Kindle - unable to handle incoming call interrupt

Android apps do automatically suspend when phone calls occur. There are no known suspend/resume issues with Corona on Android. The issue mentioned above could not be reproduced.

You can find documentation about system events here…
http://docs.coronalabs.com/api/event/system/type.html

Also have a look at sample app “Hardware/SystemEvents” that is included with the Corona SDK for an example on how to listen for system events.

Regarding “UIApplicationExitsOnSuspend”, you are correct, there is no Android equivalent to this… but you can code your app to do this. What you need to do is request the Android activity to exit when the app is being suspended. That will force it to exit.
[lua]local function onSystemEvent(event)
if event.type == “applicationSuspend” then
native.requestExit()
end
end
Runtime:addEventListener(“system”, onSystemEvent)[/lua]

Documentation for [lua]native.requestExit()[/lua] can be found here…
http://docs.coronalabs.com/api/library/native/requestExit.html

Please note that the [lua]native.requestExit()[/lua] function only works on Android. It does nothing on iOS or in the Corona Simulator, regardless if you’re simulating an Android device.
[import]uid: 32256 topic_id: 22179 reply_id: 141242[/import]

Fantastic, thanks Joshua! [import]uid: 40033 topic_id: 22179 reply_id: 141254[/import]

(looked for this info everywhere, not clearly listed in the documentation that I could find)

Joshua, would you verify/clarify these questions regarding Android?

  1. The onSuspendResume function (listed above) has no effect (because it’s built-in Corona to automatically suspend on phone calls, etc.)?

  2. There is no Android code for the IOS “UIApplicationExitsOnSuspend”?

Thanks. [import]uid: 40033 topic_id: 22179 reply_id: 141219[/import]

Android apps do automatically suspend when phone calls occur. There are no known suspend/resume issues with Corona on Android. The issue mentioned above could not be reproduced.

You can find documentation about system events here…
http://docs.coronalabs.com/api/event/system/type.html

Also have a look at sample app “Hardware/SystemEvents” that is included with the Corona SDK for an example on how to listen for system events.

Regarding “UIApplicationExitsOnSuspend”, you are correct, there is no Android equivalent to this… but you can code your app to do this. What you need to do is request the Android activity to exit when the app is being suspended. That will force it to exit.
[lua]local function onSystemEvent(event)
if event.type == “applicationSuspend” then
native.requestExit()
end
end
Runtime:addEventListener(“system”, onSystemEvent)[/lua]

Documentation for [lua]native.requestExit()[/lua] can be found here…
http://docs.coronalabs.com/api/library/native/requestExit.html

Please note that the [lua]native.requestExit()[/lua] function only works on Android. It does nothing on iOS or in the Corona Simulator, regardless if you’re simulating an Android device.
[import]uid: 32256 topic_id: 22179 reply_id: 141242[/import]

Fantastic, thanks Joshua! [import]uid: 40033 topic_id: 22179 reply_id: 141254[/import]

i got a same similar issue, and failed at amazon submission

Bug Description: Call Interrupt Fail
Steps to Reproduce:

1.Install and Launch the app.
2.Tap on Play.
3.Select EASY level and the First game in this mode.
4.A timer starts running which is at the top right corner of the screen.
5.Make a call, disconnect the call after 15 to 20 secs observe that the timer would be running in the background when on call.
OS/Device(s)/Form Factor: 2.2.1/Samsung Galaxy S/Phone + Tablet.

* I thought corona is suspending the app automatically ?

* I resubmitted the app and added this code

local function onSystemEvent(event)
if “applicationSuspend” == event.type then
if (timerobj.elapsedtimer) then timer.pause(timerobj.elapsedtimer); end
elseif “applicationResume” == event.type then
if (timerobj.elapsedtimer) then timer.resume(timerobj.elapsedtimer); end
end
end

I’m not sure if it will work with amazon, i don’t have an android phone to test it. I only have a gtab tablet. [import]uid: 157599 topic_id: 22179 reply_id: 142879[/import]

rbm1155,

Corona does suspend correctly during call interruption… or any kind of interruption for that matter because Android does not distinguish the difference. All timers will be automatically suspended too. So what you are doing is unnecessary.

The most likely problem is that your app is not resuming in a manner that the app reviewers expect. I suggest that you contact Amazon to get more details, because right now, all we’re doing is guessing. [import]uid: 32256 topic_id: 22179 reply_id: 142928[/import]

