{ "id": "84896", "key": "TIMOB-7188", "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": "12094", "description": "", "name": "Sprint 2012-02", "archived": true, "released": true, "releaseDate": "2012-01-29" }, { "id": "12593", "name": "Release 2.0.0", "archived": false, "released": true, "releaseDate": "2012-03-30" }, { "id": "12677", "description": "Release 1.8 Service Pack 1", "name": "Release 1.8.1", "archived": true, "released": true, "releaseDate": "2012-01-31" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2012-01-23T16:47:13.000+0000", "created": "2012-01-14T15:34:33.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "module_media", "qe-testadded", "regression" ], "versions": [ { "id": "12580", "description": "Dual Runtime 1.8.0", "name": "Release 1.8.0.1", "archived": true, "released": true, "releaseDate": "2011-12-22" } ], "issuelinks": [], "assignee": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "updated": "2012-02-01T12:18:54.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": "Ti.Media.takeScreenshot and Ti.Media.previewImage are commented out inside MediaModule.java since 1.8.0.1. We need investigate why (if any reason) and re-enable these. Documentation should be updated with the addition of these methods.", "attachment": [], "flagged": false, "summary": "Android: Media module methods takeScreenshot and previewImage not implemented in 1.8.0.1", "creator": { "name": "opiecyrus", "key": "opiecyrus", "displayName": "Opie Cyrus", "active": true, "timeZone": "America/Chicago" }, "subtasks": [], "reporter": { "name": "opiecyrus", "key": "opiecyrus", "displayName": "Opie Cyrus", "active": true, "timeZone": "America/Chicago" }, "environment": null, "comment": { "comments": [ { "id": "179749", "author": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "body": "h3. Test app\r\n\r\nThis test app exercises both {{takeScreenshot}} and {{previewImage}}. Create a new Titanium app and replace its app.js contents with the following. When you click the button it will take a screenshot then call {{previewImage}} to show the saved screenshot image.\r\n\r\n{code:title=app.js}\r\nTitanium.UI.setBackgroundColor('#000');\r\nvar win = Titanium.UI.createWindow({ \r\n title:'Test',\r\n backgroundColor:'#000',\r\n\texitOnClose: true\r\n});\r\n\r\nwin.add(Ti.UI.createLabel({\r\n\tbackgroundColor: \"blue\",\r\n\tcolor: \"yellow\",\r\n\ttext: \"Hello There\",\r\n\ttextAlign: \"center\",\r\n\tleft: \"10dp\", right: \"10dp\", top: \"5dp\", height: \"40dp\"\r\n}));\r\n\r\nwin.add(Ti.UI.createImageView({\r\n\theight: \"43dp\", width: \"46dp\",\r\n\timage: \"KS_nav_ui.png\", top: \"100dp\"\r\n}));\r\n\r\nvar btn;\r\nwin.add(btn = Ti.UI.createButton({\r\n\ttitle: \"Take screenshot\",\r\n\tbottom: \"5dp\", height: \"40dp\",\r\n\tleft: \"50dp\", right: \"50dp\"\r\n}));\r\n\r\nfunction previewCallback(args) {\r\n\tTi.API.info(\"previewImage success\");\r\n}\r\n\r\nfunction previewError(e) {\r\n\talert(\"previewImage failure: \" + e.message);\r\n\tTi.API.error(e.message);\r\n}\r\n\r\nfunction screenshotCallback(image) {\r\n\tif (!image) {\r\n\t\talert(\"Eeks, takeScreenshot didn't return anything.\");\r\n\t\treturn;\r\n\t} else {\r\n\t\tvar blob = image.media;\r\n\t\tif (!blob) {\r\n\t\t\talert(\"Eeks, there was no useful 'media' member of the passed result dictionary.\");\r\n\t\t\treturn;\r\n\t\t}\r\n\t\tif (Ti.Platform.osname === \"android\") {\r\n\t\t\tTi.API.info(\"Got an image blob back from takeScreenshot. Gonna store it and preview it.\");\r\n\t\t\tvar tempdir = Ti.Filesystem.tempDirectory;\r\n\t\t\tvar file = Ti.Filesystem.getFile(Ti.Filesystem.externalStorageDirectory, \"temp.png\");\r\n\t\t\tif (file.exists()) {\r\n\t\t\t\tfile.deleteFile();\r\n\t\t\t}\r\n\t\t\tfile.write(blob);\r\n\t\t\tTi.Media.previewImage({\r\n\t\t\t\tsuccess: previewCallback,\r\n\t\t\t\terror: previewError,\r\n\t\t\t\timage: file.read()\r\n\t\t\t});\r\n\t\t} else {\r\n\t\t\talert(\"Call to takeScreenshot successful. Got a blob back.\");\r\n\t\t}\r\n\t}\r\n}\r\n\r\nbtn.addEventListener(\"click\", function() {\r\n\tTi.Media.takeScreenshot(screenshotCallback);\r\n});\r\n\r\nwin.open();\r\n{code}", "updateAuthor": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "created": "2012-01-18T11:58:32.000+0000", "updated": "2012-01-18T11:58:32.000+0000" }, { "id": "179751", "author": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "body": "Pull request ready:\r\n\r\nhttps://github.com/appcelerator/titanium_mobile/pull/1208", "updateAuthor": { "name": "billdawson", "key": "billdawson", "displayName": "Bill Dawson", "active": true, "timeZone": "Europe/Berlin" }, "created": "2012-01-18T12:00:49.000+0000", "updated": "2012-01-18T12:00:49.000+0000" }, { "id": "179977", "author": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified fixed with SDK 1.9.0.v20120119134634 on Nexus S (2.3.6) and emulator 2.3.1", "updateAuthor": { "name": "emerriman", "key": "emerriman", "displayName": "Eric Merriman ", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-01-19T17:14:00.000+0000", "updated": "2012-01-19T17:14:00.000+0000" }, { "id": "181385", "author": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "body": "updated labels", "updateAuthor": { "name": "wluu", "key": "wluu", "displayName": "Wilson Luu", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2012-02-01T12:18:54.000+0000", "updated": "2012-02-01T12:18:54.000+0000" } ], "maxResults": 5, "total": 5, "startAt": 0 } } }