Hi I wrote to play music when I run app at emulator and download a music a folder create successfully with downloaded music but when I install app at real phone sumsung Galexy a7 android 10 I see no folder with any music file at download directory. I please an expert or someone who knows the problem to help me, thanks in advance
B4X:
Sub lbl_play_Click
Dim r1,r2 As Boolean
rp.CheckAndRequest(rp.PERMISSION_WRITE_EXTERNAL_STORAGE)
Wait For activity_PermissionResult (permission As String, result As Boolean)
r1=result
rp.CheckAndRequest(rp.PERMISSION_READ_EXTERNAL_STORAGE)
Wait For activity_PermissionResult (permission As String, result As Boolean)
r2=result
If File.Exists(File.DirRootExternal&"/Download","barplayer") = False Then
File.MakeDir(File.DirRootExternal,"Download/barplayer")
End If
paath =File.DirRootExternal&"/Download/barplayer/"
Dim typee As String = Main.typee
If r1 = True And r2 = True Then
If typee = "music" Then
If File.Exists(paath,Main.namefordownload&".mp3") = True Then
'play
footer.SetVisibleAnimated(100,True)
mp.Load(paath,Main.namefordownload&".mp3")
mp.Play
lbl_play.Visible=False
'pause previous page music
t.Enabled=True
SeekBar1.Enabled=True
lblplay.Text = Chr(0xE034)
sc.Top = 56dip
sc.Height = Activity.Height -256dip
Else
Log("clicked")
pnl_download.SetVisibleAnimated(100,True)
'download
End If
Else
If File.Exists(paath,Main.namefordownload&".mp4") = True Then
Dim inten As Intent
Dim pm As PackageManager
inten=pm.GetApplicationIntent("com.mxtech.videoplayer.ad")
If inten.IsInitialized = True Then
codebox.MXPlayer(File.Combine(paath,Main.namefordownload&".mp4"))
Else
Dim Provider As FileProvider
Provider.Initialize
Dim FileName As String = Main.namefordownload & ".mp4"
File.Copy(paath, FileName, Provider.SharedFolder, FileName)
Dim vid As Intent
vid.Initialize(vid.ACTION_VIEW,"")
Provider.SetFileUriAsIntentData(vid, FileName)
vid.SetType("video/*")
StartActivity(vid)
End If
Else
pnl_download.SetVisibleAnimated(100,True)
End If
End If
End If
End Sub