View Single Post
Old September 23rd, 2012, 06:07 AM   #1 (permalink)
ro_eire
New Member
Thread Author (OP)
 
Join Date: Oct 2011
Posts: 5
 
Device(s):
Carrier: Not Provided

Thanks: 0
Thanked 0 Times in 0 Posts
Default Remote drawables in Android 4.0.3

hi, Im developing an app which is a product catalogue. Users can search for and view products (books). It's all read only and just so allow user's to view products. When the user clicks on a product, the next screen displays
- book title
- book author
- picture of front cover.

It's the picture part that I've a question about. I know one way to present drawables is to have them in the "drawable" direction in my android project and access them (in my xml file) as android:src="@drawable/name".

Only problem is that new products will be added so I can't store drawables in the APK file when I release it. I'll need to read them at runtime. I'm wondering what the best way to approach this is.

I'm thinking of upon app launch executing an AsyncTask which would call
openConnection of HttpURLConnection and would grab down all drawable (from a particular remote directory on a website) and would then store them in the sqllite db (as a blob). Each product in the db could easily be associated with it's specific drawable.

Not sure if there's a better approach to this ? or should I save them to the internal storage of the device (I know the size is an issue with this option). Or I could, when I show the product, call the Async task to present the image - i.e.get the image when the user requests it. This sounds good (in a lazy loading kinda way)..

any help would be great. I'm developing on Android 4.0.3.

Thanks - Ro
ro_eire is offline  
Reply With Quote