Like last week, I attended the session on Developing Android applications in Java by Creative Techs and O’Reilly and here are my notes which I took during the session.
Demo Application
In this week’s session, he created a sample task manager app which can be used for maintaining list of things to track. This app was created using Android 1.6 with Google API support. You can download the source code of this demo app below.
The sample app will have two activities. One will have a simple data entry form which can be used to add tasks and the other to view tasks which were entered. Check the screenshots below to see how the sample app looks like.
Layouts
Tony (the instructor) briefly explained about the different types of layouts and for the sample apps he used Relative Layout. You can read more about the relative layout from the android documentation.
The major pain point in using Relative layout is that, the controls should be specified in the order in which they are referenced and not in the order in which they will be displayed.
EditText control
EditText control is an editable control which can be used to get user input. It is similar to the HTML textbox or the Java Swing JTextField.
You can read more about EditText control from android documentation.
Sharing data between views
An application can have multiple activities (views) and to share data between these multiple activities, the android framework provides a class called Application. This Application class can be accessed from all the activities of the app by calling the getApplication()
of the Activity class. Tony explained this about this class and also used it in the demo app to store and retrieve tasks from multiple activities.
You can find this class in the TaskManagerApplication.java
in the sample app. You can download the source code of this demo app below.
Safe cancelling
Tony also explained about how to listen to text changes and make sure the user is not moving away from the activity when there are unsaved work.
You can check the cancel()
method in AddTaskActivity
class, where we will be showing an alert box (see screenshot) using the built in AlertDialog
, whenever the user clicks the cancel button without saving the task that he has entered.
You can read about the AlertDialog class in the android documentation.
Source code
I have uploaded source code for yesterday’s session in github and you can download it from there. I am also working in this week’s homework and will be posting the explanation and source code once I am done.
You can also subscribe to my blog’s RSS feed or follow me in Twitter to receive updates about my notes for the next sessions.
I missed last training due to European Champions League football match…Thank you for allowing me to follow what’s going on..great concise an understandable
@Gerard,
Nice to know that my notes were useful to you. Tune in for next week too 😉
Thanks for the study notes…It was very helpful for me…!!!
I have also been working on this project and I am submitting this as my major project in college with some minor changes.
But I am not good at technical writing so I couldn’t prepare its project report.
So Does anyone have the project report for this Task Manager App for Android?
If anyone have, please let me know… or mail me at iamharish15@gmail.com
Urgently!!!
same thing is with……… i also need documentation to submit in college………. hv u got it then help me……i need it urgent……….major project……..android task manager………..
mail me at bna.rajput@gmail .com
mail to me: doduytu@gmail.com
thanks u so much!!!
I want R.java file of it
A very nice about android app development in java. a very useful information to every Android developers. i will definitely share this blog to my developers.