{ "id": "118235", "key": "TIMOB-14806", "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": "15707", "description": "2013 Sprint 23", "name": "2013 Sprint 23", "archived": true, "released": true, "releaseDate": "2013-11-15" }, { "id": "15715", "description": "2013 Sprint 25", "name": "2013 Sprint 25", "archived": true, "released": true, "releaseDate": "2013-12-13" }, { "id": "15718", "description": "2013 Sprint 25 Tooling", "name": "2013 Sprint 25 Tooling", "archived": true, "released": true, "releaseDate": "2013-12-13" }, { "id": "14982", "description": "Release 3.2.0", "name": "Release 3.2.0", "archived": false, "released": true, "releaseDate": "2013-12-19" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2014-02-13T21:25:41.000+0000", "created": "2013-08-10T01:38:09.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "qe-3.1.2", "qe-closed-3.2.0", "qe-testadded" ], "versions": [ { "id": "15479", "description": "Release 3.1.2", "name": "Release 3.1.2", "archived": true, "released": true, "releaseDate": "2013-07-31" } ], "issuelinks": [], "assignee": { "name": "csullivan", "key": "csullivan", "displayName": "Christian Sullivan", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2016-11-29T11:48:30.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" }, { "id": "12803", "name": "Templates", "description": "Templates for Titanium Mobile" } ], "description": "h5. Problem description\r\n\r\nIn Appcelerator Studio template samples for classic projects, the values used as comparison to determine if the device is a tablet or a handheld are outdated and could lead to a wrong detection. \r\n\r\nh5. Steps to reproduce\r\nCreate a new Single Window Project and open app.js. Check line:\r\n{code}\r\nvar isTablet = osname === 'ipad' || (osname === 'android' && (width > 899 || height > 899));\r\n{code}\r\n\r\nA Google Galaxy Nexus device (for example) has those values:\r\n{code}\r\nheight: 1184 width: 720\r\n{code}\r\n\r\nAs a result, it is being detected as a 'tablet' while is a 'handheld' device.", "attachment": [], "flagged": false, "summary": "ProjectTemplate: values used as comparison to determine device form factor are wrong", "creator": { "name": "fcasali", "key": "fcasali", "displayName": "Federico Casali", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "fcasali", "key": "fcasali", "displayName": "Federico Casali", "active": true, "timeZone": "America/Los_Angeles" }, "environment": "Titanium SDK 3.1.2.v20130808180613 \r\nAlloy 1.2.0-alpha6\r\nAppcelerator Studio 3.1.2.201308082014\r\nCLI 3.1.2-alpha\r\nNode 0.10.13", "closedSprints": [ { "id": 24, "state": "closed", "name": "2013 Sprint 25", "startDate": "2013-12-02T22:12:56.347Z", "endDate": "2013-12-15T22:12:56.347Z", "completeDate": "2013-12-16T16:59:16.390Z" } ], "comment": { "comments": [ { "id": "274871", "author": { "name": "csullivan", "key": "csullivan", "displayName": "Christian Sullivan", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PRs to [MASTER]\r\n\r\nhttps://github.com/appcelerator-developer-relations/Template.Tabbed/pull/6\r\nhttps://github.com/appcelerator-developer-relations/Template.SingleWindow/pull/3\r\nhttps://github.com/appcelerator-developer-relations/Template.MasterDetail/pull/3\r\nhttps://github.com/appcelerator-developer-relations/Sample.Todo/pull/7\r\nhttps://github.com/appcelerator-developer-relations/Sample.Mapping/pull/7", "updateAuthor": { "name": "csullivan", "key": "csullivan", "displayName": "Christian Sullivan", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-10-11T23:46:19.000+0000", "updated": "2013-10-11T23:56:08.000+0000" }, { "id": "276328", "author": { "name": "djha", "key": "djha", "displayName": "Dhirendra Jha", "active": true, "timeZone": "America/Los_Angeles" }, "body": "This issue is still reproducible. Still shows the below line in app.js file. Hence reopening this issue.\n\n{code}\nvar isTablet = osname === 'ipad' || (osname === 'android' && (width > 899 || height > 899));\n{code}\n\nTest Environment - \nAppc Studio - 3.2.0.201310230601\nSDK - 3.2.0.v20131022171645\nacs -1.0.7\nalloy - 1.2.2\ntitanium - 3.2.0\ntitanium-code-processor - 1.0.3\nXcode - 5.0.1\nOS - Mac OS X Mavericks (10.9)", "updateAuthor": { "name": "djha", "key": "djha", "displayName": "Dhirendra Jha", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-10-23T10:40:47.000+0000", "updated": "2013-10-23T10:40:47.000+0000" }, { "id": "279910", "author": { "name": "mxia", "key": "mxia", "displayName": "Michael Xia", "active": true, "timeZone": "America/Los_Angeles" }, "body": "The PR is merged, and the new template is updated in the Studio ruble.\r\n", "updateAuthor": { "name": "mxia", "key": "mxia", "displayName": "Michael Xia", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-11-15T23:19:24.000+0000", "updated": "2013-11-15T23:19:24.000+0000" }, { "id": "280076", "author": { "name": "sdowse", "key": "sdowse", "displayName": "Samuel Dowse", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified fixed on:\nMac OSX 10.9 Mavericks\nTitanium Studio, build: 3.2.0.201311160316\nTitanium SDK, build: 3.2.0.v20131118142443\nCLI: 3.2.0-alpha\nAlloy: 1.3.0\n\napp.js by default shows:\nvar isTablet = osname === 'ipad' || (osname === 'android' && (width > 720) && (height > 600));\n\nClosing.", "updateAuthor": { "name": "sdowse", "key": "sdowse", "displayName": "Samuel Dowse", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-11-18T23:21:04.000+0000", "updated": "2013-11-18T23:21:04.000+0000" }, { "id": "280077", "author": { "name": "lokeshchdhry", "key": "lokeshchdhry", "displayName": "Lokesh Choudhary", "active": false, "timeZone": "America/Los_Angeles" }, "body": "I don't get it. A Samsung Galaxy S4 has height:1920 & width:1080 which according to the fix will be considered as a tablet whereas its a handheld device.\r\nReopening.\r\n\r\nEnvironment:\r\nAppcel Studio : 3.2.0.201311161724\r\nTi SDK : 3.2.0.v20131117001643\r\nMac OSX : 10.8.5\r\nAlloy : 1.3.0\r\nCLI - 3.2.0-alpha\r\nDevice: Samsung Galaxy S4 running android 4.2.2", "updateAuthor": { "name": "lokeshchdhry", "key": "lokeshchdhry", "displayName": "Lokesh Choudhary", "active": false, "timeZone": "America/Los_Angeles" }, "created": "2013-11-18T23:21:26.000+0000", "updated": "2013-11-18T23:22:11.000+0000" }, { "id": "280433", "author": { "name": "csullivan", "key": "csullivan", "displayName": "Christian Sullivan", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~mxia] [~ingo] So what is the agreed parameters of a tablet? The lager devices may be handhelds, but they are considered Phablets which falls in between phone and tablet. ", "updateAuthor": { "name": "csullivan", "key": "csullivan", "displayName": "Christian Sullivan", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-11-20T23:51:39.000+0000", "updated": "2013-11-27T23:08:27.000+0000" }, { "id": "282057", "author": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Use the code here:\n\nhttps://github.com/appcelerator/alloy/blob/7ca0be6f142046f328b6b911b28fa3117501e14d/Alloy/lib/alloy.js#L449\n\nWhich is basically the same as here:\n\nhttp://stackoverflow.com/questions/16784101/how-to-find-tablet-or-phone-in-android-programmatically", "updateAuthor": { "name": "ingo", "key": "ingo", "displayName": "Ingo Muschenetz", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-12-03T04:29:39.000+0000", "updated": "2013-12-03T04:29:39.000+0000" }, { "id": "282336", "author": { "name": "csullivan", "key": "csullivan", "displayName": "Christian Sullivan", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PRs: \nhttps://github.com/appcelerator-developer-relations/Template.MasterDetail/pull/4\nhttps://github.com/appcelerator-developer-relations/Template.Tabbed/pull/8\nhttps://github.com/appcelerator-developer-relations/Template.SingleWindow/pull/4", "updateAuthor": { "name": "csullivan", "key": "csullivan", "displayName": "Christian Sullivan", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-12-04T02:12:17.000+0000", "updated": "2013-12-04T02:12:17.000+0000" }, { "id": "284630", "author": { "name": "sdowse", "key": "sdowse", "displayName": "Samuel Dowse", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Verified fixed on:\nMac OSX 10.9 Mavericks\nTitanium Studio, build: 3.2.0.201312142258\nTitanium SDK, build: 3.2.0.v20131216064236\nCLI: 3.2.0-cr3\nAlloy: 1.3.0-cr\nAndroid Phone: Galaxy S4 (4.2.2)\nScreen Resolution: 1920x1080\n\nUsed \"Master Detail\" classic application.\nUsed the following code \n{code}\n function checkTablet() {\n var platform = Ti.Platform.osname;\n\n switch (platform) {\n case 'ipad':\n return true;\n case 'android':\n var psc = Ti.Platform.Android.physicalSizeCategory;\n var tiAndroid = Ti.Platform.Android;\n return psc === tiAndroid.PHYSICAL_SIZE_CATEGORY_LARGE || psc === tiAndroid.PHYSICAL_SIZE_CATEGORY_XLARGE;\n default:\n return Math.min(\n Ti.Platform.displayCaps.platformHeight,\n Ti.Platform.displayCaps.platformWidth\n ) >= 400\n }\n }\n\n var isTablet = checkTablet();\n console.log(isTablet);\n{code}\nCode verified that the device was infact a phone despite the large screen resolution.\nClosing", "updateAuthor": { "name": "sdowse", "key": "sdowse", "displayName": "Samuel Dowse", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-12-17T00:31:39.000+0000", "updated": "2013-12-17T00:31:39.000+0000" } ], "maxResults": 12, "total": 12, "startAt": 0 } } }