Hi All!
I can sense device (SD card and USB stick) attaching and removing with example found here.
When I place cursor above the "ud", then I can see debug info. There appears two item:
mDescription and mFsUuid. They are the volume label and the volume ID what I need very much. (maybe there is a third: mPath -> path)
How can I get them?
thanks in advance
Steven
I can see, that these datas are in startingintent also, but the question remains: ho to get them?
Yes, maybe with javaobject, but If I try field name as mDescription of Description, then there is an error.
I can sense device (SD card and USB stick) attaching and removing with example found here.
B4X:
Sub Service_Start (StartingIntent As Intent)
If(StartingIntent.Action = "android.intent.action.MEDIA_MOUNTED") Or _
(StartingIntent.Action = "android.intent.action.MEDIA_REMOVED") Then
Dim JO As JavaObject = StartingIntent
Dim ud As UsbDevice = JO.RunMethod("getParcelableExtra",Array As Object("android.os.storage.extra.STORAGE_VOLUME"))
...
mDescription and mFsUuid. They are the volume label and the volume ID what I need very much. (maybe there is a third: mPath -> path)
How can I get them?
thanks in advance
Steven

I can see, that these datas are in startingintent also, but the question remains: ho to get them?
Yes, maybe with javaobject, but If I try field name as mDescription of Description, then there is an error.
B4X:
Dim JO1 As JavaObject = ud
Log(JO1.GetField("Description"))
Last edited: