1 / 18

Android Unit 2: First Project

Android Unit 2: First Project. Running the Project on an Attached Device Instead of an Emulator. Being able to use the emulator is important—but it can occasionally be problematic Being able to run an app on an actual attached device is no less important—and it can be no less problematic.

gilead
Download Presentation

Android Unit 2: First Project

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Android Unit 2: First Project Running the Project on an Attached Device Instead of an Emulator

  2. Being able to use the emulator is important—but it can occasionally be problematic • Being able to run an app on an actual attached device is no less important—and it can be no less problematic

  3. If you haven’t yet run a homemade app on your device, there are essentially 3 steps: • 1. Getting the Device Ready • You have to get into developer mode so that you it’s possible to transfer the app to the device

  4. 2. Downloading and Installing the Driver • You need a USB driver in order to transfer through a USB port • 3. Running the App on the Device • Then you can run the app on the device

  5. For reference purposes, these overheads were prepared with the following: • Windows 7 • Eclipse, as already described • A Nexus 7 tablet • The fact that it was the Nexus 7 tablet is relevant to the specific instructions for getting the device ready

  6. Getting the Device Ready • On the running device, go to the App screen • Tap on Settings • Under System, find About tablet • Tap Build number 7 times • When you return from doing this you should find Developer options under System

  7. Take Developer options • Under Debugging, enable USB debugging • You can now connect the device to your system using a USB cable

  8. Downloading and Installing the Driver • For information on the Nexus 7 USB driver, if you want any, go to the Android Web site: • http://developer.android.com • A search on “USB driver” will take you to a page that has information on the driver • The driver is only necessary when developing in a Windows environment

  9. You have a choice on getting the driver • Either you can download from this page • Or you can use the Android SDK Manager from the ADT bundle in Eclipse • If you’re following this set of overheads and not using your own development environment, using the SDK Manager is easier

  10. Using the manager is so easy, there’s not much to say about it • Click on the Android SDK manager tool in the Eclipse environment • Find the line for the driver • Click and follow any instructions

  11. What Can Be Problematic • The premise of this section is that you are trying to set this up on your own machine • Various versions of Windows will sometimes try to use a generic Windows driver instead of the Google driver • This can be a serious problem • On some systems, it appears to be impossible to prevent Windows from doing this • If that happens, you will be unable to run an app on an attached device

  12. It may also be possible to manually replace a Windows driver with the Google driver • Here is a brief list of steps for downloading and installing the driver: • Note which folder the driver is saved in • Right click on the “computer” icon on your machine • Take the Manage option • Select the Device Manager on the left • Find and expand the Other devices

  13. Find the Nexus 7 device in the list • You may find the Nexus 7 device somewhere else depending on your situation • When you find the Nexus 7 device, right click on it • Take the Update Driver Software… option • Follow the directions and browse to the location where the driver was saved to

  14. Running the App on the Device • The assumption is that you successfully installed the driver and your device is attached with a USB cable • Open your app in Eclipse • Take the Run tool or the Run option in the menu • This should cause the Android Device Chooser to appear on the screen, with the Nexus 7 device in the list • A screen shot is shown on the following overhead

  15. Select your device and click OK • The app should run on your device • In addition to running, it will be installed on the device • If you go to the apps screen you’ll find the little green Android icon with the name of the app and you can run it from there in the future

  16. Summary and Mission • This is the end of the description of the first project • As noted, it was only about nuts and bolts • The presentation had nothing to do with code or the components of the app • Those topics will be pursued in the following sets of overheads

  17. You have two missions: • 1. Get “Hello World” to work on an emulated virtual device in whatever development environment you’re using • 2. Get “Hello World” to work on a real attached Android device

More Related