HTML Panel Help - XPERIA X1 Q&A, Help & Troubleshooting

Hello all. Been a lurker here for ahwile but finally had a question so figured i would sign up.
Ive been working on a panel that is basically a front end to a parts search page online.
Ive got it somewhat working but am having some issues.
Basically what i need to do is take input from the user, pass that into a url and then pass that url into the
Open URL
ive been trying to do this via javascript but i cant seem to get it... is it possible to use a java function such as self.location = "extended://app:start ect ect " to open up the link in IE?
the only way i can get IE to open is via <a href="extended.......>
sorry im not in anyway a java or html guru and havent done anything like this in years so please forgive my ignorance..
any help would be appreciated..
for reference here is the code im attempting to use..if its sloppy or messy, again im not very well versed in html or javascript..
Code:
<html>
<head>
<meta name="MobileOptimized" content="240">
<meta http-equiv="PRAGMA" content="NO-CACHE">
<title>Partsurfer Mobile</title>
<base href="http://partsurfer.hp.com/cgi-bin/spi/main">
<script type="text/javascript">
function gosearchprod() {
var searchstring = document.getElementById('prodsearch').value;
var url ="extended://app:start?app=iexplore.exe&arg=http://partsurfer.hp.com/cgi-bin/spi/main?sel_flg=modsrch&template=main&cpric=&prodsrch=";
var searchurl = url + searchstring;
self.location = searchurl;
}
function gosearchpart() {
var searchstring = document.getElementById('partsearch').value;
var url =
"extended://app:start?app=iexplore.exe&arg=http://partsurfer.hp.com/cgi-bin/spi/main?sel_flg=partinfo&template=main&cpric=&psrchmode=&partsrch=";
var searchurl = url + searchstring;
self.location = searchurl;
}
</script>
</head>
<body>
Mobile Partsurfer<br>
<br>
<br>
By model number or name:<br>
<input name="prodsearch" id="prodsearch" value=""
type="text">
<input name="gobutton" id="gobutton" value="Go!"
onclick="gosearchprod();" type="button"><br>
<br>
By part number:<br>
<input name="partsearch" id="partsearch" value=""
type="text">
<input name="gobutton" id="gobutton" value="Go!"
onclick="gosearchpart();" type="button">
</body>
</html>

anyone?? common i cant be the only one attempting to create html panels here....even if people who know javascript can take a peek that would be awesome..
help... please.?!?

or does anyone know if you can pass variables into the "arg=" instead of say passing in "arg=http:///..........."
say "arg=id1 bla bla bla" ??

Related

GeoLocation available to webservers?

I use my G1's default browser to access a website hosted by an Apache server running on my home Linux box.
I'd like to modify some of my cgi-bin Perl scripts to record the GeoLocation (Latitude/Longitude) of my G1 at the time its browser accesses those scripts on my home website.
I had hoped the Lat/Long info would automatically be sent to my home server from my G1's browser within some ENV variable. Eg, the HTTP_USER_AGENT variable contains info that's useful to any webserver, such as ".... Android 1.6; ..... G1 Build/DRC83 .... Mobile Safari/525.20.1" and so on.
Is there a way to get the G1 browser to send the GeoPosition info to my home webserver? Or is it already being sent and I just need to look for it in another place?
Thanks in advance for any tips!
I found one answer that works!
This solution, cobbled together with pieces from code on two websites I found, uses javascript and Google Gears.
I'm posting it here in case anyone else searching for the same answer I was happens to stumble on this thread. Just put the code below into a .htm / .html file.
Best regards.
***** NOTE: DUE TO NEW USER RESTRICTIONS IN THIS FORUM FORBIDDING USE OF LINKS IN POSTINGS (SUSPICIONS THAT IT IS SPAM), I'VE BROKEN UP THE TWO URL'S JUST BELOW WITH BLANKS THAT YOU'LL HAVE TO REMOVE.
*****
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript"
src="http : // ajax. googleapis. com/ajax/libs/jquery/1.3.2/jquery.min.js"></script>
<script type="text/javascript"
src="http : // code. google. com/apis/gears/gears_init.js"></script>
<script type="text/javascript">
function updatePosition(position) {
alert('Your Latitude/Longitude is: ' + position.coords.latitude + ',' +
position.coords.longitude);
}
function handleError(positionError) {
alert('Attempt to get location failed: ' + positionError.message);
}
var geo = "";
try {window.navgeo = !!(typeof navigator.geolocation != 'undefined');}
catch(e){}
if (window.navgeo) {
geo = navigator.geolocation;
document.write('HTML5: Waiting for permission from User ');
} else {
try {window.gears =
!!(typeof GearsFactory != 'undefined' ||
navigator.mimeTypes['application/x-googlegears'] ||
new ActiveXObject('Gears.Factory')
);
}
catch(e){}
if (window.gears) {
geo = google.gears.factory.create('beta.geolocation');
document.write('Google Gears: Waiting for permission from User.');
}
}
if (geo != "") {
geo.getCurrentPosition(updatePosition, handleError);
} else {
document.write('No GPS data avalable with this Browser/Device.');
}
</script>
</head>
</html>
code not working
Hi,
I'm a newbie.
I tried your code both in 2.2 android emulator, I get the following ..
"Attempt to get location failed. The last location provider is no longer avaialbe"
Also you dont need to add google gears support.. you just do with this -
if (geo != "") {
geo.getCurrentPosition(updatePosition, handleError, {enableHighAccuracy:true});
} else {
document.write('No GPS data avalable with this Browser/Device.');
}
Can you help me out with this?

HTML Forms question

I'm trying to put together a small HTML page that links to several reports I look at frequently so I'm trying to do something like this
USER ID [____________] [SUBMIT]
and whatever is entered will be tacked on to the end of a URL that is launched.
So something like this
http://blah/report=(whatever they typed in)
I've done a bit of googling but can't seem to find a way to do it.
Try this one
HTML:
<html>
<body>
<form action="http://forum.xda-developers.com/" method="get">
USER ID: <input type="text" name="report" /><input type="submit" value="Submit" />
</form>
</body>
</html>
For USER ID: 123456
It will go to "http://forum.xda-developers.com/?report=123456

[Q] Load Local Javascript (Help)

I'm having difficulty loading my Local HTML File with Javascript. I will try explain this my issue as best as possible.
I have created a HTML5 website with Javascript and I've placed this in (main/assets/354) so inside the 354 is the HTML website with the javascript, but not in a folder. I intensionally did not add a JS folder inside the website folder so everything is in the 354 folder including images.
Now when I test the app on the Android Tablet everything seems fine but when I click the (image) which directs me to the local HTML file nothing appears (a white screen) but when you click the screen you can see a loading icon which is the HTML file. I know the reason why its working, its due to not having an extension to the url link. Example /354/index.html?lc=uk but I solved this by adding
HTML:
<body onload="setGetParameter('lc', 'uk');">
in the coding.
But for some reason it doesnt seem to pick up the Javascript or something else (this is what I'm confused on)
If someone could help me figure this out would be much appreciated.
(710.java)
HTML:
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_710);
WebView view = new WebView(this);
view.getSettings().setJavaScriptEnabled(true);
view.loadUrl("file:///android_asset/354/index.html");
setContentView(view);
}

[GUIDE][Difficulty: Advanced] Send an SMS with Address, Speed, and URL for a Map Pin

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.

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