Go to "modify system settings" of our app with one click

For android 6 and above, if you want to perform some actions, for example set sound as ringtone, it’s not possible until user manually grants write permission for an app.
The problem is, this option is very hard to find for non-experienced android user. Accessing this option from application level is a must if it (app) needs such permission.

Original threads:

Makeroid forum -->


Thunkable forum -->

Few days ago found a solution for this problem.
Performed tests:
Android 4 - emulator - not working / there is no such setting. All apps have write permissions already granted.
Android 5 - emulator - the same as above
Android 6 - physical device (LG G4) - OK
Android 6 - emulator - OK
Android 7 - emulator - OK
Android 8 - emulator - OK

SOLUTION
Just use these blocks -->

Activity Class is “com.android.settings.Settings$AppWriteSettingsActivity”
Set Data Uri with package name of your application (“package name” property of Screen 1 - in designer mode).
This won’t work with companion, app must be compiled to apk.

In this example, slider on “modify system settings” screen will be inactive. Because this application doesn’t ask for write permission.

AIA file and compiled APK -->
writepermissionsolution.aia (1,9 KB)
systemsettingstest.apk (4,1 MB)

10 Likes

Nice, thanks!

2 Likes

We have too a block for that in screen properties

3 Likes

Mika, you mean call Screen1.Open App Settings?
It works differently.

1 Like

Yeah.
Then we can add maybe the correct block for that

1 Like

New block would be nice, but I think even better would be extending block “when Screen1.Error Occured” to handle such situations easily.
Already made a topic on that -->

Regards,
BeeriaApps

1 Like

Is it possible to implement this?

If the app targets API level 23 or higher, the app user must explicitly grant this permission to the app through a permission management screen. The app requests the user’s approval by sending an intent with action Settings.ACTION_MANAGE_WRITE_SETTINGS. The app can check whether it has this authorization by calling Settings.System.canWrite().

Activity Action android.settings.action.MANAGE_WRITE_SETTINGS
Activity Data Uri package:com.baasapps.ringtone -> package:your.Package.Name

I found something but without coding experience I’m lost.
https://code.i-harness.com/en/q/1e98dd2

/Boban

4 Likes

First block returns true or false.
The second block opens the write settings page of the app.

blocks

9 Likes

W0OW @Mika that was quick implementation… :heart_eyes:

/Boban

3 Likes

The next update should be in the next days.
Bug fix release but the new blocks will be there too for that.

3 Likes

Thanks Mika for new blocks.
Just please assure that block “call Screen1.Are System Write settings Granted” always returns true if API level < 23.

Regards,
BeeriaApps

3 Likes

checked new blocks.

  1. call Screen1.Are System Write Settings Granted
    Android 4 & 5 - always returns true - OK,
    Android 6, 7, 8 - true if granted, false if not granted - OK

  2. call Screen1.Open System Write Settings
    Android 4 & 5 - function “does nothing”, I mean no go to settings screen and no error message - OK
    Android 6, 7, 8 - opens system write settings screen - OK

All works as expected, good job!

Attached aia if someone wants to test (after compiling to apk) -->
checkwritesettings.aia (45,8 KB)

5 Likes

Glad to see high responses and a solution at last.:grin:

2 Likes

hi Mika
I using thunkable classic, i can not found block
blocks
please let me how can i find them
thank you

You will not find these blocks in :thunkable: since this blocks only exist in :kodular:

/Boban

7 Likes

WHAT IS write_external_storage and system write setting?

https://developer.android.com/reference/android/Manifest.permission#WRITE_EXTERNAL_STORAGE

https://developer.android.com/reference/android/Manifest.permission.html#WRITE_SETTINGS

Hi
Is it possible to invoke display over other apps setting dialogue when application runs for the first time?

Like this?

But explain the purpose of this. How will you use this?

Yes, and I was able to find the way. Here is the way to invoke the settings.

  • Activity Starter Action --> android.intent.Settings.ACTION_MANAGE_OVERLAY_PERMISSION
  • Activity Starter Data URI --> Name of your package (like com.kodular.appname), you can get this automatically using TaifunTools extension

Purpose: When application is minimized, it will allow me to keep rendering a floating button or anything from your app you want, once this setting is enabled.

3 Likes