This question already has answers here:
Android ADB devices unauthorized
(24 answers)
Closed 5 years ago.
I have a problem with the marked area in the image below.
Can anyone please tell me how to fix this?
You should see a popup dialog on your phone, where you should approve installing app. If there is not a dialog, go to Developer options, turn off USB debugging and then turn it on. The dialog should come.
Also, as John Joe has mentioned, ASUS devices need Enable ADB integration to be turned on (they somehow switch it off, happened on my Zenfone 2).
Uncheck the instant run in File >>Settings >>Build,Execution,Deployment >> Instant Run
and change the USB cable, having Enabled ADB Integration via Tools > Android > Enable ADB Integration.
Related
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.
This question already has answers here:
How to request Location Permission at runtime
(8 answers)
Closed 4 years ago.
I wanted my app to ask for location permission each time the app was run.
It seems the device remembers that the permission has been granted earlier and won't ask for them on subsequent executions of the app.
Is there any way to reset/uninstall the app so I can see if my newer ask permission code works?
Thanks.
If it's for debugging purposes, you can find your app in Settings -> Applications -> YourApp -> Storage -> Clear Data. That will remove everything you store in your app space including preferences and permissions. That way you can Run your code and have a fresh start. In older Android Versions you can find teh same screen by long pressing the app icon and selecting App info. If you want the same thing to happen at runtime with your users, you can manually clear the data each time your app is closed by using the following code:
((ActivityManager)context.getSystemService(ACTIVITY_SERVICE)).clearApplicationUserData();
(This requires a min sdk of 19). If your min target is older than 19, there areother way to do it as well. Check this answer.
If you want just check newer ask permission code is working or not
Just go to Settings > Apps > Your App > App Info > Permissions > Location
Disable that permission and You will see run-time permission dialog again once relaunch App!!
This question already has answers here:
Device chooser dialog is not showing up after instant run
(6 answers)
Closed 4 years ago.
I have a real device and an emulator. When i first install the app , the IDE asks me to select between the two but on subsequent runs it does not ask me to choose. How do i get it to ask me every time? I tried clicking on stop app , but the problem persists.
It's very easy. In android studio please click your app name dropdown showing at the top menu then click edit configurations and unselect use same device for future launches
You can change it from Run -> Edit Configuration -> Deployment Target Options
Make sure you are stopping your app before next run. (You can find stop option on the same tools section )
This question already has answers here:
How to debug in Android Studio using adb over WiFi
(21 answers)
Closed 5 years ago.
Is there any way I can test my apps on phone without it being connected with usb cable ? I want that because when i plug my phone in laptop it starts charging and draining laptops battery, so I would like to be able to test app on real phone without it being connected to laptop.
There is an solution when your PC memory is low then emulator make it slow. Or computer does not support VTX
There is a github library for debugging using WIFI only check this link.
The library is good for your case since only wifi is needed! Check this Introduction Quote:
IntelliJ/AndroidStudio plugin which provides a button to connect your Android device over WiFi to install, run and debug your applications without a USB connected.
Happy Coding!
This question already has answers here:
How to change the default language of Android Emulator?
(5 answers)
Closed 4 years ago.
I'm just starting to learn Android development. I have included a EditText component in my view and started the emulator in Eclipse.
When I type in the Textbox, the auto suggestions are coming up in Chinese language but I want to change this to English.
How do I change this Locale and Android Emulator?
I'm using the Android 2.1 for development.
I am using the emulator with Android 4.2 + 4.3 and there is an app to set the locale called "Custom Locale".
Start emulator -> Launcher -> Custom Locale
=> Select the desired language from the list
=> Confirm with e.g "Select 'de_DE'"
My solution is to use preinstalled on android emulator "Custom locale" application. Simply send intent with extra language parameter to it as below:
adb shell am broadcast -a com.android.intent.action.SET_LOCALE --es com.android.intent.extra.LOCALE EN
More information here - prepare android emulator for UI test automation.
No Need to change local, just long press on the EditText widget, on the popup menu select input method, and change to the android keyboard.
I'm using 2.3.3, but it should be similar:
Start emulator -> Launcher -> Settings -> Language & keyboard -> Select language