Cursussen/Courses Codesnippets     Top 
B4A-JSON - Introduction


1. References
In this tutorial you can learn how to use MySQL data in a B4A app.
The information will be exchanged using JSON objects.
For this to work we can use all the help we can get. Here are some references to online tutorials:
JSON tutorial: JSON tutorial. JSON Tree tool: JSON Tree tool
Convert JSON: Convert JSON. If you want to use this type conversion then you have to update the B4A IDE to its latest version.
MySQL workbench: MySQL workbench tutorial. Download link:MySQL Workbench
PHP tutorial: PHP tutorial


2. Environments
In this tutorial you can find 2 major environments: the web server (backend) and the B4A IDE (frontend).
Web server:
For this we download and install the Uwamp tool for Windows.
When installed and started you get a local web server (Apache), a local database server (MySQL) and a programming language (PHP).
You can type the scripts in your favorite editor like Notepad++
B4A IDE:
We write code for the app in the B4A IDE. If you want to use the JSON type conversion then you have to install the latest version of the IDE.


3. App description
A B4A example that uses JSON, MySQL and PHP for lists of Thai translations.
JSON (JavaScript Object Notation) is used to get data from a MySQL database.
The MySQL database management system can run on a local or on a remote web server.
PHP scripts are used to connect to the database and run the select queries.
In B4A a JSON library is used to parse the received JSON object to a list.
Transliteration:
In the app I use a transliteration of my own using my native language (Dutch).
I write down what the Thai letter, word or sentence 'sounds like' in Dutch.
There are several transliterations for the Thai language.
Support files:
In this tutorial you can use sound files and custom true type fonts.
A sample database sql script is also included.
Download link: Files