Tappy Chicken on Android: The back button

Tappy Chicken have one mayor flaw on Android - the back button. The back button is supposed to be able to quit a game. Either directly or by first showing a confirmation dialog. The latter might be the preferred way for a game like Tappy Chicken. Keep up the great work!

Well for most of the games I have using the back button in the menu does exactly one thing: nothing. Usually you use the home button to quit the game?

In case of Back button it is importent to know that its just a button that by default does nothing, the Android UI supports it but when you have your own UI you need to add back support in to it. All mechanical buttons in Android is part of keyboard subsystem, thing is engine APIs works like wrapper for system APIs for portability reasons, so if wrapper does not support it wont see back button presses

Thats mainly because games usally ported from iOS where back button does not exist, where according go google glidelines you should use it

Google’s guidelines have always been that the back button should quit the application, and that’s what all my applications do on my Samsung phones. The home button MINIMIZES the application, letting it sit in the background and that’s a major difference.

It’s still bad design. That some people don’t know how to code for Android doesn’t mean Tappy Chicken on UE4 should do the same. At least it should be minimum for what to expect on Android.

Then the problem is even deeper than I thought. If UE4 is incapable of utilizing the back button on Android it is ignoring one of the main guidelines of Android programming.

This should be easy to fix. Here’s a blueprint that allows the back button to work on an Android device. The back button is mapped to the ESC key, and that is how I have used this in the past to work. You can also use it to take you back to a previous scene or level if you want.
Google will allow an app to be released without this functionality, however, the Samsung store will not.
2014-06-04_20h25_52.png

Oh :slight_smile: So it’s on escape button that makes things a lot simpler, so there is not problem good find… also i don’t know why this have problem with Samsung store… why you want to relese game on Samsung store to begin with? :stuck_out_tongue:

The Escape key event isn’t working for me, at least in 4.2. I’ve tried it in my own project and Tappy Chicken. Can somebody confirm it is working in 4.2?

Well looks like back button is indeed mapped as escape in Android

Maybe try to use key binddings (Edit->Project Settings->Input) but i’m not sure how to use it on blueprint, there should something in input component and setup back button bind and set Escape buton on it

I have already tried that, as well, with no success. But by the look of it, maybe you are confusing unity with unrealengine? Edit Unless I’ve misinterpreted what you said.

No im not confused with unity. As i said those buttons are seen as in Android as keyboard presses, i know that because i develop on Android a little. So if UE4 API current translate keyboard calls it sould apply to UE4 too, same thing with Unity

I see what you’re saying now. I’ve developed on Android some too. I’ve always used KeyEvent.KEYCODE_BACK inside Java though. I’m reading that the NDK constant is AKEYCODE_BACK, which I believe is what UE4 uses for Android. (http://stackoverflow.com/questions/12130618/android-ndk-how-to-override-onbackpressed-in-nativeactivity-without-java). I could be wrong though, but I’m starting to think that the Escape binding is expressed somewhere only in unity’s codebase (not Android nor UE4). Since I’ve spent way too much time trying to get it working, with no luck. :frowning:

I wonder if Epic has a reply to this? I cannot get myself to release anything on Android where the back button doesn’t work. I’ve tried a few games on Android with this issue, and all I can think of is that the developers need to learn how to code for more than just iOS.

There is an ‘Android Back’ event that you can handle in the following manner

dcb6ea756d11d6df885ef63f6962e987cf9d2dfe.jpeg