You can use Files.DirInternal.
You cannot write a file to the applications file folder you see in the IDE.
If you setup the Emulator with an SD card, File.DirRootExternal works also with the Emulator.
- Run the AVD Manager
- Setup the Emulator
- In the Hardware part, click on 'New' (picture 1)
- You will see SD Card support, click on 'OK' (picture 2)
- That's it (picture 3).
Ok, i'll take a look on it. Why may this not work?
B4X:
Dim random As Int
random = Rnd(1,2)
RemoveViews
Activity.LoadLayout("newmonster")
If(mResult == "Dot") Then
Monster.Bitmap = LoadBitmap(File.DirAssets,"egg.gif")
MonsterType.Text = "1st SPECIAL Monster"
Else If(random == 1) Then
Monster.Bitmap = LoadBitmap(File.DirAssets,"bird.gif")
MonsterType.Text = "Some Bird"
Else If(random == 2) Then
Monster.Bitmap = LoadBitmap(File.DirAssets,"creature.gif")
MonsterType.Text = "You've got an CREATURE"
End If
Using the Files tab (at the right pane) you can add any file you want to your project. However you cannot write to this folder as it is a virtual folder.