I just submitted to Nook yesterday. I couln’t get the Android back button to function like I wanted so I have a native.alert appear when it’s pressed stating “button disabled”, “Sorry for the inconveniece”. This leaves the button functional, but it isn’t used how it’s intended. Think that will be an issue? [import]uid: 46082 topic_id: 34520 reply_id: 137372[/import]
This is what Nook emailed me;
Its not acceptable for your application to ignore the Back button on the Nook Color, however if you’d like you can have it take the user to the main/1st page and then quit the application on a 2nd press that would be acceptable. If you choose to do so, please reference this ticket in the Credentials field so that the QA team does not fail your app for that reason.
[import]uid: 31039 topic_id: 34520 reply_id: 137383[/import]
I tried Rob’s method above, and it’s now getting rejected because the volume buttons are disabled… ugh - any fix or workaround for this? [import]uid: 63661 topic_id: 34520 reply_id: 137911[/import]
You have to specifiy the volume controls on Android. The below code is from the ansce “key event” sample.
[lua]local function onKeyEvent( event )
local returnValue = true
local phase = event.phase
local keyName = event.keyName
– Make an exception for Volume Up key and default to it’s normal function (just for show)
if “volumeUp” == keyName then
returnValue = false – use default key operation
end
if “volumeDown” == keyName then
returnValue = false – use default key operation
end
if “back” == keyName then
director:changeScene( “loadback” )
end
– we handled the event, so return true.
– for default behavior, return false.
return returnValue
end
– Add the key callback
Runtime:addEventListener( “key”, onKeyEvent ); [/lua] [import]uid: 46082 topic_id: 34520 reply_id: 137921[/import]
Thanks, I’ll give that a shot and report back! [import]uid: 63661 topic_id: 34520 reply_id: 137925[/import]
Tried implementing that, and the nook volume controls do not work… [import]uid: 63661 topic_id: 34520 reply_id: 137928[/import]
@Rob,
Any progress on this ?
Thanks,
Fran [import]uid: 31039 topic_id: 34520 reply_id: 137432[/import]
@Rob,
Any progress on this ?
Thanks,
Frank [import]uid: 31039 topic_id: 34520 reply_id: 137433[/import]
Soon after posting my question I got almost the exact same message you got. They told me I’m not using the back button or the “N” button how they are intended to be used. It’s not difficult to fix, but it is going to take a little time. The “N” button is essentially the Android “Home” button. You should only have to save your apps data when its event is suspended, closed, or exited. [import]uid: 46082 topic_id: 34520 reply_id: 137447[/import]
b&n was more descriptive in their rejection, as follows:
According to the tester “The app closes when pressing the back button on the NOOK System Bar when on the Page Selection Menu on the NOOK HD and NOOK HD+.”
- Begin the app on the NOOK HD and NOOK HD+.
- Tap and Hold to bring up the page selection Menu.
- Select the back button on the NOOK System bar.
Result: The app closes
As well as a note; If the Page Selection Menu is opened while on any page after page 1, the Back button appears to have no functionality. It appears the Back button is navigating the user back a page ‘behind’ the Page Selection Menu.
Does corona have this functionality in its api for the nook hd, to handle both the back button & page selection menu as described by b&n ? I haven’t seen it anywhere.
[import]uid: 31039 topic_id: 34520 reply_id: 137962[/import]
I’m so confused on all of this now - My understanding was that Nook just wants the ability for the user to navigate back to the menu before closing the app using either the “n” button on the old Nook Color, or the back button the Nook HD and HD+ tablets.
As far as testing is concerned, it worked on my end on the Nook Color. The issue I was having, and still have is now the volume control is disabled, and I tried implementing the above code, and the volume control still won’t work.
I think we need to get one clear message from Nook as to what they want from us in terms of navigating using their system bar, as I’m getting different answers than other people. [import]uid: 63661 topic_id: 34520 reply_id: 137978[/import]
@Joshua: If we use the method you described by displaying the status bar for the Nook apps, would we then eliminate having to override the “n” button as described by some of the code Rob provided above?
I was just reading up on another thread where this was discussed, and wondering if this is the same issue B&N is talking about, or a different one? If so, your solution sounds easy enough! [import]uid: 63661 topic_id: 34520 reply_id: 137998[/import]
I Just got another email from b&n stating that they couldn’t find a page selection menu in my app, so they approved it. This is all very confusing.
It does have another problem which I will mention in another thread.
Thanks all. [import]uid: 31039 topic_id: 34520 reply_id: 138008[/import]
I went ahead and just implemented the status bar, and moved things up a bit on my app, and they approved it. It seems like the much easier solution for now is to include the status bar, so they can go back a page, or suspend the app. [import]uid: 63661 topic_id: 34520 reply_id: 138097[/import]
I’ve got a thread going here I really need help with. Apple just published my game and I need to release it for Android, but this is stopping me. It’s another Android Back button problem.
http://developer.coronalabs.com/forum/2013/01/09/android-director-issue
[import]uid: 46082 topic_id: 34520 reply_id: 138100[/import]
The best way to handle key events is like this…
[lua]local function onKeyEvent( event )
– Default to false so that all other keys will be handled by the OS.
local wasOverriden = false
if (“down” == event.phase) and (“back” == event.keyName) then
– Handle the back key here.
– Just make sure to not override it if your app is displaying the root/main screen
– so that the end-user can exit out of your app with the Back key.
wasOverriden = true
end
return wasOverriden
end
Runtime:addEventListener( “key”, onKeyEvent )[/lua]
The above allows all other keys that you do not wish to override to be handled by the OS, such as the volume keys.
Also, the Nook’s physical ‘n’ button is treated like a Back key if your app is not displaying a status bar. If your app is displaying a status bar, then the physical ‘n’ button becomes a Home key and then an onscreen back key will appear instead. This is how B&N designed it. There are no known bugs with Corona and the physical ‘n’ button. It definitely works and there are other Corona made apps on the Nook app store to prove it. [import]uid: 32256 topic_id: 34520 reply_id: 138214[/import]
@Rob: any progress?
I had the same note today on one of our apps - any help on this is appreciated as I need to get it in this week.
Thanks [import]uid: 63661 topic_id: 34520 reply_id: 137790[/import]
Nothing yet. It’s only been a couple of business days since I brought it up. I’ll check back and see if there is any update. [import]uid: 199310 topic_id: 34520 reply_id: 137792[/import]
Just curious, if you’re in the main menu, and you want the “n” button to close the application, what command would you use?
for example, in all the other scenes, we used:
storyboard.gotoScene(“mainScreen”, “fade”);
etc.
What would you use to close the app? [import]uid: 63661 topic_id: 34520 reply_id: 137795[/import]