Finding your Location without GPS in J2ME

Off late, the Location Based Services are the talk of town and truly the potential for those services are enormous. But the limiting factor for the wide spread use of LBS is the means of delivering those services. The best means I would say is through their mobile phones, thanks to the ever increasing penetration of the mobiles and nowadays it is hard to find anyone who is not having a mobile phone. The issue here is the finding the location of the mobile phone to deliver the required services. Sure, there are phones with GPS but they are not widespread and the effective alternative would be to use the mobie phone network to find the location of the phone.

A GSM mobile phone keeps track of four parameters that can be used to find the approximate location of the mobile they are MCC (Mobile Country Code), MNC (Mobile Network Code), LAC (Location Area Code) and CellID. Combining these four paramenter you can zero in on mobile phone's location with an accuracy of 1KM (Urban areas) to 3KM (Sub-urban and rural areas), which is quiet sufficient for some Loaction Based Services.

There are some websites that collects the cellid's across the globe like

  1. http://www.cellspotting.com/
  2. http://www.opencellid.com/

or you can sure hop into your vehicle and roam around the city to make your own database.

Now the gotchas, there is no way to extract the cellid information from most of the phones in the J2ME environment. But the sony ericsson has thoughtfully made the cellid information accessible in the J2ME environment, refer Page 72 of SE Developer Guidelines Document. But it will work only on Sony Ericsson phones that has JAVA Platform 7.3 and above.

Now, using the below APIs' you can get the CellID information in your J2ME Application


For Home Network
System.getProperty("com.sonyericsson.net.mcc");
System.getProperty("com.sonyericsson.net.mnc");

For current Network
System.getProperty("com.sonyericsson.net.cmcc");
System.getProperty("com.sonyericsson.net.cmnc");

System.getProperty("com.sonyericsson.net.cellid");
System.getProperty("com.sonyericsson.net.lac");

Now, there is a small but usefull application called Location Alarm written based on the cellID information. Try it out.

Post a comment if you have any queries.

22 Responses to "Finding your Location without GPS in J2ME"

Unknown responded on September 29, 2008 at 1:30 AM #

FYI the package name is incorrect. IE it should be

com.sonyericsson.net.mnc

and not

com.sonyericsson.java.mnc

Kind regards
Søren Winther Madsen
mobilePeople
Developer

Raja Nagendra Kumar responded on October 23, 2008 at 4:15 AM #

Hi Soren and the Original Author,

Nice to see this post and on following the same, we are able to get the location on Sony W910i. However the value we see is some thing lie 17c2 etc..

Would it be possible to see the value assocaited with it.. On the Phone it shows the location as Nandi Gardens .. which is our current location

On N73 though it is 3rd edittions s60 fp2, the values are still null. Did any one had any luck on this..

Regards,
Raja Nagendra Kumar,
C.T.O
www.tejasoft.com

Karthik responded on November 2, 2008 at 12:32 AM #

Hi Søren
Thanks for pointing this out. I have corrected it.

Hi Raj,
These are SE specific API's and will work only in SE phones with JP7.3 and above.

The location name you see in the standby screen is not related to the values retrived using these API's. The area information string is transmitted separately by the cellular network.

Rambling Dad ... responded on December 12, 2008 at 12:10 PM #

I tried it on W810i and it DOES NOT work but works like a charm on K610i

Dharmayu Purohit responded on February 25, 2010 at 10:39 PM #
This comment has been removed by the author.
Dharmayu Purohit responded on February 25, 2010 at 10:41 PM #
This comment has been removed by a blog administrator.
RPP shanmuganathan responded on May 24, 2010 at 10:07 AM #

hi friend
can anyone post the coding for nokia

Sam responded on March 20, 2011 at 10:37 PM #

Remarkable work! The content provided was invaluable. I really hope you keep up the excellent job done.
Garland Locksmith
Bayonne NJ Locksmith
Locksmith Concord
Locksmith Palo Alto CA
Locksmith Palo Alto
Palo Alto locksmith
Locksmith Palo Alto CA

nalaka jayarathne responded on March 21, 2011 at 11:49 AM #

works for k800 tnx..

Christian Louboutin sale responded on July 13, 2011 at 6:57 PM #

