android-emulator

How to simulate hardware media control buttons on an Android emulator

别说谁变了你拦得住时间么 提交于 2019-12-05 16:47:09
问题 Android supports hardware play / pause buttons on headsets and attached devices. I am trying to find a way to test support for those devices on an emulator. The Android documentation talks about how to add support for hardware playback controls, but, unfortunately, I can't find documentation of how to emulate them. Thanks! 回答1: You can send keyevents using adb adb shell input keyevent <keycode> keycode for play - 126, pause - 85 (see KeyEvent) 回答2: There is another way to do this, from an

Segmentation Fault trying to set battery level in android emulator

耗尽温柔 提交于 2019-12-05 16:21:34
I am using Android SDK tools on Ubuntu. I have created a Nexus One Virtual Device that uses API-17. I run this emulator which attaches to port 5554. After this, I connect to this port using telnet, and try to set power level: power capacity 40 But, when I do this, I get segmentation and emulator gets killed. Also, when I goto Settings > Battery in emulator, it shows "Battery Status Not Available" and battery is 0%. All other commands work, except the power related ones. What should I do? I just had the same problem and luckily found a solution. Go to your Android Virtual Devices folder. On

Detect when user enters data into edittext immediately shows answer [closed]

五迷三道 提交于 2019-12-05 15:43:05
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 6 years ago . How is it possible to detect if a character is inputted into an EditText which makes it from 0 to 1 characters long and then perform some action? 回答1: Since you have a rather abstract question, let me attempt an

android emulator won't start on ubuntu 12.04 after when run from ssh

喜你入骨 提交于 2019-12-05 15:27:46
问题 I built the android source code based on the http://source.android.com/source/building.html on Ubuntu 12.04 and when I run the emulator I'm getting the error and emulator won't start: WARNING: Application calling GLX 1.3 function "glXCreatePbuffer" when GLX 1.3 is not supported! This is an application bug! X Error of failed request: GLXUnsupportedPrivateRequest Major opcode of failed request: 146 (GLX) Minor opcode of failed request: 16 (X_GLXVendorPrivate) Serial number of failed request: 20

Unable to simulate location data in Android emulator

被刻印的时光 ゝ 提交于 2019-12-05 14:24:26
I'm trying to test my app, which uses geolocation using the emulator. Several methods are described here . I'm going to Window->Open Perspective->DDMS , then entering lat. and long. one in Location Controls and then I hit "Send". But it doesn't work. Instead I see the following error: Unable to send command to the emulator. Why is this happening!? I don't think my app is the problem because I tested with the emulator's default browser and it also cannot access location info. Details: OSX 10.9.4 AVD_for_Nexus_4_by_Google targeting v4.4.2 Eclipse IDE for Android Developers 23.0.2.1259578 Update:

Emulator: cannot find ram.img on ubuntu

穿精又带淫゛_ 提交于 2019-12-05 13:56:10
I simply set up a Nexus 5x device with API 27 in the default emulator in Android Studio 3.5. When I was trying to boot the device, the device just closed after the first 'Google' sign. The event log there's the following output: Emulator: statvfs('/home/qiufeng/.android/avd/Nexus_5X_API_27.avd/snapshots/default_boot/ram.img') failed: No such file or directory Emulator: Process finished with exit code 139 (interrupted by signal 11: SIGSEGV) However, the ram.img exists. I also changed the permission of the whole directory and files and It didn't work. I've tried cold booting it... And that broke

Simultaneous Running HAXM AVD Emulator Limit

爱⌒轻易说出口 提交于 2019-12-05 13:34:08
To elaborate on the title, I'm running many simultaneous AVD's for my automated build/test processes (think concurrent builds for a project, or multiple projects building at once). Most problems that people have with running multiple HAXM accelerated AVD's at once is memory related. THIS IS NOT MY PROBLEM (I think). I have a pretty beefy i7 machine with 32gb of ram. When installing HAXM, I allocated 28gb (sorry, I can't post more pictures without more rep). Here is my AVD configuration(s). Observe, only 1024mb of memory allocated per emulator: AVD Config: Here are my system specs: OS Name

4.1 android emulator not detecting sd card

拥有回忆 提交于 2019-12-05 12:59:48
I used to use a 4.1 kitkat x86 android emulator with an sd card for testing. After upgrading Android Studio to 2.3, i'm no longer able to access the supplied sdcard in android making testing impossible for me. Google hasn't had answers for this and i also fail to see any clues in the emulator or adb logs. The avd has been recreated new, (i deleted the old avd folder to prevent goop from fouling things up). It simply doesn't work anymore. Here's the output when starting the emulator on Kubuntu 14.04 amd64 $ LD_LIBRARY_PATH=/data1/usr/local/android-sdk/emulator/lib64/qt/lib:/data1/usr/local

INSTALL_FAILED_INVALID_APK error with debug version code 1 inconsistent with 0

陌路散爱 提交于 2019-12-05 12:27:32
I have built an Android app on Android Studio version 2.3.3. As I try to deploy the app to a phone (lennovo) or an emulator (GenyMotion) I get an error, which says: INSTALL_FAILED_INVALID_APK: /data/app/vmdl235652946.tmp/4_yCommerceApp-b_c-dev-debug version code 1 inconsistent with 0. I have looked at various posts here and tried the approaches below, none of which seems to help Did a clean build followed by a rebuild after a restart of the Android Studio Disconnected and reconnected devices I deleted the .idea , .gradle and build directories and built again Any suggestions to solve this pls?

how to emulate a real external sd (update: removable storage) card in Android Emulator

橙三吉。 提交于 2019-12-05 12:24:01
I try to emulate a external sdcard as it would be in a real device. In a real device the external sdcard is not writeable except you use the new "Storage Access Framework" (API 21 & 22) When I add an sdcard either with a file or Size ... I always get a writeable sdcard, which is not true with a real device (I guess). I could create the Folder "CreateFolder" with just ( I know, I should not use the direct access, but this is only for a test to see if I have write access): String spathWriteTest="/storage/sdcard/"; new File(spathWriteTest + "createFolder").mkdir(); Any Idea, howto emulate a real