Can't seem to find a context for an app counter - Tasker Tips & Tricks

Hello!
What I'm trying to do is record the frequency of apps that I use. I'd plan on making a database and then just updating a counter field by 1 each time the app is used.
Now .. here's my problem. In the profile there is the application context but I'd have to check off every app I have on my phone. That could become a real pain if I add apps. I like to try different apps to see if they're any good, so I'd still like to track those. There is zero in the event context to detect an app launch or the app being used in the foreground.
I'm not sure if there is a shell command to get such information either and if there is can an unrooted device access it?
I appreciate the help/input!
Dave

Related

[Q] Retriving Network Statistiks on Galaxy S

Hello everyone,
i'm trying to collect some Network Statistiks from within my App and run into trouble doing this on the Galaxy S i9000.
Procedure is to get the output from "dumpsys batteryinfo" and parse the output
to collect lines like this:
"#1001:
Network: 415,78KB received, 700,21KB sent"
While this will work on mostly all other Android devices, same did not work on the Galaxy, because there are definitly no lines with these information. They are just missing.
Where are these kind of data collected on the Galaxys modified plattform ?
Are they collected in some other place ? If yes where can i find these historical logged informations?
Thanks for your help in advance !
there is an application to monitor wireless data usage in Android Market
i forgot the name, but it was mentioned a few times on the App section of this forum
Thanks, i know there are many apps in the Market, which are collecting data about wireles network traffic. But all of these apps just add up all the collected values .. regardless which app is causing the traffic. (Just because there is no official method for this delivered by the API.)
What i'm doing with my app, is to differenciate which app will use how much traffic ... this is done by the UID of the specific app causing traffic and the corresponding receive/sent values which i showed in my opening posting.
The #1001 is the UID of this app or process. With this you can easily determine the app/process name.
myvoss said:
Thanks, i know there are many apps in the Market, which are collecting data about wireles network traffic. But all of these apps just add up all the collected values .. regardless which app is causing the traffic. (Just because there is no official method for this delivered by the API.)
What i'm doing with my app, is to differenciate which app will use how much traffic ... this is done by the UID of the specific app causing traffic and the corresponding receive/sent values which i showed in my opening posting.
The #1001 is the UID of this app or process. With this you can easily determine the app/process name.
Click to expand...
Click to collapse
Oh myvoss.. That's just brilliant =) Have you been able to identity that the UID is always the same for a certain app? Ooooohhh I see a big project there
/me offers himself as a dev-betatester-debugger =)
cheers
Not really Phk,
until now i found no way to clearly identify these process UIDs by that way. The corresponding API-Methods just return "null" on these UIDs. Even parsing the packages.xml and compare the UID/sharedUID doesn't solve that.
But anyhow, i won't stop looking for an other way.
If you want to be able to limit a certain app to "X" mbytes per month (or something like that), you'll have to take another approach, kind of like a firewall implementation.
I don't know but i think you can do it either with iptables hooking your app to all traffic, or you could (in the worst scenario) have to replace a system linked library to implement a hook..
but these are just my brainstorms
Where is the connection between retriving network statistics and limiting certain apps to "X" megabytes ....
myvoss said:
Thanks, i know there are many apps in the Market, which are collecting data about wireles network traffic. But all of these apps just add up all the collected values .. regardless which app is causing the traffic. (Just because there is no official method for this delivered by the API.)
What i'm doing with my app, is to differenciate which app will use how much traffic ... this is done by the UID of the specific app causing traffic and the corresponding receive/sent values which i showed in my opening posting.
The #1001 is the UID of this app or process. With this you can easily determine the app/process name.
Click to expand...
Click to collapse
Just read yourself again, lol... Sorry if thought ahead.
You're right when you say all netcounters just add up values. Don't you think it would be great, for example, to limit market to 50% traffic and chat to 10% of monthly plafond?
Anyway i see that's not your point with your app... it would be great though.

[TASKER] Looking for some tasker profile ideas. Post your tasker profiles here!

