Do I have to set some special kind of permission for the app when exporting it, for it to be able to start at boot?
<uses-permission android:name="android.permission.DISABLE_KEYGUARD" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
Should there be something else in there for it to run?
The intent receiver is specified as such, here boot is mentioned at least:
<intent-filter>
<action android:name="net.dinglisch.android.tasker.WILLYUM" />
<action android:name="net.dinglisch.android.tasker.AWAKEY" />
<action android:name="android.intent.action.BOOT_COMPLETED" />
</intent-filter>
Profile: Minfree At Boot (72)
Notification: no
Event: Device Boot
Enter: Minfree (14)
A1: If [ %LaunchCount ! Set ]
A2: Create Directory [ Dir:Minfree Create All:Off Use Root:Off Continue Task After Error:On ]
A3: Variable Set [ Name:%LaunchCount To:1 Do Maths:Off Append:Off ]
A4: End If
A5: If [ %UPS > 200 ]
A6: Show Scene [ Name:Minfree Splash Display As:Dialog, Dim Behind Horizontal Position:100 Vertical Position:100 Animation:System Show Exit Button:Off Continue Task Immediately:On ]
A7: Else
A8: Notify [ Title:Minfree Run Text:Minfree run at boot Icon:null Number:0 Permanent:Off Priority:3 ]
A9: End If
A10: Variable Clear [ Name:%MemFileExist1 Pattern Matching:Off ]
A11: List Files [ Dir:Minfree Match:minfree.pref Include Hidden Files:Off Variable:%MemFileExist Continue Task After Error:On ]
A12: If [ %UPS > 200 ]
A13: Create Scene [ Name:Memory Killer Continue Task After Error:On ]
A14: End If
A15: If [ %MemFileExist1 Is Set ]
A16: Element Visibility [ Scene Name:Memory Killer Element Match:Image1 Set:True Animation Time (MS):0 ]
A17: If [ %UPS > 200 ]
A21: Else
A22: Read File [ File:Minfree/minfree.pref To Var:%Temp ]
A26: End If
A27: Else
A28: Element Visibility [ Scene Name:Memory Killer Element Match:Image1 Set:False Animation Time (MS):0 ]
A32: End If
A36: If [ %UPS > 200 ]
A37: Hide Scene [ Name:Minfree Splash Animation:System ]
A38: Show Scene [ Name:Memory Killer Display As:Dialog, Dim Behind Horizontal Position:100 Vertical Position:100 Animation:System Show Exit Button:Off Continue Task Immediately:Off ]
A39: Disable
A40: Return [ Value:0 Stop:On ]
A41: Else
A42: Notify [ Title:Minfree Run Text:Minfree run and almost finished at boot Icon:null Number:0 Permanent:Off Priority:3 ]
<Set minfree>
A44: Notify [ Title:Minfree Run Text:Minfree run and finished at boot Icon:null Number:0 Permanent:Off Priority:3 ]
A45: Disable
A46: Return [ Value:0 Stop:On ]
A47: End If
I also changed the boot task in the app I'm making to do just the same, disabled the launch of the main task in the boot task, so it now only is supposed to show a notification (and after that to set a variable). But it doesn't work. Could it be something with multiple tasks in the APK?
Ok, I now created a new task in a new project, which only displays a notification, and it works.I also changed the boot task in the app I'm making to do just the same, disabled the launch of the main task in the boot task, so it now only is supposed to show a notification (and after that to set a variable). But it doesn't work. Could it be something with multiple tasks in the APK?
It looks like this, there is a task triggered at boot that sets a variable that it was launched at boot, which then launches the main task.
Profile: Minfree At Boot (72)
Event: Device Boot
Enter: Minfree Boot (67)
A1: Variable Set [ Name:%RunOnBoot To:1 Do Maths:Off Append:Off ]
A2: Notify [ Title:Testing Text:Minfree Boot task entered Icon:null Number:0 Permanent:Off Priority:3 ] (This shows up at boot in Tasker, but not in the exported app)
A3: Perform Task [ Name:Minfree Stop:On Priority:5 Parameter 1 (%par1): Parameter 2 (%par2): Return Value Variable: ]
Minfree (14)
Abort Existing Task
A1: If [ %LaunchCount ! Set ]
A2: Create Directory [ Dir:Minfree Create All:Off Use Root:Off Continue Task After Error:On ]
A3: Variable Set [ Name:%LaunchCount To:1 Do Maths:Off Append:Off ]
A4: End If
A5: If [ %RunOnBoot ~ 1 ]
A17: Notify [ Title:Minfree Run And Finished Text:Minfree run and finished at boot Icon:null Number:0 Permanent:Off Priority:3 ]
A18: Return [ Value:0 Stop:On ]
A19: End If
(Irrelevant parts here)
A44: Return [ Value:0 Stop:On ]
This works fine when in Tasker, all notifications show up, and all rows are executed as they should.
But when exporting the same project as an app, nothing happens at boot. Are any settings wrong? The app is registered for device boot, so the notification in the entry tasks should show up at least.
For some reason Tasker didn't let me export the profile description, but I'll paste the tasks anyway:
TestBoot (82)
A1: Flash [ Text:Test at boot Long:Off ]
A2: Notify [ Title:Test Text:Test vid boot Icon:null Number:0 Permanent:Off Priority:3 ]
A3: Perform Task [ Name:Extra Task Stop:On Priority:5 Parameter 1 (%par1): Parameter 2 (%par2): Return Value Variable: ]
Extra Task (87)
A1: Flash [ Text:Extra Task, doesn't do anything Long:Off ]
I'm on a note 2, recently upgraded to 4.3 by flashing Omega ROM 21. Previously I was on Omega ROM 18 with Android 4.1.2, both very stable roms.
It has been exactly the same problem irrespective of Android versions.