Android Question Best way to read in static-ish data and images?

Scotter

Active Member
Licensed User
I'm creating a simple app. Pretty new to B4A, though. Looking for a bit of high level advice.

I have an Excel spreadsheet with 22 rows and around 10 columns. Corresponding to those 22 rows are 22 thumbnail images (75 x 130) and 22 images (222 x 211). This data almost never changes.

My app will have a button the user presses, which will choose one of the rows of data/images based on a randomly generated number. That part is easy for me.

What I'd like advise on is just how you recommend I store this data. It's almost so little data that I could hard code it into an array variable in the app.
That said, it would be more elegant and fun to maybe save the Excel file as XML and have my app read in the data. No big deal for me.

But what about the images? How would you recommend the images being stored and accessed? Seems inelegent to put a bunch of invisible ImageView controls on a view and use code to turn whichever one visible?

Thanks for any advice and ideas you all can offer! Meanwhile, I'll be reading the manual and experimenting.
 

aidymp

Well-Known Member
Licensed User
Longtime User
Hi, I highly recommend you do not store the data in your app. I did this for a few years, it makes even a simple add to the data very hard! Then you have to recompile, and redistribute the app. I was stuck but this group is very helpful I now have all my data in an online database adding, removing and editing the data is a breeze, and the app hardly ever needs updating. The app also went from around 4000 lines of code to round 2000!

Thanks

Aidy
 
Upvote 0
Top