For an internal competition project here in Avanade, my colleagues and I implemented a location aware service works on the cloud. So I’ve many outcomes from that project and want to share them with you. Our aim was to go get the a location data, based on Latitude and Longitude but alas our HTC Touch devices don’t have GPS hardware installed in. So I decided to go for GSM CellID based location awareness and worked quite well. So here is the first step to demonstrate the basic structure on how to get GSM CellId with couple of lines C# code. I just referred to MSDN codebase the RIL_GetCellTowerInfo function in the Radio Interface Layer (RIL) API.
1.Call RIL_Initialize to get a RIL handle
2. Call RIL_GetCellTowerInfo to get the information about the cell tower the phone is connected to
The “Cell” string that FindMe displays seems to be a combination of the dwCellID, dwLocationAreaCode and dwMobileCountryCode
3. Call RIL_Deinitialize to release the RIL handle
You can find the code here. GetCellDetails.rar (24.03 kb) I’ll add other steps to decode geo info (latitude and longitude data) from that cellID identifiers soon. Meanwhile you can check http://www.opencellid.org/ and similar services from other public or commercial vendors and get more info on GSM CellID.