To comply with some services app submissions guidelines they want you to display a internet usage fees may apply dialog to the end users upon first running. Does anyone have some example code to share to make this happen?
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.
Thanks this is just what I needed, to submit app to blackberry app world. I Mod it a little for allow internet application run.
B4X:
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
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.
The "EULA.txt" file is used as a flag, if IT DOESN'T exists means is the very first time the app was ran, that's why it's being created, so, the next time the app is ran it will not show up again.
The only time the EULA will show again is if the user uninstalls the app and installs it again.