5,600,483 Members 32,971 Now Online
XDA Developers Android and Mobile Development Forum

WIFI/Mobile Data as a percentage?

Tip us?
 
Houndcatcher
Old
#1  
Houndcatcher's Avatar
Member - OP
Thanks Meter 7
Posts: 87
Join Date: Oct 2013
Location: Lancing

 
DONATE TO ME
Default WIFI/Mobile Data as a percentage?

I'm currently using the following to return signal strength

Code:
$#NWIFI#!=?#NWSIG#:#NCSIG#$
Is there a way to edit that code to get the value returned as a percentage please?
Cheers Phil

Samsung S4 i9505
Dual Booting
Paranoid Android 4.2Beta4
Gummy 4.4.2
GT-S7275R Rooted CWM Recovery
 
kwerdenker
Old
(Last edited by kwerdenker; 9th January 2014 at 11:50 AM.)
#2  
kwerdenker's Avatar
Recognized Themer
Thanks Meter 1556
Posts: 1,232
Join Date: Apr 2010
Location: Probably the Zooper Forums
Quote:
Originally Posted by Houndcatcher View Post
I'm currently using the following to return signal strength

Code:
$#NWIFI#!=?#NWSIG#:#NCSIG#$
Is there a way to edit that code to get the value returned as a percentage please?
Could you please clarify, what you mean with "percentage"? Percentage of available signal levels? Percentage of signal quality?
Mobile: LG Nexus 4 | ROM: Paranoid Android 4.0 + Xposed | Kernel: faux Kernel
Tablet: Asus Nexus 7 (2013) | ROM: Paranoid Android 3+ | Kernel: faux Kernel


 
Houndcatcher
Old
#3  
Houndcatcher's Avatar
Member - OP
Thanks Meter 7
Posts: 87
Join Date: Oct 2013
Location: Lancing

 
DONATE TO ME
Quote:
Originally Posted by kwerdenker View Post
Could you please clarify, what you mean with "percentage"? Percentage of available signal levels? Percentage of signal quality?
Sorry looking for levels if poss
Cheers Phil

Samsung S4 i9505
Dual Booting
Paranoid Android 4.2Beta4
Gummy 4.4.2
GT-S7275R Rooted CWM Recovery
 
Houndcatcher
Old
#4  
Houndcatcher's Avatar
Member - OP
Thanks Meter 7
Posts: 87
Join Date: Oct 2013
Location: Lancing

 
DONATE TO ME
Not possible then maybe?
Cheers Phil

Samsung S4 i9505
Dual Booting
Paranoid Android 4.2Beta4
Gummy 4.4.2
GT-S7275R Rooted CWM Recovery
 
kwerdenker
Old
#5  
kwerdenker's Avatar
Recognized Themer
Thanks Meter 1556
Posts: 1,232
Join Date: Apr 2010
Location: Probably the Zooper Forums
Quote:
Originally Posted by Houndcatcher View Post
Not possible then maybe?
Sorry, this totally slipped my mind

While it's certainly possible to calculate a percentage, I doubt its usefulness. The two variables have a small, not continuous range (#NWSIG# 0-9, #NCSIG# 0-31) which results in rather choppy and larger percentage steps.
If you still want to use it though, here is the modified code
Code:
$#NWSTATE=2?(#NWSIG#/9*100):(#NCSIG#/31*100)$%
(the % has to be outside the $ signs)
Mobile: LG Nexus 4 | ROM: Paranoid Android 4.0 + Xposed | Kernel: faux Kernel
Tablet: Asus Nexus 7 (2013) | ROM: Paranoid Android 3+ | Kernel: faux Kernel


The Following User Says Thank You to kwerdenker For This Useful Post: [ Click to Expand ]
 
Houndcatcher
Old
(Last edited by Houndcatcher; 11th January 2014 at 03:54 PM.)
#6  
Houndcatcher's Avatar
Member - OP
Thanks Meter 7
Posts: 87
Join Date: Oct 2013
Location: Lancing

 
DONATE TO ME
Quote:
Originally Posted by kwerdenker View Post
Sorry, this totally slipped my mind

While it's certainly possible to calculate a percentage, I doubt its usefulness. The two variables have a small, not continuous range (#NWSIG# 0-9, #NCSIG# 0-31) which results in rather choppy and larger percentage steps.
If you still want to use it though, here is the modified code
Code:
$#NWSTATE=2?(#NWSIG#/9*100):(#NCSIG#/31*100)$%
(the % has to be outside the $ signs)
Thanks for that

Seems to half work but my WiFi signal never shows more that around 30% even when it is very strong? Seems like the second part of the code is being used for both WiFi and Cellular?
Cheers Phil

Samsung S4 i9505
Dual Booting
Paranoid Android 4.2Beta4
Gummy 4.4.2
GT-S7275R Rooted CWM Recovery
 
kwerdenker
Old
#7  
kwerdenker's Avatar
Recognized Themer
Thanks Meter 1556
Posts: 1,232
Join Date: Apr 2010
Location: Probably the Zooper Forums
I made a typing error when transferring it from my mobile. First part should read #NWSTATE#=2 not #NWSTATE=2.

Send from my secret moonbase via space carrier pigeons
Mobile: LG Nexus 4 | ROM: Paranoid Android 4.0 + Xposed | Kernel: faux Kernel
Tablet: Asus Nexus 7 (2013) | ROM: Paranoid Android 3+ | Kernel: faux Kernel


 
Houndcatcher
Old
#8  
Houndcatcher's Avatar
Member - OP
Thanks Meter 7
Posts: 87
Join Date: Oct 2013
Location: Lancing

 
DONATE TO ME
Quote:
Originally Posted by kwerdenker View Post
I made a typing error when transferring it from my mobile. First part should read #NWSTATE#=2 not #NWSTATE=2.

Send from my secret moonbase via space carrier pigeons
Should've seen that myself!! Thanks again
Cheers Phil

Samsung S4 i9505
Dual Booting
Paranoid Android 4.2Beta4
Gummy 4.4.2
GT-S7275R Rooted CWM Recovery

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes


XDA PORTAL POSTS

TasGear: A Tasker Extension for the Samsung Galaxy Gear

With wearable technology taking center stage this year, one can only expect more … more

Intelligently Place Contacts on Your Home Screen with CallWho Widget

There are plenty of ways to get your contacts to show up on your … more

Control TWRP from within Android with TWRP Coordinator

You may recall that back when TWRP2 introduced a couple of years ago, it brought with … more

Keep Track of Everything Your Device Does with Event Logger

Regardless of their OS choice, computing power users generally share one common … more