Question and Answer about Android from Stack Exchange network.


Every time I plug in my phone to my computer, it defaults to only charging. I have to open the phone notification to switch to file transfer mode. Is there a way to tell it to remember to use file transfer mode when connecting to my laptop? Or to change the default when connecting to my laptop?

I know that it is possible to change the default for all connections. However, I would prefer if it only changed the default when connecting with my laptop. I'm also uncomfortable that I would need to dig inside the developer settings to change the default.

If it matters, my phone has Android 10 (Q).

I was under impression that all user files are encrypted by default in Android using FDE. It was to my surprise that I can just run, for example, OrangeFox recovery and when it asks me for a password to decrypt data partition, I can simply cancel entering it and then still view /sdcard directory. If I then open some text file (from that /sdcard) in a built-in (OrangeFox) text editor, it would show me all the text properly without any scrambling. The same would obviously apply to all other files such as photos, videos, and etc. Similarly if I enable MTP in OrangeFox, I can also view all of that via USB on PC. At the same time, when booted to Android ROM, in Settings and Encrypt phone, it says Encrypted.

I would imagine that only after entering user password/pattern should it be possible to even mount that partition in OrangeFox. Viewing through USB again should only work if I'm either logged into Android ROM and unlocked the user or if through OrangeFox, when partition is unlocked and mounted.

Do I miss something? How to ensure proper encryption on all of the user data?

Screenshot of "App Permissions" and "All Permissions"As you can see in the attachment, i have denied access to microphone. But when I go to "All Permissions", it shows that the app can still use microphone. What does that mean? And how can I stop it from using my microphone?

I'm running my own DNS-over-TLS server under my domain (dns.example.com). On my Motorola G100, which is running Stock Android 11, I can set the private DNS to this domain and it works. This works on my Linux machines, two other Androids (some Motorola on Android 10 and a Samsung with Android 10), and also on two different routers (AVM FritzBox can use DoT as upstream).

The server is not at fault, the certificate is valid and all devices work the way they should, that is, until the server is rebooted or otherwise blocked. Then, of course, I receive the notification that it "can't access the private DNS server".

The Linux machines recover and just retry to connect, as well as the routers. But the Android phones don't want to retry even when I know for sure that the connection is working.

Upon disabling private DNS and reenabling with my domain, the following log is shown (IPs removed)

09-30 19:32:46.091  1144 20197 W resolv  : Validating DnsTlsServer <MY_IPV4> with mark 0xf006b
09-30 19:32:46.091  1144 20198 W resolv  : Validating DnsTlsServer <MY_IPV6> with mark 0xf006b
09-30 19:32:46.138  1144 20197 W resolv  : SSL_connect ssl error =1, mark 0xf006b: No such file or directory
09-30 19:32:46.138  1144 20198 W resolv  : SSL_connect ssl error =1, mark 0xf006b: No such file or directory
09-30 19:32:46.138  1144 20197 W resolv  : TLS Handshake failed
09-30 19:32:46.138  1144 20198 W resolv  : TLS Handshake failed
09-30 19:32:46.138  1144 20197 W resolv  : query failed
09-30 19:32:46.138  1144 20197 W resolv  : validateDnsTlsServer returned 0 for <MY_IPV4>
09-30 19:32:46.138  1144 20198 W resolv  : query failed
09-30 19:32:46.138  1144 20198 W resolv  : validateDnsTlsServer returned 0 for <MY_IPV6>
09-30 19:32:46.138  1144 20197 W resolv  : Validation failed
09-30 19:32:46.138  1144 20198 W resolv  : Validation failed

I don't know why it tells my that the handshake fails, all other devices (or kdig +tls) can connect just fine. From the server's reboot to now, no config, certificate or software version was changed.

My guess is that Android caches the connection and "remembers" that it failed at some point in the past and doesn't even try to connect again. I tried rebooting, shutdown, airplane mode, another DoT (dns.google works), disabling DoT but nothing fixes this behavior.

The way Android works, there are two cases in which an app is killed.

  1. The device is low on RAM. This is kind of self-explanatory, there is generally no page file on Android, and RAM is finite.
  2. The maximum number of cached processes is reached. To quote a comment in the AOSP source code:

The maximum number of cached processes we will keep around before killing them. NOTE: this constant is only a control to not let us go too crazy with keeping around processes on devices with large amounts of RAM. For devices that are tighter on RAM, the out of memory killer is responsible for killing background processes as RAM is needed, and we should never be relying on this limit to kill them. Also note that this limit only applies to cached background processes; we have no limit on the number of service, visible, foreground, or other such processes and the number of those processes does not count against the cached process limit.

I've noticed that it's not quite that simple, though. Time especially seems to be a factor. I can open 10, 20 apps and it's not a problem. Let the phone sit overnight, and it will only be 4 apps in my case.

In the first case, the solution is fairly obvious: somehow increase the amount of usable RAM, whether that's by reducing the number of services running, using zRAM, using a device with a lot of RAM, etc. My device (SHIFT6mq) has 8GB of RAM, and usually only about half of that is being used, so that's obviously not the restriction in my case. Which leads us to 2.

The solution here is less obvious. The most promising bit I found is this: https://github.com/crok/crokrammgmtfix, and the accompanying blog post here: https://telegra.ph/Fine-tuning-an-Android-system-04-20. I've tried the magisk module, and tried what's listed on the blog post. Doesn't matter, when I execute su -c dumpsys activity settings the results stay the same, and when I wake up, there are still only 4 apps running, whereas there were many more before I went to bed. I also found this thread on XDA: https://forum.xda-developers.com/t/how-to-disable-adjust-the-background-task-limit.3886743/, which has very similar measures. Problem is, this all seems to apply to Android versions under 10 - and I definitely couldn't get it to work on Android 10.

Now, some would say, that's the way it should work. You know what? If I wanted the app closed, I wouldn't have left it open. Now leave it open. I have 8GB of RAM, which has shown to be more than enough for that. And it closes the apps overnight... which is specifically when I have the phone plugged in.

So, how do I tweak the settings of the activity manager (or anything else for that matter) so that it stops killing apps I explicitly left open, when there's more than enough RAM available?

Note: I realize there are some devices (e.g. Samsung, Huawei) with overly aggressive battery saving measures on top of that in AOSP. This is not what I'm referring to. The stock ROM on the SHIFT6mq is very close to AOSP.

I have a Samsung Galaxy S10e SM-G970F that I'd like to use for phone calls and simultaneously as an hotspot (WiFi tethering) to browse from my laptop.

The phone has 2 sim cards.

I'm unable to make a phone call in one sim and simultaneously browse with the other.

As soon as a phone call begins in SIM1, the data connection drops in SIM2.

I tried many different combinations settings of:

  • VoLTE calls SIM 1/2
  • Allow all SIMs to use data in calls
  • Dual SIM always on

I also tried switching "Calls" and "Mobile data" between the 2 SIMs.

So far no luck. Please, do you have any tips to achieve what I need?

I want to route a specific IP address from hotspot (wlan0) to Mobile Data (rmnet_data1) interface on Android 11, bypassing VPN.

I use my phone as a hotspot and also with the help of an app called "VPN Hotspot" I share the VPN with my PC. I want to exclude a specific IP address from VPN. I have tried the route option in "OpenVPN for Android" client and it doesn't seem to work properly. I think it might because of "Always On" enabled.

Can I achieve this with ip route command?

I have a WiFi connection which, in the settings, says:

Transmit link speed
866Mbps

Receive link speed
780Mbps

I've installed PowerFTP on my phone and transferred a large video file (about 40 min.) from my Android (Pixel 5a) phone to my Linux computer. My network is a 1Gbps all around (switch, NICs, WiFi router) except for the WiFi transmission itself (obviously).

The transfer rate shown by PowerFTP is around 5Mb/s (or ~40Mbps).

Why is that transfer rate so low? Is there something else limiting the speed along the way?


Update:

My Network looks more or less like this:

