283d
This tutorial assumes you have a decent knowledge of Java, and have already installed the Android SDK and Eclipse Plugin. Visit the Installing Android SDK tutorial to get the Android SDK and Eclipse plugin installed. The application built in this tutorial will demonstrate how to do various tasks in Android over making a truly productive application. The tutorial starts slow with creating a project.
Open Eclipse and go to New Project > Android Project. Enter the following information to create the project.
The base project created for Android is a hello world implementation.
Google did an excellent job creating a project layout that allows you to easily separate data from code. The res/ directory in the project stores layout, images, and application data. Localization data is also stored in this directory, but that's beyond the scope of this tutorial.
Now Open res/values/strings.xml Since the application is going to demonstrate how to use different features, change the hello string value to instruct the user to push one of the below buttons. Next add a string named button_dialog_text by clicking add then select string and press OK. A new String will appear in the list and the input fields to the right should be blank. Enter "button_dialog_text" in the name and "Show Dialog Box" in the value fields both without quotes and click the new String resource on the left side. Do the same for button_sound_text with the value "Play Sound".
At the bottom of the pane there are 2 tabs, resources and strings.xml. Click the strings.xml tag to view the raw XML of the file. Manually add a new string with a name of "button_relative_text" and a value of "Show Relative Layout". The XML tag should look like
<string name="button_update_text">Update</string> <string name="dialog_title">Dialog Box Title</string> <string name="dialog_text">Click OK or Cancel to close</string> <string name="dialog_ok">OK</string> <string name="dialog_cancel">Cancel</string> <string name="sound_file">/sdcard/moonbeam.ogg</string>