Is there a way to detect changes in mnc/mcc?

612 views
Skip to first unread message

Brendan Johan Lee

unread,
Oct 8, 2010, 7:36:03 PM10/8/10
to Tasker
I've tried to find a way to detect changes in mnc/mcc in tasker
without luck. Is there a way of doing this? If not, is it something
that could be implemented without to much trouble?

Best regards
Brendan Johan Lee

Pent

unread,
Oct 9, 2010, 3:40:56 AM10/9/10
to Tasker
> I've tried to find a way to detect changes in mnc/mcc in tasker
> without luck. Is there a way of doing this? If not, is it something
> that could be implemented without to much trouble?

What is/are those things ?

Pent

Brendan Johan Lee

unread,
Oct 9, 2010, 5:11:47 AM10/9/10
to Tasker
mcc = mobile country code - uniquely identifies which country you are
in
mnc = mobile network code - together with mcc uniquely identifies what
operator you are connected to

Both of them together with la/cellid their uniquely identify
universally the cell you are connected to.

There are several reasons why such information should be available.
First of all it would be nice to preform certain actions based on what
country one is in, or what operator one is connected to, but more
importantly the cell-near feature is not safe without checking the mcc/
mnc values. The la/cellid-values are only unique within your current
operator. Thus the cell-near feature will create false positives when
traveling abroad. This could end up being very expensive if one for
example created a task that turns on mobile networking and downloads a
large file based on the cell-near feature and one happened to get a
false positive somewhere abroad. In addition false positives are never
a good thing.

In addition I've noticed that the %CELLID value is the la and cellid
values merges. They should actually be split to %CELLID and %LA so one
could do actions based on la (la = location area) alone. The size of
an la varies from operator to operator, but many operators lay out
their la so that they cover a single city, county or similar, thus
being able to perform actions based on la could be a very nice
feature.

(mcc and mnc are available through the getNetworkOperator() function
in TelephonyManager. Note that this is not the same as
getSimOperator())

Best regards
Brendan

Pent

unread,
Oct 9, 2010, 5:43:29 AM10/9/10
to Tasker
> > > I've tried to find a way to detect changes in mnc/mcc in tasker
> > > without luck. Is there a way of doing this? If not, is it something
> > > that could be implemented without to much trouble?

> mcc = mobile country code - uniquely identifies which country you are
> in
> mnc = mobile network code - together with mcc uniquely identifies what
> operator you are connected to

Thanks for the info. Will ponder :-)

You can get LA by splitting %CELLID in the meantime.

Pent

Pent

unread,
Oct 9, 2010, 5:46:23 AM10/9/10
to Tasker
I was considering replacing GSM/CDMA in the cell IDs with the network
operator, but
saw in the TelManager doc for getNetworkOperator:

Result may be unreliable on CDMA networks (use getPhoneType() to
determine if on a CDMA network).

...which worries me.

Pent

Brendan Johan Lee

unread,
Oct 9, 2010, 6:22:59 AM10/9/10
to Tasker
There is a reason for this. CDMA and GSM/UMTS are two completely
different systems that use completely different systems for
identifying cells. Even using the cellid from the GSM/UMTS telephony
class will be unreliable when on a CDMA network. Thats the reason the
telephony class is split into subclasses for CDMA and GSM/UMTS.

When dealing with cellidentification (or similar) on mobile phones the
only correct way of doing it, from the technologies point of view, is
having completely separate values for GSM/UMTS and CDMA networks.
Trying to merge them together into one function only creates problems.
This should also not be a problem since CDMA and GSM/UMTS are
completely incompatible and one will never be switching between
different network types.

Personally I would recommend you to do exactly that (split your
functions). Anything that has to do with the network state of the
phone should be provided in duplicate. One for CDMA networks and one
for GSM/UMTS networks, and people should use what ever variables/
functions that are available on their phone.

Unfortunately this probably means some structural changes to your
application that I'm not to keen on "pushing" on you considering how
much effort you actually must have put into the tasker software. But
doing this kind of split will most likely save you a lot of effort in
the future. Trying to merge CDMA and GSM/UMTS network features into a
single function will cause that function to break very often (somebody
starts using the application on a CDMA network that does
identification a little different, a new phone is released using a
different baseband software, or any time new features are added to the
network functions of you software). So I would definitely urge you to
split the function in two.

And by the way. If you have any questions about this kind of stuff,
feel free to contact me (email or what ever). I've been GSM "hacking"
since 1997, and it's been my one big hobby, and at the moment I'm
finally writing my masters thesis on location estimation and
positioning in GSM/UMTS-networks, and I'd be happy to help if you need
any help/information.

Saqeb Akhter

unread,
Nov 11, 2010, 12:51:10 AM11/11/10
to Tasker
Being able to tell what mnc/mcc im currently connected to would be
amazing, i'm currently having to battle with my phone not currently
detecting my roaming state i.e) im roaming but it's not thinking it is
so the turn off data when roaming feature doesn't work...if i could
pull the mnc/mcc info in tasker i could use tasker to shut the data
off if mnc/mcc != my home network...this would be really great.

Vicom

unread,
Jan 5, 2015, 2:56:22 AM1/5/15
to tas...@googlegroups.com
Was this ever implemented.?. these variable will really come in handy . MCC/MNC

This message and attachments are subject to a disclaimer. Please refer to http://www.it.up.ac.za/documentation/governance/disclaimer/ for full details.
Reply all
Reply to author
Forward
0 new messages