[Android] Better handling of connection error

Don't crash if no network connection is available.

Signed-off-by: Claudio Matsuoka <cmatsuoka@gmail.com>