Android Question I’m new to Basic4Android but have programmed VB6. I am converting VB to android. In my VB programs I

Ray Swales

New Member
Licensed User
Longtime User
I’m new to Basic4Android but have programmed VB6. I am converting VB to android. In my VB programs I have built up a great deal of data in text files (I have not used a database). I am contemplating using SQLite to hold the data. Please advise me if there is a set of SQLite commands which will allow me to read the text file data into an SQLite database for the conversion.
 

nwhitfield

Active Member
Licensed User
Longtime User
A lot will depend on how (if at all) the text files are structured, and what sort of information they contain. In some situations, you might find it useful to take the files onto the PC first and use either a text editor, or something like Excel to rearrange the format. If, for instance, it's one name/value entry per line (or can be arranged that way), then the File.ReadMap command will easily turn the text file into a Map in B4A, and you can then work through that adding entries to a database.

If the data is more of a multi-column format, then you might want to turn it into a CSV file (if it isn't already), and then you can either use the StringUtils library to load the CSV into a B4A list (an example here http://www.b4x.com/android/forum/threads/best-way-to-import-csv-file-in-sqlite-db.34382/ ) or make the database on your desktop using an SQLite tool, and simply include it as an asset with the project.

The choice for the latter will depend on what you really mean by the data built up - is this data that you, personally, have built up, so is entirely in your possession, in which case you can probably do things faster and easier on the PC. Or is it data that users of your app have built up themselves, in which case it may be less trouble to code your app to do the conversion for them, so it's a painless experience for each one.
 
Upvote 0

Ray Swales

New Member
Licensed User
Longtime User
Thanks nwhitfield your answer has given me lots to work on. I develop a series of packages for student pilots which present Mock Exams in multiple choice answer format. The data I’m talking about is; questions, possible answers, and answer explanations along with the peripheral information specifying which answers are correct etc. I have developed, captured and encrypted the complete data set and supply it to my users in a structured ‘folder/sub folder/sub folder/etc.’ type format that sits on the C: drive accessible to my VB6 package.

Student pilots can download and pay for a NPL, PPL, CPL, or ATPL versions from my website www.swales.co.za (South Africa). The packages prepare student pilots for their final CAA Pilot exams. I now want to supply them for phones and tablets for which there is a great demand.
 
Upvote 0

RVP

Active Member
Licensed User
Longtime User
Since you know VB6, and it can work with ODBC, it would probably be easiest to simply write a program in VB6 that extracts the data out of your current text files, and pushes it into an sqlLite database on your PC. You can then include that database in your B4A app in the files folder.. I use SQL Lite Expert for designing and maintain the databases I use with Apps
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…