Cheap louboutin shoes online store strongly recommend consulting a leather care professional or cobbler for specific advice and maintenance. Should you need to repair or refurbish an item purchased online we are happy to suggest the following repair specialists.
General care for all leathers:
1 Keep leather surface clean and dry using a dry, soft cloth.
2 Always store your footwear/ handbag away from light and heat.
3 Protect leather goods from rain and humidity.
4 When not in use, store your footwear in the Christian Louboutin dust bag provided
5 Avoid contact with abrasive surfaces.

Christian Louboutin sale responded on July 17, 2011 at 8:27 PM #

http://blogs.ugidotnet.org/alessage/archive/2010/10/28/stanco-del-lorem-ipsum.usa-fillerati.aspx
http://blogs.ugidotnet.org/jc/archive/2006/08/31/47059.aspx
http://blogs.yogajournal.com/yogabuzz/2010/08/pretty-woman-converts-to-hindu-woman.html
http://blogsdelagente.com/astrologia-amor-y-finanzas/2010/08/21/horoscopo-astro-vedico-jotishi-mundana-politica-argentina/
http://blogsisters.blogspot.com/2009/02/dems-still-being-blackmailed-by-gop.html
http://booksinq.blogspot.com/2008/02/cats-out-of-bag.html
http://bookwormygirl.blogspot.com/2009/04/one-deadly-sin-by-annie-solomon.html
http://bostonia.blogspot.com/2005/03/boston-starbucks-eicl-starbucks.html
http://boybutter.blogspot.com/2010/03/boy-butter-booth-at-black-party-expo.html
http://brazosbookstore.com/inprint-brown-reading-series
http://breathspakids.blogspot.com/2007/07/mmr-vaccine-does-not-contain-thiomersal.html
http://brew-j2me.blogspot.com/2008/05/finding-you-location-without-gps-in.html
http://bridgepro.blogspot.com/2007/04/spiral-raises.html
http://brokencontrollers.com/watch-naruto-shippuden-episode-88-xye452
http://btbgtfxxx.blogspot.com/2007/08/mainframe-by-dean-bradley.html
http://budtheteacher.blogspot.com/2005/05/something-to-think-about.html
http://buffalo.indymedia.org/content/mccarley-gardens-tenants-begin-campaign-save-their-homes

Christian Louboutin sale responded on August 18, 2011 at 8:37 PM #

everybody talks about <moncler uk , cheap moncler coatsthat are sold out everywhere. Wear cheap moncler jackets with any basic outfit to add a little bit of fun and flirtiness to your outfit.
A Babyliss Hair Straightener give your cut that hairstyle you've been longing for.
Here are the discount Christian louboutin shoes.

Logo Design Company responded on September 24, 2011 at 12:35 AM #

A lot of the information in this post has been very useful. I can definitely agree there are great needs for having or developing organizational, writing, and marketing skills.

jesus responded on February 12, 2012 at 10:41 PM #

I actually enjoyed reading through this posting.Many thanks.



J2ME Developer

Knox Karter responded on March 15, 2012 at 2:56 AM #

"Hi,
I like your blog very much! It is found me so interesting and informative... Thanks very much for sharing this amazing information over here…"
Integrated Local Map Optimization

The Linden Method Reviews responded on March 29, 2012 at 4:12 AM #

Great share, thank you for share.

Knox Karter responded on April 17, 2012 at 5:24 AM #

"Hi,
I like your blog very much! It is found me so interesting and informative... Thanks very much for sharing this amazing information over here…"

Military Logo

Application Development responded on May 8, 2012 at 1:36 AM #

Awesome blog! I will for sure drop by it more often!

Unknown responded on May 14, 2013 at 4:35 AM #

Your spectacular entry, man.I read your blog and I blog.its your article very useful and very good knowledge and information gained. Really sure, he likes what you say here, and you got it, I like clothes that claim to. Have Fun and witty you for making that continues to be nervous.
Pakistani wedding stage | pakistani wedding planner | event management companies in pakistan

Unknown responded on May 14, 2013 at 4:36 AM #

I had a great time reading your article and I found it interesting. This is such a beautiful topic that me and my friends are talking about. Thanks for this blog, we are enlightened..
maqbool Mirza | mirza maqbool

Unknown responded on May 14, 2013 at 4:37 AM #

Admire the information published.its really informative and innovative keep us posted with new updates. it was really valuable.
urdu newspaper | english newspaper | news from pakistan

Anonymous responded on April 27, 2020 at 4:52 AM #

Hi Dear,
I visit your website daily.
Your articles look great & helpful .
I feel very good reading your posts

You can visit my website Visit Now ...

I'm sure you'll keep my invitation..
Thank You..