Sub Activity_Create(FirstTime As Boolean)
If File.Exists(File.DirDefaultExternal, "EULA.txt") = False Then
File.OpenOutput(File.DirDefaultExternal, "EULA.txt", False)
ToastMessageShow("Read the EULA", True)
End If
End Sub
Sub Activity_Create(FirstTime As Boolean)
If File.Exists(File.DirDefaultExternal, "YOURAPPNAMEEULA.txt") = False Then
If Msgbox2("This software uses the internet and usage fees may apply, do you want to allow the connection?", "Internet Usage", "Yes - I Accept", "", "No", Null) = DialogResponse.POSITIVE Then
File.OpenOutput(File.DirDefaultExternal, "YOURAPPNAMEEULA.txt", False)
Else
Activity.Finish
End If
End If
'app start functions here
End Sub
A very simple way to do it:
B4X:Sub Activity_Create(FirstTime As Boolean) If File.Exists(File.DirDefaultExternal, "EULA.txt") = False Then File.OpenOutput(File.DirDefaultExternal, "EULA.txt", False) ToastMessageShow("Read the EULA", True) End If End Sub
In this sample, the EULA message will display ONLY THE VERY FIRST TIME the app is installed.
If File.Exists(File.DirDefaultExternal, "EULA.txt") = True Then