Titanium JIRA Archive
Appcelerator Community (AC)

[AC-2817] Android: Media - application restarts after taking a photo with showCamera()

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionNeeds more info
Resolution Date2011-12-28T06:46:47.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsTitanium SDK & CLI
Labelsn/a
ReporterFlorian Schnell
AssigneePaul Dowsett
Created2011-11-01T02:48:35.000+0000
Updated2016-03-08T07:47:44.000+0000

Description

Problem

Application restarts after taking a photo with showCamera()

My thoughts

I can confirm that this has to do with too little memory available. For instance if I have many services/applications running along it will restart almost certain, while clearing up memory by stopping apps and services will make the camera return smoothly.

Test case

Insert code here

Open up lots of applications/services ie. bring your phone to memory limit.

Calling Ti.Media.showCamera() opens the camera view correctly.

After taking a picture it is displayed just fine.

Now hitting the save-button from within the preview window the camera-app closes.

With a bit luck you will see your application's loading screen flashing up, then the app is restarted and the image taken is lost. Note: I have enclosed the full log as an attachment. This is an extracted log from the device's message stream. There is no information about why or if the application has been closed, but it seems that the camera is not able to hand over the results. Id of the app is unikoch.de.test.
11-01 11:02:23.433: INFO/TiApplication(30030): (main) [0,0] checkpoint, app created.
11-01 11:02:23.535: INFO/TiApplication(30030): (main) [105,105] Titanium 1.8.0 (2011/10/10 11:49 074cad3)
11-01 11:02:23.828: ERROR/TiBaseActivity(30030): (main) [253,384] Unable to message creator. finishing.
11-01 11:02:23.828: ERROR/TiBaseActivity(30030): java.lang.RuntimeException: Can't marshal non-Parcelable objects across processes.
11-01 11:02:23.828: ERROR/TiBaseActivity(30030):     at android.os.Message.writeToParcel(Message.java:433)
11-01 11:02:23.828: ERROR/TiBaseActivity(30030):     at android.os.IMessenger$Stub$Proxy.send(IMessenger.java:84)
11-01 11:02:23.828: ERROR/TiBaseActivity(30030):     at android.os.Messenger.send(Messenger.java:50)
11-01 11:02:23.828: ERROR/TiBaseActivity(30030):     at org.appcelerator.titanium.TiBaseActivity.handleSendMessage(TiBaseActivity.java:357)
11-01 11:02:23.828: ERROR/TiBaseActivity(30030):     at org.appcelerator.titanium.TiBaseActivity$2.run(TiBaseActivity.java:348)
11-01 11:02:23.828: ERROR/TiBaseActivity(30030):     at org.appcelerator.titanium.TiMessageQueue.handleMessage(TiMessageQueue.java:219)
11-01 11:02:23.828: ERROR/TiBaseActivity(30030):     at android.os.Handler.dispatchMessage(Handler.java:95)
11-01 11:02:23.828: ERROR/TiBaseActivity(30030):     at org.appcelerator.titanium.TiMessageQueue.sendMessage(TiMessageQueue.java:120)
11-01 11:02:23.828: ERROR/TiBaseActivity(30030):     at org.appcelerator.titanium.TiMessageQueue.post(TiMessageQueue.java:236)
11-01 11:02:23.828: ERROR/TiBaseActivity(30030):     at org.appcelerator.titanium.TiBaseActivity.sendMessage(TiBaseActivity.java:345)
11-01 11:02:23.828: ERROR/TiBaseActivity(30030):     at org.appcelerator.titanium.TiBaseActivity.onCreate(TiBaseActivity.java:328)
11-01 11:02:23.828: ERROR/TiBaseActivity(30030):     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
11-01 11:02:23.828: ERROR/TiBaseActivity(30030):     at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1615)
11-01 11:02:23.828: ERROR/TiBaseActivity(30030):     at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1667)
11-01 11:02:23.828: ERROR/TiBaseActivity(30030):     at android.app.ActivityThread.access$1500(ActivityThread.java:117)
11-01 11:02:23.828: ERROR/TiBaseActivity(30030):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:935)
11-01 11:02:23.828: ERROR/TiBaseActivity(30030):     at android.os.Handler.dispatchMessage(Handler.java:99)
11-01 11:02:23.828: ERROR/TiBaseActivity(30030):     at android.os.Looper.loop(Looper.java:123)
11-01 11:02:23.828: ERROR/TiBaseActivity(30030):     at android.app.ActivityThread.main(ActivityThread.java:3687)
11-01 11:02:23.828: ERROR/TiBaseActivity(30030):     at java.lang.reflect.Method.invokeNative(Native Method)
11-01 11:02:23.828: ERROR/TiBaseActivity(30030):     at java.lang.reflect.Method.invoke(Method.java:507)
11-01 11:02:23.828: ERROR/TiBaseActivity(30030):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:842)
11-01 11:02:23.828: ERROR/TiBaseActivity(30030):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:600)
11-01 11:02:23.828: ERROR/TiBaseActivity(30030):     at dalvik.system.NativeStart.main(Native Method)
11-01 11:02:23.832: WARN/ActivityManager(128): Trying to launch unikoch.de.test/.UnikochActivity
11-01 11:02:23.863: INFO/TiRootActivity(30030): (main) [0,0] checkpoint, on root activity create, savedInstanceState: Bundle[mParcelledData.dataSize=204]
11-01 11:02:24.066: ERROR/TiApplication(30030): (main) [202,202] APP PROXY: [Ti.App]

Discussions

Q&A: [camera crashes titainium application during low memory conditions](http://developer.appcelerator.com/question/122763/camera-crashes-titainium-application-during-low-memory-conditions)

Attachments

FileDateSize
full_log.txt2011-11-01T04:24:04.000+000076196

Comments

  1. Paul Dowsett 2011-12-28

    Thanks for raising this ticket. Please note the changes I have made to allow it to be accepted. The only item that is missing is a simple test case, which must run without modification, as per the [Creating a Test Case](https://wiki.appcelerator.org/display/guides/How+to+Submit+a+Bug+Report#HowtoSubmitaBugReport-CreatingaTestCase) section. I will mark this resolved for now. Please reopen it once it is complete, and I will move it to the main project. Cheers
  2. Paul Dowsett 2011-12-28

    I forgot to mention, the [JIRA Ticket Checklist](https://wiki.appcelerator.org/display/guides/How+to+Submit+a+Bug+Report#HowtoSubmitaBugReport-JIRATicketChecklist) is useful when raising tickets. Thanks
  3. Paul Dowsett 2012-02-17

    Closing due to inactivity. If this issue still exists, please raise a new ticket, including all the information in the [JIRA Ticket Checklist](https://wiki.appcelerator.org/display/guides/How+to+Submit+a+Bug+Report#HowtoSubmitaBugReport-JIRATicketChecklist) to ensure that we can escalate it quickly. Read [How to Submit a Bug Report](https://wiki.appcelerator.org/display/guides/How+to+Submit+a+Bug+Report) if you have not read it before, and always start a ticket using the [JIRA Ticket Template](https://wiki.appcelerator.org/display/guides/JIRA+Ticket+Template). Thanks in advance

JSON Source