Question and Answer about Android from Stack Exchange network.


When connecting two Android phones via a cable, how can I choose which phone is charging which phone? E.g. when I connected a Samsung Galaxy S9 (Android 10) with a Google Pixel 6 (Android 12) via a male-to-male USB-C cable, the Google Pixel 6 got charged.

I have the below QR code generated from my application so users can use their phones for a time-based OTP. For Google Authenticator in iOS, scanning the QR code correctly leads to an eight-character time-based OTP generating every 30 seconds. However, on the exact same Google Authenticator in Android, it incorrectly generates a six-character string instead.

I have provided the sample string and QR code below (it's from a test system) - does anyone know why the implementation of the functionality differs between the exact same app on Android and iOS, or alternatively where I can find developer documentation for either the otpauth protocol or Google Authenticator itself (both seem thin on the ground and I've had to take what I can from tutorials)?

Sample string: otpauth://totp/[email protected]?secret=GQ2DOMBXGRCDCMRSIVBEEOJSGMZEEQ2F&issuer=TestApplication&algorithm=SHA256&digits=8&period=30

Sample QR Code:

For a while now, there is a permanent red dot over my Google Chrome app icon:

red dot over Chrome

I don't have any tabs open (had many, closed them all trying to get rid of the dot) and checked all possible settings of the app.

When I open the app and close the default tab it shows, the app close, dot disappears for a second then showing again.

Why is there a red dot, and how can I get rid of it?

Device and OS: realme 6 pro V2.0, android version 11

Samsung Galaxy S10, Andorid 11, OneUI 3.1

To obtain time and number of recent calls, I got to the phone app, tap "recent" on the bottom, and see a list of incoming and outgoing calls with phone number and time. However, if it was the same phone number several times consecutively, it shows only the last time, and the number of calls in brackets: "phone_number (3) 12:34".

Is there a way to get a list of all calls individually (for all numbers, even if several times the same number consecutively).

(I know I can tap a line, hit "i", and see the whole list of calls for only this number.)

I prefer a native solution, but if a 3rd party app should be necessary, I prefer clean (as few rights as possible, no advertising, possibly open source) over "for free".

I have a Samsung Galaxy S8 SM-G950U that I used with Verizon. I moved to Japan and got a Japanese SIM card through SoftBank and used in my Galaxy S8 without a problem. My account has a global roaming service included. I came back to the US with the Japanese SIM card and was told it would work in the US but it is not connecting to a network.

'Settings' > 'Connections' > 'Mobile networks' > 'Data Roaming Access' is on.

'Settings' > 'About phone' > 'Status' > 'SIM card status' shows "Network not available" even though I have 4 bars of signal strength. Also "Not roaming" is shown but I assume I would be roaming since I'm outside of Japan.

I called a support number and they told me to go into "SIM App" to update the SIM card but I cannot find this app or setting. If I search for "SIM App", I get a result in 'Apps' > 'App info' > 'Sim App Dialog' but my only option there is 'Force stop'.

I can connect to wifi but I would like to be able to connect/use mobile data when wifi is not available.

Is it possible? Or the device needs at least a kernel to be able to charge? I have a device in bootloop that every 3 seconds it vibrates and I'm not sure if its does not charge because I erased boot and system partitions or because its consume power everytime it vibrates preventing to charge enough for me be able to turn on fastboot mode and fix it.

Problem Summary

Neither Android File Transfer nor OpenMTP will detect an LG V20, model LG-H910, over USB when it's in MTP mode. The phone is detected by them in other USB modes, there are no issues with connecting to the phone via adb and the phone will mount under Windows. Changing cables and computers makes no difference. MTP works fine with an LG V20 LG-LS997.

Details

I've got an (unrooted) AT&T branded LG V20, model LG-H910. I'm trying to transfer files over USB, but neither GUI MTP app I've tried for Macs (Android File Transfer 1.0.12; OpenMTP 3.1.10 & 3.1.15) will detect the phone when it's in MTP mode; they present "No Android device found" and "Android device is either busy or not connected" messages, respectively. When the phone is set to charge-only, each MTP app detects the phone but rightly can't connect (reporting "Can't access device storage" and "Your phone storage is inaccessible.", respectively). Image Capture connects to the phone when it's in PTP mode, though can't pull images (this also happens with another LG V20, so it's not surprising).

As a test, mtpfs (installed via MacPorts) will recognize the phone (though misidentifies it) and supposedly mount it, but all attempts to access the files via the mount result in a "Device not configured" error. Sample local shell session:

