Friday, November 2, 2018

sd card - mounting multiple ext4 partitions in Android 7+


I am doing away with exFat for my Microsd card after all my pictures decayed , corrupted and the directory was locked. I cant seem to write into a specific directory. chkdsk will just plain abort saying :


The disk does not have enough space to replace bad clusters

detected in file \WhatsApp\.Shared of name 1.
Corruption was found while examining files in directory \WhatsApp\ (6).


so I 'd like give a shot to Ext4 partitioning that cheap micro sd card , not just 2 ( the standard app2sd and sdcard1 design ) but 3. One for apps and other 2 depending on the write activity , I tweaked the block parameters etc. for each
I am able to mount the partitions & a rooted Total Commander can see them all BUT other apps cannot see the partitions I created.As I understand vold helps other apps be aware of this. So How do I go about getting this 'formally' with sounding 'hackish'
what I did :


mkdir /storage/
mount -t ext4 -o noatime,rw /dev/block/mmcblk(x)p(y) /storage/
where x and y are variables from partitions file in the proc dir.


I read about a fstab. file out there that can be modified but it would be overwritten every boot.


even the 2nd partition that app2sd ( or link2sd) creates can ONLY be approached as root. So prolly those apps that ask for root can see this stuff but other apps can write to it
Ext4 is linux . Sounds like Android seems to ignore its own 'biological' kid ext4 and instead recognize a stepson 'exfat / FAT '
I am sure I am missing something here. Any ideas ?
I am rooted with Magisk on a Galaxy j7 with of course TWRP ( 3.x) installed


Print env o/p Mount o/p




Thursday, November 1, 2018

Delayed notifications on Huawei Mate 10 pro with Android Pie, EMUI 9.0


What I experience these last months is that notifications from various apps of mine do not appear in time.


Either they appear very late or not at all (until I open the specific app).


My system is Huawei Mate 10 pro with Android Pie, EMUI 9.0.


What could be the reason for that?



Answer



Likely reason is battery saving feature of Huawei which is a stronger version of , in that apps are frozen if inactive after a duration. I had seen this on my earlier Huawei device. See my answer here. What is protected apps in Huawei phones?.


It looks like it is not called "protected apps" anymore and this Reddit explains the required settings to disable this for apps. There is also a feature of Power Genius involved and a workaround to bypass that. Options mentioned in Reddit



See if you can find a way to turn off battery savings in this Location or similar Settings- apps & notifications - apps- settings cog- special access - ignore battery optimisation >allow/disallow




Or



Settings -> Apps -> Apps -> three dots on upper right corner -> special access -> battery optimization -> change dropdown menu to "all apps" -> change apps you want to keep in background to "don't allow, may drain battery more quickly



Edit: OP confirmed that the second option was the right one for their device. Thanks


Disable battery saving feature for those apps and hopefully that should fix delayed notifications.


cyanogenmod - USB reverse tethering - netcfg not found (marshmallow CM13)


I have been attempting to get reverse tethering working on my phone. I have a Galaxy S5 (g900t), running cyanogenmod 13 (marshmallow)...rooted, and with busybox.


*Edit: I've made some progress. I ran this on my ubuntu machine:



sudo ip addr flush dev eth0
sudo ip addr flush dev usb0
sudo brctl addbr br0
sudo brctl addif br0 eth0 usb0
sudo ip link set dev br0 up
sudo dhclient br0

And then I ran this in the adb shell:


dhcptool rndis0


After doing this, I seem to have internet.


I can do wget -s google.com. However, it only works as su.


root@klte:/ # wget -s google.com
Connecting to google.com (4.59.40.99:80)
Connecting to www.google.com (4.59.40.99:80)

2000@klte:/ $ wget -s google.com
wget: bad address 'google.com'

I verified that I can do wget as a regular user when I am connected through cell network or wifi.



So my question is:


