I'm wondering why in every tutorial I watch the preview section looks like this: i.e it has the actual device shown as preview and has a button for linking it to an activity
When mine looks like this: for some reason doesn't have the device
I'm sure I've just not installed something correctly or not clicked a checkbox, or a version of something is wrong but after some googling i can't seem to work out what it is. Any help would be greatly appreciated.
Newer versions of Android Studio do not show the device bezel by default. Everything looks installed correctly.
Look at the Android Studio window title.
Your video is using 2.0 Beta, and your newer version just doesn't have the bezel.
You'll also notice there's different buttons around the screen preview area.
You could disable it in older versions, I'm not sure if it's completely gone but it was probably removed because it took up screen space and didn't serve much purpose
Related
I just launched my game on Google Play, it works fine on Android devices, but if I try to boot it though Bluestacks emulator the Unity splash (sometimes) shows and after that only a dark grey screen and nothing happens
This is how it looks after the Unity Splash intro
I have tried to install the game though Google Play and by installing the Apk file itself, both ways dont work.
I'm using v2021.1.18f1 to build the game
The game itself is here https://play.google.com/store/apps/details?id=com.BrokenGlass.TapNinja
Thank you.
UPDATE
I fixed it by changing a lot of settings in the Player Settings, not sure which is the one that actually made it work. Raguels answers was partially correct, but changing only the Graphics API did not work.
This is how my Player Settings look
It is happening because you didn't include some of the supported graphics API in your android build. Bluestacks might not work if you omit OpenGLES2. Make sure you have OpenGLES 2 in your supported graphic APIs. You can find it in Project Settings/Player/Other Settings
To make it available, you will have to change the Color space from Linear to Gamma.
For me worked changing "Optimized Frame Pacing" to disabled, in Proyect Settings/Player/Resolution and Presentation
I have been facing this issue while creating any android program/app using android studio. Whatever I design in android studio, it is not displaying properly as designed in android studio while running the app on my phone.
In short, sometimes size and the places of the controls get changed while running the app on my android phone. Please help. Thank you.
That's probably because of the difference in screen sizes of your preview and your physical phone . I've recently started using constraint layout and I think it's the best so far, a bit confusing at first but easy to understand it, it even has an option for percentage of width/height of the total screen for a view. Try that out.
I'm currently working with Xamarin for developing an android app. The structure of the app is really simple yet but a big problem appeared concerning the rendering of my main page. First, it's important to know that I'm supposed to develop for target API 23 so Android 6.0.
And every time I test my application on my Android 6.0 device via USB-debugging the design is totally messed up with my only (!) button duplicated many times and the textViews mixed up over the screen (As shown in the picture link below).
Even though I am new to Xamarin and Android (and C#) I have my settings (as I think) in perfect order. The minimum API level is 21, the target SDK version 23 (Android 6.0), my device runs version 6.0.1, the target compiling framework in properties is set to 6.0, the manifest is set up as I mentioned before and even my "Designer" window with the layouts .axml is set to v23.
I really don't know what to try next, because I want to start coding further. Would be nice if sb could help me out with that.
I have already tested the code of the app on a different API level (26 I think) and it worked perfectly fine with my Galaxy S9 in Debugger mode. Everything looked like it was designed in first place.
I also tried different AppThemes in Visual Studio but not one of the 7-8 I tried worked in any way different except for the colors.
The android app does only switch when clicking the button, texthttps://imgur.com/i0xChVniew 2 into the current date and time. I'm really sure, that my code is not the problem.
Picture: How it should look (In Xamarin)
Picture: How it looks on the phone
I am using the visual editor in Android Studio. In there, the text is really big, like how I want it to be. But when I build it on a physical device it is default size.
Thanks in advance!
simply create many layout that support pixels make all your layout handle your show way
read this to understand the idea
https://developer.android.com/training/multiscreen/screensizes
and do this in your code then check the devices
https://stackoverflow.com/a/8256573/6998825
there's also something else you may have not noticed yet
in android studio Preview Layout you can choose your the preview device as your actual device or same as it.
this way the preview design will be same as your device. but for other devices you should have above answers in mind.
Background
I have a live wallpaper that uses the relatively new API (from Android 8.1 - API 26) to request the OS to use customized colors:
https://developer.android.com/reference/android/service/wallpaper/WallpaperService.Engine.html#notifyColorsChanged()
https://developer.android.com/reference/android/service/wallpaper/WallpaperService.Engine#onComputeColors()
The problem
On Android 8.1 and even on Android P DP1, all worked fine with these functions, as they did what normal wallpaper do with the colors, affecting the notification drawer if the color that was chosen is dark enough. Here's a comparison between choosing a non-dark color and choosing a dark color background:
Thing is, on Android P beta (DP2), even though this function get called, it doesn't do anything, ever.
To test it on your own, you can try the full project I've published here.
What I've found
I thought that maybe the API has changed, so I've tried to find which functions are available, but I couldn't see anything that's new.
I've tried to use various ways to return the customized colors:
a. WallpaperColors(Color.valueOf(0xff000000.toInt()), Color.valueOf(0xff000000.toInt()), Color.valueOf(0xff000000.toInt()))
b. WallpaperColors.fromDrawable(ColorDrawable(0xff000000.toInt()))
c. WallpaperColors.fromDrawable(BitmapDrawable(completelyBlackBitmap))
d. WallpaperColors.fromBitmap(completelyBlackBitmap)
Sadly none worked (fromBitmap is the one that works well on Android 8.1).
Seeing this, I've re-checked that my code is ok, and noticed that the built in live wallpaper works fine, and that selecting a solid black wallpaper (instead of live wallpaper) also affected the UI of the OS.
Seeing that it works with built in apps, I've reported to Google about this issue, only to find out that they don't understand what I'm talking about, and each time I've tried to tell them they've misunderstood it differently:
https://issuetracker.google.com/issues/79404938
https://issuetracker.google.com/issues/79665215
https://issuetracker.google.com/issues/80029770
I wanted to make sure it's not an issue with just my app, but with others too, so I've tested Muzei live wallpaper app, which is actually made by one of Google's own developers. The issue indeed occurs there too, while working fine on Android 8.1.
I was just curious, and wanted to check if the issue could occur if I've moved Muzei to be a system app, but after doing so, I've seen the issue still exists.
The questions
How come it doesn't work anymore?
Is there a workaround/fix for this?
Why does it work fine for built in apps and for normal wallpapers, but not for third party apps? I don't think their code is any difference.
OK, Google confirmed it's a bug, which will be fixed on later version:
The development team has fixed the issue that you have reported and it
will be available in a future build.
And, it works fine now on DP4 (beta 3) of Android P.