Tasks 4.0/4.1
ββββ ββββ ββββ ββββ ββββ ββββ ββββ ββββ ββββ ββββ βββββββ ββ Background works simplified
In this version, the complete source code is rewritten to make it better with significantly large improvements. This version lacks some features which were in the previous versions until it gets stable enough. There are a few highlights, which are mentioned below.
Highlights
-
Ability to access appβs procedures.
-
Improved scheduling of tasks and components creation.
-
Application auto-open (experimental).
-
Ability to load templates files into memory.
-
Force restart services option.
-
Enabling task service timeouts.
Docs
Explanation of all the available blocks in the extension.
Creates a component from the name given.
component
is the component source package and the name, or a simple name e.g βButtonβ which refers to the button component.
name
is the unique Id for the component.
Creates a function that can be later. When a function is called, the block will be invoked with the arguments provided on the UI thread.
When itβs called, if the return value exists, itβll be saved to variables.
id
is the unique Id for the function.
component
is the id of a component that was created to call on.
block
is the name of the block or method.
values
are the arguments for the block or method call.
Accessing args
You should use {$<arg_number>}
to choose an arg that will be in that value. Incase the argument is a non-string object, and you just use the argument, it will be treated as it was.
Calls the function by its Id.
id
is the Id of the function that was created
Listens to an event on the component.
name
is the event name.
component
is the component Id to listen on
then
needs a function Id that will be called when an event raises.
experimental
Loads the template from an asset file into memory that can be reused.
future deprecation
A type of block that is used when an event is raised.
id
is the unique Id for the extra function.
codes
are the list of java sentences that will be interpreted.
Configures the foreground notification.
The Id of the notification is 1, so if you want a custom notification then you can just use any notification component with the Id to change that.
A default set of values will be assigned if not called.
title
is the title of the notification.
content
is the title text.
subtitle
is the subtitle text
icon
is an icon name for the notification. Go to android docs and pick a small icon name starting with βic_β e.g " ic_dialog_alert".
Creates a variable that can be later accessed later using special texts like {$my_var}
.
name
is the name of the variable.
value
is an object that is the value.
Begins the background service.
id
is the unique number of the service.
latency
is the delay before the service starts.
requiredNetwork
type of network required for the service to run. any
, none
, cellular
, roaming
and unmetered
are the posible values.
foreground
if its a foreground type service.
Cancels the service from the Id.
id
is the Id number of the service.
Checks if the service is running from the Id.
id
is the Id number of the service.
Returns the list of running and pending service Ids.
Sets the mode the service will begin, if set to true, extension will use alarm manager which is good at schudling exact jobs.
Check it to true if you want to the app to restart the service once its stopped.
If set to βHIGHβ, the extension will aggresively restart the service manually. βHIGHβ and βDEFAULTβ are the two posible values.
The max time in millies the service can run, once the time is reached at a point, it will be killed.
Name of procedures that can be called from background.
Extension
Thanks to all the contributors and beta testers.
Extension was created with Rush by @Shreyash.
β> Note: You need to be atleast intermediate in Koding to use this extension.
Download
xyz.kumaraswamy.tasks.aix (464.7 KB)
Known issues
- Foreground service doesnβt initialize for Android 7 and below [Moderate]
- Things such as API keys can be exposed in ADB Logs [Critical, fix needed]
- Crashes on devices Android 5 and 6 devices. [Moderate]
Thanks,
Kumaraswamy