Showing posts with label GSM information. Show all posts
Showing posts with label GSM information. Show all posts

Friday, July 10, 2009

Coordinate System Utility Library in Java

LatLongLib is a java library that provides the basic operations to be done on difference coordinate system
  • Latitude / longitude points
  • Degree, Minute, Second points
  • UTM points
To download LatLongLib library click here.
To find more details about the package (Javadoc, Testing Samples), click here.

The main Features provided by the package is
  1. Get Distance between two latitude/longitude points in meters using
    • getHaversineDistance
    • getVincentyDistance
    • getQuickEstimate
  2. Get slope between two latitude/longitude points using
    • getSlope
  3. Get point apart from certain point by certain distance and certain angle using
    • getPointAtDistance
  4. Convert latitude/longitude points to Degree Minute Second point using
    • calculateDMSFormat
  5. Convert Degree Minute Second point to latitude/longitude points using
    • calculateDDFormat
  6. Convert latitude/longitude points to UTM point using
    • LLtoUTM
  7. Convert UTM point to latitude/longitude points using
    • UTMtoLL

Monday, June 22, 2009

Getting GSM info like Cell ID, signal Strength on Symbian SDKs

In this tutorial i will demonstarte different ways to get GSM information like
  1. Cell Tower ID
  2. Location Area Code of the current tower (LAC)
  3. Mobile Network Code (MNC)
  4. Mobile Country Code (MCC)
  5. SIM Card Operator
  6. Signal Strength
on different Symbian SDKs

S60_3rd_FP1
=======================================
void CTowerModel::RunL()
{
if(iStatus==KErrNone)
{
if(iCounter == 0)
{
iCounter = 1;
iTelephony->GetSignalStrength( iStatus, iSigStrengthV1Pckg);
}
else
{
iCounter = 0;
iTelephony->GetCurrentNetworkInfo( iStatus, iNetworkInfoV2Pckg);
}
iParent->updateDisplay();
SetActive();
}
}
=======================================
The prevoius code switchs alternatvlty when iCounter=0,
Code gets Signal Strength using
iSignalStrengthV1.iSignalStrength

and when iCounter = 1, Code gets the Network Info like Cell tower id,lac. mcc, mnc
Cell Tower ID ==>iNetworkInfoV2.iCellId
LAC ==>iNetworkInfoV2.iLocationAreaCode
MCC ==>iNetworkInfoV2.iCountryCode
MNC ==> iNetworkInfoV2.iNetworkId
Operator Name ==> iNetworkInfoV2.iShortName

you should add the following CAPABILITY to be able to get Signal Strength
  • Location
  • ReadDeviceData
  • ReadUserData
More detailed code can be found here

S60_2_0_CW
=======================================
void CTowerModel::RunL()
{
if(iStatus==KErrNone)
{
iCellID = 1;
iSignalStrength = 1;
iMobileNetworkCode = 1;
iLocationAreaCode = 1;

MBasicGsmPhoneNetwork::TCurrentNetworkInfo cni;
User::LeaveIfError( phone.GetCurrentNetworkInfo( cni ) );
iCellID = cni.iCellId;
iLocationAreaCode = cni.iLocationAreaCode;
MBasicGsmPhoneNetwork::TNetworkInfo ni = cni.iNetworkInfo;
MBasicGsmPhoneNetwork::TBscNetworkId bni = ni.iId;
iMobileNetworkCode = bni.iMNC;
iMobileCountryCode = bni.iMCC;
TBuf<30> iOperatorName = ni.iLongName;

TInt32 st;
phone.GetSignalStrength(st);
iSignalStrength = st;
iParent->updateView();
}
else
{
iCellID = 0;
iSignalStrength = 0;
iMobileNetworkCode = 0;
iLocationAreaCode = 0;
}
iTimer.After(iStatus,1000000);
SetActive();
}
=======================================

To be able to test this code you might need to include etelbgsm.h File
A screenShot of the emulator Testing
More detailed code can be found here