This is a kernel module I whipped up for our phone. It creates a couple virtual files for interacting with the GPS without having to mess with any java. The idea behind this module is so you could make something like those "find my droid" or "androidlost" applications. By interfacing with the kernel directly, you don't need to go through any java program. When you rely on an apk to track your phone, you are really just hoping that the person that stole it is too stupid to uninstall that apk. Interfacing with the kernel directly lets you be more sneaky about how and where you implement your phone tracking. You could put a sh script inside the ramdisk, for example, and the only way to uninstall it would be to install a different ramdisk. The only way to know it exists would be to open a root file browser and browse to that location.
However, the official jni doesnt provide any way to access gps that I found. If you want to talk to gps features, google says you have to go through java. This kernel module uses a few of LG's diagnostic functions to let you set the gps status and get longitude/latitude. It creates /proc/gpsStatus and /proc/gpsLocation.
Download gps_loc.c.tar.gz from Sendspace.com - send big files the easy way
However, the official jni doesnt provide any way to access gps that I found. If you want to talk to gps features, google says you have to go through java. This kernel module uses a few of LG's diagnostic functions to let you set the gps status and get longitude/latitude. It creates /proc/gpsStatus and /proc/gpsLocation.
Code:
# insmod /data/local/tmp/gps_loc.ko
# cat /proc/gpsLocation
55.751,37.616
# rmmod gps_loc
Download gps_loc.c.tar.gz from Sendspace.com - send big files the easy way