text:
Is it possible to Boot into Safe Mode on an Android Device as a Precautionary Measure If Required?
Is it possible to Boot into Safe Mode on an Android Device, similar to booting up into safe mode on a Windows PC ?
An example being In Windows if you were infected with a virus you may want to immunize it in safe mode ? Is the same scenario likely with the Android OS ?
If for example you experience crashing, or freezing or indeed have battery issues ?
Perhaps it can be resolved in Safe Mode, if it exists ?
It is just something that came to mind and I thought might be worthy of asking !

What do you wish to achieve with "Safe Mode"? On Windows, this merely disables non-essential drivers and services. There aren't too many of those on an embedded system like Android.

If problems exists such as described above

@Chinmay: Safe Mode keeps services from launching at startup. This is very useful when you have a rogue/faulty app that you want to uninstall but it is hard/impossible to do when the service is running.

@AlEverett: Good point. I've never needed anything but recovery mode on Android, but safe mode would have helped when an app b0rked my phone a while ago. I owe the ClockworkMod devs a beer for enabling ADB via recovery.

@Chinmay: Whats ADB?

It's a program that allows you to (among other things) connect to your phone from your PC and get a shell (command prompt). It's part of the Android Software Development Kit (http://developer.android.com/tools/help/adb.html).

@Chinmay: OK fine thx :)

This depends a little on the device and what version of Android you have.
On versions of Android later than 4.1 you can access safe mode by bringing up the power down menu (i.e. hold the power button) and long pressing the "Power off" option. This will bring up a little dialog box that will ask if you want to reboot into safe mode. The addition is noted on the Android web site under "System" changes.
On some older phones - though not all will necessarily support this - there may be a button combination that you can hold at boot to get into safe mode instead. For example, the Galaxy S2 used to allow you to hold down the hard menu button during the boot process to start up in safe mode. Others have used (I believe) holding both volume up and volume down. Check your user manual (or Google) for your specific device to find more information, including whether or not the device supports safe mode at all.
As to what "safe mode" means - it generally disables third party apps and widgets, to help you recover from a bad app install, give you a chance to remove a possibly rogue/malicious app, or simply determine what apps may be causing problems in your system.

What about in terms of Virus infection, quarantine and or eradication does safe mode apply here especially if one does not have a dedicated Anti Virus already installed ?

@Simon: It's probably a good resource, but it might depend somewhat on exactly what the virus was doing. If it was a malicious app (and confined to the application package itself) then you could use safe mode to delete it without giving it the opportunity to launch automatically or anything like that. If it somehow modified your underlying system then you might be best served by re-flashing the OS entirely, and I don't know that safe mode would help much. Most cases: probably a useful tool for removing virus apps.

