No acknowledgement of text entry widget on Android

Discuss GUI programming with the RapaGUI plugin here
djg
Posts: 5
Joined: Wed Feb 12, 2020 10:37 pm

No acknowledgement of text entry widget on Android

Post by djg » 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?

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>

pecaN
Posts: 120
Joined: Thu Jun 10, 2010 4:15 pm

Re: No acknowledgement of text entry widget on Android

Post by pecaN » Thu Feb 13, 2020 7:21 pm

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

djg
Posts: 5
Joined: Wed Feb 12, 2020 10:37 pm

Re: No acknowledgement of text entry widget on Android

Post by djg » Thu Feb 13, 2020 10:46 pm

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. :)

pecaN
Posts: 120
Joined: Thu Jun 10, 2010 4:15 pm

Re: No acknowledgement of text entry widget on Android

Post by pecaN » Fri Feb 14, 2020 7:18 pm

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

djg
Posts: 5
Joined: Wed Feb 12, 2020 10:37 pm

Re: No acknowledgement of text entry widget on Android

Post by djg » Fri Feb 14, 2020 10:42 pm

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.

pecaN
Posts: 120
Joined: Thu Jun 10, 2010 4:15 pm

Re: No acknowledgement of text entry widget on Android

Post by pecaN » Sat Feb 15, 2020 9:25 am

Ok, thanks, forget my DebugPrint comment, wrong one :-)

Your code seems really correct so I'll see :-) pecaN

djg
Posts: 5
Joined: Wed Feb 12, 2020 10:37 pm

Re: No acknowledgement of text entry widget on Android

Post by djg » Sat Feb 15, 2020 4:18 pm

Ok, thanks for now anyway.

pecaN
Posts: 120
Joined: Thu Jun 10, 2010 4:15 pm

Re: No acknowledgement of text entry widget on Android

Post by pecaN » Sat Feb 15, 2020 4:31 pm

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

pecaN
Posts: 120
Joined: Thu Jun 10, 2010 4:15 pm

Re: No acknowledgement of text entry widget on Android

Post by pecaN » Sat Feb 15, 2020 11:23 pm

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

User avatar
airsoftsoftwair
Posts: 3309
Joined: Fri Feb 12, 2010 2:33 pm
Location: Germany
Contact:

Re: No acknowledgement of text entry widget on Android

Post by airsoftsoftwair » Sat Feb 15, 2020 11:57 pm

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.

Post Reply