Android Question File.DirAssets and File.DirInternal - SearchView


Active Member
Licensed User
what are the differences between these ?
how do I copy a file that is in dirinternal into dirassets ?

I am trying to implement the two searchviews.

my dat files (lang1.txt and lang2.txt) are in dirinternal.

Private Sub LoadIndices
    Dim ser As B4XSerializator
    ser.Tag = 1
    ser.ConvertBytesToObjectAsync( _
        Bit.InputStreamToBytes(File.OpenInput(File.DirAssets, "lang1.txt")), "ser")
End Sub

So, firstindex and secondindex returns NULL here and therefore the Searchview is not loading :

Sview.Initialize(Me, "Sview")
    Sview.AddToParent(SVPanel, 0, 300, SVPanel.Width, SVPanel.Height)
    If firstIndex <> Null Then Sview.LoadFirst(firstIndex)
    If secondIndex <> Null Then Sview.LoadSecond(secondIndex)

how do I move them into dirassets ?

or fix it ?

Thank you


Licensed User
how do I copy a file that is in dirinternal into dirassets ?
It is not possible, The Assets are readonly.

Put the file into the Filesfolder, compile your app (the file is in DirAssets) and copy it at runtime to dirinternal if you want
Upvote 0


Active Member
Licensed User
Thank you my savior.

so, if the files (lang1.txt and lang2.txt) are by default in the dirassets...

why does firstindex returns NULL ?

I work with an emulator and not with phone. does it matter?


  • tmp.jpg
    221 KB · Views: 157
Last edited:
Upvote 0