Android Question TileService

Multiverse app

Active Member
Licensed User
Longtime User
A TileService provides the user a tile that can be added to Quick Settings. Quick Settings is a space provided that allows the user to change settings and take quick actions without leaving the context of their current app
: https://developer.android.com/reference/android/service/quicksettings/TileService.html

So, this is what i put in my manifest:
B4X:
AddApplicationText(
<service android:name="anywheresoftware.b4a.objects.MyQSTileService"
    android:label="MyQSTileService"
    android:icon="@drawable/mic"
          android:permission="android.permission.BIND_QUICK_SETTINGS_TILE">
     <intent-filter>
         <action android:name="android.service.quicksettings.action.QS_TILE" />
     </intent-filter>
</service>)

(I have a service named MyQSTileService)
The tile is successfully created in the notification bar, but it gives up this error when pressed:

java.lang.RuntimeException: Unable to instantiate service anywheresoftware.b4a.objects.MyQSTileService: java.lang.ClassNotFoundException: Didn't find class "anywheresoftware.b4a.objects.MyQSTileService" on path: DexPathList[[zip file "/data/app/b4a.example-1/base.apk"],nativeLibraryDirectories=[/data/app/b4a.example-1/lib/arm64, /system/lib64, /vendor/lib64]]
at android.app.ActivityThread.handleCreateService(ActivityThread.java:3502)
at android.app.ActivityThread.-wrap6(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1732)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6776)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1520)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1410)
Caused by: java.lang.ClassNotFoundException: Didn't find class "anywheresoftware.b4a.objects.MyQSTileService" on path: DexPathList[[zip file "/data/app/b4a.example-1/base.apk"],nativeLibraryDirectories=[/data/app/b4a.example-1/lib/arm64, /system/lib64, /vendor/lib64]]
at dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:56)
at java.lang.ClassLoader.loadClass(ClassLoader.java:380)
at java.lang.ClassLoader.loadClass(ClassLoader.java:312)
at android.app.ActivityThread.handleCreateService(ActivityThread.java:3499)
... 8 more


Any solutions?
 

DonManfred

Expert
Licensed User
Longtime User
anywheresoftware.b4a.objects
i guess here you need to define your packagename here. But i´m not able to help as i dont know how to format such a setting.
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Check the libs @Johan Schoeman released... Check the ones with source.
I´m positive that there is a lib which uses a service. You can check the manifest in this projects and you need to do a similar "link" to your service in te manifest..
Maybe you can find the right syntax.
 
Upvote 0

Greg Breinholt

Member
Licensed User
Longtime User
Nope, get the same error.
Did you solve this?
I had something similar, until I used the service name in the manifest in lower-case.

Example:
B4X:
AddApplicationText(
<service android:name="myqstileservice"
    android:label="MyQSTileService"
    android:icon="@drawable/mic"
          android:permission="android.permission.BIND_QUICK_SETTINGS_TILE">
     <intent-filter>
         <action android:name="android.service.quicksettings.action.QS_TILE" />
     </intent-filter>
</service>)
 
Upvote 0
Top