# Question
Title: Flash OS firmware on an OS corrupted device via TWRP
I have a big issue: I got 2 units of the Android TV device called "Stream+" sold by Channel Master, manifactured by Technicolor (https://www.channelmaster.com/Stream\_OTA\_DVR\_p/cm-7600.htm)

One is perfectly working. The other one has the OS files completely corrupted and does not even allow me to complete a factory reset successfully (and that's out of warrancy as well, so I have to fix by myself). All it does when is switched on is showing a welcome logo, then attempts to load the OS but stays stuck forever, freezed in a black screen.

The following is the menu with the options shown when I load it on recovery mode: https://images2.imgbox.com/c9/0e/E947NI4Z\_o.jpg

What I want to ask is... Can I use TWRP to flash a copy of the OS Firmware from the device 1 (the fully working one) and then flash the defective one with it? Defective one, as said, DOES NOT load the OS, all I can do is using one of the options shown in the above pic.

Have I got any chances to solve this through TWRP? (Or anything else)

# Answer
https://www.androidcentral.com/10-basic-terminal-commands-you-should-know this is a starting point to flash twrp or a custom rom using the Android Debug Bridge ADB

Look for a utube how to install ADB and fastboot for your pc . Then when u have adb command window open connect usb to device & use
1. The adb devices command which is "adb devices"

do this first before down loading any of the sdk package as you need to know if your pc can recognize your device.

you could also use somthing like this for the type of device you have this only works for samsung but there are others for different manufactures

https://www.google.co.uk/url?sa=t&rct=j&q=&esrc=s&source=web&cd=4&cad=rja&uact=8&ved=2ahUKEwjz65GBkaneAhWlhKYKHaTHBuQQwqsBMAN6BAgDEAQ&url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DJv538rOL5p0&usg=AOvVaw3bIUhWGgbgikQiD3eBUfG1

hope this points you in right direction
> 0 votes

---
Tags: device-firmware, operating-system, android-tv
---


# Question
Title: Recovering samsung G5 after firmware flash?
So, I purchased two Samsung Galaxy S5 phones from Amazon a while back. I have been playing around with the first after reflashing to a different firmware version - no issues arose. However, when I went to reflash the second phone with the *same* firmware image I used on the first the phone refuses to complete the boot sequence.

I am able to shell into the device during its boot sequence, but the phone never gets past the Samsung animation. Further inspection of their original packaging indicates that they may be from two different regions.

Now, is there a method for determining the correct firmware version (with respect to locality/baseband version) in order to recover the phone after the original firmware has been wiped? I have been trying various versions of Samsung G5 firmware, but all give the same unbootable result.

**tl;dr** Assuming no firmware is loaded and we have only the original bootloader, what are the recovery options? Even if I must first use some Samsung tool to recover to the latest version, this is fine.

Any suggestions?

# Answer
try wiping the cache from bootloader menu .

or this

https://www.androidcentral.com/10-basic-terminal-commands-you-should-know this is a starting point to flash twrp or a custom rom using the Android Debug Bridge ADB

Look for a utube how to install ADB and fastboot for your pc . Then when u have adb command window open connect usb to device & use 1. The adb devices command which is "adb devices"

do this first before down loading any of the sdk package as you need to know if your pc can recognize your device.

you could also use somthing like this for the type of device you have this only works for samsung but there are others for different manufactures

https://www.google.co.uk/url?sa=t&rct=j&q=&esrc=s&source=web&cd=4&cad=rja&uact=8&ved=2ahUKEwjz65GBkaneAhWlhKYKHaTHBuQQwqsBMAN6BAgDEAQ&url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DJv538rOL5p0&usg=AOvVaw3bIUhWGgbgikQiD3eBUfG1

hope this points you in right direction
> 1 votes

---
Tags: recovery-mode, samsung-galaxy-s-5, device-firmware
---


# Question
Title: Oreo: associating an app with all files with a given extension?
**NOTE:** my question is indeed similar to the question above. However, there is a slight difference, which I explain below in my ADDENDUM section.

Original question ...

I am creating lots of text files on my Oreo-based Android device with various file extensions besides simply `.txt`. For example, I have files with `.xyz` extensions, `.abc` extensions, and others, and I want all files with these particular suffixes to be seen as text files by my chosen text editor app. This way, whenever I select such a file, the system will choose that text editor to open them.

I have not found any way to do this, especially given that there is no default file association for text files that is offered in Android. But even if such a default text-file association were to exist, I don't know how to cause *ad hoc* filename suffixes to be associated with text files.

Furthermore, intents seem to operate on mime types, and I don't know how to associate these extra suffixes with `text/plain` under Android.

Is there any way in Android (Oreo) for me to accomplish what I want?

Thank you in advance.

**ADDENDUM:** The post referenced above talks about how mime types are managed on an application-specific basis in Android, and that there is no official way to manage mime types on a system-wide basis.

I understand this, but I am asking something slightly different. Suppose an application is already configured in its manifest to respond to `text-plain` items. My question is this: where in Android is the `.txt` suffix defined as corresponding to `text-plain`, and is there any way to add more suffixes (such as `.abc` and `.xyz`, as I describe above) on a system-wide basis to also be mapped to `text-plain`?

I have a rooted device that makes use of `Xposed` and `Magisk`, and so even if there is no *official* way in Android to implement these kinds of mappings, I'm wondering if there might be any unofficial `Xposed` or `Magisk` modules that will enable this. I couldn't find any such `Xposed` or `Magisk` modules, but perhaps I'm overlooking something.

Also, since my device is rooted (and I also am able to change my selinux settings to `permissive`), I could manually edit system configuration files anywhere on the device to add more filename suffixes to the `text-plain` mapping, assuming that this mapping is indeed managed in some sort of system configuration file.

I also run `Tasker`, and if such a mime configuration file exists, I could make sure that `Tasker` always copies a special version of that file in place during boot-up. In addition, I run other utitilies which allow *ad hoc* scripts to be run at startup via `init.d`.

Any thoughts? ...

# Answer
The following looks like a promising answer ...

The file `/system/lib/content-types.properties` contains the following info. It looks like I can add `abc=text/plain` and `xyz=text/plain` to this file in order to get my desired behavior. I'll test this and report back.

```
# If you want to support more recognized mimetypes in libcore.net.MimeUtils, add them here

docm=application/vnd.ms-word.document.macroenabled.12
xlsb=application/vnd.ms-excel.sheet.binary.macroenabled.12
xlsm=application/vnd.ms-excel.sheet.macroenabled.12
ppsm=application/vnd.ms-powerpoint.slideshow.macroenabled.12
ppsx=application/vnd.openxmlformats-officedocument.presentationml.slideshow
pptm=application/vnd.ms-powerpoint.presentation.macroenabled.12

asm=text/x-asm
cc=text/x-c
conf=text/plain
cpp=text/x-c
css=text/css
c=text/x-c
cxx=text/x-c
def=text/plain
dic=text/x-c
f77=text/x-fortran
f90=text/x-fortran
for=text/x-fortran
f=text/x-fortran
hh=text/x-c
hpp=text/x-c
h=text/x-c
ics=text/calendar
ifb=text/calendar
in=text/plain
jad=text/vnd.sun.j2me.app-descriptor
java=text/x-java-source
ksh=text/plain
list=text/plain
log=text/plain
pas=text/x-pascal
pl=text/plain
properties=|
prop=text/plain
p=text/x-pascal
py=text/x-python
rc=text/plain
sgml=text/sgml
sgm=text/sgml
s=text/x-asm
vcs=text/x-vcalendar

```
> 0 votes

---
Tags: file-management, files
---


# Question
Title: Is there a way (with root?) to prevent Android task killer from killing certain apps?
I'd like a browser app (FireFox) not to be killed every now and then by the system's task killer since I'd like to use certain single page applications that hold some data and are not loaded very quickly. Is there any way to deal with this, even if root is required?

Some time ago, I've updated my device from a 1 GB RAM to another one, 3 GB RAM and everything went well (browser stopped to get killed at all). But after a system update in Jan 2016, things got even worse, now FireFox usually gets killed even after an alarm clock rang or I opened a camera app. This is a major issue for me so I appreciate any help about this.

PS yeap, I've tried Settings→Battery→Battery Optimization where I both added FF to exceptions (didn't help) and turned Battery Optimization at all (didn't help as well).

# Answer
**Tl;dr**

It's possible with root, you can tweak `oom_adj` values to prevent apps from being killed, alternatively force the target app to stay in memory by "locking" it or change some related settings responsible for killing apps in low memory condition.

---

**Background: Android RAM Management**

> Android uses a different way of handling processes. Instead of killing every process after its activity ended, processes are kept until the system needs more memory. The idea is to give speed improvements if you start that activity again. But how/when does Android kill a process if it needs more memory and which process to kill first?
>
> This is managed by the LMK (Low Memory Killer) driver of Android. You may already know that every app/process in Android is assigned an `oom_adj` value, which indicates the likelihood of it being killed when an out of memory (OOM) situation occurs. More higher it's value, the higher likelihood of it getting killed. Valid range is `-17` to `+15`. (if in the `-17` range means it won't get killed). According to that, there are six groups (OOM groups), into which apps/processes are categorised:

1. Foreground app
2. Visible app
3. Secondary server
4. Hidden app
5. Content provider
6. Empty app

Basically these could be described as:

> `FOREGROUND_APP`: This is the process running the current foreground app. We'd really rather not kill it!
>
> `VISIBLE_APP`: This is a process only hosting activities that are visible to the user, so we'd prefer they don't disappear.
>
> `SECONDARY_SERVER`: This is a process holding a secondary server -- killing it will not have much of an impact as far as the user is concerned.
>
> `HIDDEN_APP`: This is a process only hosting activities that are not visible, so it can be killed without any disruption.
>
> `CONTENT_PROVIDER`: This is a process with a content provider that does not have any clients attached to it. If it did have any clients, its adjustment would be the one for the highest-priority of those processes.
>
> `EMPTY_APP`: This is a process without anything currently running in it. Definitely the first to go.

These groups are defined by `oom_adj` value limits, and apps would fall into one of those groups according to the `oom_adj` value assigned to that particular app. "Foreground apps" usually have an `oom_adj` value of `0` or less (so they are the least killable; i.e High priority).

"Empty apps" have a higher `oom_adj` (they are killed early; i.e Low priority). Also, `oom_adj` value changes according to the state of the user app; it's `0` when the app is active in the foreground and assigned a higher value when the app goes to the background.

> Why their "killability" differ? Apps belonging to these different groups (that have different `oom_adj's`), start to get killed at different levels of free RAM. These triggering RAM limits are defined by the LMK minfree values. Above 6 categories correspond with 6 RAM limits which are set in the LMK minfree. eg: Stock Android 4.3 in my device comes with the minfree values of `48,60,72,84,96,120`. (these are in MB).

Practically what it means is, Empty apps will get killed when ram goes below 120mb, Content providers when it goes below 96mb, Hidden apps when it goes below 84mb and so on.. lastly starts killing Foreground apps when ram goes below 48mb. (You may notice that this last value (48mb) is not desirable when using memory intensive apps like heavy games).

NB:

1. In newer kernel, `oom_ score _adj` is used instead of old `oom_adj`. (oom\_score\_adj valid range is -1000 to 1000). But `oom_adj` is also maintained for perhaps compatibility.
2. It is said that there are many OOM process categories that are assigned different `oom_adj` priorities by the `ActivityManagerService`, but eventually all of those would be considered under above six slots/groups (according to oom\_limits), for the purpose of killing by the LMK minfree triggers. Therefore, those six are the important ones for normal users.

* We can check the minfree values (also change them) and see the OOM groupings of apps/processes with this Memory Manager app easily.
3. Not every device has the same OOM configuration.

---

**Improving RAM Management**

Nowadays there is much user friendly implementation of RAM management mechanism with UI in system settings (such as App optimisation in Battery settings, **Protected apps** in some ROMS e.g **Huawei’s EMUI** etc) and can have the same effect as described above:

Having said that we can now explore ways in which, RAM can be utilised without killing foreground applications too often. The target areas will include:

**1.Adjusting minifree values to suit one’s needs**

**2.Locking apps in memory to prevent them from being killed**

**3.Overridding the hidden app limit of android**

---

1. **Adjusting minifree values**

* You can change the minfree values with memory manager and tap apply. (Additionally there is an option “apply at boot” and tick to preserve settings across boots). Several apps can achieve this e.g Memory manager, Minfree manager etc
    * Alternatively use terminal/adb using pages:

    ```
    #!/system/bin/sh echo “values” > /sys/module

    ```
2. **Locking apps to stay in memory (making it resident)**

a) Using App Settings (Xposed)

