android - View images from a website in app? -


in android app have see images website. on website images sorted in categories , can voted. app should see (when select category) pictures category , votes each picture.

i have never done , have no idea how start this. can give me idea? idea welcome..

thanks in advance.

first, should try retrieve list of images have display. can accomplished retrieving page of wanted category on website (see http://developer.android.com/reference/org/apache/http/client/methods/httpget.html) , parsing (you can use may ways that, let choose 1 want apply).

the next step, in opinion, create custom adapter in order keep data. so, create class extends baseadapter, , manage make contain list of drawable (arraylist<drawable>) , list of urls (arraylist<string>). also, provide method allows add url adapter.

when url added, create new thread (or asynctask) retrieve image (in order use httpget here too) , create drawable (using drawable.createfromstream). once download done, notify handler add url arraylist<string>, , drawable have created in thread arraylist<drawable>. don't forget synchronization if use method.

once adapter complete, use method want display content. could, example, use gallery view (see http://developer.android.com/guide/tutorials/views/hello-gallery.html).


Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

visual c++ - Using relative values in array sorting ( asm ) -