It is known that although very accurate, GPS has some drawbacks. It needs a lot of time to connect to the satellites, in the order of tens of seconds. It won't work indoors as well. Moreover, it is banned in Egypt, Syria and North Korea!
Update: It is not banned anymore in Egypt.
So can one determine his location without the aid of GPS technology? The answer is Yes. This can be done by identifying nearby GSM cell towers and query a database that stores their location. So lets divide the rest of this post into 2 parts:
Identifying nearby GSM cell towers
Doing this on the iPhone was a bit tricky. Actually it was a challenge for us at eSpace to get such information. I will list here the challenges we met and how we managed to solve them:
- There is no official SDK for iPhone OS 1.x. This was the easiest challenge to solve. Everybody uses iphone-dev for building the iPhone toolchain. Most of the header files in the toolchain are generated by class-dump! This is a tool that takes a binary framework (library) as an input and emits some Objective-C code in a header file that represents symbols in the library. Its idea is as simple as using nm to query symbol names and some extra code to wrap this info in Objective-C syntax.
- Even in the non-official toolchain, there is not a word on how to deal with telephony features like calls and text messaging. Thanks to CellStumbler, we used it to get cell information. It is a tool that exploits CoreTelephony framework functionality. CoreTelephony.h is also generated with class-dump.
- CellStumbler is very fragile, if you do simple edits in it, it may crash! The guys say it is toolchain bugs! Just keep this in mind if you need to modify it. Be aware that server connection callback never get called, so keep on retrieving cell information until you get something useful.
- Because CellStumbler is that fragile, we left the code untouched in its major parts, we just changed the part that outputs results. We then called the binary from a shell and parsed its output to get useful nearby cell information.
Querying a database for cell location
Google used to have a secret API for this. It is called My Location. This is the API it uses in Maps. Unfortunately, at the time of our development, the API was secret, we had to sniff upon packets to/from Google Maps to know what happens under the hood and replays it. Now this API is open to developers, thanks Google.
4 comments:
Hi Hosam, Assalamu'alaikum ya akhi..
My name is Albaq, Indonesian. I am working for Chevron the Oil&Gas company in Indonesia. I was searching at the internet and found your blog about the Texas A&M Master program on Qatar. I am really interst to get the master but with continuing my job. I hold chemical engineering degree from the Indonesia Institute of Technology.
The reason I sent you an email is to have your view, wheter an international worker in Doha, can be able to also continue the Master study there. Please also let me know the fee for me (non-Qatari) to finish the study, please indicated the tutiation fees only.
If it is in sense for me and do able, I would really take a challange seeking a Qatar's Job with main focus study for master degree.
I have some offering from some company there to fill the Reliability Engineer vacant position there. Again, I need to squeezing the focus with the study. Please your thougths on this. Appreciate in advace, ya akhi.. hope to hear from you soon.
wasalamualaikum..
albaq
google id: [email protected]
YM id: [email protected]
How do you implement CellStumbler? I found the group's site and the corresponding CellStumbler files, but was unable to deploy.
sorry it has been a while since i worked on this. CellStumbler is a command-line app. So you have to jailbreak your phone and copy the binary to any place then launch it using your application. You will have then to parse its output to get information about the location.
Post a Comment