{ "id": "119738", "key": "TIMOB-15110", "fields": { "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false }, "project": { "id": "10153", "key": "TIMOB", "name": "Titanium SDK/CLI", "projectCategory": { "id": "10100", "description": "Titanium and related SDKs used in application development", "name": "Client" } }, "fixVersions": [ { "id": "15699", "description": "2013 Sprint 21", "name": "2013 Sprint 21", "archived": true, "released": true, "releaseDate": "2013-10-18" }, { "id": "15700", "description": "2013 Sprint 21 API", "name": "2013 Sprint 21 API", "archived": true, "released": true, "releaseDate": "2013-10-18" } ], "resolution": { "id": "7", "description": "", "name": "Invalid" }, "resolutiondate": "2013-09-30T13:07:19.000+0000", "created": "2013-09-10T07:57:06.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "android", "ipass1" ], "versions": [ { "id": "14162", "description": "Release 3.1.0", "name": "Release 3.1.0", "archived": true, "released": true, "releaseDate": "2013-04-16" }, { "id": "15478", "description": "Release 3.1.1", "name": "Release 3.1.1", "archived": true, "released": true, "releaseDate": "2013-06-17" }, { "id": "15479", "description": "Release 3.1.2", "name": "Release 3.1.2", "archived": true, "released": true, "releaseDate": "2013-07-31" } ], "issuelinks": [], "assignee": { "name": "sunila", "key": "sunila", "displayName": "Sunila", "active": true, "timeZone": "Asia/Kolkata" }, "updated": "2017-03-28T20:23:49.000+0000", "status": { "description": "The issue is considered finished, the resolution is correct. Issues which are closed can be reopened.", "name": "Closed", "id": "6", "statusCategory": { "id": 3, "key": "done", "colorName": "green", "name": "Done" } }, "components": [ { "id": "10202", "name": "Android", "description": "Android Platform" } ], "description": "Camera photo's is not saving in a photo gallery. This following code is working in 3.0.2 version but it's not working in later version for android platform.\r\n\r\n{code}\r\n\r\nvar win = Ti.UI.createWindow({\r\n\tbackgroundColor : '#fff'\r\n});\r\n\r\nfunction fireUpTheCamera() {\r\n\tTitanium.Media.showCamera({\r\n\t\tsaveToPhotoGallery : true,\r\n\t\tallowEditing : false,\r\n\t\tautohide : false, //Important!\r\n\t\tmediaTypes : [Ti.Media.MEDIA_TYPE_PHOTO],\r\n\t\tsuccess : function(event) {\r\n\t\t\t\r\n\t\t\tTi.API.debug('Our type was: ' + event.mediaType);\r\n\t\t\tif (event.mediaType == Ti.Media.MEDIA_TYPE_PHOTO) {\r\n\t\t\t\tvar imageView = Ti.UI.createImageView({\r\n\t\t\t\t\twidth : win.width,\r\n\t\t\t\t\theight : win.height,\r\n\t\t\t\t\timage : event.media\r\n\t\t\t\t});\r\n\t\t\t\twin.add(imageView);\r\n\t\t\t\t\r\n\t\t\t} else {\r\n\t\t\t\talert(\"got the wrong type back =\" + event.mediaType);\r\n\t\t\t}\r\n\t\t},\r\n\t\tcancel : function() {\r\n\t\t\t// called when user cancels taking a picture\r\n\t\t},\r\n\t\terror : function(error) {\r\n\t\t\t// called when there's an error\r\n\t\t\tvar a = Titanium.UI.createAlertDialog({\r\n\t\t\t\ttitle : 'Camera'\r\n\t\t\t});\r\n\t\t\tif (error.code == Titanium.Media.NO_CAMERA) {\r\n\t\t\t\ta.setMessage('Please run this test on device');\r\n\t\t\t} else {\r\n\t\t\t\ta.setMessage('Unexpected error: ' + error.code);\r\n\t\t\t}\r\n\t\t\ta.show();\r\n\t\t},\r\n\r\n\t\t\r\n\t});\r\n}\r\n\r\nfireUpTheCamera();\r\nwin.open();\r\n{code}\r\n ", "attachment": [ { "id": "42509", "filename": "log.txt", "author": { "name": "morahman", "key": "morahman", "displayName": "Motiur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "created": "2013-09-16T11:12:09.000+0000", "size": 636, "mimeType": "text/plain" } ], "flagged": false, "summary": "Android: Camera photos are not saving in Photo Gallery", "creator": { "name": "morahman", "key": "morahman", "displayName": "Motiur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "subtasks": [], "reporter": { "name": "morahman", "key": "morahman", "displayName": "Motiur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "environment": "Phone : Google Nexus One\r\nAndroid Version: 2.3.4\r\nKernel Version: 2.6.35.7\r\nBuild Number: 3.11.405.2", "comment": { "comments": [ { "id": "270734", "author": { "name": "morahman", "key": "morahman", "displayName": "Motiur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "body": "Hi Ingo Muschenetz,\n\nPlease check this code and try to fix this bug urgently cause it's important for our project.\n\nThanks", "updateAuthor": { "name": "morahman", "key": "morahman", "displayName": "Motiur Rahman", "active": true, "timeZone": "Asia/Dhaka" }, "created": "2013-09-11T06:42:01.000+0000", "updated": "2013-09-11T06:42:01.000+0000" }, { "id": "273358", "author": { "name": "sunila", "key": "sunila", "displayName": "Sunila", "active": true, "timeZone": "Asia/Kolkata" }, "body": "Since the 'useLegacyWindow' is false by default, the window that is created has it's own activity. Here the fireUpTheCamera is called before the window is created and the activity that is used to handle the callback after the photo is taken is associated with the main activity and not window activity. Only after the window is closed, the main activity resumes and callback is called to save the file. The code will work if the 'useLegacyWindow' is set to true or the 'showcamera' is called after the window is opened. Something like calling 'fireUpTheCamera' from a button click in the window.", "updateAuthor": { "name": "sunila", "key": "sunila", "displayName": "Sunila", "active": true, "timeZone": "Asia/Kolkata" }, "created": "2013-09-30T13:07:19.000+0000", "updated": "2013-09-30T13:07:19.000+0000" }, { "id": "273359", "author": { "name": "sunila", "key": "sunila", "displayName": "Sunila", "active": true, "timeZone": "Asia/Kolkata" }, "body": "Here is the code that works\n\n var win = Ti.UI.createWindow();\n\t \n\tfunction fireUpTheCamera() {\n\t Titanium.Media.showCamera({\n\t saveToPhotoGallery : true,\n\t allowEditing : false,\n\t autohide : false, //Important!\n\t mediaTypes : [Ti.Media.MEDIA_TYPE_PHOTO],\n\t success : function(event) {\n\t \n\t Ti.API.debug('Our type was: ' + event.mediaType);\n\t if (event.mediaType == Ti.Media.MEDIA_TYPE_PHOTO) {\n\t var imageView = Ti.UI.createImageView({\n\t width : win.width,\n\t height : win.height,\n\t image : event.media\n\t });\n\t win.add(imageView);\n\t \n\t } else {\n\t alert(\"got the wrong type back =\" + event.mediaType);\n\t }\n\t },\n\t cancel : function() {\n\t // called when user cancels taking a picture\n\t },\n\t error : function(error) {\n\t // called when there's an error\n\t var a = Titanium.UI.createAlertDialog({\n\t title : 'Camera'\n\t });\n\t if (error.code == Titanium.Media.NO_CAMERA) {\n\t a.setMessage('Please run this test on device');\n\t } else {\n\t a.setMessage('Unexpected error: ' + error.code);\n\t }\n\t a.show();\n\t },\n\t \n\t \n\t });\n\t}\n\t \n\t\n\t\n\twin.open();\n\tvar btnShowCamera = Ti.UI.createButton({\n\t\ttitle : 'Take picture',\n\t\twidth : 150,\n\t\theight : 70,\n\t\ttop : 50\n\t});\n\n\twin.add(btnShowCamera);\n\n\tbtnShowCamera.addEventListener('click', function(e) \n\t{\n\t\tfireUpTheCamera();\n\t});", "updateAuthor": { "name": "sunila", "key": "sunila", "displayName": "Sunila", "active": true, "timeZone": "Asia/Kolkata" }, "created": "2013-09-30T13:09:08.000+0000", "updated": "2013-09-30T13:09:08.000+0000" }, { "id": "273589", "author": { "name": "sunila", "key": "sunila", "displayName": "Sunila", "active": true, "timeZone": "Asia/Kolkata" }, "body": "I tried this on \n Google Nexus with Android 4.3 \n Google Nexus S with Android 4.1.2\n Motorola zoom tablet with Android 4.0.4\nand is working fine with the new code and I am able to reproduce the issue with the old code. I don't have a 2.3.4 version to test this.\n\n", "updateAuthor": { "name": "sunila", "key": "sunila", "displayName": "Sunila", "active": true, "timeZone": "Asia/Kolkata" }, "created": "2013-10-02T11:06:55.000+0000", "updated": "2013-10-02T11:06:55.000+0000" }, { "id": "416034", "author": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Closing", "updateAuthor": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2017-03-28T20:23:49.000+0000", "updated": "2017-03-28T20:23:49.000+0000" } ], "maxResults": 9, "total": 9, "startAt": 0 } } }