1

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.

Mohit Raval
  • 440
  • 1
  • 6
  • 19

2 Answers2

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

Community
  • 1
  • 1
Tobrun
  • 18,291
  • 10
  • 66
  • 81
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