This is in continuation to the first two articles of Android Google Maps Api Ver 2.0.
The objective of this article is to test our Google Maps Api Ver 2.0 Application that we have developed so far in the first two parts of this series of articles on a Physical Device. We need a physical Android device. The one that I have is HTC One X.
Identifying which Android USB drivers to use
Before we start to install the drivers we need to identify which drivers are we going to install.If we have an Android Developer Phone (ADP) like Nexus we will use the Google USB Drivers. The latest Google USB Drivers can be downloaded using the following link. http://developer.android.com/sdk/win-usb.html and help on how to install it . Only the Galaxy Nexus drivers are provided by Samsung and not Google. We can get the drivers for Galaxy Nexus from the following link. http://www.samsung.com/us/support/downloads/verizon-wireless/SCH-I515MSAVZW . If we have a device other then the above mentioned, we will use OEM Drivers. I own an HTC ONE X so in this article we will go the the OEM Drivers.
Installing the Android USB Drivers
Now that we have identified which device do we have and which drivers we will install. In my case I ll install the OEM drivers for HTC ONE X. The link shows a list of devices and their links from where their USB drivers can be downloaded. http://developer.android.com/tools/extras/oem-usb.html . So we will go to the HTC page and will click on support to get the drivers. HTC Sync Manager will do the job. When the appropriate drivers are installed on the computer than we will move to the next phase.
Setting up Eclipse for our Physical Device
Run Eclipse, open the DDMS tab. If our emulator is running we will only see the emulator in DDMS. We wont see Physical Device in DDMS.
Enable the USB debugging from the device. Then in DDMS select the Devices Tab and click on the right most arrow to get the drop down menu , click on Rest adb.
When we Reset the adb, the DDMS will show our Physical Device in the Devices Tab. If not make sure that the device is properly connect to the computer with the USB connecting cable. This is what you will see when everything goes fine.
Deploying our application on the Physical device.
Close all the Emulators, Make sure the Device is connected properly with the computer. In DDMS check in the Devices Tab if its still showing our Physical Device, if it is than its ok, if not then Reset adb as explained earlier. After having the Physical Device in the DDMS go to Run Configuration Screen from where we normally select the AVD or emulator to Run our application. The image below shows the screen.
In the Target Tab click on the dropdown menu, it has three options
- Active AVD’s/Active Devices
- Active AVD’s
- Active Devices
Select the 3rd option, “Active devices” Then Click Apply and Run. If the device is properly connected, and it appears in the DDMS, the system will automatically search for active devices. In our case HTC One X is the active device. The application will be directly deployed on our Device. When we make some changes to the code, we can deploy the application directly to the device exactly the same way again, but its better to un install the last deployed application and then deploy a fresh copy of our application again on the device from Eclipse.
Note:- This article is not specific for deploying just Google maps applications on Physical Devices. Any application can be deployed on Physical Device using the steps in this article. Secondly , earlier it was not possible to run Android Google Maps APi ver 2.0 on AVD or emulator so we had to test the application on Physical Device. But now its not necessary , now we can test our Android Google Maps API Ver 2.0 applications on emulators or AVDs.
Thats all for now, I ll come up with testing and deployment on emulator soon