I catch one image from my web service and show this image in my all activity. but in this way i call the service in all activity, but now i want to call web-service one time and catch the image and want to store this image in draw-able, and use this image in all other layout. how can i do.. thanks for you answer.
Asked
Active
Viewed 458 times
2 Answers
1
When you want to "save" something in Android, you want to persist data on client-side.
Android has different mechanismes for saving things:
- Shared Preferences
- Internal/external file I/O
- Database
Since you want to save an image you cannot use sharedPreferences, file I/O could be a possible but i would take a look at using SQLLite Database and BLOB-datatype for this, an example can be found here
-
any other way without database ? – Mohit Raval Nov 01 '12 at 10:04
1
You Should Follow This Link .
How to store images in sqlite database on click event of button?
In that you have to change in DownloadFile() . you have to write your image download code in that function and use for more .

Community
- 1
- 1

Chintan Khetiya
- 15,962
- 9
- 47
- 85
-
-
Hello Mohit you can store in your sd card . can you valid for that > – Chintan Khetiya Nov 01 '12 at 10:05
-
hey Chintan thanks for answer, i want something like that. i want image store in my apk is it possible ? – Mohit Raval Nov 01 '12 at 10:10
-
mohit if you want to store in apk then you have to store in databse. otherwise you can store in sd card and using path you can use it. – Chintan Khetiya Nov 01 '12 at 10:16
-
-
Thanks Mohit, Now you have to just write your folder name in DownloadFile() and image name which you want to store . its very easy for you. – Chintan Khetiya Nov 01 '12 at 10:55
-
ok.. thanks. i will do that. i am from Ahmedabad belong from Junagadh. – Mohit Raval Nov 01 '12 at 11:04
-