Sunday, July 12, 2015

Using SQLLite for Android

What is SQLite for Android?

It is an implementation of SQL language that is presented in all devices. It is a very simple version, but it also have a lot of features to be used.

·      First of all, you will need to add on your code the android.database.sqllite package.
·      You should implement methods that create and maintain the database and tables:



·      In apps, we interact with a SQLite database using the SQLiteOpenHelper class and the SQLiteDatabase class. SQLiteOpenHelper is like a ‘Portal’ into SQLiteDatabase, it allows you to create statements into SQLiteDatabase class.
·      We use OnCreate() method to be called by the system if the database does not exist.
·      OnUpgrade() is called when the version number changes.
·      getReadlableDatabase access database in read-only mode. So, only use this method for select statements.
·      getWritableDatabase is used for Insert and Update statements.
·      Definition for column names and table names:


·      SQLiteOpenHelper creates a subclass that overrides onCreate(), onUpgrade() and onOpen() callback methods. Here it is an implementation of SQLiteOpenHelper:

·      To access your database you just need to instantiate your DB class as below:

·      Put information/ Read / Delete and Update information on database:



I hope these help you in your android implementation. Happy coding! See you next month.

Thiago Leoncio.

Sunday, June 28, 2015

Android Coding: How to manage your Android fields using LinearLayout,TableLayout and TableRow

Hello everyone,

    Today I am going to show thru screenshots and video how to create a structure for your layout in your Android application. This will allow you to align your fields, buttons and tables.


NOTE: Please use these screenshots below with the video explanation, so you can have a better understanding on this mobile article:

1) This first picture is displaying the behavior of  LinearLayout,TableLayout and TableRow.  
2)Java code of the actions that we will be using.



3) Please watch the video with all details on this layout structure.

AndroidSoapBox by ThiagoLeoncio - Layouts


Happy coding!

I hope it helps you,
Thiago Leoncio.