[GUIDE][Difficulty: Advanced] Send an SMS with Address, Speed, and URL for a Map Pin - Tasker Tips & Tricks

Your phone is lost, or you've got a relative who you're okay with sharing your location to. If you're driving, it's hard to give them an exact location, but thanks to the power of Tasker and a Javascriptlet, you can do that and more. With this task, you'll be able to automatically send an SMS with the current Address, current Speed that the phone is traveling, and a URL that drops a pin on the phone's location in Google Maps. Very helpful for easily finding a location! I would like to thank Redditor /u/popillol for figuring out the proper Javascriptlet to parse the Google Maps Geocoding API results.
Prerequisites
Secure Settings plugin if you are rooted and want to be able to automatically toggle location mode
Create a new Profile and select the Event context. Go to Phone and select Received Text. For the Type, leave it at Any and the Sender field blank. However for the Content field, choose a trigger phrase that you will share with your trusted relatives. This trigger phrase should be unique enough that there is no way it will trigger based off of any random text message.
Create a Task and name it 'Get Location.'
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
Now, for the task itself. Be warned that this involves some Javascript, so be sure you copy/paste the functions in properly otherwise it might not work.
Variables --> Variable Set. Set Name to %from and To to %SMSRF. This gets the phone number that the text was sent from and puts it into a variable called %from.
(If Rooted) Plugin --> Secure Settings. Choose Location Mode/High Accuracy under System+ Actions.
Location --> Get Location. Set the source as Any.
Net --> HTTP Get. Under Serverort, put in the following URL to access the Google Maps Geocoding API:
Code:
maps.google.com/maps/api/geocode/json?latlng=%LOC&sensor=false
Set Mime Type as text/xml
Code --> Javascriptlet. For the code, add the following:
Code:
var locj = JSON.parse(global("%HTTPD"));
var spd = Number(global("%LOCSPD"))*2.23693629;
var lat = global("%LOC").split(",");
var lon = Math.abs(lat[1]);
lat = lat[0];
var latd = Math.floor(lat);
var latm = ( lat - latd )*60;
var lats = ( latm - Math.floor(latm) )*60;
latm = Math.floor(latm);
var lond = Math.floor(lon);
var lonm = ( lon - lond )*60;
var lons = ( lonm - Math.floor(lonm) )*60;
lonm = Math.floor(lonm);
lat = latd+"\°"+latm+"\'"+lats.toFixed(1)+"%22N";
lon = lond+"\°"+lonm+"\'"+lons.toFixed(1)+"%22W";
var url = "https://www.google.com/maps/place/"+lat+"+"+lon+"/@"+global("%LOC")+",14z";
if ( locj.results.length > 0 )
{
var short = locj.results[0].address_components[0].short_name;
if ( short.search(/[^\d-]/) == -1 )
short = "";
else
short = "("+short+") ";
var add = locj.results[0].formatted_address;
add = short+add.replace(", USA","");
}
Phone --> Send SMS. For the Number, put in %from. For the Message, put in the following:
Code:
%add
Speed ~ %spd mph
URL: %url
That's it! As mentioned in the Reddit thread for this, you can use AutoInput to automate turning on/off location services if you aren't rooted, but it's a bit of a messy implementation so I recommend just leaving location services on.

Maybe publish the script that can be downloaded and inserted from tasker. Thanks.

vizdak said:
Maybe publish the script that can be downloaded and inserted from tasker. Thanks.
Click to expand...
Click to collapse
I've attached the script in the post. Enjoy!

MishaalRahman said:
I've attached the script in the post. Enjoy!
Click to expand...
Click to collapse
Dropped pin is not accurate, its showing all blue area. Whats the problem?

Hi,
Just bought tasker and setted this up, seems like the url query is not working, any tips?
Also, putting that url in chrome gives me the following:
Code:
{
"results" : [],
"status" : "ZERO_RESULTS"
}
Regards.

