Results 1 to 4 of 4
  1.    #1  
    OK, i had this idea. Let me know what you think.
    I'd like to set up a cron task to poll for gps data on a set interval - say, once every 10 minutes and write that data to a file.
    Once that data is written to a file, applications can read said gps data without the overhead (read: power, cpu) of polling the gps. I had envisioned a resource wherefrom apps and scripts could access approximate gps data quickly and easily, and this seems like a simple enough solution.

    One application example would be as follows;
    I would like to have location-sensitive triggers on my phone that enable/disable or change phone settings based on my location. I'd like to mute all when I go to the movie theater. I'd like to enable roam-only mode when I'm at my house. I'd like to disable roam-only mode when I'm at work, etc. This particular application doesn't warrant having precise up-to-date gps data to function. A (seperate) cron task to read the output of the previous task and make any changes appropriate would be fine.

    Another application:
    Google Maps and other GPS software can sometimes take a long time to pinpoint your position. This is especially true if you've moved a long distance since the last time you used the software. Having this cached "approximate" data would give the app in question a nearby starting point and could potentially (if code were optimized) substantially increase the "locating" time of GPS-reliant apps.

    The basic idea is to create a running log (or cache) of periodic gps data to apps that need the gps data but don't necessarily need it to be up-to-date and accurate. Caching this data to a file alleviates some of the need for apps to redundantly poll the phone's gps, allowing the phone (and said apps) to function more efficiently.

    Sooooooo..............whaddaya think?
  2. jsabo's Avatar
    427 Posts
    Global Posts
    479 Global Posts
    Basic work's already been done: GPS Tracking - WebOS Internals and

    Writing the details to a file would be a trivial change.

    The key to this is the following command:

    luna-send -n 3 palm://com.palm.location/startTracking
    '{"appId": "ILovePalm", "subscribe": true}'

    That calls the location tracking function. The value supplied for n is the vital piece-- it seems like you don't actually get GPS data until you use n=3. Guessing that n=1 and 2 is cell tower info or wifi triangulation.

    That should be enough to get you going, if you discover any interesting things about getting the location, post it!
  3.    #3  
    OK, so cron would run a script that looks something like this:

    pos=$(luna-send -n 2 palm://com.palm.location/startTracking '{"appId": "ILovePalm", "subscribe": true}' 2>&1 | tail -1 | cut -d, -f4,5,8 | sed -r 's/[^-\.0-9,]//g')
    lat=$(echo $pos | cut -d, -f1) #pull lat from output
    lon=$(echo $pos | cut -d, -f2) #pull long from output
    spd=$(echo $pos | cut -d, -f3) #pull spd from output
    echo "$lat, $lon, $spd" > gpscoords #write those 3 pieces of data to a file called "gpscoords".  if there's already a file that exists, overwrite it.
    #ideally, a homebrew app would write the following portion, allowing the user to use a GUI to indicate which scripts to run once the gps data has been polled.
    #These scripts could do any one of a number of things - adjust email polling interval, enable roam-only mode, set phone to silent, etc.
    Am I taking a total shot in the dark here? I'm not getting a lot of love here...
  4. jsabo's Avatar
    427 Posts
    Global Posts
    479 Global Posts
    Without actually trying to run those, that looks like the right stuff. What's the issue you're having?

Posting Permissions