Hi all. My first time here - just starting with B4X and am very excited with it. Great work!
I've been struggling with this problem for two full days and cannot find a satisfactory answer. Maybe I'm not asking the right questions?
- My B4A version is 9.80.
- My Phone is Android 9 pie. I've inserted/changed the lines
#CanInstallToExternalStorage: True
#DebuggerForceStandardAssets: true
- and also in the Manifest Editor, I added the targetSdkVersion: <uses-sdk android:minSdkVersion="4" android:targetSdkVersion="28" />
The code shown here under is the start of the example called "Layers". (Horse running across a mountainous background). Files horse00.png , horse01.png ... etc. are all in File Manager under "#Default Group".
When ran with IDE set to Debug, it runs fine, but when I Release the app, it says "FileNotFoundError". See hi-lighted lines. When I examen the Files.DirAssets folder, it contains two entries called "images" and "webkit". Trying to open them as a folder (File.DirAssets/images) , I get "not a folder" error.
Please can somebody help?
Regards to all.
Theuns
I've been struggling with this problem for two full days and cannot find a satisfactory answer. Maybe I'm not asking the right questions?
- My B4A version is 9.80.
- My Phone is Android 9 pie. I've inserted/changed the lines
#CanInstallToExternalStorage: True
#DebuggerForceStandardAssets: true
- and also in the Manifest Editor, I added the targetSdkVersion: <uses-sdk android:minSdkVersion="4" android:targetSdkVersion="28" />
The code shown here under is the start of the example called "Layers". (Horse running across a mountainous background). Files horse00.png , horse01.png ... etc. are all in File Manager under "#Default Group".
When ran with IDE set to Debug, it runs fine, but when I Release the app, it says "FileNotFoundError". See hi-lighted lines. When I examen the Files.DirAssets folder, it contains two entries called "images" and "webkit". Trying to open them as a folder (File.DirAssets/images) , I get "not a folder" error.
B4X:
#Region Module Attributes
#FullScreen: False
#IncludeTitle: True
#ApplicationLabel: Layers
#VersionCode: 1
#VersionName:
#SupportedOrientations: unspecified
#CanInstallToExternalStorage: True
#DebuggerForceStandardAssets: true
#End Region
'Activity module
Sub Process_Globals
Dim ProgName As String : ProgName = "Layers"
Dim ProgVersion As String : ProgVersion = "V 1.0"
Dim TimerHorse As Timer
Dim TimerBackground As Timer
Dim TimerInterval As Long
End Sub
Sub Globals
Dim ImageI As Int ' index of the current horse image
Dim ImageDir As Int ' direction of the horse image
Dim ImageNumber As Int ' number of horse images
ImageNumber = 8
Dim imgHorse(2, ImageNumber) As Bitmap ' array horse image bitmaps
Dim imvBackground As ImageView ' background ImageView
Dim imvForeground As ImageView ' foreground ImageView
Dim cvsForeground As Canvas ' canvas for the foreground image
Dim rectHorse As Rect ' rectangle of the horse image
Dim HorseWidth As Int ' horse image width
Dim HorseHeight As Int ' horse image height
Dim HorseTop As Int ' horse image top
Dim HorseLeft As Float ' current left position of the horse image
Dim HorseDelta As Float ' horse move per timer tick
Dim BackgroundLeft As Float ' current left position of the background
Dim BackgroundDelta As Float ' background move per timer tick
End Sub
Sub Activity_Create(FirstTime As Boolean)
Dim i As Int
' load the horse images
' first index = 0 for galloping to the right
' first index = 1 for galloping to the left
For i = 0 To ImageNumber - 1
[B]imgHorse(0, i).Initialize(File.DirAssets, "horse0" & i & ".png")
imgHorse(1, i).Initialize(File.DirAssets, "horse1" & i & ".png"[/B])
Next
Please can somebody help?
Regards to all.
Theuns