Profile: Voice - Navigate To (62)
State: AutoVoice Recognized [ Configuration:Event Behaviour: true
Command: "navigate to" ]
Enter: Voice Navigation (63)
A1: Variable Set [ Name:%Home To:home Do Maths:Off Append:Off ]
A2: Variable Set [ Name:%Work To:work Do Maths:Off Append:Off ]
A3: Variable Set [ Name:%Parents To:mum and dad Do Maths:Off Append:Off ]
A4: Variable Set [ Name:%Dustin To:dustin Do Maths:Off Append:Off ]
A5: Variable Set [ Name:%VanessasParents To:Vanessa's parents Do Maths:Off Append:Off ]
A6: If [ %avcommnofilter ~ %Home ]
A7: Variable Set [ Name:%Destination To:201 South Anystreet St Anytown PA 18049 Do Maths:Off Append:Off ]
A8: Else If [ %avcommnofilter ~ %Parents ]
A9: Variable Set [ Name:%Destination To:339 Anystreet Rd Anytown PA 19504 Do Maths:Off Append:Off ]
A10: Else If [ %avcommnofilter ~ %Dustin ]
A11: Variable Set [ Name:%Destination To:2456 Anystreet Ln Anytown PA 18104 Do Maths:Off Append:Off ]
A12: Else If [ %avcommnofilter ~ %VanessasParents ]
A13: Variable Set [ Name:%Destination To:12 Anystreet Rd Any PA Do Maths:Off Append:Off ]
A14: Else If [ %avcommnofilter ~ %Work ]
A15: Variable Set [ Name:%Destination To:795 Anystreet Rd Anytown PA 18109 Do Maths:Off Append:Off ]
A16: Else
A17: Variable Set [ Name:%Destination To:%avcommnofilter Do Maths:Off Append:Off ]
A18: End If
A19: Wait [ MS:0 Seconds:2 Minutes:0 Hours:0 Days:0 ]
A20: Send Intent [ Action:android.intent.action.VIEW Cat:None Mime Type: Data:google.navigation:q=%Destination Extra: Extra: Package: Class: Target:Activity Continue Task After Error:On ]
This will navigate directly to my home if %avcommnofilter is "home" and same for my work, friend's, parents, etc. Or I can just say a specific address...or something google-able like "Walmart" "McDonald's" etc...
This reminds me that I want to include the use of %LOC in my query... I'll get to that soon.
Bob's house, <GPS coordinates>
That is cool... I'm gonna add that too. Thanks for sharing!
Wait Jeremy! Need more help lol. I'm a noob.
how do you do this pary
Which part? You just quoted the whole task?
also what is the (62) and (63) for?
Those are just numbers assigned to tasks as you create them. Not important as far as I know.
For the "voice" part, I use the Autovoice plugin. You can see how I've set it up in the profile description. The "navigation" part is the "voice navigation" part is the entire task... You can see how I handled the voice recognition in the task description. The "navigation" part is the very last action in the task...Send Intent... And it's what makes the magic happen. It opens maps automatically set to navigation to wherever you told it to go.
--
You received this message because you are subscribed to a topic in the Google Groups "Tasker" group.
To unsubscribe from this topic, visit https://groups.google.com/d/topic/tasker/FkgSbOU-bgo/unsubscribe.
To unsubscribe from this group and all its topics, send an email to tasker+un...@googlegroups.com.
Visit this group at http://groups.google.com/group/tasker.
For more options, visit https://groups.google.com/d/optout.
Ultimately, You'll find that %Destination isn't set with what you expect, I think.
I'm not familiar with %avcommandandfilter ...is that intentional? I use %avcommnofilter no filter... which is the words after my trigger words.
So with the example:
"Navigate to Robert home"
Navigate to is the trigger and Robert home is %avcommnofilter.
I suspect that Home and Work are working for you only because maybe you have them saved as Google locations.
Try changing every instance of %avcommandandfilter to %avcommnofilter
Okay cool, you're almost there. Your results indicate that %avcommnofilter doesn't match %JohnFisher...It's using Google as if you said "navigate to McDonald's". There's various ways to debug that, but I'd start by using all lowercase in your If/Else conditions.
--
If you haven't done so already, make sure you have toasts turned on for Autovoice Continuous possible recognized commands, so you can see how your voice is recognized.
The problem is that %avcommnofilter does not match exactly what you have set for %JohnFisher (John Fisher's home).
What I was trying to say was to set it to (john fisher home), but that was just a guess...I made it confusing for you probably, sorry.
But you might find that %avcommnofilter holds "John Fishers home" or something else. You'll have to check and see, then adjust %JohnFisher accordingly. You could check for matches against several possibilities, long term if you need to.
Just another approach to consider.
For several years, I have been using my contacts as way points and to store any destination. Some of the advantages of this is are..
1. The way you can search for who or what you are looking for. A contact name can be very long so you can enter as much data as you like to help you find it again. I find this far easier to use then the antiquated file hierarchy system or even worse a alphabetized list. For example, To save the location of a hiking trail head i will save it as 'Hiking town state date difficulty' so to find hiking trails in vermont I can just search my contacts for vermont hiking or use just the town ect..
2. Instant cloud back up when created.
3. Able to access from any device with web access
4. Can use lat lon or street address
5. Easily integrated with navigation
6. Unlimited storage
7. Easily add all kinds of data for each contact
8. Easily add locations found by searching maps.
Ect... ect...
I find it absurd that google now is still incapable of navigating directly to a contact. However with tasker I think you will be able to achieve as much automation for navigating to a contact as you like. I personally do not find speech recognition accurate enough to get a one step voice command correct. I prefer at the very least 1 additional step where I can verify it is about to do what I want. IE when I say 'navigate to bobs' I want it to show a button and ask 'do you want to navigate to bobs' so I do not automatically navigate to 'boobs'.
So for my navigation I will take a voice input then have tasker open my contact search and paste in what it thinks I want to search for. This brings up a list of all 'bobs' for me to select one of them. Then I tap on the address for the contact. After that tasker will tap on the 'get directions' option then tap on the 'navigation' option. So I get my confirmation screen then one additional tap will navigate me to my query.. I am sure if you wanted a one step navigation this would be possible as well..
To save a location I just do a 'get location' then convert lat lon to a address then use a 'open map' action which will open maps with a location tag showing. Hit the menu key and save to contacts. Now i already have the address in the contact name.
Probably not for everyone, just thought i would share..
It'd be interesting to see an example of this setup with contact variables.
> It'd be interesting to see an example of this setup with contact variables.
What do you mean by contact variables. As usual my set up is part of other profiles and tasks, most of the actions are basic, if you would like specifics i can pull them out for you, just let me know..
> > It'd be interesting to see an example of this setup with contact variables.
Here is a example of how I take the 'get voice' results and start the contact search with the results. This was just copied out of a task and is not a stand alone task.
Navigate To (649)
<navigate>
A1: If [ %voice1 %voice2 ~ navigate to/navigate too/search for/call* ]
A2: Array Pop [ Variable:%voice Position:1 To Var: ] If [ %voice1 !~ call ]
A3: Array Pop [ Variable:%voice Position:1 To Var: ]
A4: Variable Join [ Name:%voice Joiner:%space Delete Parts:Off ]
A5: Run Shell [ Command:am start -a android.intent.action.SEARCH -t vnd.android.cursor.dir/contact --es query "%voice" --activity-clear-task Timeout (Seconds):0 Use Root:On Store Output In: Store Errors In: Store Result In: ]
A6: Goto [ Type:Action Label Number:1 Label:end task ]
A7: Stop [ With Error:Off Task: ]
A8: End If
Since I started using Tasker in May, I haven't done anything at all with contacts, so I'm just a bit unfamiliar...but I imagine the processes are similar to other things I've done... I'll chime in if I get stuck on something. I might find some more time to play around with it over the weekend.
Thanks for sharing that intent especially. ;)
Test Voice Navigation (240)
A1: Variable Set [ Name:%Test To:%avcommnofilter Do Maths:Off Append:Off ]
A2: AutoContacts [ Configuration: Package:com.joaomgcd.autocontacts Name:AutoContacts Timeout (Seconds):1000 ]
A3: [X] Flash [ Text:%acnames() Long:Off ]
A4: [X] Stop [ With Error:Off Task: ]
A5: If [ %acnames() ~ *,%Test,* ]
A6: Variable Set [ Name:%Contact To:%Test Do Maths:Off Append:Off ]
A7: AutoContacts [ Configuration:Contact Name or Nickname: %contact Package:com.joaomgcd.autocontacts Name:AutoContacts Timeout (Seconds):1000 ]
A8: Variable Set [ Name:%Destination To:%acaddress Do Maths:Off Append:Off ]
A9: Else
A10: Variable Set [ Name:%Destination To:%Test Do Maths:Off Append:Off ]
A11: End If
A12: Send Intent [ Action:android.intent.action.VIEW Cat:None Mime Type: Data:google.navigation:q=%Destination Extra: Extra: Package: Class: Target:Activity Continue Task After Error:On ]
I'm stuck on figuring out how to make the condition on A5 true. Gonna step away for a little bit and come back fresh... Probably something obvious that I'm missing.
I'm open to better solutions but here's how I did it:
Profile: Voice - Navigate To (62)
State: AutoVoice Recognized [ Configuration:Event Behaviour: true
Command: "navigate to" ]
Enter: Voice Navigation (240)
A1: Variable Set [ Name:%navto To:%avcommnofilter Do Maths:Off Append:Off ]
A2: Variable Convert [ Name:%navto Function:To Lower Case Store Result In: ]
A3: Variable Search Replace [ Variable:%navto Search:[0-9] Ignore Case:Off Multi-Line:Off One Match Only:Off Store Matches In:%addressdirect Replace Matches:Off Replace With: ]
A4: AutoContacts [ Configuration: Package:com.joaomgcd.autocontacts Name:AutoContacts Timeout (Seconds):1000 ]
A5: If [ %acnames() ~ *%navto* ]
A6: Variable Set [ Name:%contact To:%navto Do Maths:Off Append:Off ]
A7: AutoContacts [ Configuration:Contact Name or Nickname: %contact Package:com.joaomgcd.autocontacts Name:AutoContacts Timeout (Seconds):1000 ]
A8: If [ %acaddress !Set ]
A9: Flash [ Text:%acname doesn't have an address. Long:Off ]
A10: Else
A11: Variable Set [ Name:%destination To:%acaddress Do Maths:Off Append:Off ]
A12: End If
A13: Else If [ %addressdirect !Set ]
A14: Perform Task [ Name:LOC Convert To Address Priority:%priority + 1 Parameter 1 (%par1): Parameter 2 (%par2): Return Value Variable: Stop:Off ]
A15: Variable Set [ Name:%destination To:%navto %LocZip Do Maths:Off Append:Off ]
A16: Else
A17: Variable Set [ Name:%destination To:%navto Do Maths:Off Append:Off ]
A18: End If
A19: Send Intent [ Action:android.intent.action.VIEW Cat:None Mime Type: Data:google.navigation:q=%destination Extra: Extra: Package: Class: Target:Activity Continue Task After Error:On ]
LOC Convert To Address (242)
A1: Variable Set [ Name:%space To: Do Maths:Off Append:Off ]
A2: Get Location [ Source:Any Timeout (Seconds):100 Continue Task Immediately:Off Keep Tracking:Off ]
A3: HTTP Get [ Server:Port:maps.google.com/maps/api/geocode/json?latlng=%LOC&sensor=false Path: Attributes: Cookies: User Agent: Timeout:10 Mime Type:text/xml Output File: Trust Any Certificate:Off ]
A4: Variable Set [ Name:%location To:%HTTPD Do Maths:Off Append:Off ]
A5: Variable Split [ Name:%location Splitter:"formatted_address" Delete Base:Off ]
A6: Variable Split [ Name:%location2 Splitter:" Delete Base:Off ]
A7: Variable Split [ Name:%location22 Splitter:, USA Delete Base:Off ]
A8: Variable Set [ Name:%LocAddress To:%location221 Do Maths:Off Append:Off ]
A9: Variable Split [ Name:%location221 Splitter:, Delete Base:Off ]
A10: Variable Split [ Name:%location2213 Splitter:%space Delete Base:Off ]
A11: Variable Set [ Name:%LocZip To:%location22133 Do Maths:Off Append:Off ]
Finished.
looks good.
Thanks! :)
How dose that work for you? do you need to have the exact contact name or just part of it? in other words if your contact is saved as Bob smith, what happens when you say "navigate to Bob"
I thought you would need a list of contact names then search that for matches and if you found more then one match then display the options.
My sample size is small enough right now that I haven't run into any issues yet. However, I would've expected a coma delimited array in %acnames() of all matches...but I only return a single match on the first in alphabetical order...gonna have to workaround that soon than later.
To save a location I just do a 'get location' then convert lat lon to a address then use a 'open map' action which will open maps with a location tag showing. Hit the menu key and save to contacts. Now i already have the address in the contact name.
I'm trying to figure this bit out. I can get converted to a formatted street address but when I'm in maps and hit menu, there's no option to Save to Contacts.
I'm using an intent to Create Contact then Auto Input from there...or that's the approach I'm taking so far...
> To save a location I just do a 'get location' then convert lat lon to a address then use a 'open map' action which will open maps with a location tag showing. Hit the menu key and save to contacts. Now i already have the address in the contact name.
>
> I'm trying to figure this bit out. I can get converted to a formatted street address but when I'm in maps and hit menu, there's no option to Save to Contacts.
>
> I'm using an intent to Create Contact
Could you post that intent
then Auto Input from there...or that's the approach I'm taking so far...
>
That sounds a bit easier then my approach, here is the way I do it.
Get My Location (650)
A1: Flash [ Text:Getting Location
Please Wait Long:On ]
A2: Get Location [ Source:GPS Timeout (Seconds):16 Continue Task Immediately:Off Keep Tracking:Off ]
A3: Set Clipboard [ Text:%LOC Add:Off ]
A4: HTTP Get [ Server:Port:maps.google.com/maps/api/geocode/json?latlng=%LOC&sensor=false Path: Attributes: Cookies: User Agent: Timeout:120 Mime Type:text/xml Output File:testfile.txt Trust Any Certificate:Off Continue Task After Error:On ]
A5: Variable Set [ Name:%address To:%HTTPD Do Maths:Off Append:Off ]
A6: Variable Split [ Name:%address Splitter:"formatted_address" : Delete Base:Off ]
A7: Variable Split [ Name:%address2 Splitter:" Delete Base:Off ]
A8: Open Map [ Mode:Point Address:%Aaddress Lat,Long: Zoom:1 Label: Continue Task After Error:On ]
A9: [X] Wait [ MS:0 Seconds:5 Minutes:0 Hours:0 Days:0 ]
A10: Run Shell [ Command:input keyevent 66 Timeout (Seconds):0 Use Root:On Store Output In: Store Errors In: Store Result In: ]
A11: Button [ Button:Menu ]
A12: Dpad [ Button:Down Repeat Times:1 ]
A13: Run Shell [ Command:input keyevent 66 Timeout (Seconds):0 Use Root:On Store Output In: Store Errors In: Store Result In: ]
Could you post that intent
Here you go. I sniffed this one out with Intent Intercept ;)
Contacts Testing (233)
A1: Send Intent [ Action:android.intent.action.INSERT Cat:None Mime Type: Data:content://com.android.contacts/contacts Extra: Extra: Package: Class: Target:Activity ]
here is the way I do it.
Thanks. I'm still working mine out...just got back from movies with the wife and haven't played with it much this afternoon.
--
LOC Save To Contact (233)
A1: Perform Task [ Name:LOC Convert To Address Priority:%priority + 1 Parameter 1 (%par1): Parameter 2 (%par2): Return Value Variable: Stop:Off ]
A2: Send Intent [ Action:android.intent.action.INSERT Cat:None Mime Type: Data:content://com.android.contacts/contacts Extra: Extra: Package: Class: Target:Activity ]
A3: AutoInput Action [ Configuration:Type: Id
Value: com.android.contacts:id/button_add_field
Action : Click Package:com.joaomgcd.autoinput Name:AutoInput Action Timeout (Seconds):20 ]
A4: AutoInput Action [ Configuration:Type: Text
Value: Address
Action : Click Package:com.joaomgcd.autoinput Name:AutoInput Action Timeout (Seconds):20 ]
A5: AutoInput Action [ Configuration:Type: Text
Value: OK
Action : Click Package:com.joaomgcd.autoinput Name:AutoInput Action Timeout (Seconds):20 ]
A6: Set Clipboard [ Text:%LocAddress Add:Off ]
A7: AutoInput Action [ Configuration:Type: Focus
Action : Paste Package:com.joaomgcd.autoinput Name:AutoInput Action Timeout (Seconds):20 ]
A8: AutoInput Action [ Configuration:Type: Text
Value: name
Action : Focus Package:com.joaomgcd.autoinput Name:AutoInput Action Timeout (Seconds):20 ]
> Here we go...This launches the activity to create a new contact via a Send Intent
Nice.. this is a better approach. Did you try to find a way to include the query in the intent? I would think this is possible. I will do some searching to see if it can be incuded in the intent.
A7: AutoContacts [ Configuration:Contact Name or Nickname: %contact Package:com.joaomgcd.autocontacts Name:AutoContacts Timeout (Seconds):1000
How dose that work for you? do you need to have the exact contact name or just part of it? in other words if your contact is saved as Bob smith, what happens when you say "navigate to Bob"
I thought you would need a list of contact names then search that for matches and if you found more then one match then display the options.
My sample size is small enough right now that I haven't run into any issues yet. However, I would've expected a coma delimited array in %acnames() of all matches...but I only return a single match on the first in alphabetical order...gonna have to workaround that soon than later.
I'm getting some inconsistencies. Sometimes it's not matching on contacts that should be there (both partial and full matches). Also, sometimes when it DOES match, %acaddress is not set for the contact when it should be.
I noticed at one point that %acnames() only contained the first half of my contacts (A-J)... I'm gonna have to dig into that a little bit today... Trying to figure out a pattern, etc...
Nice.. this is a better approach. Did you try to find a way to include the query in the intent? I would think this is possible. I will do some searching to see if it can be incuded in the intent.
I've only given it a passing thought so far. Haven't figured out if I can insert an address data/field directly in the intent yet...possibly in the data or extra fields...might be a better chance by starting the intent via Run Shell instead, especially if flags are needed.
I'm looking at a pretty packed day today...but my mind is consumed with tasker, so I'll plug away more today, a little at a time...
> Here we go...This launches the activity to create a new contact via a Send IntentNice.. this is a better approach. Did you try to find a way to include the query in the intent? I would think this is possible. I will do some searching to see if it can be incuded in the intent.
--
> Nice.. this is a better approach. Did you try to find a way to include the query in the intent? I would think this is possible. I will do some searching to see if it can be incuded in the intent.
Got it.. Matt r posted this..
Send Contact Intent (651)
A1: Send Intent [ Action:android.intent.action.INSERT Cat:None Mime Type:vnd.android.cursor.dir/raw_contact Data: Extra:name:Fake name Extra:phone:555-0199 Package: Class: Target:Activity ]
To add an address you would use "postal"
Send Contact Intent (651)
A1: Send Intent [ Action:android.intent.action.INSERT Cat:None Mime Type:vnd.android.cursor.dir/raw_contact Data: Extra:name:New Name Extra:postal:New Address Package: Class: Target:Activity ]
All of the contact data fields can be found here..
http://developer.android.com/reference/android/provider/ContactsContract.Intents.Insert.html
A1: Send Intent [ Action:android.intent.action.INSERT Cat:None Mime Type:vnd.android.cursor.dir/raw_contact Data: Extra:name:New Name Extra:postal:New Address Package: Class: Target:Activity ]
Thanks man, that's great! That effectively eliminates A3 - A8 in the task above, and even let's me do something more... like "Save location to Joe" and completely fill in both the name and address!
--
> A1: Send Intent [ Action:android.intent.action.INSERT Cat:None Mime Type:vnd.android.cursor.dir/raw_contact Data: Extra:name:New Name Extra:postal:New Address Package: Class: Target:Activity ]
>
> Thanks man, that's great! That effectively eliminates A3 - A8 in the task above, and even let's me do something more... like "Save location to Joe" and completely fill in both the name and address!
Yes, much nicer.. there are a few wiggles to work out, for example I was just playing with it and when if I am at a location that does not return a street address with street numbers, like a spot along a highway, if you just save that address it will not be able to find that exact point when searching for the contacts address. So I am thinking we will need to test the returned address for a street number and if there is no street number then save the lat,lon instead of the returned address.
I will probably make a option to enter the contact name with 'voice' for more automation, with a 'do you want to save?' option to make sure the 'get voice' "gets it correct"
So I am thinking we will need to test the returned address for a street number and if there is no street number then save the lat,lon instead of the returned address.
After more thought, with all the options and categories available with contacts I will probably try to save the lat lon as the primary address for easy navigation and the street address as a secondary address.
I also found that a contact search appears to search 'all' the contact fields, I could have sworn I tested this a long while ago and found it to only search the contact name category. This makes thing much nicer as you can put all the info in the proper categories and still find them with quickly with a contact search. It even searches the 'notes' so this is most likely where I will be storing all the extra data I want to search the contacts for. Such as 'hiking trail head' , ;'ski mountain', 'places to see' ect....
Here's an updated working task:
Voice Navigation (240)
A1: Variable Set [ Name:%navto To:home Do Maths:Off Append:Off ]
A2: Variable Convert [ Name:%navto Function:To Lower Case Store Result In: ]
A3: Variable Search Replace [ Variable:%navto Search:[0-9] Ignore Case:Off Multi-Line:Off One Match Only:Off Store Matches In:%addressdirect Replace Matches:Off Replace With: ]
A4: AutoContacts [ Configuration:Contact Name or Nickname: %navto Package:com.joaomgcd.autocontacts Name:AutoContacts Timeout (Seconds):1000 Continue Task After Error:On ]
A5: If [ %acname Set ]
<Check Contact Address>
A6: If [ %acaddresses1 ~ *acadd* ]
A7: For [ Variable:%contact Items:%acaddresses() ]
A8: Array Pop [ Variable:%acaddresses Position:1 To Var: ]
A9: Goto [ Type:Action Label Number:1 Label:Check Contact Address ]
A10: End For
A11: Else
A12: Variable Set [ Name:%destination To:%acaddresses1 Do Maths:Off Append:Off ]
A13: Flash [ Text:Navigating to contact at %acaddresses1 Long:Off ]
A14: End If
A15: Else If [ %addressdirect !Set ]
A16: Perform Task [ Name:LOC Convert To Address Priority:%priority + 1 Parameter 1 (%par1): Parameter 2 (%par2): Return Value Variable: Stop:Off ]
A17: Variable Set [ Name:%destination To:%navto %LocZip Do Maths:Off Append:Off ]
A18: Flash [ Text:Navigating to search result. Long:Off ]
A19: Else
A20: Variable Set [ Name:%destination To:%navto Do Maths:Off Append:Off ]
A21: Flash [ Text:Navigating to address. Long:Off ]
A22: End If
A23: Send Intent [ Action:android.intent.action.VIEW Cat:None Mime Type: Data:google.navigation:q=%destination Extra: Extra: Package: Class: Target:Activity Continue Task After Error:On ]
That makes sense, and I'll probably follow suit... It'll be very useful to mark my hunting stands and trail heads.
I tried it this way too...I kinda like being able to select from a list of partial matches! Right now, my goal is to be 100% hands free, but I'm going to consider automating this way too...combination of AutoVoice and AutoInput or touch simulations might do the trick...hmm...maybe even navigate intent... interesting.
> After more thought, with all the options and categories available with contacts I will probably try to save the lat lon as the primary address for easy navigation and the street address as a secondary address.
>
> That makes sense, and I'll probably follow suit... It'll be very useful to mark my hunting stands and trail heads.
I have been at this for a few hrs and So far I can not figure out how to set 2 different address fields with the same intent. I went to a shell command intent because tasker only has 2 extra fields and I figured I would be setting more then 2 of the contact data fields. It seems I can set as many fields as I like but I can not set a primary address and a secondary address.
Here is the shell command..
Send Contact Intent (651)
A2: Run Shell [ Command:am start -a android.intent.action.INSERT -t vnd.android.cursor.dir/raw_contact -e "name" "New contact name" -e "postal" "123 main street westford MA" -e "notes" "hiking trail" Timeout (Seconds):0 Use Root:On Store Output In: Store Errors In: Store Result In: ]
It seems I can set as many fields as I like but I can not set a primary address and a secondary address.
Here is the shell command..
Send Contact Intent (651)
A2: Run Shell [ Command:am start -a android.intent.action.INSERT -t vnd.android.cursor.dir/raw_contact -e "name" "New contact name" -e "postal" "123 main street westford MA" -e "notes" "hiking trail" Timeout (Seconds):0 Use Root:On Store Output In: Store Errors In: Store Result In: ]
Hmmm....auto contacts has a variable for "address type" (ie: home, work, etc...) so I wonder if a good place to start figuring out how to add multiple addresses would be to identify the "type" of address in the field?
Check out
POSTAL_ISPRIMARY flag
and also
POSTAL_TYPE
I can successfully set an address as "work" type instead of the default "home" type using both of the Extra fields in a Send Intent action.
I'm not too experienced in invoking from shell but I gave that a shot unsuccessfully...but this has got to be possible.
...how I tried to modify...
> http://developer.android.com/reference/android/provider/ContactsContract.Intents.Insert.html
>
> Check out
>
> POSTAL_ISPRIMARY flag
> and also
> POSTAL_TYPE
Yea, those are the ones I have been playing with.
>
> I can successfully set an address as "work" type instead of the default "home" type using both of the Extra fields in a Send Intent action.
I think if you check closely you will find you made a additional 'work' category as a extra label. and it is not the actual 'work ' category. That was my findings anyway.
>
> I'm not too experienced in invoking from shell but I gave that a shot unsuccessfully...but this has got to be possible.
I am not sure about that... :(
>
I am not sure about that... :(
Well, at the very least, I can use this intent to open the Create Contact screen with name and 1 address, then use AutoInput to click the "+" button, then paste 2nd address.
I'm also trying to figure out if it's possible to run the intent as is, then run a second intent ACTION_EDIT right afterwards, to add a second address to the existing contact just created by the first action...
--
> Well, at the very least, I can use this intent to open the Create Contact screen with name and 1 address, then use AutoInput to click the "+" button, then paste 2nd address.
True..
>
> I'm also trying to figure out if it's possible to run the intent as is, then run a second intent ACTION_EDIT right afterwards, to add a second address to the existing contact just created by the first action...
That was my next thought as well. However I am not apposed to simply set another field as the street address (like 'company' ) and set the address field to lat, lon.
> > I'm also trying to figure out if it's possible to run the intent as is, then run a second intent ACTION_EDIT right afterwards, to add a second address to the existing contact just created by the first action...
Okay I give up.. The fact that the docs list additional categories for phone and email but not for address leads me to believe that this is not possible. And if it is, it over my head to figure it out anyway... :)
Okay I give up..
Ah yes, a worthy adversary it's proven to be. The work week beckons me, but I'll continue to tinker here and there.
I am overwhelming pleased with how this weekend's project has turned out though. Very good ideas to implement contacts to my navigation and being able to add new waypoints to contacts. So, thank you for the idea and support!
LOC Save To Contact (233)
A1: Perform Task [ Name:LOC Convert To Address Priority:%priority + 1 Parameter 1 (%par1): Parameter 2 (%par2): Return Value Variable: Stop:Off ]
A2: Send Intent [ Action:android.intent.action.INSERT Cat:None Mime Type: Data:content://com.android.contacts/contacts Extra:postal_type:Navigation Extra:postal:%LocLatLon Package: Class: Target:Activity ]
A3: AutoInput Action [ Configuration:Type: Id
Value: com.android.contacts:id/add_button_container
Nearby Text: address
Action : Click Package:com.joaomgcd.autoinput Name:AutoInput Action Timeout (Seconds):20 ]
A4: Set Clipboard [ Text:%LocAddress Add:Off ]
A5: AutoInput Action [ Configuration:Type: Focus
Action : Paste Package:com.joaomgcd.autoinput Name:AutoInput Action Timeout (Seconds):20 ]
A6: If [ %AVCONTINUOUS !~ true ]
A7: AutoInput Action [ Configuration:Type: Text
Value: name
Action : Focus Package:com.joaomgcd.autoinput Name:AutoInput Action Timeout (Seconds):20 ]
A8: Else
A9: Set Clipboard [ Text:%avcommnofilter Add:Off ]
A10: AutoInput Action [ Configuration:Type: Text
Value: name
Action : Paste Package:com.joaomgcd.autoinput Name:AutoInput Action Timeout (Seconds):20 ]
A11: AutoInput Action [ Configuration:Type: Text
Value: save
Action : Click Package:com.joaomgcd.autoinput Name:AutoInput Action Timeout (Seconds):20 ]
A12: Wait [ MS:0 Seconds:1 Minutes:0 Hours:0 Days:0 ]
A13: Run Shell [ Command:input keyevent 4 Timeout (Seconds):0 Use Root:On Store Output In: Store Errors In: Store Result In: ]
A14: End If
> Well, here's my solution for now...
I will probably end up with something very similar.
both lat/long and street address is entered,
I found if I did that and the street address did not contain street numbers then need a navigation app would Try to locate a combination of the lat lon and street address and not find it.
That is why I will probably not put them together and use a different category for the street address.
Here is the address I was testing with.
42.41001715,-72.10933331666666. Massachusetts 2, Athol, MA 01331, USA
To navigate to a contact I revised my approach a little.
Now I,
get voice
Check for 'navigate to'
Open contact search with my query
Tap on correct contact
Long press on address (this can be lat lon or street)
Tap on "copy to clipboard"
I now have a additional profile like this..
Profile: Navigate To Clip (652)
Event: Variable Set [ Variable:%CLIP Value:%WIN ]
Enter: Nav To Clip On (653)
A1: Notify [ Title:It Worked Text: Icon:null Number:0 Permanent:Off Priority:3 ]
A2: Open Map [ Mode:Navigate To Address:%CLIP Lat,Long: Zoom:1 Label: Continue Task After Error:On ]
On my device the %WIN value becomes the value of the displayed address when the 'copy to clip board' toast comes up, so setting the clipboard will trigger this profile. Then i just use a 'open map' action set to navigation. Even though i have the data in a 'address' field it will still work if the address is a lat, lon.
.
Edit..
> Now I have
>
>tasker- get voice
>tasker- Check for 'navigate to'
>tasker- Open contact search with my query
> user- Tap on correct contact
> user- Long press on address (this can be lat lon or street)
> user- Tap on "copy to clipboard"
>
So i now have 3 screen taps to navigate to a contact and i have my confirmation screen.
Since my approach is different than yours I didn't expect to run into that problem...and I don't. But I expected that I would have both addresses loaded in %acaddresses()...and I don't. I only get the lat/long loaded and the street address remains inaccessible in AutoContacts as far as I can tell.
That's functional, so okay by me. Street address is still visible in the contact if I need to view it.
Clever! I like it. The contact search intent you're using is really nice... I still need to create a scene, or adopt your method, or find some other way to deal with matches on multiple contacts that have addresses. Right now it's not a problem because I don't have many addresses saved to my contacts... that'll change quickly though.