AppContext [0.4.7.2] - Better application context for Tasker with Xposed! [4.0.3+]

Search This thread

ninestarkoko

Senior Member
Nov 26, 2013
513
213
Thanks! Yes, in your automation app you'll need to use the Plugin event, or if it supports condition/state contexts, you can use those too.
AppContext does not run in the background like a Service. It is a BroadcastReceiver, which is indeed called when needed and communicates to the automation API. After that it is either killed or cached, that's up to the Android system.
Regarding your suggestion: I'm actually investigating if I can implement that.

Thanks for the explanation!
I use mostly triggers regarding app Activities so it would be very useful if you could add this kind of discrimination.

I give you some info about Automagic behaviour on this. Automagic uses two types of detection you can choose for activity recognition: "classic" which uses the accessibility service and "usage statistics" which is more experimental and works on Lollipop+ (the description says that).
 
  • Like
Reactions: JayShortway

JayShortway

Senior Member
Apr 3, 2017
95
89
I give you some info about Automagic behaviour on this. Automagic uses two types of detection you can choose for activity recognition: "classic" which uses the accessibility service and "usage statistics" which is more experimental and works on Lollipop+ (the description says that).
Thanks for the info, I'll be sure to check it out!
 
  • Like
Reactions: ninestarkoko

JayShortway

Senior Member
Apr 3, 2017
95
89
AppContext 0.4.3

Hi everyone,

I have just released AppContext 0.4.3! It is now available on Google Play, XDA Labs and the Xposed Module Repository.

In this version, I changed the way Services are hooked again. Toggling the experimental Services feature requires a reboot to take effect. I also moved the 'Ignore Recents' setting to Experimental. Moreover, app detection is improved for apps that quickly launch multiple Activities. I made yet another attempt at fixing the random crashes. I received 1 report saying the random crashes haven't yet occurred with this version, so I'm hopeful. But please keep reporting them if they happen, thanks! Lastly, I fixed some Xposed-related errors.

Please report any bugs in this thread, or by using the in-app Feedback button or sending an email to [email protected]. Thanks!

Enjoy!
 
  • Like
Reactions: Crsmsg and zzzhead

zzzhead

Senior Member
Dec 5, 2013
406
88
Noticed that in app ops, appcontext is triggered frequently for run in background. I tried to disable it and all seems to work fine still.
Is it okay to disable run I'm background?
 
  • Like
Reactions: JayShortway

JayShortway

Senior Member
Apr 3, 2017
95
89
Noticed that in app ops, appcontext is triggered frequently for run in background. I tried to disable it and all seems to work fine still.
Is it okay to disable run I'm background?
I have never used App Ops myself, so I don't know why specifically AppContext is listed as running frequently in the background, but what I expect is happening is this. AppContext is a BroadcastReceiver, so it only does something when needed (i.e. let Tasker know an app has started). Android will (as far as I know) typically keep a BroadcastReceiver in cache, so it can act quickly when needed. I guess that's why it is seen as running in the background. If it still works if you disable 'run in background', I suspect Android restarts the BroadcastReceiver each time it is needed, resulting in slightly slower response times. So as long as it works, feel free to disable 'run in background', but it might make responses a bit slower. Please note I am not sure about the above, it is just what I suspect is happening.
 

Artieza

Senior Member
Mar 17, 2016
456
173
I have never used App Ops myself, so I don't know why specifically AppContext is listed as running frequently in the background, but what I expect is happening is this. AppContext is a BroadcastReceiver, so it only does something when needed (i.e. let Tasker know an app has started). Android will (as far as I know) typically keep a BroadcastReceiver in cache, so it can act quickly when needed. I guess that's why it is seen as running in the background. If it still works if you disable 'run in background', I suspect Android restarts the BroadcastReceiver each time it is needed, resulting in slightly slower response times. So as long as it works, feel free to disable 'run in background', but it might make responses a bit slower. Please note I am not sure about the above, it is just what I suspect is happening.
Your app always in the background and holds ~13 mb. I don't like it. ? You don't need any broadcasts. You can hook everything and call static method into yourself directly.
 
  • Like
Reactions: JayShortway

JayShortway

Senior Member
Apr 3, 2017
95
89
Your app always in the background and holds ~13 mb. I don't like it. ? You don't need any broadcasts. You can hook everything and call static method into yourself directly.
Yes there is room for optimization, and your suggestion is a good one. The 'communication' between AppContext and other apps was one of the first problems I had to solve, meaning I didn't know much about Xposed/Android internals, and I went with broadcasts. Now that AppContext seems to be more stable (very few reported crashes in the Play Console since 0.4.3, please let me know if your experience is different), I can shift the focus somewhat to optimization.
 
  • Like
Reactions: Artieza

JayShortway

