Easy To Use Database: Is It Needed??

margret

Well-Known Member
Licensed User
Longtime User
UPDATE - The DataBase V1.0 Functions & Samples are Complete, see link below! - August 1st, 2011 12:21 AM

http://www.b4x.com/forum/basic4android-getting-started-tutorials/10553-new-easy-use-database-functions-v1-0-samples.html

Hello All,

No extra libraries are needed, just the CORE B4A library. I have tested some of the functions on my NookColor with up to 2500 records. With 2500 records, it moves very fast and searches are instant. All data stored will be in string format, however, you will be able to store links to images, web pages, etc. I wrote and posted the Strings functions here: http://www.b4x.com/forum/basic4android-getting-started-tutorials/10365-string-functions.html, and these functions will work in a similar way.

The functions and sample code are now attached. Some benefits may be that it is easier for new users to learn and less overhead on the processor. You don't have to learn SQL, etc. and the code required for each function is much less. Each device will have its limit on the number of records you can have before the system slows down, based on memory and processor. This will do just fine for most apps and contacts style programs. If you need to save images, objects, etc. directly into the database this will not work for you. You can have as many fields of any size as B4A and Android will support. It will also include the s.GenerateRecords(1000) functions, so you can populate the database with hundreds or thousands of records to test how the app performs under max load. Also, the database handles the pointer for you, it also handles BOF, EOF and no records in the database. It makes your coding job much easier!

If you have problems or questions, please post and I will try to help. Hope you find it useful!

___________________________________________________________________
db.AddRecord()

db.DeleteRecord()

db.Exist()

db.FindRecord()

db.GenerateRecords()

db.GetRecord()

db.GetStructure()

db.ListRecords()

db.UpdateRecord()

db.FirstRecord()

db.LastRecord()

db.PreviousRecord()

db.NextRecord()
___________________________________________________________________


Thanks,

Margret
 
Last edited:

kickaha

Well-Known Member
Licensed User
Longtime User
Sounds like a good addition to B4A, and it is always good to see people contributing to this fine language.
 
Upvote 0

Smee

Well-Known Member
Licensed User
Longtime User
Plus another 1 to that Margaret. I use database functions a lot also in sql but i am not yet an android programmer but very soon i probably will be.

Thanks in advance
 
Upvote 0

Rui

Member
Licensed User
Longtime User
Yes please,

How about db.firstrecord, db.lastrecord, db.previousrecord, db.nextrecord and a function to order the database based on a field
 
Upvote 0

Widget

Well-Known Member
Licensed User
Longtime User
Margret,
Sounds like a good alternative to Sqlite for small tables.

Would:

db.Sort("LastName,FirstName")

be possible?

I'm thinking maybe your database could be used to fill a Spinner or ListView with data.

Widget
 
Upvote 0
Cookies are required to use this site. You must accept them to continue using the site. Learn more…