android-emulator

Why would you use the ternary operator without assigning a value for the “true” condition (x = x ?: 1)

吃可爱长大的小学妹 提交于 2019-12-17 11:17:50
问题 In the Android open-source qemu code I ran across this line of code: machine->max_cpus = machine->max_cpus ?: 1; /* Default to UP */ Is this just a confusing way of saying: if (machine->max_cpus) { ; //do nothing } else { machine->max_cpus = 1; } If so, wouldn't it be clearer as: if (machine->max_cpus == 0) machine->max_cpus = 1; Interestingly, this compiles and works fine with gcc, but doesn't compile on http://www.comeaucomputing.com/tryitout/ . 回答1: This is permitted in GNU as an obscure

How to customize the width and height when show an Activity as a Dialog

时光怂恿深爱的人放手 提交于 2019-12-17 10:53:28
问题 If I have defined a Activity: public class DialogActivity extends Activity{ @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(dialog_activity.xml); } } I would like to display the above activity like a dialog, so in the AndroidManifest.xml file, I declare this activity like below: <activity android:name=".DialogActivity" android:theme="@android:style/Theme.Dialog"/> Everything is fine at this point, my DialogActivity showed as a

ACCESS_FINE_LOCATION permission error emulator only

时光怂恿深爱的人放手 提交于 2019-12-17 10:40:52
问题 I'm having a weird error while using the emulator ONLY. I found one question that has the same issue 9 months ago with no answers at all... I'm using google play services locations to get locations in my app and I'm sure of my manifest permissions and everything works perfectly on my phone, the problem occurs when using an emulator only, and I tried different emulators on both my iMac and Windows machines. I doubt that emulators don't support this basic function! here is my manifest code: <

Can't start emulator for Android Studio

北城以北 提交于 2019-12-17 10:05:47
问题 I'm using Android Studio, the new official IDE for Android. I can't never get the emulator running. A black emulator screen containing the word "android" flashing appears, without change for minutes. I have waited more than 30 minutes without any change. Must I use eclipse instead? The IDE shows the messages: Waiting for device. C:\Users\Yasser\AppData\Local\Android\android-sdk\tools\emulator.exe -avd Nexus7 -netspeed full -netdelay none 回答1: You are getting blank screen So try to create an

Emulator: Process finished with exit code -1073741819 (0xC0000005)

◇◆丶佛笑我妖孽 提交于 2019-12-17 09:52:10
问题 I'm using android studio 3.0.1, when I start my emulator I get many error messages, I've tried to solve each problem separately, I also searched a lot but nothing works for me. 12:24 م Emulator: init: Could not find wglGetExtensionsStringARB! 12:24 م Emulator: OpenGL backend 'angle' without OpenGL ES 1.x library detected. Using GLESv2 only. 12:24 م Emulator: Failed to eglInitialize 12:24 م Emulator: Could not initialize emulated framebuffer 12:24 م Emulator: Warning: requested RAM 1024M too

android.view.InflateException: Binary XML file line #2: Error inflating class <unknown>

我的梦境 提交于 2019-12-17 09:46:10
问题 I am developing a simple app. Just finished the home screen. If the orientation changes more than two times, it is throwing the error and application is force closing. My activity Code : public class PasswordActivity extends Activity implements OnClickListener { Button login; Button forgot; Button register; private static final String PREFERENCES = "prefs"; private static final String PREFERENCES_NAME = "pref_name"; SharedPreferences settings; private Cursor c; @Override public void onCreate

Emulator not running

谁说我不能喝 提交于 2019-12-17 09:33:23
问题 My AVD Emulator is not running after I changed my Hardisk to other MotherBoard i5 3GHz processor without re-installing OS. OS: Ubuntu 10.10 my emulator is not running thru eclipse. when I click Run As.. Android application. Then I try to run thru the command prompt then its showing some error as below. padmakumar@padmakumar-desktop:~$ emulator -avd JellyBelly Failed to create Context 0x3005 emulator: WARNING: Could not initialize OpenglES emulation, using software renderer. Segmentation fault

Android emulator not rotating to landscape

♀尐吖头ヾ 提交于 2019-12-17 09:30:28
问题 When i try to switch the orientation of my emulator, the emulator window rotates and the orientation of the emulator screen stays as it were. Can anyone tell me what is the reason for this ?I have tried all the answers from StackOverflow and nothing seem to help 回答1: Some of the emulator targets like 4.4 (API level 19) and 2.3 have a bug. Change your emulator to target version 4.2 or 4.3 and try to change the orientation. See the history of this bug: https://code.google.com/p/android/issues

Android: UnknownHostException

喜你入骨 提交于 2019-12-17 08:54:31
问题 I am using Android SDK 2.2, testing my application with the emulator. I want to send a HTTP Post. When I do I get a UnknownHostException. I have placed the required permissions <uses-permission android:name="android.permission.INTERNET" / > in the manifest.xml. Also I can open the browser on the emulator and navigate to the URL with no problem. Here is my code: HttpClient httpclient = new DefaultHttpClient(); HttpPost httppost = new HttpPost( uri ); HttpResponse response = null; try { // Add

Difference between iPhone Simulator and Android Emulator

本小妞迷上赌 提交于 2019-12-17 08:23:26
问题 What is the difference between iPhone Simulator and Android emulator? I have heard people saying that Emulator really emulates the target device which is not true in case of simulator. I think Android emulator mimics the processing speed of the target device, the memory usage, but a simulator does not emulate the device. 回答1: Disclaimer: I'm only an iPhone developer, not an Android developer. You are correct, the difference between emulators and simulators is that emulators mimic the software