I have tried valiantly to adapt this to Tasker, but I just can't get the Tasker code right. Can anyone *please* help me make sense of it?
Yes, I realize that Tasker has a means of detecting these state attributes, but only as a profile context, but there are a few reasons that make creating a separate profile undesirable. I also realize that Notification Listener followed by a Regex can also indirectly yield the charging source, but that is suboptimal and less efficient (and in general I really try to avoid plugins as much as possible)
P's and Q's in advance.
As for what I am trying to accomplish (and I'm not altogether sure why it would be relevant), the aim is to interrogate Android to ascertain which charging method is active so that various performance parameters can be adjusted accordingly (i.e. screen timeout, screen brightness, etc, etc). For Tasker's "restore settings" to work optimally, the charging method needs to be evaluated within the same profile with the charging state context. It would be ridiculously inelegant to create four different profiles for Fast AC, AC, USB, and wireless.
Unless Joao could incorporate the fused location Play Service, that would save me some work.
--You received this message because you are subscribed to the Google Groups "Tasker" group.To unsubscribe from this group and stop receiving emails from it, send an email to tasker+un...@googlegroups.com.Visit this group at https://groups.google.com/group/tasker.To view this discussion on the web visit https://groups.google.com/d/msgid/tasker/ceef9684-7e89-40a2-be00-53caec16a2ad%40googlegroups.com.For more options, visit https://groups.google.com/d/optout.
The following lines successfully return the address location info, but requires that I first get a coordinates fix within tasker. For efficiency, I'd love to be able to query Android for the last seen coordinates. (Or a way to get the address info directly from Android without having to ask Android for a location lookup.)
A1: Java Function [ Return:geo Class Or Object:Geocoder Function:new
{Geocoder} (Context) Param:CONTEXT Param: Param: Param: Param: Param: Param: Continue Task After Error:On ]
A2: Java Function [ Return:%temp Class Or Object:geo Function:getFromLocation
{List} (double, double, int) Param:%par(6) Param:%par(7) Param:1 Param: Param: Param: Param: Continue Task After Error:On ]
A3: Variable Search Replace [ Variable:%temp(1) Search:(?ix) \".*?\" | (?<=\=)(?!(?:null|true|\-?\d+\.\d+)(?:\,|\]|$))[^\,\"]+(?=\,|\]|$) Ignore Case:Off Multi-Line:Off One Match Only:Off Store Matches In Array:%temp(1) Replace Matches:Off Replace With: ] If [ %temp(1) Set ]
<TaskerData sr="" dvi="1" tv="5.7.2">
<Task sr="task64">
<cdate>1559575345236</cdate>
<edate>1559575420447</edate>
<id>64</id>
<nme>Sandbox - Location</nme>
<Action sr="act0" ve="7">
<code>664</code>
<se>false</se>
<Str sr="arg0" ve="3">geo</Str>
<Str sr="arg1" ve="3">Geocoder</Str>
<Str sr="arg2" ve="3">new
{Geocoder} (Context)</Str>
<Str sr="arg3" ve="3">CONTEXT</Str>
<Str sr="arg4" ve="3"/>
<Str sr="arg5" ve="3"/>
<Str sr="arg6" ve="3"/>
<Str sr="arg7" ve="3"/>
<Str sr="arg8" ve="3"/>
<Str sr="arg9" ve="3"/>
</Action>
<Action sr="act1" ve="7">
<code>664</code>
<se>false</se>
<Str sr="arg0" ve="3">%temp</Str>
<Str sr="arg1" ve="3">geo</Str>
<Str sr="arg2" ve="3">getFromLocation
{List} (double, double, int)</Str>
<Str sr="arg3" ve="3">%par(6)</Str>
<Str sr="arg4" ve="3">%par(7)</Str>
<Str sr="arg5" ve="3">1</Str>
<Str sr="arg6" ve="3"/>
<Str sr="arg7" ve="3"/>
<Str sr="arg8" ve="3"/>
<Str sr="arg9" ve="3"/>
</Action>
<Action sr="act2" ve="7">
<code>598</code>
<Str sr="arg0" ve="3">%temp(1)</Str>
<Str sr="arg1" ve="3">(?ix) \".*?\" | (?<=\=)(?!(?:null|true|\-?\d+\.\d+)(?:\,|\]|$))[^\,\"]+(?=\,|\]|$)</Str>
<Int sr="arg2" val="0"/>
<Int sr="arg3" val="0"/>
<Int sr="arg4" val="0"/>
<Str sr="arg5" ve="3">%temp(1)</Str>
<Int sr="arg6" val="0"/>
<Str sr="arg7" ve="3"/>
<ConditionList sr="if">
<Condition sr="c0" ve="3">
<lhs>%temp(1)</lhs>
<op>12</op>
<rhs></rhs>
</Condition>
</ConditionList>
</Action>
</Task>
</TaskerData>
But while I have your ear, do you know how to get the "last location" from android?
Also, Tasker's location vars do not update with Android, but Android *does* update with Tasker. So doing a Tasker location update before an address lookup will ensure that Android knows you migrated from an out parcel fast food joint to the mall just behind it (which probably has a different street address).
Admitted, kinda frivolous, but highly useful for tracking events such as sales visits or journals. Add a task shortcut with a voice promoting to add a quick encounter memo or summary. Everything can be written to a csv for Excel or Google Sheets. The timestamps and coords allow calculation of mileage, travel time, and visit time. Also useful if documenting such things as business or medical expense tax itemizations.
--You received this message because you are subscribed to the Google Groups "Tasker" group.To unsubscribe from this group and stop receiving emails from it, send an email to tasker+un...@googlegroups.com.Visit this group at https://groups.google.com/group/tasker.
To view this discussion on the web visit https://groups.google.com/d/msgid/tasker/72e9f80a-4082-48b0-8e60-b66530178362%40googlegroups.com.