Trigger Plugin

Post your questions and help other users.

Moderator: Martin

Post Reply
Bahevi
Posts: 3
Joined: 10 Jun 2014 17:37

Trigger Plugin

Post by Bahevi » 10 Jun 2014 17:48

Hello!

I'm trying to create a Trigger Plugin, Automagic detects my app, but the trigger is not fired.
I checked Tasker and Locale Guides and if i understood them right, this is what i have to call:

Intent intent = new Intent();
intent.setAction("com.twofortyfouram.locale.intent.action.REQUEST_QUERY");
intent.putExtra(com.twofortyfouram.locale.Intent.EXTRA_ACTIVITY,TriggerActivity.class.getName());
sendBroadcast(intent);

but the trigger isn't fired in the app...
Any idea what i'm doing wrong?

Greetings

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Trigger Plugin

Post by Martin » 10 Jun 2014 18:02

Hi,

Locale has an example of a condition plugin in their developer documentation:
http://www.twofortyfouram.com/developer

I recommend to use the Locale Display Condition available in the download section as a starting point and then modify this example to suit your needs.

Do you want to use your plugin purely in a trigger or also in a condition?

Regards,
Martin

Bahevi
Posts: 3
Joined: 10 Jun 2014 17:37

Re: Trigger Plugin

Post by Bahevi » 10 Jun 2014 18:20

I want to use it purely as a trigger.
I used the Locale Display Condition and modified it as said in the Tasker plugin guide, but that didn't work.
Don't get me wrong, the app is detected, but the trigger doesn't fire...

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Trigger Plugin

Post by Martin » 11 Jun 2014 15:45

Do you receive the broadcast with action com.twofortyfouram.locale.intent.action.QUERY_CONDITION from Automagic after you have sent the REQUEST_QUERY intent? Is your broadcast receiver for the com.twofortyfouram.locale.intent.action.QUERY_CONDITION properly registered in the AndroidManifest.xml?

Is there anything in the log when you enable Debug log in the preferences of Automagic and make the plugin check its state?

If you like, you can send the plugin apk to info@automagic4android.com, so I can check what events Automagic receives and if there's anything missing in your plugins manifest.

Bahevi
Posts: 3
Joined: 10 Jun 2014 17:37

Re: Trigger Plugin

Post by Bahevi » 16 Jun 2014 09:41

Debug log is enabled.

06-16 11:35:02.521: D/AM_ActionManagerService(3705): Received intent Intent { act=com.twofortyfouram.locale.intent.action.REQUEST_QUERY flg=0x10 (has extras) } extras: com.twofortyfouram.locale.intent.extra.ACTIVITY=com.triggertest.shaketrigger.ui.TriggerActivity
06-16 11:35:02.541: D/AM_ActionManagerService(3705): Received intent finished

I know a shake-trigger already exists, just wrote my own for testing the plugin feature.
In my project there is a Service listening to sensors and then sending the intent and the Activity for the UI.

User avatar
Martin
Posts: 4468
Joined: 09 Nov 2012 14:23

Re: Trigger Plugin

Post by Martin » 16 Jun 2014 15:32

I don't see anything in the log that indicates that Automagic checked the condition using com.twofortyfouram.locale.intent.action.QUERY_CONDITION, so the broadcast receiver might not declared in the manifest of your plugin.
Could you please send the APK to info@automagic4android.com, so I can check what's missing.

Post Reply