Full API support via Tasker (Pre-built Helper task)

(Likely requires elevated permissions for the “Run Shell” action. I use Shizuku running alongside Tasker.)

Tasker’s “Send intent” action only supports three extras. For many of the API calls, that’s enough.

But there are some important actions where we really need more extras to make use of the call. For example: when making a backup, we must include two mandatory extras–before we even choose any options! Surely there must be a better way…

That’s where this task comes in! Using this, Tasker can make full usage of every API function. (Be sure to look at the official API documentation for more info on the API itself.)

Benefits

  • include any number of extras
  • explicitly declares extra’s type
  • basic error handling
  • simplified set-up
  • supports all API functions
    • (as of Symfonium v15.1.0)
  • future-proof design

This is possible by using the “Run shell” action instead of the “Send intent” action. We are passing the information to Android’s ActivityManager, which then broadcasts the intent for us.


Disclaimer

I have not tested every API call. As long as I typed everything correctly, there shouldn’t be any issues.

If you do run into a problem, post about it IN THIS THREAD. Not in the Support channel! It’s a problem for me to fix. The app developer has nothing to do with it.

I simplified some of the inputs by assuming (perhaps incorrectly) that only the boolean keys you enter need to be set to “true”. Any boolean key that isn’t entered will be left unset (if it’s an optional key) or set to false (if it’s a mandatory key).

My “Custom Intent Builder” can still cover any cases where you actually need to set a Boolean to false. (Or any other case. It can do it all.)


Download

v1.0 release

Use this TaskerNET link

What a cute, little task. It’s only… 250 actions!? Nani?! :rofl:




All of the following info is included in the task as well, for easier reference.

HOW TO USE:

This is a Helper task. It does nothing if run directly.

  1. Create your own SEPARATE task. (Or use one of your existing ones.)
  2. Add the Perform task action
  3. In the Name field, enter Symfonium API Handler
  4. In the Parameter 1 field, enter the action you want to perform (e.g. backup)
  5. In the Parameter 2 field, enter any extras needed, separated by triple-backslashes (e.g. myPassword123\\\SETTINGS\\\PROVIDERS )
  6. Run that separate task as needed.

Function Mapping

Enter the following values to perform the specified action

Expand

%par1 → Function called

cast → Change renderer
sync → Force sync
player → Playback controls
start → Media start
setting → Setting change
playlistImport → Playlist Import
playlistThumb → Regenerate playlist thumbnail
randomize → Update playlist stable random sort
loadQueue → Load a media queue
genreThumb → Regenerate genre thumbnail
cleanOffline → Cleanup offline cache
backup → Start backup
activeConnect → Change provider active connection
artistThumb → Regenerate artist thumbnail
loadAS → Load application style
loadProfile → Load profile
CUSTOM → Custom Intent Builder

%par2 - Important notes

Expand
  1. For backups, you must list USER_DATA before its nested options
  • The nested options are:
    • USER_DATA_ALL
    • CUSTOM_IMAGES
  1. For mandatory options, you don’t need to specify the key
  2. For boolean keys, you don’t need to specify a value.
  • Any boolean listed will be set to true
  • Any boolean key that isn’t listed will be:
    • left unset (if key is optional)
    • set to false (if key is mandatory).



Example Usage

Expand

Example 1

Goal: Load a media queue

%par1 == loadQueue
%par2 == 69

Result:

  • action is auto-filled as app.symfonium.api.CUSTOM_ACTION
  • 69 is added as a Long value to key LONG_PARAMETER
  • RESUME is set to false

Example 2

Goal: Load a media queue (with Resume enabled)

%par1 == loadQueue
%par2 == 69\\\RESUME

Result: RESUME is now set to true

Example 3

Goal: Backup of Settings, User Data, and All Media Entries

%par1 == backup
%par2 == 123\\\SETTINGS\\\USER_DATA\\\USER_DATA_ALL

Result:

  • action is auto-filled as app.symfonium.api.CUSTOM_ACTION
  • password is set to 123
  • SETTINGS is set to true
    • it will be included in the backup
  • USER_DATA is set to true
    • it will be included in the backup
  • USER_DATA_ALL is set to true
    • it will be included in the backup



Bonus Features

Preset backup options

Expand

Instead of listing all of the options individually, you can use the following shortcut values:

%par1 == backup
%par2 == password\\FULL

Result: backup will include all of the default main options. (Settings, Providers, EQ, Playlists, Internet Radios, Auto Offline Rules, & Favorite Files)


And you can still add the remaining options!

%par1 == backup
%par2 == password\\FULL\\USER_DATA

Result: All of the above + User Data


Or use this preset to include everything in your backup. (Reminder: Smart Filters backup is not yet supported by the API)

%par1 == backup
%par2 == password\\COMPLETE

Result: backup will include ALL options. (Beware of battery drain & large file sizes.)

Custom Intent Builder

Expand

This lets you build an intent more freely. This should support almost any API option added in the future!

To use:

  1. Set %par1 to CUSTOM
  2. Set the first extra in %par2 to the “ACTION” line, as written in the Docs site
  3. Set any additional extras in sets of three–representing the Type, Key, and Value

Types supported (case-sensitive):

  • String
  • Int
  • Long
  • Float
  • Boolean
  • URI

Example:

Goal: send intent for “Playback Control - Seek Relative - 10 seconds”

  1. Check official Docs here to find the relevant options.

%par1 ==
app.symfonium.api.MEDIA_COMMAND

%par2 ==
String\\\COMMAND\\\seek_relative\\\Int\\\INT_PARAMETER\\\10

(Using default value separator: triple-backslashes \\\ )

Explanation:

%par2 contains six values, separated by triple-backslashes. Since these extras must be in sets of three, this corresponds to two extras:

  • Extra 1
    • Type: String
    • Key: COMMAND
    • Value: seek_relativr
  • Extra 2
    • Type: Int
    • Key: INT_PARAMETER
    • Value: 10

Reserved

(20 characters)

@telrod11 I changed the Download section to a TaskerNET link. (I didn’t know that existed. Definitely much nicer than copying the whole text.)

Please keep any further discussion of the task to this thread. Thanks!

It worked just as it should.

Change your example to a password of ABC, as it won’t work with integers (e.g 123)

Thanks.

It will work with a password of 123. That’s explicitly why I chose that example.

This task handles all the types for you. So 123 is sent as a String, because that is what the Password uses.

Unlike the “Send intent” action where you have to hope it sends the correct type or try to trick it with “123s” or something.

Ok, I have no idea on this then.

I can tell you, it works with ABC, but fails with 123 on my tests.

Thanks, I do appreciate all the work on this

Can I ask exactly what you entered for par1 & par2 when it failed?