B4A-budget app tutorial using B4X pages, a tabhost, a SQLite database, a CLVDragger class and a calendar dialog library class.

PaulMeuris

Member
Licensed User
In this step-by-step guide you can build a budget app.
You will be using code from the previous tutorials (B4A-lists and B4A-calendar).
A database class will be set up to use SQL queries to add, change or remove records from database tables.
You will also learn how to use 'prepared statements' to prevent SQL-injection.
The app uses dialog views for the database changes and for the selection of a date.
Check it out via this link: B4A-budget
Happy coding!
tut3_007_08.png
tut3_007_09.png
 
Last edited:

Xfood

Expert
Licensed User
congratulations, nice app, and for a while I had in mind a similar app, so simple, and very useful
 

PaulMeuris

Member
Licensed User
congratulations, nice app, and for a while I had in mind a similar app, so simple, and very useful
Thank you for the kind words, Xfood.
Did you implement the assignment at the end of the tutorial?
Greetings,
Paul
 

LucaMs

Expert
Licensed User
Longtime User
Thanks, Paul, for those great tutorials.

If you don't provide the source project as well, @Xfood may feel bad until next Christmas (at the very least) 😁

We know him well, he is a collector of source projects (and he knows we joke about it).
 

PaulMeuris

Member
Licensed User
EDIT: there was an issue with the checking of the start date and end date when the user selects a date in db_dialog layout.
Only the default values were taken and not the settings from the database table settings!
At the end of the section wrapping up - 1. functionalities check I have put the extra code to fill the strstartticks and strendticks variables from the database table settings.
Have a look and you will understand.
Do you have any more questions? Start a new thread in the forum and I will be glad to look at them.
Happy coding!
Paul
 

aeric

Expert
Licensed User
Longtime User
there was an issue with the checking of the start date and end date
I am also having some trouble with the ticks in sqlite recently and quite mess up. We need to be careful when using B4X DateTime.Now and the SQLite localtime/unixepoch. The problem become worse when I upload my data to a server having UTC+0 while my local timezone is UTC or GMT +8.
I come up with a way by setting a DEFAULT value in SQLite table for created_date field with (strftime('%s') * 1000) as INTEGER value. For the server, I need to add 8 hours to display the time following my local timezone since the VPS doesn't allow me to change the MySQL timezone.
 
Top