The XDA LG QPair Developer Challenge Voting Has Begun!

It seems like it was just yesterday that weannounced that we had paired up with LGto … more

Major Update for the Sony Smartwatch 2 Brings DND and More

With the wearables landscape now dominated by Android Wear and Pebble, its … more

How to Root Android Wear 5.0.1 Lollipop Devices – XDA TV

The Lollipop update for Android Wear devices has hit the market and people are … more

Android 5.0.2 and New Factory Images For Nexus 7 (Wi-Fi) Available

Android 5.0 is has been publicly available since early November, and the … more

Welcome to XDA

Search to go directly to your device's forum

Register an account

Unlock full posting privileges

Ask a question

No registration required
Post Reply

WIFI/Mobile Data as a percentage?

OP Houndcatcher

9th January 2014, 11:43 AM   |  #1  
Houndcatcher's Avatar
OP Senior Member
Flag Lancing
Thanks Meter: 10
 
107 posts
Join Date:Joined: Oct 2013
Donate to Me
More
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?
9th January 2014, 12:47 PM   |  #2  
kwerdenker's Avatar
Recognized Themer
Flag Probably the Zooper Forums
Thanks Meter: 2,394
 
1,421 posts
Join Date:Joined: Apr 2010
Donate to Me
More
Quote:
Originally Posted by Houndcatcher

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?
Last edited by kwerdenker; 9th January 2014 at 12:50 PM.
9th January 2014, 02:24 PM   |  #3  
Houndcatcher's Avatar
OP Senior Member
Flag Lancing
Thanks Meter: 10
 
107 posts
Join Date:Joined: Oct 2013
Donate to Me
More
Quote:
Originally Posted by kwerdenker

Could you please clarify, what you mean with "percentage"? Percentage of available signal levels? Percentage of signal quality?

Sorry looking for levels if poss
11th January 2014, 10:04 AM   |  #4  
Houndcatcher's Avatar
OP Senior Member
Flag Lancing
Thanks Meter: 10
 
107 posts
Join Date:Joined: Oct 2013
Donate to Me
More
Not possible then maybe?
11th January 2014, 12:03 PM   |  #5  
kwerdenker's Avatar
Recognized Themer
Flag Probably the Zooper Forums
Thanks Meter: 2,394
 
1,421 posts
Join Date:Joined: Apr 2010
Donate to Me
More
Quote:
Originally Posted by Houndcatcher

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)
The Following User Says Thank You to kwerdenker For This Useful Post: [ View ]
11th January 2014, 04:48 PM   |  #6  
Houndcatcher's Avatar
OP Senior Member
Flag Lancing
Thanks Meter: 10
 
107 posts
Join Date:Joined: Oct 2013
Donate to Me
More
Quote:
Originally Posted by kwerdenker

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?
Last edited by Houndcatcher; 11th January 2014 at 04:54 PM.
11th January 2014, 05:05 PM   |  #7  
kwerdenker's Avatar
Recognized Themer
Flag Probably the Zooper Forums
Thanks Meter: 2,394
 
1,421 posts
Join Date:Joined: Apr 2010
Donate to Me
More
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
11th January 2014, 05:11 PM   |  #8  
Houndcatcher's Avatar
OP Senior Member
Flag Lancing
Thanks Meter: 10
 
107 posts
Join Date:Joined: Oct 2013
Donate to Me
More
Quote:
Originally Posted by kwerdenker

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

Post Reply Subscribe to Thread
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes