Draagon Draagon - 1 year ago 88
Android Question

Direct internet connection on Android Wear?

I tried to build an app showing some pictures from the internet.

I used a function, which works great on my Phone (Galaxy S3 - Android 4.3) but on the watch i get a


The code (works on phone):

private class DownloadImageTask extends AsyncTask<String, Void, Bitmap> {
ImageView bmImage;

public DownloadImageTask(ImageView bmImage) {
this.bmImage = bmImage;

protected Bitmap doInBackground(String... urls) {
String urldisplay = urls[0];
Bitmap mIcon11 = null;
try {
InputStream in = new java.net.URL(urldisplay).openStream();
mIcon11 = BitmapFactory.decodeStream(in);
} catch (Exception e) {
//Log.e("Error", e.getMessage());
return mIcon11;

protected void onPostExecute(Bitmap result) {

Other functions throw a

The watch is paired and online as i can use voice commands and search the web etc.

So the question: Can i access the web directly from Android Wear or do need to handle all these tasks on my phone? Or is there something wrong with my setup?

Answer Source

Android Wear Devices have no direct access to the internet. If you want to access the web, you should do so using your companion app. You can use the Data Layer API to transfer data back and forth between the wearable and the handheld. The Data Layer API has built-in support for transferring assets (mostly images, but basically you transfer anything other binary data).

EDIT: As of Android Wear 2.0, it is possible to directly access the internet using regular network APIs. See the Android Wear 2.0 Developer Preview documentation for details. Android Wear 2.0 has not yet been released yet, refer to the Developer Preview Program Overview for a timeline.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download