android emulator setup not quite right - android

When I run an app on my android emulator after following a tutorial, my app always looks different than it is supposed to. My default background is white with black text but every other emulator I see on the internet has a default black background with white text. Also when I create a Spinner it doesn't have the green selection circles that seem to be default on all the other emulators. I'm using eclipse Juno with android sdk rev 20. It looks like I didn't install something or enable something but I don't know what I'm missing. Here are some pics to show what I mean.
My emulator where I have a Spinner being clicked:
What other emulators seem to look like when Spinner is clicked:

It's not an emulator issue but the theme that you have applied to your application and the target SDK that you are running your application. Please change target SDK in the manifest file to 10 or lower and comment or remove the line that applies theme: android:theme="..." Then you should achieve desired effect.

It's not the emulator. It's the Android Version you are running on them. By default a Spinner will look like the second image in Android 2.0-2.3.3 and the first picture shows a spinner on Android 4.0+, which in normally like a dropdown menu.

Related

How to configure Toast icon in Android 12?

Starting with Android 12, Google show a toast message with an app icon.
My application have launcher icon. Android 12 splash screen show app icon correctly.
Show toast by code
Toast.makeText(this, "Show simple toast", Toast.LENGTH_LONG).show()
compileSdkVersion/targetSdkVersion 31
android emulator Google play Intel x86 Atom_64 System Image API Level 31, Revision 8.
How can i change this default toast icon?
For me a simple restart of the device did the trick.
I had not restarted my test phone after the update to Android 12 at all. I experienced the same odd bug that a generic app icon was shown in Toasts issued by my app. I tried changing the Manifest as Mickaël‘s answer suggested. No luck. I ended up with the exact same Manifest the app had before I started debugging … and then I restarted the device. My app now displays the correct icon in Toasts reliably. What happened? Unsure. I suspect that a restart may trigger an icon cache refresh that crawls all installed apps in search for new/updated app icons.
Seems like this issue was reported to Google, and assigned to a Google engineer:
https://issuetracker.google.com/issues/202863198
From me the restart of the phone work as well. The toasts now show the proper App Icon, configured in my apps. If it does not work for you please review this statement and check if everything is properly set for you app icon. I hope that this will help :)
https://developer.android.com/studio/write/image-asset-studio
PS: There is one more place from which you can build your app icons https://romannurik.github.io/AndroidAssetStudio/index.html
After running a few tests, I found that setting <application android:icon="#drawable/ic_stat_name" ... with a drawable generated with Image Asset > Notification Icons is overriding the default toast icon.
However, this doesn't work with a drawable generated as Image Asset > Launcher Icons. So at this point, I guess something is missing in Android Studio's generation tool.

colors on android studio are different from color from the physical device

im creating an app and i changed the color of editext to #AE0202 and it looks great on the android studio but when i run the app on my physical device the color changes and is like orange instead of red my phone has android 11 cant figure out a solution (if i run the app on the emulator the colors are correct)

White screen on Android Emulator, but screenshot shows it working

I'm trying to run a sample Xamarin app and I think my Android emulator is acting up. I've tried enabling Hyper-V, increasing the RAM, telling it to use the host GPU, launching the virtual device from the command line instead of the GUI, and double checking that I have the correct version of the build tools for the version of Android I'm attempting to run.
As a test I've just run the emulator by itself without an app and have discovered that it still shows a white screen even when it is apparently running, somehow. The first image is what I get when I press the Screenshot button. The second image is what I actually see on my desktop. It's been like this for over 10 minutes.
Any advice? I've been Googling like crazy and can't seem to work this out.
Have you tried simply changing the renderer?
Go on the sidebar menu, click the 3 dots>Settings>Advanced and try changing the OpenGL ES Renderer

Default AVD in Android Studio

Does anyone know of a way (or if it's even possible) to set the default preview AVD in Android Studio v0.4.5. Every time I create a new activity it shows it in a Nexus 4 preview but as I have TEGRA Note 7 and have a custom AVD created for that, I want to see that as the default.
Is this possible and, if so, can anyone advise how to do it? I've checked all the settings but can't see anything that jumps out.
Thanks in advance.
In Android Studio 1.2.2, I was able to solve this problem by going to Run > Edit configurations...
From there, you can change the default emulator (avd) by clicking Defaults, then Android Application. From there, under Target Device, select your Preferred Android Virtual Device then click Apply or OK.
If that still does not work, you may need to also change this setting at the application level. Instead of clicking Defaults, click Android Application and select the name of the project in question. Then proceed to define the project-specific, preferred AVD as described above.

Android Holo Theme not working in Emulator

I added a themes.xml in /res/values-v11 and made sure that my Themes defined there extend "#android:style/Theme.Holo.Light" or "#android:style/Theme.Holo". When running my app on the Galaxy Nexus everything looks fine.
When running it on an Emulator with Android 4.0 or 4.0.3, the new Holo-Theme does not seem to take effect; the ActionBar Buttons are not displayed, etc.
Turns out that it worked, the "problem" was that the emulator by default is configured to have hardware buttons. Thus the ActionBar Overflow-Icons won't be shown. Instead the menu items will only be shown when the menu-Button is pressed.
To get a preview on what this would look like on a Phone without buttons, you have to create an AVD and add the property "hardware back/home key" set to false. Editing an existing AVD does not achieve this (confusingly).
Another problem are old tools. Make sure to use the latest emulator system images and sdk tools / plugins. Re-create the avd and you should be fine. (In between i had the theme not working at all in an ics emulator it just didn't choose the holo theme)

Categories

Resources