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

PaulMeuris

Active 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

Active 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

Active 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.
 

Xfood

Expert
Licensed User
Very kind @PaulMeuris
Thanks for sharing the project link,
I didn't mean to bother you, I've done a lot of searching here in the forum, I can't find the calendar_dialog3 library
Could you kindly pass the link to download it
Thanks you are a friend
 

PaulMeuris

Active Member
Licensed User
In the attached zip-file you can find the calendar_dialog3 library files. Unzip and copy the files to the additional libraries folder to use.
The source code is explained in the tutorial and you can also find a class version in the B4XDialog examples (caldialog).
Enjoy.
 

Attachments

  • calendar_dialog3.zip
    5.7 KB · Views: 13
Top