i got a same similar issue, and failed at amazon submission

Bug Description: Call Interrupt Fail
Steps to Reproduce:

1.Install and Launch the app.
2.Tap on Play.
3.Select EASY level and the First game in this mode.
4.A timer starts running which is at the top right corner of the screen.
5.Make a call, disconnect the call after 15 to 20 secs observe that the timer would be running in the background when on call.
OS/Device(s)/Form Factor: 2.2.1/Samsung Galaxy S/Phone + Tablet.

* I thought corona is suspending the app automatically ?

* I resubmitted the app and added this code

local function onSystemEvent(event)
if “applicationSuspend” == event.type then
if (timerobj.elapsedtimer) then timer.pause(timerobj.elapsedtimer); end
elseif “applicationResume” == event.type then
if (timerobj.elapsedtimer) then timer.resume(timerobj.elapsedtimer); end
end
end

I’m not sure if it will work with amazon, i don’t have an android phone to test it. I only have a gtab tablet. [import]uid: 157599 topic_id: 22179 reply_id: 142879[/import]

rbm1155,

Corona does suspend correctly during call interruption… or any kind of interruption for that matter because Android does not distinguish the difference. All timers will be automatically suspended too. So what you are doing is unnecessary.

The most likely problem is that your app is not resuming in a manner that the app reviewers expect. I suggest that you contact Amazon to get more details, because right now, all we’re doing is guessing. [import]uid: 32256 topic_id: 22179 reply_id: 142928[/import]

i got a same similar issue, and failed at amazon submission

Bug Description: Call Interrupt Fail
Steps to Reproduce:

1.Install and Launch the app.
2.Tap on Play.
3.Select EASY level and the First game in this mode.
4.A timer starts running which is at the top right corner of the screen.
5.Make a call, disconnect the call after 15 to 20 secs observe that the timer would be running in the background when on call.
OS/Device(s)/Form Factor: 2.2.1/Samsung Galaxy S/Phone + Tablet.

* I thought corona is suspending the app automatically ?

* I resubmitted the app and added this code

local function onSystemEvent(event)
if “applicationSuspend” == event.type then
if (timerobj.elapsedtimer) then timer.pause(timerobj.elapsedtimer); end
elseif “applicationResume” == event.type then
if (timerobj.elapsedtimer) then timer.resume(timerobj.elapsedtimer); end
end
end

I’m not sure if it will work with amazon, i don’t have an android phone to test it. I only have a gtab tablet. [import]uid: 157599 topic_id: 22179 reply_id: 142879[/import]

rbm1155,

Corona does suspend correctly during call interruption… or any kind of interruption for that matter because Android does not distinguish the difference. All timers will be automatically suspended too. So what you are doing is unnecessary.

The most likely problem is that your app is not resuming in a manner that the app reviewers expect. I suggest that you contact Amazon to get more details, because right now, all we’re doing is guessing. [import]uid: 32256 topic_id: 22179 reply_id: 142928[/import]

i got a same similar issue, and failed at amazon submission

Bug Description: Call Interrupt Fail
Steps to Reproduce:

1.Install and Launch the app.
2.Tap on Play.
3.Select EASY level and the First game in this mode.
4.A timer starts running which is at the top right corner of the screen.
5.Make a call, disconnect the call after 15 to 20 secs observe that the timer would be running in the background when on call.
OS/Device(s)/Form Factor: 2.2.1/Samsung Galaxy S/Phone + Tablet.

* I thought corona is suspending the app automatically ?

* I resubmitted the app and added this code

local function onSystemEvent(event)
if “applicationSuspend” == event.type then
if (timerobj.elapsedtimer) then timer.pause(timerobj.elapsedtimer); end
elseif “applicationResume” == event.type then
if (timerobj.elapsedtimer) then timer.resume(timerobj.elapsedtimer); end
end
end

I’m not sure if it will work with amazon, i don’t have an android phone to test it. I only have a gtab tablet. [import]uid: 157599 topic_id: 22179 reply_id: 142879[/import]

rbm1155,

Corona does suspend correctly during call interruption… or any kind of interruption for that matter because Android does not distinguish the difference. All timers will be automatically suspended too. So what you are doing is unnecessary.

The most likely problem is that your app is not resuming in a manner that the app reviewers expect. I suggest that you contact Amazon to get more details, because right now, all we’re doing is guessing. [import]uid: 32256 topic_id: 22179 reply_id: 142928[/import]