# Question
Title: How to make a 'Captive Portal' on my mobile hotspot?
Some Wi-Fi networks such as those you find in coffee shops, when connected to, automatically redirect you to a web page where you will need to do something (enter credentials, accept terms of service, etc) in order to access the internet.

Is the same possible with an Android hotspot?

# Answer
Myles Bartlett's answer might be correct in a few respects: This is no simple job! Creating a captive portal on a mobile hotspot would require more than just an app. It would require a backend system to manage user authentication and access control. One possible approach would be to implement a RADIUS server, which is a networking protocol that provides centralized authentication, authorization, and accounting (AAA) management for users who connect to a network.

To create a captive portal, you would need to configure your mobile hotspot to redirect all traffic to a web page that prompts users to authenticate themselves. Once the user enters their credentials, the backend system would use RADIUS to authenticate the user and allow or deny access to the network.

However, implementing a RADIUS server on a mobile device can be complex, and it may require root access. It might be easier to use an existing captive portal solution or consider using enterprise/prosumer wireless access points from a vendor like Ubiquiti Networks, which offers built-in captive portal functionality.
> 1 votes

# Answer
I've made a script that works alongside Irfan Latif's CLI-based AP. I've made some minor modifications to their script, so here's the final result which works in Android 12 (LineageOS 19)(SELinux: Enforcing):

```
#!/system/bin/sh

# SCRIPT SOURCE: https://android.stackexchange.com/a/215514
# SEE ALSO: https://android.stackexchange.com/a/202335

set -e
#set -x

# this scripts creates a hotspot network

[ "$(id -u)" = 0 ] || { echo 'Not running as root!' >&2; exit 1; }

# Add /vendor/bin/hw to path. That’s where hostapd is in LineageOS 19.0
export PATH=$PATH:/vendor/bin/hw

# check required binaries are on PATH
for bin in iw ip iptables hostapd dnsmasq
do
    ! which $bin >/dev/null || continue
    echo "$bin not found." >&2
    exit 1
done

####################
# define variables #
####################
source /data/data/com.termux/files/home/customAP/config.sh

##########################
# start / stop tethering #
##########################
STOP()
(
    echo 'Cleaning up. Feel free to ignore any errors in this stage..'

    # don't print error messages
    #exec >/dev/null 2>&1

    # hope there are no other instances of same daemons
    pkill -15 hostapd
    # Do not kill wpa_supplicant to avoid WifiSelfRecovery from disabling wifi
    #pkill -15 wpa_supplicant
    pkill -15 dnsmasq
    # remove RPDB rule and iptables rule
    ip rule del lookup main
    iptables -D INPUT -i $AP_INTERFACE -p udp -m udp --dport 67 -j ACCEPT
    # delete AP interface
    #ip link show
    iw dev $AP_INTERFACE del
    #ip link show
    rm -rf $DIR
    echo "Cleanup done."
)

if [ "$1" = stop ]
then
    STOP || true
    exit
elif [ "$1" != start ]
then
    echo 'Usage:' >&2
    printf '\t%s\n' "$(basename "$0") start|stop" >&2
    exit 1
fi

################
# basic checks #
################
if ! iw phy | grep -A10 'Supported interface modes:' | grep -q '\*[ ]*AP'
then
    echo 'AP mode not supported.' >&2
    exit 1
fi

if ! iw dev $WIFI_INTERFACE link | grep -q '^Not connected'
then
    echo 'First disconnect form Wi-Fi.' >&2
    exit 1
fi

##########################
# stop running instances #
##########################
STOP || true

#####################################
# create virtual wireless interface #
#####################################
if ! iw dev $WIFI_INTERFACE interface add $AP_INTERFACE type __ap
then
    echo "Couldn't create AP interface." >&2
    exit 1
fi

#####################################
# configure newly created interface #
#####################################
echo 'Configuring network...'

# activate the interface and add IP
ip link set up dev $AP_INTERFACE
ip addr add ${IP}/24 broadcast ${SUBNET}.255 dev $AP_INTERFACE

# Android doesn't look up into main table by default
ip rule add lookup main

#######################
# access point daemon #
#######################
# create configuration file
mkdir -p "$DIR"
cat <<-EOF >$DIR/hostapd.conf

logger_syslog=1
logger_syslog_level=0

logger_stdout=-1
logger_stdout_level=0

country_code=AR

# network name
ssid=$SSID
# passphrase to use for protected access
wpa_passphrase=$PASSCODE

# network interface to listen on
interface=$AP_INTERFACE
# wi-fi driver
driver=nl80211

# set operation mode, 'g' for 2.4GHz band
hw_mode=g
# WLAN frequency channel to use
channel=9

#Win10 compatibility stuff
ieee8021x=0
eap_server=0
ignore_broadcast_ssid=0

# Security
wpa=2
# key management protocol; use pre-share key
wpa_key_mgmt=WPA-PSK

#Win10 compatibility stuff
wpa_pairwise=TKIP
rsn_pairwise=CCMP

EOF

#Show condiguration
#echo '========================================='
#echo 'Using this hostapd.conf configuration file:'
#cat $DIR/hostapd.conf
#echo '========================================='

echo 'Starting hostapd...'
hostapd -B $DIR/hostapd.conf

################################################
# run a dhcp server to assign IP's dynamically #
################################################
# create configuration file
cat <<-EOF >$DIR/dnsmasq.conf
    # we dont want DNS server, only DHCP
    port=0

    # nameservers to be sent to clients
    dhcp-option=6,1.1.1.1,1.0.0.1

    # range of IPs to make available to wlan devices and when to renew IP
    dhcp-range=$IP,${SUBNET}.254,24h
    # where to save leases
    dhcp-leasefile=$DIR/dnsmasq.leases

    # respond to requests from a different IP broadcast subnet
    dhcp-authoritative
    # don't look for any hosts file and resolv file
    no-hosts
    no-resolv

EOF

# open listening port
iptables -I INPUT -i $AP_INTERFACE -p udp -m udp --dport 67 -j ACCEPT

#echo "dnsmasq config:"
#cat $DIR/dnsmasq.conf

echo 'Starting DHCP server...'
dnsmasq --pid-file -C $DIR/dnsmasq.conf </dev/null

echo "All Done!"

```

If you're having issues with the AP starting up feel free to uncomment some of my left-over debugging commands.

Also note that most times it takes a couple of minutes (2mins) until Windows 10 actually detects the AP and allows you to connect to it.

For more information about that script, checkout the links at the beginning.

The contents of config.sh:

```
SSID=MyAP                           # set this to your desired string (avoid spaces and non-ascii characters)
PASSCODE=foobarfoobar               # set this to your desired string (8 to 63 characters)
WIFI_INTERFACE=wlan0                # set this according to your device (check with 'lshw' or 'ip link show')
AP_INTERFACE=${WIFI_INTERFACE}-AP
#AP_INTERFACE=p2p0
DIR=/data/local/tmp/$AP_INTERFACE
SUBNET=192.168.43
IP=${SUBNET}.1

```

Now, this is the script I made. Run it as root to enable the traffic redirection. Note that running it with "sudo" doesn't work.

```
# ./captive_portal.sh start

```

```
#!/system/bin/sh

source /data/data/com.termux/files/home/customAP/config.sh

# IP the traffic will be redirected to
REDIRECT_IP=192.168.43.1

STOP()(
echo "Stopping dnsmasq..."
pkill -15 dnsmasq

echo "Restoring previous dnsmasq config..."
mv $DIR/dnsmasq.conf.bak $DIR/dnsmasq.conf

echo "Removing phishing redirect iptables rules..."
iptables -t nat -D PREROUTING -i wlan0-AP -p tcp --dport 80 -j REDIRECT --to-port 8080
iptables -t nat -D PREROUTING -i wlan0-AP -p udp --dport 80 -j REDIRECT --to-port 8080
iptables -t nat -D PREROUTING -i wlan0-AP -p tcp -j DNAT --to-destination $REDIRECT_IP

echo "Starting dnsmasq..."
dnsmasq --pid-file -C $DIR/dnsmasq.conf </dev/null

echo "Done."
)

if [ "$1" = "stop" ]
then
    STOP || true
    exit
elif [ "$1" != "start" ]
then
    echo 'Usage:' >&2
    printf '\t%s\n' "$(basename "$0") start|stop" >&2
    exit 1
fi

echo "Stopping dnsmasq..."
pkill -15 dnsmasq

echo "Setting up iptables rules..."
iptables -t nat -A PREROUTING -i wlan0-AP -p tcp --dport 80 -j REDIRECT --to-port 8080
iptables -t nat -A PREROUTING -i wlan0-AP -p udp --dport 80 -j REDIRECT --to-port 8080
iptables -t nat -A PREROUTING -i wlan0-AP -p tcp -j DNAT --to-destination $REDIRECT_IP

# Backup the dnsmasq config
cp $DIR/dnsmasq.conf $DIR/dnsmasq.conf.bak

# Overwrite the config
rm  $DIR/dnsmasq.conf
cat <<-EOF >$DIR/dnsmasq.conf

    # nameservers to be sent to clients
    dhcp-option=6,$IP,$IP

    # range of IPs to make available to wlan devices and when to renew IP
    dhcp-range=$IP,${SUBNET}.254,24h
    # where to save leases
    dhcp-leasefile=$DIR/dnsmasq.leases

    # respond to requests from a different IP broadcast subnet
    dhcp-authoritative
    # don't look for any hosts file and resolv file
    no-hosts
    no-resolv

    # Reply to all queries with my IP
    address=/#/$REDIRECT_IP

EOF

echo "Starting dnsmasq..."
dnsmasq --pid-file -C $DIR/dnsmasq.conf </dev/null

echo "Done."

```

Then you just start a web server in the IP 192.168.43.1 and you're done!

```
python -m http.server 8080 --bind 192.168.43.1

```

Note that this doesn't do any authentication. The script above only does the traffic redirection. You'll have to implement authentication yourself, probably through nginx, PHP and iptables.
> 0 votes

# Answer
You might be able to, if you wrote an app for it. I'm not sure if the APIs are available though, and whether it would require root or not as I don't develop for Android. As far as I know, there is no way to do it on stock Android.

EDIT: Android's Native Development Kit could make porting such software easier, however I do not know if one can manage the network in the correct way (the closest most apps can get without root is the VpnService API)

You would need to implement RADIUS or similar. Trust me, it is complicated even on platforms FreeRADIUS supports. You might want to just get some enterprise/prosumer wireless access points and use those (Ubiquiti Networks are good ones to look at)
> -1 votes

---
Tags: wi-fi, wifi-hotspot, captive-portal
---