+-------+        +-------------+        +--------+        +------+
|       |        |             |        |        |        |      |
| Phone |<::::::>| WiFi Router |<------>| Switch |<------>|  PC  |
|       |  WiFi  |             |  LAN   |        |  LAN   |      |
+-------+        +-------------+        +--------+        +------+
~700mbps         ~700Mbps  1Gbps          1Gbps            1Gbps

The LAN has a switch and that connection is local (as in 192.168.x.x).

There are other devices on the WiFi (3 phones, a laptop--which was off when I tested the above).

Of course, I can see some WiFi devices from my neighbors... so I understand there can be interference there.

How does the Google Android emulator emulate the RAM?

Does it use the physical RAM of the host or use secondary memory like the hard disk?

Further to my earlier question here and according to the "Mounting Partitions Early" article, I'm looking the correct way to implement my new idea:

  1. Skipping the mounting in the startup of vendor in fstab - Its easy to erase the record in fstab related to /vendor partition
  2. Doing alternative mount from provided custom vendor image - It's require to know where to inject the mount command

Anyone have an idea ? Thanks,

Just received a new Motorola E6 phone. It's running Android 9.0. Any time the phone is bumped, moved, or there is any kind of vibration the screen lights up. How can I stop it from doing this?

Internet search suggests I should find a "Sneak Peek" option under Settings - Displays, however, this phone does NOT have "Sneak Peek" or anything similar there. It also does not have an Ambient Display setting.

Android 11; Samsung Galaxy A20 (SM-S205G)


I've had a long-standing problem on my Android phone with IBM Community forum websites.

Forum postings like this one are zoomed in too far. I can't read the text on either side of the page (portrait or landscape).

I have the same problem in all browsers that I've tried. I've tried pinching out the screen to zoom out, but that doesn't do anything. It stays at the same zoom level.

My uneducated guess would be that the page isn't handling responsive design properly. I've reported the problem to IBM. But they don't seem to be interested in fixing it.

I don't have this problem with any other websites on my Android phone. For example, there are even other IBM forums that don't have this problem. But unfortunately, I don't use those specific forums.


I've had some luck solving the issue on a different device: Safari/iPad (7th gen; 17.7.1).

In Safari, there is an option where I can zoom out at a set percentage (85%).

enter image description here

That works well. There's a tiny bit of cutoff at the righthand side. But I can live with that.


Question:

To compensate for the problem with the IBM website on my phone, is there a way for me to change the zoom level in an Android browser app? (just like I did with Safari?)

So far, I haven't found a setting like that in Samsung Internet, Firefox, or Chrome. I'm open to installing a different browser on my phone if needed.

