I'm new to the Android OS and I am having trouble interacting with a virtual device. I've installed the Android SDK + Java + Eclipse and I'm trying to get a virtual device running and debug an apk I have.
I create a AVD and start it up and get this basic screen below but none of the other Android OS options you'd see on a standard phone. I can't even really control this device as the buttons seem to have no effect. I can't get into settings or see default installed applications, etc..
What am I doing wrong? I'd expect to have a basic clean Android OS startup when I launch these virtual devices but I get this funky screen and can't do anything with it, controls don't seem to work.
Worth noting I am doing this from a VMWare Workstation running Windows 2012 R2, not sure if there are issues if I'm running this all in a VM.
UPDATE:
OK so it appears I was using the Android 4.4W which I think is for wearable devices and why the OS was basically empty. I changed it to Android 4.4.2 x86 by cloning a Nexus 5 and now I just get a blank screen when I try to start the emulator. Here is a screenshot, any ideas?
Update:
You are using Android Wear API target, please try with regular android API (L preview or API 19 or below). I was able to reproduce your issue if i used Android Wear Target, it works if i used non-wear target. Android wear target is for 'wear' device types.
When configuring the AVD, you can pick different "skins" , please see below highlighted in redbox
If you are using a custom (or vendor) defined device type, go into AVD Manager -> Device Definitions and double-click your device entry, it will open the below window, make sure Buttons tab says Software
You can also navigate the emulator UI with keyboard shortcuts, often quicker this way.**
A. Ashoke is right about using skins, you may choose a skin when you create or edit the emulator. Here is a screen-shot. Check the 'skin' dropdown. (It may not be available for some 'devices' you select here.
You are using VMWare, so you might be behind a proxy. You may need to provide proxy, using following steps -
Click on Menu
Click on Settings
Click on Wireless & Networks
Go to Mobile Networks
Go to Access Point Names
Here you will Telkila Internet, click on it.
In the Edit access point section, input the "proxy" and "port"
Also provide the Username and Password, rest of the fields leave them blank.
When you will load it for the first time, it may again ask for your credentials. So provide there as well.
Related
I am trying to run some tests of an Android application I am developing. The question I have is if it is possible to create an actual android device with its settings not just skins and the device's layout using Android Studio or a Virtual Machine, in order to see how application operates on other devices.
Would really appreciate if anyone could help.
You can use AVD Manager in Android Studio. You can create Android VM with it. You can customize :
What Android Version runs on it
The device screen size
memory
camera
storage
You can send custom inputs
Physically moving the device
Custom GPS coordinates
Send sms and call
Change battery level
etc
It is more than a skin, you can access the file system with adb, navigates the settings etc.
What you can't do is having the custom software layers made by manufacturers (i.e. OneUI from Samsung). It is stock Android
The emulator seems to be a standard qemu running a complete android system, so it's not only a skin.
If you want to test on real devices, you can have a look at Firebase Test Lab, which offers actual devices for testing, for a fee. See https://firebase.google.com/docs/test-lab/android/available-testing-devices on how to get the list of devices. Another option is Browserstack, which seems free for open source projects.
I am trying to test a website responsiveness to see if it works fine on Android devices, but I don't have an Android device. Is there a way to test website responsiveness on Android Studio? I have already tried resizing windows and all those websites that do that. What I want is a software that emulates the Android operating system. If yes, please share how. Thank you.
Yes, you can test a responsive website using Android Studio's emulator. Here are the steps to do this:
Download and install Android Studio - https://developer.android.com/studio/
Launch ADV Manager (Android Virtual Device Manager) within Android Studio and create a new virtual device
Click the play button to launch your app. Choose the device that you created in ADV
When the emulator opens, close the app that opens on the emulator and navigate to the web browser on the device. You should be able to test your website without issue now.
If you run into problems, make sure that you have all updates installed in Android Studio.
Here is a reference that you can use to get the emulator up and running: https://developer.android.com/studio/run/emulator
Open a Chrome Browser -Right mouse click and select Inspect Element.
To the right of the tab Elements is a picture of a phone. Click That. Then you will see the browser resized.
Go to the top drop down menus on top to get some awesome choices.
Select one of the options from the Device drop down.
Then select one of the options from Network drop down.
Reload the page while doing a speed test from the far right tab.
Then you have a single user analysis of your app. For multi-user tests use JMeter.
i m starting (or at least trying to) developing android application(s) and I m using eclipse for it along the android sdk.
Now I m wondering if there's a faster way to "test" and tryout something newly writen in the code than starting it in the emulator?
I'm wondering because I m running on 8gb ram and q9550 (quadcore) and it takes some time (let's say 20secs) to upload and start the apk and now
I'm wondering if this really is the only way to test since it requires huge amount of time, especially when I'm trying something new which doesn't work and thus I'm always gotta run it like this let's say like 20 times until I figure out what's wrong with my code...
You can connect your android phone using USB debugging mode and debug your code. If you can't do that, you can export an apk file (which is quick) and use dropbox/gmail to send it to your phone. I am not a big fan of emulator :)
Here's how to enable usb debugging
http://www.groovypost.com/howto/mobile/how-to-enable-usb-debugging-android-phone/
I would recommend running on your device rather than the emulator.
http://developer.android.com/tools/device.html
In short:
Turn on "USB Debugging" on your device.
On the device, go to Settings > Applications > Development and enable USB debugging (on an Android 4.0 device, the setting is located in Settings > Developer options).
Set up your system to detect your device.
If you're developing on Windows, you need to install a USB driver for adb. For an installation guide and links to OEM drivers, see the OEM USB Drivers document.
If you're developing on Mac OS X, it just works. Skip this step.
If you're developing on Ubuntu Linux, there is a detailed guide in the link above.
Now in eclipse, your device should be available to run on.
In the eclipse toolkit, you have the option to run it directly on a device. It's rather quick to do so.
Enable USB debugging as well as installation of apk from sources other than the market. Then assuming you have already setup the required drivers/settings to connect to your phone via ADB, you should be able to run it on the device and debug. In the run dialog, it will list all available devices and you can simply select the one you want to use.
If you already have a run entry (i.e. you've already run your application),
select your project
click Run -> Run Configuration
You should be in your application run configuration (on the left under Android Application -> Your_App).
In the Target tab, you should be able to select your device. It will likely already be in "Automatically pick compatible device...". On my setup, it will run directly on my phone if it's the only available device. You can select Always prompt to pick device which will let you choose every time.
Eclipse plugin (ADT) information: http://developer.android.com/tools/help/adt.html
Information about setting up your device: http://developer.android.com/tools/device.html
I know android emulator is too slow.
You can either use device or
try bluestacks it saves lots of time.
User device only when you want to test your app for particular device.
Here is what you are looking for :
http://developer.android.com/tools/device.html
To summarize:
Plug your phone to your computer with a USB cable.
Make sure the drivers are installed and your phone properly connected.
Make a Ctrl + F11 from eclipse.
It will build the apk, transfer it to your phone and then launch it automatically.
If you have unit tests, Robolectric lets you run them without using the emulator or the device.
you can download bluestacks as emulator, as it is really fast.
after then make settings in eclipse as window->preferences->android->build -> then uncheck the 3rd checkbox written as "skip packaging and...", then apply and restart the eclipse to take effect.
now open the bluestacks in background and just double click the apk file in bin folder of eclipse and bluestack will install it in 2 to 3 secs and you can directly see the result.
NOTE here that you have to only save the file ,you working on in eclipse and only double click on apk, and result will directly appears to bluestacks. Without uninstalling and reinstalling apk in bluestacks.
and you can delete your apk also, it automatically immediately create
a fresh version of apk (thus not required) as soon as you save all your files apk will be updated.
Google BlueStacks.
It runs on Windows and it's really fast.
I'd like to check for memory leaks in my Android app using the DDMS feature in Eclipse. When I launch an emulated device, the threads display properly for the emulated device, starting with 8600 and up.
However, when I connect my Droid to the PC, the device shows up just fine in DDMS. The logcat is generated correctly, and I can view the file structure. However, threads do not display. I get "no client selected" in the Threads pane, and there is no drop-down icon next to the device listing.
Do I need to change some particular setting in Eclipse? Is this maybe a driver issue?
Eclipse Preferences (OSX) > Android > DDMS > check Thread Updates Enabled by Default
Add Android Device view to get device pan(e) noted above
Set android:debuggable=true (two g's) in app tag as noted above
Run your app in emulator
Select device in device pane
Click the update threads button
Enjoy
Make sure you have android:debuggable="true" in you application tag in the manifest file
This is expected behavior. The issue is your droid is not in debug mode. Notice that in the Devices pane, beside the version number, debug is stated against the emulated device but not in the case of the droid.
From what I have found so far - on the droid, only an app can be run in debug mode; and only this will be listed under your device in DDMS.
I don't know how to run(/boot) the entire droid in debug mode, or if it is possible. So far as it appears, there is no way to boot an entire real device in 'debug' more.
Go to DDMS
Select device in device pan
Look at header of this pane. You can see update threads
You can see thread and updates from device
If you use Intellij Idea like me - run monitor from tools-> android, other way Idea built in ADB conflict with ddms.
On Android Studio :
On the DDMS (Dalvik Debug Monitor Server) Screen:
Show View -> and then select the profiling view you need.
In Eclipse I am developing an application using Google APIs (maps) on a Nexus One.
When I launch the application for debugging on the device i get:
"Automatic Target Mode: Unable to detect device compatibility. Please
select a target device."
and the "Android Device Chooser" pops up.
I can select the Nexus One and everything is ok. It annoys me, however, that i need to select the device every time i want to test something.
Setting a build target name to any standard android version (not using Google apis) automatically launches my app without showing the Android Device Chooser. But since i need the maps, that is not an option for me.
Is there a way to force an application using Google apis, to be launched on the attached device without showing the Android Device Chooser?
Go to your project properties. Select Run/Debug Settings, click the Edit button of your run configuration, select the Target tab in the upcoming dialog, switch the selectboxes to "Automatic" and check the checkbox by your device.
This is an irritating acknowledged defect (Issue 11373) reported on the Android Issue tracker.
The Issue has status Assigned and presumably will be fixed.
I was just having this problem and traced it to my USB connection. I had started using a 2.0 hub, which I would think to be sufficient. It's powered. When I plugged the USB cable into the laptop itself, problem solved.
Good luck.
Mark
This may be useful to you.
First Find the Your device OS Version & API Level.
IN Eclipse, Then Right click on Your project select Property, In
Property's window select Android, In it select Project Build Target as
per your device OS API Level.
For example i have Samsung Galaxy Fit - Android 2.2 os API Level - 8
so i,selected the Google APIs, Google Inc, 2.2, 8 .
Let me know this is useful for you or not ?
Once the popup comes up to choose a device, select your device and then check the Use same device for future uses at the button of the Dialog.