Welcome!

Welcome to the official BlackBerry Support Community Forums.

This is your resource to discuss support topics with your peers, and learn from each other.

inside custom component

Java Development

Reply
Developer
ajaysainsgvu
Posts: 242
Registered: ‎02-19-2013
My Device: 9500

Problem while getting Cell Location and map to http://opencellid.org/

[ Edited ]

I am fetching the cell location as below code.

 

can you plese tell me is it correct to get the cell location for GSM, CDMA network, iDEN.

 

try {
                cellId = GPRSInfo.getCellInfo().getCellId();
                mnc = GPRSInfo.getCellInfo().getMNC();
                mccI = GPRSInfo.getCellInfo().getMCC();
                lac = GPRSInfo.getCellInfo().getLAC();
            }
            catch (Exception e)
            {
                cellId = CDMAInfo.getCellInfo().getBID();
                mnc = CDMAInfo.getCellInfo().getNID();
                mccI = CDMAInfo.getCellInfo().getSID();
                lac = 0;            
            }
            
            String mcc = Integer.toHexString(mccI);
            String loggedAt = CalendarTime.getFormatedTime();
            
            xml = XmlRecordUtil.getCellLocationRecord(loggedAt,
                    mcc, String.valueOf(mnc), String.valueOf(cellId), String.valueOf(lac));