Android Development Tutorial: Nikhil Yadav CSE40816/60816 - Pervasive Health Fall 2011
Android Development Tutorial: Nikhil Yadav CSE40816/60816 - Pervasive Health Fall 2011
Nikhil Yadav
CSE40816/60816 - Pervasive Health
Fall 2011
Outline
Setting up the Android Development
Environment (Windows)
Starters Android “Hello World” empty project
Android project components
Example: Tabbed application project
Accessing Sensors on an Android Device:
GPS, accelerometers and the Google API
Database connections – Local SQLite and
remote access
Android Development Environment
Download the latest JDK (Java distribution)
www.eclipse.org/downloads/
Install the Android SDK starter package from:
http://developer.android.com/sdk/index.html
In Eclipse, install the ADT (Android Developer
Tools) plugin:
http://developer.android.com/sdk/eclipse-adt.html
Instructions on setting up the SDK and
development Environment can be found on:
http://developer.android.com/sdk/installing.html
The Android SDK starter package
Not the full development environment, includes
the core SDK tools
Keep track of where you have downloaded this
it is required for the ADT plugin setup, e.g.
C:\Program Files\android-sdk-windows\platform-
tools>
Useful for “adb” commands
The ADT plugin
Gives access to Android development tools
from within the Eclipse IDE
Automates the process of building a new
Android project by setting up all the basic files
needed for development
Allows code signing of your app so it can be
distributed
Installing the ADT plugin
(Link: http://developer.android.com/sdk/eclipse-adt.html#installing)
To simplify ADT setup, it is recommend installing the Android SDK prior to installing ADT
3.For the SDK Location in the main panel, click Browse...and locate your
downloaded SDK directory (e.g. C:\Program Files\android-sdk-windows\)
Update the system’s PATH variable to recognize two folders inside your
android-sdk-winwows. The first is: tools and the second is platform-
tools.
1.Windows > Start > Control Panel > System > Advanced > Environment
Variables > System Variables > PATH > Edit
2.Add references to the sub-folders mentioned above. In this example:
c:\android-sdk-windows\tools;C:\android-sdk-windows\platform-tools;
3.OK
Make sure Java and Eclipse Environments and path variables are setup
correctly:
http://www.hometutorials.com/google-android.html
Starters: “Hello World”
Android Project Components
Once you complete the New Project Wizard, ADT creates the following
folders and files in your new project:
•src/ Includes your stub Activity Java file. All other Java files for your
application go here.
•gen/ This contains the Java files generated by ADT, such as your
R.java file and interfaces created from AIDL files.
http://www.helloandroid.com/tutorials/connecting-
mysql-database
http://developer.android.com/reference/android/d
atabase/sqlite/SQLiteDatabase.html
Questions?
http://developer.android.com/index.html