- This repo is built to help you understand basic use of some Android APIs.
- Need to have basic knowledge of Java and Android first before checking the content.
- It includes the use of
- Fragment (using Tab to switch between fragments)
- SQLite (create, retrieve, update, delete)
- AsyncTask
App theme is generated by Android Action Bar Style Generator.
Make sure to update your minSdkVerion with 14 in AndroidManifest.xml
Use tabs
in ActionBar
to view different Fragment.
Here we use 2 tabs called '1st' and '2nd' respectively.
Fragment used the following files:
- src/main/activity/MainActivity.java
- src/main/activity/FirstFragment.java
- src/main/activity/SecondFragment.java
- res/layout/one.xml
- res/layout/two.xml
You can find TabListener(used for Tab in ActionBar) here.
See document here.
- Input a 'name' and an 'email' to CREATE a data.
- Input a 'name' to search the data you want to UPDATE.
Then input another 'name' which you want to update with. - Input a 'name' which you want to DELETE.
- It will RETRIEVE all data and display below.
SQLite used the following files:
- src/main/activity/SqliteActivity.java
- src/main/activity/DBHelper.java
- res/layout/sqlite.xml
See document here.
Running through 4 methods used in AsyncTask.
Each will write some text in Log and Toast (except for doInBackground method).
When the method is done and success without exception, TextView will appear with the text '(method name) finished.'.
AsyncTask used the following files:
- src/main/activity/AsyncTaskActivity.java
- res/layout/asynctask.xml
See document here