[英]Download image from URL and save it in my app's drawable-hdpi folder
I need to download an image from url and save it in the app's drawable-hdpi
folder and then show it in ImageView. 我需要从url下载图像并将其保存在应用程序的
drawable-hdpi
文件夹中,然后在ImageView中显示它。 How I can do it? 我该怎么办?
I tried using this and this code but it's not a good solution for me because this code saves on the SDCard. 我尝试使用此代码和此代码,但这对我来说不是一个好的解决方案,因为此代码保存在SDCard中。
You cannot save in the app package. 您无法保存在应用包中。 You only have these options:
您只有以下选项:
Your data storage options are the following:
您的数据存储选项如下:
Shared Preferences Store private primitive data in key-value pairs.
共享首选项将私有原始数据存储在键值对中。 Internal Storage Store private data on the device memory.
内部存储将私有数据存储在设备内存中。 External Storage Store public data on the shared external storage.
外部存储将公共数据存储在共享的外部存储中。 SQLite Databases Store structured data in a private database.
SQLite数据库将结构化数据存储在专用数据库中。 Network Connection Store data on the web with your own network server.
网络连接使用您自己的网络服务器将数据存储在Web上。
more information: http://developer.android.com/guide/topics/data/data-storage.html 更多信息: http : //developer.android.com/guide/topics/data/data-storage.html
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.