Senior Member
Apr 3, 2017
95
89
I'm not sure what you are trying to do. I guess it's in the background because of ACTIVITY_CHANGED intents. I don't know how you pass it to Tasker.
Yes those are the Intents needed to communicate from the Xposed module to the Tasker plugin, which then communicates with Tasker via a different Intent. I have a way in mind to reduce the number of Intents between the module and the plugin, but I don't think I can eliminate them.
 

JayShortway

Senior Member
Apr 3, 2017
95
89
AppContext 0.4.4

Hi everyone,

I have just released AppContext 0.4.4! It is now available on Google Play, XDA Labs and the Xposed Module Repository.

This is a minor update, because I have been in London for the past week which means I didn't have much development time. There were still some minor bugs reported via Google Play. This version fixes all those. Further, some inconsistencies/imperfections in the UI have been corrected, including an old overflow/menu button on pre-Lollipop devices. I have also started some work on optimizations. Lastly, this version targets Android 8.0 Oreo. There is of course no Xposed for Oreo, but it's best to be ready :D.

Please report any bugs in this thread, or by using the in-app Feedback button or sending an email to [email protected]. Thanks!

Enjoy!
 

JayShortway

Senior Member
Apr 3, 2017
95
89
AppContext 0.4.5

Hi everyone,

I have just released AppContext 0.4.5! It is now available on Google Play, XDA Labs and the Xposed Module Repository.

This is another minor update. Opening an existing Context now shows a Snackbar with 'Configure' button, allowing you to quickly adjust the configuration. I have made the Requirements-section a bit clearer and rewrote some of the Dialogs. Some minor optimizations are implemented, which are mainly foundations for further optimization later. Lastly, some minor bugs were fixed.

Please report any bugs in this thread, or by using the in-app Feedback button or sending an email to [email protected]. Thanks!

Enjoy!
 
  • Like
Reactions: Gggggas and Crsmsg

Gggggas

Senior Member
Dec 9, 2013
637
342
Hi everyone,

I have just released AppContext 0.4.5! It is now available on Google Play, XDA Labs and the Xposed Module Repository.

This is another minor update. Opening an existing Context now shows a Snackbar with 'Configure' button, allowing you to quickly adjust the configuration. I have made the Requirements-section a bit clearer and rewrote some of the Dialogs. Some minor optimizations are implemented, which are mainly foundations for further optimization later. Lastly, some minor bugs were fixed.

Please report any bugs in this thread, or by using the in-app Feedback button or sending an email to [email protected]. Thanks!

Enjoy!
Glad to see that this module is still active [emoji16] Great job Dev!

Sent from my SM-G935F using Tapatalk
 

JayShortway

Senior Member
Apr 3, 2017
95
89
Yet another 5-star review disappeared before I could reply. This keeps happening, and I'm beginning to suspect Google Play. Although I wouldn't know why they'd remove reviews.

In any way, I'd like to thank the person who wrote the review for the in-app purchase! Also to answer your questions: you don't need to change any setting in Tasker and you can indeed disable Tasker's accessibility service, but it shouldn't matter if it's enabled. However, you do need to create your application contexts with the AppContext plugin.

edit: So what happens is: I get a notification containing a new review, but when I tap to open it says the review can't be loaded and it might not exist anymore.
 
Last edited:

JayShortway

Senior Member
Apr 3, 2017
95
89
Okay so I just got another 5-star review. (Thanks a lot!) This time, I was able to type a reply, but when I clicked to publish an 'error occurred' and the review was gone. Can anyone who wrote a 5-star review confirm it is gone on their side as well? Would like to get to the bottom of this, understandably. Thanks in advance.
 

JayShortway

Senior Member
Apr 3, 2017
95
89
AppContext 0.4.6

Hi everyone,

I have just released AppContext 0.4.6! It is now available on Google Play, XDA Labs and the Xposed Module Repository.

This is yet another minor update. I made the Requirements more descriptive and merged the 2 Tasker requirements ('installed' and 'enabled'). Also, you can now collapse the Requirements-section. I fixed a few bugs in the Dialogs and did some internal code restructuring. Also, I migrated to the Play Billing Library. This was quite a task actually and involved a lot of rewriting. If there happen to be any problems regarding in-app purchases made not being recognized, please do let me know!

Please report any bugs in this thread, or by using the in-app Feedback button or sending an email to [email protected]. Thanks!

Enjoy!
 

