MessageRequester working on desktop but not when Android app deployed
Posted: Fri May 24, 2024 6:26 pm
OK, so I bought SpiderBasic and wrote my first, simple, android test app (code below). It compiles and runs fine on my desktop. You'll notice the commented out line for the messagerequester though. When I uncomment that line, the app on my Android phone hangs. If I quickly tap the screen a couple of times, it continues running, but completely ignores the messagerequester line. If I hesitate, and do not tap the screen for 30+ seconds, it completely hangs my entire phone and the app for several seconds and then finally gives an error message "Application Error : the connection to the server was unsuccessful. (http://localhost/index.html)". Am I missing something obvious (most likely, as I'm very new to SB), or is this a problem/bug? My phone is on Android 14, I'm running SB v2.51 and I'm using Java 11.0.19 2023-04-18 LTS.
Code: Select all
CloseDebugOutput()
Procedure InputButtonHandler()
Text$ = InputRequester("Name:", "")
Result = TextGadget(1, 1, 100, 90, 30, "Hello "+text$+"!")
EndProcedure
Procedure QuitAppHandler()
End
EndProcedure
OpenWindow(0, 0, 0, 200, 200, "ButtonGadgets", #PB_Window_SystemMenu | #PB_Window_SystemMenu)
;MessageRequester("Hello World!")
Result = ButtonGadget(0, 1, 50, 50, 30, "Input")
BindEvent(#PB_Event_Gadget, @InputButtonHandler(),0,0)
BindEvent(#PB_Event_CloseWindow, @QuitAppHandler(),0,0)