简体   繁体   中英

Storing image from url into our project in android

我正在一个涉及自定义谷歌地图标记的项目。自定义标记在服务器上有图像,并且我正在使用Android Query调用Web URL。每次加载应用程序时都会从Web加载此标记。我想存储图像到drawable文件夹,但这是不可能的。是否有一种方法可以保存图像一次,这样我就不必在每次运行该应用程序时加载图像?

Why not download the markers from you browser and store it in your drawable or asset folder? That way you don't need to load it from the internet. I'm sure those markers are just small i size maybe could take up 50-100kb ea, or even lesser.

you can store ur bitmap image in resource folder and then call MarkerOption class..

MarkerOption options=new MarkerOption();
options.icon(BitmapDescriptorFactory.fromBitmap(Yourimage));

refer to https://developers.google.com/maps/documentation/android/marker#customize_the_marker_image

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM