how to test my application in my android device - android

I have build my first application for Android Phone in Eclipse.
I want to test my app in my real device. I have not made apk till now.
Can anyone please provide me the step by step guideline on how to load my app from eclipse to my device and run it.

You need to enable USB debugging on the phone itself (by starting the Settings application and selecting Applications > Development > USB Debugging), install the Android USB device driver if you haven’t already (Windows only), and then plug the phone into your computer using the USB cable that came with the phone.
Close the emulator window if it’s already open. As long as the phone is plugged in, Eclipse will load and run applications on the phone instead. You need to right-click the project and select Run As > Android Application.
or
In eclipse you go to run->build or if you have build automatically turned on you can go into the projects file structure and just copy the .apk file out of the bin folder. You can put this on the devices SD card and install it from there. No need to do the export unsigned apk thing.

Go through this link
http://developer.android.com/tools/device.html
An must for device debugging is Mobile usb drivers and You should go to SDK manager->extras->usb pluggin download that pacakge....

This may help http://developer.android.com/guide/developing/device.html.
If you're on Windows you will need to install the USB driver. Then, on your Devices tab (Window->Show View->Other->Android->Devices) you should see a new row appear when you connect your device to your workstation with a USB cable (although LG handsets are problematic in my experience)

If you're on Windows you will need to install the USB driver. Then, on your Devices tab (Window->Show View->Other->Android->Devices) you should see a new row appear when you connect your device to your workstation with a USB cable (although LG handsets are problematic in my experience).

Related

Visual Studio and Android Device Monitor doesn't detect any devices

I've just installed VS2015 Community with Xamarin to develop some mobile apps. The problem is, I can't achieve debugging Android apps on any device. Android Device Monitor shows empty list. I tried connecting different phones, which I know are detected on my friend's PC. I can explore their files from windows explorer, from there computer sees them.
USB Debugging on the phone is turned on.
USB connection mode is set to camera, no change at all.
I have Google USB driver installed in Android SDK manager.
I tried adb kill-server, adb start-server. Nothing changed. adb devices
shows empty list.
This is device manager while Developers options are disabled on the phone.
And here with enabled Developers options
I also tried updateing driver to google usb driver, but windows said it's up to date.
You most likely did not grant access to the device. Try to go into the developer settings on the smartphone and revoke the USB debugging authorisation. Then connect the phone to the pc and and wait for a popup on the phone which you should accept. After accepting you should see your device with adb devices.
You can also try to set the connection mode to MTP (instead of the camera PTP).
Hope it helps!
Enable the device for development
Goto: Device > Settings > Developer Options > tick USB debugging
Sometimes just restarting Visual Studio might help
Try the this:
1 - Close Visual Studio
2 - connect your device
3 - Restart visual studio with the device already connected by usb (with the device options checked)
This just happened to me. And it seems setting the startup project to your Android project fixed it.
My understanding is that the Google USB Drivers from the Android SDK Manager only work for Google Nexus devices (at least according to https://developer.android.com/studio/run/win-usb.html); annoyingly enough, to use other kinds of devices you'll probably need to download vendor-specific drivers. For example, I definitely had to download Motorola's drivers to use my Droid for debugging purposes. Unfortunately, for whatever reason Windows wasn't able to automatically detect that that's what it needed to download, so I had to download them manually.
I had the same problem, using a Samsung Galaxy A5
Google Drivers Installed
Samsung Drivers Installed
Phone shows up in file explorer
Plugging the phone in while Visual Studio was opened resulted in a pop up asking for permission. After authorising, everything worked perfectly. I didn't have to go into the developer settings on the smartphone and revoke the USB debugging authorisation.
To preface, I had connected my phone (a blackberry which had Android and full Google Play Store access) via Android Studio before so I KNOW it's possible, but when I was trying to do it with Xamarin I was having issues, Visual Studio just wouldn't recognize my device.
Found the problem appears to be the USB cable I was using. When I standardly plug in the USB, blackberry gives me the option to just charge the phone, or to enable File Transferring. But the first cable I was using always just charged the phone and didn't give me options. I tried switching the usb cable and voila, I got the prompt, and I can see the device now in the Start Debugging dropdown. So it looks like there's charge-only usb cables as well as Data cables. Be sure you're using a Data cable else it won't be able to see your Device
I had the same issue after updating Visual Studio found that in recent versions is better if you open VS in administrator mode to properly work, this should fix the problem.
I had previously revoked debug auth on my phone, but my phone didn't prompt me to allow debugging on my PC when I connected it again. Ended-up restarting my LG V30 while connected to my PC and I was prompted to allow debugging.
After that, Visual Studio 2019 version 16.10.0 adds my phone to the device list.
Running on Windows 11. Visual Studio 2022. But, I don't think the versions are really relevant here - included for completeness.
Followed all instructions re enabling USB debugging from the device. Also, the USB Drivers for my Samsung device were successfully installed on the Windows machine.
I was running the Duet Display application as I had previously installed it for use with my iOS devices. This appears to have created a conflict when connecting the Android device, as the prompt related to Duet would appear but not the prompt to allow USB debugging from the computer along with the RSA thumbprint. Once I exited the Duet app from my system tray and reconnected the Android device I got the prompt and it immediately appeared in Visual Studio 2022.
Here's some things I check when having an issue with Android device not appearing:
Enable developer mode on the device from settings
Install (e.g. to windows) the manufacturer's* developer USB drivers for the device
Ensure the Minimum Android Version in the AndroidManifest.xml is lower or equal to your device
And as always, try a different lead and restart both PC and Device!!
*Manufacturer Android USB Development driver links I know of:
Sony | Samsung | Google/Nexus | Blackberry
I have just updated from VS2015 (14.0.25402.00 Update 3) to VS2017 (15.7.5).
Amongst other things, I had to migrate a .forms app from 2.3.x to 3.1.x...
As it (according to MS) now should be possible to install also the Xamarin integration software in parallel to older versions of VS, I first (for security reasons) wanted to leave my “old” .forms app under VS2015 and .forms 2.3x and start to update to .forms 3.x with VS2017.
First, everything looked good - I was able to open my “old” .forms 2.3.x project in VS2015 (what was not possible in the earlier migration from VS2013 to VS2015).
But, I was not able to bring my two dev mobiles (both Samsung Galaxy S7) to work under VS2015 again, although, they were showed to my dev-machine (windows explorer) correct.
After wasting about a full day (doing every suggested workaround, I found on the web), I gave up und started to migrate the .forms project under VS2017.
Under VS2017 both mobiles were showed immediately without any problems and I was able to debug to the device.
So.. it seems, as the installation of VS2017 (with Xamarin integration SW) has “destroyed” something in the VS2015 installation regarding the access to the mobile devices...
I wasn't getting the USB debugging prompt on the device to trust the PC it was connected to and it wasn't appearing in the drop down list of devices in Visual Studio or ADB. Tried many things but installing the USB driver for the device (in my case Sony Xperia XA1 from: https://developer.sony.com/develop/drivers/
After installing this device driver by right-clicking the ADB Interface device in Device Manager and choosing the downloaded driver it showed the prompt to allow the PC and now works fine. This was on Windows 8.1 . I don't remember having to do the same for my Windows 10 PC.
I tried all the options but the only way I got it working is to unplug the USB cable and connect it on a different USB port.
After downloading phone specific drivers and restarting computer / restarting visual studio etc etc. What fixed it for me was from developer options
Disable USB Debugging
Enable USB Debugging
This was on a Samsung Galaxy, looks like although it was saying USB debugging was enabled it was in fact not enabled until I retriggered it using the above method.

How to try an app on a tablet

I am doing some applications using Android + Eclipse to run on tablets. I have had too much trouble with the tablet emulator, so I would like to try my code (apps) on a real tablet. How can I do this? I have a Samsung Galaxy Tab 3. Do I need to install the adt-bundle on it?
I'd appreciate any input.
http://developer.android.com/tools/device.html
You just need a usb cable to connect your device to your pc.Go to the above link for more info
check this it may help you Run on a Real Device
Here is a copy paste, but check the link it's really good and well explained :
If you have a real Android-powered device, here's how you can install and run your app:
1-Plug in your device to your development machine with a USB cable. If you're developing on Windows, you might need to install the appropriate USB driver for your device. For help installing drivers, see the OEM USB Drivers document.
2-Enable USB debugging on your device.
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.
Note: On Android 4.2 and newer, Developer options is hidden by default.
To make it available, go to Settings > About phone and tap Build number seven times. Return to the previous screen to find Developer options.
To run the app from Eclipse:
1-Open one of your project's files and click Run from the toolbar.
2-In the Run as window that appears, select Android Application and click OK.
Eclipse installs the app on your connected device and starts it.
Or to run your app from a command line:
1-Change directories to the root of your Android project and execute:
ant debug
2- Make sure the Android SDK platform-tools/ directory is included in your PATH environment variable, then execute:
adb install bin/MyFirstApp-debug.apk
3-On your device, locate MyFirstActivity and open it.

Eclipse Won't Recognize BLU Dash 3.5 As An Active Android Device

I got a new Gingerbread phone to try to develop on, but Eclipse won't recognize it.
I put it into debug mode already.
The Win7 Device Manager shows a problem with 4 Qualcomm HSUSB devices, this is certainly related to the phone.
Windows update is unable to find any updates for it.
I couldn't find any drivers support downloads from BLU either.
About the phone:
Andriod version: 2.3.5
Kernel version: 2.6.38.6-perf
Hardware version: A5.V1.2
Build number: BLU_D170_v03_GENERIC
Did you try using the Google USB driver?
For me, in device manager, I had an unknown device listed as "Android device" with a yellow exclamation point over it. Right click it, then choose update driver software. Then choose browse my computer, then choose let me pick from a list of devices...
Then click the Have disk button, and point it to the google usb driver (this should be downloaded via the SDK manager). It will be in the folder where your SDK stuff gets downloaded in the /extras/google/usb_driver folder. When browsing, select the inf file in this folder.
You should get three options that pop up, choose Android ADB Interface. It will then install the generic usb driver so you can connect your phone to ADB.
Note: I have the BLU Dash 4.0, but the driver should work on just about any android device.
First of all, are you able to transfer data to the phone normally? If you can, don't bother with the second part below.
If you can't transfer data, look at this second part. When you bought the phone, did it come with a driver disc? If it did, install the drivers from there. If it did not, try checking the official manufacturer site to see if there's a driver online.
I managed to make contact with BLU service, and they e-Mailed me a driver that only works on 32-bit Win7, not 64-bit :-(
I figured out that I can still test my apps on my DASH 3.5 by uploading the .apk file to a webserver & using the phone to browse to that link. Android will recognize that .apk is an app file it can install. So you could also distribute your own apps to anyone this way, without using any of the Android stores|markets at all.

Android USB Debugging on Samsung Infuse 4G

I am trying to test an Android application through the Eclipse plugin on a real device. It is a Samsung Infuse 4G. I believe I have followed all steps on the Android page for testing on devices.
First of all, I cannot figure out what the Android OS version is because it does not show up in the settings. I can see that the firmware version is 2.2.1, so I assume I am running that version of Android OS as well.
Next, when I connect the device to my computer (running Vista, 64 bit), I get prompted with three options: Kies (firmware update), Media player, and Mass storage. When I look on the Internet, I see that I am supposed to select "Charge only", but this does not appear in the options with which I am prompted. I have already set USB Debugging to true through Settings > Applications > Development.
Third, I have installed the correct driver from the Samsung site based on my model number (SGH-I997), yet when I do adb devices from my platform-tools directory (I have tried adb kill-server and adb start-server), I still do not get my device listed.
I am not very advanced in terms of working with Android and have been banging my head against the wall on how to solve this problem, so any and all help guiding me through this would be appreciated.
Thanks!
Try installing this PC Suite ...Samsung Kies http://www.samsung.com/in/support/usefulsoftware/KIES/JSP this would help you to get the exact driver for the device and don't forget to check USB Debugging option in settings.
You also need to mark "Allow Mock Locations "in Development Options in Applications settings of your phone.
Also try enabling ,use as mass storage after connecting your device.
You can check if your device is detected in device tab of DDMS in Eclipse.
Even trying all such things ,it does not work try connecting your device 2 or 3 times ,restarting eclipse and enabling USB Debugging and mock locations again

Debugging on Android Disgo 8100 tablet

I've got a Disgo 8100 tablet which I would like to test an app on but I'm having problems doing anything with it. I'm new to Android development but I've got 2 phones setup and connected and working with Eclipse. The Disgo is running 2.3.3 but there is no USB debugging option under Settings -> Applications and when I connect the device to the USB all I get is a drive mounted and no device listed in adb. Device manager also shows a disk rather than a device so I can't update the driver.
What can I do to get this working?
If the device has an option to allow installation of non market applications, then you can select this.
Once that is done, creat an apk for your app in eclipse, then when the device is mounted
as a drive, just transfer the apk file to the device in a tmp folder.
Once you have done this, you need to locate the file on the device (using a file explorer such as astro), and run it.
This will install the app onto the device, although you wont be able to debug, you will be able to see if the app runs ok.
Hope this helps..
Firstly you need to look deepper in settings, may be USB debugging option on in App. section. For example on my Galaxy S2 ICS it's in Development section.
After it you should install drivers for your device

Categories

Resources