Android Question How to read and write external storage through RandomAccessFile

bagazhou

Member
Licensed User
Longtime User
HI

i want to use read and write external storage through RandomAccessFile , but hava error , What are the good solutions?

B4X:
    Dim FileName As String
   Dim Dir As String
   ' this path is for test
   Dir = "/storage/7764832/test"
   FileName = "v.mp4"
   
   Dim buffer1(256) As Byte
   
   Dim raf As RandomAccessFile
   ' error for this line
   raf.Initialize(Dir, FileName, False)
   raf.ReadBytes(buffer1, 0, buffer1.length,0)
   
   raf.Close

B4X:
this is error
java.io.FileNotFoundException: /storage/7764832/test/v.mp4: open failed: EACCES (Permission denied)
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…