MishaalRahman said:
Your phone is lost, or you've got a relative who you're okay with sharing your location to. If you're driving, it's hard to give them an exact location, but thanks to the power of Tasker and a Javascriptlet, you can do that and more. With this task, you'll be able to automatically send an SMS with the current Address, current Speed that the phone is traveling, and a URL that drops a pin on the phone's location in Google Maps. Very helpful for easily finding a location! I would like to thank Redditor /u/popillol for figuring out the proper Javascriptlet to parse the Google Maps Geocoding API results.
Prerequisites
Secure Settings plugin if you are rooted and want to be able to automatically toggle location mode
Create a new Profile and select the Event context. Go to Phone and select Received Text. For the Type, leave it at Any and the Sender field blank. However for the Content field, choose a trigger phrase that you will share with your trusted relatives. This trigger phrase should be unique enough that there is no way it will trigger based off of any random text message.
Create a Task and name it 'Get Location.'
Now, for the task itself. Be warned that this involves some Javascript, so be sure you copy/paste the functions in properly otherwise it might not work.
Variables --> Variable Set. Set Name to %from and To to %SMSRF. This gets the phone number that the text was sent from and puts it into a variable called %from.
(If Rooted) Plugin --> Secure Settings. Choose Location Mode/High Accuracy under System+ Actions.
Location --> Get Location. Set the source as Any.
Net --> HTTP Get. Under Serverort, put in the following URL to access the Google Maps Geocoding API:
Code:
maps.google.com/maps/api/geocode/json?latlng=%LOC&sensor=false
Set Mime Type as text/xml
Code --> Javascriptlet. For the code, add the following:
Code:
var locj = JSON.parse(global("%HTTPD"));
var spd = Number(global("%LOCSPD"))*2.23693629;
var lat = global("%LOC").split(",");
var lon = Math.abs(lat[1]);
lat = lat[0];
var latd = Math.floor(lat);
var latm = ( lat - latd )*60;
var lats = ( latm - Math.floor(latm) )*60;
latm = Math.floor(latm);
var lond = Math.floor(lon);
var lonm = ( lon - lond )*60;
var lons = ( lonm - Math.floor(lonm) )*60;
lonm = Math.floor(lonm);
lat = latd+"\°"+latm+"\'"+lats.toFixed(1)+"%22N";
lon = lond+"\°"+lonm+"\'"+lons.toFixed(1)+"%22W";
var url = "https://www.google.com/maps/place/"+lat+"+"+lon+"/@"+global("%LOC")+",14z";
if ( locj.results.length > 0 )
{
var short = locj.results[0].address_components[0].short_name;
if ( short.search(/[^\d-]/) == -1 )
short = "";
else
short = "("+short+") ";
var add = locj.results[0].formatted_address;
add = short+add.replace(", USA","");
}
Phone --> Send SMS. For the Number, put in %from. For the Message, put in the following:
Code:
%add
Speed ~ %spd mph
URL: %url
That's it! As mentioned in the Reddit thread for this, you can use AutoInput to automate turning on/off location services if you aren't rooted, but it's a bit of a messy implementation so I recommend just leaving location services on.
Click to expand...
Click to collapse
The part where you used +"%22N" and +"%22W" wouldn't it only make it work in the northern part of America?
Tried it out, and by my location I should be in Denmark, but the URL leads me to be somewhere in the Atlantic Ocean.
If I delete the two parts or simply change the W to an E, it works... But isn't it possible to make Google determine if it should be N/S and W/E? I mean, it can be fixed with an If(), but isn't there a way to make the api do that? But that's a cool script! I've been looking for ages for a function that could do the speed without root - you helped me out, thanks!

mnhs1010 said:
Dropped pin is not accurate, its showing all blue area. Whats the problem?
Click to expand...
Click to collapse
Sometimes, the URL that gets sent in the SMS doesn't format properly (there's nothing you can do about that except maybe use a URL shortener service) so you'll have to make sure you copy/paste the ENTIRE URL that gets sent rather than just clicking on what it gives you.
Cryorus said:
Hi,
Just bought tasker and setted this up, seems like the url query is not working, any tips?
Also, putting that url in chrome gives me the following:
Code:
{
"results" : [],
"status" : "ZERO_RESULTS"
}
Regards.
Click to expand...
Click to collapse
Hi, it's perhaps failing because your phone failed to get a location lock, meaning %LOC is not being set. If %LOC is not set, then the URL query will not work as Google Maps is expecting GPS coordinates being passed to it. As for why it doesn't work when you open the URL in Chrome, same reason.
One thing you can do is add an Alert --> Flash command and Flash %LOC right after the "Get Location" action. If you don't see GPS coordinates pop up then it means Tasker timed out on getting a location on you.

