Android Question Download settings on app start!

aidymp

Well-Known Member
Licensed User
Longtime User
Hi for quite a while now i have been hardcoding all my urls ect into my app, and if something changes I have to update the app!

So the information I have to download

A package name (there are about 7 packages)

I currently add them to a spinner with

B4X:
Spinner2.Add ("Install Setup Number 1")

I now download a file and read it with this

B4X:
Dim tmplist As List
tmplist=(File.Readlist(File.DirDefaultExternal , "/Download/packagelist"))
Spinner2.AddAll(tmplist)
Log("added "&tmplist)
End Sub

The Problem I have now is that linked to the file i also have to match it with a URL and and add some other data.

So if spinner2 is set to Install Setup Number 6

Package number 6's URL will be "http://mysite.com/download/pack6"

I see I can do this with a map file as in "Install Setup Number 1" , "http://mysite.com/download/pack1"

but i also need to have 2 more bits of info associated with the pack!

A location to an image file & a location to a description file! So looking at it I would have to have a text file containing, The Package names! and then 3 map files? It looks to me that I am OVER COMPLICATING this!

Can anyone suggest a simpler way?

Ideally a file that contained something like this

title, url, image url, description!

Install Package 1 , http://mysite.com/download/pack1 , http://mysite.com/download/pack1.jpg , This is package 1 is great, but package 2 is better


Thanks Aidy
 

Peter Simpson

Expert
Licensed User
Longtime User
Why don't you use something as simple as a CSV file loaded directly from your online server on app startup and then load the file into a list, then maniplate the lost with Regex.Split.

pack1, pack1.jpg, xxx1, yyy1
pack2, pack2jpg, xxx12, yyy2
pack3, pack3.jpg, xxx3, yyy3
pack4, pack4.jpg, xxx4, yyy4
pack5, pack5.jpg, xxx5, yyy5
pack6, pack6.jpg, xxx6, yyy6

This is just a start, obviously one of the genius boffins on here will come up with a better simpler solution. There are lots of ways for you to get to the end solution that you are after.
 
Upvote 0

aidymp

Well-Known Member
Licensed User
Longtime User
yeah i was looking at regex, but to be honest, its over my head. i will look into it

Thanks

Aidy
 
Upvote 0
Top