$ sudo -s
# mkdir /Volumes/phone
# mtpfs /Volumes/phone
Listing raw device(s)
Device 0 (VID=1004 and PID=633e) is a LG Electronics Inc. LG G Flex 2.
   Found 1 device(s):
   LG Electronics Inc.: LG G Flex 2 (1004:633e) @ bus 20, dev 29
Attempting to connect device
desired configuration different from current, trying to set configuration
libusb_set_configuration() failed, continuing anyway...: Operation timed out
Android device detected, assigning default bug flags
Listing File Information on Device with name: V20
# ls /Volumes/phone
ls: : Device not configured

mtpfs has other issues, such as taking about 1 minute to run (there's about a 1 minute pause before the last line of output, beginning "Listing File Information [...]"). I'm not so much interested in mtpfs as a solution as I was using it to test MTP on the phone.

Whether USB Debugging is enabled or not makes no difference to MTP, though when enabled, the phone is accessible via adb, both from the command line and in Android Studio (I can run a shell on the phone, pull files, install & debug apps in Android Studio &c.).

AFT didn't log any messages to the system console when the phone was connected in MTP mode.

There were no file access issues with the LG-H910 when connected to a Windows computer (both internal & external storage mounted, and the files were accessible). AFT and OpenMTP detect and can access a different phone of the same type, an (unrooted) Sprint-branded LG V20, model LG-LS997.

I've tried rebooting phone & computer, ejecting the SD card in the phone & rebooting, different cables, different ports and different computers (both Macs, one with a clean install of OS X); nothing had any impact on the issue, and the only common factors are the LG-H910 and OS X. A factory reset of the LG-H910 made no difference.

Question

How can I get AFT (or even OpenMTP) working with the LG V20 LG-H910? What other troubleshooting steps can I take?

Related questions

There are similar questions on this site, but none seem to describe the same situation, or have solutions.

There are plenty more questions, but all are either AFT isn't installed, AFT detects the phone, or the phone isn't detected by anything.

System Info

  • mid-2012 13" MacBook Pro
  • MacOS 10.14.6
  • Android 8.0.0 (both phones)
  • Android File Transfer 1.0.12
  • OpenMTP 3.1.10, 3.1.15
  • mtpfs 1.1

I was using TubeMate to download my first video with TubeMate, and I got banned from the Wi-Fi network I was using:

enter image description here

Online activity through a browser or application has been flagged as malicious or in violation of the purpose of this network! Close all offending programs and try accessing the Internet again in five minutes.

Quarantine Trigger

"ET P2P ThunderNetwork UDP Traffic"(2009099) UDP 192.168.10.237:58509 -> 13.57.93.165:10050

According to https://whatismyipaddress.com/ip/13.57.93.165, 13.57.93.165 is an Amazon.com IP. I have no idea why some packet would go there.

I'm wondering why TubeMate caused it. Does Tubemate use some peer-to-peer network? If not, what could have caused this ban?

I am using LineageOS 18.1

When I was on LOS 16, I used to edit the file /system/etc/init.d/00banner and put my iptables commands there, e.g.:

#!/system/bin/sh
sh -c 'iptables -A OUTPUT -m owner --uid-owner 10195 -d 203.205.255.78/23 -j REJECT'

All iptables commands I put in there used to run on phone start up. But in LOS 18.1, the /system/etc/init.d/ directory was deprecated.

1. I created and filled the custom script with the iptables commands above:

touch /system/etc/custominit.sh
chmod 0755 /system/etc/custominit.sh

2. Then I edited /system/etc/init/hw/init.rc and I added to the end:

chmod 0755 /system/etc/custominit
exec /system/etc/custominit

3. I also tried adding:

service custominit /system/bin/custominit.sh
    disabled
    oneshot

But none of this worked.

What is it that I doing wrong? I have root access but I do not want to install any additional apps on my phone for this, as it was possible to do on LOS 16.

I have an ASUS Zenfone Max Pro M1(X00_TD). Lately, I have noticed that my phone's downloading or uploading speeds don't go over 10 to 15 Mbps. It has a 2.4 G wifi and easily used to give me 40-60 Mbps 2-3 months ago. But now I don't know why the speeds never go above 15 Mbps.

Initially, I thought my ISP maybe down or the server may not be giving off above 15, but I cross verified it 50 times with other devices.

It doesn't go above 15 Mbps even on cellular data.

The ISP is fine(100 Mbps). It doesn't go above 15 even in speed tests. How can I fix this? Thanks in advance

How can one disable incoming videos on Zoom? I use Samsung Galaxy S9 with Android 10.

E.g. in MS Teams one may do it as follows:

enter image description here

I have read about the Contacts Provider API, but it is not clear to me how applications interactions are regulated. If an application stores contacts in an account specific to that application, can any other application given permission to access contacts still read the information of those contacts (i.e., of the other application)? Or does each application have access only to its own accounts and any contacts manually entered via the (default) Contacts application?

I am sure I am missing something here and a quick fast dirty attempt yielded nothing.

I would like to rename all files in a specific directory using total commander for Android multi rename tool so that all extensions have JPG and only the first five letters of the filename are included in the rename.

asssdd.0
sloppyjoeontop.0
gghhhh.0

results

asss.jpg
sloppy.jpg
gghhh.jpg

How can this be done?

I tried to replace everything aka * with name placeholder aka [N1-5] and then the extension. This respects the extension and changes it but there is no change in the name.See screenshot

enter image description here

I have around 50 trichrome library folders in /data/app using around 3 gb.

What varies is the alphanumeric string after the package name denoting version: com.google.android.trichromelibrary_410408383-VgzblS0EY8swXcjTqN6reQ==

Can I delete all but most recent to clean my system and regain some space?

Or is it like WinSxS folder in Windows where all revisions of the same dll are stored for different programs to use?

I'm using the samsung a32 5g.

Just wondering if it's worth allowing it to use my mobile data since I'm on a tight plan and why it would be important. All I use is SMS messages, I read that all it is used for is RCS or any android related messaging apps.

If that's the case can I disable background data usage if it does nothing for me, and even go further to disabling the app? Would doing so disrupt SMS or any other messaging service?

If I delete images with file explorer from DCIM/Camera and images are still in DCIM/thumbnails, will thumbnails images stay there? If they stay there, will something delete them in future? Does Xiaomi phones have something to delete thumbnails?

I am trying to flash an Android 12 GSI onto my Samsung Galaxy Tab Active3. Goal is to install the GSI without root / voiding the warranty. My company produces an app which is primarily used on Android on Galaxy Tab Active devices. It's expected Galaxy Tab Active3 will get Android 12 update in the next few months and we wanted to do some regression testing in advance of that. Hence the need to get Android 12 GSI onto the Tab Active3.

Device is an arm64 so I downloaded the arm64+gms version of Android 12 GSI (from Google's website). I have successfully unlocked the bootloader, and enabled DSU support. The device supports Project Treble and the VNDK isolated namespace, so in theory should support GSIs.

Everything I tried so far has failed. Any ideas to get it working?

Manual DSU

I have tried to install the GSI by manually starting the DSU via activity manager. Every time it just says "Installation failed" after reaching about 50% progress. I have tried setting different sizes for the USERDATA: 8GB (Google's recommended size), 2GB and 1GB. I get the same error every time. The device has around 40GB free space and the GSI image size is around 2GB, so it shouldn't be anything to do with the space requirements.

Logcat reports an error:

11-11 13:10:09.620  1103  3695 I DynamicSystemService: Failed to install system
11-11 13:10:09.621 16445 23403 E InstallationAsyncTask: java.io.IOException: Failed to start installation with requested size: 1257738436

This doesn't help unfortunately; it is thrown from the following file and this is just thrown if there is any error in the underlying dynamic installation:

https://android.googlesource.com/platform/frameworks/base/+/refs/heads/master/packages/DynamicSystemInstallationService/src/com/android/dynsystem/InstallationAsyncTask.java

PS: Unfortunately the device does not support DSU Loader even though it's running Android 11 (searching for "dsu" in the settings returns no relevant results). Apparently none of the Samsung devices are supporting DSU Loader.

Fastboot and FastbootD

The device can be rebooted into fastboot mode (adb reboot bootloader) but every command just hangs forever (except for fastboot devices, which does detect the device). I tried fastboot reboot fastboot, but it just reboots into the standard mode of the device and does not enter a fastboot userspace mode (fastbootd mode) as some have suggested it should.

Heimdall

At least one person has said they can patch GSIs using Heimdall: https://forum.xda-developers.com/t/can-i-flash-gsi-roms-with-odin.4029921/

That person was able to flash their GSI to the SYSTEM partition, but my device doesn't have a SYSTEM partition. The partitions are like SUPER, PRISM, etc.

I'm not able to get Heimdall working properly on Windows 10. I have tried with WinUSB, libusb0 and libusbK, but the same is true for all of them. After rebooting the device into ODIN mode, the device can be detected with heimdall detect, but I can't do anything more including heimdall print-pit, as I get a "Failed to access device. libusb error: -12" error.

I managed to set up Heimdall on an Ubuntu instance of WSL and map the USB using USBIPD. Inside WSL, heimdall print-pit does work but I can't get further to flashing anything (I tried to flash the GSI to SUPER, not sure if this was a good idea but anyway it failed) as I get a "Protocol initialisation failed!" error.

Odin

I am not sure if Odin even supports GSIs and I can't find anyone saying it supports them. I have tried flashing the GSI as an AP in Odin 3.12, 3.13, 3.14 and the patched 3.14 which removes signature checks. But every time it just fails.

Custom recovery

Just to also note, it seems none of the custom recoveries (TWRP, SHRP, Orangefox etc) support the Tab Active3, or I could have tried to flash those using Heimdall/Odin and then use them to flash the GSI. But I feel it's likely I would have had the same issues, at least with Heimdall.

EDIT: Heimdall on native Linux

@Robert in the comments below suggested I run Heimdall on native Linux rather than on WSL or the Windows version. This worked better and fixed the issues I was having before with Heimdall.

I then tried to flash VBMETA (the one which is bundled with the GSI) using Heimdall which worked, however my device is now soft-bricked, can only boot into Download Mode, and gives the following error:

ODIN MODE (AVB fail)
vbmeta: Public key used to sign data rejected. (5)
vbmeta: VERIFICATION_DISABLED bit is set.
CUSTOM VBMETA
VBMETA : No sign info
VBMETA ,

@alecxs in the comments had suggested flashing a VBMETA generated from avbtool instead; I tried this also, but got almost the same situation and a very slightly different error output:

ODIN MODE (AVB fail)
vbmeta: Error verifying vbmeta image: OK_NOT_SIGNED (3)
vbmeta: VERIFICATION_DISABLED bit is set.
CUSTOM VBMETA
VBMETA : No sign info
VBMETA ,

EDIT 2: Heimdall on WSL again, VBMETA findings, and how I got DSU working

I found that both Heimdall on native Linux and Heimdall on WSL actually suffer from the same problem. You can only post one command to the device, then subsequent commands fail with "protocol initialisation failed". On WSL I was doing things like heimdall print-pit --no-reboot and that's why I was facing issues when flashing. Basically, if you get protocol initialisation failed, just reboot the device and it should work.

Samsung devices seem to do a signature check on VBMETA and only accept official Samsung-signed ones. I found two different VBMETA images in my stock ROM - vbmeta.img and vbmeta_samsung.img. I happened to notice that vbmeta_samsung.img has the same file size as the vbmeta disable images. By the time I'd got this fixed I'd flashed vbmeta_samsung.img and then done a factory reset. I'm not sure if this was strictly necessary though, as after flashing vbmeta.img it still worked. Not sure if re-flashing original stock vbmeta.img will have re-enabled AVB though. Although I'd say it's unlikely, as even Google themselves say you need to disable AVB in order to use DSU.

How I got DSU fixed eventually (aside from the above) - I had made a really stupid error when running the DSU command. For KEY_SYSTEM_SIZE I was passing the gzipped system size, not original system image size. This is why the installation always failed after 50%, because it was only installing 50% of the system image. Also another really important thing to note is that after running DSU, you have to restart the system from the DSU notification and not from the normal power menu of the device.

Normally titanium backup saves backups with its ownership, for example u0_a252: -rw------- 1 u0_a252 u0_a252 539 2021-11-07 09:52 com.application.zomato-20211107-095236.properties

However, it sometimes saves backups with media_rw ownership: -rw------- 1 media_rw media_rw 963K 2021-11-07 09:00 net.bikerouteplanner-667db7c2a87ed259454c457130013a1a.apk.bz2 The backup directory is in /sdcard/, internal storage.

These files can't be read by users, or even by root! It prevents me from easily syncing the files to an external server, or to copy them off before doing a factory reset.

I've tried chown in adb with su, but the the ownership isn't changed. The solution I've found is to reboot to the bootloader, boot TWRP and change it in an adb shell.

I've found nothing in web searches other than to use TWRP. I found nothing going to the cause of the bad ownership other than perhaps android taking them as media files. I believe the problem started with android 11.
I am currently running android 11 on a pixel 5, rooted with magisk.

I'm not an Android developer, I am a developer in many other contexts.

I have a simple question that I don't see an answer to on Google: Can a standard android application (no rooting required) listen to a socket on a high numbered port? E.e. only using standard in-app permissions?

Any reference to the documentation on the available permissions would be a nice addition for this weekend warrior Android coder to-be.

I am running a lower Android version and need to install a Linux proot container in Android. Another Term is the closest alternative, but how do I install it? It seems pretty hard.

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