* One simple method is used Xposed module, App settings (you need Xposed framework installed)
* After installing the framework, then download the 'App Settings' module through Xposed installer.
* Open App Settings and allow the applications to load, selected the target app (in this case **firefox browser**)
* In the settings page, enable the toggle and activate editing mode, tick the “Resident” option and save. (*Making apps resident, causes apps to staying memory without being killed and it is advised to use exit button in target application if it’s no longer needed otherwise it will deprive other apps memory)*

b) Using memory locker

Another implementation of this concept is locking the target application in memory by controlling the system files for setting `oom_adj` for all running processes.

How the application works:

> Memory locker controls files in the /data directory and also controls sytem files in root for setting oom\_adj for running processes.
>
> All locked applications are automatically locked after each reboot. Apps are classified as downloaded/system apps, to unlock select target app and click on the lock on right side. (You can optionally set `oom_adj` priority)

3. **Overriding the hidden app limit**

* In addition the low memory killing mechanism, there is another parameter that controls killing of hidden and empty apps. Apps are killed when they go beyond specified limits.
    * There is a build.prop setting that which can control this (default is usually a low number less than 25, and modifying this can increase this value to a much larger value like 80)
    * Add this line to build.prop file in /system and leave another blank line below that (be sure to make back up first)

`ro.sys.fw.bg_apps_limit=80`

---

References and Credits

1. Android RAM Management (Special credits: mrhnet)
2. Memory Locker
3. Xposed - General info, versions & changelog
> 11 votes

# Answer
This app, RAM Manager claims to be able to lock certain apps from Android's RAM management mechanics.

Alternatively, go to **Settings→Battery→Battery Optimization** and set Firefox to *Don't optimize* can help a bit.
> 1 votes

# Answer
The post above is very thorough, but I will add instructions for a few specific models (stolen from ASM app page). Note that for apps that use more memory (eg Firefox), the system will likely eventually kill the app anyway when other apps request memory space. If the cached ram is needed, the largest and oldest apps go first regardless of battery saving settings, and Firefox is a big spender.

---

How to deal with (known) Battery savers?

Samsung In Android settings \> Device Maintenance \> Battery, add app to the list of Unmonitored apps

Huawei (depending on models) In Android settings \> Advanced settings \> Battery Manager, add app to the list of Protected Apps or: Battery \> Close apps after screen lock, uncheck app from the Lock screen clean up

Xiaomi In your Security app: Battery % \> App battery saver, select app then No restrictions and: In your Security app: Permissions \> Autostart then allow app to be started.

Asus (Zenfone) Open your Auto-start Manager and allow app to be started.

OnePlus In Android settings \> Battery \> Menu \> Aggressive Doze & App Hibernation, check app to exclude it from the optimised apps.

Infinix Open your Xmanager app, Auto-start manager and allow app to be started.
> 1 votes

---
Tags: ram
---


# Question
Title: Overheating device with random apps spiking CPU usage
Few days ago my phone has started overheating and burning through the battery like crazy. I don't use it too much, and it used to last 1.5-2 days, now it's dead in 6 hours.

I've installed System monitor lite and it's showing that several of my cores are constantly at extremely high usage (over 80%), and various regular applications like Gmail and LinkedIn are shown spiking the CPU up to 20% each. I expected a single app to be doing something stupid, and after seeing which one it is, it would be simple to just remove it, but that's not the case. It turns out that a bunch of regular apps that I haven't opened in days are going crazy.

Here are some screenshots:

So, any suggestions besides doing factory reset?

## The phone in question is Xiaomi Redmi Note 4 running original MIUI without root.

# Answer
> 1 votes
A couple of things:

* Applications that show running processes are only able to show the user processes (meaning no kernel processes)
* Android gives more priority to the application in the foreground (the one you are currently seeing). When you open the the task manager, the other processes are being capped. The measuring you are trying to do influences the results.

If you can provide more details by measuring externally with one of these:

1. **Try installing Android Studio**:
2. **Post the Log Cat results**:
3. **Or use the Android Debug Bridge** (adb) with `adb logcat` – you can view your Android device’s log.

With one of these you can actually profile your running Android phone over a USB connection.

I don't think anyone can give you a complete direct answer without some more information, except if maybe they had the exact same model number and issue.

# Answer
> 0 votes
looking like you are on Chinese variant of RN4 with mediatek deca-core processor

If you feel like your phone is using too much cpu power than it is not the case image showing cpu usage of asus zenfone max pro m1\] here you can give a look at my device cpu usage. all 8 cores are working on a high frequency but still i am getting a great battery backup. so definitely it is not looking like a issue in cpu. u can try resetting your device or can take help from a xiaomi care.

---
Tags: battery, cpu, xiaomi-redmi-note-4g
---


title: SMS/MMS database location?

text:
# Question
Title: SMS/MMS database location?
I'm trying to pull SMS messages from an old Nandroid backup, but need to find the database before I can. I found an article listing its location in Kitkat, but can't find anything for Nougat/Oreo. (Or even Marshmallow for that matter.)

Anyone happen to know where the files for SMS/MMS messages are actually stored?

# Answer
> 5 votes
While for Android 6 and 7 the DB with SMS data is located under

> /data/data/com.android.providers.telephony

on my LineageOS 15 (Oreo) the file has been moved under

> /data/data/com.android.messaging

and renamed to bugle\_db

Oo

# Answer
> 1 votes
```
/data/data/com.android.providers.telephony/databases/mmssms.db

```

# Answer
> 0 votes
If you have Mokee rom this is the location:- data/data/com.android.messaging/databases/bugle\_db Copy it using some root file browser(ES explorer/Amaze file manager) and rename it to bugle\_db.db

---
Tags: sms
---


title: What does /mnt/asec directory contain?

text:
# Question
Title: What does /mnt/asec directory contain?
What does `/mnt/asec` directory contain in Android? Can someone explain in brief?

# Answer
Thought Google would have an official definition on Android Developers, but surprisingly not. So with a lil bit of Google I dug up this:

Android Security Internals: An In-Depth Guide to Android's Security Architecture

Look around P80 for related content. From what I understand, ASEC (Android Secure External Cache) was implemented in a time when Android devices come with limited storage and has to resort to external storage (i.e. SD card) for apps, and its purpose is to securely store part of the apps so as to prevent corruption and piracy by copying SD card contents.

Wikipedia also has a bit of intro here.
> 4 votes

# Answer
It's actually used to achieve "Move to SD card" feature.

Take a sample app called `com.sample.app`.

When an app is installed, a new folder will be created by the app name `/data/com.sample.app` which contains the app's private data. Similarly, the APK itself is contained in `/data/app/com.sample.app1.apk`

When we move the application to external storage,

1. It will not be moved to `/mnt/sdcard/` partition. Android will create a new folder under `/mnt/asec` partiton called `/mnt/asec/com.sample.app`.
2. It will also copy the APK from `/data/app/com.sample.app1.apk` to `/mnt/asec/com.sample.app/com.sample.app1.apk`
> 3 votes

# Answer
On one hand, when I browse my rooted android through adb shell, I get here:

```
/data/data/com.sample.app

```

Then `ls -al` gives :

```
drwxrwx--x u0_a25   u0_a25            2018-10-28 23:52 cache
drwxrwx--x u0_a25   u0_a25            2018-10-29 00:36 files
lrwxrwxrwx install  install           2018-10-29 09:48 lib -> /mnt/asec/com.sample.app-1/lib
drwxrwx--x u0_a25   u0_a25            2018-10-29 07:45 shared_prefs

```

On the other hand, through USB connection, I get two mount points:

```
mtp:/Y330-U01/Phone storage/
mtp:/Y330-U01/SD card/

```

The following directory `mtp:/Y330-U01/Carte SD/.android_secure/` looks empty. Is it actually empty ?

When plugging directly the SD Card on the PC (via USB micro SD adapter) the directory `.android_secure/` appears to contain: `com.sample.app-1.asec`

So in my opinion `/mnt/asec` is a mount point for `/mnt/asec/com.sample.app-1/` mount points, leading to `.android_secure/*.asec` secure disk image files (or kind of...)
> 1 votes

---
Tags: file-system
---


# Question
Title: Doing the equivalent of "adb pull", but initiated from the Android device, not via adb
I have a rooted Oreo Android device, and I can use "adb pull" from my linux machine to retrieve copies of files and directories from my device.

However, I want to get a full copy of each and every file and directory on my device, starting from the root filesystem. I know I have to do "adb root" in order to allow this to happen, but when I do so, I get the following error ...

```
adbd cannot run as root in production builds

```

So what I'd like to do, if possible, is to get this data onto my linux machine in the opposite manner: *i.e.*, to be su'ed on my android device, and from that device, to cause a complete recursive copy of everything from root on down to somehow be sent out to my linux machine.

Any ideas of how I can do this?

Thank you in advance.

# Answer
> 2 votes
Thanks to **izzy**, above, I realized that I can copy the TWRP backup directory to my linux machine and de-tar the files contained in the backup. I didn't realize that they were tar files.

This is the solution.

---
Tags: adb, file-management
---


# Question
Title: Whatsapp last seen is blank and shows only when online
it looks pretty confusing and weird that some contacts the last seen is always blank and it shows up "Online" only when the contact is Online.

