Page 1 of 2
No acknowledgement of text entry widget on Android
Posted: Wed Feb 12, 2020 11:40 pm
by djg
Hello,
I am learning how to program using RapaGUI, and the following problem occurs.
When I compile for Windows, an acknowledge attribute arrives, but when I compile for Android, it does not.
Is it a bug or am I missing something?
Code: Select all
; text entry test
@REQUIRE "RapaGUI", { Link = True}
@FILE 1, "TextEntryTestGUI.xml"
Function p_EventHandler(msg)
Switch(msg.action)
Case "RapaGUI":
Switch(msg.attribute)
Case "Acknowledge":
Switch(msg.id)
Case "message_entry":
text$ = moai.Get("message_entry", "text")
DebugPrint("text entered: \""..text$.."\"")
moai.Set("message_entry", "text", ReverseStr(text$))
EndSwitch
Case "Text":
Beep()
EndSwitch
EndSwitch
EndFunction
moai.CreateApp(ReadBytes(1))
InstallEventHandler({RapaGUI = p_EventHandler})
Repeat
WaitEvent
Forever
The xml file:
Code: Select all
<?xml version="1.0" encoding="iso-8859-1"?>
<application>
<window title="TextEntryTest">
<vgroup>
<textentry id="message_entry" notify="acknowledge; text"></textentry>
<hgroup>
<button id="a" disabled = "false">1</button>
<button id="b" disabled = "false">2</button>
<button id="c" disabled = "false">3</button>
<button id="d" disabled = "false">4</button>
</hgroup>
</vgroup>
</window>
</application>
Re: No acknowledgement of text entry widget on Android
Posted: Thu Feb 13, 2020 7:21 pm
by pecaN
Hi,
if the xml code you posted is like this, you definitely get an error message because this line is total nonsense :
<textentry id="message_entry" notify="acknowledge; text"></textentry>
correct is this:
<textentry id="message_entry" notify="Acknowledge"/>
the rest of your line is wrong because <textentry/> is NOT paired!! the same as <hline/>, <rectangle/> etc...
i advise you to read manual very carefully and understand all the differencies from the start, I had similar problem.
pecaN
Re: No acknowledgement of text entry widget on Android
Posted: Thu Feb 13, 2020 10:46 pm
by djg
I see. I have corrected the line but it didn't solve the problem, I'm afraid. When I press return om the keyboard on my phone the keyboard disappears as you would expect, but the text is not reversed in the widget. It does work under Windows and AmigaOS. I could not find any error message, but I do see this after compiling for Android:
Code: Select all
> Task :app:lint
Ran lint on variant arm8Debug: 42 issues found
Ran lint on variant arm7Release: 42 issues found
Ran lint on variant arm8Release: 42 issues found
Ran lint on variant arm7Debug: 42 issues found
Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
BUILD SUCCESSFUL in 8s
I have no idea what Gradle is or what Lint is, but I do understand the last line printed in green letters.

Re: No acknowledgement of text entry widget on Android
Posted: Fri Feb 14, 2020 7:18 pm
by pecaN
Well I haven't compile anything for android so far but your problem really interests me. Can you please post the exact .hws code (not the xml file) which is working on win so I can test it myself?
I still don't understand some parts of your code - e.g. this line:
DebugPrint("text entered: \""..text$.."\"")
DebugPrint is a Hollywood command afaik so you can't use it in RapaGUI until you have a hollywood display embedded in your gui, which you don't, so using this command is a mystery for me because it needs a hollywood display to output...
thanks pecaN
Re: No acknowledgement of text entry widget on Android
Posted: Fri Feb 14, 2020 10:42 pm
by djg
Alright, here it is:
Code: Select all
; text entry test
@REQUIRE "RapaGUI", { Link = True}
@FILE 1, "TextEntryTestGUI.xml"
Function p_EventHandler(msg)
Switch(msg.action)
Case "RapaGUI":
Switch(msg.attribute)
Case "Acknowledge":
Switch(msg.id)
Case "message_entry":
text$ = moai.Get("message_entry", "text")
DebugPrint("text entered: \""..text$.."\"")
moai.Set("message_entry", "text", ReverseStr(text$))
EndSwitch
Case "Text":
Beep()
EndSwitch
EndSwitch
EndFunction
moai.CreateApp(ReadBytes(1))
InstallEventHandler({RapaGUI = p_EventHandler})
Repeat
WaitEvent
Forever
It's not pretty, but it is only meant for testing after all. The output of DebugPrint I can see in Hollywood IDE on Windows. Later I added the ReverseStr and Beep functions so I had a simple way to test what message attributes were sent on Android. After every typed character I hear the beep, but on Android the text is not reversed after I hit enter, while on Windows it is.
Re: No acknowledgement of text entry widget on Android
Posted: Sat Feb 15, 2020 9:25 am
by pecaN
Ok, thanks, forget my DebugPrint comment, wrong one
Your code seems really correct so I'll see

pecaN
Re: No acknowledgement of text entry widget on Android
Posted: Sat Feb 15, 2020 4:18 pm
by djg
Ok, thanks for now anyway.
Re: No acknowledgement of text entry widget on Android
Posted: Sat Feb 15, 2020 4:31 pm
by pecaN
you're welcome
but hey, on win10 it works great, can you please send me the APK file to:
pecank@seznam.cz
I can test it on my android - very old version 4.4

pecaN
Re: No acknowledgement of text entry widget on Android
Posted: Sat Feb 15, 2020 11:23 pm
by pecaN
Ok, doesn't work on my Android too.
Did you try to compile it for Windows to?? Maybe that DebugPrint really causes problems in an exe file so try to remove it.
Consult Hollywood manual on DebugPrint command, it's explained there
Re: No acknowledgement of text entry widget on Android
Posted: Sat Feb 15, 2020 11:57 pm
by airsoftsoftwair
djg wrote: ↑Wed Feb 12, 2020 11:40 pm
Hello,
I am learning how to program using RapaGUI, and the following problem occurs.
When I compile for Windows, an acknowledge attribute arrives, but when I compile for Android, it does not.
Is it a bug or am I missing something?
It's a bug

RapaGUI on Android currently doesn't support the acknowledge attribute. Will be fixed.