Android: Questions and Answers

Spread the love

Android recoveryIn this article several issues related to Android will be discussed. The format will be in a question and answer based manner.

For more generic questions, please check the article: Miscellaneous Questions and Answers

 

Read also this special article which is dedicated to using ADB wirelessly via Wi-Fi.

 

Question: How can I make a screen-shot/screencast of my Android device?
Answer screenshot: At Ubuntu/Linux issue the command:

adb shell screencap -p | perl -pe 's/\x0D\x0A/\x0A/g' > screenshot.png

…which will store a screen-shot in the current working directory of the workstation which is running the ADB-command.

Answer screencast: At Ubuntu/Linux issue the command:

adb shell screenrecord --output-format=h264 - | ffplay -

…which will open a player window after some time at the workstation which is running the ADB-command. Tested with Ubuntu 16.10 and Android 5.0.1.


Question “Permission denied” in ‘adb shell’: You get the message “Permission denied” in ‘adb shell’ when invoking the command ‘su’ despite of you have installed a superuser-app.
Answer: Please check: Settings->Developer options (make sure this is switched ON) -> Root access -> Apps and ADB


Question: The WiFi-connection of my Cherry M-906 tablet is very bad, how can I improve this?
Answer: Attempt to improve WiFi by changing some settings:

  1. adb shell
  2. su (You do need root-permissions)
  3. Make /system read-write, use this pre-compiled command or find the parameters yourself:
    cat /proc/mounts | grep system | awk '{split($0,parts," ");print "mount -o rw,remount -t " parts[3] " " parts[1] " /system"}'

    This will execute a command like:

    mount -o rw,remount -t print ext4 /dev/block/nandd /system
  4. Edit /system/build.prop (i.e. use ‘vi’ or copy to local computer, edit there and upload again to the same location at your Android-device).
    The fastest way is to use ‘vi’ from the ‘adb shell’. Another way is to copy the build.prop-file to your local computer (‘adb pull /system/build.prop‘), edit the file using your favourite text-editor (but keep line endings as they are!), upload the file to the SD-card (‘adb push build.prop /storage/sdcard0/‘) and from the ‘adb shell’ move the file to the correct location

    mv /storage/sdcard0/build.prop /system/

    Make sure these settings are active:
    wifi.supplicant_scan_interval=180 (edit)
    net.tcp.buffersize.wifi=4096,87380,256960,4096,163 84,256960 (add)

  5. Reboot your device.

Source: flashmyandroid.com – [TUT] Wifi performance increase and wifi battery usage decrease – TESTED&WORKING đŸ™‚


Question: How can I backup and restore the data of a package?
Answer: In this answer the data of CandyCrush will be stored to your computer using the Android Software Development Kit (SDK) and restored to your Android-device.

  1. Find package name:
    adb shell pm list packages
  2. Backup package data:
    adb backup -f com.king.candycrushsaga.ab -noapk com.king.candycrushsaga
  3. Restore package data:
    adb restore com.king.candycrushsaga.ab

Question ‘Unable to resolve project target’: When I try to build my Android project I receive the error: “Unable to resolve project target ‘android-10′”

  • In my manifest-file there is something like:
    <uses-sdk android:minSdkVersion="9" android:targetSdkVersion="10" />
  • And project.properties contains the line: target=android-10

Answer: Please make sure Android 2.3.4 (API 10) is installed. Check this using the Android SDK Manager. The manager is available in the SDK.
Start the manager using the command:

[SDK PATH]/android-sdk-linux/tools/android sdk

Question How to make modifications to my system partition? / How to mount my partition read-write
You would like to add/remove/change something at a particular read-only partition of your device?
Answer: For this you need root-access to your device and ‘adb’ must be installed at your device.

adb shell
su
mount -o rw,remount,rw /system
[Make some changes in /system]
mount -o ro,remount,ro /system

Leave a comment