They haven't blocked me anywhere not have I. How this could happen?

Regards Shiva

# Answer
Because in their settings, they have disabled for others to see their last seen time.
> -2 votes

---
Tags: whatsapp-messenger
---


title: Removing SMScontactsbackup folder

text:
# Question
Title: Removing SMScontactsbackup folder
I have read a similar post here Accumulation of APK's?

I have about 8Gb of my SDcard on a Samsung Galaxy S7 used by the apks folder within the SMScontactsbackup folder

Now from what I have read and understood (which may be wrong)

This apks folder contains the installation material for new versions of Android apps. Surely the apk should be deleted once the app upgrade has been successfully installed?

I don't have the Super Backup and Restore installed on the phone (which some people claim is the cause of the problem) but I can't be sure whether that app was installed in the past and now removed.

My question is

How do I delete this apks folder and its contents which are taking a large part of my SD card? I could not find those instructions anywhere - but maybe I missed them

Thanks

Clive

# Answer
> 1 votes
* Super Backup and Restore application creates a folder named SMScontactsbackup on internal storage. The application is used to backup and restore contacts, call logs, sms, apps etc.
* Each items are kept in separate folders.
* The app also saves each app's previous apk's which are updated through play store.
* You can delete this folder by these methods.

1. By removing Super Backup and Restore application from your device, it will also ask permission whether to delete folder and it's contents.
    2. Using any file manager app (here Samsung file manager for Samsung devices),you can delete that folder from internal storage. (N.B if Super Backup and Restore application is not removed, then folder will be created again ).

Note: You need to make sure that, you've restored everything before removing app/ deleting folder.

---
Tags: external-sd
---


# Question
Title: Installing .apk as system app directly (with root)
I'm wondering is it possible to install .apk file as system app directly (with root)? **Without converting user app to system app.**

# Answer
You can simply copy the apk (its name not relevant) into */system/app* or */system/priv-app*, set the appropriate permissions (rw-r-r, root:root) and then do a reboot. That's it.

Works well on Android 6.0.1.
> 5 votes

# Answer
Via ADB: (Copy apk to phone via usb/My computer first)

Example:

```
adb shell                                           (Get into shell to run beow commands)
su                                                  (Run as root)
mount -o rw,remount /system                         (Mount system read/write since default it read-only)
chmod 755 /system/priv-app/Messaging_SEP81          (Set permissions on folder)
chmod -R 644 /system/priv-app/Messaging_SEP81       (Set permissions on apk file)
ls -l /system/priv-app/Messaging_SEP81              (Check permissions - Should be: -rw-r--r-- 1 root root - not sure what 1 & 2 is)
ls -l /system/priv-app | grep "Messaging"           (Check permissions - Should be: drwxr-xr-x 2 root root)
reboot                                              (Reboot device)

```
> 2 votes

---
Tags: root-access, installation, system-apps
---


# Question
Title: How to block ads in Android applications?
Are there ways that attempt to block ads in applications? It seems that it should be theoretically possible, by blocking web requests to certain sites, for example.

# Answer
The most popular method is replacing the built-in hosts files with one that forces DNS queries to well-known ad servers to result in 127.0.0.1 (localhost). This effectively blocks most common ads, and most of the Google Ads in applications.

The downside is that applications can tell that ads are being blocked, and can either refuse to run or otherwise degrade their usefulness while the ad blocking is in effect.

Also, root access is required to replace the hosts file.

Beyond that, I haven't seen anything that can selectively block web requests for arbitrary apps. For some programs that only use internet access for ads, you could use a firewall app to prevent them from accessing the internet or -- if your ROM supports it (like the latest CyanogenMod) -- revoke the internet access permission from the app.

Again, root access is generally required to set up a system-wide app-level firewall or replace your ROM.
> 16 votes

# Answer
There are two different apps, AdFree Android and AdAway that block ads, theoretically in all applications. You must have a rooted phone in order to use these.

AdFree Android works by

> ...nullifying requests to known host names in the system hosts file.

which is essentially an automated solution of modifying the hosts file, brought up by another user here. It appears that Adaway does the same thing.

If you do not have a rooted phone, you can, at the very least, use the Firefox Browser with the Adblock Plus AddOn (installed via Firefox).
> 12 votes

# Answer
You can use an **ad-blocking DNS server** such as AdGuard DNS. Unlike the HOSTS file method, you won't need to use an app, nor root your phone.

On Android 9 Pie and later, you can use ad-blocking DNS servers by configuring the **Private DNS** setting:

1. Go to Settings → "Network & internet" or "Wi-Fi & Internet" or "Connections".
2. Select "Advanced" or "More connection settings" → "Private DNS".
3. Select the "Private DNS provider hostname". Enter `dns.adguard.com`. (This is the AdGuard DNS hostname. If using another ad-blocking DNS, then replace it with the corresponding hostname.) Press "Save".

For versions prior to Android 9 Pie:

1. Go to "Settings" → "Wi-Fi".
2. Press and hold the name of the Wi-Fi network you are currently connected to.
3. Select "Modify network".
4. Tick the "Advanced options" checkbox.
5. Change "IP Settings" to "Static".
6. Remove the DNS addresses that may be already listed and replace with `94.140.14.14` for DNS 1 and `94.140.15.15` for DNS 2. (These are AdGuard DNS IP addresses. If using another ad-blocking DNS, then replace them with the corresponding IP addresses.)
7. Press "Save". You may need to disconnect from the Wi-Fi network and reconnect for the changes to take place.
8. Note that if the "Save" button is grayed out, manually re-enter the current values into the "IP address", "Gateway", and "Network prefix length" text fields. Then press "Save", which should become active by this point.

---

Aside from the DNS / IP address-based ad blockers, I'd also recommend **MinMinGuard** (requires a rooted phone and the Xposed Framework). It features API-based blocking, where function calls provided by the advertisement network SDK are blocked.

> MinMinGuard is an Ad-remover made with Xposed Framework for Android. MinMinGuard can completely remove both the ads inside apps and the empty space caused by those ads. Conventional ads removing apps are only able to block the ad content, but the space taken by the ad will still remain unused (black). MinMinGuard successfully removes that black space, which extends the app window and makes your user-experience better!
>
> Features:
>
> * Totally remove the advertisement. You can notice that AdBlock and AdAway only stops showing the ad content, but it can not remove the empty field that was originally taken by the ad. MinMinGuard can totally remove the empty field!
> * Lightweight. Alternative ad removing apps (AdBlock etc) constantly run a background VPN service, which puts a heavy loading on the system. MinMinGuard does not need to run a VPN service, so it saves system resources and, thus, extends the battery life.
> * Per App Setting. MinMinGuard lets you choose which apps you want to remove ads from. If you only want to remove ads from several apps, MinMinGuard is your best solution.
> 5 votes

# Answer
You can also use a firewall or permissions-limiting application (DroidWall or LBE Privacy Guard, for example) to limit internet access for particular applications. These also require root.
> 4 votes

# Answer
To disable ads, you have to understand where the ads actually come from. There are easy-to-identify ad servers, and those can be easily avoided by editing your hosts file (you can edit hosts file on a rooted phone through ES file manager, or from a terminal session be it local or from your laptop/desktop).

But when the ad servers keep having random subdomains, that can be a real chore to keep chasing those updated servers. There are applications (previously mentioned) that help to ease that task--but it still is the same solution of getting hit with ads--and then blocking the new servers. None of those methods work if the ip address gets hardcoded in. That is the trump card.

Another option is to enable a firewall that denies ANY traffic for a specific application. That means: updates, ads, pushing your stats, etc...don't use your data plan and don't tie up your phone. Avast! Mobile security (free on marketplace or Play) gives you granular control when you want it. I have used Avast on desktops and servers, and run it on rooted Gingerbread and CyanogenMod9 (ICS). Very good appl.
> 3 votes

# Answer
Adblock Plus is now available for Android.

Here's a snippet from Lifehacker's review:

> If you love Adblock Plus on the desktop, now you can take it with you on your Android phone. Adblock Plus for Android blocks ads on sites while you browse and even suppresses ads inside of ad-supported applications. Best of all, it's completely free.
>
> Adblock Plus for Android doesn't require root access to your phone to suppress ads, but works best if your device is rooted. If you're rooted, it'll suppress ads over 3G/4G and Wi-Fi with no additional configuration required. If you're not rooted and you're running Ice Cream Sandwich, it'll block ads over Wi-Fi but not 3G/4G. If your device is running Gingerbread or earlier, you'll have to set up Adblock's proxy manually to get it to work. Speaking of proxies, that's how Adblock Plus for Android manages to strip out all of those ads: it routes all of your traffic through their servers, and removes the ads before it gets to your phone.
> 2 votes

# Answer
Although incomplete I have a solution in place that is sufficient for me. I have configured the dnsmasq dns server in my lan to serve 0.0.0.0 as the response to a specified set of advertising hostnames.

The pro is that I have one solution that fixes this for both my tablet and my phone without the need to root either of them. The con is that it only works at home on my wifi.
> 1 votes

