mol
mol

Reputation: 19

ANDROID : Getting images from drawable using filename from database

Ok, I have this database of 750+ images and I am wondering how to view the images one by one on a page when the filename is clicked from a listview instead of having to create 750+ pages to show each. I am just starting with Android so please help with code and where to put the code etc.

Thanks in advance. AM

Upvotes: 0

Views: 259

Answers (1)

Adí
Adí

Reputation: 854

"I am wondering how to view the images one by one on a page when the filename is clicked from a listview instead of having to create 750+ pages to show each."

Ideally, you would have a MySQLiteHelper class with methods to run SQL eg. pick specific image with id

A Main Activity will have a listview showing all images in a ScrollView layout

listAdapter will have a OnClickListener to start new Activity after passing the id of the image clicked, and opening an ImageView in the new activity, which will show the image from your database.

Now go and refer Android Dev Docs to learn about SQLite, listview, scrollview, onclicklistener, imageview

Good Luck

Upvotes: 1

Related Questions