Top Liked Posts

  • There are no posts matching your filters.
  • 16
    All 5-star Play Store reviews disappear right after they are posted for some reason.
    If you want to give a 5-star rating, please first give a 4-star rating and then update it to 5 stars.
    Thanks!​


    AppContext was featured on XDA Portal!

    banner_shortway_512.jpg

    Hi everyone!

    After years of reading, flashing, and gaining a lot of Android-knowledge on XDA-Developers, I felt it was time to create my own Xposed Module.
    So hereby I proudly present to you my first app:


    AppContext
    Better application context for Tasker with Xposed!
    Now available on Google Play, XDA Labs and the Xposed Module Repository.

    With AppContext, you can have Tasker react on running applications, without the downsides of the default implementation.

    The default application context of Tasker has several downsides:
    • it is inaccurate (in Android versions after KitKat)
    • it needs an accessibility service (which disables screen lock for enhanced data encryption, but this can be re-enabled)
    • it checks frequently which app is running
    Especially the last point is inconvenient, as frequent checks may drain battery and infrequent checks means Tasker is slow to react.

    AppContext solves these problems by utilizing the power of Xposed! It hooks directly into the Activity-class, letting Tasker react immediately when an app starts. This means no more periodic checking which app is running, so no more battery drain and no more slow reactions. It's also perfectly accurate and doesn't need an accessibility service, so your device's screen lock can be used for enhanced data protection again.
    (Experimental support for reacting on Services is also present.)

    AppContext may also work with other apps using the Locale API, such as Locale, Llama, Automate, Automagic and others. However, this is not tested extensively.

    To support development, AppContext contains non-intrusive ads. These can be removed with a small in-app purchase. (Note that if you donate through PayPal on XDA, ads are not removed. Nevertheless, it is still highly appreciated:))

    Please understand that AppContext is still considered to be in beta. There may be bugs. Please report them in this thread, or by using the in-app Feedback button or sending an email to [email protected].
    Constructive criticism is highly appreciated!

    DOWNLOAD
    Google Play
    XDA Labs
    Xposed Module Repository



    COMPATIBILITY
    • Android 4.0.3 and higher
    • Xposed Framework
    • Tasker (or equivalent)

    CREDITS
    • Crafty Apps EU/Pent for creating Tasker
    • rovo89 for creating the Xposed Framework
    • Google Play and the Google Play logo are trademarks of Google Inc.

    XDA:DevDB Information
    AppContext, Xposed for all devices (see above for details)

    Contributors
    JayShortway
    Xposed Package Name: io.shortway.appcontext

    Version Information
    Status: Beta
    Current Beta Version: 0.4.7.2
    Beta Release Date: 2018-07-09

    Created 2017-06-17
    Last Updated 2018-07-09
    6
    Changelog

    0.4.7.2 (Announcement)
    Please report any bugs in this thread, or by sending an email to [email protected].
    • [FEATURE] Added Chinese (Simplified) translation (thanks to @smailzhu).
    • [FIX] Some fixes to the Chinese (Traditional) translation (thanks to @smailzhu).
    • [FIX] Bug-fixes.


    0.4.7.1 (Announcement)
    Please report any bugs in this thread, or by sending an email to [email protected].
    • [FEATURE] Added Chinese (Traditional) translation (thanks to @smailzhu).
    • [FEATURE] Compiled for Android 8.1.0 (API 27).
    0.4.7 (Announcement)
    Please report any bugs by using the in-app Feedback button, or by sending an email to [email protected].
    • [FEATURE] The Requirements-section collapses automatically when all are met.
    • [FEATURE] Works with *official* Xposed for Nougat! Yay!
    • [FIX] A crash preventing AppContext to be launched is fixed.
    • [FIX] Minor bug fixes.
    0.4.6 - Yet another minor one (Announcement)
    Please report any bugs by using the in-app Feedback button, or by sending an email to [email protected].
    • [FEATURE] The Requirements are more descriptive.
    • [FEATURE] Merged the 2 Tasker requirements ('installed' and 'enabled').
    • [FEATURE] You can now collapse the Requirements-section.
    • [FIX] Some bugs in the Dialogs are fixed.
    • [FIX] Internal code restructuring.
    • [ALSO] Migrated to the Play Billing Library.
    0.4.5 - Another minor update (Announcement)
    Please report any bugs by using the in-app Feedback button, or by sending an email to [email protected].
    • [FEATURE] Opening an existing Context now shows a Snackbar with 'Configure' button.
    • [FEATURE] The Requirements-section is clearer.
    • [FEATURE] Minor optimizations. Mainly foundations to be implemented later.
    • [FIX] Rewrote some of the Dialogs.
    • [FIX] Minor bugfixes.
    0.4.4 - Minor update (Announcement)
    Please report any bugs by using the in-app Feedback button, or by sending an email to [email protected].
    • [FEATURE] Compiled for Android 8.0 Oreo. (No Xposed for Oreo, so ¯\_(ツ)_/¯.)
    • [FEATURE] Slight optimizations.
    • [FIX] All currently reported bugs fixed.
    • [FIX] Some UI tweaks.
    0.4.3 - Moar bugfixes (Announcement)
    Please report any bugs by using the in-app Feedback button, or by sending an email to [email protected].
    • [FEATURE] Changed hooking of Services again, to prevent some problems.
    • [FEATURE] Toggling the experimental Services feature now requires a reboot to take effect.
    • [FEATURE] Moved 'Ignore Recents' to experimental features.
    • [FEATURE] Improved app detection.
    • [FIX] Another attempt to fix random crashes.
    • [FIX] Fixed some Xposed-related errors.
    0.4.2 - Another bugfix release. (Announcement)
    Please report any bugs by using the in-app Feedback button, or by sending an email to [email protected].
    • [FEATURE] Completely different way of hooking Services...
    • [FEATURE] ...which removes the reboot requirement...
    • [FEATURE] ...and should work much better.
    • [FIX] Another attempt to fix random crashes. If they still occur, please keep reporting them. Thanks!
    • [FIX] Minor bug-fixes.
    • Tested on unofficial Xposed for Nougat.
    • Some code restructuring.
    0.4.1 - Bugfix release. (Announcement)
    Please report any bugs by using the in-app Feedback button, or by sending an email to [email protected].
    • [FIX] Sometimes not all apps were shown in the 'Pick apps' screen. Shouldn't happen anymore. (Thanks for testing @Infy_AsiX & @JKL22.)
    • [FIX] Some Xposed-related errors were fixed. (Thanks for testing @JKL22.)
    • [FIX] Hopefully fixed the random crashes. If not, please keep reporting them. Thanks!
    0.4 - Service support is here! (Experimentally, but still.) (Announcement)
    Please report any bugs by using the in-app Feedback button, or by sending an email to [email protected].
    • [FEATURE] Now supports Services for Event Contexts. Enable it under 'Experimental features'.
    • [FEATURE] Completely rewrote the 'Pick apps' screen.
    • [FEATURE] The Search bar is now a Search button.
    • [FIXED] Tasker blurbs are a bit clearer now.
    • [FIXED] The website-version of Tasker is properly recognized.
    • [FIXED] Some other minor bugs.
    0.3.2 - Another bugfix release. (Announcement)
    Please report any bugs in this thread, or by using the in-app Feedback button or sending an email to [email protected].
    • [FIXED] AppContext recognizes the Xposed Framework properly when installed (systemlessly) via Magisk.
    • [FIXED] The search bar was sometimes unresponsive. Not anymore.
    • [FIXED] The minimum Xposed Framework version required was downgraded to 86, as per request.
    • [FIXED] Some other minor bugs.
    0.3.1 - Bugfix release. (Announcement)
    Please report any bugs in this thread, or by using the in-app Feedback button or sending an email to [email protected].
    • [FIXED] If AppContext's module is enabled, it won't complain about not being able to find the Xposed Framework.
    • [FIXED] Pressing 'back' when picking apps to act on does not crash the app anymore.
    • [FIXED] The Tasker blurb in a State profile makes sense now.
    0.3 - Initial release.
    • Please report any bugs in this thread, or by using the in-app Feedback button or sending an email to [email protected].
    6
    AppContext 0.4.4

    Hi everyone,

    I have just released AppContext 0.4.4! It is now available on Google Play, XDA Labs and the Xposed Module Repository.

    This is a minor update, because I have been in London for the past week which means I didn't have much development time. There were still some minor bugs reported via Google Play. This version fixes all those. Further, some inconsistencies/imperfections in the UI have been corrected, including an old overflow/menu button on pre-Lollipop devices. I have also started some work on optimizations. Lastly, this version targets Android 8.0 Oreo. There is of course no Xposed for Oreo, but it's best to be ready :D.

    Please report any bugs in this thread, or by using the in-app Feedback button or sending an email to [email protected]. Thanks!

    Enjoy!
    6
    AppContext 0.4.7

    Hi everyone,

    I have just released AppContext 0.4.7! It is now available on Google Play, XDA Labs and the Xposed Module Repository.

    The Requirements-section now collapses automatically when all requirements are met. I also tested it with the official Xposed for Nougat and found no problems. Please let me know if it works for you as well. Furthermore, a crash preventing AppContext to be launched should be fixed now. Lastly, I fixed some minor bugs.

    I'd also like to thank rovo89 for the release of the official Xposed for Nougat. I'm very excited about this!

    Please report any bugs in this thread, or by using the in-app Feedback button or sending an email to [email protected]. Thanks!

    Enjoy!
    3
    • it needs an accessibility service, which prevents using screen lock to enhance data encryption

    FYI you can still use disk encryption password with accessibility services. when you enable the service it disables the 'require passcode on boot' but you can just re-enable from the security settings and it works

    great module by the way! thanks
Our Apps
Get our official app!
The best way to access XDA on your phone
Nav Gestures
Add swipe gestures to any Android
One Handed Mode
Eases uses one hand with your phone