Measuring Cellular Signal Strength

Measuring cellular signal strength

I briefly looked at the VAFieldTest project located at Github.

There seems to be getSignalStrength() and register_notification() functions in Classes/VAFieldTestViewController.m that might be interesting to you as they call into CoreTelephony.framework.

I am pretty confident that some of the used calls are undocumented in the CoreTelephony framework documentation from Apple and therefore private - any app in the AppStore must have slipped passed inspection.

Measuring real phone signal strength on a mobile phone

Here's a solution I found for people who are still looking for an answer:

Some windows mobile HTC mobile phones have a program called fieldtest.exe which contains the information I need (probably other phones also have that, I've only tested with a specific HTC but from search on google I understand that most HTC WM phones it). The fieldtest program not only has the exact signal strength for the phone, but also a big amount of other very useful telephony information not accessible otherwise.

The only problem is how can you use the data of that program in your process since all the values are stored in a ListView.

Well, that was the point of another question I had posted.

So, the solution is to run the fieldtest program and extract / steal the required values from there !

iPhone signal strength

Apple does not allow developers direct access to the low-level wireless API functions. It is possible to include some of these functions in your application (see the iphone-wireless project for example) but your application will not be accepted for inclusion in the iTunes store.

Previously some applications were allowed to do this (WiFiFoFum for example) but these applications have been removed from the store for using private APIs.

Measuring cellular strength in Ionic Framework

Ionic is a frontend framework so no you can't read low level network related data via its API. Also if you are referring to ionic-native, thats only a wrapper around the APIs exposed by different cordova plugins to provide some convenience features such as autocomplete, promise-callbacks and change-detection out of the box.

What you can do is searching for a cordova-plugin which can deliver this kind of information (for example: cordova-plugin-signal-strength (Android only)). Another possibility is to create your own plugin and implement the native parts yourself.

How to detect at realtime the increase/decrease of cellular signal power in iOS

To detect cellular signal power I use CTRadioAccessTechnologyDidChangeNotification.

You can try this code :

import CoreTelephony

private var info: CTTelephonyNetworkInfo!

func createObserver() {
self.info = CTTelephonyNetworkInfo();
NSNotificationCenter.defaultCenter().addObserver(self, selector: "currentAccessTechnologyDidChange",
name: CTRadioAccessTechnologyDidChangeNotification, object: self.observerObject)
}

func currentAccessTechnologyDidChange() {
if let currentAccess = self.info.currentRadioAccessTechnology {
switch currentAccess {
case CTRadioAccessTechnologyGPRS:
print("GPRS")
case CTRadioAccessTechnologyEdge:
print("EDGE")
case CTRadioAccessTechnologyWCDMA:
print("WCDMA")
case CTRadioAccessTechnologyHSDPA:
print("HSDPA")
case CTRadioAccessTechnologyHSUPA:
print("HSUPA")
case CTRadioAccessTechnologyCDMA1x:
print("CDMA1x")
case CTRadioAccessTechnologyCDMAEVDORev0:
print("CDMAEVDORev0")
case CTRadioAccessTechnologyCDMAEVDORevA:
print("CDMAEVDORevA")
case CTRadioAccessTechnologyCDMAEVDORevB:
print("CDMAEVDORevB")
case CTRadioAccessTechnologyeHRPD:
print("HRPD")
case CTRadioAccessTechnologyLTE:
print("LTE")
default:
print("DEF")
}
} else {
print("Current Access technology is NIL")
}
}

I've tested it on my iphone by turning on/off airplane mode and I've noticed that sometimes I have to wait a bit more time for notification. So maybe the better way in your case will be just called info.currentRadioAccessTechnology and get the result when you need it. Of course, remember to remove observer when you don't need it anymore.

Apple documentation about this :

currentRadioAccessTechnology
Discussion:
The current radio access technology the device is registered with. May be NULL if the device is not registered on any network.

Additionaly, I do some research and I found an interesting answer which might help you.

Simple Obj-C version :

#import <CoreTelephony/CTTelephonyNetworkInfo.h>


CTTelephonyNetworkInfo *ctInfo = [CTTelephonyNetworkInfo new];
[[NSNotificationCenter defaultCenter] addObserverForName:CTRadioAccessTechnologyDidChangeNotification object:nil queue:nil usingBlock:^(NSNotification *note) {
NSLog(@"current access radio access did change to : %@", ctInfo.currentRadioAccessTechnology);
}];


Related Topics



Leave a reply



Submit