Android Question I need examples

JohnJ

Member
Licensed User
Longtime User
There are examples included in the B4A download as well as in the forum. Just search B4A sqlite, you can also look at the b4j examples
 
Upvote 0

emexes

Expert
Licensed User
examples of code

https://x.com/i/grok/share/ziKgSIRMGiPuxWD44YgfwUA45

does a scarily suprisingly good job.

My side of the conversation, excluding pleasantries, was:

I am using the B4A programming language. It is a dialect of BASIC for Android. I have some questions about using it with Sqlite.
How do I create a database with two tables?

The first table is a list of names and addresses, with columns for: first name, last name, street address line 1, street address line 2, suburb, state, postcode and country, where all those columns are strings, and also columns for latitude and longitude, where those two columns are numbers (decimal degrees, not degrees-minutes-seconds).

The second table is a list of suburbs, with columns for: suburb name, state and postcode (all strings) and latitude and longitude (numeric).
In B4A, when extending a single long program line over multiple text lines, please add a space and an underscore at the end of each line that continues on the next line.
How do I add a suburb to the second table, eg:
suburb name is Kilsyth
state is VIC
postcode is 3137
latitude and longitude are -37.802545 and 145.315868
 
Last edited:
Upvote 0

MicroDrie

Well-Known Member
Licensed User
Longtime User
How do I create a database with two tables?

The first table is a list of names and addresses, with columns for: first name, last name, street address line 1, street address line 2, suburb, state, postcode and country, where all those columns are strings, and also columns for latitude and longitude, where those two columns are numbers (decimal degrees, not degrees-minutes-seconds).

The second table is a list of suburbs, with columns for: suburb name, state and postcode (all strings) and latitude and longitude (numeric).
Use (with or without installing it) free portable apps and add FREE DB Browser for SQLite. Create the Db and tables and look to the SQLiite create table query under Database Structure tab.

In B4A, when extending a single long program line over multiple text lines, please add a space and an underscore at the end of each line that continues on the next line.
Use smart string like $"${variableName} _
next line texts "$


How do I add a suburb to the second table, eg:
suburb name is Kilsyth
state is VIC
postcode is 3137
latitude and longitude are -37.802545 and 145.315868
Play with FREE DB Browser for SQLite under 'Execute SQL' tab and look to results under Browse Data tab and convert SQLite queries with safe parameters.
 
Upvote 0

emexes

Expert
Licensed User

I tried redoing the Grok conversation from:


to be more to your style:

https://x.com/i/grok/share/QMWl8hFbXjfJyhKUsTwitkiTI

but in the process, I might have learned something new (that "Array(" is possibly not same as "Array As Object(")

Then again, AI isn't always correct. 🙄

But on a positive note, I've never seen it afraid to admit when it's wrong. Unlike us "organic twits". 🤣
 
Upvote 0
Top