Published on Dec 09,2015
1.5K Views
Email Post

 

The Application I have chosen for my android project is actually a data capture application for a Photo Marketing Company in UK. The Application collects the data locally using SQLite database. Then I can export it to a csv file and upload to a MySql Database.

If you are not clear with the basic concepts of Android, please attend this Android Course.

About Me :

I’m Michael Alvares a freelance web developer from Goa. I completed my Masters in Computer Management from Pune University in 2009 and before that my Bachelors of Computer Applications from Goa University. My main area of development is PHP. However of late I have received a number of requests for android apps.

The widgets used are:

  • listview    => Used to display a list of entered data
  • tabhost    => Used to provide tables one for adding and the other for listing
  • textview   => To display non editable text in listview
  • edittext    => Accept input from user.
  • button      => To perform actions when clicked.

As there is a database to be used, I created a database handler to Create, update, add, edit and get data from database.
I also created a class called Client to handle adding of data and to extract specific data from the returned object from the database.

I had to create an adapter to display the data in list view. So I created a simple adapter using textview to do the same.

Activities used in this Android Project

  • MainActivity

Initialize the tab host widget and assign content to the tabs.

  • AddActivity

It is used to add a client. It is called in a tab host ie it is set as content for the first tab. There are two functions apart from the onCreate

  1. validEmail: used to validate the email address. I have used the inbuilt patterns to check the format
  2. addRec: used to collect data from the edittext. Validate it and then add it to a database.
  • EditActivity

It is used to edit a client. It is called independent of the tabhost. It has an integer parameter sent to it via an intent using intent.putextra(bundle.putint(“key”,”val”)).

Using the integer parameter, it gets the vales form the database and displays it in the edittext. It also has two functions

  1. validEmail: used to validate the email address. I have used the inbuilt patterns to check the format
  2. editRec: used to collect data from the edittext. Validate it and then edit the record in the database.
  • ListActivity

It is used to list all clients from the database. It is called in a tab host ie it is set as content for the second tab. It makes use of list view with an adapter to display the data. Onclick of the list item, it opens the record for editing. There is also a menu item with a function that calls the exportactivity.

  • ExportActivity

Retrieves the data from the database, formats it in a csv format, and saves it to a csv file on the sd-card.

Data Capture App | Android Project

[dl url=”#” class=’eModal eModal-19′ title=”Download Code” desc=”” type=”” align=”” for=”download”]

Happy Learning!

You may also like these related posts:

About Author
Gaurav Shankhdhar
Published on Dec 09,2015

Share on

Browse Categories

Comments
5 Comments