{ "id": "160696", "key": "TIMOB-23470", "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": [], "resolution": { "id": "3", "description": "The problem is a duplicate of an existing issue.", "name": "Duplicate" }, "resolutiondate": "2016-06-06T20:56:29.000+0000", "created": "2016-06-01T20:33:04.000+0000", "priority": { "name": "Critical", "id": "1" }, "labels": [ "Android", "data", "photo", "size" ], "versions": [], "issuelinks": [ { "id": "51962", "type": { "id": "10002", "name": "Duplicate", "inward": "is duplicated by", "outward": "duplicates" }, "outwardIssue": { "id": "155055", "key": "TIMOB-20439", "fields": { "summary": "Android: Using camera bloats app storage", "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" } }, "priority": { "name": "High", "id": "2" }, "issuetype": { "id": "1", "description": "A problem which impairs or prevents the functions of the product.", "name": "Bug", "subtask": false } } } } ], "assignee": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2017-03-22T21:59:42.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": "Taking photos and saving them outside of the applicationdatadirectoy is causing the data size of the app to grow even though no data is being saved to the app.\r\n\r\nTo reproduce, use the following code in app.js:\r\n\r\n{code:java}\r\nvar window = Titanium.UI.createWindow({\r\n\tbackgroundColor : 'white'\r\n});\r\n\r\nvar _storage = Ti.Filesystem.applicationDataDirectory;\r\nif (Ti.Filesystem.isExternalStoragePresent()) {\r\n\t_storage = 'file:///sdcard/';\r\n};\r\n\r\nvar folder = Ti.Filesystem.getFile(_storage, 'images/');\r\nif (!folder.exists()) {\r\n\tfolder.createDirectory();\r\n\tvar saveLocation = 'images/';\r\n};\r\n\r\nvar takePhoto = Titanium.UI.createButton({\r\n\ttitle : 'Open Camera',\r\n});\r\n\r\ntakePhoto.addEventListener('click', function(e) {\r\n\tvar timeInMs = Date.now();\r\n\tTitanium.Media.showCamera({\r\n\t\tshowControls : true,\r\n\t\tautorotate : false,\r\n\t\tsaveToPhotoGallery : false,\r\n\t\tsuccess : function(event) {\r\n\t\t\tvar image = event.media;\r\n\t\t\tvar file = Ti.Filesystem.getFile('file:///sdcard/images/', timeInMs + '.jpg');\r\n\t\t\tfile.write(image);\r\n\t\t},\r\n\t});\r\n\r\n});\r\n\r\nwindow.add(takePhoto);\r\nwindow.open({\r\n\tfullscreen : true\r\n});\r\n{code}\r\n\r\nRun the app and take not if the initial data size on the device.\r\n\r\nRepeatedly take photos and verify they are saved outside of the applicationdatadirectory in a folder called 'images'\r\n\r\nAs photos are taken and saved, the data size of the app will continue to grow, even though the images are not in the app.\r\n", "attachment": [], "flagged": false, "summary": "Android: Saving photos to external directory still causing app data size to grow", "creator": { "name": "jdbaron25", "key": "jdbaron25", "displayName": "Jeremy S", "active": true, "timeZone": "America/New_York" }, "subtasks": [], "reporter": { "name": "jdbaron25", "key": "jdbaron25", "displayName": "Jeremy S", "active": true, "timeZone": "America/New_York" }, "environment": "5.2.2 GA on Android", "comment": { "comments": [ { "id": "387409", "author": { "name": "nsalahin", "key": "nsalahin", "displayName": "Nazmus Salahin", "active": true, "timeZone": "Asia/Dhaka" }, "body": "Hello,\r\nI am able to reproduce this issue with given code and given steps.\r\n*Steps:*\r\n1. Create a default classic project for android with given code.\r\n2. Build and run the app on Android Device.\r\n3. Take note of initial size of the app from settings.\r\n[Screenshot| https://i.imgsafe.org/ff91a5e91d.png]\r\n4. Take some photos from the app by clicking {{OPEN CAMERA}}.\r\n5. Take note of the app size again. It is apparent that the app size is increased.\r\n[Screenshot| https://i.imgsafe.org/ff950169ce.png]\r\nThanks\r\n\r\n*Environment*:\r\n\r\n*Device info:* HTC One (android 4.4.3)\r\n*Node.js Version:* 0.12.7\r\n*npm Version:* 2.11.3\r\n*Titanium SDKs:* 5.4.0.v20160509133737\r\n*Java Development Kit Version:* 1.8.0_73\r\n*Titanium CLI Version:* 5.0.5\r\n*Appcelerator CLI Version:* 5.2.2\r\n*Appcelerator Studio:* 4.5.0", "updateAuthor": { "name": "nsalahin", "key": "nsalahin", "displayName": "Nazmus Salahin", "active": true, "timeZone": "Asia/Dhaka" }, "created": "2016-06-02T09:18:21.000+0000", "updated": "2016-06-02T09:18:21.000+0000" }, { "id": "387480", "author": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "body": "[~nsalahin] What happens when you press, `Clear Data` and `Clear Cache`?\r\nAnd can you try this on Android 6.0 as well?", "updateAuthor": { "name": "msamah", "key": "msamah", "displayName": "Ashraf Abu", "active": false, "timeZone": "Asia/Singapore" }, "created": "2016-06-03T02:50:14.000+0000", "updated": "2016-06-03T02:57:14.000+0000" }, { "id": "387692", "author": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "updateAuthor": { "name": "hpham", "key": "hpham", "displayName": "Hieu Pham", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2016-06-06T20:56:14.000+0000", "updated": "2016-06-06T20:56:14.000+0000" }, { "id": "415069", "author": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "body": "Closing ticket as duplicate and links to the related ticket has been provided above.", "updateAuthor": { "name": "lmorris", "key": "lmorris", "displayName": "Lee Morris", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2017-03-22T21:59:42.000+0000", "updated": "2017-03-22T21:59:42.000+0000" } ], "maxResults": 4, "total": 4, "startAt": 0 } } }