Here in this tuturial, i will guide you how to setup your android device for development. There after you will be able to comunicate with your mobile from Eclipse (or any other IDE). It will also enable you to debug your project directly on your mobile.
There are five simple steps including,
1. Make your Application Debuggable
2. Enable USB debugging on your mobile device
3. Download & Install your device driver
4. Eclipse Deployment Target Selection Mode
5. Testing
Lets start,
1. Make your Application Debuggable
In the AndroidManifest.xml
file, add android:debuggable="true" to the <application>
element.
Note: Be sure to remove this before you build for release (your published application should usually not be debuggable).
2. Enable USB debugging on your mobile device.
Now you need to enable USB debugging on you mobile.
- On most devices running Android 3.2 or older, you can find the option under Settings > Applications > Development.
- On Android 4.0 and newer, it's in Settings > Developer options.
3. Download & Install your device driver
If you have already installed your mobile driver just leave this step or if you have device driver with you install it on your computer. You can also download your device driver from internet. Below is the list of vendors and their official downlaod links.
4. Deployment Target Selection Mode
By default android automaticaly choose preffered emulator (AVD) to launche/debug our application instead of your mobile device. So we need to know how to select our mobile device instead of emulator,
Right Click on your project> Run as > Select Run Configurations > select Target Tab
Select Always prompt to pick device instead of automatically pick.
5. Testing
Your Application will be launched on your phone & you will be able to debug and see the output on your android device.