MessageRequester working on desktop but not when Android app deployed

Just starting out? Need help? Post your questions and find answers here.
OriginalPaladin
Posts: 3
Joined: Fri May 24, 2024 6:08 pm

MessageRequester working on desktop but not when Android app deployed

Post 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)
Quin
Posts: 118
Joined: Wed Nov 08, 2023 4:38 pm

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

Post 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.
User avatar
Caronte3D
Posts: 189
Joined: Sat Nov 23, 2019 5:21 pm
Location: Some Universe

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

Post by Caronte3D »

Works for me on Android with Chrome.
Maybe do you have a popup blocker or something like that?
OriginalPaladin
Posts: 3
Joined: Fri May 24, 2024 6:08 pm

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

Post 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?
User avatar
Caronte3D
Posts: 189
Joined: Sat Nov 23, 2019 5:21 pm
Location: Some Universe

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

Post by Caronte3D »

I used: "CreateApp..." and uploaded the .apk to the phone.
OriginalPaladin
Posts: 3
Joined: Fri May 24, 2024 6:08 pm

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

Post 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...
Post Reply