"Display over other apps" - java

I'm not a regular Android user, but I'm building an Android app and the latest versions of Android now show a pop up when you first install & run an app saying "Display over other apps" with a toggle for several built-in apps and my apps.
I've been googling for a while and haven't been able to find any information as to these basic questions:
What is this?
Does my app need to display over other apps?
If not, can I disable this pop up from coming up?
Any links to documentation would be great.

This happens because your application asks for SYSTEM_ALERT_WINDOW permission! If your app doesn't need it, you can remove following line from your Manifest.xml file:
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />

your device OS is above the android veriosn 6.0 and sometimes devices gives as that pop-up when you will ask for permission. You can check this link https://screenoverlaydetected.com/draw-over-other-apps/
better option is format your device as it will show in every apps.

Related

WRITE_SETTINGS permission Android

I am making a flash light app. So naturally most devices now a days have a built in flash for the camera but when a flash is not present I want to use the screen as the flash light. To make this functionality work I want to adjust the screen brightness so it can act as the flashlight.
To change the brightness I used code from this post. The code works fine and I can change the brightness without issue. As a side note this code I used works on Physical android 8.1, 10 and 11 devices.
My first question comes from a lint warning I get when adding the <uses-permission android:name="android.permission.WRITE_SETTINGS"/> permission. The warning says
"Permission is only granted to system apps". Now I can obviously just suppress this warning, but my worry is when I upload the app to the app store Google will either reject the AAB or the app will no longer be a "System app" once its downloaded from the app store. Will suppressing the error do anything?
My second question is is this a false positive? Looking at the manifest permission docs WRITE_SETTINGS has no special permission besides for having to get the users consent buuuut WRITE_SECURE_SETTINGS definitely does. As per the docs for WRITE_SECURE_SETTINGS "Allows an application to read or write the secure system settings. Not for use by third-party applications." So could this be lint thinking WRITE_SETTINGS is WRITE_SECURE_SETTINGS?

Why I'm unable to install application in my phone. Redmi 7s Connected already but it's not showing to install application in Android Studio. Why?

Android Studio Not Showing My Phone for Run Application:
I want to run my developed application directly on my phone but I'm unable to run this. Because It's not showing in android studio. It also not working on emulator also. I already ready Google Development Guidelines(https://developer.android.com/studio/run/oem-usb.html). But these are not working for my system.
Have you enabled Developer mode on your phone?
If you haven't done yet follow these steps:
Go to settings -> About phone.
Tap on Build number 7 times and the developer option will be on.
If you have already enabled it then:
Go to Settings and find Developer options.
Check whether it is enabled or not.
Swipe down and find USB debugging. This option should be enabled. (Also enable Wireless ADB debugging if you're running app wirelessly)
Sorry for the late answer
I am also facing this issue couple of month ago, I had checked that I had enabled the USB debugging in developer but there is an issue with the Redmi phones that along with the USB debugging you will need to do the following
Go To Settings > Additional Settings > Developer Options
Enable USB debugging
Enable Install via USB
Disable Turn on MIUI optimization
On Select USB configuration select MIDI or File transfer (this is
what solved the problem for me)
also, keep in mind to give an RSA permission
you also check the link https://developer.android.com/studio/run/device?hl=ro
I have solved my problem on my own. The problem was in Android SDK. I'm using 2 windows in my same pc so I just used android studio on my another window then it's was working perfectly so I thought i have to try with changes that windows Android/Sdk folder in other windows which one I had problem. So I just copy (C:\Users{MyUserName}\AppData\Local\Android\Sdk) in getting the problem window and try again the android studio & Wawu... It's starting working. I hope it's will be helpful for you also.

How to get all <uses-permission> of other particular application installed on the device (Android)?

I want to get all permission that compare in the Manifest.xml of other application, is it possible?
Unfortunately, you can't even check if this app is installed on same device...
Google doesn't allow to do this.

Android TV app runs on mobile

I want to create app that targets only Android TV. I use this in my manifest
<uses-feature android:name="android.software.leanback"
android:required="true" />
considering on developers.android it says:
If you set the required attribute value to true, your app will run only on devices that use the Leanback UI.
But i can run my app on any device(tablet, phone or TV). Am i doing something wrong? I also added activity with android.intent.category.LEANBACK_LAUNCHER.
Does this only happen in debug mode? And if so, does this allows me to test my TV app on devices like Android mini pc or Kindle Fire?
I found that by setting as you did, it limits the device compatibility on Google Play. But you can still test on other devices using adb (it works OK with 7 and 10 inch tablets, but the UI is too big for my Nexus 4). However, you can only launch through adb. The icon will not show up on non-Android TV devices even though it is installed.
Am i doing something wrong?
Not that I can see.
Does this only happen in debug mode?
It happens when you are not distributing through a distribution channel like the Play Store. Quoting the docs for <uses-feature>:
The purpose of a declaration is to inform any external entity of the set of hardware and software features on which your application depends.
Here, "external entity" primarily is a distribution channel, though in principle it could be anything else that has access to the APK and chooses to examine it.

Android app force closes when theme is set

I'm just getting started with Android dev, done a few tutorials, now I'm working on a simple app. On both the emulator and my phone (Android 4.0.3 emulator, Android 4.1.1 Atrix HD) apps are displaying in what I think is Holo Light. I'd rather have it be Holo Dark, but when I add the following line to the application block in the Android Manifest file: android:theme="#android:style/Theme.Holo" the app compiles fine but force closes as soon as I open it.
What am I doing wrong? I'm sure it's something really simple, but as I said I'm new to this. Thanks in advance, y'all!
If you want to use a theme for all the activities of your application then you need to use
<application android:theme="#style/CustomTheme">
in AndroidManifest.xml.If you want a theme applied to just one Activity in your application, then add the android:theme attribute to the activity tag instead.So need to know what type you use in your application.However see these things which will clear you more..
http://developer.android.com/guide/topics/ui/themes.html
http://www.androidengineer.com/2010/06/using-themes-in-android-applications.html
The simplest thing you can do and you should always do is to read logs why does it crash. The log will tell you the reason of you crash. Please post the reason including logs from Logcat and only then ask about fixes:)

Categories