patrickpetersen said:
The part where you used +"%22N" and +"%22W" wouldn't it only make it work in the northern part of America?
Tried it out, and by my location I should be in Denmark, but the URL leads me to be somewhere in the Atlantic Ocean.
If I delete the two parts or simply change the W to an E, it works... But isn't it possible to make Google determine if it should be N/S and W/E? I mean, it can be fixed with an If(), but isn't there a way to make the api do that? But that's a cool script! I've been looking for ages for a function that could do the speed without root - you helped me out, thanks!
Click to expand...
Click to collapse
You are correct. To make the Javascriptlet work globally, you would need to do the following (this is from the Redditor that came up with the Javascript):
This assumes you're using North latitude numbers and West longitude numbers (so North America). If you want to use it globally, this would be the way to do it:
In the javascriptlet, check the sign (+ or -) of lon before getting the absolute value, and assign a new variable string with either W or E based on the sign. Do the same thing with lat (after the lat=lat[0] line) and with N or S. Then near the bottom where it puts the degrees, minutes, and seconds together, use that string variable after the "%22". I haven't tested it but that should work.
Click to expand...
Click to collapse

MishaalRahman said:
Sometimes, the URL that gets sent in the SMS doesn't format properly (there's nothing you can do about that except maybe use a URL shortener service) so you'll have to make sure you copy/paste the ENTIRE URL that gets sent rather than just clicking on what it gives you.
Hi, it's perhaps failing because your phone failed to get a location lock, meaning %LOC is not being set. If %LOC is not set, then the URL query will not work as Google Maps is expecting GPS coordinates being passed to it. As for why it doesn't work when you open the URL in Chrome, same reason.
One thing you can do is add an Alert --> Flash command and Flash %LOC right after the "Get Location" action. If you don't see GPS coordinates pop up then it means Tasker timed out on getting a location on you.
Click to expand...
Click to collapse
Thanks for the tip, it seems that step 3. Get Location takes a while (around a minute or more) to complete, after that, Flashing %LOC doesn't return anything.
Edit: Working now, I turned options for GPS to use Wifi and Bluethooth and it worked, but the link isn't sent completly, the hyperlink breaks at the first comma. Example: www.url.com/22w22s1234,etc.
Edit 2: Just read that there is nothing to do about it... gona find a way around.
Edit 3: Found a way around using the bitly API, the problem now is even if I change the location N to S (I'm in South America) it doesn't pin anything. (It doesnt even with N)

MishaalRahman said:
You are correct. To make the Javascriptlet work globally, you would need to do the following (this is from the Redditor that came up with the Javascript):
Click to expand...
Click to collapse
Can someone edit the script and provide me for global? I am in Pakistan and its not showing accurate drop pin.

This is the link it is giving me: https://www.google.com/maps/place/-34°32'48.6"S+70°37'12.2"W/@-33.4531551,-70.6200612,14z
No marker and the address is not accurate.
Edit: Address was not accurate because of where I was (office) went outside and it worked perfectly, still there is no pointer in the map.

MishaalRahman said:
Your phone is lost, or you've got a relative who you're okay with sharing your location to. If you're driving, it's hard to give them an exact location, but thanks to the power of Tasker and a Javascriptlet, you can do that and more. With this task, you'll be able to automatically send an SMS with the current Address, current Speed that the phone is traveling, and a URL that drops a pin on the phone's location in Google Maps. Very helpful for easily finding a location! I would like to thank Redditor /u/popillol for figuring out the proper Javascriptlet to parse the Google Maps Geocoding API results.
Prerequisites
Secure Settings plugin if you are rooted and want to be able to automatically toggle location mode
Create a new Profile and select the Event context. Go to Phone and select Received Text. For the Type, leave it at Any and the Sender field blank. However for the Content field, choose a trigger phrase that you will share with your trusted relatives. This trigger phrase should be unique enough that there is no way it will trigger based off of any random text message.
Create a Task and name it 'Get Location.'
Now, for the task itself. Be warned that this involves some Javascript, so be sure you copy/paste the functions in properly otherwise it might not work.
Variables --> Variable Set. Set Name to %from and To to %SMSRF. This gets the phone number that the text was sent from and puts it into a variable called %from.
(If Rooted) Plugin --> Secure Settings. Choose Location Mode/High Accuracy under System+ Actions.
Location --> Get Location. Set the source as Any.
Net --> HTTP Get. Under Serverort, put in the following URL to access the Google Maps Geocoding API:
Code:
maps.google.com/maps/api/geocode/json?latlng=%LOC&sensor=false
Set Mime Type as text/xml
Code --> Javascriptlet. For the code, add the following:
Code:
var locj = JSON.parse(global("%HTTPD"));
var spd = Number(global("%LOCSPD"))*2.23693629;
var lat = global("%LOC").split(",");
var lon = Math.abs(lat[1]);
lat = lat[0];
var latd = Math.floor(lat);
var latm = ( lat - latd )*60;
var lats = ( latm - Math.floor(latm) )*60;
latm = Math.floor(latm);
var lond = Math.floor(lon);
var lonm = ( lon - lond )*60;
var lons = ( lonm - Math.floor(lonm) )*60;
lonm = Math.floor(lonm);
lat = latd+"\°"+latm+"\'"+lats.toFixed(1)+"%22N";
lon = lond+"\°"+lonm+"\'"+lons.toFixed(1)+"%22W";
var url = "https://www.google.com/maps/place/"+lat+"+"+lon+"/@"+global("%LOC")+",14z";
if ( locj.results.length > 0 )
{
var short = locj.results[0].address_components[0].short_name;
if ( short.search(/[^\d-]/) == -1 )
short = "";
else
short = "("+short+") ";
var add = locj.results[0].formatted_address;
add = short+add.replace(", USA","");
}
Phone --> Send SMS. For the Number, put in %from. For the Message, put in the following:
Code:
%add
Speed ~ %spd mph
URL: %url
That's it! As mentioned in the Reddit thread for this, you can use AutoInput to automate turning on/off location services if you aren't rooted, but it's a bit of a messy implementation so I recommend just leaving location services on.
Click to expand...
Click to collapse
mnhs1010 said:
Can someone edit the script and provide me for global? I am in Pakistan and its not showing accurate drop pin.
Click to expand...
Click to collapse
Try to follow the instructions from the redditor or manually switch the 22N to 22S and 22W to 22E

patrickpetersen said:
Try to follow the instructions from the redditor or manually switch the 22N to 22S and 22W to 22E
Click to expand...
Click to collapse
its working fine 3 days but now it is sending the last same location always not new location.

Cryorus said:
Thanks for the tip, it seems that step 3. Get Location takes a while (around a minute or more) to complete, after that, Flashing %LOC doesn't return anything.
Edit: Working now, I turned options for GPS to use Wifi and Bluethooth and it worked, but the link isn't sent completly, the hyperlink breaks at the first comma. Example: www.url.com/22w22s1234,etc.
Edit 2: Just read that there is nothing to do about it... gona find a way around.
Edit 3: Found a way around using the bitly API, the problem now is even if I change the location N to S (I'm in South America) it doesn't pin anything. (It doesnt even with N)
Click to expand...
Click to collapse
I'm having this problem as well, the "Get Location" times out no matter how high I set the time out value to be. I've Turned on WiFi and Bluetooth scannaing to no avail. Whenever the task runs, I see the GPS icon show up in my status bar. And Google Maps has no problem getting my location quickly and accurately. I'm not sure what's going on

Ben Abel said:
I'm having this problem as well, the "Get Location" times out no matter how high I set the time out value to be. I've Turned on WiFi and Bluetooth scannaing to no avail. Whenever the task runs, I see the GPS icon show up in my status bar. And Google Maps has no problem getting my location quickly and accurately. I'm not sure what's going on
Click to expand...
Click to collapse
Did you test it outside? It takes a while to get my location here at my work, but outside it is super fast.

Cryorus said:
Did you test it outside? It takes a while to get my location here at my work, but outside it is super fast.
Click to expand...
Click to collapse
I just did, and it worked!
I don't know how Google Maps can get a lock on my so easily while I'm inside, but Tasker struggles, haha. Perhaps Google Services it's using Google Service's last known location of me.

It's simpler to use GeoTask in order to get the address and location.

Big Brother now works for me. Thanks, MishaalRahman.
One thing to point out for paranoid/right peoplle, it is possible to make an email-to-SMS gateway trigger it, although it does require setting up a new Context.
For those who do not know, a SMS gateway is when you send an email to a carrier's portal, and they pass the message along as an SMS. It also works backwards, sending an SMS back will send the reply to the sending email address. Wikipedia has a list of U.S. ones. For those outside the U.S., some research will be required, so go practice your Google-fu.
One thing to check for is the message may be wrapped in transit with things like the sender's name, subject line, etc. Test it out thoroughly, as the Context's contents must match the SMS exactly in order to trigger the Task. I recommend sending the message and simply copy/pasting what it spits out as the new Context's contents.
Last caveat, check to make sure that the message actually comes through the email reply, AT&T's SMS-to-email parser breaks on the degree symbol (Unicode B0 ALT+0176 °), so some editing may be required on the receiving end prior to presenting the URL to Gmaps. Once again, test thoroughly.

I don't know why, but I'm not able to import your projects into my tasker @MishaalRahman. Is there any way to export them in another format? Could you upload that? Is anyone else having this issue?
Would be awesome!
Cheers

I love the whole idea. It's great! Can you please write the Java scriptlet for me that works anywhere in the world? Requesting because I do not know coding at all.

Related

GPS Cycle Computer v3

Yet Another GPS Tracker? - yes, but:
- this is a nice one - thanks to excellent design by expo7! And you can set your custom background and button images;
- can select GPS run interval: from "always on" to "run every 10 min" - this is useful if you want to reduce battery power usage;
- has usual cycle computer display: time, distance, speed (current, average, max) plus a graph of your track.
The tool logs GPS data into a binary file (so a lot of data can be stored in a compact form), which can be loaded back for viewing, or saved into .kml / .gpx file to view in e.g. GoogleEarth. With the latest version of GoogleMaps, you can view KML files on your phone. Just click on a kml file in file explorer. Note there is a bug in the latest GoogleMaps installation, so KML files does not work - read the manual how to fix this.
The files are now stored at Google Code web site, please download the latest version from here: http://code.google.com/p/gccv2/downloads/list
What you need to download (go for the latest version!) :
- GpsCycleComputer_X.XX.cab - the application itself. To install, copy CAB into your phone, and click on it from your phone File Explorer. The manual (file called Readme.htm) is installed on your phone, in the same folder as the application. E.g. if you install into "Internal Storage" on English Windows, the path to the application will be \Internal Storage\Program Files\GpsCycleComputer.
- GpsCycleComputerSource_X.XX.zip - A complete source code in C#, uses CF .NET 2.0. Feel free to change anything you like!
If you have questions about Live logging on www.crossingways.com, please visit this forum: http://forum.xda-developers.com/showthread.php?t=484809
{
"lightbox_close": "Close",
"lightbox_next": "Next",
"lightbox_previous": "Previous",
"lightbox_error": "The requested content cannot be loaded. Please try again later.",
"lightbox_start_slideshow": "Start slideshow",
"lightbox_stop_slideshow": "Stop slideshow",
"lightbox_full_screen": "Full screen",
"lightbox_thumbnails": "Thumbnails",
"lightbox_download": "Download",
"lightbox_share": "Share",
"lightbox_zoom": "Zoom",
"lightbox_new_window": "New window",
"lightbox_toggle_sidebar": "Toggle sidebar"
}
I'll give it a try thank you.
Does it work with the screen switched off?
Edit: now I see the backlight off button xD
Hi,
the tracker works great! buuuuuut I have a problem, I can't import the .kml file into google earth. Although I open it (with a text editor) and the coordinates seem correct, when I import it, google earth sets all the coordinates in the north pole ¿?¿?
Very Nice
Hello,
it really looks good And i like the "simple" stuff. Exactly the needed functionality. The only thinmg I miss is the possibility to save the files as GPX.
Oh and it would be perfect if it is possible to disable all button's but the power button when the screen is of.
Thanks for the tool. I will test it in Australia next month.
And I will have a look in the sources
Br Martin
I cannot see the truck in google earth ... why?
Strange that you do not see anything in Google Earth. I just tested again, all OK. I use Windows version: "Google Earth 4.3.7284.3916 (beta) Build Date Jul 8 2008"
The KML file is quite simple - I looked an existing KML sample supplied with Google Earth (called, of course, "KML Samples"), found the simplest one with "path" and simply put the new coordinates there.
Try to put a single point in the coordinates and see if it works for you?
The only bit this I can think of is the "Z" coordinate, which is "optional" according to Google manual. But maybe in your version you need that "Z" as well (this will be the 3rd number after lat/long, - put 0 there, note it is separated by comma.
Also I removed entry called "<LookAt>" - but seems my version can set the eye position automatically...
Re the buttons: I have not explore all the Diamond settings in details: on mine, by default, all the buttons are locked as I click software button "BkLight Off". Then I switch it back with hardware "power" button. Do you have the same?
BTW: here is the Google sample I used as a template - try if this works (and after removing which field it does not!). BTW, according to Google help, it might be possible to use GoogleMaps for viewing KML file (but I was not able to make this work on Diamond) - anyone tried?
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://earth.google.com/kml/2.2">
<Placemark>
<name>Tessellated</name>
<description><![CDATA[If the <tessellate> tag has a value of 1, the line will contour to the underlying terrain]]></description>
<LookAt>
<longitude>-112.0822680013139</longitude>
<latitude>36.09825589333556</latitude>
<altitude>0</altitude>
<range>2889.145007690472</range>
<tilt>62.04855796276328</tilt>
<heading>103.8120432044965</heading>
</LookAt>
<LineString>
<tessellate>1</tessellate>
<coordinates>
-112.0814237830345,36.10677870477137,0 -112.0870267752693,36.0905099328766,0 </coordinates>
</LineString>
</Placemark>
</kml>
Hi,
The problem is that you use the comma character to separate the decimal part, whereas kml files use the dot
this is:
google: -112.0814237830345,36.10677870477137
you: -112,0814237830345,36,10677870477137
I replaced the commas for dots and now google shows the route correctly
BTW, the Z coordinate is not needed, as you guessed.
Please fix this, I love this software!!!
Thank You, your tools sounds great !! It runs on my Diamond, but i Am inhouse at the moment, so no gps signal, but it works so far. can you explain the "GPS sample validity" a little more, please ? i donßt understand your readme. And "GPS activity", does it mean that the tool saves point in this time frame or that GPS is activated after this time, send the position, goes off and wait for some minutes ? And when it goes on, how long do it try to receive a signal ? For example, if i go in a house, does it start the gps and try to receive for hours or does it switch the gps off after some time ?
I hope you keep developing, very good start for the concept. Is there a chance to improve the design ? Maybe in Manila style ? Like the small "stopwatch 1.01" tool, simple, but great design, improves it a lot !!
hans
Did you do any battery tests ? How long do the diamond work for tracking ?
hans
one more: on my diamond, one press on hardware buttons and the button light goes on, second press screen goes on Any idea ?
hans
this might be what you are looking for
http://forum.xda-developers.com/showthread.php?t=422871
.G.
Would love to make a bit nicer design, but have not learn yet how to do skins ... Anyone would like to try? - the source code it attached
Regarding start/stop : if you select an option "GPS activity" "run every xx sec", then:
1) as soon as you get a valid sample (to decide that it is valid - the second option is used "GPS sample valid xx sec") - GPS is switched OFF and a timer started for xx sec.
2) as timer expires, it starts GPS
3) GPS starts searching and as soon it get a valid sample (see 1)...
So, it means that you need to add "search time" to "timer time" - that will be your distance between samples. Clearly, the longer the timer time, it will takes longer for GPS to get a valid sample again.
The battery usage is printed at start/stop - I specially added this to estimate usage. I did not have much chance to test, but with "GPS always on" and "3 sec valid time" (as you load the file back, it shows as "gps options 0/3 sec" after file name) - I think it shall run for
about 3 hours.
BTW, I noticed the application hangs sometimes when it frequently start/stop GPS (I tried 5 sec / 5 sec), AND you have a few other applications running (blame Microsoft ... it was not me). I guess the GPS start/stop is a bit stressful for the system, so this could explain. I am looking into this. At default mode (0/3 sec) all seems works fine. Again - look at source code, maybe you have some suggestions?
AndyZap said:
Re the buttons: I have not explore all the Diamond settings in details: on mine, by default, all the buttons are locked as I click software button "BkLight Off". Then I switch it back with hardware "power" button. Do you have the same?
BTW: here is the Google sample I used as a template - try if this works (and after removing which field it does not!). BTW, according to Google help, it might be possible to use GoogleMaps for viewing KML file (but I was not able to make this work on Diamond) - anyone tried?
<?xml version="1.0" encoding="UTF-8"?>
<kml xmlns="http://earth.google.com/kml/2.2">
<Placemark>
<name>Tessellated</name>
<description><![CDATA[If the <tessellate> tag has a value of 1, the line will contour to the underlying terrain]]></description>
<LookAt>
<longitude>-112.0822680013139</longitude>
<latitude>36.09825589333556</latitude>
<altitude>0</altitude>
<range>2889.145007690472</range>
<tilt>62.04855796276328</tilt>
<heading>103.8120432044965</heading>
</LookAt>
<LineString>
<tessellate>1</tessellate>
<coordinates>
-112.0814237830345,36.10677870477137,0 -112.0870267752693,36.0905099328766,0 </coordinates>
</LineString>
</Placemark>
</kml>
Click to expand...
Click to collapse
Yes, search for TrackMe here on XDA, and for the serverfiles.
The serverfiles have a build-in google maps API, sure you can work it out.
HansZimmer said:
Did you do any battery tests ? How long do the diamond work for tracking ?
hans
Click to expand...
Click to collapse
22 minutes connected = 10% of battery ...
Thank you so mutch
I searched many, many time for a tool like this!
I will try it, today evening....
Great Job
great app - a suggestion
This is a fantastic app...I love the simplicity and the functionality.
I'm trying to find something that is as close to Nokia's sports tracker as possible for WM6.1 and this is near as perfect.
One suggestion for added functionality...
is it possible to add markers to show:
fastest point
slowest point
highest point
lowest point
These are then visible on the .kml file in google earth/maps.
Keep up the good work!
cheers, cojo
I will be posting the latest version into the first post, so please check it for updates. The latest update is for KML output fix, also I added GPX output day before.
Re battery usage - I noticed that as you switch GPS on, the battery reduces quickly (which looks ok, as battery current increases, so voltage drops), but then it drains the battery not as fast. I.e. 20 min run might not be an indication how long it will last.
Hy Andy,
the 1) part makes me a little bit worried. Can you change that to a number of sattelites used or a certain hdop to decide that a signal is valid instead of taking a "GPS sample valid xx sec"
I really like your tool It would be nice to have a option for the folder where the logs should be stored.
Br Martin
AndyZap said:
Would love to make a bit nicer design, but have not learn yet how to do skins ... Anyone would like to try? - the source code it attached
Regarding start/stop : if you select an option "GPS activity" "run every xx sec", then:
1) as soon as you get a valid sample (to decide that it is valid - the second option is used "GPS sample valid xx sec") - GPS is switched OFF and a timer started for xx sec.
2) as timer expires, it starts GPS
3) GPS starts searching and as soon it get a valid sample (see 1)...
So, it means that you need to add "search time" to "timer time" - that will be your distance between samples. Clearly, the longer the timer time, it will takes longer for GPS to get a valid sample again.
The battery usage is printed at start/stop - I specially added this to estimate usage. I did not have much chance to test, but with "GPS always on" and "3 sec valid time" (as you load the file back, it shows as "gps options 0/3 sec" after file name) - I think it shall run for
about 3 hours.
BTW, I noticed the application hangs sometimes when it frequently start/stop GPS (I tried 5 sec / 5 sec), AND you have a few other applications running (blame Microsoft ... it was not me). I guess the GPS start/stop is a bit stressful for the system, so this could explain. I am looking into this. At default mode (0/3 sec) all seems works fine. Again - look at source code, maybe you have some suggestions?
Click to expand...
Click to collapse
I think I was not very clear about "valid xx sec" - Of course, first of all I check that the position/velocity/heigth is "valid" - this information is provided by the GPS. I.e. this means that you have proper GPS lock first. Also each gps sample has time stamp, so I additionally check that the sample is fresh enough. This seems useful when you switch "off" GPS, then switch it "on" - and it could return "old" sample at start.
Regarding the location of the stored files - I thought it is quite easy to remember that these are stored with the application (so you do not need to search for them...). If you would like to change the folder, the easiest would be to copy the tool in any place you like! I just wanted to keep the number of buttons (and options) to very minimum ...