# Answer
I like the firewall approach. Recently installed the NoRoot Firewall and by trial and error found that if I block access to l\[ab\]-in-f\[0-9\]{3}\\.1e100\\.net (actually, the app doesn't support regex in addresses), ads don't get through.
> 1 votes

# Answer
I had similar problem before and non of the existing apps could solve my problems, furthermore I cannot root my company phone due policy. Then I realized that you can configure proxy for each and every connection (wifi and 4g) separately. So I installed a squid, configured to block most of the annoying ad sites and deployed in docker. Long story short:

```
docker run -d -p 3128:3128 --name squid-adblock andrassebo/squid-adblock

```

Then configure the proxy on your phone to use the hosting machines IP address and 3128 as port.

If you would like to check details or simply compile your own image, the source code is available on GitHub: source and DockerHub: images
> 1 votes

# Answer
The latest Android Market app (*I have 3.15 which is the first time I've noticed the option*) has an option to allow you to prevent Google or AdMob ads from tracking you and personalizing the ads to your interests. If that's all you want to stop, then it's just a tickbox away.

Open the Market app, press`Menu` scroll down to the **Other Settings** heading where you should see:

> **Google AdMob Ads**: personalize ads based on my interests
>
> Choose whether to personalize ads from Google and AdMob in mobile apps on this device. Learn more

Just remove the tick from that tickbox to:

> **Opt out**
>
> If you opt-out, your device identifier information will not be used by Google for advertising going forward and you will not receive ads based on your interests or inferred demographics.
> 0 votes

# Answer
The answer is: theoretically yes, practically no. Several years passed since the question, but adware got even worse.

Best way to "block ads" is to "get rid of code that produces it". This is very hard to achieve, because this would require to get rid of adware roots, which are related to current world's economical model and entrepreneurship. It's like to rehabitate all people around the world, to react ads very drastically and ultimative: *"either no ad, either no use of android os/devices"*. This could happen through children education, via seeding strong idea, like *"ads is something criminal like porn/theft/deception and speculation/terrorism/narcotics"*... In such way, after several human generations adware would eventually starve, because any "ad-related activity" would refer to organisation which will be considered *"codnucting illegal activity"* and enormous penalty tax should be applied, and person who publish ad jailed.

There exists other, faster way: It is to create a group, who would develop android alternative firmware, essentially same as android, but with licensing terms explicitly disallowing using of ads, and maybe even some banning/firewall engine, embedded into system and easily tunable by users. Good implementation would be very costly, and it would take time to put it on a very single phone. But that would definetely force android community to react.

That is some effective approaches, but any real action should involve Google, which should "change its mind and become white and fluffy" in order to really get rid of adware in android. This is very unlikely to achieve, with current world's economical model.
> -2 votes

---
Tags: ads
---


# Question
Title: How to unhide my review that had been hidden by app developer?
I noticed that one app that is licensed under GPLv3, while the app developer had not been publishing code updates on github for several years already. I decided to write a review on Google Play and stress this issue in it:

Since the review was added, many users upvoted it and app developer was quite angry at me. So he clicked some option, that my review was inappropriate/spam, after which it was hidden and became not seen to other users. Only I can see and edit it now, but visibility does not change.

How can I dispute this? Can I appeal to Google Play support team?

# Answer
Normally, I would be right there with you about getting the code released and would go and fight with you, however they have made some changes, one of which being the licensing.

According to their website, they no longer use the GPL license, which started with version `2.7`. They still have a commercial license available.

> Sources
>
> Until release 2.7, FBReader source code was dual licensed: GPL and commercial. Unfortunately, GPL violations were too regular. Since 2.7 the source code is only available for a fee. Please contact us for information about the commercial license.
>
> The full sources of FBReader 2.6.15 for Android 2.x are available under the GPL from the git repository at GitHub.

If you were to look at the Wikipedia page, which uses a web archive page as the source, it will tell you that they use a GPL and commercial license. That need to be updated to reflect the new information.

Now, as to your review, what the app publishers are doing is correct. You are technically in the wrong. It is misinformation that you are posting and gives bad credit to the owners.
> 1 votes

---
Tags: applications, google-play-store, open-source
---


# Question
Title: Galaxy S6 and S7 not auto-connecting to WiFi
I've had a problem with my phones (Galaxy S6 and S7) not auto-connecting to WiFi. When I open up the WiFi settings it will connect.

Is there any way I can determine if an app is disrupting the ability to auto-connect?

I think it is not the phone because I just got a new S7.

I think it is not the router because this happens with multiple routers.

Thanks very much for your help.

Edit: This is close to being a duplicate of
AT&T Samsung Galaxy S6 will not connect to WiFi automatically and
Galaxy S6 no longer automatically connects to my home WIFI

Edit 2: I have uninstalled a bunch of apps on my S6 and it now auto-connects without issue!

Edit 3: I have uninstalled a bunch of apps on my S7 and it now auto-connects without issue!!

# Answer
> 1 votes
This appears to be a problem with app interference. I have uninstalled a bunch of apps on my phones and they now auto-connect without issue.

I wish I knew which app or apps was the culprit. As I install back some apps that I need maybe I will find out. If I do I will update this answer.

# Answer
> 1 votes
Had the same problem with ATT S7. Spun my wheels trying to figure out. Samsung tech a BestBuy finally fixed it. He said there's a bug with ATT auto connect app. I think it was called something like WiFi Direct.... anyway we removed all ATT apps on the phone that we were allowed to remove. That fixed the issue. Now it connects to all WiFi previously connected to.

# Answer
> 1 votes
I've been having the same problem for a couple months, just finished a chat session with Samsung. I was advised to restart my phone in **SAFE MODE** and then manually delete and re-add my home WIFI network (ORBI mesh). Restarted the phone and tested by walking outside far enough from home to disconnect from WIFI. Upon returning within range, Galaxy S6 reconnected fine! Have only done this one test, will report back if anything changes.

# Answer
> 0 votes
I had exactly this problem with my Galaxy S6 international phone -- no matter what I tried in the system settings, it wasn't resolved. Then I came across this:

https://thedroidguy.com/2018/10/fix-samsung-galaxy-s6-can-no-longer-connect-wi-fi-mobile-data-networks-troubleshooting-guide-1068247#Problem2

Immediately the issue was resolved! Also importantly, I didn't notice any collateral damage / undesired change with clearing the system cache.

Edit: Unfortunately the issue came back for me :( Note though I have an international 920F phone. My search continues...

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


# Question
Title: Accidently renamed system/xbin to system/xbi
So i accidently renamed xbin in /system to xbi. I can't get root anymore because su is stored there and it won't work in xbi. I get a 'Connection to ui timed out' every time i try do './su'. If it helps i'm on a Samsung S4 Mini or a GT-I9195T.

# Answer
Someone will probably want an answer so here are the steps I performed:

I managed to get twrp running on it with odin. (I got odin from odindownload.com, gone to twrp.me/Devices), found my device, grabbed the `.tar` and started odin.

I then clicked the 'AP' button and selected the `.tar` file. I connected the phone and pressed start. Booted into recovery by holding the

`Vol up` \+ `Home` \+ `Power key` buttons.

Finally I hopped in a terminal and finally `cd system;mv xbi xbin`.
> 2 votes

---
Tags: samsung
---


title: old emojis in whatsapp

text:
# Question
Title: old emojis in whatsapp
I have upgraded whatsapp on my phone but i dont like the new emojis on whatsapp so the quesition is : Is this possible to get my old emojis back using whatsapp's latest version apk with apktool debugging?

# Answer
> 1 votes
You can install a WhatsApp mod like GBWhatsApp. Then, activate "Old Emojis style" in settings.

>

# Answer
> 0 votes
You can try downgrading your WhatsApp version, by downloading an older APK.

before you download the apk make sure to uninstall WhatsApp.

After that, download the desired apk from here

You should then be able to go thru the regular registration process in WhatsApp.

To make sure it doesn't automatically update the app, go to the play store, search for 'WhatsApp' in the search bar, press on the WhatsApp icon, then press on the three dots menu on the top right of the screen and deselect 'auto update'

Note: WhatsApp might give you an error telling you to download the latest version. Also note: just because you will now have the older version of emojis, doesn't mean that the recipient will see them in that way. The opposite is also true, if someone sends you an emoji that came with the latest update, chances are, that you will not be able to view them.

**I'm not responsible if anything goes wrong.**

# Answer
> 0 votes
What you want is **not** possible. You want the latest version of the app, but the old emojis. That is impossible for anyone but the developer.

When an app is built, all its components are consolidated into one project. It is not possible for the layman to change any one component of the project. The previous emojis were in one project, while the modified emojis are in another project. You **cannot** just change the emojis and keep the rest at the latest version.

If you are okay with downgrading, then you can try what @Abochur has said, or simply uninstall the updates. Otherwise you'll have to get used to the new emojis.

---
Tags: whatsapp-messenger, emoticons
---


title: YU Yureka stuck in bootloop

text:
# Question
Title: YU Yureka stuck in bootloop
I have a **Yu Yureka plus**.i tried installing twrp and it got into bootloop.fastboot didnt detect my device and i gave to a repair center.after 5 days,they sent back my device saying it cant be repaired.i cant go to fastboot mode nor recovery mode.whatever combination of buttons i press,i goes to a screen which says **Download Failed Images-aboot**ihow can i get back to recovery now.i am blank.please guide.

# Answer
You should use its full fastboot command

```
fastboot -i 0x1ebf devices

```

Or any other command with `fastboot -i 0x1ebf`.

This will definitely work in Yureka.
> 0 votes

---
Tags: boot-loop, unbricking
---


title: Unable to install PyCrypto

text:
# Question
Title: Unable to install PyCrypto
I'm installing PyCrypto because it is a dependency of another package. The installation always ends in an error in Termux (`pip install pycrypto`):

```
Command "/data/data/com.termux/files/usr/bin/python -u -c "import setuptools, tokenize;__file__='/data/data/com.termux/files/usr/tmp/pip-install-ip9yqged/pycrypto/setup.py';f=getattr(tokenize, 'open', open)(__file__);code=f.read().replace('\r\n', '\n');f.close();exec(compile(code, __file__, 'exec'))" install --record /data/data/com.termux/files/usr/tmp/pip-record-_ac102nh/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /data/data/com.termux/files/usr/tmp/pip-install-ip9yqged/pycrypto/

```

The other Python packages have so far installed succesfully.

# Answer
> 1 votes
Try installing a C compiler like Clang provided by Termux:

```
apt install clang

```

---
Tags: termux, python
---


title: Android terminal not able to nslookup?

text:
# Question
Title: Android terminal not able to nslookup?
Every time I try to telnet to a domain on my LG Ally it fails, but it works if I use an IP address. So I tried to use `nslookup telehack.com` and it returns:

```
Server:       0.0.0.0
Address 1:    0.0.0.0

nslookup: can't resolve 'telehack.com'

```

I have Android Terminal Emulator and BusyBox installed,

It wasn't working with the default dns, so now I've got my dns entries set to OpenDNS, and it still won't resolve.

is there anything I can do to resolve this, or is it a limitation on the Ally?

# Answer
This is a known design problem when using statically linked libresolv and glibc.

You have 2 options:

1. Use Google Android's native libc Bionic library instead of glibc.
2. Build busybox to search libraries in `/system/lib` (or make the necessary links e.g. `/usr/lib -> /system/lib` ). Place ld-linux.so.3, libc.so.6, libresolv.so.2, libnss\_dns.so.2 in your `/system/lib`.
> 4 votes

# Answer
enter your terminal, then type 'su' and press enter (note only works if you have a rooted phone)

```
$ su
#

```

then enter the following (replace x.x.x.x with your dns servers ip)

```
# echo 'nameserver x.x.x.x' > /system/etc/resolv.conf
# echo 'nameserver x.x.x.x' >> /system/etc/resolv.conf
# exit

```

Now test to see if it worked correctly

```
$ nslookup google.com

```

It should resolve now.
> 2 votes

# Answer
Check that your terminal emulator environment has DNS set correctly by running `getprop net.dns1` and if necessary set it with `setprop net.dns1 [yourdns]`. The commands may differ by device, some use `net.eth0.dns1` or `net.gprs.dns1`, run `getprop` without parameters to see all set properties for hints.
> 1 votes

# Answer
I've copied (and slightly changed) my answer from a comment I posted on an issue on the Google code page for Terminal IDE, however, it should be the same:

If you are rooted, you can install the latest version of busybox (you may be able to compile it). Then find out where you updated busybox is and run the following commands: (I'm assuming the new version is in `/system/bin` and the old version is in `~/system/bin`)

```
PATH=/system/bin:$PATH
cd ~/system/bin
mv busybox busybox.old
ln -s /system/bin/busybox busybox

```

Now domains will be resolved properly.

Please note: due to the way busybox works, you have to be root to be able to use `ping` (although things like `wget` and `nslookup` should be able to resolve hosts properly now). The busybox developers are working on this issue.

I personally used this application to install the latest version: https://play.google.com/store/apps/details?id=stericson.busybox
> 1 votes

# Answer
Which network are you using? If it's Wifi, can other machines on your network contact it? If it's carrier data plan...is it being blocked?

Update: 0.0.0.0 seems like a hosts file block to me. Any ad blockers? Adblock plus? Hosts file modifications?

Try USB networking - if you post a comment here asking for it i'll update the question & put in a tutorial (it's involved, and I only know how to do it on GNU/Linux machines)
> 0 votes

# Answer
I use this in android from adb. Maybe there are better ways.

```
ip=$(ping -c 1 -W 1 example.com|grep PING|cut -d "(" -f 2|cut -d ")" -f 1)

```
> 0 votes

---
Tags: terminal, dns
---


# Question
Title: Google Now Launcher still exists inside launcher settings
I have used Google Now Launcher on my Redmi 1S that runs Lineage OS 14.1. And, now I am using Nova Launcher as home app(launcher). I have uninstalled Google Now Launcher, and also, its not present in app list. But, it is still listed in launcher settings (Settings-\>Apps-\>Configure Apps (settings icon)-\>Home App). I have tried to clear cache from recovery, but have no result. I have uninstalled Nova launcher, but still it shows Google Now launcher, and Trebuchet to set as Home App. May be it got saved somewhere permanently, otherwise I have tried to make Google Now launcher as system app, it may be happened due to this. How to solve

# Answer
> 0 votes
I installed Google now launcher from play store. And the default launcher is Trebuchet which is similar to that of Google now launcher.

The device is rooted, and I tried to make Google now launcher as a system app. For, that I changed permissions of app using ES file explorer.

This may got saved, and that's why it not removed from default app list.

I performed a fresh install of lineage os which solved from this issue.

# Answer
> 0 votes
Did you install Google Now Launcher as part of a Google Apps package? If this is the case, Google Now Launcher will be installed as a /system app. Therefore, you'll have to remove it manually using a file manager or recovery mode.

---
Tags: launcher, lineageos, redmi-1s
---


# Question
Title: bind mount / symlink - keep destination "tree" on removal of source?
I'm trying to accomplish something fairly odd, so bear with me.

I've added an external SD card to my old Droid Mini (basically just for an experiment to see whether or not I could expand the storage capability). It's currently running Lineage OS 13.

The issue is that the external SD adapter is very power hungry, and the kernel on this version (3.4.42) doesn't properly support autosuspend.

I can force the device into low power mode by unbinding the SCSI device from the USB device, but obviously it disappears if I do that.

I read that bind mounts *can* preserve the directory structure of the source folder even if it is removed, but I can't seem to get that to work (see here \- *"It is possible to unmount /some/where, in which case /else/where remains mounted."*)

The idea is to wait until the USB device goes idle, then manually suspend it by unbinding it until it is needed again. However, if I unbind the device, the "stat" file I'm using to monitor idleness ALSO disappears, do I can't use that to check if activity is requested.

So my (maybe silly) idea was to make bind mount of the external card to a "virtual" USB device which doesn't disappear when the source is removed, and re-attaches it when it's needed.

Baby steps though, any ideas how I might go about preserving a "fake" drive for the system to operate through? Bind-mounts don't seem to do *quite* the right thing here.

Thanks, R

# Answer
> 0 votes
That sounds really crazy...

At first glance, I have a guess that while you can unmount the source directory of a bind mount, **you must keep the underlying device attached** for a bind mount to work.

I confirmed my guess in experiments on my OnePlus 6 (Android Linux 4.9.65) and my Ubuntu 18.04 (real Linux 4.15.0) and the result is same.

On Ubuntu, I inserted a USB flash drive (ext4 filesystem) and mounted it to `/mnt/usb`, and I bind mounted `/mnt/usb/data` to `/mnt/bind`

* I unmounted `/mnt/usb` while keeping the flash drive attached, and I can access `/mnt/bind` with no error. All changes to `/mnt/bind` reflected to `<drive root>/data` (verified later).
* Then I detached the flash drive and attempted to access `/mnt/bind`, and got this message:

```
ls: reading directory '/mnt/bind': Input/output error

```

On my OnePlus 6, I inserted a USB flash drive via OTG (exFAT filesystem). I mounted the device `/dev/block/vold/public:8:97` to `/data/dev`, and bind-mounted `/data/dev/Android` to `/data/bind`.

* I unmounted `/data/dev` while keeping the OTG attached, and all the data remains in `/data/bind` and is accessible without errors.
* Then I turned off "OTG function" in the Settings app, the Android mount point `/mnt/media_rw/xxxx-xxxx` disappeared, but I can still access my bind mount.
* Next I detached the OTG drive and attempted to access `/data/bind` and got this:

```
ls: reading directory `/data/bind`: I/O error

```

A side note is, unlike Ubuntu, access to `/data/bind` remained available for around half a minute, but directories that I didn't previously visited weren't accessible anymore, only the directories that I visited before detaching the drive was still accessible.

That's it. The conclusion is in the top paragraph.

---
Tags: lineageos, kernel, usb-drivers, usb-storage
---


title: Linux Deploy ext4 and Adoptable Storage

text:
# Question
Title: Linux Deploy ext4 and Adoptable Storage
**Edit:**

I created an issue in the Linux Deploy project.

---

I have a smartphone with the following settings:

And the following SD:

Ok, it's not a good SD, but that's what I have for today...

I was using SD as an extension to internal storage, and I was able to store applications and files there normally.

I would like to use Kali Linux through Linux Deploy (if there is no other way), but the system can only have a maximum of 4GB per account of the created *.img* file and the format of the card, which is very little in my opinion.

So I tried to follow this tutorial for an installation with more space for the operating system.

I created a three partitions:

* Fat32 to continue using on my smartphone as before (with less space of course);
* An additional swap...
* And an ext4 for the operating system installation.

I've ejected the ext4 partition to install Kali Linux. And everything worked perfectly!

Well... Almost everything!

Kali Linux was working just the way I wanted it, but when I tried to use my smartphone as before, I realized that I could no longer transfer my applications to the fat32 partition I created for it.

The option to transfer applications to SD is no longer displayed.

I tried to transform part of SD as Adoptable Storage again but do it directly from the smartphone, formatting all the storage, undoing all created partitions.

I then followed this answer (both with `adb`, and with Root Essentials). Which again undid my partitions. But I re-did it again following the following steps:

1. Format everything and use 50% for Adoptable Storage (by `adb` or Root Essentials).
2. Remove the SD from the smartphone and insert it into the computer to create the other partitions (ext4) with MiniTool because Android Partition Tool (AParted) was not able to do this.

Ok, now I can transfer my applications to SD, and I also have the ext4 partition for installing Kali Linux, but now Linux Deploy can not see this partition mounted or ejected by Android.

**Monted:**

```
[12:36:31] >>> status
[12:36:32] Device: MotoG3
[12:36:32] Android: 7.1.2
[12:36:32] Architecture: armv7l
[12:36:32] Kernel: 3.10.49-MPI24.241-2.35-1-g4023d70
[12:36:32] Memory: 38/898 MB
[12:36:32] Swap: 273/511 MB
[12:36:32] SELinux: yes
[12:36:32] Loop devices: yes
[12:36:32] Support binfmt_misc: no
[12:36:32] Supported FS: ext2 ext3 ext4 f2fs fuseblk vfat
[12:36:32] Installed system: unknown
[12:36:32] Status of components:
[12:36:32] :: extra/dbus ... stopped
[12:36:32] :: extra/ssh ... stopped
[12:36:32] :: graphics/vnc ... stopped
[12:36:32] Mounted parts:
[12:36:32]  ...nothing mounted
[12:36:32] Available mount points:
[12:36:33] * /system  0.9/2.2 GB (ext4)
[12:36:33] * /data  4.5/11.8 GB (f2fs)
[12:36:33] * /cache  0.2/0.2 GB (ext4)
[12:36:33] * /fsg  0.0/0.0 GB (ext4)
[12:36:33] * /firmware  0.0/0.0 GB (ext4)
[12:36:33] * /persist  0.0/0.0 GB (ext4)
[12:36:33] * /mnt/runtime/default/emulated  4.5/11.8 GB (sdcardfs)
[12:36:33] * /storage/emulated  4.5/11.8 GB (sdcardfs)
[12:36:33] * /mnt/runtime/read/emulated  4.5/11.8 GB (sdcardfs)
[12:36:33] * /mnt/runtime/write/emulated  4.5/11.8 GB (sdcardfs)
[12:36:33] * /mnt/media_rw/f86f8583-23fb-d201-f063-858323fbd201  13.0/13.7 GB (ext4)
[12:36:33] * /mnt/runtime/default/f86f8583-23fb-d201-f063-858323fbd201  13.0/13.7 GB (sdcardfs)
[12:36:33] * /storage/f86f8583-23fb-d201-f063-858323fbd201  13.0/13.7 GB (sdcardfs)
[12:36:33] * /mnt/runtime/read/f86f8583-23fb-d201-f063-858323fbd201  13.0/13.7 GB (sdcardfs)
[12:36:33] * /mnt/runtime/write/f86f8583-23fb-d201-f063-858323fbd201  13.0/13.7 GB (sdcardfs)
[12:36:33] * /mnt/expand/bd43c04c-2500-40bd-9325-1de5ae577eb6  14.2/14.8 GB (f2fs)
[12:36:33] Available partitions:
[12:36:34]  ...no available partitions
[12:36:34] <<< status

```

**Ejected:**

```
[12:39:49] >>> status
[12:39:49] Device: MotoG3
[12:39:49] Android: 7.1.2
[12:39:49] Architecture: armv7l
[12:39:49] Kernel: 3.10.49-MPI24.241-2.35-1-g4023d70
[12:39:49] Memory: 42/898 MB
[12:39:49] Swap: 216/511 MB
[12:39:49] SELinux: yes
[12:39:49] Loop devices: yes
[12:39:49] Support binfmt_misc: no
[12:39:49] Supported FS: ext2 ext3 ext4 f2fs fuseblk vfat
[12:39:49] Installed system: unknown
[12:39:49] Status of components:
[12:39:49] :: extra/dbus ... stopped
[12:39:49] :: extra/ssh ... stopped
[12:39:49] :: graphics/vnc ... stopped
[12:39:49] Mounted parts:
[12:39:49]  ...nothing mounted
[12:39:49] Available mount points:
[12:39:49] * /system  0.9/2.2 GB (ext4)
[12:39:49] * /data  4.5/11.8 GB (f2fs)
[12:39:50] * /cache  0.2/0.2 GB (ext4)
[12:39:50] * /fsg  0.0/0.0 GB (ext4)
[12:39:50] * /firmware  0.0/0.0 GB (ext4)
[12:39:50] * /persist  0.0/0.0 GB (ext4)
[12:39:50] * /mnt/runtime/default/emulated  4.5/11.8 GB (sdcardfs)
[12:39:50] * /storage/emulated  4.5/11.8 GB (sdcardfs)
[12:39:50] * /mnt/runtime/read/emulated  4.5/11.8 GB (sdcardfs)
[12:39:50] * /mnt/runtime/write/emulated  4.5/11.8 GB (sdcardfs)
[12:39:50] * /mnt/expand/bd43c04c-2500-40bd-9325-1de5ae577eb6  14.2/14.8 GB (f2fs)
[12:39:50] Available partitions:
[12:39:50]  ...no available partitions
[12:39:50] <<< status

```

> Is it possible to do what I'm trying? Use half the SD as Adoptable Storage and the rest as ext4 to install Kali Linux? Am I forgetting to set something up?

# Answer
> 1 votes
Here how I'get 16gb on Linux deploy hope this help somebody:

1. Use twrp, advanced, make partition ext4 swap 0 (https://www.xda-developers.com/how-to-install-twrp/)
2. Use the Linux deploy terminal, configuration, check telnet, port, local host and http
3. Go to configuration again and select terminal, on terminal, put the command, `ls /dev/block`
4. Identify your ext4 partition, in my case `/dev/block/mmcblk0p2`
5. In Linux deploy, propierties, select your os and proper settings, in instalation type use partition, instalation rute use the One on the point 4, file system ext4, The other settings at your decide
6. Install
7. enjoy

---
Tags: linux, adoptable-storage, ext4
---


# Question
Title: Can YouTube videos be downloaded with subtitles for offline viewing using the app?
I noticed that when I download a video in the YouTube app for offline viewing, subtitles are not included.

What do I need to do so that I can see subtitles while viewing a video offline?

# Answer
With youtube-dl you can download all available subtitles from video. More details you can find here.
> 1 votes

# Answer
Try the 'TubeMate' app. I personally like it very much as when I copy the link of any video from my YouTube app, it automatically detects it and shows a icon, by clicking on which you can directly reach the TubeMate app. If the video has subtitles, it will automatically download it, and also the download speed is very good.
> 1 votes

# Answer
If you have YouTube Premium, start watching the video you want to download and turn on captions. Now when you start the download it should also download the subtitles.
> 0 votes

---
Tags: youtube
---


# Question
Title: Problems with Internet via home WiFi, mobile data and other WiFis work fine
I'm having various problems with two Android phones in my home WiFi: from time to time, the phones

* can't connect to the WiFi at all (despite stored credentials) -- happens only rarely
* can connect, but get no Internet access via the WiFi (e.g. right now I'm getting `DNS_PROBE_FINISHED_NO_INTERNET`, but the another time it might be a different one) -- happens more often (say once every two weeks)
* can connect and get Internet access, but with a big lag (DNS lookups and/or establishing connections is very slow, once connected the bandwidth is fine) -- *happens always*

At the same time, the phones work fine with mobile data and other WiFis. Similarly, the home WiFi works well with our laptops. It seems that there is something problematic in the specific combination of these specific phones and that specific WiFi.

Workarounds that I've tried and that sometimes (but not always) work:

* Disconnecting and reconnecting to the WiFi
* Disabling and re-enabling the WiFi on the phones
* Rebooting the phone
* Removing the stored credentials for the WiFi from the phones
* Resetting the WiFi access point

One of the phones is an Lenovo C2 (K10a40) running Android 6.0, the other one is a Samsung S4 mini Gt-i9195 also running Android 6.0.

The WiFi access point is a TP-Link TL-WR841N/ND v9 running OpenWrt/LEDE Reboot 17.01.4. The WiFi is using WPA2 PSK encryption and automatic channel selection.

I've checked other similar threads on android.SE, but none of them suggest anything that I haven't already tried.

**What are possible reasons and solutions for these problems?**

# Answer
Please check what type of wifi your router broadcasts. If it broadcasts both 2.5Ghz and 5Ghz your phone may discover the 5Ghz network, try to connect to it but then has no "power" to stay on that type of network and falls. So make sure your device is connecting to the 2.5Ghz network.
> 0 votes

---
Tags: wi-fi, internet
---


# Question
Title: How do I turn off the "suggested news" stories on Chrome's homepage in v70?
Chrome 70 - homepage now showing "suggested news" stories and is sucking up data and is slow. The flags solution is now gone in Chrome 70. How do I get rid of this stupid news feed?

# Answer
Flags solution works but with a different flag

* `Chrome://flags`
* Disable `enable-ntp-remote-suggestions`

(Click to enlarge)
> 3 votes

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


# Question
Title: Bluetooth signal strength bug with my car's stereo
i have problem with xiaomi mi a1 and bluetooth radio of ford fiesta car.

I connected an Android phone to a vehicle via bluetooth to make/receive calls.

Connecting the device via bluetooth was simple. Making calls, however, was a challenge. The vehicle reports that the Android phone is always without cell reception, and therefore will not place calls. Furthermore, the vehicle's head unit (aka receiver) shows a "no reception" indicator for the Android device's cell reception.

Placing calls from the Android device through the vehicle's audio system works as expected. This also shows that the Android device has ample cell reception to make calls.

with the bt hci log i see that:

when phone connects bt to radio, the phone sends this info:

+CIND: 0,0,1,3,0,4,0

legend +CIND:("call",(0,1)),("callsetup",(0-3)),("service",(0,1)),("signal",(0-5)),("roam",(0,1)),("battchg",(0-5)),("callheld",(0-2))

when the signal strength on the radio disappears and reset all (zero) the phone send this info:

+CIEV: 3,0 +CIEV: 4,0

3 = service, 0 = no service (previously was 1) 4 = signal, 0 = no signal (previously was 3)

but the phone in realty upgrade the signal strength from 3 to 4!!!!!

# Answer
At first sight the source of the problem in your log is `mIsSimStateLoaded=false`.
The true value of the service indicator (1, available) is logged, but because of this SIM state equal to false `HeadsetService` sends 0 (not available) instead of 1.
The true value of the signal indicator is unknown, because of service=0 HeadsetService sends 0 instead of the true signal level indicator (this temporary 0 value is logged, in fact it is not mSignal value).
Possibly Android `HeadsetService` contains an error with mIsSimStateLoaded flag processing, because it can be cleared on every phone service loss, but set only on `ICC_LOADED` broadcast. If so it is strange because a lot of Android phones shoud have the similar problem.
Have you tried to reboot the smartphone before connecting to headunit?
Upd: Hmm, this SIM broadcast is sticky, than maybe this is bug by Xiaomi, not Android.
> 0 votes

---
Tags: bluetooth, network-signal
---


title: Can't delete file in download folder

text:
# Question
Title: Can't delete file in download folder
A few days ago, I downloaded a file of 1.9gb to my phone using the utorrent app. Utorrent downloaded the file automatically to my internal storage, and since I only had 2 gigs of free space, the download did stop after a while. when I saw it I deleted some files, and the download went on. When the download was finished, I decided to take a look in my folder but the folder which *did* have the name of the file that I downloaded was empty. So I checked my internal storage, but it was almost full, so the file must be somewhere on my device.

Furthermore can't I delete that empty folder. By the way: my phone (Samsung Galaxy S4) is not rooted.

How can I find that file, and how can I delete that folder?

# Answer
> 1 votes
Thanks everyone especially you geffcheng! I finally found a way to delete the file. I thought that it might work if I downloaded the same file on my pc, and then transfered it to the same folder(downloads) on the internal storage on my phone. I thought that my pc would ask if I wanted to overwrite the existing folder, but my pc didn't and I had 2 exactly the same folders in my download folder. Then I turned on the SDmaid app on my phone(while it was still plugged in my pc), and I deleated the whole download folder. It actually worked!!

So thanks again to everyone who helped!

P.S. I'm sorry if you could't understand everything. I'm Dutch;)

# Answer
> 2 votes
You could try SD Maid, and see if it can find the file. It has a feature that lets you search for the BIGGEST files. If that file was cached somewhere before it was put into the correct folder, chances are SD Maid might be able to find it.

I can't remember though if you need the Pro version to use the feature, but do check it out.

# Answer
> 0 votes
You could try using File Manager (Rhythm Software) to find and delete it.

# Answer
> 0 votes
Go into to your settings on android. Then to storage, then wait for it to load phone file. Then tap on it. Then, used space, then, select audio or whatever file you are looking for, but for this question select audio...You will then see different folders there. Tap on each until you find what you are looking for. Press and hold one file then from there to delete more files after holding down one file the trash can comes up then you can select each folder from there then tap trash can. All done

---
Tags: internal-storage, samsung, downloading
---


# Question
Title: Is there a way (not date) to number photos sequentially.
My regular digital camera assigns numbers sequentially. My Android 8.0 Galaxy S8+, after the date, assigns random numbers to each picture. If copied to a computer the pics all become "created" at the same time. I'd like them numbered in the sequence taken. Samsung says it's a logarithm naming matter and what I want "can't be done". I don't believe that. It's a computer. Why wouldn't it be able to do it?

# Answer
To my knowledge, all digital cameras follow the Design rule for Camera File system (DCF), a Japan Electronics and Information Technology Industries Association JEITA standard (CP-3461B) for digital cameras. This is why your digital camera sequences the photos.

Phones do not necessarily have to follow this standard, since they are not just digital cameras. Phone storage still used the DCIM folder to give a standardized placement for photos, but this does not mean that they photo file names will follow the standard.

As far as phones storing photo with sequential numbers, yes, it is possible that they could do that. It would mean changing how the file names are generated to use a sequencing number instead of the randomly generated number or, in my case with the S9, the use of the time in military format for the second half.
> 1 votes

---
Tags: stock-android, photos
---


title: Android device ID while unrooting phone

text:
# Question
Title: Android device ID while unrooting phone
If I perform below steps,

1. I root Android phone,
2. From third party apps available on Play Store, I change 16 digit Android device id(Let say from **aaaaaaaaaaaaaaaaa** to **bbbbbbbbbbbbbbbb**)
3. And then again unroot the phonne.

Will unrooting the phone also change Android device id again or it will remain bbbbbbbbbbbbbbbb only?

Thanks in advance.

# Answer
Unrooting your phone doesn't reverse the changes you made to `/system`. These changes are reversed only when you flash a stock / custom ROM. Of course, apps that you had installed earlier which had root privileges will not work

To sum up, your changed ID will remain till the next factory reset
> 1 votes

# Answer
First of all, tweaking that 16 digit Android ID doesn't require root access. You can change that ID using ADB alone. Since Android 5.0, this should work just fine.

```
adb shell settings get secure android_id                   # returns the current Android ID
adb shell settings put secure android_id YOUR-16-DIGIT-ID  # to change the ID with your new 16 digit ID

```

The Android ID is stored inside data partition. It is set on first boot after factory reset and remains until you factory reset again. It has got nothing to do with rooting and unrooting your device. So, if you changed that ID using some app and unrooted your phone later, that ID would persist until factory reset.

**Note**: since Android 8.0 each app sees android\_id which is unique to that app. It is not the same android\_id that you would see from settings command. See relevant documentation for more info on this.
> 4 votes

---
Tags: applications, rooting, unrooting
---


# Question
Title: Huawei backup not offering location "Internal storage"
I want do backup a Huawei P20 lite using its own "Backup" app. But it does not offer "Internal storage" as a backup location, even if it supports that, according to documentation here: PHONE BACKUP AND RESTORE GUIDE (see second screenshot there)

There is 44 GB of internal storage free (of 64GB total).

What is wrong?

I want to do a backup in the most hassle free way possible. There is no SD card at hand and have the slot used for the second SIM anyway.

# Answer
> 0 votes
I can confirm that the option to backup to internal storage is not available on the recent Huawei Backup application version 8.02.xxx.

You can still install the older versions of the application available on APKmirror (versions 7.0.xxx) if you want to back up on internal storage:

<sup> online image </sup>

---
Tags: backup, huawei
---


# Question
Title: How to prevent systemless Xposed Framework from crashing Play Store?
I'm using systemless Xposed Framework module (v90.2 beta 3) of Magisk Framework (v17.1) on a rooted OnePlus 6 running OxygenOS v5.1.8 (Android 8.1.0).

I'm having an issue with Xposed Framework and Play Store. Play Store crashes whenever I try to browse for an app, or install, or update an app. This problem has affected others users as well with no solution from rovo89 or topjohnwu as of yet.

I tried to identify the issue in logcat, just like the user here but miserably failed to understand what caused the crash.

The issue goes away so long as I keep disabled Xposed Framework from Xposed installer or from Magisk Manager.

How do I fix this problem?

# Answer
> 2 votes
The developer of GravityBox Xposed modules, C3C0, suggested to use official and original Xposed Framework (flashes system partition and breaks Safety Net). They confirmed it working alongside Play Store, but on Android 8.0 though.

Alternatively, one can try Aurora Store from F-Droid, as an alternative to Play Store and as an interim solution. It fetches apps' updates and new apps directly from Play Store. It also provides sufficient information regarding the app to be installed, such as What's new, permissions, and so on.

---
Tags: xposed-framework, 8.1-oreo, magisk
---


# Question
Title: Is possible to open and display both front and back cameras simultaneously?
Does anyone know if it is possible to open and display both front and back cameras simultaneously? Any suggestions or references will be appreciated

# Answer
Please refer to these two answers https://stackoverflow.com/questions/30377081/access-both-back-and-front-cameras-simultaneously and https://stackoverflow.com/questions/51227768/how-to-save-front-and-back-camera-footage-in-the-same-file-after-being-recorded

According to the first answer, most often the android phone do not have enough hardware resources to have both camera working at the same time.

However, this is quite old answer and these days phones come with much better hardware support. You can try opening front camera while the rear camera is in action.

Hope this helps.
> 1 votes

---
Tags: camera
---


# Question
Title: Is it possible to use the Android Hardware without using android APIs?
I've always liked cheap smartphones ($ 50) because with little money I can have a powerful system with lots of sensors and things like that. So I wondered if it was possible to use the hardware without using the very limited android APIs, programming it at a low level then, of course with the root. In particular I wanted to see how the LTE module worked and experiment with this having full control, the Android API does not allow it to do much.

# Answer
> 0 votes
You can try using NDK. It gives more access to android hardware.

Please refer

https://stackoverflow.com/questions/53134098/hardware-access

---
Tags: root-access, hardware, development
---


# Question
Title: synch the contacts on my Android with the current contacts on Google Contacts
I have recently changed number, but kept the same device (Sony Xperia XA1). With the previous number, I saved my contacts in Google Contacts.

Before I changed the sim on my device, I erased some contacts from Google Contacts. I formatted the phone and reinstalled applications, logged in with the same google account.

Those "unwanted" contacts are still there. Even though I erased them from Google Contacts website (and I checked the website, they are no longer there).

I tried to log off that google account and in again, because I thought it was a matter of synch. But nothing changed.

So my question is, how to synch the contacts on my Android with ***just*** the current contacts on Google Contacts?

# Answer
> 0 votes
1. Log out from your google account.
2. Delete all contacts - make sure all contacts are deleted from all sources.
3. Log in to your google account

There is a auto - backup and restore option (Find more here). There is possibility that your device may restore the contacts that were deleted just before the formatting.

---
Tags: contacts, sync, sony-xperia, google-contacts
---


# Question
Title: How can I play audio over an open phone conversation?
I would like to be able to play an audio recording over an open phone conversation. I.e., while the phone is connected (an outgoing call) a prerecorded audio file is played over the open phone connection. How can I do this?

# Answer
No, the best that you would be able to accomplish is playing a sound through the speaker so the microphone can pick it up. There are no api's that can accomplish that.
> 5 votes

# Answer
@jim, Try using AudioTrack API in Stream mode. see below code snippet

```
            AudioTrack track = new AudioTrack(AudioManager.STREAM_VOICE_CALL, mySampleRate,
            AudioFormat.CHANNEL_CONFIGURATION_MONO, AudioFormat.ENCODING_PCM_16BIT,
            myBuffersize, AudioTrack.MODE_STREAM);

```

This should work
> 3 votes

# Answer
When i need to play something recorded over the phone, i usually turn on the phone speaker and press up the volume to max. Then people on the other end can hear it, but it works best on HD voice carriers (the audio sounds much better on the other end) :)
> 2 votes

# Answer
If you have a phone or secondary device that you can play the audio file on and both devices have auxillary ports, simply buy a cheap aux cable, cut it open, and plug both wires in the other way, so the phone thinks that the other device is a microphone. This works better that simply playing it through a speaker because there is much more clarity and no background noise.
> 2 votes

# Answer
As per my experience, you can play your recorded audio in a music player app. Though the app stops playing when phone is connected, for most music apps, if you **restart playback**, it continues to play.

If you want the audio to be played automatically, may be you can use voicemail.
> 0 votes

---
Tags: audio, calls
---


# Question
Title: How do I activate Google Translate in Chrome?
When I go on a page that's totally in a foreign language the "do you want to translate" option comes up but how do I make Chrome translate a page that has 90% English and a few lines in another language. Is there a button I can install or something because the Google Translate thing doesn't come up when only a few sentences are in another language.

OS: 4.1 S3

# Answer
Go to `chrome://flags/#translate-android-manual-trigger` (copy paste into your browser) and enable this feature. After relaunch, you'll see the new "translate" option in the menu.
> 5 votes

# Answer
With the latest Google Translate update, you can **Enable Tap to Translate** feature in Google Translate **Settings**.

In chrome, long press the text you want to translate and choose **copy**. A google translate icon will appear in the window and you just tap it to see the translation. In this way, you no need to switch between two apps :)
> 4 votes

# Answer
In my device（nexus 5） I have Google translate and chrome. if i want translate words→long press →share→translate them. you can try it. :)

ps: Forgot my poor English.
> 3 votes

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


# Question
Title: Change week day names on specific locale
Where Android stores strings like week day names, months, etc for each locale? I dug into SettingsUI, framework-res, but didn't find anything related into res/values/arrays.xml or strings.xml. Could it be into the linked odex file? I'm using a modified by me LG stock Rom KK 4.4 on a G2

# Answer
> 0 votes
Found /system/usr/icu/icudt51l.dat http://site.icu-project.org Need to tamper with that file

---
Tags: settings, locale
---


# Question
Title: How to "safely" root a Motorola XT320 (running Android 2.3.6 / Gingerbread) without loosing data?
Related to this question: How to extract calendar data from the stock calendar app of Android Gingerbread (2.3.6) without a Google account?

How can I "safely" root a Motorola XT320 phone running Android 2.3.6 / Gingerbread? It is my intent to do this without loosing any data. Through root privileges, I hope to gain access to certain data on the phone (a local calendar) which I want to backup.

I have to admit I am new to this field. As far as I can tell, the most recommended app for this purpose appears to be KINGO ROOT. Unfortunately, my phone is not on the compatibility list. If I understand the matter correctly, this rules out a relatively "safe", mostly non-invasive exploit-based root approach and only leaves flashing certain parts of the ROM as an option. The latter should only be done **after** a backup of all essential data has been made ...

Because this phone and its OS are rather old, I was wondering whether anybody around here has any (past) experience that could help me.

# Answer
> 0 votes
There are a few options. But you need to be cautious and do a little bit research before choosing one.

Step 1. Back up all your data to pc or sd card (if sd card then better remove it after backup is complete). For pc you can use tools like moboginey pc suit.

Next you can use one click root functionality of mobogine. Or try following guidelines here - https://www.oneclickroot.com/root/motorola-xt320-tnbst\_4\_07-23-15rps-2-3-6/

---
Tags: rooting, root-access, 2.3-gingerbread, motorola
---


title: WhatsApp Android: Auto move images

text:
# Question
Title: WhatsApp Android: Auto move images
Is there any way to automatically move images from different person to different folders?

# Answer
No. But WhatsApp does manage images for you. You can see all images posted in a particular chat by clicking on the Name of the group or person.
> 0 votes

---
Tags: whatsapp-messenger, images
---


# Question
Title: How to disable all notifications from the lock screen
Can anyone kindly tell me how to disable notifications from appearing on the lock screen? I have tried going to settings and then notifications but it just gives me a list of all apps, and I would like to disable them all.

Thanks.

# Answer
> 3 votes
In settings -\> Notifications we see all apps list. On same screen there is a gear icon or advanced menu which will launch advanced notification settings. From options select 'On the lock screen' and select don't show notifications at all.

You can also search 'lock screen' in settings to easily find it.

If this doesn't work then edit and mention your handset model in the question.

---
Tags: notifications, lock-screens
---


# Question
Title: System language resetting to SIM language after reboot
I recently got a new phone, a Landvo XM100 Plus. It sometimes reboots randomly which doesn't bother me much, but what's annoying is that it keeps setting the system language to German.

I did not have these issues on my old phone (Samsung Galaxy S3), and I don't have the problem when there is no SIM Card inserted. However, I'm using the same SIM that I used in my old phone, so I'm really confused as to what is going on.

I tried googling the issue and I ended up at a few different boards with everyone basically scratching their heads.

Could it be the custom ROM the manufacturer uses? I don't quite want to flash my phone with a different OS right now since I still got a warranty.

Any ideas?

# Answer
> 1 votes
I disabled secure start up. I guess secure start up uses the default keyboard (instead of SwiftKey that I normally uses) and that the language of the default keyboard depends on the sim card.

(Click to enlarge)

I am using a cubot power (cheap Chinese crap) with a Thai and a Danish sim card. Before the fix, the language changed to Danish every time I rebooted

# Answer
> 0 votes
For my device it stopped reverting the language settings after I ticked 'Keypad' in Settings -\> Wake-Up Sources, not sure if you have that option depends on android OS version probably.

# Answer
> -1 votes
I just went and got a new sim and it fixed the problem

---
Tags: reboot, languages
---


title: Are all Magisk Modules Open Source?

text:
# Question
Title: Are all Magisk Modules Open Source?
I noticed the main place to download modules is here

https://github.com/Magisk-Modules-Repo

some in the links section link the source which just loops back to the same page. So are all the modules hosted on github itself open source? as i see what looks like the contents of each module there.

I suppose some modules might be posted on XDA that aren't on github and i know not all Xposed modules on Xda or repo.xposed.info aren't open source.

Appreciate all help.

# Answer
Github does not equal open source. Because a Magisk module is on Github it does not mean it is open source

You can have both open and closed projects hosted on Github and Magisk is no exception as you can see from this XDA post by Magisk developer (though instructions pertaining to Magisk are outdated)

There are projects hosted on Github with a portion of the code which is closed source and is offered as paid or pro version, for example code of FairEmail is available on Github but the pro version features are not open source. Though I am not aware of any such Magisk module with pro component

Though this SO question is old, it gives pointers to better understand
> 1 votes

# Answer
I asked somewhere else. The response was.

If the Module has a LICENCE file listed in the github listing it's open source.

Magisk modules generally have their code publicly available (if it's not on GitHub you can just open the zip and read the code). There might be included binaries and apps that don't have the code available, of course.

Don't mistake publicly available code for open source. It's not the same thing... A Magisk module doesn't have to be open source for you to be able to see what it does.
> 0 votes

---
Tags: root-access, xposed-framework, magisk
---


# Question
Title: Gboard: Is there anyway to switch language by swiping spacebar?
I have two languages on Gboard and when I want to switch between them, I have to press the globe button. Is there anyway to switch language by swiping spacebar? I've seen this feature on Samsung Keyboard and I was wondering if it's available on the new Gboard.

# Answer
> 6 votes
There is no as such settings that enables you the Language switch on the basis of swiping Spacebar.

But there are two options you can set in the settings.

**1. Enables the Switch Language Key:-** It enables you with the same features like swipe to change the language, on Clicking on this Globe Switch key your language will get automatically switched based on their preferences in the `Settings`.
if you have to do more with the language then this is the best option.

**2. By clicking on Spacebar:-**
if you have disabled the Language Switch in `Settings`. then you can get the language Popup by clicking on the `Spacebar`.

# Answer
> 0 votes
I had the same issue. Once you set up the Gboard, un your input settings , select Gboard as your preferred keyboard and save. Go in messages or WhatsApp or browser wherever you need to type and make your Gboard appear. Long press the comma at the left of the space bar,you'll have the option to get into settings of Gboard, where it proposes you to select the language. Set off "use system language" and select as many languages desired. You'll be then good to go and will be able to switch between selected languages through long press on space bar.

# Answer
> -1 votes
Swiping the spacebar is available in Hacker's keyboard.

---
Tags: languages, gboard
---


# Question
Title: Relationship between CPU Usage and Battery Usage
I'm comparing the resource consumption of two Android Apps.

* App A uses accelerometer
* App B uses both accelerometer and gyroscope

After reading these sensors, these apps does some processing on the sensor values. Now I measured their CPU usage using dumpsys cpuinfo as well as top command. In general, App B uses 3-4 times more CPU than App A. The actual numbers are as follows: These results for single CPU and my phone is using Dual-core 1.2 GHz Cortex-A9 CPU (Samsung Galaxy S2).

```
App A (Average CPU Usage: 5%)
APP B (Average CPU Usage = 20%)

```

Then I measured the percentage battery usage for these two apps. I kept the Android phone in Aeroplane mode and only one of these two apps were running at a a specific moment of time. After running them for one hour, I get the following results:

```
Remaining battery level after one hour of use:
Idle mode: 99%
Running App A: 96%
Running App B: 93%

```

I was expecting the same ratio with these battery level as I observed with CPU Usage. I also tested these apps on a smartwatch ( CPU: Quad-core 1.2 GHz Cortex-A7) and I observed even smaller difference between the battery use. The observed results for one hour use are as follows:

```
Remaining battery level after one hour of use:
Idle mode: 99%
Running App A: 87%
Running App B: 85%

```

So my question: Why the ratio of CPU usage for these apps is not reflected in their remaining battery levels? Or Shouldn't the CPU Usage be linearly related to the battery use ? Could the reason be that multiple cores are active at the same, that's why I observe small difference between the their battery levels? PS: I use partial lock in these apps.

# Answer
Long story short, battery comsumption depends not only on CPU but also every other part of your device.

Full version. An SoC consists of CPU, GPU, modem, north bridge, south bridge and RAM (on a discrete semiconductor chip but packed together into the same shell) altogether. Also the battery powers not only the SoC but also sensors, screen (which is usually the most power-consuming part) and wireless connection antennae.
A CPU has its own algorithm to control it's power and performance, which is called a 'governor'. A radical CPU governor tends to provide better CPU performance at the cost of high battery consumption, whereas a gentle governor will try to reduce battery consumption, resulting in lower CPU performance. The same applies to GPU and other parts of the SoC.
The screen is often the most battery-consuming part of a device, and the most decisive factors of a screen's power are size, resolution, brightness and technology (LCD or OLED). Cheaper phones and watches use LCD screens while high-end ones use OLED screen, as OLED uses significantly less power than an LCD one of the same specifications.
A watch usually has significantly less battery capacity but not-so-little screen power, which will decrease the draining difference in its battery stats while the screen is on. Besides, the sensors used on the phone and the watch may not be exactly the same, causing various differences.
The bottom line, the battery cost is determined by all parts of a device rather than only CPU. If another part is draining too much battery, you can't find large differences even though the CPU's power is highly variable.
> 2 votes

# Answer
Power-saving features are an important element to understanding power consumption on an Android device. The Android Doze and App Standby documentation describes power-saving features introduced in Android 6 (Marshmallow). While dozing, Android delays application actions and reduces use of network connections to reduce power consumption.

If the device is not in doze mode, it will consume considerably more power than when in doze mode. If you have an application that keeps the device awake when it otherwise would not be, this will cause other applications and communications to consume more power. The amount of power directly consumed by the application can be very small relative to the power consumption over the doze state.

There are also other battery-saving features (standby, for example), but I have not found documentation that is as good as the doze and app standby descriptions. I assume these other features exhibit the same kind of on/off power consumption characteristics.
> 1 votes

# Answer
Android battery usage not only depend on CPU status, but also depends on wifi status, sensors, bluetooth etc. Different device may lead to different result. http://androidxref.com/9.0.0\_r3/xref/frameworks/base/core/java/com/android/internal/os/BatteryStatsHelper.java FYI
> 0 votes

# Answer
. As already explained. Your battery usage depends on multiple factors not only on CPU.

. Secondly, when device is sleeping it drains very low battery whereas if you use wake lock, more battery is drain. . According to documentation it is better to bundle tasks and run them in one go rather than calling wake lock again and again - because after wakelock is released it takes some time for phone to go back to idel state.

. Please check out following documentation

https://developer.android.com/topic/performance/power/
> 0 votes

---
Tags: battery, battery-life
---


title: A/B (Seamless) update device questions

text:
# Question
Title: A/B (Seamless) update device questions
The internal storage of each Android device is separated into partitions such as system and boot. Most devices have only a single copy of each partition, but devices that support seamless updates have two copies of certain partitions—slot A and slot B, hence A/B—so that one copy of the partition lies dormant while the other is in active use. Because each partition is a copy, they can be used interchangeably to boot into Android. This also means that you can update one partition in the background and then swap to it when you reboot—thus your update is seamless!

I need to know more about this for a stock unrooted device:

1. After OTA system update, does the device install OS to both partitions? Or install to only one partition.
2. whether the device continues to same(current) android version until reboot manually?(after installing version update). Or whether it updates current to latest version overnight.
3. When normal reboot(not after update), how can a user identify whether device is booted to which slot (A/B)? Else, will the device continues to current slot on normal reboot(for example if it is A).
4. If any one slot got corrupted, Is it possible to use other slot only.

# Answer
> 5 votes
> After OTA system update, does the device install OS to both partitions? Or install to only one partition.

and

> whether the device continues to same(current) android version until reboot manually?(after installing version update). Or whether it updates current to latest version overnight.

It installs only to the inactive partition, which becomes active on reboot after update. Figure explains clearly

> When normal reboot(not after update), how can a user identify whether device is booted to which slot (A/B)? Else, will the device continues to current slot on normal reboot(for example if it is A)

On a normal reboot, it always reboots into the currently active partition. You can verify by running this command pre and post normal reboot

`fastboot getvar all | grep “current-slot”` (On Linux)

On Windows, `fastboot getvar all` and search for `current-slot`

Edit : You can see current slot using apps like Dev check

> If any one slot got corrupted, Is it possible to use other slot only.

If you mean by corruption , the update has failed,

> ....the device will roll back to the working build on the other slot....Your data is kept perfectly intact, even if the update is borked, as there is only one partition (userdata) which houses your data.

From How A/B Partitions and Seamless Updates Affect Custom Development on XDA and for more technical details see A/B (Seamless) System Updates

**Edit:**

1. Here is a more detailed picture from Android Police
2. Also see A/B (Seamless) System Updates from Android developers.

---
Tags: ota-update, stock-rom, moto-x4
---


# Question
Title: How to backup all notes from the stock notes app in Froyo?
Is there an easy way to backup/export notes from the stock notes app in Froyo? Alternatively, I'd like to know where said data gets stored, so I can manually copy them over to my PC.

Edit: I'm pretty sure the app came pre-installed on my device. The name of the app, as it looks from the app drawer is "Note pad."

# Answer
> 1 votes
I did some research and found out that this was pre-installed either by Huawei, or my telecom, as it resided in /cust/tata/in/app.

The notepad app is too bad as it doesn't allow anything else other than adding and deleting notes.

I solved my problem by manually opening each and every one of the notes, selecting all of them, tapping "copy" and then going to a file manager to open a text file. I then pasted it there, and saved them one by one.

# Answer
> 1 votes
My notepad (aka `com.example.android.notepad`), resident of Motorola xt317 (android 2.3), has a sqlite database living in the phone. Download it with

```
adb pull /data/data/com.example.android.notepad/databases/note_pad.db ./Documents

```

# Answer
> 0 votes
From https://android.stackexchange.com/a/73052/241313

Convert `.ab` into `.tar`:

```
adb backup -f com.example.android.notepad.2018-11-05.ab -noapk com.example.android.notepad
dd if=com.example.android.notepad.2018-11-05.ab bs=1 skip=24 > data.gzX
printf "\x1f\x8b\x08\x00\x00\x00\x00\x00" | cat - data.gzX | gunzip -c > data.tar

```

Extract `.tar` file:

```
tar xf data.tar

```

Optionally, create a `.tar.gz` file:

```
gzip -c data.tar > com.example.android.notepad.2018-11-05.tar.gz

```

---
Tags: 2.2-froyo, backup, notes
---