I was thinking more in terms not within the app itself ?(But then I'm not sure how else the virus could enter except maybe by USB - maybe thats where USB debugging comes into play ? How many apps in the Google Play Store could potentially carry viruses (viri ?) Is there a strong screening process beforehand

@Simon Potentially all could contain viri, as there is no screening process. Google may look at apps if they get loads of flags, but that it is.

Could this be increased by sideloading apps from different sources ?

@Simon: Screening is discussed a bit here Are the apps safe? How can I make my Android more secure?. Many malicious apps do tend to be sideloaded rather than coming from the Play Store.

Per your other comment: if a device was infected via some other means (like USB) then it's hard to say how much help safe mode would provide. It could be fairly minimal, since the OS will still load system services normally as far as I know, just not 3rd party stuff. If the virus managed to infect a system file (on Linux, for example, there are hacks where ssh is replaced by a malicious one that sniffs data) then it may still get loaded/executed.

Interesting....But from experience have you ever seen a virus infection or been asked by someone who has ?

It depends on the device.
Some devices have a safe mode, whereas some do not.
If it does have a safe mode, the combination would most likely be in the instruction manual. On my old LG-GT540, pressing Home & Power booted safe mode.
Remember that this functionality can sometimes be broken when using a custom ROM.

That might be seen as a disadvantage to flashing a custom ROM then ?

@Simon Correct. When I had my LG-GT540, the home & power combi was used for recovery, so safe mode was lost, although I never really used safe mode, as it broke widgets.


text:
How to customize the quick settings drop-down menu in android 4.2?
As of title, is there any way to customize the quick settings grid available in Android 4.2 ? This feature has potential, but in most cases it does not take advantage of the screen size.

Currently I can only find customization options through mods or other updates to the ROM. For example: http://forum.xda-developers.com/showthread.php?t=1999125
It would really be great if stock Android 4.2 would provide functionality to add tiles, re-order tiles or change the function of long/short taps on tiles. This issue has some of those feature enhancement requests: http://code.google.com/p/android/issues/detail?id=40285

Basically meaning no you can not customize it through stock Android itself.

If there's still anyone interested in getting the answer, the best I know is by using Notification Toggle by j4velin. It can be customized to display toggles(Wi-Fi, Bluetooth, etc) or to launch apps.

Looks like a useful app! But it also looks like it just adds a notification with its own buttons rather than customizing the system quick settings menu. Is that right?

This can be done in Android 4.1.2 especially in Samsung Galaxy Note 2. Settings-> Display-> Notification Panel. Then drag and adjust required combinations.

I believe this is a Samsung only feature, it's not available on stock Android.

My stock Android 4.2 and 4.4 devices doesn't allow Quick Settings customization. To customize it, I had to settle with Gravitybox [JB] which needs Xposed Framework and root access.
My initial stock Quick Settings were more or less similar to the one you posted. After my favorite tweaks it looks like (see an app's icon too):

The usage is simple. You install, activate, launch this app → Statusbar tweaks → QuickSettings management and do the tweaks as per your needs.
And don't worry regarding it's description related to Mediatek devices only. It works on Qualcomm ones as well.

source: Stack Exchange

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/

sort: votes


text:
Hide contacts with only email address
When clicking on Phone -> Logs, I have hundreds of contacts presumably from Gmail.  Is there a way to hide all google contacts, and only show ones I've manually entered (SIM or other storage)? I'd like to only see contacts with phone numbers when using the Phone.
My phone is a S2 (Tmobile), if it matters.

What Android version are you on? Have you seen this question?

You have not mentioned your Android version, if it is Android 4.0+, I fear you cannot do this. There's no option to show contacts with phone numbers only in People app that is included in 4.0+.
If you are on GingerBread or earlier versions, you have a setting something like this:
Contacts app - > Menu -> Display Options -> Only contacts with phone numbers

I am talking about stock Android apps, your manufacturer / ROM builder may have a tweak depending on what ROM are you running. I don't see a chance, but still a possibility.
See this similar question.

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/3.0/


text:
GT I9300 clockworkmod Cyanogen 10 nightly external SD not mounting
I haven't played around with custom ROMs since my G1 back in 2008, so when I put Cyanogen 10 on Galaxy S3 last night I wasn't surprised that things have changed a bit.
I rooted the phone first, then put on CM touch, then C10 and the appropriate gapps.
My problem is that I can't see the ext sd that worked fine under the stock ROM.
These are the specifics:

recovery-cwm-touch-6.0.1.2-i9300
cm-10.1-20121220-NIGHTLY-i9300
gapps-jb-20121212-signed

I'm trying to mount via the CWM menu but get this response:
Error mounting /external_sd!
I've also tried to use ICS SD Binder, but with no success.
Any help would be grand.

Please use a separate question for your separate issue (don't mix things), and then remove it from this question. One question per post is the premise here.

How are you mounting the EXT partition?

finally found the solution.  You have to fix the card first (which also means you can get back any data on the card).
On a Windows box I ran chkdsk.
Start -> cmd -> chkdsk e: /f
Then set the partition up as fat32, a 32GB partition.  I did this on an Ubuntu box, for no other reason than that is my normal OS.
After popping the card back in the phone it was picked up and is being reported as 59.43GB
I tried a few things before I found the solution: http://exceptionallyexceptionalexceptions.blogspot.co.uk/2012/12/s3-mod.html

First to the recovery:
Samsung phones that use Odin have their recovery image as part of the kernel. You should flash the CyanogenMod zip file, and that should flash the CWM recovery. Alternatively, you could flash the Siyah kernel, which comes with a modified CWM touch recovery image.
Now to the EXT partition:
Make sure that the EXT partition is primary, and also ensure that your ROM has EXT support - you should ask on your ROM's forum post/website to check if it does. If it does, then it could be an issue with the mount script, if it doesn't well we know what the issue is now ;)

Thanks Liam.  It seems that the 3rd flashing the CWM recovery has stuck; not sure why it took three flashes, as I didn't do anything different each time.  As far as the the ext is concerned, I ask on the cyanogen blog.  I'm trying to mount via CWM touch and it returns an error.


text:
What is the name of the install package and how to make it visible in Recovery mode?
Issue; when downloaded to a Mac, the .zip file was unzipped.  The issue was resolved by downloading files from the vendor with Windows.
The goal is to install the factory Android 10 ROM:
HE_FULL_UPDATE_10-16-10.00-QG-U00-STD-HEL-04.zip
and wipe the existing configured ROM.   The .zip file contents were copied to a micro SD card, which was installed in the Android device.
From Android Recovery Mode, I tried to install the files that were visible, however the failures returned are captured on the photo:

A list of files is returned by user@mac HE_FULL_UPDATE_10-16-10 % find .
./compatibility.zip
./.DS_Store
./care_map.pb
./META-INF
./META-INF/.DS_Store
./META-INF/com
./META-INF/com/.DS_Store
./META-INF/com/symbol
./META-INF/com/symbol/DeviceManifest.xml
./META-INF/com/android
./META-INF/com/android/otacert
./META-INF/com/android/metadata
./payload_1.bin
./payload_properties.txt
./payload_properties_1.txt
./payload.bin

For some reason not all file are displayed in Android Recovery Mode.   Which file is the to be selected and how to enable its selection from the Android Recovery Mode?
Attempt to flash .zip file failed:

For some reason, when the zip file was download to my Mac it was automatically unzipped into a folder.  I compressed the folder into a .zip file, copied it to the SD card.   The photo shows the results of attempts to install.

you must not zip the parent folder, only the subfolders and files. or tell your mac to just download the file. if zebra respect the standard file layout, recovery is looking for META-INF/com/google/android/updater-script inside the zip file (which seems missing) but of course vendors can have their own layout (like HTC)

flashable UPDATE.ZIP must not extracted. flash the file as it is

license: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
Micro SD card stopped functioning after inserted when phone on. Android and Windows recognize the card, but can't read it. Can I recover my data?
Android and Windows say I have to format the card in order to access it, but I don't want to lose my data. I have tried to read the card with Recuva and iCare Card Recovery Pro, but they can't access the card either. The card is partitioned, I don't know why. Disk Management, at Control Panel, shows one partition of 16mb and other of 7,2gb.
Is there a way I can recover my data?
Android version: 6.0
The card was used as internal storage.

Welcome to Android Enthusiasts! Can you please [edit] your post and fill some gaps: What Android version is running on your device? If 6 or above, did you use the card as "internal storage" (aka "adoptable storage")?

Or did you encrypt the card?

Hi, thank you for your answers! I made the changes on the post.

"The card was used as internal storage" - This means it is encrypted and tied to the decryption key on your device. If your device is already rooted, you Might be able to access the key and use this to access it, it requires Linux and some terminal use, Windows will not be useful for this operation.
If you removed this card while the device was powered up and the card mounted, which it will always be as internal storage, you likely corrupted the drive's file system, and recovery of data from a damaged, encrypted file system is extremely difficult and often requires professional forensic data recovery if the decryption key is available, it's impossible without it, and those services are rather expensive and can be thousands of dollars in some cases.
When a drive is adopted as internal storage, it is reformatted to Linux ext4 file system and encrypted, it is intended to never be removed from the device, ever, unless you go through the process to convert it back to portable storage. The encryption used is very secure, without the decryption key it is generally considered impossible to access the data even if the file system is completely intact and undamaged.
So basically I am saying you're most likely out of luck... The chances of recovery of the data is near zero.


text:
contacts do not sync and get overriden/deleted
When I use the built-in contact app with either a outlook.com or a office365 account on the phone created contacts get deleted after some time and they don't sync to the web.
What have I done:

delete and add account
factory reset

Similiar to https://forums.oneplus.net/threads/contacts-keep-deleating.484478/ except that I already save to another account.

what phone are you using? What is the OS version?

See tagged, op3 with newest nougat update

I was unable to stop the outlook App overriding/deleting created contacts. But syncing contacts via gmail, but using the Outlook App for everything else seems to work.

Disable Contact syncing for all accounts added to the Outlook App in the system settings.
Add all accounts to as an exchange account to the google App (In Account settings, there should be an 'Exchange' option. Disable all syncing but contact sycning.

For outlook.com accounts you will need to manually select 'Exchange' in the next step, even after selecting Exchange Account in Account Settings (else it defaults to IMAP).

I will accept this answer, if there is no better solution posted, after the bounty expires.

Same problem here on the Moto G5 Plus.  My answer was simply to avoid the Outlook app and force myself to get comfortable with Google's Mail app.  By not having Outlook installed, the exchange contacts from my Office 365 Personal account are working fine now.  As stated above, you must do manual setup to have the account recognized as an Exchange account rather than an IMAP.
Aside from the contacts challenge, Outlook was not allowing me to add the gmail account to the app (maybe a Google rescriction?), so in the end avoiding Outlook solved both problems.

I'm not a user of OnePlus, but I can say Outlook App in Android has
  some issues built-in for quite a long time, so one suggestion is that:
  uninstall the app & make a fresh install again. Hope it helps.

'factory reset' did include a fresh install


text:
Does anyone know what this android emulator call is?
I've been looking at the network traffic for an Android emulator using mitm proxy.  I have noticed large amounts of traffic going to google's servers.  Does anyone know what this request would carry or a good way to find out?
Had to put the file on my server because it was too big to add to this post.
android_emulator_post.txt

kinda hoping someone from google is on this that knows the endpoint or someone else is familiar with why the heck google would need to send so much log data.  I would bet that most people are using hex interpreters and not reading like english, lol


text:
Local files revisited: Opening local HTML files (file:///path/to/file) in Chrome on Android 10.x
You may note the almost duplicate title from this question. It keeps coming up when trying to solve my current issue.
I created a little web app to help at work. Just some HTML and JavaScript, and before Android started enforcing the Scoped Storage, I had no issues using it. Now when I try to load the URL (ie: file:///storage/emulated/0/__MyDocs/SignInTracker.html) I get an access denied error.
I could use Firefox, but it seems to be because it's not yet using the Scoped Storage standard, which if I understand correctly, will be a requirement in the next Android version, so that means I cannot rely on it working in the future. Also, Firefox just doesn't run as nicely as Chrome.
Is there a proper way for a non-Android-developer to use a local web app like this? Is there perhaps a location on the phone where I can place my .html and .js files that will allow Chrome to access them without issues? At work, I'm not online or connected to anything, so loading from another server/computer is not an option.
For reference: My Chrome version is 79.0.3945.116, my Firefox version is 68.4.1, and my phone OS is Android 10; Pixel Build/QP1A.191005.007.A1.

This same problem occurs with other browsers like Firefox and Bromite :-(

You have 2 options:

You can use a local web server in your Android phone itself. There are many server apps out there in the Play Store, one such app is Simple HTTP Server.

You can put your documents into the folder Android/data/com.android.chrome/files/Download/ in the internal storage. It's absolute path is /storage/emulated/0/Android/data/com.android.chrome/files/Download/ or /sdcard/Android/data/com.android.chrome/files/Download/. This is the location where Chrome stores any downloaded files and therefore, this the only location where Chrome can access the files. But remember, uninstalling Chrome will delete this directory.

I had tried some server apps but they all had issues (one of them didn't even process Javascript). Placing the files in that directory seems to have worked though. Thanks!

You can also use Opera browser of you wish. It is much similar to Chrome since both use the same engine. Opera have no issues at all while browsing the storage.

Thanks a lot for the suggestion of Simple HTTP Server: it is very easy to use, is free and works like a charm. This is a very elegant workaround! Still I don't fully understand why Android doesn't allow to give apps access to selected folders in the local storage. Maybe in the future this will be implemented; let's hope.

For Android 11 [One UI 3.1]
Browsing local files (in internal storage space) in Chrome using file:///sdcard/ or file://localhost/sdcard/, one can notice that only media files and subdirectories (if any) are listed in almost every folder except the "Download" folder (but not in its subfolders=subdirs).
This means that on Android 11, the folder from which Chrome can read local (m)HTML is /Download folder, not Android/data/com.android.chrome/files/Download in internal or external storage space like in Android 10.
NOTE: on my Samsung devices, downloads onto internal storage were saved into /Download folder in all versions of Android (9, 10, 11), but downloads on an external SD card changed their folder from /storage/emulated/exSD_CARD/Android/data/com.android.chrome/files/Download in Android 10 to /storage/emulated/exSD_CARD/Download in Android 11, where exSD_CARD is the device's label for external SD card (0123-4567 or 9C33-6BBD in my devices)
Thus, (m)HTML files saved into /Download folder with Chrome (with .mhtml extension from older times or with manually added extension by renaming saved mhtml files without extension - from certain time Chrome stopped to append .mhtml extension to saved mhtml files :) on my devices, I guess from upgrading to Android 10)
This did not work for the mhtml files which have been moved to other folders and then returned to /Download folder. (And because of collecting saved mhtml files in many different folders, I have many mhtml files which are necessary to copy/move back to /Download folder prior to opening but they still cannot be opened)
Notes about opening mhtml files
I need to use Total Commander's "Open with" functionality with file://url option checked, then choose Chrome in order to open (mhtml) file with Chrome (with file://url checked, the Chrome is in the list to choose from, with file://url option unchecked, it is not listed in the list) or to browse local files in internal storage directly in Chrome (file manager My Files provided with the device was unusable to choose mhtml files to be opened with Chrome)
(mhtml) files from /Download folder opened in this way are opened as offline versions of downloaded web pages - but only if the file was not moved and returned back to /Download folder, otherwise you get Access Denied message. Also, opening (mhtml) files in this way using Total Commander, but from other folders than /Download folder, leads to Access Denied message
Opening mhtml files from any folder using Total Commander, but with file://url option unchecked (in this case, the Chrome is not in 1st list, so you need to choose "Open with *" option with folder icon from the list and subsequently choose Chrome from next list) behaves differently. Opening in such a way leads not to successful opening or Access Denied message but to Save as Dialog Form in which one can choose also if the resaved mhtml file should be saved to internal storage or external SD card (if present). In this way, resaved mhtml files in /Download folder (on internal or external storage space) can be now opened using Total Commander "Open with" dialog with checked file://url option.

Still, there exists a way of opening the (m)HTML files with Chrome

without other browsers/viewer
without rooting the Android device

but maybe only until the next update :)

Thank you! The URL file:///sdcard/ works on Android 8.

My workaround to open local files on my Samsung tablet is this:

Install Ghost Commander from f-droid.org (link)

Navigate to the directory where the .html file is, then double-click on it and open with Chrome, Opera, or Samsung web browser. Sadly I'm unable to associate with Firefox for Android (not listed).

The URL seems a bit random: content://com.ghostsq.commander.FileProvider/FS/L3N0c3JhZ2UvZW11bBF1ZWQvMC9Nb3ZpZXMvenNhbmk/videos.html
But everything works, all the relative paths listed in the .html are working.
In my case, I have a list of videos which I can filter from .css only (embedded inside the .html file) without any additional javascript.

all_licenses: Creative Commons - Attribution Share-Alike - https://creativecommons.org/licenses/by-sa/4.0/


text:
Activate USB tethering from the command line
I would like to activate USB tethering from within a bash script.
I've found TetherSettings action name from
aapt dump xmltree com.android.settings.apk AndroidManifest.xml | less +/ether

The following command open the needed settings, but don't change anything alone
am start -n com.android.settings/.TetherSettings

Is there any possibility to run a command line with adb shell to change it?

Related, but the opposite: Is it possible to disable USB tethering from command line?

That's really cool. I tried to find other commands doing aapt dump xmltree com.android.settings.apk AndroidManifest.xml but that didn't work on my phone(aapt not found). How can I see a list of the available settings ?

http://elinux.org/Android_aapt

Thanks! I've found aapt in the build-tools folder. I can run it now. I can't seem to find com.android.settings.apk though. I've tried: find / -name 'com.android.settings.apk' on the phone, but nothing came up :( Can you please let me know where I can find com.android.settings.apk ?

If your Android version has svc inbuilt utility, run this command:
adb shell svc usb setFunctions rndis

This would enable USB tethering. To see what other USB functions are available, run:
adb shell svc usb

*setFunction in first command

@Jortstek in the latest release of Android (version 12), it still continues to be setFunctions. See https://android.googlesource.com/platform/frameworks/base/+/refs/heads/android12-release/cmds/svc/src/com/android/commands/svc/UsbCommand.java#39 It is possible the Android implementation by your  device's vendor removed the trailing s from the keyword.

Wow. Android 8 on Samsung device, it most definitely is without the "s". What ways they think of to trip people up.

Running the following command as root should enable USB tethering:

service call connectivity 32 i32 1 on Ice Cream Sandwich (4.0)
service call connectivity 33 i32 1 on Jelly Bean (4.1 to 4.3)
service call connectivity 34 i32 1 on KitKat (4.4)
service call connectivity 30 i32 1 on Lollipop (5.0)
service call connectivity 31 i32 1 on Lollipop (5.1) according to an answer by Firelord
service call connectivity 30 i32 1 on Marshmallow (6.0), untested
service call connectivity 41 i32 1 on Samsung Marshmallow (6.0)
service call connectivity 33 i32 1 on Nougat (7.0)
service call connectivity 39 i32 1 on Samsung Nougat (7.0)

The first number you see in the commands is the setUsbTethering() method's number in IConnectivityManager.aidl (this depends on the Android version and doesn't exist on Gingerbread).
(Tip: to check this file for a particular Android version, select the appropriate branch.)
So what this command does is call setUsbTethering() and pass either 1 (enable USB tethering) or 0 (to disable it).
For more information, see this related question on Stack Overflow.

If you're enabling USB tethering as part of a USB reverse tethering setup, setprop sys.usb.config rndis,adb should be more than enough to get the rndis0 interface set up.

This is the right answer for USBTethering. It won't work for WifiTethering though. The API hasn't been left open for that...

That  command for Android M works well on my stock Android 6.0.1 on Nexus 6. Good work keeping a list for multiple Android versions. I wish I could upvote it again.

Confirm that the MM command works on CM13 6.0.1 also. Thanks!

on CM14.1(7.1) the Jelly Bean command works

For Oreo (8.0): service call connectivity 33 i32 1

There is a pretty bad method using adb shell input tap, Get the coordinates for enable tethering and substitute
adb shell input tap <x> <y>

Or navigate to enable radio using  adb shell input keyevent. Just have a look at,
adb shell input

Again this confines to a particular device.

Combining this all together, this works for me if the screen is unlocked: adb shell "am start -n com.android.settings/.TetherSettings; input keyevent KEYCODE_DPAD_UP; input keyevent KEYCODE_ENTER". I found a list of key events on SO.

In case anyone wants to test this out and/or modify it for their device, I'll post this here. I wrote a little script to turn on tethering for my nexus 5x (needs to be unlocked) and hooked it up to udev to do that automatically when I plug it in

@redbmk - thanks for the useful script.  For a Galaxy A5 2017 the key sequence is:
${inputKey}DPAD_DOWN; $pause; ${inputKey}DPAD_DOWN; $pause; ${inputKey}ENTER.  Also I found that pause="sleep 0.3" works ok.

In the sequence above I had forgot the initial key presses to dismiss the pop up confirmation about enabling MTP, which is ${inputKey}DPAD_DOWN; $pause; ${inputKey}DPAD_DOWN; $pause; ${inputKey}ENTER;.

Try the setprop command below:
setprop sys.usb.config rndis,adb

This is only part of what's needed. This won't start dnsmasq for instance.

this is device independent (toggles USB tethering)
adb shell am start -n com.android.settings/.TetherSettings &&
adb shell input keyevent 20 &&
adb shell input keyevent 20 &&
adb shell input keyevent KEYCODE_ENTER &&
sleep 2 &&
adb shell input keyevent 4

Modified to use windows timeout command instead of sleep, wake screen first, and only press down once. Twice down enabled wifi tethering on my phone.
adb shell input keyevent KEYCODE_WAKEUP && adb shell am start -n com.android.settings/.TetherSettings && adb shell input keyevent KEYCODE_DPAD_DOWN && adb shell input keyevent KEYCODE_ENTER && timeout 2 && adb shell input keyevent KEYCODE_BACK

The service method did not work for me on my Samsung device. I figured out how to do it by configuring the network interface directly, though. Here is a script that sets up a Linux machine and a USB-connected rooted Android device for USB tethering. This does not set up DNS or NAT masquerading, but is sufficient to make the device accessible at 192.168.42.129:
#!/bin/bash
set -euo pipefail

# Set up USB tethering for an Android device.
# Usage: adb-usb-tether [USB-VENDOR USB-PRODUCT]
# If USB vendor/product is unspecified, use first USB network interface.
# On the Android side, tethering is enabled via adb shell.

if [[ $# -eq 2 ]]
then
    any=false
    vendor=$1
    product=$2
else
    any=true
fi

function find_if() {
    local path if
    for path in /sys/class/net/*
    do
        if=$(basename "$path")
        if [[ "$(readlink "$path")" == */usb* ]]
        then
            local ifproduct ifvendor
            ifproduct=$(cat "$(realpath "$path")/../../../idProduct")
            ifvendor=$(cat "$(realpath "$path")/../../../idVendor")
            if $any || [[ "$ifproduct" == "$product" && "$ifvendor" == "$vendor" ]]
            then
                echo "Found interface: $if" 1>&2
                echo "$if"
                return
            fi
        fi
    done
}

function adb_shell() {
    adb shell "$(printf " %q" "$@")"
}

function adb_su() {
    local quoted
    quoted="$(printf " %q" "$@")"
    adb shell su -c "$(printf %q "$quoted")"
}

if=$(find_if)
if [[ -z "$if" ]]
then
    echo "Requesting interface:" 1>&2
    adb_su setprop sys.usb.config rndis,adb
    echo " >> OK" 1>&2
fi

while [[ -z "$if" ]]
do
    echo "Waiting for network device..." 1>&2
    sleep 1
    if=$(find_if)
done

while ! ( ip link | grep -qF "$if" )
do
    echo "Waiting for interface..." 1>&2
    sleep 1
done

function configure_net() {
    local name="$1"
    local if="$2"
    local ip="$3"
    local table="$4"
    local cmdq="$5" # Query command
    local cmdx="$6" # Configuration command

    if ! ( "$cmdq" ip addr show dev "$if" | grep -qF 192.168.42."$ip" )
    then
        echo "Configuring $name interface address:" 1>&2
        "$cmdx" ip addr add 192.168.42."$ip"/24 dev "$if"
        echo " >> OK" 1>&2
    fi

    if ( "$cmdq" ip addr show dev "$if" | grep -qF 'state DOWN' )
    then
        echo "Bringing $name interface up:" 1>&2
        "$cmdx" ip link set dev "$if" up
        sleep 1
        echo " >> OK" 1>&2
    fi

    if ! ( "$cmdq" ip route show table "$table" | grep -qF "192.168.42.0/24 dev $if" )
    then
        echo "Configuring $name route:" 1>&2
        "$cmdx" ip route add table "$table" 192.168.42.0/24 dev "$if"
        echo " >> OK" 1>&2
    fi
}

configure_net local  "$if"   128 main  command   sudo
configure_net device rndis0  129 local adb_shell adb_su

To enable forwarding (i.e. connect to the Internet from the PC via the Android device), see my question and answer here.


text:
How do phones from non-famous brands usually update their version of Android?
Stuff like 11T Pro or i13 Pro Max are just examples of Android phones that don't have any famous brand.  My question is, how do these phones usually allow us to update?
Is the updating mechanism something in Android itself and is done from Google's servers?  Similar to how Microsoft Windows updates itself regardless of which PC hardware we use?

These type of phones are largely considered disposable and are not updated, ever... Not the OS anyways, apps would be updated via your software store of choice (Google Play, F-Droid, etc).

Related/possible dupe: Is there a technical reason Android update story is so bad? (posted in 2014, but still relevant until now)

Compared to a PC the update process is a bit different, because Google does not provide binary updates for devices (only modern devices load some system apps via Google Play Store but these system apps only cover a small part of the OS).
Google Android devices always load their updates from a site operated by the phone manufacturer. Google is in the update process only involved at two points:

Google provides the security and/feature updates in source code form, which are then compiled and integrated by the phone manufacturer into their device fimware.
After everything is ready for an update Google gets the update an proves if it is compliant to a large list for rules each device and firmware have to satisfy. If the update passes all test the manufacturer gets the OK from Google and can then provide the update on their servers.

How long, how often or if a device gets updates at all depends on the phone manufacturer. The general rule is that the cheaper the phone the less updates you will get. For the extra cheap section on AliExpress or similar sites this means you are lucky if you get an update at all.


text:
Samsung Galaxy A51, please enter your PIN code. AGAIN?
From my employer, I've received a smartphone Samsung Galaxy A51. Almost at everything I want to do with it, I need to enter my PIN code. I would like to use my smartphone without needing to enter my PIN code again and again and again and again ...
In my own smartphone, also a Samsung, but a Samsung Galaxy A6+, there I don't need to enter my PIN code that much.
I've been looking in the settings, but I don't find where to modify that configuration.
Does anybody have an idea?

It is likely flashed with a proprietary OS version for their protection. If it is their property they can likely enforce any security they deem required to protect their property. Remember they are tracking EVERYTHING you do on their phone.

If the comapany you work for has an IT department ask them. If it can't be done they will tell you.

Could you explain further by "enter my PIN code again and again"? I'd assume this is when the device wakes up from sleep/screen turns off? Or are there other situations when it asks again? If it's the former, then it's probably set by the IT admin, which can be enforced by Android Device Policy as the device administrator.

Fingerprint?
Face unlock?
If you have a fingerprint use it.
If not then use face unlock.
Fingerprint is more secure than face unlock.

I would like to avoid these: I mean, if I don't need to enter my pincode on my Samsung Galaxy a6+, then it should be possible on my Samsung A51 too, or not?

@Dominique Well, it's a safety measure. Look into your apps's settings for an option to disable them.
If not then you have 2 choices:
Removing your pin
or using fingerprint or face unlock


text:
How Do We Set the Default Camera App in Android 11?
In Android 11 Beta 3, Google is blocking the ability for third-party camera apps to handle photo/video requests on behalf of other apps. Interested developers can read the release notes for the rationale behind this change.
However, there is one odd sentence in that explanation:

A user can set a third party camera app as the default camera app.

Here is the "Default apps" screen in Settings:

I don't see "Camera" on there. And if I search for "default" in Settings, I do not see an option for setting the default camera app.
So... how do we set the default camera app in Android 11?

I am on Android 11 (Pixel 4a) and was searching to do this and I recalled this question (had posted an answer and deleted, not being correct) . Here's the answer from Android 11 Changelog — Full List of All 50+ New Features

You Can't Change the Default Camera
To prevent malicious apps from capturing your location, Google has removed the ability to set a third-party camera app as default. You can continue to use the third-party app as usual, but if an app requests to use the camera app, it will use the preinstalled one. But the change isn't as dramatic as it sounds — you can still use the cameras that are built into apps such as Snapchat and set shortcuts to third-party apps.

As Andrew said in comments(now deleted)
, the release notes do not include that sentence to the effect that third party apps can be set as default camera app.


text:
How to tell what architecture an APK is intended for?
I am writing a script to test a large quantity of apks.  Some run on x86 and some run on arm.  Is there a way I can tell which apks are intended for which architecture?
I have looked through the report on aapt badging with aapt dump badging application.apk.  For some of the arm compatible versions I see native-code: 'armeabi-v7a' but not for all of them, and I don't see any indication of what architecture the x86 compatible apks run on.
I have also tried using apktool to break apart the apk and examine the AndroidManifest.xml.  I don't see anything pertaining to the chip architecture in it either.
I'm looking for something on a linux platform.
Any ideas?

One (rather crude) way to see what architecture an APK's native libraries are built for is to unzip it (it's only a zip file) and take a look at the libs folder - if the application contains any native libraries, they will be split into the following subfolders inside (with the compiled libraries inside these):

armeabi: compiled code for the older ARMv5 architecture (32-bit, support for ARMv5 was removed from the Android NDK in r17)
armeabi-v7a: compiled code for the ARMv7 architecture (32-bit)
arm64-v8a: compiled code for the ARMv8 architecture (64-bit)
x86: compiled code for the x86 architecture (32-bit)
x86_64: compiled code the x86-64 architecture (64-bit)
mips: compiled code for the MIPS32r1 architecture and later (32-bit, support for MIPS was removed from the Android NDK in r17).
mips64: compiled code for the MIPS64r6 architecture (32-bit, support for MIPS64 was removed from the Android NDK in r17).

See Android Application Package for more information on an APK's structure, and the above list's source. A more complete (including MIPS64) list, along with some information about architecture-specific things, can be found on an archived version of the Android Developer ABI Management page, captured on April 18th 2016.
Interestingly enough, targeting one single ABI (where an app includes native libraries designed for one architecture) doesn't necessarily mean that the app won't run on devices that use other architectures. ARMv8-a, for example, is backwards compatible with ARM and ARMv7-a, and Intel's x86 Android devices contain a proprietary translation layer that allows ARM code to execute on x86 devices (allowing ARM-only apps to run on x86 platforms). A list of the ABIs that an Android device can execute can be found in the ro.product.cpu.abilist property, which can be attained in a shell (e.g. via a terminal app on the device, or over adb using adb shell) using the getprop command: getprop ro.product.cpu.abilist.

What if there is no lib directory ?

@KaKi87 Then I believe the app uses no native code, so doesn't need any platform-specific stuff.

You can also use APKSharp:
A Windows tool to De-bloat, view full details & manage APKs on any Android, it has AAPT for Windows & Android inside.

thanks for the answer, but I'm looking for a linux tool


text:
How to resume app restore after stopping it on first opening Google Play?
I've installed a fresh stock ROM from Google site on my Galaxy Nexus.
At the time I've opened the Google Play and started installing the 157 apps... the problem is that I needed to stop downloading in the middle as I needed to move to an area without wifi coverage, so I pressed stop.
Now I don't see any option to resume that installation.
Is it really a one shot? How could I have paused it to avoid downloading it on 3G?

I think it's "one shot." I am willing to be proven wrong though. I have faced this a few times.

This should be a feature request, I'm in the same pickle you were!

It seems by the latest answer that it isn't. At least if you're willing to use shell commands.

Use bmgr from adb shell. See this answer for a complete explanation of backup sets.
Root access is not required.
shell@maguro:/ $ bmgr list sets
  1234567890abcdef : droid48
  34567890abcdef12 : galaxy49
  ...

shell@maguro:/ $ bmgr restore 1234567890abcdef
Scheduling restore: droid48
done

This triggered a full restore of all the previously installed apps on my device instantly.

Awesome, great tip. Does this work on every Android version?

@NeTeInStEiN This was on 5.1. Per documentation: bmgr runs on devices supporting API Level 8 or greater.

Useful tip. This work on my Note 7 replacement. I interrupted my app/settings restoration while trying to simultaneously connect to my cellular provider. The phone prompted me to restart. I restarted, assuming that the restoration would resume. After it didn't, I went online and found this tip. This resumed my app downloads. FYI: My Note 7 didn't automagically appear in adb devices. I followed this guide to uninstall default drivers and install "Koush" "Universal Windows ADB Driver": http://www.makeuseof.com/tag/android-wont-connect-windows-adb-fix-it-three-steps/

I just tried this on a variant of 7.1 (from lineageos) and it did require root, when run from a terminal emulator (vs abd).  But it worked terrifically to get things started again.

fantastic tip. This worked great to get me set backup even after interrupting a restore to root/configure. thanks!

Love this, just a shame you can't choose which apps like you can in the original setup.

Just wanted to say Thanks, this is about the 5th time I've found this note and used it.  Just did it via adb (without root) on the Pixel 2 XL, so it still works on 8.0.

I've got several consecutive identical backup sets. Anyway to tell which is which?

I got "No restore sets"

There's no option to resume. If you stop you can only manual download later.
If you didn't pressed stop, you could just disable data transfer and, when connected again, download will continue.
If you stop, the current sync state will be sent to the server and it will be (without the apps that weren't installed) stored as the device final state after restore.
And by the way, clear market data will not help (Tested >5 times on reflash my Desire)

At the time I though there must be a way to resume or restart it later...

Market store device state, so if stop with internet disabled and then clear market data before connect - restore can be restarted (no guarantee). If you stop with internet enabled - new device state will be saved, and next time restore will proceed to curent state (until you change it installing new apps).

"Market store device state" by this you are refering to store online the device state right?

If you had turned off 3G, or even the device altogether, the downloads would have 'paused' so to say, and would have been resumed as soon as a data connection became available.
Apart from that, there is no way to pause an app download from Google Play, to resume later.

I had this same problem. Don't know exactly what I did but I removed the Google account from my phone and re-signed in. Then I opened the Play Store and all my previous apps began downloading. Hope this helps

A side note to consider: On pre-ICS devices (Android 2.x), removing the Google account also removes data connected to Google Apps (such as accounts, calendar-data, etc.) from the device. While this shouldn't be a big deal for data already synced, I'm not sure concerning settings (unsynced data of course would be lost). No problem, though, starting with Android 4.0 – and yes, dropping and re-adding the account should trigger restore when you check the backup option on add.

A similar problem happened with me and I try to factor reset a few times. It did not work. What worked was as follows:

Factor reset the phone.
After setting the language, the phone will ask you to connect to wifi. While connecting with wifi, go to top taskbar, swipe data, and disable mobile data.
Once the wifi is connected go through the process and while selecting the reset, if there is more than a day old (not today's) backup is available use that. You may loose one or two days worth of data, sms etc but mostly other stuff will be recovered. It will also save you the trouble of going through installing each app separately.


text:
What are the "Window animation scale", "Transition animation scale" and "Animator duration scale" settings in android developer settings?
I have seen many posts suggesting to turn them off, i have them turned off and notice quicker transitions, no animations, etc. But in some places it is weird to see no animation.
I googled the terms to try to find what they meant, but could only find the above suggestions. Could someone explain what effects each setting has?

Related http://android.stackexchange.com/q/81529/131553

All 3 of these are set to 1.0× by default ;  you don't need to turn them off, just cut the values in half and set them all to 0.5 for noticeable snappier performance.
As for what each one does specifically and using my Galaxy S8+ to test them ᎓
Window animation scale controls pop-up window opening and closing animation speed, such as the pop-up you get with the various speeds you can choose when you select this option.
Transition animation scale controls app window opening and closing animation speed,
Animator duration scale controls app switching animation speed.
If you use your phone's stock launcher, one of these — likely the middle one — will also affect homescreen-to-homescreen transition animation speed ;  on my phone I use Nova Launcher and homescreen animation speed is adjustable within Nova itself, and is unaffected by any of the above developer options.


text:
"Display over other apps" prevents me from entering passwords
The smartphone is a OnePlus Nord CE 5G, model EB2103.
Basically, when I focus a field where I'm supposed to enter a password, a system "Display over other apps" like this

takes over and overlays the original app, not allowing me to enter the password in any way.
This happened after I upgraded to Android 12.
Here I've filmed what happens.
Any clue how I can solve this?

I've also noticed one more detail. If the app has the little eye icon to make it show the password (unlike the app in the video), I can click on that icon before focusing the password field, then when I focus it and type the passord, the annoying thing doesn't happen.
Here is the video of this behavior, but be aware that the screen never gets full black for me; I always see what's going on while I type the password.

According to the logcat, the Password Store (legacy) app (package name: com.zeapo.pwdstore) tried to open the "Display over other apps" permission settings.
The relevant logcat is
ActivityTaskManager: START u0 {act=android.settings.action.MANAGE_OVERLAY_PERMISSION dat=package:com.zeapo.pwdstore flg=0x10000000 cmp=com.android.settings/.Settings$OverlaySettingsActivity mCallingUid=10278} from uid 10278

This has been reported on its GitHub repo, Issue #767 - [BUG] "Display over other apps" settings panel keeps popping up.. According to the developer, this is caused by the older autofill method leveraging the accessibility service for pre-Oreo (because the proper autofill service was introduced in Android 8.0 Oreo).
From comment #13 and afterward by the developer:

@jonathf @Rio6 can you both check your accessibility services and verify if the Password Store service is still enabled?

Yes, it is installed and enabled.

That's the problem, it shouldn't be. We don't use the accessibility service on Android Oreo and above. Try disabling it manually and I'll push a patch to prompt users automatically.

I've updated the fix for this at #827 to automatically disable the a11y service on Android Oreo and above so we'll be able to seamlessly resolve the problem without manual intervention.

For the solution, disabling the accessibility service for this app should fix the issue.

Note: according to Site/app linking to the legacy Password Store, the app has been migrated from com.zeapo.pwdstore to dev.msfjarvis.aps. The renewed app is on:

GitHub
Play Store
F-Droid


text:
Internet is not working except Whatsapp application
In Xiaomi Mi 2 mobile, I can't connect to internet except Whatsapp application which is running smoothly.
I can't open any website on any browser also Gmail and other apps are not working.
This happened after phone reset and changing sim.
I called AirTel customer care, they say that internet is fine from their side.
Please suggest something to fix the issue.
Thanks

Have you confirmed that your plan has access to use internet outside of WhatsApp? Are you by any chance using WhatsApp-only plan?

Have you confirmed that the problem persist with both Wi-Fi and mobile data? Related: Some apps cannot access the internet (happens only on Wi-Fi)

Related: my android phone can't access to any google related sites and services (for mobile data only).

Yeah, There is full fata plan.
Btw I found that in APN setting, proxy was set. I removed it and net working now.

I finally found that proxy was set to some ip in APN setting.
    I removed proxy and saved APN setting. And Internet is working fine now.

Mobile Networks > Access Point Names > open the one APN > delete the
  content in Proxy

removing proxy under APN names in Mobile Networks, worked great for me on redmi note 3 32 gb

This worked for me on Samsung S8 as well

You saved me, Thanks. Xiaomi Redmi note 8

select mobile office instead of airtelgprs
 in the column of access points. it will work

First check the data settings and allow all apps to get connected.
next change access point names.
watch it
https://youtu.be/RRfSZkLQ3-w


text:
Gmail displaying "me" instead of actual sender's name
When viewing my inbox, I would like to display the sender's name according to the email's header.  Meaning, if I send an email to myself from my gmail address, but give the from name as Freddie Flintoff, I want Freddie Flintoff to appear instead of "me".

There is special handling for "me" and you cannot override this.
Edit: This is handled by MessageHeaderView.getRecipientSummaryText(…) where myName is "me" (in English).

Half line answers — what would be the best course of action(s) to deal with them?

This isn't an half-line answer. There is currently no possibility to do what the OP asks.

What @Manubhargav means is that this answer is a bit hard to understand without some background and/or description (sources?) for what you posit.


text:
Accounts disappearing on Samsung S3
I have developed an application which creates an account in "Account & Sync"
Some users on Samsung Galaxy SIII report that this account occasionally disappear (maybe at each reboot).
Of course, this doesn't happen with other phones.
Has anyone encountered a similar issue, ie an account disappearing?

Voting to leave open, since the question also relates to users that are having issues with paid apps and their accounts being removed on reboot.

This sounds a lot like the bug introduced in Android 4.1 Jelly Bean that (probably due to DRM and encryption) will install any paid application to /mnt/asec, even if it contains an account service.  This has a side-effect of having all accounts associated with such apps being removed on every reboot.  This Google Code issue has more details.
As of Android 4.2.1, it looks like the issue has not been resolved.  Many developers resort to creating a second "JB work-around" app that is free, and therefore can be properly installed and is able prevent the accounts of the main app from disappearing on reboot.

I forgot to mention this was the paid app version. You're pointing to a bug that is likely to be the one I'm facing. Thanks a lot, I had no way to test this myself. I just couldn't reproduce on the emulator...


text:
How do I insert a non-breaking space with the Android OS Keyboard?
At times I insert a non-breaking space (on my Mac) instead of characters in a Last Name field when filling out forms. Is there a way to do this using the default or some other keyboard on my Nexus 4 (4.2.2)?

It's not possible with the default keyboard. Someone may answer to suggest a keyboard which has this functionality.

Sounds like a case for Hacker's Keyboard. But as I never checked, I cannot tell for sure if it supports this.

The other difficulty is that the font must support it. It is the case for Droid Sans and Droid Serif, but others font may not implement it.

You might want to try with Hacker's Keyboard. They offer "compose key" functionality, which can be used for non-breaking space and more:

Hacker's Keyboard (click image for larger variant)
See the "circle key" to the right of the space bar? If you long-press it, according to the FAQ, this activates "compose key mode". They seem to follow the "standard rules" here, so "2x space" should give you a non-breaking space. A list of supported compose sequences can be found in the code.

The source moved to here, but the wiki is not maintained. https://github.com/klausw/hackerskeyboard/blob/master/app/src/main/java/org/pocketworkstation/pckeyboard/ComposeSequence.java

A workaround is to copy the non-breaking space from somewhere (e.g. the Wikipedia page has it in the first line between the quotes), or from between the brackets here:
[ ]


text:
How to get more information about Android random restarts
Android randomly restarts - where would I find an error log or some other way of enabling information gathering from this process? I want to attempt to troubleshoot this.

Most logs are stored in catlog, you can use ADB (Android Debugging Bridge) to read it; there are apps on the market can be used to read catlog.


text:
Android Mockup Tool that can read/write balsamiq files
I've been testing some mockup tools for android but none seems to be able to import balsamiq mockup files. Has anyone found one yet or any converter out there?
I already tried "Mockups.me" and "Mockups for Android"

Can you tell us what are some mockup tools that you have tested so far?

Updated my Question


text:
What URLs are needed to use "Ok Google"?
I own a fire tablet what I lock ALL internet traffic for using my router configuration. Works as expected.
But while I need no Internet at all on that device I want to use "Ok Google" which itself needs to have internet connection to analyze my commands.
So my idea would be to whitelist the URLs needed for "Ok Google" to work. But I cannot find any list of those URLs on the net.
As my Router does not log any outgoing connection (at least not that I can watch it) I cannot just look into my router.
Long words short: Does anyone have a list of URLs needed for "OK Google" so I can whitelist them?
To clearify: I need a specific URL. So no "Google.com", but "assistant.google.com" (or what ever the right url might be)

Not that, but an idea "the other way around": you could use a tool like Network Connections to monitor what the Google app wants to access, see e.g. this screenshot.

Looks promising. But seems not to display hostnames, but only IP-Addresses

True – but AFAIK one can use IP addresses with firewall rules :) Guess you mention this because you want to filter more closely, in case e.g. Playstore would use the same IP but a different URL? Might be good to specify that in your question if that's the case (you know, not everybody goes through all the comments ;)


text:
How to insert bookmarks inside Google docs for Android without using desktop browser?
I need the functionality of inserting bookmarks within the Google drive or Google Docs Android app. I can do that from within the desktop browser.  Is this feature already there, and I am just not seeing it?
This is not the same thing as adding a shortcut to the Android devices home screen as indicated by: Can I make a Google Doc shared with me more accessible on my Android device?
Google is a large company. When it creates apps for Android, it needs to be on parody with the desktop browser unless there are specific technical reasons why that's not possible, and sometimes it is not possible, but not in this particular situation for sure.

It is (still) not possible currently to insert a bookmark with Google Docs for Android (version 1.20.494.04.33). The only option to insert a bookmark is via the computer as stated on Docs Editor Help: Work with links, bookmarks, section breaks, or page breaks:

Add a bookmark
Bookmarks are not available on Android; you’ll have to use a computer.

If the doc is very important to you, you could download a copy to your device and make a folder for it.  You could also try setting your browser permanently on desktop, or desktop user agent. When you go online in this mode, your device is seen as a Linux computer.  At least my Z Fold 4 is, on Vivaldi/Duck Duck Go.


text:
Get new random MAC for same SSID without factory reset on Android 10+
Here is the MAC Randomization described and stated:

Note: Randomized MAC addresses are generated per SSID and are persistent.

I can confirm after deleting the SSID, rebooting, and connecting again, the same random MAC is used as before. However, if you reset the device to factory defaults and connect to the same SSID, the device connects with another random MAC address.
So how can you trigger this behavior without doing a factory reset?

On Android 11, there is a new option "Wi-Fi-enhanced MAC randomization" in the developer options.
When you enable it, delete/forget the network, and then reconnect, you get a new MAC address every time. Also, you get a new MAC address for this WiFi/SSID when you reboot your device. Disabling and enabling WiFi is not enough to get a new MAC. With this enabled, the device also generates a new random MAC address every few days.
When you disable this option, you get back your previously used random MAC.
Please also read liangpig1's answer, which is very informative.
Even with a new random MAC, some WiFi hotspots recognize you and still show your free hotspot time is over. This seems to be because of cookies with the Android browser. To mitigate this: connect, dismiss the notification that you have to log in, and in your browser in a new private window, open any non-HTTPS website. Then you'll be redirected to the login page, can log in, and enjoy free WiFi again.

Upvoting from airport WiFi ;)

Is there any way to force regeneration of the MAC without a reboot or forgetting the network? Even with root

The key related to MAC randomization is only generated for the first time.
And the MAC address is calculated by calling hmac_sha256 over the SSID with the generated key.
This key is stored in the /data/... on the device, and as far as I know, Android does not provide any API to remove it.
But when you perform a factory reset, all the data located under /data/... is wiped out, that's why the MAC address changes after that.
Therefore, if you can manage to remove the key, you can trigger this behavior, which is not easy, in my opinion.

Here is a list of events that will change your random MAC:

The network name changes
The operating system is upgraded and the device connects to the network for the first time after the upgrade
The network name is "forgotten" in the phone settings and then reconnected to

Source: https://wifi-helpcenter.nokia.com/hc/en-us/articles/360056890733-Issues-with-random-MAC-addresses-Android-10-iOS-14-

The quoted Nokia article is incorrect in its statement that you get a new random MAC if reconnecting to a "forgotten" network. Verified on Nokia G300 running as per Nokia's tradition fairly stock Android 11, and a Samsung Note 9 running Android 10. (The article aays it covers Android 10 & iOS 14 or later; maybe it refers to iOS on this point?)


text:
Updated Telegram from APK - why after the installation, it asks for phone number?
I face IMO strange issue with Telegram. The notification says Google Play Services need Phone permission to work, but it has that permission when I go there, however the update of Telegram via Google Play does not work (endless progress animation). So I've downloaded APK from the Telegram site. Asks if I want to update existing, I answer ok, it installs but then asks for phone number. Why?
I updated it, I don't want to confirm the phone number. And the phone keeps showing new messages notifications from Telegram. If I enter the phone number, I have no idea if it installs a new instance or the old one. Now when I click the old icon, it still complains update is needed, but the install went through from apt.
I don't like such app behavior. Any way to update Telegram from APK w/out going through phone number confirmation? Android 9. This question is about Telegram from APK, I do not ask how to fix Google Play. I hypothesize an update is possible w/out Google Play.

"when I click the old icon" did you mean there are 2 Telegram apps now? I don't have experience with Telegram, but the APK from the Telegram site (org.telegram.messenger.web) is not the same as the Play Store (org.telegram.messenger). By "updating", looks like you installed a new Telegram app instead, and that's why the app considers you haven't logged in yet and asks for the phone number. Also, I think the notification for new messages came from the Play Store version one.

@AndrewT. I opened apps in settings - two Telegram apps. Any place to download GP one? TL;DR:
if apk from the site is for different app, then why say "update" during install? Although truly speaking I've tried it several times and many now it wants to update itself, not GPlay one. I do not see a new icon (maybe it is not on home screen?), I click an icon located on the place on home screen where I used to click it, therefore I called in "old"

You can try downloading and installing from APK Mirror which is using the APK from Google Play Store.

@AndrewT., I was able to update old one. And now I have another one. Not sure it adds any value as AFAIK one app can support several accounts unlike WhatApp. Please write a short answer. Thanks! P.S. do you know why telegram has two apps?

This article explained why there are 2 versions of the app. Basically, due to the restriction imposed by Play Store.

Telegram has 2 versions of the app with different package name:

Play Store (org.telegram.messenger)
Web version (org.telegram.messenger.web)

While both have the same name, each app is considered as a different app, and thus (some of) its data, settings, and states are also not shared.

What was probably happening in this case:

The Play Store version was asking for an update but failed to update.
Downloaded an APK from the Web version and installed it. It's unclear if it's trying to update the existing app or not.
Opened the Web version, was asked for the phone number confirmation but did not continue the process.
Still receiving new messages from the existing Play Store version.
Open the old (Play Store version) icon which was still not updated.
Ended with 2 Telegram apps; one is the non-updated Play Store version, and another is the latest-and-freshly-installed Web version.

To manually update the Play Store version, there are alternative markets or mirror sites (e.g. APK Mirror) that provide the APK from Play Store.


text:
Switch "Google page" off on Android
I got Huawei P30 lite with Android 9. There is a page on the main screen (if you swipe right from Home) which looks like combination of Google assistant, search, news, weather etc..
What is it called and how to remove it?

Here are the instruction from Huaweihub on how to disable Google Feed on the P30 Lite

Hold your finger on an area of blank space on the Homescreen.
Select Homescreen Settings.
Locate Google Feed, then swipe the adjacent toggle from On to Off.

Original article here: How to disable Google Feed on the Huawei P30

Thanks! This works on an LG GPad 5 as well :)


text:
How do I create a ClockworkMod installation package?
I'm a seasoned Linux veteran and recently bought a Samsung Galaxy S2 from T-Mobile.  I've been feeling the tinkering bug, so I opted to download the source code from Samsung's site and start fiddling.
My problem is that I've already got ClockworkMod installed on my phone, so I don't want to odin flash a new kernel and thereby corrupt ClockworkMod, so I'm looking for details on how to create a proper ClockworkMod install package (generally/always a zip file?) so that I can test the newly compiled kernels.
My searching on google thus far has brought up naught.  The ClockworkMod page seems to be pretty barren of documentation.  Can anyone point me to some documentation on the install package creation process?

Flashing a kernel with Odin breaks CWM?

I figured it would since ODIN seems to flash the main bootblock of the phone, but I could be totally off base there.  I didn't want to try it without knowing for sure.  My understanding was that CWM is a middle-man thin kernel that would pivot to the proper kernel, but again, could be totally off base.

The required part of a kernel .zip file looks like this:
META-INF
    com
        google
            android
                update-binary
                updater-script

You'll also want to have the kernel zImage file somewhere else, easiest if you just have it in the root of the archive.
updater-script contains the following at minimum (assumes zImage in the root):
assert(package_extract_file("zImage", "/tmp/zImage");
       write_raw_image("/tmp/zImage", "/dev/block/mmcblk0p8");
       delete("/tmp/zImage")
);

You can also do things like show a progress bar, print messages, wipe /cache, and so on.
You'll want to grab update-binary from another kernel package for the SGS2.  One at random is attached to this XDA post.
I tested this method on my SGS Vibrant without issue, using a kernel from an Odin package and an update-binary from another Vibrant kernel .zip.  Note that this is perfectly safe as long as you're writing to the correct partition -- for the Vibrant it was bml17, for the SGS2 it appears to be mmcblk0p5 (based on the kernel from XDA I linked above) or mmcblk0p8 if you're flashing an entire boot image (see comments below).  You'll want to verify it for sure.  Worst case your kernel doesn't work and you flash a known good one.

For the Samsung Galaxy S2 (T-Mobile) SGH-T989, the proper directive (gathered from a known good rom I already installed) shows that the boot block goes in /dev/block/mmcblk0p8, not p5.  Might want to edit that for safety's sake.  I made a zip based on this post and it worked like a charm!  Thanks!

@PeterGrace Ah, the boot image is more than just the kernel, so that's why it's different.

Is there a way to make sure that I should use /dev/block/mmcblk0p8? I've got a Galaxy S2 from Virgin Mobile Canada (same one a Bell Canada), so it's not from T-Mobile and I have no known good ROM (except for CM7, but it writes a boot image, not a zImage). Should I assume that my Virgin Mobile GS2 works the same way as your T-Mobile GS2 or is there a way to check for sure?

@Rognon You could try running mount to see which blocks are mapped where.  Otherwise, find a ROM.

@MatthewRead mount doesn't show either p8 nor p5. Googling around seems to indicate that the zImage should be written to p5, and so does this site : http://forum.xda-developers.com/showthread.php?t=1691867. I have tried to list the content of folder mentioned in the thread, but it doesn't exist on my phone...

I've found you can use fastboot without affecting CWM.
sudo /path/to/fastboot boot boot.img

or
sudo /path/to/fastboot flash:raw boot /path/to/zImage /path/to/ramdisk.img


text:
Deleting contacts in bulk - Ice cream sandwich
I just got my Galaxy Nexus, and from logging into some service, I can't figure out which,
it automatically imported contacts which I don't want on the phone. Is there a way to delete contacts in bulk? I haven't found one yet.
Thanks

for android 4.0
settings--->storage--->Apps--->Contacts Storage--->clear data
sync the contacts with your gmail account before doing this, remove synchornisation, do the above steps and sync again with you gmail account, will take some time for the names and numbers to come


text:
Cleaning the screen of a tablet safely
My 4 year old son loves my ASUS Eee Transformer, and likes the games and stuff.  But he has a cold, and the screen is literally gross.
What are safe methods, and conversely what are unsafe methods of cleaning it?
Being a touch pad I am not sure if the surface is specially coated and say, Windex will destroy it.
I understand there might be device specific concerns as different manufacturers may use different screen cover materials that react differently.

You can find special screen cleaning mixtures to use, but they're mostly just alcohol. I've been using a lens-cleaning spray on my phone for years with no adverse effects. Just spray a bit on a piece of paper towel and wipe the screen down. You'll want to use an alcohol based spray, as it evaporates much faster than water, and so won't short out your device.

Good to know.  Was not sure if there was anything that would damage the screen.

They're pretty good about making the screens neutral.

Do you mean neutral pH, or neutral electrically, or something else?

Chemically neutral, so they're not going to easily react with other substances.

The Transformer's screen is quite impervious, as this video demonstrates.

A bit extreme it would seem.  However, the point is well taken.  I doubt it would survive my Great Pyrenese dog.  He made mincemeat of my Blackberry that he picked up off the counter as it was charging.


text:
Why is sound on my Android suddenly increasing?
I am running Android 2.3 on a Samsung Galaxy S 2.
Recently, when I play music, at some random time, the volume will suddenly increase. It's hard to put an exact measurement on the increase, but I'd estimate it's about 20 to 30% louder.
It's quite jarring, and if my volume is already up near maximum, it can be a little painful.
This happens with any application that plays MP3s, so I don't believe it's application specific.
It also happens without any action on my part. When the volume jumps up, I'm not holding my phone or using any interface, or touching any buttons. It's not that volume buttons are accidentally being hit, either. It happened just now, and my Android is lying on the table beside my laptop, without anything touching it.
Is this a bug of some kind?

What music player do you use?

I use at least three different players, one for podcasts, one for music, and another for streaming internet. I don't think this is connected to one player.

It could most likely be a bug. I suggest you upgrade your Android via Kies or manually.
Galaxy Nexus is known to have a similar software issue with volume: http://techie-buzz.com/mobile-news/galaxy-nexus-to-get-a-software-update-to-fix-the-volume-bug.html Perhaps it could be the same with your S2, especially since it is on older Android version.

It could be a built in limiter to the audio player. It is keeping the volume below a certain DB and then when the track actually drops below that DB the perceived volume increases because the limiter is no longer active. Annoying, not too sure how you would turn it off but try a different audio player perhaps.


text:
Can I use arrow keys?
I've got a Samsung Galaxy Tab GT-I9100 running Android 2.3.5.
I love the "Swype" keyboard except I really want arrow keys. Is there please a way to add them or switch them on?
(Background)
I know I can tap the text entry box and a little pointer appears, but that's just not usable. Often, the vertical bar is always several characters off from where I drag the pointer to. If I want to insert text somewhere outside the visible area, its near impossible to get it to scroll to the right point.

The version of Swype pre-loaded on most Gingerbread Galaxy S's does have arrow keys built in.
Swipe your finger across from the Swype button in the bottom left corner of the keyboard to the SYM button alongside it, and you should see the cursor control screen instead.

Just tap the ABC button to get back to the normal keyboard.
(the other useful extra keyboard you can get is a proper num pad by swiping from the Swype key to the F key in middle of the keyboard).

+1 for another Swype feature I hadn't noticed.   Works on my Droid Bionic (2.3 Gingerbread) and Transformer Prime (4.0.3 ICS).

Yes yes yes! Thank you. Exactly what I was looking for without having to download anything new.

Really great...

As of today this still works but the "sym" key is now a "1234" key and pageUp, pageDn, Home, End have been removed. With Android in general, I wish there was a way to define my own keys more easily. Also I think the  Android volume rocker should switch keyboards. And rolling back to older versions (like Hacker's Keyboard allows) should be easier :-/

Following keyboard apps have arrow keys:

Hacker's Keyboard
Go Keyboard with its Pad Plugin

Simply install them.
Hacker's Keyboard is not liked on smartphones due to its small buttons, but as you are on tablet, I'd recommend it to you. It has all keys found on a PC's physical keyboard (including even Control, Alt etc keys). Take a look of it:

Use Go Keyboard if you want style. It supports more layouts, themes and languages. It supports swipe-based input, too.

Go Keyboard is my primary keyboard. But, when I use Connect Bot to access my remote servers, I switch to Hacker's Keyboard.

I love Hacker's keyboard especially because it does show arrow keys along side characters just like out normal PC keyboard. Other keyboard apps unnecessarily replaces character keyboard with arrow keyboard, so I need to jump between two different keyboards if I have to constantly use characters and arrows together. What now I am missing in Hacker keyboard is swype. Is it possible to have swype on Hacker's keyboard? Or is there any other app which provides charachters+arrows+swype on same screen together? Also Go Pad plugin is not for phones so no way to get arrows with Go on phone?

@PJBrunet You can select text using shift + arrow keys using hacker's keyboard

Current version of Swype (as of this writing) doesn't have the arrow keys feature.  I would suggest putting in a feature request on Swype forums.
With that said, there are many alternative keyboard apps on the Google Play Store with the arrow keys built in.

Arrows are back in latest version. I'm using it now in Android 4.4.2


text:
Galaxy Nexus - How do I start adding strangers' numbers to "auto-reject"?
I regularly get phone calls from people trying to reach an old folks' home and I want to outright reject those automatically (without any "send to voicemail" ideally).
This was fairly painless on the Galaxy S: from the Call Log, tap-hold on the bad number, menu pops up, select "add to auto-reject". [Auto reject was enabled in the phone's settings before]
How do I achieve the same thing with the Galaxy Nexus?  I'm figuring the same feature should be available from the stock ICS somewhere.  If not, I'm open to lists of auto-reject apps.

If it's the same people ringing you regularly what you could do is:

Add them as a contact, under 'Ignore1', 'Ignore2' etc. whenever they
ring
Go to Contacts -> Select 'Ignore1' -> Options (or action menu) -> Select 'All calls to voicemail'

Or if you don't like this method then you could try:

Mr. Number: Text, Call & Block
(free)
Extreme Call Blocker Droid  (paid)

I didn't want to add a new contact called "Auto Reject List", but I guess it's good enough for now... Although, I'm just going to add all of the rejects into the same contact, because it's cleaner than flooding my contact list with "Ignore #1, #2, #3... etc"

Ah yes I didn't think of adding them to the same one. I know it's irritating have to have them saved as a contact, you'd think you could just block people and then have a separate list of who you've blocked so you can revoke it if you change your mind.

You can also try Call Manager.


text:
Is GSM telephony feasible on the Samsung Galaxy Tab 8.9?
I'm looking to buy a small tablet to use as a "table phone" for use with a headset, and for video telephony. GSM telephony is a must - I don't want to rely entirely on Skype, or Internet connectivity in general. (Plus I'm eligible for a landline number on my mobile contract so people can call me from normal phones for free, which is great.)
I am hovering between the 7" P1000 Samsung Galaxy Tab and the more expensive, newer 8.9" one.
The 7" one officially supports GSM telephony. Various tests remarked that it's a bit too chunky for use as a normal mobile phone but for my use case on the desk, that doesn't matter. I really just want something I can carry around in a bag, and put on my desk to make calls with.
The 8.9" one supports GSM telephony, but doesn't come with it activated out of the box. You need third party Android products in order to use it.
This strikes me as odd, and makes me expect problems - why else would one build in the functionality, but not ship with it enabled? Telephony is the one thing I really, really need to just work - I can't afford to deal with dropping connections, bad voice quality, patches, and an overall "beta" experience.
Is telephony feasible on an 8.9" Samsung Galaxy Tab?

I really like this question, but I wouldn't ask for GSM telephony on a particular tablet and instead ask general ".. on Android tablets".

@Flow good idea, I edited it into a more general form. Thanks!

No, a list will only get out of date.  We close questions asking for "Devices with X" all the time.

Hmm, he isn't asking for a list. Pekka ask about experience with GSM telephony on the tablets. The out of date argument would also include all CW questions, more or less. And I don't see why the answers now shouldn't also become sometime in the future out of date.

Related: Can I make and receive phone calls using a tablet with a SIM card slot in it?

You write that the 8.9" tablet has support for GSM telephony but that it is not activated out of the box - and that suprises and concerns you.
Well, for many of us, the original 7" Galaxy Tab is the same: the hardware supports GSM telephony but the North American firmwares have no support for it.  Presumably this was done at the behest of the N.A. carriers who want users to use the tablet as a second cellular device - not as a replacement for a phone.
As a result, I had to root the Galaxy Tab and load a European firmware on it in order to activate its GSM telephony.  Once I did this it worked perfectly well as both a phone and a tablet.  (Though it does seem rather slow by today's standards, and it won't be getting ICS.)
It sounds like that is the same situation that you would face with the 8.9" tab: the fact that the GSM telephony was not supported out of the box did not mean that it didn't work well - but you need to be prepared to get your hands dirty to 'activate' this functionality yourself.

A list with tablets will rapidly became outdated so the best is to provide a reference to 2 sites that will probably get updated at least every once in a while:

http://en.wikipedia.org/wiki/Comparison_of_Android_devices

(not all specs available you can search for the model name here http://www.gsmarena.com/ to get the specs) and

http://www.google.com/phone

(only US devices I think)


text:
Google Now is not able to call one of my Google contacts
Google Now can call all of my contacts... except for one: James P*****. See the following screenshot:

Screenshot: Call James (click image for larger variant)
What? Who the hell is James A. Kellam? An attorney, apparently, but I don't know him.
Let's try a similar name, also in my contacts: Jimmy P***** (same last name, different contact):

Screenshot: Call Jimmy (click image for larger variant)
As you can see, that works as expected. I find this strange because they are both Google contacts. They both show up on http://contacts.google.com and they are both marked as Google contacts on my phone.
Why can't I call James through Google Now, but I can call Jimmy?
I am running CyanogenMod 10.0.0-d2vzw on a Samsung Galaxy S III.

Is the voice recognition correctly getting the last name you are saying? I can never get it to understand my last name, so it usually does a google search for what I thought it said, instead of trying to call a contact.

Yes, I blacked it out but the last name is correct.

I have several contacts that act the same way. Sometimes when I append the contact's number's label to the end of my spoken command it helps; something like, "Call John Smith, mobile" or "Call John Smith, home."

"Call James P*****, Mobile" just comes up with "Contact not found." There is an option for "find contact." I press that and select "James P*****" and then press mobile and it calls. If I say "Call James P*****, Mobile" again, however, it just comes up with the same "Contact not found" screen.

Does adding "on" help? E.g., "Call John Smith on mobile"

Adding on did fix it. Strange.

Strange indeed. I only do it as a hold-over from a previous phone that required voice commands be given in a specific way. I'm glad it helped solve your trouble.

It gets stranger: "Call James" works now but not "Call James P*****."


text:
Sent text (SMS) messages sometimes show up under wrong contact's conversation
I'm on a Nexus One with Android 2.3.7 (CyanogenMod-7.2.0-passion), and recently I've noticed some sent messages go into the wrong contact's conversation: I send a message to person ABC, the person does receive it correctly, but when I check later the app shows it as sent to a different person XYZ. This really messes up the conversation and gets confusing quickly.
This has happened thrice so far, and there doesn't seem to be any pattern to it except both the contacts involved were people I had been messaging recently at those times. Note that the correct contact does receive the message, it's only on the display of the Sent message that this bug happens.
I'm using Handcent app, but the same display issue occurs in the default Messaging app. In both cases, the message details that comes up after a long press on the message shows the correct number. But somehow, it is still shown under the wrong contact. I've also tried restarting the phone, doesn't help.
Edit: I checked them all, and there does seem to be a pattern here - in each case, if a message ("msg1") sent to A is wrongly displayed under B, it turns out that B was the person I sent the next SMS after "msg1". That is, I send "msg1" to A, then after some time (varies from a few hours to a few days) I send a different message ("msg2") to B, "msg1" and "msg2" both end up under contact B one after the other

Do the phone numbers of the two contacts show some similarities, e.g. ending with the same X digits (in an extreme case: identical numbers with just different country prefixes)? Or are the "wrongly listed" places only depending on "recently messaged contacts", and it might be a different "place" each time it happens?

I checked the numbers, there isn't any visible consistent similarities among them: one pair has the 4th and 5th digits as the same, another has 4th and 6th digits, another has only the 8th digit the same between them. Looks like only random, chance correlation.
I don't understand your second question though, could you explain what you mean?

The first part was referring to "number matching": some algorithms only check the last N digits whether they're matching, so 0123-4567890 and 0321-4567890 would be counted similar on N=7. That's obviously not the case here. Second part was a raw guess: You message A, then B, and the last msg gets applied to A (while sent correctly to B). Now you message C, then A, and A gets the last msg, but it's stored to C? That would make a pattern ("stored to previous"), though it makes no sense. Enough time between the two messages, and they get stored correctly?

Yes, there does seem to be a pattern of that kind here! I checked them all, and in each case, if a message ("msg1") sent to A is wrongly displayed under B, it turns out that B was the person I sent the next SMS after "msg1". That is, I send "msg1" to A, then after some time (varies from a few hours to a few days) I send a different message ("msg2") to B, "msg1" and "msg2" both end up under contact B one after the other.

That's very strange! Though I know of no solution to this: would you please [edit] your question and include this discovery, so it's easier to find? That way it might attract some attention from others having experienced the same, and improves chances for possible answers. Thanks!

Sounds related to that old SMS bug from 2010, where messages were being sent to the wrong person.


text:
Nexus 7 tablet (original model) stuck in Safe mode; no way out?
I own a Nexus 7 tablet (the first Wi-Fi + 3G model - only front-facing camera, no support for phone calls). Yesterday, I wanted to take a screenshot on my tablet and tried various key combinations; i.e. power key + up/down volume keys; I am not sure about the exact combination, especially because I didn't expect anything bad to happen.
I am not sure that's the exact cause, but there's no other way it'd have gotten into safe mode.
So, how do I get my tablet out of safe mode?
I've tried:

As stated in the official docs (and confirmed by a Google rep.), simply restarting the tablet (i.e. power off, then power on) should fix it.

...restart your device to get it out of safe mode

Following these exact steps, I tried manually booting into safe mode, and then restarting the tablet to get out of it.
This:

It is necessary to hold the volume control switch to "high" and then operate the "on" switch, to get out of safe mode [...] hold the "on" switch for at least fifteen seconds.

Reset device to factory settings.
Reset device in Recovery mode.
(Followed steps under Nexus 7 section) successfully from 1 to 5. Volume buttons become unfunctional at this point, and I am unable to use them to scroll to "wipe data/factory reset". Mind you, the volume buttons worked in the first few steps, so there's nothing wrong with the buttons themselves.
Battery pull, i.e. holding the power button until the tablet restarts.
Remove SIM card and restart. Insert SIM and restart.

But... NONE of them worked. My tablet is still in safe mode and I'm out of ideas. Is there anything I can do to fix this?

request RMA from Asus, sounds like hardware key is stuck.

@t0mm13b I don't think the keys are stuck. Please read point (5) in my question. Anyway, I'll be taking the tablet to the ASUS service point in my place (just came to know there's one).

I also encountered the very same problem. But since i had already rooted my device and installed Cyanogenmod 12.1. This tutorial helped me fix the problem.
http://www.guidingtech.com/57291/disable-physical-buttons-android-phone/

I had the same problem. Spent a night to fix it. First i thought it to be a software issue.. browsed and tried infinite fixes. I tried re seating flex cable that connects the volume buttons and the motherboard.I tries to factory reset through boot loader. Thought of flashing a different ROM. Dint work out for me.
Here is what worked for me.

Open the back panel of the tablet.
https://www.ifixit.com/Guide/Nexus+7+Power+%26+Volume+Button+Cable+Replacement/9926
Flip up the retaining flap on the 'power and volume button ribbon cable' connecting to the mother board. DO NOT PULL OUT THE CABLE NOW.   Be ready to pull out the cable.

3.Press the power button to switch on your tablet.
4.The moment you see Google logo, pull out 'power and volume button ribbon cable'. This will disconnect volume down key, which forces the tablet into bootloader.
5.Now the tablet is ON in normal mode.
6.Plug the 'power and volume button ribbon cable' into its mother board socket.
7.Close the panel and enjoy using your tablet.
Be very careful with 'power and volume button ribbon cable'. A slight twist or bend will short the connections inside the cable.
P.S : After powering on, Try not to switch off the tablet. The volume down key might malfunction again and your tablet might go back to boot loader. Charge it before the battery dies out. In worst case, you'll have to repeat the above steps again. Messing with the power keys cable is not always a good idea :D
The volume down key and power key combination lets you to go into boot loader. So when volume down key is malfunctioning, your tablet might go for a toss. This could be for various reasons ,
a.Volume key is abused
b. volume key cable is damaged
c. Mother board is unable to supply enough power to volume keys.
d. volume keys socket in the mother board is damaged.

I had this issue and I solved it by replaceing the OEM power and volume ribbon. I picked it up from Alibaba for only $3. Today I installed it and it works as it should now. My issue to start with was a Monster can bursting all over it in my laptop bag. Saved my laptop saved my old but good tablet. Nexus 7 wifi 2012 version

If your cell phone or other Android device is always booting into Safe Mode, follow the steps below.

Remove any case or gel skin from the phone. If the case is pressing on the Menu key it can cause it to load into Safe Mode.
Remove the battery and SIM card (if present) from the phone.
Wait at least 30 seconds.
With the battery still out of the phone plug the phone into its wall charger.
Place the battery and SIM card back into the computer.
Turn the phone back on. While the phone is loading do not press any keys or buttons.

After the above steps have been followed your phone should be able to load into normal mode each time you start the phone. If the phone continues to load into Safe Mode an app you've recently installed may be preventing the phone from loading normally. Remove any recently installed app on the phone and try the above steps again.
Finally, if the phone continues to load into Safe Mode after following all of the above steps we suggest performing a master reset, which will reset the phone and erase all settings and software.
Source: http://www.computerhope.com/issues/ch001362.htm

Your method (of removing and re-inserting SIM card) doesn't work. As stated in my question, I've already tried Factory Reset, and it too didn't work.

Try solve it with the Android Toolkit wich helped me. Boot it via the program itself (boot stock....). You might need to install the drivers first(the program helps you with it). See more here: http://forum.xda-developers.com/showthread.php?t=1809195

My Nexus 7 (2013) had this problem and the volume rocker switch was bad. Found a new OEM part on ebay for $15 (including shipping) and looked at youtube for how to pull the device open and then the replacement was easy!
Sometimes switches go bad. When your device is out of warranty why not give a replacement a shot?

To make it easier for others with the same problem, could you add a link to the YouTube video that you found? Thanks!


text:
Partition MicroSD card to exFat and Ext 4 for link2sd?
I've been poking around using GParted on my 128GB microSD card so it can use two partitions for link2sd. Problem is, no matter what I do, each time I place the card in my phone, it says that the card is corrupted. I had been using the card just as storage (it was formatted by Android itself).
Technical details:
Phone: Samsung Galaxy Express 3 (SM-J120A)(sometimes called Samsung Galaxy J1)
Version: 6.0 Marshmellow
SD Card: Samsung EVO Select 128GB
Root status: Rooted
When I look at the partition after the phone formats it, it is an exFat partition with the Flags "boot" and "lba". Reformatting it myself to exFat with no Flags causes it to give an error in the phone "This card won't work".  If I try to give it flags, only the "boot" flag is applied. Anytime I press the "lba" flag option, it won't even check the box (its not greyed out). Other flags work fine. Even if I use the command-line (Parted) it still won't apply the lba flag.
To confirm that the card isn't broken, I have stuck it back into the phone for it to format. Works perfectly. I've even formatted the entire card to Fat32. Stuck it in the phone, no problems. Fat32 and ext4 partition combo does work.
Other than that, it simply will not accept a exFat/ext4 combo. Or even exFat alone. What I really want is to have 32 GB as an ext4 partition, and the rest being exFat. I don't want to be limited by Fat32's 4GB file size. Though aside from video, I'm not sure what large files I might have (emergency storage?).
Recommendations, advice, and solution(s) would be most appreciated.

You could try a partitioning app directly on the Android device (not tried that myself; disclosure: link goes to my Android site).

Tried AParted, it partitions, but second partition is considered "corrupted" by Android. Android's way of saying that it's no good.

OK, was worth a try. Sad it didn't work out better. Maybe you've gotta stay with FAT32+Ext4. By the way, have you tried to "switch" their order? I've never partitioned my SD, but it always sounded like the FAT partition should come first.

Both of the app movers say they expect the Ext2/4 partition to be the Second partition. So that's the way I've been doing it.

If your phone is rooted you can emulate ext4 partition instead of formatting:

install a ext4 image file located on external microSD Card
busybox dd if=/dev/zero of=/sdcard/.data.sdext2.img bs=4k count=1048576
busybox mke2fs -T ext4 -F -q /sdcard/.data.sdext2.img

Due the limitation of FAT32 file systems, the maximum file size is 4 GB. However, some busybox binaries are compiled without large file support and cannot create files bigger then 2 GB.

fix the mount script. pre-mounting the sdcard first, then mounting the ext4 image file (all mount options are just examples, check "mount" for real uid/gid)
#!/system/bin/sh
/system/xbin/busybox sleep 4

# use this if mount point is missing on boot
/system/xbin/busybox mount -o remount,rw /
mkdir /storage/sdcardtmp
/system/xbin/busybox mount -o remount,ro /

/system/xbin/busybox mount -t vfat -o rw,dirsync,nosuid,nodev,noexec,relatime,uid=1000,gid=1015 /dev/block/mmcblk1p1 /storage/sdcardtmp

/system/xbin/busybox sleep 1

# use this to overwrite old LinkSD settings
/system/xbin/busybox umount -l /data/sdext2

/system/xbin/busybox mount -t ext4 -o loop,rw,nosuid,nodev,noatime,noauto_da_alloc,data=ordered /storage/sdcardtmp/.data.sdext2.img /data/sdext2

After this, Link2SD now detects 2. partition on boot. but instead of a 2. partition you just have a single image file on sdcard (which can easily copied via MTP for backup)

Try to use this app for Windows to partition sd card: MiniTool Partition Wizard.
Then use App2SD Pro: All in One Tool [ROOT] to create a mount script for the second partition.

Took FOREVER for that software to do it, but it worked. Much slower than GParted. Made an Ext3 partition at 32 GB and the rest being an exFat partition.

Jumped the gun initially. The exfat partition works. But now the second partition (made it ext2 at this point) is seen as a second SD card which android considers corrupted.

I'm now using Apps2SD instead. It has a built-in partition editor.
Though I went and verified other things. Turned out my GParted was old, got a newer version and formatted a FAT32/Ext2 combo. Works with Apps2SD. Link2SD might be broken. I'm content with FAT32 for now. I think Apps2SD does ExFat though. Tried Link2SD because I thought it might work when Apps2SD did. Does not. Not sure why. Read somewhere that Link2SD might also be dying, but that's speculation.


text:
Folder becomes invalid after trying to create a nameless folder inside it by mistake!
My first post on stackexchange.
I was trying to change the name of a folder inside another folder in my extsdcard. I cut the name. But unfortunately pressed the rename button before inserting  a new name for the folder. Now the parent folder becomes empty, only a file named "invalid " (0.0 byte) is in it.  Other files & folders are not there.
Is it possible to recover the files?

You should try to put your SD card into a linux computer.
Then make as soon as possible a dump of your SD card using dd. In this way you'll get an image which you can use for recovery trials and avoid to brick your original device.
Then you can use this image (or a copy if you modify it) for your trials.

First try just to mount it and see, if it possible to access it and the relevant files.
If this does not help, you should use fsck to hopefully recover your lost files, results are typically stored in the directory lost+found.
If this all does not help, you should use a tool like testdisk to recover all kind of lost and deleted files. (However, this method will be most likely have a chance to be successfull, if there have not been to much write operations on the SD card, as every write operation might overwrite any lost files).