# Question
Title: Disable "Upcoming Alarm" Notification (without disabling alarm)
I'm fairly new to the Android platform so hopefully this is a silly question, but since I've had my Pixel (Pixel 1, Android 8.0.0), it's been giving me notifications for alarms I set in the Clock app two hours prior to their occurrence (disregard actual time in the screenshot). Note that I *do not want to delete the alarm*, just this notification about it.

.

I know this isn't a *huge* issue, but it's just more annoying notification clutter that I don't want. What's weird is, I've apparently found the settings to change this behavior - but the toggle is disabled and I can't modify it.

Is there another way to do this that I'm missing, or a way to enable that toggle?

# Answer
> 6 votes
After spending an hour on the phone with Google tech support (don't know why I didn't think of this earlier) their representative was able to replicate the issue.

At this time there appears to be no way to disable this notification on a stock/unrooted Pixel. I'll update the answer if I get any further information.

# Answer
> 4 votes
Well, this is a late response but I just ran across this as I am having the same problem. Thank to jszpila here for posting Google's response so I didn't have to waste any more time trying to get rid of the "upcoming alarm" notification.

As a work-around, I changed the sound for the "upcoming alarm" notification to "None". The notification still comes up but it is unobtrusive.

# Answer
> 2 votes
A long press 'upcoming alarms' will bring up another screen where you can customize the 'upcoming alarms' notification category.

# Answer
> 2 votes
I managed to do it by setting an alarm and waiting for the notification to come up. Long press and go to more settings. Weirdly, as you said, it's already disabled, but if you tap on the bottom line with the disabled setting, you get a new menu and then select notification priority (the top option) and select "low priority".

# Answer
> 2 votes
This is from a Mate 20 Pro with Android 9, and Google Clock app version 6.2. It is now possible to disable the annoying notification. For me, it was SO annoying, because I use a Garmin smartwatch that vibrates when a notification arrives, and it ended up waking me up 2 hours earlier!

Sorry for the screenshots' language, it's in Italian which is my native language, but I hope that they can help.

# Answer
> 1 votes
There is a function called "alarm skip" that lets you dismiss/turn off an alarm two hours before it rings. I hadn't realized that I had turned it on, but I was missing alarms because of that notification (and dismissing it turns the alarm off). I turned off Alarm Skip in settings, and things should work better now. Sharing in case someone else needs this.

(ETA: I'm on an LG V35 ThinQ so I don't think my phone is completely stock Android, but perhaps looking for some variation of this function will help you find the setting to turn it off?)

# Answer
> 0 votes
Not entirely sure, as I use a modified 7.1.2, but I got the impression you could disable individual, or at least app-wide notifications, by swiping to the side and tapping the settings button.

Also, in MM / N there's a menu somewhere in the notifications settings that let's you block notifications from an app, I know that for sure. As I said before, I don't use Oreo, though if I found a ROM for my device that did, I would.

Let me know if this works, or if it doesn't.

# Answer
> 0 votes
Disabling notifications stopped the 2-hour-early reminder for me without affecting the alarms themselves.

# Answer
> 0 votes
Install AutoNotification which can be flexibly configured to block almost any notification.

Install the app.

1. Make sure the Upcoming Alarm notification is active (set an alarm for a few minutes time if not)
2. Open AutoNotification
3. Choose **Notification Blocking** in the **Standalone Features** section.
4. Touch the **+**
5. When asked for help setting up the block filter, Press **Yes**
6. If you have more than one notification active, it will ask you which one to use - tap on **Clock: Upcoming Alarm**.
7. Choose **Title** when asked about about Title or Text.
8. Press **OK** if it tells you about Partial Blocking.
9. The Filter setup screen should already be pre-populated with the right information, on my phone it looks like this:

10. Press **OK** and you're done - the Upcoming alarm notification should disappear.

# Answer
> 0 votes
I've found a partial answer, after going to

https://support.google.com/android/answer/9079661?hl=en#contact=1

selecting the Samsung helpsite, and chatting with Pete.

He instructed me to go to Settings \> Accessibility. At the top of the list was something that said "Using 2 functions". I was able to turn off the upcoming notification of notifications in Timely there.

The Timely timer still doesn't have any sound. (I've added "The Clock" to my list of apps to have a timer that rings.) Nudnik works, but it still doesn't unlock my screen. And I still haven't figured out how to turn off the damned bubbles that are cluttering up my screen.

But avoiding 25-minute advance notifications of notifications is progress, at least.

# Answer
> 0 votes
Evidently this is possible now with newer version of Android. I just wish they made the distinction between having the notification be available to see, but not "wake" the screen at 120 minutes and 30 minutes before the alarm.

I'd still like to see the upcoming alarm if I wake the screen manually, I just don't want it waking my screen twice on its own.

Disabling "Upcoming alarms" means everything goes away. Oh well.

# Answer
> -2 votes
https://www.androidsage.com/2018/08/09/how-to-enable-system-ui-settings-on-any-android-device/

Install a System UI Tuner launcher, then go to Status Bar. Scroll down to Alarm and turn off. Now the Alarm icon will be hidden from the status bar.

---
Tags: notifications, alarm, clock, google-pixel
---


# Question
Title: How do I use my BLU M8L 2022 tablet as a phone?
How do I use my BLU M8L 2022 tablet as a phone?

# Answer
> 0 votes
GSM Arena is wrong on the hardware. The BLU M8L has 4G LTE hardware. If it didn't, you wouldn't have a SIM and phone number. It does have the radios, just no phone or text system apps visible. The system apps stay hidden.

If I can figure out how to unhide them long enough to be able to add those apps to the home screen, I will post my results.

P.S. to anyone checking, I believe you could still download the apps TextNow, Pinger, and stuff like that, but use their app with your phone number instead of their VoIP setup. It's not ideal but in a worst-case scenario.

You can alternatively, if you know enough about the process. Open developer settings, and enable OEM unlock. From there you could probably find TWRP Recovery and a LineageOS custom ROM. LineageOS tablet ROMs usually have the GApps for Phone on the home screen anyway as default for AOSP Gapps. I will return with my progress.

---
Tags: tablet, telephony, blu
---


# Question
Title: Got recommend YouTube videos that my friend is watching from his offline laptop
So, my friend was watching a movie. His laptop was offline for the last 2 days. When I opened my YouTube, I got recommended a scene from the same movie. It is highly unlikely to be a probable incident. If his laptop was online, it would make sense for recommendations. But even if he has downloaded that movie months ago.

How is the algorithm able to predict this even if I don't watch scenes from movies?

# Answer
Check your microphone privileges on all social media, and apps like YouTube, and make sure that the mic permission is set to "Only while using the app". Most of those apps will cache small voice recordings and forward them to the apps and services. That's how it customizes its ads to you. It's also why people are paranoid about their devices "listening" to them.

When Facebook Messenger was first released, it asked for permissions to mic, cam, phone, contacts, and photos. A video immediately went viral and hit most national news outlets of a man ranting about Facebook stealing our data and spying on us. It can and probably does get used that way, but that was never the intent. It was literally the app asking your permission to do those things to make your life easier. So all of those functions could be used through just Messenger.

However, if you don't want extra data and input saved, change your permissions for the mic from "always", to "only while using..." Should clear that issue up.
> 0 votes

---
Tags: google, privacy, youtube
---


# Question
Title: Remove Gmail account from Gmail app without removing Google account from the phone
I don't use Gmail for my e-mail. However, I want to use the Gmail app for my work e-mail. So, how do I keep only my work e-mail in the Gmail app, removing the Gmail account from it completely?

I still want to have Play Store and Google Fi to be associated with my account. To my understanding, when I try to remove my Gmail account from the Gmail app, it suggests completely removing my Google account from the phone.

I'm on Android 9.

# Answer
For me, I have a slightly different need but the same solution applies. For me, I use the unified inbox in Gmail for work (I have multiple work email accounts) but I also need to sometimes check my son's school email.

A solution that works for me is to use Secure Folder (for Samsung) or dual apps (for Xiaomi or other phone makers). This creates two separate profiles with separate Google accounts.

The one asking the question here could then put their personal account and Google Play in one profile and their work emails in the other profile
> 1 votes

# Answer
Emails and Play Store accounts are not related. There are 2 ways

1. You can remove the account from Android's `Settings` -\> `Account management` despite its warnings, and then just log back into Play Store with it.
2. Open the Gmail app, press the hamburger menu, go to `Settings`, select the email address, and disable sync.

For the record, I have multiple Gmail accounts and change which one I am using in the Play Store multiple times a day. And I don't use Gmail for emails at all. Underneath, one has nothing to do with the other.
> 1 votes

---
Tags: gmail, google-account
---


# Question
Title: Transfer LINE account from a phone to another without losing friends and chat history
LINE is a messaging/call application.

I bought a new Android phone, and want to transfer LINE friends, chat history, call logs, groups, groups chat history, from my former Android phone.

How to do?

# Answer
> 6 votes
# Official backup / restore solution for Android, introduced by LINE by 2018 for all regions

## Limitations of this method

**Restored:** Chats, Contacts, Media not older than a few weeks

**Not restored:** Sealed letter messages, Group chats, Media older than a few weeks

## Perform on old Phone

1. Make sure you set an Email and Password for your LINE Messenger account
2. In LINE, go to your friends list
3. Open **Cogwheel** (top right)
4. Open **Chats**
5. Open **Back up and restore chat history**
6. If **Google account** has **Not set** written below, click on it
7. Choose your Google account and click **OK**
8. Select **Back up to Google Drive**
9. Make sure the date on **Last backup** is the current day and time

## Perform on new Phone

1. Install LINE Messenger
2. Login with your Email and Password
3. Go to the friends list screen
4. Open **Cogwheel** (top right)
5. Open **Chats & Calls**
6. Open **Back up and restore chat history**
7. If **Google account** has **Not set** written below, click on it
8. Choose your Google account and click **OK**
9. Choose **Restore**

# Answer
> 10 votes
*Warning: LINE only allows one active phone, and will destroy data on the old phone as soon as you log in on the new phone, so be sure to correctly perform this procedure BEFORE logging in on the new phone.*

# Fast procedure (requires rooted phones)

