Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

AppGameKit Classic Chat / Android text entry problem.

Author
Message
DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 4th Aug 2012 16:57
Hi all. I have recently released Moonsnaker on android, and a problem with starttextentry() has caused me to attempt to improve it with an editbox.
However I am having issues getting my code to work on android. It runs fine on PC using a real keyboard but on android it basically will not detect when the name is entered.

If anyone could test this out on their android devices or any besides PC really and see what happens. On PC it will let you enter your name then bloank out when done. On android it will let you enter your name and sit there until you click the screen, losing focus on the textbox and thus exiting. I do not want that I want it to work as soon as you hit return.

I have tried using all the checks I can besides GetEditBoxChanged, but am out of ideas now.

Any ideas? Does this work ok for some of you on mobile devices? It seems like a bug to me. How would you go about getting it to work as wanted?

DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 13th Aug 2012 18:30
No replies? I have had to use a pointer state check to work around it, but it is not ideal Has nobody else has had this problem?
I have since tried making the textbox invisible to stop the box being shown if the adverts fail, which also does not seem to work. Has anyone else tried using the transparency setting on edit boxes?

Rich Dersheimer
AGK Developer
14
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
Posted: 13th Aug 2012 21:14 Edited at: 13th Aug 2012 21:17
I'm curious about this as well, I'll try your code when I get home from work tonight.

I like how text boxes work in windows, but they suck in iOS and Android, IMHO.

BTW, have you ever noticed how your (everyone's) original post flashes up for a split second before the edited version appears? You can see it if you look sharp, or I guess you could record it, and see what the poster typed before they edited.

Ancient Lady
Valued Member
20
Years of Service
User Offline
Joined: 17th Mar 2004
Location: Anchorage, Alaska, USA
Posted: 13th Aug 2012 21:18
What I did was detect whether I was on a portable device first in a startup function (something like this):


After everything is loaded, clear the splash screen:


When I needed to get some input I'd build my first input box, located to make sure that a pop-up keyboard won't cover it (a prompt and a button would be next to the box and the button would be labeled something like 'press to submit'):


Then I'd loop until I had a non-blank value:


The 'makeAButton' creates a square sprite with text in front of it and places a virtual button on top of it (invisible).

Obviously you'd need to come up with values for some of the variables used to position things (px#,py#,i_bx,i_by were all calculated based on lots of stuff not shown in these snippets).

This has the affect of manually popping up the 'old' edit box on top of everything and accepting input when the user presses the 'done' or 'enter' key on the virtual keyboard.

I had this working very well with my WIP game.

Cheers,
Ancient Lady
AGK Community Tester
Rich Dersheimer
AGK Developer
14
Years of Service
User Offline
Joined: 1st Jul 2009
Location: Inside the box
Posted: 14th Aug 2012 05:02 Edited at: 14th Aug 2012 05:45
I can confirm that I'm getting the same result, the keyboard and the edit box go away after hitting the ENTER key, but it's like the GetEditBoxChanged() is not triggering.

This is on a Kindle Fire.

On my HTC Incredible, the virtual keyboard never even pops up, so there's no way to type. Hitting the BACK button on the phone does close the edit box, but with the same problem of leaving all the text objects until you tap the screen again.

A bug, in my opinion.

EDIT: Oh, my iPad does the same thing, gotta touch the screen after ENTER to continue, BUT it also doesn't display the text string as you type it. So that's another bug with text boxes. Or maybe it's not a bug, but one of those "your program is not guaranteed to continue running while..." things.

DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 14th Aug 2012 15:40
@ Rich, thanks for confirming it. I wasn't aware that the text doesn't display on iphone, but I don't own one so not surprising! I have also has occasional times on my HTC when the keyboard doesn't show up, but most times it works ok. I never noticed post edits flashing up though, perhaps it is a cache thing.

@ Ancient Lady, I was trying to do away with the text input command, as it is in itself buggy. When I use that, the entry box is hidden behind the virtual keyboard! I used the edit box so I could position it, or text, in a place the keyboard never covers. It would by the sounds help with detecting return as that works ok (I used that before I tried edit boxes). I never thought to combine the two to get the return key working. Still I would prefer the commands to be fixed, than have to work with both text input and an edit box if possible! It is a pity they didn't just add a position text input box command, when they added the new edit box commands, so it could be moved above the virtual keyboard.

I think that the transparency commands are bugged also, as I have not had any joy trying to hide the edit box either, as I stated in my second post. A pity, because hiding the box behind the text would look better in general for most games.

Funnell7
12
Years of Service
User Offline
Joined: 8th Sep 2011
Location: UK, England
Posted: 14th Aug 2012 22:38
DVader, why not give the user the choice to input a name, rather than forcing it on them? More often than not I don't want to submit the score as I know its not good enough...

This is what I do for my app which seems to work fine on both Android and iPhone. I have extracted the code and removed the need for Media incase you want to try it...



I also write out the NameString to a file so the user doesn't have to type it in everytime they load the app.

This is what it actually looks like with the correct media etc...

DVader
20
Years of Service
User Offline
Joined: 28th Jan 2004
Location:
Posted: 15th Aug 2012 21:20
Well in Moonsnaker, it remembers your name after entering it once and never asks you again. If you want to change it you then have to go into the options. It doesn't remember your name when you reload though, I didn't think it important. If you go into the options and set your name, it then just uses that and never asks you again until you reload of course

I can add a feature to remember your name for an update possibly. The score is not online on my app as I am useless at that sort of thing. All attempts so far have met with not even marginal success. Definitely my weakest point at the minute with using AGK.

I'm back tinkering on Obliterator at the moment, a boss is proving troublesome, but I will keep updating Moon Snaker when I can.

Login to post a reply

Server time is: 2024-05-02 02:06:15
Your offset time is: 2024-05-02 02:06:15