To make the difference more clear, I split the combined examples from my previous post into four smaller examples.
example1:
Code: Select all
@DISPLAY {Title = "Dir test", ScaleMode = #SCALEMODE_AUTO, FitScale = True}
ExitOnError(False)
If PermissionRequest(#PERMREQ_WRITEEXTERNAL)
filedir$ = "/mnt/sdcard/DIR1"
TextOut(100, 75, filedir$)
If Exists(filedir$)
TextOut(100, 100, filedir$.." exsists")
Else
TextOut(100, 100, "MAKING DIR 1")
MakeDirectory(filedir$)
EndIf
If Exists(filedir$.."/testfile.dat")
TextOut(100, 125, "File in DIR1 exists")
Else
StringToFile("", filedir$.."/testfile.dat")
TextOut(100, 125, "Creating file in DIR1")
EndIf
EndIf
WaitLeftMouse
example2:
Code: Select all
@DISPLAY {Title = "Dir test", ScaleMode = #SCALEMODE_AUTO, FitScale = True}
ExitOnError(False)
If PermissionRequest(#PERMREQ_WRITEEXTERNAL)
filedir$ = "/storage/emulated/0/DIR2"
TextOut(100, 75, filedir$)
If Exists(filedir$)
TextOut(100, 100, filedir$.." exsists")
Else
TextOut(100, 100, "MAKING DIR 2")
MakeDirectory(filedir$)
EndIf
If Exists(filedir$.."/testfile.dat")
TextOut(100, 125, "File in DIR2 exists")
Else
TextOut(100, 125, "Creating file in DIR2")
StringToFile("", filedir$.."/testfile.dat")
EndIf
EndIf
WaitLeftMouse
example3:
Code: Select all
@DISPLAY {Title = "Dir test", ScaleMode = #SCALEMODE_AUTO, FitScale = True}
ExitOnError(False)
t = GetSystemInfo()
If PermissionRequest(#PERMREQ_WRITEEXTERNAL)
filedir$ = t.SDCard.."/DIR3"
TextOut(100, 75, filedir$)
If Exists(filedir$)
TextOut(100, 100, filedir$.." exsists")
Else
TextOut(100, 100, "MAKING DIR 3")
MakeDirectory(filedir$)
EndIf
If Exists(filedir$.."/testfile.dat")
TextOut(100, 125, "File in DIR3 exists")
Else
TextOut(100, 125, "Creating file in DIR3")
StringToFile("", filedir$.."/testfile.dat")
EndIf
EndIf
WaitLeftMouse
example4:
Code: Select all
@DISPLAY {Title = "Dir test", ScaleMode = #SCALEMODE_AUTO, FitScale = True}
ExitOnError(False)
t = GetSystemInfo()
If PermissionRequest(#PERMREQ_WRITEEXTERNAL)
filedir$ = t.SDCard.."/DIR4"
TextOut(100, 75, filedir$)
ChangeDirectory(t.SDCard)
If Exists(filedir$)
TextOut(100, 100, filedir$.." exsists")
Else
TextOut(100, 100, "MAKING DIR 4")
MakeDirectory("DIR4")
EndIf
If Exists(filedir$.."/testfile.dat")
TextOut(100, 125, "File in DIR4 exists")
Else
TextOut(100, 125, "Creating file in DIR4")
StringToFile("", "DIR4/testfile.dat")
EndIf
EndIf
WaitLeftMouse
Example 1 and Example 4 works well when compiled with HW8.0/Apk-Compiler 3.2
None of the examples work when compiled with HW9.0/Apk-Compiler 4.0
Example 2,3 and 4 works as applets with Hollywood Player 9.1 on android. Example 1 does not work.
My question is then whhat makes the above codes work with HW8/Compiler 3.2 but not with HW9/Compiler 4.0?
And why does not example 1 work with Hollywood Player 9.1?