How to ask for a permission in my new extension? "android.permission.FOREGROUND_SERVICE"

How to ask for a permission “android.permission.FOREGROUND_SERVICE” in extension making process of kodular?

I am new to extension development, please help me with an example …

I guess it is not different from other permissions.

1 Like

If it is not different from other permission then
You have to use @UsesPermissions annotation. For example;
@UsesPermissions(permissionNames = "android.permission.INTERNET, android.permission.CAMERA")

Also, you can look over to AppInventor open source.
GitHub - mit-cml/appinventor-sources: MIT App Inventor Public Open Source

Thanks for you help,
I am using rush to create extension and following error showing,

│ ERR src\com\speaker.java:12: error: cannot find symbol
│ import com.google.appinventor.components.annotations.UsesPermissions;
│ ^
│ symbol: class UsesPermissions
│ location: package com.google.appinventor.components.annotations

│ ERR src\com\speaker.java:17: error: cannot find symbol
@UsesPermissions(permissionNames = “android.permission.MODIFY_AUDIO_SETTINGS”)
│ ^
│ symbol: class UsesPermissions
│ warning: The following options were not recognized by any processor: ‘[output, org, root, version, extName]’

│ Total error(s): 2
└ Failed

I haven’t use rush .
But this might help you,

I don’t know this

Thanks a lot

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.