How to download an image on Android wear?

本小妞迷上赌 提交于 2019-12-12 04:53:08

问题


I have an ArrayList of Serialization objects on my handheld.

I found a solution to send it to my wearable device.

Can I send custom objects to Android Wear?

In my Object I have the URL of an image and in my handheld I am using Picasso to download the image from the URL (es in a ImageView).

Can I download the image in the wearable? (I think no).

Should I download all the images of the ArrayList in the handheld and send it putting them as assets in a DataMap?


回答1:


You can't download images directly from the Wear as there's no direct internet access.

However you're on the right path by downloading images on mobile (e.g. using Picasso), then transferring them to the Wear via an Asset.

There's a tutorial with all the code required on how to send an image using an Asset in the Android training section: https://developer.android.com/training/wearables/data-layer/assets.html



来源:https://stackoverflow.com/questions/26610636/how-to-download-an-image-on-android-wear

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!