Question

I am trying to get started developing in Android. I have programming experience with Java (and Eclipse), but not with Android. I installed the ADT bundle, and I followed the instructions in this tutorial exactly, but on both of my laptops I have had the same problem: the app (MyFirstApp) won't run on my Android device (Nexus 7). It appears that absolutely nothing happens when I press the Run button. I do have USB debugging turned on on my tablet.

My first laptop is a 64-bit HP Pavilion dm4 (6GB RAM), running Windows 7. I downloaded the USB driver for my tablet, and it is recognized when I plug it in. This laptop is somewhat old and slow, and ADT kept freezing up anyway, so I'd prefer to get it working on Linux.

My second laptop is a 32-bit Acer C7 Chromebook (4GB RAM), in developer mode, running Ubuntu. I dual-booted Unity using a Crouton chroot via this method. I know this isn't the machine most people would choose to code on, but theoretically, it should work, right? Or would I need to dual-boot traditionally, instead of using a chroot?

Était-ce utile?

La solution

  1. Make sure your phone/tablet is set to debugging mode. It's in developer options, I believe. Or USB connection settings.

  2. When you plug it into your laptop, after enabling USB debugging, it should install some drivers. If it doesn't, something might be wrong.

  3. Whether it installs drivers or not, once it's plugged in, open whatever app you were trying to build again. In Eclipse, next to the Run button, there's a little arrow. Click that and go to run configurations.

  4. On the left side of the dialog, click Android Application Project

  5. Click on the radio button that says Launch, then click that drop-down option on the right and select your main activity.

  6. Click the Target tab up above, and select the radio button "Always Prompt To Select A Device." Click apply, then click Run, and it should ask you to choose a device. Your phone/tablet should be on the list of selectable devices.

Autres conseils

Are you sure you installed the driver correctly?

If so, try switching Nexus 7's usb mode from storage mode to pics transfer??/view?? mode(forgot the exact name here).

Hopefully it does help.

Licencié sous: CC-BY-SA avec attribution
Non affilié à StackOverflow
scroll top