OpenCellId

Categories

  • No categories

Changer la langue

Follow us :

twitter link

Tools Box

SEARCH

WhereRYou: OpenCellID Blackberry client

Posted in: Project Opencellid by admin on 24 January 2009 | No Comments

WhereRYou is an OpenCellID Blackberry client, created by Aris Volcoff. This application works in the background and use the OpenCellID Backend, so not really graphical, but here is a small snapshot:

Here is is

OpenCellID client for SonyEricsson phones with sources

Posted in: Project Opencellid by admin on | No Comments

Pär Bertilsson have created a nice client that can be used on SonyEricsson phone that use an external bluetooth receiver to fill the OpenCellID database! Again, thanks to SonyEricsson to be the first one to implement an easy way to access to CellID from the phone, and thanks to Pär for creating this nice client and giving access to the J2ME source code.

The full description of the program: OpenCellID for Sony Ericsson JP-7.3+/JP-8

OpenCellID Client for Windows Mobile: OpenCellClient

Posted in: Project Opencellid by admin on 29 December 2008 | No Comments

Welcome to the latest OpenCellID client, running on Windows mobile: OpenCellClient.

This project will be integrated with another project from the same team: RemoteTracker.
Enjoy and thanks for this contribution.

WhereAmI: new Blackberry application for OpenCellID

Posted in: Project Opencellid by admin on 17 December 2008 | 3 Comments

New application for blackberry from Ari Volcoff, using OpenCellID: WhereAmI!

product:242952WhereAmI?
Windows Mobile client for OpenCellID

Posted in: Project Opencellid by admin on 30 October 2008 | No Comments

Just forgot to say this, but dale lane created a Windows mobile client to fill OpenCellID database. All the informations are available on his blog: Programmatically getting the CellID from your Windows Mobile phone. The post contains also some great informations related to CellID for Windows Mobile, informations which are not always so easy to find!

screenshot of FindMe
Reblog this post [with Zemanta]
Phonelocator joining OpencellID

Posted in: Project Opencellid by admin on 10 October 2008 | 2 Comments

Phonelocator just joined OpenCellID, and submitted millions of mesures and ten thousands of Cells! (see our stats )
Logo-medium

Phonelocator is a native S60 realtime GPS tracking application for Nokia
S60 phones developed by Birkett Enterprise Ltd. It allows you to view the
location of your phone and a trail of where it has been using this
website. Phonelocator has advanced features like “Intelligent Update” that
reduces the amount of data sent by the application and “Battery Saver”
that turns off the GPS when the phone is stationary or the GPS signal is
too weak. Phonelocator can be run in the background and started when your
phone is booted.

So thanks to Birkett Entreprise for this, our coverage is much better than before on many countries!

Two new functions added in OpenCellID API

Posted in: Tutorial Opencellid by admin on 7 September 2008 | No Comments

Just added two new useful functions in the OpenCellIDAPI:

measure/list
to list your measures
and
measure/delete to delete on measure

This is usefull if you made some errors…

Also note that entry with either lat or lon equals to 0 will not be accepted, as this is a frequent error…

MyOpenPos: Open Source positionnig

Posted in: Tutorial Opencellid by admin on 8 July 2008 | 6 Comments

In the first part, we’ve introduced CellID, and OpenCellID – the OpenSource database of CellID – and we have created a small program to retrieve position from CellID information.

This time, we will go on step further and display a map, based on open source data OpenStreet map, on your mobile phone, based on your location.

This will be close to the experience of Google Map “MyLocation” on mobile, and will run on top of JavaME.

So to achieve this, we will use J2memap component. J2memap is a library that we have created to develop our flagship product, a mobile tourist guide. But the purpose of this library is to easily create mobile application based on a Map. This library is free for non commercial use.
This component can display map based on any tile provider, like Google, MSN or others, but also OpenStreetMap. On top of this, you can add extra layers as bitmap or KML, GeoRSS, GPX and much more.
A complete description of the feature is available at http://j2memap.8motions.com .

The HelloMap program!

So how to use it? It’s very simple, you can use MapDisplay. The simplest J2memap program is like this one:

