Professional Documents
Culture Documents
Tutorial 1 Basic Android Setup Windows PDF
Tutorial 1 Basic Android Setup Windows PDF
Parts of this tutorial borrow explanations from the official Android developers website (developer.android.com).
2. Unzip the downloaded file to a convenient location on your hard disk, for example:
C:\\Android\\android-sdk-windows
2. Unzip the downloaded file to a convenient location on your hard disk, for example:
C:\\Android\\eclipse
5. Verify that Eclipse starts properly and an IDE window like in Figure 1 is shown. You can
display the primary development console by choosing Window > Show View > Console,
so that a console like in Figure 2 appears.
8. In the dialog below, select the checkbox for Developer Tools and click Next. Accept all
license agreements. Click Finish.
9. Restart Eclipse after all the packages have been downloaded and installed.
Updating the Android SDK
1. In Eclipse, select Window > Preferences, and open the Android tab. Enter the SDK
location. In the example given above, it would be:
C:\\Android\\android-sdk-windows
2. In Eclipse, select Window > Android SDK Manager. A window like that in Figure 3
should pop up.
Finally, if you plan to use the emulator (not necessary if you have already a device) you
need to download a system image, for example
Android 5.1 (API 22) > ARM EABI v7a System Image
2. Click Install <number> packages, choose Accept License for all items listed, and
click Install. The selected packages will now be downloaded and copied to your
Android SDK installation folder. You can monitor the download/installation progress at
the bottom of the Android SDK Manager window.
3. Add the location of the tools and platform-tools subfolders for the Android SDK to
your system PATH. For help on editing the PATH, please follow the tips here:
http://www.computerhope.com/issues/ch000549.htm
4. On Windows, you will need to install the appropriate USB driver. Read this page for
more information:
http://developer.android.com/tools/extras/oem-usb.html
Note: For the Motorola Droid, you can also download the latest USB driver from:
http://www.motorola.com/Support/US-EN/SupportHomepage/Software_and_Drivers/USB-and-PC-Charging-Drivers
Note: You may need to restart your computer after installing the USB driver in order for
the phone to show up in Eclipse.
In the external My First App tutorial, they only run the My First App program in an
emulator. Additionally, we will now also run the program on the actual Android phone. Make
sure your phone is properly linked to your computer.
1. In Eclipse, select the project MyFirstApp in the Project Explorer. Then, select Project >
Properties > Android and select the highest Android version if it is not already selected.
Thanks to backwards compatibility and support libraries, it does not matter if your device
does not support this particular version.
2. Known issue: If you chose as minimum required SDK an API < 14, the additional
support library appcompat_v7 will be created. A known bug in Eclipse may show an
error on that library, preventing you to build your project. To solve the problem, select
the appcompat_v7 library in the Project Explorer and press F5 (or File > Refresh) to
refresh it. You can now clean it and rebuild it by choosing Project > Clean and then
Project > Build project. The error should be gone.
3. Select the project MyFirstApp again, then Run > Run Configurations > Android
Application > MyFirstApp > Target. Choose Always prompt to pick device.
5
4. Select Run, and in the Device Chooser dialog, select your Android phone. The My First
App program will be sent to and automatically started on your phone, and you should
see the screen similar to Figure 4 on your phone.
4. Check to make sure everything is copied correctly into the project. If there are
compilation errors, a red X will appear in the Package Explorer. If you have followed all
the previous steps correctly and still get errors, it may be necessary to clean your
workspace: Project > Clean > Clean all projects and to rebuild it.
5. Select Run and in the Device Chooser dialog, select your phone. You should see
something like Figure 5 on your phone. Point the camera at different objects around you
to see how the mean, standard deviation, and histogram of each color channel changes
dynamically. You are augmenting the viewfinder in real time!