can't allow USB debugging with xperia XA1 - android

I'm trying to unistall an app system(it's spotify...) without rooting my phone.
I'm new to the concepts related to android and I'm following this tutorial
So I'm on the step 10 where I need to allow USB debugging to my computer
but when i press "ok", there is the following message : "Because an app is obscuring a permissions request, Settings cannot verify your response" and then I can't grant connexion to my pc.
Does someone know what can i do ?

I don't have your phone and I don't know what apps you have installed so I don't know the exact cause, but this most commonly happens when you have an app installed that has the "draw over other apps" setting enabled. Find the app at fault and either delete it or try to turn off the "draw over other apps" setting for the offending application.
What the error message is trying to communicate is that the button to grant permissions for the application can't be clicked because something is covering up the prompt buttons.

I found this problem when there is FB chathead on screen or when I set display overlay, etc But, I don't have XA1. Hope this can help other people.

Reset default settings and turn off the "draw over other apps" setting for none default apps and it should be working.
Settings --> General --> Apps --> Top right dots --> Reset App Preferences.

Related

Disabling "Connect to open networks"

I want to programmatically switch on/off Connect to open networks and Open network notification from the android settings:
https://source.android.com/devices/tech/connect/wifi-infrastructure
How can I do this? Do I have to use ConnectivityManager / WifiManager?
The reason for this is that I am annoyed by my phone telling me about "open" telekom wifi/hotspot when I am outside. Also I cannot find the settings page to turn these settings off on my Samsung Galaxy S7.
Update
As I have not found a viable solution programatically I have solved the problem the following way:
Remove public hotpots that I do not want to connect to from my "Saved WiFi Network" list. Use MacroDroid/Tasker to disable WiFi when I am leaving my home.
It seems you can disable Open network notification:
Settings.Secure.putInt(cr, Settings.Secure.WIFI_NETWORKS_AVAILABLE_NOTIFICATION_ON, 0);
But therefore you need the permission android.permission.WRITE_SECURE_SETTINGS which is only available to system apps.

How to lock LTE_ONLY mode?

I am working on an application that has a requirement to lock the RAT on devices. I just want to lock only two modes i.e. "LTE Only" or "WCDMA Only".
We can do this without using an app from phone dial app by running ##4636## and choosing Phone Information and the "LTE Only" or "WCDMA Only".
I have also tried QXDM to set these values on NV Item 10 but it doesn't persist on reboot. So if some one have good knowledge of QXDM and share that knowledge then it would be really helpful.
My final goal is to do this from Android application that has root access.

How to move an Android App in Auto Start List of Mi Note3, so it receives Push even app is closed

I am working on an android app and from last 2 weeks i am facing a issue in MI Phones that they don't receive Push Notification when application is in Background State or Inactive State. This is working great in other devices like samsung, micromax etc.
At last i solve it by Moving My application in Auto Start Mode through Device Permission Section
Security -> Permission Section -> Auto Start -> MY_APP -> Mark Toggle to On.
When i follow above steps i found that Facebook and whatsapp are already in AutoStart List, means it is possible to move an android application in AutoStart by code.
So can anybody please help me with some piece of code or Tutorials which i can follow to solve this issue.
You can use cordova-plugin-autostart by enabling autostart after boot
cordova.plugins.autoStart.enable();
If enabled is not called, then by default it will be disabled
cordova.plugins.autoStart.disable();
In the config.xml the following needs to be added
<gap:plugin platform="android" name="cordova-plugin-autostart" version="2.0.1" source="npm"/>
NOTE: Installation to the SD card will prevent the automatic start of your app after the boot
I have same issue with mi 3 but bro its not possible from lollipop and marshmallow cause of security reason. But if your phone is rooted then you can change it to allow.

How to "Restrict Background data" for selected app

I have a list of apps which consume high battery.
when I select one app, I want to "Restrict background data (Settings > Data usage > select app > Restrict background data)" for the selected app.
How Can I do this ?
Same question is asked at below link
Programatically toggle "Restrict Background Data"
And it says it can not be done.
You can run this command in the command line
svc data disable or svc data enable
You obviously need root to do that, like this:
Runtime.getRuntime().exec("echo svc data disable | su");
This should bring up root dialog if your device is rooted.
And it says it can not be done.
There is nothing in the Android SDK for this. Therefore, it is usually assumed to be impossible until proven otherwise. In this case, there is also a security aspect -- one app should not be able to control this setting for other apps, except perhaps on rooted devices.
You may try Reflection.I am not sure of it.

Huawei, logcat not showing the log for my app?

OK, logcat is showing system logs but it is not showing application log on my Huawei Ascend. If I switch to another device such as my Galaxy Nexus or Nexus 7 then for the same app (same APK even) log is displayed.
The Huawei Ascend is running Android 4.1.1, it has USB debugging switched on in developer options. This occurs for logcat run from either the command line or from IntelliJ. And I'm making sure that the correct device is selected - in fact I'm only plugging a single device in at a time. I've tried restarting adb, clearing it's buffer etc
I can see that the app is starting on the Huawei, I even get system logs showing that the Activity has started. But unlike on the other devices I get no app log in the Activity#onCreate (or from anywhere else).
08-08 20:55:44.050: INFO/WindowManager(431): Switching to real app window: Window{41ae8780 au.com.xandar.wirelesstiming.timekeeper/au.com.xandar.wirelesstiming.timekeeper.TimeKeeperActivity paused=false}
08-08 20:55:44.180: INFO/ActivityManager(431): Displayed au.com.xandar.wirelesstiming.timekeeper/.TimeKeeperActivity: +387ms
How can the application log not be getting delivered?
OK, since I had another Huawei Ascend I ran into the same problem. This time I have the exact answer. Follow these instructions (from denispyr's answer on Why doesn't logcat show anything in my Android?)
Dial
*#*#2846579#*#*
and you will see a hidden menu. Go to the Project Menu > Background Setting > Log setting and define the log availability (log switch) and level (log level setting).
And then make sure you restart your phone.
Please note this probably only applies to Huawei phones.
Also note that if you're on a Huawei tablet (e.g. MediaPad M3), instead of dialing, you launch the Huawei Calculator in landscape and enter ()()2846579()().
For Huawei with Android 8.0+
we must dial the code: *#*#2846579#*#*
and selecting the option AP Log will be enough to display the messages in the LogCat.
If any one having Letv Phone (LeEco Le Max 2 or 1) above solution won't work. Try the below USSD. Fig.1 for reference.
Press Dialer *#*#76937#*#*
Select "Enable All Logs"
Instead of using
Log.d(TAG, msg);
Try this.
Log.wtf(TAG, msg);
work for me.
I have a HUAWEI Y3 II aka LUA-L21.
The accepted answer didn't work for me.
It led to some MTKLogger settings screen, which is different than described in the answer, and didn't help at all.
My solution
Dial *#*#2846580#*#* (please note this code is different from the one in the accepted answer)
You just entered a settings screen called EngineerMode (again, different from accepted answer's ProjectMenu)
In the first Telephony tab, click the Log Control item
Activate both switches (set Mtklog control to catch all log and adb radio log to catch radio log by adb)
Back in the previous screen, swipe to the Log and Debugging tab
Open Debug Utils
Change Debug Level from User Mode to Engineer Mode
For good measure, restart your phone
Screens
Changing Log control
Changing Debug utils
Additional notes
Just to clarify my original problem; logcat was showing some of my app's log entries, just not my own messages - I saw entries belonging to my process com.example.myapp, but never anything I was printing out myself, in my code, using Log.d("TAG", "hello world");
There was plenty of stuff like this:
4260-4270/com.example.myapp I/art: Debugger is no longer active
4260-4412/com.example.myapp I/System.out: [CDS]rx timeout:1
4260-4412/com.example.myapp D/NativeCrypto: doing handshake ++
4260-4603/com.example.myapp D/OpenGLRenderer: Flushing caches (mode 0)
4260-4603/com.example.myapp D/Surface: Surface::disconnect(this=0xb85285d8,api=1)
4260-4260/com.example.myapp D/ActivityThread: ACT-STOP_ACTIVITY_HIDE handled : 0 / android.os.BinderProxy#2333cbdf
...but never anything like this:
4260-4603/com.example.myapp D/MainActivity: hello from onCreate!
The above steps solved the issue for me.
Some newer versions of Huawei Phones (I am using a Y9s 2019) have some settings changed.
Process is now
Dial *#*#2846579#*#*
Background Settings -> AP LOG Settings -> Open.
If you still can't see the logs, restart both your phone and Android Studio/Eclipse
Open your Dialer app and enter the following code: *#*#2846579#*#*.
1-Enter the Background Settings page.
2-Click on “Log Settings”
3-Check all 3 options to enable full logging.
4-Ignore the "will affect performance" warning.
5-Reboot the phone.
Try downloading a Logcat app(eg aLogCat) on your device itself and see if you are having the same problem.
I know its not a complete solution, but this way you may be able to figure out whats going wrong by reading the application logs.
Try this:
In Eclipse editor:
Reset adb from windows-->devices and then try again ...
please check your project is highlighted with green color (simply select your projrct name)

Categories

Resources