Android Question NB6 File Provider

Apip Bayok

Member
Hi,

I have some issues with NB6 Custom Sound,
I use File Provider class module that is required for some features with this code below in the manifest editor
Code:
CreateResource(xml, provider_paths,   
   <files-path name="name" path="shared" />   
)

but NB6 Custom Sound example source code is a little bit different
Code:
CreateResource(xml, provider_paths,   
   <external-files-path name="name" path="shared" />
)

when I use <files-path name="name" path="shared" /> NB6 custom sound did not play the sound, otherwise
if I use <external-files-path name="name" path="shared" /> it's ringing but my other function not work.
I put it together the result is sound ringing but another function is failed and my app is force close.

I attach the project sample.
Help, please.
 

Attachments

You should change the folder to:
Code:
Private Sub createNotif_Click
    Dim n As NB6
    Dim folder As String = Provider.SharedFolder '<====
    Dim FileName As String = "sms.mp3"    
    File.Copy(File.DirAssets, FileName, folder, FileName)
    n.Initialize("custom sound2", Application.LabelName, "HIGH").SmallIcon(smiley)
    n.SetDefaults(False, True, True)
    Try
        n.CustomSound(Provider.GetFileUri("sms.mp3"))
    Catch
        Log(LastException)
    End Try
    Dim notification As Notification = n.Build("Testing", "Custom With Sound", "Waiting", Main)
    notification.Notify(2)
End Sub
Note that I've also changed the channel id as the OS doesn't allow changes after a channel was used (unless you uninstall the app first).
 
Upvote 0

Similar Threads

  • Question Question
Android Question NB6 + Target SDK 33
Replies
6
Views
6K
Replies
1
Views
4K
Replies
11
Views
16K
  • Question Question
Android Question NB6 example-problem
Replies
1
Views
4K
Back
Top