Why isn't the usb_driver working...? - android

I have just started android programming, and after watching many tutorials and reading many articles I learned that if I want to run my programs on my android phone, I will need to install the usb_driver. I have done that, but when I go to device manager, in other devices, my phone has a yellow exclamation error. This is normal, but it should go away after right click->update driver software->browse->C:\Users\myusername\AppData\Local\Android\sdk\extras\google\usb_driver->next. But, after doing this, I get the error:
Without downloading the usb_driver, my device just wouldn't get detected. I have already allowed usb debugging, and allow mock locations, so right now I just need the driver. I have read almost all the other articles and tutorials, but my device still doesn't show up?

There is also a great tool: adb driver installer, that allows you to install drivers for almost any phone, without need for the 'software suites' that often come along drivers.

I figured out that besides for installing the updates for the computer, I must also go into my computer and allow permission for these updates to run. After that, I followed these instructions.

Related

Android Studio doesn't list my phone in the device manager

I've been working on the HelloWorld app for a few weeks now, overcoming many little hurdles, and I think I've reached the last one. I'm working out of 'Learn Android Studio' by Adam Gerber (not an endorsement, just happens to be the book I'm using). I have an HTC One.
When I open the device manager, there is no device listed. In the terminal, I issue the command adb devices and I get the heading "List of attached devices" with nothing listed. If I click the green run arrow, I'm asked to choose my device, but my device isn't shown.
I used to get the error "Unable to obtain result of 'adb version'" when I opened the device manager, but I don't get that anymore, for some reason. But now, when I open Android Studio, I get a Windows Firewall window telling me that some aspects of Android Studio are blocked, including public networks. I don't know if this is the reason for my difficulty or not (I don't think connecting my phone to my laptop is like a public network, is it?).
I went to the developer.android site and followed the directions for connecting a device:
How to connect an Android device to Android Studio.
Step 1 is: "Verify that your application is "debuggable" in your manifest or build.gradle file." The details on how to do it are provided, and I made the appropriate addition to my build.gradle file.
Step 2 is: "Enable USB debugging on your device." This is the thing where you tap your phone at a certain place in the settings to enable development capabilities. I did that.
Step 3 is: "When plugged in over USB, you can verify that your device is connected by executing adb devices from your SDK platform-tools/ directory. If connected, you'll see the device name listed as a 'device.'" As I mentioned above, I get a heading for a list, and no items listed. My book says on page 23: "If your computer does not recognize your Android device when you connect to your computer via a USB cable, you probably require a USB driver. If your computer initially recognizes your Android device, you should probably forgo installing a different or newer version of the USB driver, as this could cause the USB connection to fail." Since I've transferred image and music files to and from my HTC One dozens of times, I followed this advice and did not install a driver (Actually, before I read this book, I had started looking for a driver, following the links on the developer.android site, but I wasn't able to locate one).
On another site where programmers congregate, someone gave me this list of 4 items to check:
- Have you reinstalled adb? (I'm not sure what this means.)
- Do you have the DeveloperOptions SubMenu enabled on your phone? (yes)
- Do you have USB debugging enabled on your phone? (yes)
- Do you have AllowMock Locations enabled on your phone? (I did not, and I enabled it.)
Regarding the first item, my adb is an exe. How do I 'reinstall' that? I responded to his message, and he has not responded to clarify what he means.
Regarding mock locations, that was not enabled, and I enabled it and tried again to connect my phone to Android Studio. That's when the Windows Firewall window showed up for the first time. I don't know if it's because I enabled mock locations or not.
I also tried rebooting after starting the adb, as suggested by my book, on page 25, but that didn't do anything. "If after restarting the ADB server you still don't see the device, it's possible, though unlikely, that the USB driver requires a system reboot to take effect." I've noticed that adb starts up when I boot up (I tend to keep the task manager open), so I know my problem is not that the adb is not running.
I looked at many similar questions on this forum, and the most common advice seems to be to install a driver. Since my book says a driver might not be necessary and could ruin my USB connecting ability, and also since some programmers stated that their Android Studio connection to their phone was failing in spite of installing drivers, I'm not rushing to install a driver, especially since I need USB connectivity on my phone for my job.
So this is where I am. So, what about this statement in my book that if my laptop can see my phone, I don't need a driver. Would that be true? What else could be the problem?
Any help/suggestions/comments gratefully appreciated.
The fact that your computer can see your phone does not mean that you don't need a driver.
What that means is that your computer has the appropriate drivers installed for recognizing your phone as a media device.
What you need is for your phone to be recognized as an ADB device. These are often different drivers from the phone drivers that are installed by default, as the vast majority of users do not need to use developer tools with their phone.
If you can find these drivers from HTC, then they are very safe to install and the risk to your computer is negligible. Google's USB drivers installed via the SDK manager work for many devices and are also safe, though I cannot speak as to whether they will work with the HTC One or not.

USB Driver won't install properly

I'm trying to get my phone to connect with Eclipse so I can run android apps without using an emulator. I've already gotten this to work and made an app, but I got a new hard drive since then. Every time I try to reinstall it on the new hard drive, it says that it doesn't install properly. I've tried using 2 different usb cords, rebooting every time I try it and installing/uninstalling the USB driver from the Motorola website to no avail, and I can't remember exactly how I did it before.
Can anyone help?
Make sure your usb debugging turned on and use this free software to install the driver :
http://adbdriver.com/
Android's development page doesn't explain this one in full detail. I had problems with it myself. Although my situation wasn't exactly like yours, installing the usb driver from the SDK made it work.
Follow this guide!

Cannot debug Android from Eclipse

I have a problem debugging apps on my Samsung Galaxy S3, (GTI9300, I believe this is also known as the international version) from Eclipse.
The thing is, debugging actually worked for a time and then it just stopped working. I've tried quite a few things to make it work again. I'll describe my whole experience briefly, to keep you from suggesting things I've already tried, and save us all some time.
When I first got my phone, debugging didn't work. When I plugged in my phone, the system detected it, and I could use it almost like a storage drive (using Media Transfer Protocol or some such thing) But when I started Eclipse and tried to debug, the debugger didn't see the phone.
I googled some, learned that I had to install some specific driver. I honestly don't remember which driver it was, but I believe it was an official one (from Samsung's website). Once I installed this driver, Windows would no longer detect my phone as a storage device. But the debugger did see it, and I was able to debug a few simple apps that I'd made. I could easily live with this tradeoff.
Then I got busy with other stuff and set Android development aside. I came back to it this weekend - after 2 or 3 months - only to find that it no longer works. No matter what I do, the debugger does not detect my phone (Windows still won't detect it either).
I tried all the first aid solutions like restarting Eclipse, rebooting my computer and rebooting the phone. Just for the sake of completeness, I do have usb debugging enabled on my phone.
The only major change of the whole setup that I can think of is that my phone's OS has recently updated. I don't know the exact version it was before, right now it's Android version 4.1.2 (Kernel version 3.0.31-1160235, if this is useful to anyone). I tried plugging the phone into other computers, it gets recognized as a media/storage phone. I can't install the Android development tools and try debugging on any of these computers - I'm stuck with the one I've got.
I've tried reinstalling the usb drivers for my phone. It didn't help. In desperation (and against my better judgement) I tried installing Samsung's software, first AllShare Control, and eventually Kies. None of it helped. When I run Kies, it gives me the option of connecting through USB or via WiFi. However it won't detect my phone when I plug it in. When I click "Troubleshoot connection" (or some such thing, unfortunately Kies decided to use my native language instead of English) it starts reinstalling the USB driver. This process takes quite a while, and fixes nothing.
I'm basically out of ideas, I don't know what to try next. Any help would be appreciated.

Eclipse won't recognize G-tablet

I am trying to view a sample app on a real device (a ViewSonic G-tablet), but the device won't display in the "Choose a running Android device" area. The virtual devices show, but no real devices show (there is only one plugged in, the G-tablet). Some other information...
I am using a Mac with Eclipse SDK 3.7.1 w/Android
App is noted as debuggable in manifest file (android:debuggable="true")
G-Tablet is set to allow debugging
Device selection is set to manual in SDK
I CAN view files on G-Tablet using Finder
I have reviewed Android developer docs
I have searched a lot online for a fix, without success
Please also note...
There is NO option on G-tablet to allow "unknown sources". However, I have downloaded apps outside the customary channels (e.g. Firefox from the Firefox site) and it works fine.
I do NOT want to do anything to the G-tablet to void the warranty.
I have already checked for/installed updates using the Android SDK Manager.
The fixes I was able to find on StackOverflow related to this problem did not work for me. I am thinking the problem may be device specific. One fix discussed getting a driver for the device, but I couldn't find one.
Can anyone please help me figure out how to get the SDK to recognize my device? I'd appreciate any insight on this.
Can you export the app as an .apk and run that on your G-tablet?
also is the android:minSdkVersion set to a value lower than your G-tablet's version?
Found the answer after trying a zillion things. All that needed to be done to fix the problem was turn to OFF 'USB debugging' and then turn it right back on. I found the idea on this page... http://www.mobileread.mobi/forums/showthread.php?t=156247 . Hope that might save someone else hours of time.

How to test my app on my phone? I have Eclipse w/ Android plug-in

Where do I copy the apk file on the Motorola Droid? Which directory? Are there any possible issues I need to be careful of, it's also my personal phone...
To install an apk file, you need to execute
adb install /path/to/file.apk
While the droid is connected. I would avoid using any programs other an adb to install your application. adb will definitely follow the rules and you should be able to clean things up, etc if something goes wrong. That may not be the case with other programs.
I should note, this is assuming you are writing the program yourself. adb is a program that comes with the Android development kit (I assumed you are using this as this is a programming related site. If you are not referring to this and you are simply trying to install a program on your phone, this question would probably be better on superuser.com)
Edit To address your comment. When you select "run" from eclipse, and you have your droid plugged in, it should give you the option to select which device you want to execute the code on. Double clicking on your droid will automatically install and launch the app. You may need to enable the development settings within the Settings menu though for it to be recognized. To confirm that eclipse (really it's adb) can see your droid, launch a terminal or command prompt and type adb devices while the droid is connected. If it's listed there, you're good to go.
I guess I was making it way more complicated than it needed to be. If you have eclipse with the Android plug-in, all you need to do is go into the settings of the phone, then applications, then development. Set the Debug mode to on. when you compile the app with eclipse I guess it looks for an actual phone first, if it detects it, then it loads the app on it. If no phone is detected and you have the ADV set up right it loads it there. Easy... There is a setting about unsigned apps in the application menu, I set it to accept and turned it off after, my apps are still on the phone and work... I am not sure if it was needed at all.
I don't know whether this is how you're supposed to do it, but get Astro File Manager, and you can install your app wherever you place it.
There shouldn't be anything you need to be careful of if it isn't rooted. Programs are pretty well contained and can't do much outside of their own little Dalvik machine.

Categories

Resources