Why would I be able to apparently access the internet as su, but not as a regular user? I've checked my ifconfig and route settings, and they all look the same either as su or regular user. Does anyone see what I'm doing wrong?




Config setting printouts


These settings are all the same, whether I run them as su or not. Here is my ifconfig:


1|root@klte:/ # ifconfig rndis0
rndis0 Link encap:Ethernet HWaddr 62:91:0C:85:FD:6B
inet addr:192.168.22.6 Bcast:192.168.22.255 Mask:255.255.255.0
inet6 addr: fe80::6091:cff:fe85:fd6b/64 Scope:Link
UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1

RX packets:582 errors:0 dropped:0 overruns:0 frame:0
TX packets:126 errors:0 dropped:0 overruns:0 carrier:0
collisions:0 txqueuelen:1000
RX bytes:62495 (61.0 KiB) TX bytes:15839 (15.4 KiB)

And here is my route table:


root@klte:/ # route
Kernel IP routing table
Destination Gateway Genmask Flags Metric Ref Use Iface
default 192.168.22.1 0.0.0.0 UG 0 0 0 rndis0

192.168.22.0 * 255.255.255.0 U 0 0 0 rndis0

And it appears that my DNS servers are set correctly:


root@klte:/ # cat /etc/resolv.conf  
nameserver 8.8.4.4
nameserver 8.8.8.8

Answer



I just recently stumbled across what seems to me to be a much better (or at least easier) solution for reverse tethering: gnirehtet


It sets up a VPN on the android which redirects all traffic across an adb reverse port connection. Doesn't even require root at all.


2G versus 3G: Does it really save battery?


I often hear the recommendation that fixing your device to 2G saves a lot of juice compared to using 3G.


Is that true? Or is it really a myth?




Answer



Fast answer:


Nes. Yo. Well, it all depends... on how you use your device.


Detailed answer


Self-Experiment


I just did a self-experiment to find out. Until now, I had all my devices fixed to 2G -- as that should "save juice", like the question suggests. So for 4 days now, I have 3G enabled. Surprisingly: No difference which could not be explained by measurement errors or slightly different situations (after all, I had a. no lab conditions and b. just tested with a single device). Humm. Time to go for some facts, and do some calculations.


Hard data


I already posted some hard data on battery consumptions of components as answer to the question What can I do to increase battery life on my Android device?, more than half a year ago. So now I picked the relevant values, made an average over the two devices, and -- I admit -- slightly adjusted things to reduce differences:



  1. I took the best GSM (2G) speed possible to make 2G seem faster


  2. I took worse conditions to "slow down" UMTS (3G) to conditions which should be met even in areas where it was not improved to the "the latest cutting-edge" (oh, speaking of "edge": 2G assumes EDGE here).


And now I've got some surprising answers: Whether 2G saves more juice than 3G, or vice versa, depends on how you use your device. I created 4 different "usage-groups", and added a 5th special case at the end. Here are my results:




Few phone minutes, few data


Yeah -- that's me: 150..300 minutes talk per month, that makes not more than an average of 5..10 min per day. I have a 50 MB data flat, and hardly ever use it up (which makes for ~ 1.5 MB/day). So I'm mostly left with "standby":



  • ~UMTS StdBy 15 mW

  • ~GSM StdBy 10 mW



Consider that your screen uses 400..800 mW on average when turned on, a difference of 5 mW can safely be ignored. Besides, the little data even compensate -- but I get ahead of myself.




The 24/7 caller with no time for data


...better switches to 2G:



  • ~UMTS Tel 800 mW

  • ~GSM Tel 400 mW