[Q] VPN via Android Intent?

Hi there,
I'm using the "Llama" App to manage all my configurations. I can connect my phone via WiFi to my Router and use my Landline number with it. I can call other Landline numbers in 75 countries using this feature.
I configured a VPN connection to my Home-router. Everything works fine, but...
All I may know so far is, that I can use Android-Intent to start my VPN. Correct??
The "Llama" i can run an Intent, but I don't know how to configurate it propably.
//
It says:
- "Intent send mode:" with following options: Start activity / Start service / Broadcast
- package name
- class name
- Action
- Categories (comma/pipe seperated)
- Data
- Data Type
- Extra -> Add new 'extra' row [Description: Set the 'key' to blank to remove that row. Surround variable names with two hashes to expand them in string extra (e.g. ##variablename##)]
When adding an extra row:
- >Key - boolean / byte / short / int / long / float / double / string - value
//
Is this possible?
If needed... It's a IPSec-VPN with Xauth-Authentification.
Thanks very much for any help! :fingers-crossed:
cheers, maxbenn
the only thing i know you can reach without root ist the menu where to choose wich vpnconnection you want to start with:
Code:
Intent-send-mode: Start activity
Action: android.net.vpn.settings
With root you have to make a shortcut to the vpnconnection with an additional app and start the intent of the additional app.
Thx, it works!
The non root version is enough for me.
Cheers,
Max.

[Q] Adding custom text to retrived data from database

Hi,
im a beginner i have small problem i have small application build where i can add stuff to the database and read it thats working fine for me but now for example i want to be it like example the output from the database is test test but i want it like Name : test Adress : test how can i fix this.
Thank you
Splitting Text
Not sure if I've understood correctly, but are you getting a String back from the database like this: "test test"?
If so you can use the String split() command to break your String into segments. For example:
Code:
String returned = //Get String from the database
String[] split = returned.split(" ");
String name = "Name: " + split[0]; //This contains your first word
String address = "Address: " + split[1]; //This contains your second word
How are you connecting to your database? Depending on how you connect, it is possible to return just a name, or just an address, rather than all columns in a row.
For example, using HQL (Hibernate Query Language) you could write something like:
Code:
SELECT address FROM person p WHERE p.name = "Harry"
This would return all the addresses of people called Harry from the table person

Help with comparing variables

This is probably simple for a programmer, but as a newb, I am getting stuck.
I have 2 variables and I want to check if the first is contained in the second
so, %event = Phone and %check = WorkPhoneReport
I have tried :
*%event* ~ %check
*%event* ~R %check
*%event\* ~ %check
And several other similar patterns. What to do to get this test working?
I am trying to read my calendar and not process the same event a second time. So, each item it reads is appended to another variable, then on its next loop, it compares the new event to the check variable to see if it was processed already. Don't know if I should be using an array instead of a variable, and if I can use an array in a if/then statement....
Any help is appreciated!!
Figured out a way.
Variable Search and Replace:
Variable %check Search %event store in %matches
then in the if statement just check if %matches is set.
If there's a simpler way, please let me know, this task is at 50 commands, never hurts to shorten it.
Code:
%check ~R .*%event.*
In Regex format, dot (.) can be any character including having no character there, and star (*) means repeat previous character as much as possible.
So .* means "look for no character or any number of any characters", and .*%event.* means "look for %event with something or nothing before it, and something or nothing after it"

How to use Java Function in Tasker?

Hello,
I'm using Sygic Navigation for Android. Now I'm trying to get some data out of Sygic to use in Tasker. For example I want to get my Estimated Time of Arrival (ETA) and save it as a variable in Tasker. Sygic offers a SDK, see "developers [dot] sygic [dot] com [slash] documentation.php?action=code_geteta" (sorry, first post, not allowed to post URLs), so I guess there are possibilities with Tasker....??
The thing is, I'm really new to programming and have no idea how to start / what to do with the Java possibilities in Tasker
Is there anyone who can help me "translate" the Java code below to some Java code that I can use in Tasker? Or is this not possible at all?
Code:
import com.sygic.sdk.remoteapi.Api;
import com.sygic.sdk.remoteapi.ApiNavigation;
import com.sygic.sdk.remoteapi.model.RouteInfo;
...
String strETA = "";
try {
RouteInfo info = ApiNavigation.getRouteInfo(false, 0);
RouteInfo.RouteInfoTime eta = info.getEstimatedTimeArrival();
strETA = String.valueOf(eta);
} catch (GeneralException e) {
Log.e("RouteInfo", "Error code:"+ e.getCode());
}
Thanks!
Vic
I would not go the SDK / Java route unless you have some Java programming skills already.
In your case, try to investigate Autonotification and AutoInput which are two very popular Tasker plugins.
You can find some similar examples (I actually do it with Maps) on the AutoApps forum.
It won't work at all in Tasker unless you write a completely new plugin. How can you use Sygic SDK in Tasker?? I don't think it's possible. If the information is in the notification you can use Notification Listener to get the notification in the task and read it. If it's only on the screen you can read it using the action "read screen" of TouchTask plugin.

Categories

Resources