Your SlideShare is downloading. ×
0
Set up Android Development Environment
Set up Android Development Environment
Set up Android Development Environment
Set up Android Development Environment
Set up Android Development Environment
Set up Android Development Environment
Set up Android Development Environment
Set up Android Development Environment
Set up Android Development Environment
Set up Android Development Environment
Set up Android Development Environment
Set up Android Development Environment
Set up Android Development Environment
Set up Android Development Environment
Set up Android Development Environment
Set up Android Development Environment
Set up Android Development Environment
Set up Android Development Environment
Set up Android Development Environment
Set up Android Development Environment
Set up Android Development Environment
Set up Android Development Environment
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Set up Android Development Environment

1,107

Published on

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total Views
1,107
On Slideshare
0
From Embeds
0
Number of Embeds
0
Actions
Shares
0
Downloads
68
Comments
0
Likes
0
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. CS241001 Android Lab 2009.11.24
  • 2. <ul><li>Website </li></ul><ul><ul><ul><li>http://developer.android.com/intl/zh-TW/index.html </li></ul></ul></ul><ul><li>Android API </li></ul><ul><ul><li>http://developer.android.com/intl/zh-TW/reference/packages.html </li></ul></ul>
  • 3. <ul><li>Supported Operating Systems </li></ul><ul><ul><li>Windows XP (32-bit) or Vista (32- or 64-bit) </li></ul></ul><ul><ul><li>Mac OS X 10.4.8 or later (x86 only) </li></ul></ul><ul><ul><li>Linux (tested on Linux Ubuntu Dapper Drake) </li></ul></ul><ul><li>To get started, you’ll need to download and install the following Eclipse IDE </li></ul><ul><ul><ul><li>Eclipse 3.4 (Ganymede), 3.5(Galileo) </li></ul></ul></ul><ul><ul><ul><ul><li>Recommended Eclipse IDE packages: Eclipse IDE for Java EE Developers, Eclipse IDE for Java Developers, Eclipse for RCP/Plug-in Developers </li></ul></ul></ul></ul><ul><ul><ul><ul><li>Eclipse JDT plugin (included in most Eclipse IDE packages) </li></ul></ul></ul></ul><ul><ul><ul><li>JDK 5 or JDK 6 (JRE alone is not sufficient) </li></ul></ul></ul><ul><ul><ul><li>Android Development Tools plugin (optional) </li></ul></ul></ul>
  • 4. <ul><li>Download the latest JDK from Sun at http://java.sun.com/javase/downloads/index.jsp </li></ul><ul><li>After installing JDK , remember to modify environment parameters “Path” </li></ul><ul><ul><li>C:Programming FilesJavajdk1.6.0_16in </li></ul></ul><ul><ul><li>C:Programming FilesJavajre6in </li></ul></ul>
  • 5. &nbsp;
  • 6. <ul><li>Download Eclipse at http://www.eclipse.org/downloads/ </li></ul><ul><ul><li>Eclipse 3.4 (Ganymede), 3.5(Galileo) </li></ul></ul><ul><li>Uncompress the download file </li></ul>
  • 7. <ul><li>Open Ecilpse </li></ul><ul><li>Select Help  Software Updates…  Available Software </li></ul><ul><li>In the resulting dialog box, choose “Add Site” </li></ul><ul><li>Enter the location </li></ul><ul><ul><li>https://dl-ssl.google.com/android/eclipse/ </li></ul></ul><ul><li>Back in the Available Software view, you should see the plugin listed by the URL, with &amp;quot; Developer Tools &amp;quot; nested within it. Select the checkbox next to Developer Tools and click Install... </li></ul><ul><li>On the subsequent Install window, &amp;quot; Android DDMS &amp;quot; and &amp;quot; Android Development Tools &amp;quot; should both be checked. Click Next . </li></ul><ul><li>Read and accept the license agreement, then click Finish . </li></ul><ul><li>Restart Eclipse. </li></ul>
  • 8. <ul><li>Download SDK from http://code.google.com/p/androidbmi/wiki/InstallAndroid and uncompress </li></ul><ul><li>Now modify your Eclipse preferences to point to the Android SDK directory: </li></ul><ul><ul><li>Select Window -&gt; Preferences... to open the Preferences panel </li></ul></ul><ul><ul><li>Select Android from the left panel. </li></ul></ul><ul><ul><li>For the SDK Location in the main panel, click Browse... and locate your downloaded SDK directory. </li></ul></ul><ul><ul><li>Click Apply , then OK . </li></ul></ul>
  • 9. <ul><li>select Window  Android SDK and AVD Manager </li></ul><ul><li>Select  Available Packages  in the left panel. This will reveal all components currently available for download. </li></ul><ul><li>Select the components you&apos;d like to install and click  Install Selected . </li></ul><ul><li>Verify and accept the components you want and click  Install Accepted . </li></ul>
  • 10. &nbsp;
  • 11. &nbsp;
  • 12. <ul><li>Create an AVD </li></ul><ul><li>Create a New Android Project </li></ul><ul><li>Creating a Launch Configuration </li></ul><ul><li>Running and Debugging Your Android Applications </li></ul>
  • 13. <ul><li>Create a virtual device </li></ul><ul><li>select Window  Android SDK and AVD Manager  Virtual Device  New </li></ul>Virtual Device name Select target Select skin Create  Finish
  • 14. <ul><li>From Eclipse, select File &gt; New &gt; Project . </li></ul><ul><li>Select &amp;quot;Android Project&amp;quot; and click Next . </li></ul>
  • 15. <ul><li>Fill in the project details with the following values: Project name: HelloAndroid </li></ul><ul><li>Build Target : Android 1.5 </li></ul><ul><li>Application name: Hello, Android </li></ul><ul><li>Package name: tw.nthu.cs241001.helloandroid </li></ul><ul><li>Create Activity: HelloAndroid </li></ul><ul><li>Min SDK Version: 5 </li></ul><ul><li>Click Finish </li></ul>
  • 16. <ul><li>3 </li></ul>5 4 6 7 8 9
  • 17. <ul><li>Select Run -&gt; Run Configurations …. . </li></ul><ul><li>Right-click Android Application on the project type list, and select New. </li></ul>
  • 18. <ul><li>Select Run As…  Android Application </li></ul>
  • 19. <ul><li>src : This folder holds all the source code files for your application, inside the appropriate package subfolders. </li></ul><ul><li>gen : This file holds all the automatic generation files </li></ul><ul><li>res : This folder holds all the resources for your application. </li></ul><ul><li>AndroidMainifest.xml : list the application provide functions </li></ul>
  • 20. <ul><li>package com.example.helloandroid; </li></ul><ul><li>import android.app.Activity; </li></ul><ul><li>import android.os.Bundle; </li></ul><ul><li>public class HelloAndroid extends Activity { </li></ul><ul><li>/** Called when the activity is first created. */ </li></ul><ul><li>@Override </li></ul><ul><li>public void onCreate(Bundle savedInstanceState){ </li></ul><ul><li>super.onCreate(savedInstanceState); </li></ul><ul><li>setContentView(R.layout.main); </li></ul><ul><li>} </li></ul><ul><li>} </li></ul>
  • 21. <ul><li>package com.example.helloandroid; </li></ul><ul><li>import android.app.Activity; </li></ul><ul><li>import android.os.Bundle; </li></ul><ul><li>import android.widget.TextView; </li></ul><ul><li>public class HelloAndroid extends Activity { </li></ul><ul><li>/** Called when the activity is first created. */ </li></ul><ul><li>@Override </li></ul><ul><li>public void onCreate(Bundle savedInstanceState){ </li></ul><ul><li>super.onCreate(savedInstanceState); </li></ul><ul><li>// setContentView(R.layout.main); </li></ul><ul><li> TextView tv = new TextView(this); </li></ul><ul><li> tv.setText( “Test TextView” ); </li></ul><ul><li> setContentView(tv); </li></ul><ul><li>} </li></ul><ul><li>} </li></ul>
  • 22. <ul><li>New String </li></ul><ul><ul><li>res  values  strings.xml </li></ul></ul><ul><ul><li>Click Add…  String  OK </li></ul></ul><ul><ul><li>Fill up Name and Value  Save </li></ul></ul><ul><li>Add to main.xml </li></ul><ul><ul><li>res  layout  main.xml </li></ul></ul><ul><ul><li>Select Text field </li></ul></ul><ul><ul><li>Properties </li></ul></ul><ul><ul><ul><li>Property : Text  Value  Select the new string </li></ul></ul></ul>

×