0. If you don't remember your LINE PIN code, now is the last chance to change it, LINE will ask for it after you switch. Even if you never set one, it will ask you so better set it now.
1. Make sure Letter Sealing is disabled in Line settings on your old phone (you can re-enable it after this is complete).
2. Root both of your Android phones, old and new (absolutely required)
3. Install Titanium Backup (free) on both phones.
4. On the old phone, make sure LINE is not running, launch Titanium backup, and backup LINE (App+Data).
5. Copy the Titanium Backup folder (typically `/sdcard/TitaniumBackup/`) from your old phone to your new phone. It should contain 3 files or so.
6. On the new phone, install LINE (don't start it yet), launch Titanium Backup and use it to restore LINE (App+Data). Press "Done", do not start it yet.
7. On the new phone, install Root Browser, and use it to copy `/data/data/jp.naver.line.android/databases/naver_line` to your `/sdcard/`, then transfer it to a desktop computer (via ADB or email)
8. Open this file in SQLiteBrowser, go to the `Execute SQL` tab.
9. Type `delete from setting;` then press the Execute button. Click "Write changes" then exit, and copy the modified file back to `/data/data/jp.naver.line.android/databases/naver_line`
10. Start LINE on the new phone and log in. When Line asks you about restoring the chat history; say no. Even though Line warns you about loosing your chat history, just go head; all of your data will be just like you left it.

This restores your friends, chat history, call logs, groups, groups chat history.

Note about Letter Sealing: if you forgot to disable it in step 1, new incoming messages will show up as an error and you won't be able to send messages. To fix this problem, just:

1. Disable Letter Sealing.
2. Use Root Browser to remove all files that start with "e2ee" in `/data/data/jp.naver.line.android/databases`.
3. Re-enable letter sealing.

*Thanks to TechGravy for the procedure.* *Thanks to YandereSan for the Letter Sealing fix.*

# Slow procedure (no rooting needed)

If you are unlucky enough to have a phone that can't be rooted (the old one or the new one or both), then your only option is this:

* One-by-one for each chat conversation, go to the conversation settings and backup it (`Backup all`) to the SD card (or email if you prefer).
* Move the resulting files to the new phone in a folder called `/sdcard/LINE_Backup`.
* Log into LINE on your new phone. This will destroy all history from your old phone, so only do it when all conversations have been backed up.
* For each of your friends, go to the conversation, chat settings, and tap `Import chat history`, confirm.

In total this will take about 1 minute per friend if you are fast, for instance about 3 hours if you have 200 friends.

Warning: Groups chat history can not be restored by this procedure. This only restores friends, chat history, call logs, groups. Also, it loses any media older than a couple of weeks.

# Answer
> 2 votes
# ROOT 2020-06: Transfer all data locally and allows for 2 phones with the same LINE account

An updated version of @nicolas-raoul 's answer, for when your phone is **ROOT**ed. The following procedure does NOT require uploading your private chats to Google (everything is done locally). Works with Letter Sealing.

**Disclaimer:** These steps worked for me, and I tried to be as detailed as possible. I'm not responsible for any loss of data, or other damages. Try at your own risk.

# Situation my transfer succeeded

* Tested with a transfer from Android 9 (OnePlus 3) to a new Android 10 phone (Samsung S20+) (through a computer)
* Both phones ROOTed (with Magisk) and still working
* LINE Version: 10.9.3 (old phone) - 10.9.3 (new phone) (v9.7.0 gave me a black screen on Android 10 following the instructions below, so I updated to the latest version on the time of writing through the Play Store)
    + Letter Sealing is ON
* Computer to transfer files from and to your old/new phone
* Turned off wifi / mobile internet to not receive new LINE messages during the transfer process.
* **Warning:** Pictures did not show in chat after transfer. Maybe I should have transferred these images first. Or filesystem path changed, hence it cannot find the images?

# Preparation

Locate `settings_ssaid.xml` on your old and new phone. Likely can be found in 1 of these locations (what I did and what the below instructions assume):

* `/data/system/users/0/settings_ssaid.xml`
* `sbin/.magisk/mirror/data/system/users/0/settings_ssaid.xml` Or you can use an app like Android ID Editor to find/edit an app's Android ID (untested)

# Steps on your old phone

1. Make sure your LINE is registered with an Email address and Password that you remember (More -\> Settings (cogwheel right-top) -\> Account)
2. Get Android ID (which is unique per app since Android 8+; Before 8, it's your device's Android ID)
3. With a file browser that has ROOT access (I used Total Commander), access the file `settings_ssaid.xml` (see Preparation step)
4. Search for "line" and you should find something like: `<setting id="xxx" name="yyyyy" value="aaaaaaaaaaaaaaaa" package="jp.naver.line.android" defaultValue="bbbbbbbbbbbbbbbb" defaultSysSet="false" tag="null" />`. Copy+paste this line (or whole file) somewhere outside your phone.
5. Close Line and backup with Titanium Backup. This created 2 .apk.gz and 1 .properties files for me.
6. Use another app to create an .apk of your current LINE version (in case TitaniumBackup cannot restore the app itself, what happened to me)
7. Transfer your LINE app backup (Titanium Backup) to your new phone (e.g. through your computer). Check that the backup files are not 0 Bytes (something went wrong then).

# Steps on your new phone

1. Install Titanium Backup (or other app) and an app that can edit SQLite databases (e.g. SQLite Editor)
2. Copy the Titanium Backup of your LINE app+data to the storage on your new phone (likely 3 files).
3. Check if Titanium Backup shows a "Restore" button (DO NOT OPEN THE APP AFTER INSTALL):

* If yes, tap this (if it's taking 5+ minutes (my case), it's not working. Restart phone and follow "no" steps)
* If no, something might have gone wrong, but you can try these steps:
    1. Install LINE (through the .apk) with e.g. a file browser OR Play Store if you had the newest version (my case)
    2. Start the app once and close it again (this should create an entry for LINE in `settings_ssaid.xml` on your new phone)
    3. Titanium Backup's "Restore" button should have appeared now, tap this and select "Data only"
    4. Do NOT open LINE yet

4. Go to your phone's settings -\> Apps -\> LINE -\> Storage -\> Data should NOT be 0 B (this means Titanium Backup has failed)
5. In relation to `settings_ssaid.xml` (Android 10):
6. Open `settings_ssaid.xml`

* If you can find `jp.naver.line.android`: change the values to of `value` and `defaultValue` to values found on your old phone (`aaaaaaaaaaaaaaaa` and `bbbbbbbbbbbbbbbb`, respectively) \- (untested) If not found: Copy the whole `<setting id ... tag="null" />` and change id to 1 higher than the other apps (e.g. `setting id="27"`)

2. If permissions were changed on save, restore original values (probably did not happen if you used Total Commander)

* File permissions: Owner-only RW; value=600; UID: 1000 system; GID 1000 system

6. Open your SQL editor app, give it root access, and navigate to: `/data/data/jp.naver.line.android/databases/naver_line`. If using SQL Editor:

* Use File explorer (not Apps list)
* If you cannot see `naver_line`, press the 3 dots right-top and uncheck "Show only database files" (it's a database file, but without extension)
* Open `naver_line` -\> setting -\> delete everything with specific phone info (I deleted entries here on a a previous transfer, so I forgot what I deleted, sorry)

7. (untested) Copy LINE images received in chat to new phone.
8. Restart your phone (otherwise Android ID change won't take effect, and LINE will crash)
9. Start LINE:

* If you see your chats, congrats, you now have LINE working on both phones :D
* If you get an error saying LINE detected a new phone, do NOT continue. If you continue, LINE will erase all your messages. Go back to the SQL editor step, and delete more entries that could tell LINE that it's not your old phone.

I figured this stuff out with the help of the following resources:

# Answer
> 2 votes
# Root solution for fresh install and old database

## Example situation

You lost your old phone, the other root solutions do not work here, but luckily you have a backup of `naver_line` database found in `jp.naver.line.android/databases/naver_line` (maybe you have set up Syncthing to always have the latest version)

You have installed NAVER LINE on your new phone, but were not able to set your chat history back at first startup.

## Solution

1. Download "DB Browser for SQLite": https://sqlitebrowser.org/
2. Open the latest naver\_line DB with DB Browser
3. Click "Attach Database" in toolbar and select your old naver\_line
    * When searching for your file, change "Files of type" to "All files (\*)" (naver\_line file has no extension)
4. Write SQL code to merge the 2 databases
5. Copy the merged database to your Android phone
6. Set the UID and GID to LINE
7. Rename the new app's current `naver_line` db and copy your new merged db into e.g. `/data_mirror/data_ce/null/0/jp.naver.line.android/databases`
8. You got your chat history back!

## Limitations

* Not sure how to recover images shared in chat yet.
* Chats that haven't seen a new message since you reinstalled LINE do not show up (but have all your chat history)
    + These do appear if you select the chat from your home screen. The message will be shown as from 1970/1/1 though
* Search for old chat history seems broken :/ Even after you have opened an old chat.

# Answer
> -1 votes
Another "Fast procedure" for un-rooted phones is by using a 3rd party tool called Backuptrans Android Line Transfer. You need to follow these steps:

* Connect both your Android Phones to computer via USB cable. (Make sure USB debugging is enabled on phone)
* Run the Android Line Transfer program on computer. Choose the source device on the program and then click the "Transfer" icon.
* Choose your target device and wait the transferring to be done.

That is it.

---
Tags: data-transfer, line
---


title: Stream audio to Windows 10 through USB

text:
# Question
Title: Stream audio to Windows 10 through USB
I want to listen to the podcasts I have on my Android phone while I'm playing games on my computer and therefore, I want to stream the audio from my phone to my Windows 10 computer.

I'm wondering if it's possible to do that through USB?

# Answer
> 1 votes
While you probably can route audio to USB (I assume if you connect a USB device that identifies it as a USB audio receiver... thingy) your PC is a USB host.

So a better solution would be to get a USB audio adapter like this (may not be necessary if you have a mic in port), connect your headphone into the mic, and get something like VLC to play it.

Windows also allows to "Listen" to an input device which plays it out of your speakers so you don't *need* VLC or a special player. (See image below). Note that this can be annoying if you do video conferencing as you will have to make sure this is disabled when you're on a call.

# Answer
> 0 votes
You can use scrcpy and your Android audio goes through your PC by default.

> This application mirrors Android devices (video and audio) connected via USB or over TCP/IP

---
Tags: usb, audio, windows, streaming
---


# Question
Title: How does the app SD Maid find leftover files from apps that the user has already uninstalled?
I read on https://techcult.com/how-to-delete-uninstalled-app-data-on-android/:

> The “CorpseFinder” option is specifically there on the SD Maid to find any leftover files from apps that the user has already uninstalled. It will search and display all such files. Either user can choose to delete all of the files, or if they feel they need any specific leftover files, they can individually select the leftover files they want to remove. Overall, SD Maid is a great, safe, and effective option to remove leftover files after uninstalling apps on Android operating system mobile devices.

How does the app SD Maid find leftover files from apps that the user has already uninstalled?

# Answer
> 3 votes
* First, this app has two versions - SD Maid (which is quoted in the link, recognizing by app logo since I have both versions on my device) and SD Maid SE. I can't link them (see next bullet). The former is in maintenance mode only and mainly targets older versions, while the SE versions target newer Android versions.
* Second, both versions are currently banned from Play store due to *Stalkerware policy* (IMO blatantly unfair when the developer has to justify in limited text to a *bot*, without any human interaction)
* Third, the SE version is **open sourced** (unlike the earlier version) . Quoting from Corpse finder section of the Github, depending on the *filter* you applied (important), it looks for the following places to clear corpse data:

> Sdcard

> Public media

> Public app data

> OBB resources

> Private app data

> Dalvik cache

> App libraries

> App sources

> Private app sources

> Encrypted app resources

Somebody who understands code can interpret better from the Github code or check in Discord channel

**PS**: If you decide to sideload either version of the apps make sure that you disable Google play protect, else it is possible that it may silently uninstall as per policy

> It may deactivate or remove harmful apps from your device.

> It may reset app permissions to protect your privacy on certain Android versions

This is applicable as long as the ban (second bullet) continues

---
Tags: applications, uninstallation, cleanup
---


# Question
Title: What is significance of country listed in "about phone"?
I have just bought a surprisingly-cheap refurbished Samsung S10+ to (eventually) replace my elderly S7.

I have not yet tried to connect it to my Samsung/Google accounts.

The S10+ is running Android 12. `Settings > About phone` shows:

```
Phone number                   unknown
Model name                 Galaxy S10+
Model number               SM-G975F/DS
Serial number                      ...
IMEI (slot 1)                      ...
IMEI (slot 2)                      ...
United Arab Emirates       TRA ID: ...
                               TA: ...

```

The S7 has Android 8 and does not show a country on this setting page.

What is the significance of the country? How does it affect operation of the phone?

I am in UK. Should I be trying to change the display to say UK? Perhaps flash a local firmware?

I can provide information from `Software information`, etc, if any of that will be relevant.

# Answer
Yes, you should change the country.

Country mainly affects the choice of apps that you can install from Google Play, as also other apps on Play store (some developers limit the app availability in different countries for a bunch of reasons. See answer here

Make sure you factory-reset your phone, flash the firmware of your country and register with Google account showing your country (your Google account created in UK), else you will have to undergo the lengthy official process How to change your Google Play country.

There are a bunch of questions on this site as to how to spoof the country but if you are planning to use the phone in UK only, it's best to do it for once as above.

Related: Why are there different versions of each firmware for different country?
> 3 votes

---
Tags: samsung, android-12, localization
---


# Question
Title: Can I use a US SIM card on my xiaomi Note 8?
I am trying to use my Verizon SIM card as well as a SIM card from airvoice wireless on my xiaomi Note 8. It says that it's reading the cards but I don't know how to enable them if I can.. Please help?!

# Answer
Try and see.

To control the sims

* Settings
* Connections
* Sim Manager

You can enbale / disable them here.
> 1 votes

---
Tags: sms, xiaomi, mobile-network, dual-sim, cellular-radio
---


# Question
Title: adb fails to authenticate but still connects
I'm connecting to a phone on OpenSTF via `adb`. Running

```
$ adb connect <url>:<port_no>

```

produces the message

```
failed to authenticate to <url>:<port_no>

```

However, `adb devices` shows the device and I can interact as expected with the phone. What does the authentication failure mean and should it concern me?

# Answer
If you're connected to the phone via USB, you may need to run

```
$ adb tcpip 5555

```

See https://developer.android.com/studio/command-line/adb#wireless
> 0 votes

# Answer
Looks like sometimes the `adb` tooling changes.

I doubt you have had an old `adb` running in background that was still connected but try `adb kill-server`.

A new connect failed but an old connection is still open.

As for me, the pubkey has to be renewed on STF sometimes so remove it from OpenSTF and add your `adb` pub key (`~/.android/adbkey.pub`) again (even or especially when it tells you the key already is registered!).
> 0 votes

---
Tags: adb
---


# Question
Title: New Device: Support Duration from Switch-on
Having purchased a new Galaxy Tab s8 just recently, the question of would the 2027 software update curfew still hold, or will the clock for support start ticking once it is turned on, connected to the internet (and optionally registered)?

Experience with the older Galaxy Tab A S10.1 (2016) purchased in 2017 was positive, a generous 5 years, with the last update in early 2022. Because it had only occasional usage, functionality is not impaired in any way, and looks as if it could see out a couple more years at the very least.

Given that four years is the current figure for lifetime support, would switching on the new device then take it on to September 2027?

# Answer
When you switched it on is immaterial, the clock started when the device appeared in the market. If you purchase a device towards the end of it's support period, updates stop when the support period is over. Samsung Security Updates clearly says

> And select devices launched in 2019 or later will be supported with firmware security updates for a minimum of four (4) years following their **global launch**...

(Emphasis added)

From a quick search your device was released in February 22. Your support period started from that date. In other words you have about two & half years of support left.

---

General Information that may be of use

See Check this new tracker to see if your phone will get the next Android update and the Android Update Tracker.
> 5 votes

---
Tags: samsung, updates
---


title: Pixel 7 lock screen timer

text:
# Question
Title: Pixel 7 lock screen timer
I would like to have the lock screen on a Google Pixel 7 to display for a specific time before powering off the screen.

This should not be confused with the screen timeout (normal screen \> lock screen). This question is about the specific timer that powers-off the screen once the lock screen is showing (lock screen \> no power consumption by the screen).

There is a setting "Always show time and info", which is the opposite of what I want to do (battery waster, not battery saver), so that's "off", of course.

What I would expect is two timers. One for (normal screen \> lock screen), which I was able to find, and one for (lock screen \> no power consumption by the screen).

Note that apps that simply place a black background on the screen aren't turning the power off to the screen, so that's not a solution.

Where can I change (limit) the amount of time that the lock screen is consuming power?

# Answer
> 1 votes
If the "Always show time and info" is OFF, then after the phone is locked, the lock screen is only consuming power for a few seconds. This duration is not customizable.

---
Tags: lock-screens, battery-life, google-pixel
---


# Question
Title: Chrome for Android: How to see network console information?
Is there any way to see networking information on mobile Chrome, ala the networking tab on fully fledged desktop Chrome, on the device itself? I'm attempting to try some remote debugging for a user but I can't really ask them to install the required software to test on a desktop. I need to see if any scripts / etc are failing to load.

Am I out of luck?

# Answer
I have written an Xposed module that allows a user to use Developer tools on Chrome for Android. See my Xposed module ChromeXt.

Here are some screenshots of the Network tab:

1. Using the eruda console
2. Using the DevTools
> 0 votes

---
Tags: chrome-for-android
---


# Question
Title: How to display JavaScript console on Chrome (or a different browser)?
I want to quickly try some JavaScript code on an Android phone.

I cannot find how to open the console or something similar on either Chrome or the default browser. `about:debug` doesn't do anything, and I don't want "remote debugging".

I can download another app if necessary (but I don't want to root my device).

# Answer
> 0 votes
That feature seems to be unavailable for all major Android browsers.

You could try Opera Mini instead:

1. Reset the console output by opening a new tab with the address `debug:resetconsole`
2. Open a tab on the page on which you want to do the inspection:
3. Run JavaScript code on the page by replacing the address in the address bar with the following address `javascript:var%20n%3Ddocument.firstChild%3Bwhile%28n%20%26%26%20n.nodeType%21%3DNode.ELEMENT_NODE%29%20n%3Dn.nextSibling%3Bconsole.log%28n.outerHTML%29%3B`
4. Retrieve the output by opening a new tab with the address `debug:console`

# Answer
> 0 votes
You can use Kiwi Browser. It is the only one that has debug mode built in, plus extension support on mobile.

# Answer
> 0 votes
If you are willing to root the device (Alternatively, you can try the non-root solution LSPatch) and install an Xposed Framework, then you can use my Xposed module ChromeXt. It supports showing the console with Eruda Console and with DevTools. See screenshots of both of them respectively:

---
Tags: browser, chrome-for-android, javascript
---


# Question
Title: App flickers and won't start on Pixel Fold foldable screen
On my new Pixel Fold, the Mixcloud app won't start and just flickers (in a way that could induce an epileptic fit in a person with epilepsy) when I try to open it on the foldable screen. It works fine on the outside screen, which is a more normal phone size.

What can I do?

# Answer
> 1 votes
Rotating the screen fixed the problem.

However, the app still has the same problem if I try to use it in Split Screen mode. So I guess I can't use it in Split Screen mode.

---
Tags: applications, google-pixel
---


# Question
Title: How to manage Android Chrome new tab shortcuts?
I'm using Chrome on my Android tablet. The new tab page contains 8 shortcuts (pretty much as in Chrome for Windows). In Windows however, I can configure the shortcuts: one of the 10 positions is reserved for "Add shortcut" action, so if I would like to replace a shortcut, I would add a new link and delete the old one. Additionally, I could rearrange the existing icons using a mouse. I cannot figure out how to configure these shortcuts in Android.

The first 8 shortcuts were added automatically using the first sites visited. I would say that Chrome eventually (very rarely) replaces shortcuts based on its internal algorithm, but recently I decided to remove several shortcuts and replace them with specific links. Here is the problem: while I deleted undesired links, I cannot select what would be used instead. What is even worse: instead of direct links to other sites Chrome uses links to google.com with recent (and not very recent) search queries. I'm deleting these links, but Chrome adds more junk with links to other Google queries. The algorithm is unusually stupid, as it prefers queries that I made once to the sites I'm visiting on an everyday basis.

The context menu offers only "Open in new tab in group", "Open in incognito tab", " Download link", and "Remove" options. How can I configure the links on the new tab page?

**Update:** the answer here calls these thumbnails "Most Visited", but as I clearly show in my question, the links Chrome uses to replace the deleted thumbnails are definitely not "most visited", but visited only once. What's wrong with my Chrome?

# Answer
Your main concern has been raised in Google community *four years* ago but with no answers and the question is locked Chrome-On-Android: Possible To Manually Add Shortcuts On New-Tab Page?

As mentioned in the comments, it is possible to add shortcuts on a rooted device. Also the algorithm is not transparent and apparently buggy, so that's the way it is implemented and nothing wrong with your Chrome.

However, a part answer relating to search queries:

> What is even worse: instead of direct links to other sites Chrome uses links to google.com with recent (and not very recent) **search queries**. I'm deleting these links, but Chrome adds more junk with links to other Google queries

To *avoid* search queries showing up in home page use this flag (copy-paste) `chrome://flags/#organic-repeatable-queries`

You will get options like this:

Choose *disabled* and you won't have search queries showing up as home page shortcuts (On the contrary, if you want them, choose other options available).

**Source:** This answer from Google support.

Since flags are often modified/disappear with various Chrome versions, this is tested on `Chrome 116.0.5845.163` (latest on Play Store for me).
> 2 votes

---
Tags: chrome-for-android
---


# Question
Title: Connect Samsung tablet to ethernet and also to PC/laptop?
I have a Samsung Galaxy Tab Active Pro (SM-T545) tablet. I'd like to connect it to the ethernet using an adapter having an RJ45 port. I would also like to connect the tablet to my laptop (in this case MacBook Air) so that I can access the logs.

I tried using the Type-C Hub (from UGREEN) that has an RJ45 port and the tablet connected to the ethernet successfully. However, when I try to connect my laptop using a Type-C to Type-C cable and later Type-A (from hub) to Type-C (to laptop), nothing happens on the tablet and laptop.

Is there any way I can connect the tablet to ethernet for the internet and also to my laptop to get the logs?

Note: The wireless option is not possible as the connection is very unstable.

# Answer
To talk to the Ethernet adapter, the Android device has to switch its USB chip to host mode (USB OTG). The Android device becomes the USB master managing the USB bus, and the Ethernet adapter will work as a USB slave (usually USB Ethernet adapters can only work as a USB slave).

The USB chip in the PC is always acting in USB host mode (as USB master). If you are connecting two USB chips both in host mode, it will not work, as in USB, there can be only one host (master) and multiple clients (slaves).

The only way I see to get a wired network connection and connect the Android device to your PC at the same time would be to use reverse tethering via adb.
> 1 votes

---
Tags: adb, samsung, usb, ethernet
---


# Question
Title: Why do my wifi networks vanish until I turn airplane mode off and on?
Over the last few weeks, my Samsung Galaxy S20 FE 5G (Android version 13) seems to lose all wifi networks. Going to Wifi settings shows no networks connected or listed at all.

Every other device in the room can see my networks and others. There are no errors reported, and it's not hanging forever. I get a busy indicator for a few seconds, and then it turns off as if the wifi check just didn't return anything.

If I turn on airplane mode, wait a few seconds, and then turn it off again, it can suddenly see all the networks and connects successfully. Then sometime later (I don't know how long but hours, not days), I notice that the phone is using 5G again. If I go back to the Wifi settings, no networks are listed. This happens a few times a day.

I've tried restarting it a number of times and making sure the OS is updated. My wife and son each have an identical S20 and they are not seeing this.

Is this a known problem? Is there a remedy short of a factory reset?

# Answer
> 0 votes
I think there are a few things to try.

1. Click on the gear of the connected wifi and flick the `auto connect` switch to on.
2. There could be an app doing it. Look at the permissions of your apps and remove location permission to drill down to the culprit.
3. There could be a hardware fault.

---
Tags: samsung, wi-fi, samsung-galaxy-s-20
---


# Question
Title: Can I block calls based on a specific number prefix or pattern?
Is it possible to block calls starting with a specific number? For instance, I want to block calls from numbers starting with 1408 as they are all spam calls. The digits following these four, keep changing.

# Answer
If you're looking for a free *and* ad-free/in-app-purchase-free app, you can use the open-source NoPhoneSpam, which is available on F-Droid (though not Google Play). It supports blocking calls from individual numbers and from numbers that match a pattern with wildcards.

This is especially useful for blocking "prefix spoofing" calls, that appear to start with the area code and exchange (next 3 digits) of your phone number, but really are from random law-breaking telemarketer bots.
> 33 votes

# Answer
TrueCaller also allows this. Steps to take on an Android phone:

1. Open TrueCaller
2. Settings
3. Block
4. View my block list
5. Press the plus button in bottom-right
6. Block a number series
7. Enter the first six of your number
> 6 votes

# Answer
I only found ONE call blocker that is capable to block patterns (which is important for me). It is embware Call Blocker, it can block or enable numbers with Match criteria: starts with, ends with, or include specific numbers.
> 4 votes

# Answer
1. install F-Droid (FOSS/Open Source store) https://f-droid.org/docs/Get\_F-Droid/
2. install NoPhoneSpam by searching from F-Droid
3. add rules from within the app to block the blocs needed in your country, for France:

* France: : `0162, 0163, 0270, 0271, 0377, 0378, 0424, 0425, 0568, 0569, 0948, 0949`
* Guadeloupe, Saint-Martin et Saint-Barthélemy : `09475`
* Guyane : `09476`
* Martinique : `09477`
* La Réunion and Mayotte : `09478` and `09479`
> 2 votes

---
Tags: call-screening
---


# Question
Title: How to permanently disable the annoying "RCS chats" popup in Messages app
I have a Pixel 3. I try to avoid using SMS and instead use Signal whenever possible. When I do use SMS (the Messages app), I don't want "RCS chats" to be enabled. But nearly every time I open the Messages app, I'm prompted with a popup where the "Agree" button is very prominent.

I do not want to agree to use RCS chats. I want my choice (when I click "Use Messages without RCS chats") to be permanent.

How can I fix this?

# Answer
There is a *two year old* Google community question about this, which Google as usual chose not to respond to, and just locked up the question.

On my Pixel 6a, I had enabled RCS previously. After seeing this question, I disabled RCS and opened messages app many times over two days. I did not get the enable RCS popup again

Enabling RCS by tapping agree and then from settings disabling RCS is a hack that worked for me. I am not sure if this behavior is OS version dependent or the logic behind this ( I guess it's some kind of promo popup to encourage RCS usage).

This may or not work for OP but making it into an answer that may help somebody.
> 3 votes

---
Tags: sms, google-messages, rich-communication-services
---


# Question
Title: Disable Bixby on Galaxy S9 without root?
I have read this question and realised that it is outdated.

With the most recent android update for my Galaxy S9, I have no way to disable the Bixby button out of the box. Previously I had to sign in to Bixby, Then go to setting and disable the button there. Afterwards I could remove the samsung account and had no issues at all.

**How can I get rid of Bixby/disable the bixby button without rooting the device?**

---

Software update: G960FXXU2CSB9/G960FOXM2CSB3/G960FXXU2CSB3

Android version: 9

Security Patch: 2019-02-01

Bixby Home Version 3.0.02.6

Bixby Voice Version 2.1.04.18

# Answer
You can disable the Bixby button by using Bixbi Button Remapper - bxActions. This allows you to remap the button to another action.

As for disabling Bixby altogether, I am unsure of how to do it.

Another mention was enabling developer options, then scrolling to the bottom of that menu to Background Check, then disabling the options for Bixby in there. I did try this, but it did not disable the Bixby Button, nor am I sure it actually did anything with Voice.

You can still remove Bixby Home by holding on the main screen then navigating over and disabling Home.
> 1 votes

# Answer
I have just jumped straight from Android 8 on an S7 to Android 12 on an S10+, so I don't know if this works on any other version than 12:

1. Go to: Settings \> Apps \> Bixby Voice
2. Select "Disable"

After this, the button appears to do nothing.

---

Similarly, disabling the "Google" app appears to prevent that popping up after a long-press on the home "button".
> 0 votes

---
Tags: 9.0-pie, samsung-galaxy-s-9, samsung-bixby
---


# Question
Title: Notifications are removed regularly and energy saving mode activated spontaneously
I have a Samsung Galaxy A51 phone, 2 or 3 years old. Since some time, out of nothing (like just after using the phone for some time, when getting out of screen lock), I see notifications (like WhatsApp, mail, etc.) icons on the main page.

However, before I have the chance to look at them/click them, the phone gets into energy (battery) savings mode spontaneously and all notifications are gone (when disabling energy savings mode manually). So, I have to find in all applications what 'news' there is.

Is there a solution to get rid of this spontaneous saving mode activations? (without disabling it when I want to do it manually to save battery power) ?

# Answer
You should be able to **turn off Adaptive Battery Saving** if you go to **Device Care**, tap the **three-dot button**, and then tap **Automation**. So now your phone won't turn on the Battery Saver by itself.

Sample Images Attached
> 1 votes

---
Tags: samsung, notifications, battery-saver
---


# Question
Title: Unbricking Vivo Y97 after flashing wrong recovery.img
It all started when I flashed the wrong `recovery.img` on my device. I have two Vivo Y97s with the exact model, version, and specs. I didn't realize that I need to port TWRP first on my `recovery.img` before I can flash it using fastboot. After I flashed the wrong `recovery.img`, my device suddenly wouldn't turn on, couldn't boot up, and couldn't even enter recovery mode. BTW, they are both bootloader unlocked and the other one is already rooted.

Let's say A is the bricked phone and B is working fine. Can I use the backup ROM of B and restore it to A? I'm not gonna use stock ROM.

# Answer
# SOLVED!

After flashing the ROM of B into A, the phone is unbricked now and it's working perfectly fine.

I've flashed the **system.img** (*this contains the library of Android system*) and also **vendor.img** (*this contains the drivers of all the hardware for the device, like GPU, camera, touchscreen, microphone, audio, and sensors that the apps use*).

Then I reformat the **recovery.img** partition inside the bricked phone since it was the reason why it was bricked.

I've also reformated the **userdata.img** (*as the name says, it has all the user data like contacts, installed apps, screenlock, photos, videos, and other files*) which basically the same as reset factory in settings
> 2 votes

---
Tags: recovery-mode, custom-roms, unbricking, vivo
---


# Question
Title: How to browse Play Pass catalogue in Google Play app
What are the exact steps that I need to undertake in order to see *that famous* "Google Play Pass Catalogue"?

I wanted to see how many games of my interest are currently included.

I went to Google Play app → tap my avatar → Play Pass → *How can I browse the catalogue as a subscriber?*

And (emphasis mine):

> Check out **the Play Pass tab** in the Play Store app or look for games and apps marked with a Play Pass badge throughout the Store.

Since I already was inside Google Play app I pressed *Back* once to get back to the main screen and I saw the following tabs:

* For you
* Top charts
* Children
* Premium
* Categories

Categories includes:

* Action
* Adventure
* Arcade
* Board
* Card
* Casino
* Casual
* Educational
* Music
* Puzzle
* Racing
* Role Playing
* Simulation
* Sports
* Strategy
* Trivia and
* Word.

The same can be selected as a *Categories* filter in *Top charts* tab.

Either I am totally blind or **I see absolutely no traces or tab, category or anything related to *Play Pass***. What am I missing?

Due to my recent problems with Play Points Google Play app on my phone had both cache and main memory cleared and it was restarted many times. No effect.

# Answer
The Play Store app seems to have been improved recently.

If you are subscribed to Play Pass, you should see a "Play Pass" tab at the bottom, with links to all app and game categories (a bit hidden).

Alternatively, you may use App Finder. It has a filter for the Play Pass, and you can browse a list of nearly/all 1272 Play Pass apps and games with screenshots, short descriptions, and all important data.

You can filter by category, user rating, number of ratings etc.

App Finder is free and without ads, and you don't need to have the Play Pass already.

Here lists of all Play Pass apps (not games) by category.
> 1 votes

---
Tags: google-play-store
---


# Question
Title: Unidentified app using excessive battery
I have a battery drain issue with a stock Nexus-7 (2013), Android 6.0.1, up to date with monthly patches. The battery is losing 15-20% overnight. Turning WiFi off overnight doesn't reduce it, or not much. The top consumer is just called "10017".

Some background - A recent version of Sygic Navigation was showing high battery usage even when I didn't use the app. I couldn't keep it from running. After exiting it, or after force-stopping it, I would shortly find it running again. I deleted the app but kept its user folder. Maybe related?

I keep Google Account Manager and Google Play Store disabled when I'm not actively using them. This is not new; I've done it since shortly after the tablet was new.

I installed the August patches a few days ago; the tablet was rebooted by that process. The battery issue predates that update.

**How can I find out what it (10017) is?**

# Answer
> 2 votes
Try going to `Settings > Storage & USB > Explore` to see if you can find/delete anything left by Sygic Navigation.

You can also try rebooting the tablet into safe mode by pressing and holding the power button until the dialog box with Power off appears. Then, press and hold the on-screen "Power off" button until it prompts you about rebooting into Safe mode. See if your battery is okay in safe mode (test it for about a day). Note that in safe mode, you can only use the core apps that the tablet came with and no third party apps. To exit safe mode, just turn off and turn back on the tablet.

Hope this helps.

# Answer
> 1 votes
Try dialing `*#*#4636#*#*`, it should give usage statistics that can be sorted by usage time, last time used, and app name. You will get an output as shown:

Sort by *App name*. If it shows Sygic or any other app which shows abnormal usage, then possibly the UID belongs to that app. Next steps:

* Uninstall that app and see if the situation improves
* Determining PID/UID if the above didn't help (assuming PID is the number 10017) - is easy if your device is rooted as described on How can I find app name by UID?. Even if your device is not rooted, see Firelord's solution which works for non-rooted devices

That should help you nail the culprit.

# Answer
> 1 votes
Backing out recently installed apps, "10017" went away when I un-installed Talkatone. I repeated the install and un-install with the same result (other than the "battery-burner" having a different numeric ID).

# Answer
> 1 votes
This is a little tricky and yet simple

1. Any apps you just uninstalled will list up with UID as your phone doesn't save anything from the app once you use a cleaner app to clean up files after the uninstallation process.
2. If you still doubt it, go to Safe mode, dial up `*#*#4636#*#*`, and sort by time. This will give you a vague idea of which app it is exactly. If you still can't find out, look for a similar number as that is different based on the device. If you find something unusual like installed on Jan 1, 1970, then that's part of your phone OS. Don't tamper with it anymore. Keep calm and understand that your battery life is reducing as the device is old now like 3+ years.

---
Tags: battery-life, nexus-7
---


# Question
Title: Pixel randomly turn on flashlight, shows emergency call screen
This is a very poorly-defined question, because I can't figure out what causes this issue. But on occasion (and not rarely), when I pull my phone out of my pocket, the flashlight is on, bluetooth has been turned off, and when I unlock the phone I am looking at the emergency call screen. I believe that the DND and bedroom settings get modified sometimes as well.

I haven't been able to find anything like this on the web. Any ideas? (Pixel 6, Android 13)

# Answer
> 2 votes
**Solution:** In the lock screen settings disable both Tap to Wake and Lift to Wake

**Source:** Pixel 6 Dialing Contacts Or Opening Random Apps When In Pocket \[Fixed\]

> Numerous users have voiced their concern that whenever their Pixel 6 is kept in their pocket, it tends to open any random app, dial a phone call to any random person, enable DND Mode, turn on Airplane Mode, send a message via WhatsApp, etc

OP has confirmed the solution to work on their phone

---
Tags: bugs, google-pixel-6
---


# Question
Title: Convince android to use AAAA records when VPN has IPv6 but main connectivity doesn't
I have a VPN (WireGuard right now, but the same behaviour manifested with OpenVPN) that provides me with an IPv6 address. I can confirm that it is working because pings (both from the android terminal with `ping6` and to the android terminal from the other side of the VPN) work. This also confirms that the VPN is establishing the DNS server properly, as I am using an internal domain while pinging from Android.

However, the browser (both Chrome and Firefox) only work properly when the main connectivity has also IPv6 enabled. That means that if I am connected to a WiFi that provides IPv6 connectivity, then the VPN works properly. But if I am using mobile data (my ISP doesn't provide IPv6) or I am using a IPv6-less WiFi, then the browser doesn't work for IPv6-only URLs. The android terminal `ping6` command keeps working in all scenarios, meaning that the VPN is properly connected and working, but it's as if the browser/android machinery refuses to use AAAA records and the browser gives me an error.

Is that a known issue? I am using Android 11. Can I change something or force Android to believe that there is an IPv6 connection established? Is the browser's fault? Is the DNS resolver fault?

Edit: Forgot to mention: if I manually enter the IPv6 into the browser, it loads the web properly. So it seems that there is a DNS issue there, but the DNS is properly set up. So I assume that Android (or both browsers) are misjudging when to use AAAA records, hence the title of this question.

# Answer
Configure your VPN to route the entire IPv6 address space. The requirement is that you need a default route for IPv6 for chrome to consider AAAA.

I was having the exactly same problem on android 12 and my VPN was configured to only route a ULA /56. Setting a default route through the VPN should cause chrome to start resolving domains with AAAA.

The caveat is of course all IPv6 traffic now goes through the VPN even when your WiFi/Cellular has native IPv6. I guess I just have to prepare two profiles now.
> 1 votes

---
Tags: vpn, dns, ipv6
---


# Question
Title: What are the restrictions for spending Play Points?
Does anyone know why spending Play Points is impossible in Poland:

That was the only reasonable reward I could imagine, but it turned out that I hit the closed door with "Unavailable" label on it. Anyone has any idea how I can open *these* door?

# Answer
This was either a bug:

* In Google Play app in general
* In Google Play service's configuration for my country
* Somewhere in between my account and Google Play service (some glitch)

After filling a two separate Google Play Points Support's reports, of which none has been answered so far (except for repeated information that a problem has been reported to Google Play technician) the whole thing suddenly "un-choked" itself.

Without any change on my side and without any actual information from Google, starting last Saturday I am able to use my Google Points as expected.
> 1 votes

---
Tags: google-play-store, google
---


# Question
Title: How to reinstall an uninstalled system app through ADB?
My phone is an unrooted Samsung Galaxy S7 Edge running Oreo 8.0. Yesterday when removing bloatware from my phone, I accidentally uninstalled a system app using the adb command:

```
pm uninstall -k --user 0

```

I suspect the culprit to be `com.sec.factory.camera`, as since that unfortunate event, the camera app crashes every time I try to launch it.

I tried reinstalling it using either of these two commands

```
pm install com.sec.factory.camera
pm install --user 0 com.sec.factory.camera

```

but they returned a "can't open non-file" error message.

I tried as well downloading the APK on my phone and installing it from Android, but at the end of the installation process, I got a "not installed application" message.

How to reinstall an uninstalled system app through ADB?

# Answer
Technically, the command `adb shell pm uninstall -k --user 0 <package_name>` does not uninstall an app from the device. Instead, it just removes it from a user.

There are a couple of ways to get the removed app back to the user: one way is through an ADB shell with the command:

```
adb shell cmd package install-existing <package_name>

```

Or an extreme way would be through a factory reset of the device.
> 26 votes

# Answer
I uninstalled the package `com.google.android.partnersetup` when I was going to uninstall other app. I couldn't recover it with Bo Lawson's method. Instead, I found this way:

```
pm dump com.google.android.partnersetup | grep Path

```

This gives us some paths. One of them is the one I'm going to use:
*"**codePath=**/system/priv-app/GooglePartnerSetup"*

Finally, I install the app which is in that direction. The app has the same name of the app folder, with ".apk" at the end:

```
pm install -r --user 0 /system/priv-app/GooglePartnerSetup/GooglePartnerSetup.apk

```

I hope this helps, but I don't know what exactly does this do.

My source: comment from Mac23.
> 3 votes

# Answer
For those circumstances when `install-existing` solution is unavailable the dandan657's method works. But I've found an easier way to look for the location of the existing APK. In ADB shell type:

```
pm list packages -f -u | grep <package name>

```

You will get the result in this format:

```
package:<full path to the apk>=<package name>

```

Example:

```
package:/system/app/Photos/Photos.apk=com.google.android.apps.photos

```

These are the useful optional parameters that `pm list packages` command accepts:

```
-f: See their associated file.
-d: Filter to only show disabled packages.
-e: Filter to only show enabled packages.
-s: Filter to only show system packages.
-3: Filter to only show third party packages.
-i: See the installer for the packages.
-u: Also include uninstalled packages.
--user <USER_ID>: The user space to query.

```

**Tip**: Using the above it might be a good idea to have variously filtered package lists saved for the future reference.

Reference: https://android-doc.github.io/tools/help/shell.html#pm
> 3 votes

# Answer
My way

1. Install Solid Explorer
2. Open Settings
3. Enable Root Storage
4. Back to main
5. Open hamburger menu
6. Select root
7. Go to system
8. Go to app
9. Search your app
10. Install it
> 2 votes

# Answer
I had the same problem with my Android 6 phone. On Android 6, the `adb shell cmd ...` commands are not available.

I fixed it the following way (needs root or custom recovery with full file system access):

1. Locate the APK file of the deleted package in the `/system/priv-app` folder
2. Move the APK file to a different location (e.g. `/data/app`)
3. Reboot phone
4. Move the APK file back to its original location
5. Reboot phone

I hope this can help others who also don't have Android 7 or newer.
> 1 votes

# Answer
Bo Lawson's answer has worked perfectly and is the best answer for those without root access, this is what I did:

Install the app again by:

```
adb shell cmd package install-existing <package-name>

```

Then uninstall it by:

```
adb shell pm uninstall <package-name>

```

Then install the app or its update from Google Play or from your browser.
> 1 votes

# Answer
I accidentally uninstalled the default file manager and then was unable to set shared dirs for new apps and other essential functions.

Once I found out the package name included `documentsui`, searching for that in App Manager (free, available on F-Droid) allowed me to just click a greyed-out listing, where it then asked me whether I wanted to reinstall it. Full functionality restored.

Hope that helps someone.
> 0 votes

---
Tags: adb, installation, uninstallation, system-apps
---


# Question
Title: A universal way of changing the PIN code on a mobile SIM card
Is there a universal way to change the PIN code on a SIM card for a mobile/cell phone?

Will it work on both my phone's two SIM cards, SIM1 and SIM2?

# Answer
> 4 votes
> Is there a universal way to change the pin code on a SIM-card for a mobile/cell phone?

Enter `* * 04 * oldPIN * newPIN * newPIN #` in the usual way that you dial a phone number (i.e. through the "Phone" app if it's on Android). This is defined by ETSI GSM 02.30.

> Will it work on both my phone's two SIM-cards, SIM1 and SIM2?

Dual-SIM phones were outside the scope of the standard, so it depends on the way each manufacturer implements its SIM selection UI.

---
Tags: sim-card, dual-sim, sim-pin
---


# Question
Title: Why do I need to turn on location services to pair with a Bluetooth device?
Whenever I try to connect my Samsung Galaxy S6 with Android 6.0.1 to a Bluetooth enabled device, it tells me to enable "location services".

When I complained about this, the software vendor replied: "Recent updates to the Google Android API affecting Bluetooth LE technology requires location permissions to be granted in order to use the app."

I fail to see the need for this.

This discussion talks about this. The technical reference says the apps need to have certain *permissions*, not that location services be active.

> To access the hardware identifiers of nearby external devices via Bluetooth and Wi-Fi scans, your app must now have the ACCESS\_FINE\_LOCATION or ACCESS\_COARSE\_LOCATION permissions

**Question**: Does this mean the software vendor's statement is incorrect?

# Answer
My understanding of Bluetooth is that applications using Bluetooth have direct access to the device MAC address for the purpose of pairing. I will assume this for this answer.

If you can read MAC addresses of WiFi or Bluetooth transmitters, you can locate a device. This is how WiFi/Bluetooth location works; you listen for MAC addresses of transmitters and look these up in a giant global database.

Therefore, any application using Bluetooth and a data connection is theoretically capable of locating your device. I am not sure this is practically possible; Bluetooth does not have the same range and semi-permanent access point infrastructure as WiFi.

By requiring location services to access Bluetooth, you ensure that the user understands their location information may leak when they use Bluetooth. In versions of Android prior to Marshmallow, the user could use Bluetooth without location services enabled, but location information could leak. In these older versions, you could also run WiFi scans to find MAC addresses without location services enabled, which again meant that your location information could leak. The requirement to allow location services to use Bluetooth is about ensuring that someone who disables location keeps their location private.

I would characterize this issue as a design problem and not a bug. A bug is presumably fixable, but it's not clear to me you can use Bluetooth at all without potentially leaking location information. Bluetooth was created before anyone considered WiFi and Bluetooth location services.
> 12 votes

# Answer
The vendor is correct, you need to enable location services to scan for WiFi or Bluetooth LE devices.

See bug #185370 for details. Google said they have fixed it in a 'future release' but according to comments on the bug, it's still not fixed in Android 7.

---

Edit: I previously said location services are only required when the App starting the scan is running in the background. The source code indicates this is only true if the API-Target is \< Android M.
> 4 votes

# Answer
The OP asked about Pairing (the original, privacy-safe Bluetooth method to define a new, trusted relationship by confirming a code sent from the other device). For pairing, an app DOES NOT need:

1. Scan for a MAC address
2. "Location Services"
3. `ACCESS_FINE_LOCATION` or `ACCESS_COARSE_LOCATION` permissions (not 100% sure on this)

I believe the Bug #185370 is unrelated. There is no bug; there are dishonest vendors.

A MAC address has a manufacturer ID and device ID, and usually a model number. Android 6.0 castrated a feature which previously allowed a manufacturer's app to scan for MAC addresses to link to their own products, to save you the trouble of Pairing and other fun things.

However, many apps abused it to find all WiFi & Bluetooth products in your home, what car you drive, your data providers, etc, and figure out out where you work, what your friends have or who they are, how often you visit, which stores you go to, etc. (think marketing, election meddling and "free" games from other countries).

From Google:

> To provide users with greater data protection, starting in this release, Android removes programmatic access to the device’s local hardware identifier for apps using the Wi-Fi and Bluetooth APIs. The `WifiInfo.getMacAddress()` and the `BluetoothAdapter.getAddress()` methods now return a constant value of 02:00:00:00:00:00.

Again, Location services are not needed for "Pairing". This is from my new Bluetooth "BlueDriver" ODBII vehicle code scanner (i.e., check engine light):

> Location Services
>
> BlueDriver can use the Bluetooth Location service to scan for nearby BlueDriver sensors. Instead, if you wish, you can pair a sensor in the Bluetooth settings of your phone.

(At first glance of their Privacy Statement I freaked: they will upload to their servers, the VIN (includes mfr, model, ID, etc.) of every car I service, plus all of the car's data with driving habits, etc.; I can't opt out of ADS pouring into my email. Then I read it to the end. I found they have very strict policies about keeping it private and NOT sharing it. Very unusual!)

Location Services can be legitimate. The Fitbit app doesn't need it to connect to my Fitbit, but it may help them gather all the data they want from me. And believe me, it's plenty more than they need to check my heart rate and count my steps, and the mapping is optional.
> 3 votes

# Answer
I will need to add my two cents to this -- being an app developer who needs to scan for Bluetooth LE health devices. I also need to do this in the background so the app can re-connect to the device without the user having to engage with the app.

The fact that Android requires FINE location and background permissions to do this on the latest version has proven to be a great headache. The idiots reject my app because of this, yet the app does not need location info or care about location. The app also filters the scans to assure it only exposes health devices that it can support (there are a lot of proprietary devices out there).

I can background discover SPP and HDP (pre-10 Android killed HDP in version 10) without these permissions. Working with Bluetooth is hard enough for many people, especially the elderly who are not particularly tech savvy. Android is making using their platform more and more impossible to use in remote patient monitoring situations.

So my answer to the original question. The app developer is not 'lying'. Android forced this!
> 3 votes

# Answer
For making a Bluetooth connection, the dependency on location can be related as below -

**If an App can scans for known Bluetooth beacons, then it can also figure out the location from the available beacon. So if an app gets access to use Bluetooth in your phone, it is likely that it can also retrieve your location. So it makes sense that an app asks for location access when it try to scans for Bluetooth devices.**

So the dependency on location for Bluetooth is added in Android 6 (Marshmallow) onwards. Moreover in recent Android version (10 onwards) they have further restricted the use of location based on whether you are using the app (foreground access) or your app is running in background.

One more note is - this dependency on location and related permission is not specific to Android but also added in iOS.
> 2 votes

# Answer
Apps no longer need your location to scan for nearby Bluetooth devices on Android 12

> Android 12 adds new permissions specific for Bluetooth scanning and tracking, without needing apps to access the wider Location permission.
>
> \[...\]. Now, apps no longer need to ask for the location permission to keep track of a nearby Bluetooth device.
>
> This is probably a weird one, and you might ask yourself: Why is the location permission needed for scanning nearby Bluetooth devices? Basically, before Android 12, the ability to scan for nearby Bluetooth or Wi-Fi devices were tied to Android's broader "location" permission. The reason this was the case makes sense: You can definitely track a device by inferring what Bluetooth devices or Wi-Fi networks are nearby or are currently connected. So even if an app just scans for Bluetooth devices and doesn't utilize GPS or other tracking technologies, it still needed the same Location permission nonetheless.
>
> \[...\]
>
> Now in Android 12, Google has added a new BLUETOOTH\_SCAN and BLUETOOTH\_CONNECT permission, which are dedicated permissions distinct from the location permissions that apps can request. After being granted these permissions, an app can scan for nearby devices without also requesting the location permission. Only apps targeting Android 12 can declare these permissions, however.
> 2 votes

---
Tags: 6.0-marshmallow, bluetooth, location-services
---


# Question
Title: Is there Android for ARM (Windows) laptops?
I'm thinking of buying an ARM laptop as a second laptop for programming and hacking experiments.

Ideally I would set it up to multiboot Windows, Linux, and Android.

I've seen several articles and videos on the internet for setting up x86 Android on an x86 laptop, but can't find anything on ARM laptops.

I'm guessing it would come down to things like device drivers and maybe UEFI?

Is it possible for a normal person to install Android natively on an ARM laptop intended for Windows/Linux? (And preferably dualboot/multiboot?)

(I'm aware some highly skilled hacker types can probably do it using AOSP. I'm also aware I could just use a VM or emulator. For this question I'm only exploring the options of installing natively on the hardware.)

# Answer
Your difficulty with this is that boot arrangements for ARM-based computers are not currently standardised, and device drivers are specific to particular operating systems.

ARM Windows laptops are all based on Qualcomm SoCs at present, and Microsoft control the ecosystem far more than they do for x86 hardware. They seem to boot using a system devised by Microsoft and Qualcomm, which is quite different from Android booting, or Windows x86 booting. The device drivers you'd need for Android are different from the ones that come with Windows, even though they would drive the same hardware. You can run Linux on them via WSL2; Microsoft don't support booting standalone Linux.

Booting Android on them would require writing or modifying a boot loader and device drivers. It's a substantial reverse-engineering project, not something for ordinary users.

You could have run Android apps on them via Windows Subsystem for Android when this answer was first written. However, Microsoft have now abandoned that product.
> 1 votes

---
Tags: installation, hardware, arm-processors, dual-boot
---


# Question
Title: Android apps for "armeabi-v7a" and "x86" architecture: SoC vs. Processor vs. ABI
While downloading Android apps, sometimes I have seen apps for `armeabi-v7a` and `x86` architecture.

I read some references for `armeabi-v7a` and `x86` architecture. However, at the end, I couldn't finalize which mobile processors and architectures belong to `armeabi-v7a` and which belong to `x86`.

As per my knowledge, mobile processors commonly used in Android devices are Snapdragon (by Qualcomm), MediaTek, Exynos (by Samsung) and Kirin (by Huawei). Almost all brands explain specifications of a smartphone and almost all specifications say mobile processor is 64-bit or not. Should I conclude that 64-bit of mobile processors (Snapdragon, MediaTek, Exynos or Kirin) belong to ARM architecture?

**EDIT:**
To understand which SoC supports `armeabi-v7a` Android apk and which SoC supports `x86` Android apk, I have gone through the specifications of `MediaTek Helio X30` and `Snapdragon 855`. The specification of Helio X30 says, it supports dual-core ARM Cortex-A73 and quad-core ARM Cortex-A53 but ARM is not mentioned anywhere in the specification of Snapdragon 855. So should I conclude that Helio X30 will support `armeabi-v7a` Android apps and Snapdragon 855 will not support `armeabi-v7a` apps?

Please clarify my confusions.

# Answer
Here are my incomplete summarized notes on the subject, but enough to answer your question.

**INSTRUCTION SET:**

Processors are made of semiconductor dies, usually electronic-grade mono-crystalline silicon. They don't know English or any other human language, they understand only `0` and `1`. So the designer of processor tells us in what sequence of zero's and one's we can instruct that specific processor. This numerical language of instructions is standardized as `Machine Language` and the set of machine instructions is called `Instruction Set`. A processor can act upon only specific type(s) of instruction set.
Instruction sets can be 8/16/32/64-bit (defines how many instructions a processor can process at a time), last 2 being the common one these days.

**LOW LEVEL LANGUAGES:**

But writing program code (instructions) directly in machine language (the executable file) is near to impossible because it will take years to write and debug a reasonably larger program (that we can write in a few hours these days). So to put programmers at ease, Assembly Language was developed, still a processor-specific language but relatively easy to understand. Code written in Assembly Language is converted into machine code by `Assembler` \- a program written in Machine language. Both of these are called Low Level languages.

**HIGH LEVEL LANGUAGES:**

To further reduce human effort in communicating with hardware, high level languages were developed which are not bound to a specific instruction set (denoting a specific architecture). These are identical to human languages, hence easy to write, understand, debug and apply to multiple architectures. Code written in high level language is converted into low level language by `Compiler` \- a program written in low level language. One of the most commonly used high level languages is C. But sometimes code is not pre-compiled to machine code, instead directly executed (or compiled during execution) by `Interpreter`. Java is one of such *"write once, run anywhere" (WORA)* languages which is compiled to `byte-code` and then interpreted by `Virtual Machine` \- again a compiled program.

**APPLICATION BINARY INTERFACE (ABI):**

Since an architecture-independent program (code) can be converted to architecture-dependent code for any processor, it's the duty of compiler to take care of all the requirements of a specific architecture. That's what Application Binary Interface (ABI) defines. In simple terms, an ABI represents one or more specific architectures. Further details on Embedded ABIs require an insight into stages of Assembling and Compiling; object code, Executable and Linkable Format (ELF), static (archiving) and dynamic linking of libraries etc.

**Now coming to your question:**

**WHAT ARE `x86` AND `ARM`?**

x86 is a family of instruction sets, mainly developed and manufactured by Intel and AMD. ARM is another family, designed by a single entity `ARM Holdings` and being licensed to many embedded solution manufacturers including Qualcomm, Mediatek, Samsung and Huawei. Snapdragon, Exynos and Kirin are their brand names. They are not processor manufacturers but they have licenses to include ARM processors with their own System on Chip (SoC) circuits.

**WHAT IS SoC?**

A System on Chip (SoC) is a small circuit that includes processors along with other components such as GPU, RAM, Flash/eMMC (equivalent of HDD or SSD), WiFi and bluetooth module, USB connectivity, UART (serial ports), JTAG (a very lower level serial communication protocol), GPS, modems (for cellular connectivity) and possibly others.

**ARM ABIs:**

Though the major part of Android apps is written in Java, one can program in native languages like C and C++, which needs to be compiled. Android provides its own Native Development Kit (NDK) including (libraries, header files and) a compiler that can compile code for multiple ABIs including `armeabi-v7a` (`armhf` in Linux community) and `x86`.

Android (Java) app itself isn't specific to an architecture. During app build process Android SDK converts Java source to bytecode (`.class` files) and then compiles it to **D**alvik **EX**ecutable (`.dex`) file which is packed with `.apk` files. This Dalvik bytecode is interpreted and run in a separate instance of `Dalvik Virtual Machine`/`ART` for every app by a process named `Zygote`. Or it can be permanently compiled to native machine code (`.odex` or `.oat`) according to the architecture of the device during installation of app (or later). But if the apk (zip) file additionally contains ELF binaries/libraries, those are architecture-specific. Developers usually include native libraries for multiple architectures in their apps.

Native applications/programs/binaries/executable/libraries built with compiler suites targeting `ARM Embedded ABI v7a` (armeabi-v7a) can be run on `Application profile of 7th version of ARM processors` (Armv7-A).
Code compiled with toolchains provided by other vendors, targeting same architecture (though with different ABI names) should also run on Android devices.

**32-BIT VS. 64-BIT:**

ARM processor can be 32-bit or 64-bit. It depends on SoC manufacturers what they want to build with their embedded system e.g. Snapdragon can be 32-bit or 64-bit. 32-bit ARM processors were improved for performance and new capabilities were added from version 2 to version 7. 64-bit support was introduced in ARMv8.

To find out if a device is 32-bit or 64-bit, you need to check the specifications of its SoC and then of its processor. For instance SoC in Redmi Note 4 is Qualcomm Snapdragon 625 (MSM 8953), which contains processor `Cortex-A53`. It's evident from technical specifications of Cortex-53 that it's based on `ARMv8` architecture, which can process 2 types of Instruction Sets: `aarch64` (which Android's arm64-v8a ABI uses) and `aarch32` (which Android's armeabi-v7a ABI uses i.e. backward compatible with `ARMv7`).

So it can run binaries/libraries compiled for both of these ABIs, but not for x86 or `armeabi` (called armel in Linux community; which targeted architecture `ARMv5/v6`, and was removed in `NDK r17`).

---

**RELATED:** Could a 64-bit hardware device run a 32-bit Android version?
> 11 votes

# Answer
The number of hardware devices that use x86 was never very high. Some years ago Intel had some x86 processors (Intel Atom) that were used in some Android tablets (e.g. Samsung Galaxy Tab 10.3).

However those tablets never reached a high volume on the market. And I am not sure if there is any x86 Smartphone or tablet on the market that still use an x86 CPU.

However there is one very common use case where you encounter an "x86 Android device": Android Emulators like the one contained in Android SDK or other emulators like Genymotion, BlueStacks, ...

As the PC running the emulator typically uses a x86 CPU emulators that run an x86 image (instead of an ARMv7 or ARMv8/ARM64 based image) can make use of the CPU integrated virtualization techniques which result in a much higher speed.
> 3 votes

# Answer
## A shorter answer

All the current Android devices on the market use ARM-compatible processors.

* ARM Holdings designs the basic architectures, and example processors. The modern examples all have names like Cortex-A78, Cortex-A720 or Cortex-X2.
* Chip manufacturers, such as Qualcomm, MediaTek, Huawei and Samsung license the ARM architectures. They design SoCs, made up of ARM processors, memory, GPUs, digital radio systems and other electronics. Some of those companies manufacture SoCs themselves, others sub-contact the manufacturing, to TSMC, SMIC, or other "chip foundries."
* The chip manufacturers all have brand names for their SoCs: Qualcomm = Snapdragon; MediaTek = Helios; Samsung = Exynos and Huawei = Kirin. Their marketing material tends to leave out ARM because they want to look as if their products are uniquely their own and vastly superior to the competition.
* Some chip manufacturers enhance the ARM designs in various ways, and a few have designs that are genuinely their own. Apple are the notable example, but their chips are not used for Android devices. Qualcomm are planning to introduce designs of their own under the "Oryon" brand name, likely in late 2024.
* ARM-compatible processors have existed in many, many variations. Android has set a few different minimum standards, to make software compatibility easier to manage. Those are called "ABIs". `armeabi-v7a` is the modern 32-bit ABI; `arm64-v8a` is the modern 64-bit ABI. Making ARM-based SoCs for the Android market that weren't compatible with the ABIs would be silly, and nobody does it.
* When this question was first asked, `armeabi-v7a` was universally available on modern devices with `arm64-v8a` becoming widely available. As of mid-2023, `arm64-v8a` is just about universal, and `armeabi-v7a` is starting to be dropped.

There were a *few* Android devices that supported the `x86` ABI, but they were never widely used. They are just about extinct now. The `x86_64` ABI is used for emulators, but not on devices. Intel and AMD, who make x86 and x86-64 processors, have never managed to achieve power usage to performance ratios that compete with ARM, and are unlikely ever to do so, because of the complexity of the x86 architecture. They make processors that are faster than almost any ARM chips, but they use *much* more power, which makes them unsuitable for battery-powered devices.
> 1 votes

---
Tags: applications, google-play-store, arm-processors, processor, x86-processors
---


# Question
Title: Can I run an Android emulator (with GUI) on a headless Linux server?
I have a hosted server that runs the Ubuntu server, and I was wondering if there was a way to run Android applications and get access to the Android GUI remotely, such as with a remote desktop. Also, is there a way to set up this without installing a complete GUI on the remote server to preserve resources?

# Answer
> 0 votes
It's commercial, but Canonical's AnBox Cloud should be able to do what you need. It runs Android in containers and is intended for streaming Android games, but that is not its only use.

I looked at it for on-premises software testing, because I had test data that I wasn't willing to put on a cloud platform, and Canonical reckoned that could be done.

---
Tags: linux, android-emulator, remote-access, virtualization
---


title: Why are Android ELF files different?

text:
# Question
Title: Why are Android ELF files different?
When I try to run a x64 ELF file which was build for Android on my desktop PC I get a "file not found" error.

I think that's normal because Android ELF files aren't compatible to normal ELF files.

What is the reason behind this?

# Answer
The ELF file format is the same. The difference is the file paths embedded in the ELF file.

ELF is a very general format, which can encode many things about the contents of a file. Linux, Android, and many other operating systems use ELF format for executables and libraries but that does not make them compatible. It's like having directions for different journeys by road. They're all written in the same language (corresponding to ELF) but trying to follow directions for getting to Koln from Stuttgart when you're starting in Frankfurt won't work.

As per the comments, if you build a *completely* statically linked executable for x86-64 it may well work both in the Android emulator and on your Linux desktop. However, most programs need to use system libraries, and the linker embeds the names of those libraries, and the path to the run-time linker in your ELF executables.

Although Android uses a Linux kernel, the system libraries and run-time linker are completely different from Linux. Android uses the Bionic library, and most Linuxes use glibc. This was deliberate: Android was originally designed for fairly slow devices without much RAM, and needed a library that didn't take up much space and ran quickly. Glibc could assume more powerful hardware.

The Android run-time linker is `/system/bin/linker` (or `/system/bin/linker64` for 64-bit code). The Linux run-time linker is *usually* `/lib/ld.so` (or `/lib64/ld-linux-x86-64.so.2` for 64-bit code). Obviously, these are different paths, and each only exists on the relevant operating system. The "file not found" error you get when running an Android ELF file on Linux is a complaint that `/system/bin/linker64` doesn't exist on your Linux system.
> 1 votes

---
Tags: linux
---


# Question
Title: Why is a vendor blob needed to build an Android ROM?
Why do we need a vendor blob in order to make our custom Android ROM from the AOSP project?

As far as I know, the vendor blob contains the required proprietary drivers. But these drivers we could have used as modules in the kernel itself, then why do we use vendor blob as a separate partition?

# Answer
> 1 votes
Vendor blobs are required because the vendors aren't willing to release the source code of their Android drivers as open source. This may seem silly, given that the drivers are no use on any other hardware, but they doubtless have their reasons.

The most obvious one is that vendors who spend a lot on developing high-performance hardware will fear it being cloned by other vendors, who have not spent much on development and can thus sell their copied chips for less. For example, source code for drivers can be extremely helpful in figuring out how a GPU works.

---
Tags: linux, rom, kernel, aosp
---