As in title, what are the conditions? (fingerprint isn't enough to unlock the device, one needs to enter PIN. I am not talking about the requirement after a re-boot)

I can't seem to discern a pattern, on some days I get this security warning at least 3 times, and on some days never or maybe once, while the usage pattern seems to be similar.

Pixel 4a, Android 11

What's this N symbol? It shows up in various menus sometimes. And how do I get rid of it?

enter image description here

Does anyone know any existing OS (other than Android) that works for Nokia Xr20. or if not, is it fairly quick to Port an existing OS for this phone?

Some Android apps require libraries to be linked against by specifying <uses-library> in their Manifest (in the application element):

<uses-library android:name="com.example.customlib" android:required="true" />

It is possible to list the installed libraries on the device by running the following command:

$ adb shell cmd package list libraries                                                                                                                                                  1 ⨯
library:android.ext.services
library:android.ext.shared
library:android.hidl.base-V1.0-java
library:android.hidl.manager-V1.0-java
library:com.android.future.usb.accessory
library:com.android.location.provider
library:com.android.media.remotedisplay
library:com.google.android.gms
library:com.google.android.trichromelibrary
library:javax.obex
library:org.apache.http.legacy
library:com.example.customlib
...

Where are these libraries installed? Is there a command similar to adb shell pm path com.exaple.packagename that would return the path of com.example.customlib? When I tried pm path, it does not return anything.

I accidentally flashed some outdated bootloader firmware and now I cannot seem to access the bootloader I tried holding the vol up + power and both to volume buttons + power but it made the phone vibrate and reboot.

On Android v10 on mobile, I use the Google "note to self".

I'd like those notes to go to an app where I can edit/delete them.

I'll settle for Google Keep, although would be ideal to send to Evernote or Any.Do

How do I access text messages on my rooted device using the command line?

I specifically want to extract a text transcript, without using any cloud services and thereby exposing sensitive or personal info.

I installed an icon pack (Arcticons), and some widgets don't match the design of the icon pack. Let's take Shazam widget as an example. Can I:

  • Create a custom widget icon for the existing Shazam widget?
  • Create a widget with icon I want and trigger Shazam's song recognition on my own from "my widget"?

Thanks for your help.

Topics


2D Engines   3D Engines   9-Patch   Action Bars   Activities   ADB   Advertisements   Analytics   Animations   ANR   AOP   API   APK   APT   Architecture   Audio   Autocomplete   Background Processing   Backward Compatibility   Badges   Bar Codes   Benchmarking   Bitmaps   Bluetooth   Blur Effects   Bread Crumbs   BRMS   Browser Extensions   Build Systems   Bundles   Buttons   Caching   Camera   Canvas   Cards   Carousels   Changelog   Checkboxes   Cloud Storages   Color Analysis   Color Pickers   Colors   Comet/Push   Compass Sensors   Conferences   Content Providers   Continuous Integration   Crash Reports   Credit Cards   Credits   CSV   Curl/Flip   Data Binding   Data Generators   Data Structures   Database   Database Browsers   Date &   Debugging   Decompilers   Deep Links   Dependency Injections   Design   Design Patterns   Dex   Dialogs   Distributed Computing   Distribution Platforms   Download Managers   Drawables   Emoji   Emulators   EPUB   Equalizers &   Event Buses   Exception Handling   Face Recognition   Feedback &   File System   File/Directory   Fingerprint   Floating Action   Fonts   Forms   Fragments   FRP   FSM   Functional Programming   Gamepads   Games   Geocaching   Gestures   GIF   Glow Pad   Gradle Plugins   Graphics   Grid Views   Highlighting   HTML   HTTP Mocking   Icons   IDE   IDE Plugins   Image Croppers   Image Loaders   Image Pickers   Image Processing   Image Views   Instrumentation   Intents   Job Schedulers   JSON   Keyboard   Kotlin   Layouts   Library Demos   List View   List Views   Localization   Location   Lock Patterns   Logcat   Logging   Mails   Maps   Markdown   Mathematics   Maven Plugins   MBaaS   Media   Menus   Messaging   MIME   Mobile Web   Native Image   Navigation   NDK   Networking   NFC   NoSQL   Number Pickers   OAuth   Object Mocking   OCR Engines   OpenGL   ORM   Other Pickers   Parallax List   Parcelables   Particle Systems   Password Inputs   PDF   Permissions   Physics Engines   Platforms   Plugin Frameworks   Preferences   Progress Indicators   ProGuard   Properties   Protocol Buffer   Pull To   Purchases   Push/Pull   QR Codes   Quick Return   Radio Buttons   Range Bars   Ratings   Recycler Views   Resources   REST   Ripple Effects   RSS   Screenshots   Scripting   Scroll Views   SDK   Search Inputs   Security   Sensors   Services   Showcase Views   Signatures   Sliding Panels   Snackbars   SOAP   Social Networks   Spannable   Spinners   Splash Screens   SSH   Static Analysis   Status Bars   Styling   SVG   System   Tags   Task Managers   TDD &   Template Engines   Testing   Testing Tools   Text Formatting   Text Views   Text Watchers   Text-to   Toasts   Toolkits For   Tools   Tooltips   Trainings   TV   Twitter   Updaters   USB   User Stories   Utils   Validation   Video   View Adapters   View Pagers   Views   Watch Face   Wearable Data   Wearables   Weather   Web Tools   Web Views   WebRTC   WebSockets   Wheel Widgets   Wi-Fi   Widgets   Windows   Wizards   XML   XMPP   YAML   ZIP Codes