Upload
lynley
View
56
Download
0
Tags:
Embed Size (px)
DESCRIPTION
Coursework 2: getting started (1) – running the phone emulator. Chris Greenhalgh G54UBI / 2011-02-21. Contents. Option 1: using the Android SDK Installing the Android SDK Configuring the Android SDK Manager Creating an emulator Starting an Emulator Option 2: - PowerPoint PPT Presentation
Citation preview
Chris Greenhalgh ([email protected]) 1
Coursework 2: getting started (1) – running the phone emulator
Chris GreenhalghG54UBI / 2011-02-21
Chris Greenhalgh ([email protected]) 2
Contents
• Option 1: using the Android SDK– Installing the Android SDK– Configuring the Android SDK Manager– Creating an emulator– Starting an Emulator
• Option 2: – Running an Android emulator using the
AppInventor local installation
Chris Greenhalgh ([email protected]) 3
Option 1: using the Android SDK (for use with HTML/JS, PhoneGap or native apps)
Chris Greenhalgh ([email protected]) 4
Installing the Android SDK
• Follow the steps in http://developer.android.com/sdk/installing.html– Step 1: Ensure you have a JDK (version 1.6)
(Eclipse is NOT required at this stage)– Step 2: download the SDK .zip file and extract its
contents (e.g. android-sdk-windows/) to your chosen working directory
– (Step 3: ADT is NOT required at this stage)
Note: this step should NOT be required in the labs: should already be installed in C:\Program Files\Android\android-sdk-windows\
Chris Greenhalgh ([email protected]) 5
Setting up the Android SDK (1)
• (Without Eclipse) run “SDK Manager.exe” from the unpacked directory– (with eclipse, choose Window > Android SDK and AVD
Manager)– You can “cancel” the initial dialog which suggests
installing all of the available packages– Under “Settings” set the HTTP proxy if required
• E.g. in the University host “128.243.253.109” and port “8080”
Note: this step should NOT be required in the labs: should already be installed in C:\Program Files\Android\android-sdk-windows\
Chris Greenhalgh ([email protected]) 6
Setting up the Android SDK (2)
• From “Available Packages” select and install at least:– Android SDK Platform-tools and– SDK Platform Android 2.2, API 8
• Under Android Repository– Google APIs by Google, Inc., Android API 8
• Under Third party add-ons, Google Inc. add-ons [for google maps]– (If you have an older Android device then install a version of Android and Google
APIs that is compatible with it)– Note: you will need to click “Accept” for the Google APIs licence:
Note: this step should NOT be required in the labs: should already be installed in C:\Program Files\Android\android-sdk-windows\
Chris Greenhalgh ([email protected]) 7
Creating an emulator, a.k.a. Android Virtual Device
• Under Virtual Devices click “New…” and choose – name (any), – target (Google APIs…)– SD Card size, e.g. 64 MB– Resolution (WVGA800)– and Create AVD…
• Note that the (large) emulator file(s) are usually stored in a hidden directory .android, in your home directory (H:\), which can be deleted if you no longer need the emulator
Note: this step should only need to be done ONCE
Chris Greenhalgh ([email protected]) 8
Starting an emulator
• Start the SDK Manager if required (see earlier slide)
• Under “Virtual Devices” select the emulator (“AVD”) you want and click “Start…” – You can modify the launch
options if required, e.g. size on the monitor, then press “Launch”
– It typically takes a minute or two for the emulator to start up
Note: this step needs to be done each time you want to start an emulator
Chris Greenhalgh ([email protected]) 9
A running emulator(exact appearance depends on version and AVD options)
Chris Greenhalgh ([email protected]) 10
Option 2: using the AppInventor tools (for use with Google AppInventor)
Chris Greenhalgh ([email protected]) 11
Installing the AppInventor tools
• Follow the set-up instructions for your operating system:– http://appinventor.googlelabs.com/learn/setup/index.
html#setupComputer– Make a note of the installation directory, typically …\AppInventor\commands-for-Appinventor
• If a web proxy is required then you need to configure it now, e.g. by setting the http_proxy environment variable
Note: this should already be installed in the labs in C:\G54UBI\
Chris Greenhalgh ([email protected]) 12
Configuring the emulator web proxy
• From inside the University network (except UoN-guest) if the proxy is not set then you will be able to access University web sites but not external web sites (e.g. google). – At present a suitable proxy from within the University network is
“http://128.243.253.109:8080”• If you start an emulator from the SDK Manager then it should use the
proxy set there (slide 4)• Otherwise the emulator will use the environment variable
“http_proxy” to determine what (if any) proxy to use– This can be set/checked in
• (Windows 7) Control Panels Search “Environment” Edit environment variables for your account
• (Windows XP) Control Panels System Advanced Environment Variables– You need to restart the emulator to pick up any change
Chris Greenhalgh ([email protected]) 13
Running the emulator using the AppInventor tools
• In the AppInventor installation directory (…\AppInventor\commands-for-Appinventor) run the emulator command– Windows: double click run-emulator.bat• After a few seconds the phone emulator should appear
and start up
Note: this should be installed in the labs in C:\G54UBI\
Chris Greenhalgh ([email protected]) 14
Conclusions
• You should now be able to:– Install and setup the Android SDK if required– Run an Android emulator– And optionally• install the AppInventor tools • and run an Android emulator using those