70 likes | 226 Views
Get android development environment running. Install. http://developer.android.com/sdk/requirements.html Get and install JDK 5 or 6 (see link in the web page) Install should run smoothly Get and install Eclipse 3.5 or 3.6 (I use 3.6.1 Helios) To install, just zip
E N D
Install • http://developer.android.com/sdk/requirements.html • Get and install JDK 5 or 6 (see link in the web page) • Install should run smoothly • Get and install Eclipse 3.5 or 3.6 (I use 3.6.1 Helios) • To install, just zip • Since you only unzip eclipse, to start eclipse you must open the file explorer, go to you eclipse directory and double click on eclipse.exe. • Get the SDK starter package • See step 2 of http://developer.android.com/sdk/installing.html#Installing • Save into directory c:\android. • Just unzip • Install the ADT plugin in eclipse • See http://developer.android.com/sdk/eclipse-adt.html • Be sure to do the step “Configuring the ADT Plugin” • Add other components • See http://developer.android.com/sdk/installing.html#components, which says to do the following • Open eclipse • Go to workspace • Select menu Window -> Android SDK and AVD Manager • If Android SDK and AVD Manager is not an option, then the plug was not installed Try going through the steps to install the plugin again, perhaps with trying to uninstall the plugin. However, I found that I had to delete the eclipse directory and start over again. • Install all available packages • Note this will install a usb driver. This USB drive needed to communicate with a phone device. Double check that you have the directory C:\Android\android-sdk-windows\usb_driver. When you plug in your phone, the OS will ask for the location of the driver. This is where it is.
Create an Emulator • In eclipse, select Window-> Android SDK and AVD Manager • Use Android SDK and AVD Manager to create an emulator • See Create an AVD in http://developer.android.com/resources/tutorials/hello-world.html • When done creating the emulator, start it • From eclipse, select menu Window -> Android SDK and AVD Manager • Highlight the emulator and click start
USB • When the new device is attached to a PC, the usb driver must be installed. This must be done for each device • Also, “Enable USB Debugging” must be selected • Settings -> applications -> Development -> USB debugging • When the devices is plugged in, a message should appear indicating the USB debugging is available. If not, then retry and perhaps reinstall the driver. • Once these steps are complete, the device should be available by typing adb devices • Also, the device should be showing in the eclipse DDMS and one of the options when running an application
adb • Open a command window (terminal) • Go to C:\Android\android-sdk-windows\platform-tools • C:> adb devices • Will show the devices, including the emulator and devices attached via usb • C:\Android\android-sdk-windows\platform-tools>adb devices List of devices attached HT035P901026 device emulator-5554 device • Make sure that both are shown. • If the emulator is not shown, check that it is running. Note, it takes a really long time for the emulator to start • If the phone is not shown, check that your phone is plugged it. Check • Try the shell on your phone • C:> adb –d shell • $ ls • $ su • If the above gives an error message, then you don’t have root access. • Try the shell on your emulator • C:>adb shell
svn • SVN (subversion) is used to share code and to keep track of versions of code • Get subclipse (subversion plug in for eclipse) • http://agile.csc.ncsu.edu/SEMaterials/tutorials/subclipse/ • See section 2.0 Adding Subclipse Plug-in to Eclipse • Get TestSvn app from the class svn server • See section 3.0 Subclipse Perspectives • Window > Open Perspective > Other... > SVN Repository Exploring. • Left-hand side: SVN Repository or window->show view-> SVN Repository • Right-click in svn repository area -> new-> repository location • Enter https://128.4.35.53/svn/Android1 • User name is your lastname • Password is given in class • Do it again, but enter https://128.4.35.53/svn/last name • Go back to java perspective: window->open perspective: select java • In web page listed above, see section 4.0 Adding a Repository URL to Subclipse • Instead of new->Svn repository, you might need to new->other. New dialog opens, select svn->check out • Create a new
Homework • Use the adb • to list the contents of a dir • To transfer a file from your desktop to your phone • adb –d push filename filename • From shell on device, • $ netcfg • Enable wifi and connect to a access point and • $ netcfg • Explain what netcfg shows • Use SVN to get app, TestSVN • Run testSVN on your phone and use eclipse DDMS to show your phone’s screen on your computer. Turn in a picture