So I just discovered the magical world of tasker, and am loving it! Totally worth the money, and one of the best apps to have (the best if you know how to maximise its use)! I have been experimenting a bit with it, so I don't have many profiles. I'm sure many folks here will be using tasker and would be having some great profiles, so I'm looking forward to hearing some suggestions! The profiles I use are:
1. WiFi off at night, from 00:45 to 08:00, except WhatsApp, Play Store, Quora
2. Airplane mode at night, from 00:30 to 07:00
3. Use of interactive CPU governor when using Real Racing 3, and revert to lionfish governor after exiting app(Kernel adiutor profiles do this for me). I also added a condition to use auto-rotate when playing the game, and revert to portrait orientation after closing the app.
4. Auto-sync every two hours, from 08:00 to 20:00 (I would like to improve this to auto-sync only Gmail, would welcome suggestions on how to do this from any tasker experts out here )
I would love to implement more profiles and automate my phone, so looking for ideas.
Need a tasker profile which can disable my mobile data only for some specific apps.it means If I start those apps then my mobile data would automatically disabled and when I close them Data service should be enbled.If u can help on this then That wud be very helpfull
Nothing very fancy for me - right now just have it turning on my wifi hotspot when it detects my car's bluetooth connection so my stereo can use the internet.
It sounds like you are taking it pretty far, @varunadi. You should check out https://www.reddit.com/r/tasker for more cool ideas.
koimr said:
Nothing very fancy for me - right now just have it turning on my wifi hotspot when it detects my car's bluetooth connection so my stereo can use the internet.
It sounds like you are taking it pretty far, @varunadi. You should check out https://www.reddit.com/r/tasker for more cool ideas.
Click to expand...
Click to collapse
Yep, I am looking to maximise the use of this app, so thanks for that link, will check it out!
anks095 said:
Need a tasker profile which can disable my mobile data only for some specific apps.it means If I start those apps then my mobile data would automatically disabled and when I close them Data service should be enbled.If u can help on this then That wud be very helpfull
Click to expand...
Click to collapse
I'm still finding my way around tasker, reading a lot of tutorials so once I figure it out I'll let you know.
anks095 said:
Need a tasker profile which can disable my mobile data only for some specific apps.it means If I start those apps then my mobile data would automatically disabled and when I close them Data service should be enbled.If u can help on this then That wud be very helpfull
Click to expand...
Click to collapse
I don't know if you can disable mobile data entirely (not just background which Android can do already) for just certain apps.
Perhaps it would be easier to use something like Netguard.
I've never used it but the description says "Applications can individually be allowed or denied access to your Wi-Fi and/or mobile connection."
koimr said:
I don't know if you can disable mobile data entirely (not just background which Android can do already) for just certain apps.
Perhaps it would be easier to use something like Netguard.
I've never used it but the description says "Applications can individually be allowed or denied access to your Wi-Fi and/or mobile connection."
Click to expand...
Click to collapse
Can't the secure settings plugin be used for that purpose? Toggle data on/off I mean.
varunadi said:
Can't the secure settings plugin be used for that purpose? Toggle data on/off I mean.
Click to expand...
Click to collapse
I was actually going to suggest that as I have it installed already but when I tried it didn't work.
The "Mobile data" toggle was unavailable because it claims I don't have root. However, I'm definitely rooted and there's no listing (saying denied or otherwise) in SuperSU for Secure Settings so it didn't even ask for root. I'm not too surprised as SS hasn't been updated in over a year and a lot of the Play Store comments mention mobile data toggle specifically not working either (among other things). Too bad as it was pretty powerful and of course I think I paid for it right after its last update.
Not getting SS working for me might just be my problem and perhaps someone else can get it going.
I was also going to suggest [APP][2.2+][ROOT] Toggle Data 5.0 (xda-exclusive free version) but then I read more about what @anks095 said which was "can disable my mobile data only for some specific apps" so I'm guessing he just wants certain apps restricted and not all (although the next sentence seems to say otherwise but I might be reading it incorrectly). I'm not too sure that can be done via Tasker/SS - my guess is that it's an "all-or-nothing" kinda thing for mobile data so the VPN thing might be the only way.
I use a similiar app called automagic but some of the things that I got my tasker like program to do are: lockscreen enable/disable through wi-fi at trusted places (don't like geofencing due to battery), when connected to the bluetooth of my car. Auto silent 5 min before a meeting, but if not connected to my smartwatch then vibrate. And lastly sms emergency location request where my family can send a keyword and my phone will automatically send location.
joeanca said:
I use a similiar app called automagic but some of the things that I got my tasker like program to do are: lockscreen enable/disable through wi-fi at trusted places (don't like geofencing due to battery), when connected to the bluetooth of my car. Auto silent 5 min before a meeting, but if not connected to my smartwatch then vibrate. And lastly sms emergency location request where my family can send a keyword and my phone will automatically send location.
Click to expand...
Click to collapse
How is the lockscreen one working for you? I find the built-in SmartLock to be really unreliable but when I tried to do lockscreen stuff before (last year) there was some bug in either Tasker or Secure Settings that would sometimes keep your screen black with just the nav buttons visible present. I'll have to re-try now.
That sms emergency request thing sounds cool! Can the recipient open the location in Maps to see exactly where you are?
Without issues I set it so that it clears the password. Makes it so that I have to swipe to unlock. As for the location, yes it sends coordinates and the user in the other end taps it to bring up Google maps.
Sent from my XT1563 using Tapatalk
joeanca said:
Without issues I set it so that it clears the password. Makes it so that I have to swipe to unlock. As for the location, yes it sends coordinates and the user in the other end taps it to bring up Google maps.
Sent from my XT1563 using Tapatalk
Click to expand...
Click to collapse
Thank you very much - clearing the password was the key! I had been trying before to disable the keyguard entirely so I wouldn't even have to swipe but that's where the problem/bug came in. Thinking about it that makes more sense to have at least a swipe because I'd end up calling people from my pocket by mistake. So thanks again!
Tasker...hmmm. Bought it, but much to complicated for me. Macrodroid is much easier to understand and can also do complicated automation with a normal user friendly interface. I tried to like Tasker, but the more and more I tried the more stupid I felt.

[Q] Tasker event trigger on SHARING?

Hello everyone,
I want an event to trigger such that whenever a text is shared from any app (context) by using the SHARE button , say Chrome browser or Opera mobile, a sound should PLAY (task). how do I achieve the event trigger?
Many thanks for helping.
The plugin AutoInput has a "UI Action" Event trigger, that you can configure to detect anything that is clicked on in the AI, then in the linked task you can check its "name" or "id" in the variable %aitext or %aiid,
However, to prevent the Event from triggering anytime you press anything all day long, you should add an "App" context to the Profile to constrain it to a list of particular apps (even if its 10 different ones etc) since you'll also need to figure out in those apps if the Share button(s) have a common/same name or ID, or if in the Task you're going to need to look for one of several values in those variables mentioned above.
Ratchet_Guy said:
The plugin AutoInput has a "UI Action" Event trigger, that you can configure to detect anything that is clicked on in the AI, then in the linked task you can check its "name" or "id" in the variable %aitext or %aiid,
However, to prevent the Event from triggering anytime you press anything all day long, you should add an "App" context to the Profile to constrain it to a list of particular apps (even if its 10 different ones etc) since you'll also need to figure out in those apps if the Share button(s) have a common/same name or ID, or if in the Task you're going to need to look for one of several values in those variables mentioned above.
Click to expand...
Click to collapse
Thank you for the reply.
I actuallly succeded doing the thing with Autoshare. [https://play.google.com/store/apps/details?id=com.joaomgcd.autoshare&hl=en]
1. Taker> Event> Plugin> Autoshare> Command=android.intent.action.SEND (rest all parameters default)
2. Taker> Task> Alert> Beep.
So, whenever I share any data, I automatically hear a beep!
Many thanks!

Tasker or another automate app working?

Hi,
I tried to find root cause, but unfortunately without success. Is there anybody, who using Tasker or another application for automatization of your phone without any issues?
My issue is, Tasker is still "delayed" - but same rules I used before on LG G3 (Android 6.0) - but now on P9 (DualSIM) didn't work.
I have task for Calendar Entry, where if I have appointment in my work calendar, during this time Sound mode is deactivated (only Vibrate).
Some suggestion? I tried white lists, etc. or another app with same bad behavior.
Thank you!
Well, I tried to deactivate power management app from Huawei over ADB and looks good now finally! Its workaround, but tasker now working very well as expected.
adb shell pm hide com.huawei.powergenie
Did you have "Run in Foreground" selected in Tasker's preferences?
My Tasker works fine with that selected, although I also have trusted the app in permissions manager, allowed it to auto launch & activated it as a device administrator in advanced settings/security.
Yeah, I tried every tip over Tasker or phone (EMUI settings) and only deactivate power management helps me.
I had the same problem with IFTTT. It worked perfectly with my LG G3, but was hopeless on the P9. No amount of white-listing or settings would work.
I even had the app in memory, with Google maps running, on GPS, screen on, and it still wouldn't trigger a location based profile.
I've had to revert to manually arming and dis-arming my home security system. Annoying.
I translate from spanish so I'm sorry if your phone shows menus with other name.
You must go to adjust > advanced adjusts > memory and store and at bottom of page "space clean". On new screen push on upper-right wheel, and now on last option "white list of memory clean". Finally look for your app and activate it.
If you don't include app here, clean system will close it on background and timers won't work. It solved my problems.
aidrabmol said:
I translate from spanish so I'm sorry if your phone shows menus with other name.
You must go to adjust > advanced adjusts > memory and store and at bottom of page "space clean". On new screen push on upper-right wheel, and now on last option "white list of memory clean". Finally look for your app and activate it.
If you don't include app here, clean system will close it on background and timers won't work. It solved my problems.
Click to expand...
Click to collapse
"Settings>Advanced settings>Memory & storage>Storage cleaner" and "Memory cleanup whitelist".
Using Agama, I can get an app to start following a reboot. However, I would like to start the App at every Startup. Does Automate or any other app let you do that?
carroamer said:
Using Agama, I can get an app to start following a reboot. However, I would like to start the App at every Startup. Does Automate or any other app let you do that?
Click to expand...
Click to collapse
Why would you need Tasker for that simple.
Settings, type in the Search Autostart and add your app to the list of apps to be started on every reboot.
You may also need to disable Battery Optimization for your app (to make sure it would still work in background when the phone sleeps with dark screen)
That should generally work for all Androids. I don't have Huawei P9 now for years, I remember that EMUI might have had specific Settings organization but there was also Autostart (or Auto start)...
zgfg said:
Why would you need Tasker for that simple.
Settings, type in the Search Autostart and add your app to the list of apps to be started on every reboot.
You may also need to disable Battery Optimization for your app (to make sure it would still work in background when the phone sleeps with dark screen)
That should generally work for all Androids. I don't have Huawei P9 now for years, I remember that EMUI might have had specific Settings organization but there was also Autostart (or Auto start)...
Click to expand...
Click to collapse
When I search 'Autostart' it produces 'No results'
carroamer said:
When I search 'Autostart' it produces 'No results'
Click to expand...
Click to collapse
I had P9 for three years (if you don't believe, you can find tons of my posts here back from 2017-2018)
Now, you have that phone, not me (I got rid of my last Huawei almost three years ago) - I cannot show you and I cannot look into the EMUI settings because I don't have the EMUI phone anymore
But I KNOW that there was a way in EMUI how to control which apps will be automatically started on boot - I know because I played with all that back in those years, II did need for many apps like AdAway, Find My Device and similar that required to be auto-started to operate correctly
Take your time and google and you'll find. Sorry, I tried to help you but I will no more waste my time on that. Huaweis are past time for me
And take your time, use your imagination, If not Autostart, google for EMUI startup manager or something similar to find the answer for your question on the Net

[HELP] Task stuck in a loop performing action on app open

Hey everybody and thanks for taking the time to read this.
I'll explain my problem as clearly as possible:
I created a task with the purpose of opening an app (vpn hosts) and clicking on a button (with autoinput) when I launch twitch or YouTube.
What I was trying to accomplish is that whenever I open said apps my vpn app opens up, activates and then I would like the phone to go back to the original app.
Here comes the problem: I get stuck in a loop cause whenever I go back from vpn hosts to twitch (using autoinput) tasker detects that a profile condition is met and runs again the task.
Is there a way I can force tasker to run those tasks one time and one only?
Hopefully I explained my problem clearly enough to be understood, thanks in advance
Set a cool down period in the profile settings. This will prevent the profile from running again for your specified period.
Less clean, you could also set a variable in the enter task and disable the profile if the variable is set.
Else, use a condition of "not" the vpn app as a trigger condition in the profile.

Categories

Resources