import com.eightmotions.map.MapDisplay; import com.eightmotions.util.UtilMidp; import javax.microedition.midlet.*; import javax.microedition.lcdui.*; public class HelloMap extends MIDlet { public void startApp() { UtilMidp.checkMIDP(this); //Initialise the utility library... Display.getDisplay(this).setCurrent((new MapDisplay()).getCanvas()); } public void pauseApp() {} public void destroyApp(boolean unconditional) {} }

You see, just create a MapDisplay and display the related Canvas. Now, you can play with a map, move it, etc…

The result looks like good already:

Using OpenStreeMap as a Map provider

So, we need now to do two things: integrate OpenStreetMap, and use OpenCellID feature.
The OpenStreeMap integration is quite easy: you can implement or replace layers, by implementing the MapOverlay interface.
But even better, there is the “GenericOverlay” classes, which take care of most of the hard complex, and just need an URL, and a few settings:

MapOverlay openStreeMap=GenericOverlay(“OpenStreeMap”,”http://tile.openstreetmap.org/!z!/!x!/!y!.png");

The URL contains some special token, the ones between ‘!’ like ‘!x!’,’!y!’, and ‘!z!’.
These are dynamically replaced by the corresponding value at run time, they are related to lon, lat and zoom level.
I will not go into detail of these values, they are beyond the scope of this article, but you should know that you
have others values, like !minLon!,!minLat!, etc…. In other words, this could be very easily used to connect to a WMS server….
Then we just tell the engine to display it:

myMap.setMapProvider(0,openStreeMap);

Retreiving results of OpenCellID

At this level, we will already a map application where we can zoom in /out connected to OpenStreeMap. We just reuse the code of our last week sample, and add the following at the end of the treatment of the OpenCellID result:

.... int pos=res.indexOf(','); String latStr=res.substring(0,pos); int pos2=res.indexOf(',',pos+1); String lonStr=res.substring(pos+1,pos2); myMap.setInfoOnScreen(latStr+" "+lonStr); float lat=Float.parseFloat(latStr); float lon=Float.parseFloat(lonStr); // If we are in a lower zoom mode, go into an higher mod if(myMap.getZoom()<10)myMap.setZoom(14); // If the 'current location' is not yet created, do it, and add it in the current track if(lastLoc==null){ lastLoc=new MyLoc(); t.addLoc(lastLoc); } lastLoc.setLonLat(lon,lat); myMap.goTo(lastLoc);

Adding a custom Marker: using Marker

What is this MyLoc element? Using the libray, you can add element on top of the map, like pins, markers, etc… You can use picture to do your own marer, but in this example, we will create our own custom marker, an empty circle
To do this, we just extends the default Marker, add the size field/

Note: at this stage, the range value returned by the API is wrong, so we won’t use it and we will set a predefined size for your cell range….

class MyLoc extends Marker{ public int range=1000; public MyLoc(){ super(); } public void paint(Graphics g,int inpx,int inpy,int offx,int offy,int w,int h,int zoom){ int x=offx+w/2+(px-inpx)/(1<<zoom); int y=offy+h/2+(py-inpy)/(1<<zoom); g.setColor(0x8080A0); g.fillArc(x-6,y-6,12,12,0,360); g.setColor(0x0000C0); g.drawArc(x-50,y-50,100,100,0,360); } }

Conclusion

The result is the following: when you press the “LocateMe” button on your phone, a request will be sent to the OpenCellID server, trying to see if we find a correspondence between this CellID and a location. If this is found, then, we move the map to this location.

A few shortcuts are available:

1 to zoom in, 3 to zoom out, 5 to change of map provider

Important: as discussed in the first article, only latest SonyEricsson provides access to CellID on JavaME. On others phone, if you attempt to use this feature, the program will warn you through a “this phone does not support CellID”.

The complete source code is available here.The compiled program is available here, with jad and jar.

If you have any questions, remarks, comment, feel free to ask: t.landspurg@8motions.com

Zemanta Pixie
Adding location to a non GPS phone : using OpenCellID

Posted in: Tutorial Opencellid by admin on 26 June 2008 | 17 Comments

1) Introduction

In this two parts article, we will introduce mobile positioning with CellID, and the open source database of CellIDs: OpenCellID. We will see how to use it through a simple sample. The second part will demonstrate how to use OpenCellID with OpenStreeMap and the 8Motion library to create a full interactive mobile mapping experience in JavaME, each of these examples being less than 100 lines of code.

2) What is CellID

We all know that GPS will be deployed in the vast majority of phones in the future. But now, only a few high end handsets are GPS enabled.
An alternative, available since a long time, but gaining momentum recently is CellID based location. What is CellID? A CellID is the number given to a specific cell (the radio tower to which your handset is connected) . In most of the case, it’s the closest tower to your location. So by knowing this tower, you know where the user is. But a tower can cover a huge area: from a few hundred meters, in high density area, to several kilometers in lower density area. That’s why CellID accuracy is lower than GPS accuracy, but this present a very good alternative.

CellID has become recently more popular, mainly thanks to his nice integration into GoogleMap mobile.

3) OpenCellID

So this sounds great, let’s just get the phone cellID, so we will have his location. The issue is that the location of cells is not a public information. Operators keep this private, for many reasons:

  • They don’t want to give tower location to their competitors
  • They use this as an extra revenue income, as they provide paying services to retrieve cell location.

That’s why we have set up a service called “OpenCellID”. OpenCellID.org is an open source database of CellID, serving two purposes:

  • Everybody can create an application gathering information about cell locations, and send these information to the OpenCellID server, improving the coverage
  • The database can be used by other applications to get the location of a cell, according to his cell id.

