Need Help with Dynamic Usage of Gallery view

Put problem concerning Views, Layouts and other XML-Resources (like AndroidManifest) here.

Need Help with Dynamic Usage of Gallery view

Postby northernguy69 » Wed Dec 09, 2009 8:21 pm

I'm fairly new to android development and I can't seem to figure out how to do a certain task with the Gallery view. Basically, i'm trying to get json data from a url which will provide me with an ids and a urls to images.

An example of the sample return json string would be as follows:


[{"image_id":445, "image_url":"http://www.domain.com/image1.jpg"}, {"image_id":446, "image_url":"http://www.domain.com/image2.jpg"}]



- How could i dynamically build the Gallery with the image URL's obtained from the JSON data?
- For each image in the Gallery, how can i give it the "image_id" value from the json data so that when i click on that image, i can start a new activity and pass it the necessary image_id value via intent.putExtra("image_id", "445"); ?

I appreciate any help you can provide me with!

Thanks
Al
northernguy69
Freshman
Freshman
 
Posts: 5
Joined: Wed Dec 09, 2009 8:05 pm

Top

Postby qlimax » Wed Dec 09, 2009 10:18 pm

building and parsing json strings:
http://developer.android.com/reference/ ... bject.html

loading images from the web
gallery_with_remote_images-t769.html

associate (and getting) additional informations to the view (ImageView)
Code: Select all
http://developer.android.com/reference/android/view/View.html#setTag(java.lang.Object)
http://developer.android.com/reference/android/view/View.html#getTag()


sorry... it's only a list of links. the full answer would be a great tutorial :)

bye ;)
¯`·.¸¸.><((((º>¯`·.¸¸. ><((((º>
User avatar
qlimax
Master Developer
Master Developer
 
Posts: 271
Joined: Mon Aug 31, 2009 10:54 am
Location: Swiss

Top

Return to View, Layout & Resource Problems

Who is online

Users browsing this forum: No registered users and 7 guests