简体   繁体   English

从URL下载图像并将其保存在我的应用程序的drawable-hdpi文件夹中

[英]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.

相关问题 以hdpi分辨率为图像命名drawable-hdpi重要吗? - is it important to name drawable-hdpi for image in hdpi resolution? 我应该在drawable和drawable-hdpi文件夹中保留图像吗? - Should I keep images in both drawable and drawable-hdpi folder? 如果我将所有图像留在 drawable-hdpi 文件夹中会发生什么? - What happens if I leave all of my images in the drawable-hdpi folder? 如何同时使用可绘制和可绘制hdpi中的资源? - how to use resources from drawable and drawable-hdpi at the same time? Android 资源问题:如何获取 res/drawable-hdpi 文件夹的标识符? - Android resources problem: How to getIdentifier for a res/drawable-hdpi folder? Android:无法将图像粘贴到Eclipse中的drawable-hdpi文件夹中 - Android: Cannot paste images to drawable-hdpi folder in eclipse drawable-hdpi文件夹中custom.xml上的Android FileNotFound异常 - Android FileNotFound Exception on custom.xml in the drawable-hdpi folder 单击按钮时,从库中的res / drawable-hdpi打开图像 - Open image from res/drawable-hdpi in gallery when clicking a button WebView如何获取本地res \\ drawable-hdpi图像路径 - WebView how to get local res\drawable-hdpi image path Android:如何在drawable-hdpi中放置具有不同分辨率的相同图像 - Android: how to place same image with different resoultion in drawable-hdpi
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM