Posts

Showing posts from 2020

Connect ADB via WiFi

Hey Friends,      Many times there are chances that you want less cable over your desk or may be length of your data cable is shorter than expected. In this case, many developers have to struggle in compiling & testing Android Apps. I am showing you a simple way to connect your Android Testing Device once to your system & then you can run/debug your code wirelessly. Steps to follow: 1. You need to connect your device to your computer via USB cable. Make sure USB debugging is working. You can check if it shows up when running adb devices . 2. Run adb tcpip 5555 Here 5555 is port number that you want to use for connection. 3. Disconnect your device (remove the USB cable). 4. Go to the Settings -> About phone -> Status to view the IP address of your phone. I generally use IPv4 for connection. 5. Run adb connect <IP address of your device>:5555 6. If you run adb devices again, you should see your device. Now you can use device...

Location Permission in Android 10

As Android 10 has introduced, the dialog UI as well as handling the location permission has updated. Now, the user has right to allow/disallow that the app can fetch location while it is in background. To accomplish this, a new permission has to be declared in the manifest file: android.permission.ACCESS_BACKGROUND_LOCATION Calling this would pop up a dialog with basically three options: Always Allow Allow only while using the app Deny Along with these options, there are some other scenarios i.e. On selecting Deny will give a new option Deny & Do not ask again Or, if user selects ' Allow only while using the app ', the next time the app is launched, it will only ask the user to allow the Location Permission or deny . User can choose this option to optimize the battery consumption as some of the apps use location updates even when the app is in background or service might be running even if the appis killed. Lets take a simple example of a share cab ap...