BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 12-15-2010, 08:46 PM   #1 (permalink)
Knows Where the Search Button Is
 
Join Date: Oct 2010
Model: 8100
PIN: N/A
Carrier: Software
Posts: 17
Post Thanks: 1
Thanked 0 Times in 0 Posts
Post OpenCellID doesnt work

Please Login to Remove!

Hi, Im trying to do an application for getting location using OpenCellID. I'm using this code in order to get some parameters needed by OpenCellID:

Code:
public class Geopd extends net.rim.device.api.ui.UiApplication 
{
	private boolean isNetworkType(final int type)
    {
        return (RadioInfo.getNetworkType() & type) == type;
    }

	private String networktypes()
    {
        if(isNetworkType(RadioInfo.NETWORK_UMTS))
            return "3G";
        if(isNetworkType(RadioInfo.NETWORK_CDMA))
            return "CDMA";
        if(isNetworkType(RadioInfo.NETWORK_GPRS))
            return "GPRS";
        if(isNetworkType(RadioInfo.NETWORK_IDEN))
            return "IDEN";
        if(isNetworkType(RadioInfo.NETWORK_802_11))
            return "WiFi";
        return "None";
    }
	
	public Geopd() throws IOException {
		//pushScreen(new SalutationScreen(Utilitarios.GetConnectionID()));

		String celid = "";
		
		String mcc = "";

		String mnc = "";
		
		String lac = "";
		
		String extraInfo = "";
		
		if(isNetworkType(RadioInfo.NETWORK_CDMA))
        {
			mcc = Integer.toString(CDMAInfo.getCellInfo().getSID());
			mnc = Integer.toString(CDMAInfo.getCellInfo().getNID());
            // No LAC on CDMA -- http://supportforums.blackberry.com/rim/board/message?board.id=java_dev&thread.id=2839
			lac = "";
			celid = Integer.toString(CDMAInfo.getCellInfo().getBID());
			extraInfo = networktypes()+"-"+CDMAInfo.getChannelNumber();

        } else if(isNetworkType(RadioInfo.NETWORK_GPRS)) {
        	mcc = Integer.toString(GPRSInfo.getCellInfo().getMCC());
        	mnc = Integer.toString(RadioInfo.getMNC(RadioInfo.getCurrentNetworkIndex()));
        	lac = Integer.toString(GPRSInfo.getCellInfo().getLAC());
        	celid = Integer.toString(GPRSInfo.getCellInfo().getCellId());
        	extraInfo = "&extraInfo="+networktypes()+"-"+GPRSInfo.getCellInfo().getARFCN();
        }


		String str = "celid = " + celid + "\n mcc = " + mcc + "\n mnc = " + mnc + "\n lac = " + lac + "\n extraInfo = " + extraInfo;
		
		pushScreen(new SalutationScreen(str));
		//LocationTracker lt = new LocationTracker();
		//lt.run();
		
	}

	/**
	 * @param args
	 * @throws IOException 
	 */
	public static void main(String[] args) throws IOException {
		
		Geopd _geopd = new Geopd();
		
		_geopd.enterEventDispatcher();
		

	}

}
It works fine I get all paramters but when I use them in this url given by OpenCellID url:

http://www.opencellid.org/cell/get?k...200&cellid=234

it doesnt return latitude and longitud.

So what Im doing wrong?

PS: I getting values from real device and then testing url in my Desktop Computer.

Thanks,

Demian.
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads for: OpenCellID doesnt work
Thread Thread Starter Forum Replies Last Post
HOWTO: Use BlackBerry on Generic NON-BlackBerry Data Plan Mark Rejhon BlackBerry Network 92 03-08-2014 11:26 AM
Work Email Restriction Issues? ricpac General BlackBerry Discussion 2 12-13-2007 09:23 AM
webmail on BIS fine, work email not ahw01 General BlackBerry Discussion 1 11-05-2007 11:57 AM
Blackberry Work in Korea? wangta01 General BlackBerry Discussion 10 09-27-2006 08:55 AM
Help Home address and Work address fabius Developer Forum 2 09-26-2006 05:52 AM





Copyright 2004-2014 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.