{ "id": "63589", "key": "TIMOB-2957", "fields": { "issuetype": { "id": "2", "description": "A new feature of the product, which has yet to be developed.", "name": "New Feature", "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": [], "resolution": { "id": "2", "description": "The problem described is an issue which will never be fixed.", "name": "Won't Fix" }, "resolutiondate": "2013-01-14T10:35:31.000+0000", "created": "2011-04-15T03:33:43.000+0000", "priority": { "name": "Medium", "id": "3" }, "labels": [], "versions": [ { "id": "11233", "name": "Release 1.6.0", "archived": true, "released": true, "releaseDate": "2011-02-23" } ], "issuelinks": [], "assignee": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-22T17:22:38.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": "{html}

Problem

\r\n

On the incredible there is no external data storage so when I\r\nwrote a file I need the ability to set the privilege on it so it\r\ncan be accessed by another activity not belonging to my app\r\n(Context.MODE_WORLD_READABLE).

\r\n

Solution

\r\n

Expose MODE_WORLD_READABLE through the Ti.Filesystem module on\r\nAndroid. I will ask the enterprise client to post more information\r\non their preference for this exposure.

\r\n

Associated Helpdesk Ticket

\r\n

http://appc.me/c/NCI-43191-678

{html}", "attachment": [], "flagged": false, "summary": "Android: Expose MODE_WORLD_READABLE", "creator": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "subtasks": [], "reporter": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "environment": null, "comment": { "comments": [ { "id": "129766", "author": { "name": "andreassandberg", "key": "andreassandberg", "displayName": "Andreas sandberg", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Adding some kind of permission property on to the object\nTitanium.Filesystem.File would work for me. Thanks!

{html}", "updateAuthor": { "name": "andreassandberg", "key": "andreassandberg", "displayName": "Andreas sandberg", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:33:44.000+0000", "updated": "2011-04-15T03:33:44.000+0000" }, { "id": "129767", "author": { "name": "andreassandberg", "key": "andreassandberg", "displayName": "Andreas sandberg", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Any chance we can get this moved into 1.7?

{html}", "updateAuthor": { "name": "andreassandberg", "key": "andreassandberg", "displayName": "Andreas sandberg", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:33:44.000+0000", "updated": "2011-04-15T03:33:44.000+0000" }, { "id": "129768", "author": { "name": "dthorp", "key": "dthorp", "displayName": "Don Thorp", "active": true, "timeZone": "America/Los_Angeles" }, "body": "{html}

Opie, this needs to be considered for our spec as appropriate.\nI'm assigning it to S12 so that it can scoped wrt the spec. We will\ndo the work once the spec has been approved. Please move it back\ninto the new state once you update the spec and this ticket with\nany pertinent information.

{html}", "updateAuthor": { "name": "dthorp", "key": "dthorp", "displayName": "Don Thorp", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-04-15T03:33:44.000+0000", "updated": "2011-04-15T03:33:44.000+0000" }, { "id": "129769", "author": { "name": "opiecyrus", "key": "opiecyrus", "displayName": "Opie Cyrus", "active": true, "timeZone": "America/Chicago" }, "body": "{html}

This item was taken into consideration for the stream spec and\nshould be moved to another milestone I think where it can be\ngrouped with the stream implementation. Assigning back to Don for\nplacement.

{html}", "updateAuthor": { "name": "opiecyrus", "key": "opiecyrus", "displayName": "Opie Cyrus", "active": true, "timeZone": "America/Chicago" }, "created": "2011-04-15T03:33:45.000+0000", "updated": "2011-04-15T03:33:45.000+0000" }, { "id": "165892", "author": { "name": "jalter", "key": "jalter", "displayName": "Jon Alter", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Need use and repro case for this to move forward.", "updateAuthor": { "name": "jalter", "key": "jalter", "displayName": "Jon Alter", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-09-13T14:15:12.000+0000", "updated": "2011-09-13T16:47:31.000+0000" }, { "id": "165939", "author": { "name": "jalter", "key": "jalter", "displayName": "Jon Alter", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Updated example from helpdesk ticket. It is possible to successfully run the updated example without this fix on a device that does not have an sd card. Must have a pdf reader installed, Adobe Reader for example.\r\n\r\n{code:title=app.js}\r\nvar win = Ti.UI.createWindow({\r\n\tnavBarHidden: true,\r\n\tbackgroundColor: 'blue'\r\n});\r\nwin.open();\r\n\r\nvar button = Ti.UI.createButton({\r\n\ttitle: 'Get PDF',\r\n\theight: 50,\r\n\twidth: 200,\r\n\ttop: 20\r\n});\r\nwin.add(button);\r\nbutton.addEventListener('click', function(e) {\r\n\tvar xhr = Ti.Network.createHTTPClient();\r\n\txhr.onload = function() {\r\n\t\tvar f = Ti.Filesystem.getFile(Titanium.Filesystem.externalStorageDirectory,\"test.pdf\");\r\n\t\tf.write(this.responseData);\r\n\t\tvar intent = Ti.Android.createIntent({\r\n\t\t\taction : Ti.Android.ACTION_VIEW,\r\n\t\t\ttype : 'application/pdf',\r\n\t\t\tdata : f.getNativePath()\r\n\t\t});\r\n\t\tTi.Android.currentActivity.startActivity(intent);\r\n\t};\r\n\r\n\txhr.open(\"GET\", \"http://www.appcelerator.com/assets/The_iPad_App_Wave.pdf\");\r\n\txhr.send();\r\n});\r\n{code}\r\n\r\nh4. Tested with \r\nTiSDK 1.7.3.v20110826161351\r\nNexus S, 2.3.4", "updateAuthor": { "name": "jalter", "key": "jalter", "displayName": "Jon Alter", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2011-09-13T17:02:51.000+0000", "updated": "2011-09-13T17:04:46.000+0000" }, { "id": "171532", "author": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "body": "When developers explicitly create files (via the documented Ti.Filesystem.createFile), let them pass in an argument for mode world readable. That would address this issue. If they want to make a file world readable that already exists, their JavaScript can copy it in to a new file that has been created properly.\r\n\r\n{code:title=app.js}\r\nvar xhr = Ti.Network.createHTTPClient({\r\n onload: function() {\r\n var f = Ti.Filesystem.getFile('test.pdf');\r\n f.createFile({\r\n mode: Ti.Android.MODE_WORLD_READABLE\r\n });\r\n f.write(this.responseData);\r\n var intent = Ti.Android.createIntent({\r\n action: Ti.Android.ACTION_VIEW,\r\n type: 'application/pdf',\r\n data: f.getNativePath()\r\n });\r\n Ti.Android.currentActivity.startActivity(intent);\r\n }\r\n});\r\nxhr.open('GET', 'http://www.appcelerator.com/assets/The_iPad_App_Wave.pdf');\r\nxhr.send();\r\n{code}", "updateAuthor": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "created": "2011-11-04T13:04:55.000+0000", "updated": "2011-11-04T13:04:55.000+0000" }, { "id": "182851", "author": { "name": "tomazi", "key": "tomazi", "displayName": "Tom A", "active": true, "timeZone": "America/Los_Angeles" }, "body": "TypeError: Object File has no method 'createFile'\r\n(tested with Nexus S Android 4.0.3, Ti SDK 1.8.1)\r\n\r\nWould be useful to have this feature. Am I doing it wrong or is this just not resolved yet?\r\n\r\nAny update on the status would be much appreciated.\r\n", "updateAuthor": { "name": "tomazi", "key": "tomazi", "displayName": "Tom A", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2012-02-11T18:28:42.000+0000", "updated": "2012-02-11T18:32:55.000+0000" }, { "id": "234173", "author": { "name": "vjoshi", "key": "vjoshi", "displayName": "Varun Joshi", "active": true, "timeZone": "America/New_York" }, "body": "Found this link: http://developer.android.com/reference/android/content/Context.html#MODE_WORLD_READABLE\n\nGoogle has deprecated this constant since API Level 17 and the use of this constant is strongly discouraged due to certain security issues as mentioned in above link.\n", "updateAuthor": { "name": "vjoshi", "key": "vjoshi", "displayName": "Varun Joshi", "active": true, "timeZone": "America/New_York" }, "created": "2013-01-14T10:32:23.000+0000", "updated": "2013-01-14T10:32:23.000+0000" }, { "id": "234174", "author": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "body": "Shak, please look at my accepted answer on that Q&A. The code you've pasted won't help you, and it's already fixed in platform.", "updateAuthor": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "created": "2013-01-14T10:33:12.000+0000", "updated": "2013-01-14T10:33:12.000+0000" }, { "id": "234176", "author": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Marking as won't fix based on Varun's link.", "updateAuthor": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-01-14T10:35:31.000+0000", "updated": "2013-01-14T10:35:31.000+0000" }, { "id": "234180", "author": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "body": "\"Won't fix\" doesn't help the customers very much. This is a legit issue for them, and \"mode_world_readable\" was only one solution.\r\n\r\nBased on the link and my very limited understanding, the customer would need to be able to create their own ContentProviders. Right? Or, someone could write a module (ie the module team) that exposes a static file ContentProvider. The app inits the module with a directory, and we're off.", "updateAuthor": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "created": "2013-01-14T10:42:28.000+0000", "updated": "2013-01-14T10:42:42.000+0000" }, { "id": "234485", "author": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "body": "It doesn't matter to me. If it matters to Shak, he can do so.", "updateAuthor": { "name": "dtoth", "key": "dtoth", "displayName": "Dawson Toth", "active": true, "timeZone": "America/New_York" }, "created": "2013-01-15T15:47:29.000+0000", "updated": "2013-01-15T15:47:29.000+0000" }, { "id": "414785", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as the issue will not fix and with reference to the above comments.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-22T17:22:38.000+0000", "updated": "2017-03-22T17:22:38.000+0000" } ], "maxResults": 19, "total": 19, "startAt": 0 } } }