Page 1 of 1

MessageRequester working on desktop but not when Android app deployed

Posted: Fri May 24, 2024 6:26 pm
by OriginalPaladin
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)

Re: MessageRequester working on desktop but not when Android app deployed

Posted: Fri May 24, 2024 10:08 pm
by Quin
In my own app, the MessageRequester() shows fine on desktop, but when running it on Android (Pixel 7 Pro), it simply doesn't show. It acts as if MessageRequester was never called.

Re: MessageRequester working on desktop but not when Android app deployed

Posted: Sat May 25, 2024 8:14 am
by Caronte3D
Works for me on Android with Chrome.
Maybe do you have a popup blocker or something like that?

Re: MessageRequester working on desktop but not when Android app deployed

Posted: Sat May 25, 2024 2:49 pm
by OriginalPaladin
Caronte3D wrote: Sat May 25, 2024 8:14 am Works for me on Android with Chrome.
Maybe do you have a popup blocker or something like that?
Hmmm. I've compiled it as an (native?) app, not a webapp, but that was a good thought. Do the compiled apps for Android run as native or are they running their own, internal web browser for displaying things?

Re: MessageRequester working on desktop but not when Android app deployed

Posted: Sat May 25, 2024 2:56 pm
by Caronte3D
I used: "CreateApp..." and uploaded the .apk to the phone.

Re: MessageRequester working on desktop but not when Android app deployed

Posted: Sat May 25, 2024 5:27 pm
by OriginalPaladin
Caronte3D wrote: Sat May 25, 2024 2:56 pm I used: "CreateApp..." and uploaded the .apk to the phone.
OK, that's what I did too. I use an ad-blocker and I turn it off except when needed. Puzzling...