0

I’m newbie here, and now I’m develop some app, I’m confuse about how to retrieve image and text in custom Listview and clickable like this Custom Listview Text and Image and Clickable My question is, How to build Custom Listview like that and clickable every list into other activity? Please someone help me and ill appreciate for your hard work :) and i already have some db and I want to import and uses on android studio.

Any help would be appreciated.

Prabhat Sinha
  • 1,500
  • 20
  • 32
F_X
  • 491
  • 2
  • 7
  • 16
  • No need for activity for every click see this link http://www.androidhive.info/2014/07/android-custom-listview-with-image-and-text-using-volley/ – Arpit Patel Apr 12 '16 at 05:14
  • @ArpitPatel hi arpit thanks for answer, if i want using offline database , what is best? SQLite or JSON? because i have like an hundred images with some names – F_X Apr 12 '16 at 05:30
  • see my answer and if it is useful then appreciate with vote :D – Arpit Patel Apr 12 '16 at 05:38

2 Answers2

0
  1. To store data into local db (sqlite), you need to do some implementation, here's an effective guide of it: Saving Data in SQL Databases
  2. Put your images into drawables , store their Resource Ids into database and get them in Listview's Custom Adapter
  3. For Images async loading, try Lazy List or Lazy Adapter so that you can have a smooth scrolling for list. For it, use the above URL mentioned by @Dixit
Hassan Jamil
  • 951
  • 1
  • 13
  • 33
  • my problem is i have hundred images and size more than 1mb, – F_X Apr 12 '16 at 05:37
  • @Raj No problem you can have drawables for size greater than 1mb, this should not be an issue. – Hassan Jamil Apr 12 '16 at 05:42
  • Actually im follow this site http://www.javahelps.com/2015/04/import-and-use-external-database-in.html but idk how to retrieve images could you help me for retrieve images? – F_X Apr 12 '16 at 06:09
  • You want to retrieve images from server or you are having images locally and want to retrieve them on the basis of your queries to the database? – Hassan Jamil Apr 12 '16 at 10:29
  • You can put all your images into drawable and in sqlite db you can store their drawable resource ids (You can retrieve their resource ids as e.g. R.drawable.image1). – Hassan Jamil Apr 12 '16 at 14:08
0

@Raj What is use for JSON and SQLite.

JSON When you are getting data from server you need to use json.

SQLite When you don't need server data so you can use SQLite

When you have a lots of data i would prefer JSON.

and use this link for getting data from server. http://www.androidhive.info/2014/07/android-custom-listview-with-image-and-text-using-volley/

Arpit Patel
  • 7,212
  • 5
  • 56
  • 67
  • Yes, im prefer using SQLite because i dont need server and internet access :D, but how to implement SQLite on your link give it on me ? can you help me? – F_X Apr 12 '16 at 05:40
  • see another androidhive link with good explanation http://www.androidhive.info/2011/11/android-sqlite-database-tutorial/ – Arpit Patel Apr 12 '16 at 05:41
  • And this link show store image in SQLite http://stackoverflow.com/questions/11790104/how-to-storebitmap-image-and-retrieve-image-from-sqlite-database-in-android – Arpit Patel Apr 12 '16 at 05:46
  • Actually im follow this site http://www.javahelps.com/2015/04/import-and-use-external-database-in.html but idk how to retrieve images could you help me for retrieve images? – F_X Apr 12 '16 at 06:09
  • are you store this image in SQLite?? – Arpit Patel Apr 12 '16 at 06:15
  • see it's next post for the store and retrieve images http://www.javahelps.com/2016/04/import-database-with-images-in-android.html – Arpit Patel Apr 12 '16 at 06:17
  • yes i want to store all image on SQLite, or you have another ways to do that? because all i need is to shown an image with text in listview from offline database – F_X Apr 12 '16 at 06:17
  • Yes im follow that too, exactly how to convert spinner into listview? – F_X Apr 12 '16 at 06:19
  • ya you have to fatch all images name and set into you listview adapter – Arpit Patel Apr 12 '16 at 06:23
  • i have low rep cant give more votes, yeah , my problem is i cant retrieve images in the same list – F_X Apr 12 '16 at 06:30
  • see this link http://www.androidhub4you.com/2012/09/hello-friends-today-i-am-going-to-share.html – Arpit Patel Apr 12 '16 at 06:37