How to use OpenCellID (http://www.opencellid.org/api )

The API is a simple REST api. There are only two relevant calls: measure/add and get/cell

measure/add to add a measure of cell. This is used to by application which wants to add information to the database. These application produce content for the OpenCellID database. To use it, you need to require a key to OpenCellID.org. The key is used to track applications providers, and ensure that no fake data are inserted into the system.

Examples:

http://www.opencellid.org/measure/add?key=myapikey&mnc=1&mcc=2&lac=200&cellid=234&lat=3.42&lon=3.12

Replace myKey with the key that you received while registering at OpenCellID. This will tell the serveur that a client found a cell of id 234, for mcc=1, mcc=2 and the position 3.42,3.12 …Be careful: all informations are in decimal, while some handsets (sonyericsson for instance) provides lac and cellid in hexa, so you will need to convert them before calling the API.

Cell/get is used to get the position associated with a cell. You just need to give mcc,mnc,cellid and optionnaly lac.

http://www.opencellid.org/cell/get?mcc=250&mnc=99&cellid=29513&lac=0

You need to provide at least mcc, mnc (mobile country code, and mobile network code of the operator), and cell id. Lac (location area code) is an optional parameter, and will help to find an alternate position if cell is not found.
In return, the API will return a simple XML, like this one:



<rsp stat="ok">
<cell lat="57.8240013122559" lac="0" lon="28.00119972229" mcc="250" nbsamples="38" range="0" cellid="29513" mnc="99">
</cell></rsp>

Lat and lon are the coordinate of the cell, based on 38 samples…

If needed, you can use the optional parameter “fmt” to specify an output format,:

http://www.opencellid.org/cell/get?mcc=250&mnc=99&cellid=29513&lac=0&fmt=txt

will return something like this:

57.8240013122559,28.00119972229,250,99,0,29513,100,38

Same informations than before, but in a much compact form (see the API description for a complete description).

Others API are under development, to retrieve operators from mcc/mnc for instance.

4) Sample program:

So let’s use OpenCellID to create a small program, written in JavaME, which will just get the CellID of the phone , do a request to the OpenCellID server and display the results.

First, let’s get the CellID:

We use SonyEricsson specific properties. There properties are non standard, and only available on some devices.

// These properties are implemented on latest SonyEricsson phone // This does not work on others (Nokia, etc...) String cellid=System.getProperty("com.sonyericsson.net.cellid"); String mcc = System.getProperty("com.sonyericsson.net.cmcc"); String mnc = System.getProperty("com.sonyericsson.net.cmnc"); String lac = System.getProperty("com.sonyericsson.net.lac");

Cellid is of course the cell id, mcc is mobile country code, mnc is mobile network code and identify the operator and the country (cmcc stands for current mcc). That’s all we need to find our location.

Then, verify if theses properties are supported:

String info="This phone does not support CellID"; if(cellid!=null){ info="Cell:"+cellid+" mcc:"+mcc+" mnc:"+mnc+" lac:"+lac; url="http://www.opencellid.org/cell/get?cellid="+Integer.parseInt(cellid,16)+ "&mcc="+mcc+"&mnc="+mnc+"&lac="+Integer.parseInt(lac,16)+"&fmt=txt"; cellInfo.setString(info); Thread t=new Thread(this); t.start(); posInfo.setString("Requesting position..."); }

In this part, we have created the URL to request information on the server, and start the fetch of the information in a separate thread:

public void run(){ try { HttpConnection cnx = (HttpConnection)Connector.open(url); InputStream is=cnx.openInputStream(); StringBuffer b=new StringBuffer(); int car; while( (car=is.read())!= -1){ b.append((char)car); } is.close(); cnx.close(); String res=b.toString(); if(res.startsWith("err")){ posInfo.setString("Cell not found!"); }else{ int pos=res.indexOf(','); String lat=res.substring(0,pos); int pos2=res.indexOf(',',pos+1); String lon=res.substring(pos+1,pos2); posInfo.setString(lat+" "+lon); } } catch (IOException ex) { ex.printStackTrace(); posInfo.setString(ex.toString()); } }

If the API call return something starting with err, we are probably in error. Otherwise, we will have our current cell id positioning.

And that’s done. The complete source code is available here.The compiled program is available here, with jad and jar.

So, what happens if the CellID is not in the database? Then the program will display an error. You can improve the accuracy of OpenCellID by discovering more cells. Check OpenCellID to know how to do it.

Next part will improve this first version, by creating an interactive program displaying the location on a map, using J2memap free component…

Watchee: another OpenCellID client

Posted in: Project Opencellid by admin on 14 May 2008 | 1 Comment

watchee.net - stay connectedTake a look at “Watchee.net“,another client gathering the OpenCellID database! And thanks to Marcel for all his relevant feedback to OpenCellID API! Good luck…..