As you can see, when on-call, 3G uses about twice as much juice than 2G would use (and you don't speak faster on 3G -- a call is a call, and will take the same time). So if you spend a lot of time in calls, and have only little data traffic, you're much better off with 2G/GSM.





Few phone minutes, but big data sucker


Here comes the big surprise: This group saves a lot when sticking with 3G/UMTS:



  • ~UMTS XFER 1200 mW

  • ~EDGE XFER 1000 mW


Doesn't look like a huge difference? OK: looking on "how much does it suck per minute" might not make the big deal. So we need a second component:



  • ~UMTS speed dl/ul 7/1 MBit/s (HSDPA/HSUPA)

  • ~EDGE speed dl/ul 200/100 kbit/s



You see I assumed max speed for EDGE, but not the state-of-the-art (20 MBit/s downstream) for UMTS. UMTS coverage might differ between areas, but the 7+ MBit/s should be available everywhere. Now let's look how long the download/upload of 1 MB data takes, and how much juice that corresponds to:



  • ~UMTS 1MB dl/ul 1s/8s ~ 1200/9600 mWs

  • ~EDGE 1MB dl/ul 40s/80s ~ 40.000/80.000 mWs


That's about a factor of 1:7 for upload, and even more than 1:30 for download!


So yeah: This group is definitely better off sticking to 3G!!!




Multi-Tasker: 24/7 on call while using full data



This now very much depends on what "full data" stands for, and if you're really a 24/7 on-call-boy (or girl). No clear answer for this, you must put your own data into the equation and do the calculation. It's rather 50:50 -- as with group #1, you might run a "zero growth" -- or tend to either group 2 or group 3.




Special case: The "hopper"


Especially in rural areas, coverage might be, humm, "slippery". Your device might be permanently toggling between 2G and 3G, always on the hunt for the better signal. Here all the above might become relative, as the toggling itself is drinking the juice. If you are in such a situation: Check to which of the 4 groups above you fit best, and fix your device to either 3G or 2G, depending on.


Btw: A similar situation would be if you've got the idea to toggle between 2G/3G whenever you switch your display off/on. As the toggling requires up to 10s full-power (to find the corresponding stations; 2G and 3G use different frequencies), you wouldn't really "save juice".




Epilog


Yepp, I completely forgot about 4G/LTE. But incidentally. First: I have no 4G/LTE device for a self-experiment. Second: I have no "hard data" on 4G/LTE. So all I could do is guessing. Doing that, OK, OK: It most likely will be the same as above -- just increment the numbers by one :)


wi fi - How to make Android WIFI connection static and use always mobile internet?


I want to use always my mobile internet although I am connected to the wifi network. So I want to make my connection static.



OS: OO 3.1
Phone: Oneplus 2
Related thread: here



Answer



From the linked post your WiFi is not good enough, so combining WiFi and mobile data may work


Speedify claims to do this ( not tried by me)



Combine your Wi-Fi and Mobile Data Connections for Fast Unbreakable Connectivity



external sd - "Cannot Move App Not Enough Storage Space" Error Message



I have a Huawei Y635 phone running Android version 4.4.4 with 1GB of RAM and 8GB phone storage. I bought an 8GB SD card to transfer some apps as the phone memory is nearly full. The SD card has 7.19GB of free space but when I try to move apps I get the error message stating there is not enough space. I have made the SD card the default storage location. The app I was trying to move was only 92.09MB. I have read some of the other posts but can't seem to get answer to this specific query. Any help greatly appreciated.




4.0 ice cream sandwich - How to turn of Google Samsung Nexus Galaxy `3g`/`mobile data usage` warning?


After turning data mobile usage warning on as described here


The exceeded-limit notification stay in my notification list which is very annoying. I cannot remove it - ie. I just need it to notify me then I can remove, later on if I start using and the limit exceeds again, notify me again :)


If you know how to, please share.



enter image description here



Answer



Click the notification which will open Data usage settings and move the orange warning bar above data usage level.


Data Usage screen


Next warning will appear when the warning level is exceeded again.


samsung galaxy s 2 - Cannot restore Kies backup after firmware upgrade

I backed up my Samsung Galaxy S2 on Kies before updating to Ice Cream Sandwich. After the upgrade I tried to restore, but the restore fails ...