{ "id": "109122", "key": "TIMOB-12565", "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": "14162", "description": "Release 3.1.0", "name": "Release 3.1.0", "archived": true, "released": true, "releaseDate": "2013-04-16" }, { "id": "15273", "description": "2013 Sprint 05 API", "name": "2013 Sprint 05 API", "archived": true, "released": true, "releaseDate": "2013-03-11" }, { "id": "14815", "description": "2013 Sprint 05", "name": "2013 Sprint 05", "archived": true, "released": true, "releaseDate": "2013-03-11" } ], "resolution": { "id": "1", "description": "A fix for this issue is checked into the tree and tested.", "name": "Fixed" }, "resolutiondate": "2013-03-23T01:18:28.000+0000", "created": "2013-02-04T19:15:37.000+0000", "priority": { "name": "High", "id": "2" }, "labels": [ "SupportTeam", "parity", "qe-closed-3.1.0", "qe-testadded" ], "versions": [ { "id": "13505", "description": "Release 3.0.0", "name": "Release 3.0.0", "archived": true, "released": true, "releaseDate": "2012-12-14" } ], "issuelinks": [], "assignee": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "updated": "2013-10-04T10:40:35.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": "*Problem description*\r\nTitanium.Contacts.Person.getBirthday() returns null for a contact on Android, works fine on iOS.\r\n\r\n*Test case*\r\n{code}\r\nvar tabGroup = Titanium.UI.createTabGroup();\r\n\r\nvar win = Titanium.UI.createWindow({\r\n\tbackgroundColor : \"#fff\",\r\n\ttabBarHidden : true\r\n});\r\n\r\nvar tab1 = Titanium.UI.createTab({\r\n\ttitle : 'Tab 1',\r\n\twindow : win\r\n});\r\n\r\nvar android = (Ti.Platform.osname === 'android');\r\n\r\nvar activityIndicator;\r\nif (android) {\r\n\tactivityIndicator = Ti.UI.createActivityIndicator({\r\n\t\tmessage : 'Loading all contacts, please wait...'\r\n\t});\r\n\tactivityIndicator.show();\r\n}\r\n\r\nvar makeTable = function() {\r\n\tTi.API.info(\"Making table...\");\r\n\tvar people = Titanium.Contacts.getAllPeople();\r\n\tvar rows = [];\r\n\tfor (var i = 0; i < people.length; i++) {\r\n\t\tTi.API.info(\"People object is: \" + people[i]);\r\n\t\tvar title = people[i].fullName;\r\n\t\tif (!title || title.length === 0) {\r\n\t\t\ttitle = \"(no name)\";\r\n\t\t}\r\n\t\trows[i] = Ti.UI.createTableViewRow({\r\n\t\t\ttitle : title,\r\n\t\t\tperson : people[i],\r\n\t\t\thasChild : true\r\n\t\t});\r\n\t\trows[i].addEventListener('click', function(e) {\r\n\t\t\tvar display = Ti.UI.createWindow({\r\n\t\t\t\tbackgroundColor : 'white',\r\n\t\t\t\ttitle : e.row.person.fullName\r\n\t\t\t});\r\n\t\t\tdisplay.add(Ti.UI.createLabel({\r\n\t\t\t\ttext : \"Birthday: \" + e.row.person.getBirthday()\r\n\t\t\t}));\r\n\t\t\ttab1.open(display, {\r\n\t\t\t\tanimated : true\r\n\t\t\t});\r\n\t\t});\r\n\t}\r\n\treturn rows;\r\n};\r\n\r\nvar tableview = Ti.UI.createTableView({\r\n\tdata : makeTable()\r\n});\r\n\r\nwin.add(tableview);\r\n\r\nif (android && activityIndicator) {\r\n\tactivityIndicator.hide();\r\n}\r\n\r\ntabGroup.addTab(tab1);\r\ntabGroup.open();\r\n{code}\r\n\r\n*Native example*\r\n{code}\r\nprivate String getBirthday2(long contactId) {\r\n // read birthday\r\n Cursor c = getContentResolver().query(\r\n Data.CONTENT_URI,\r\n new String[] { Event.DATA },\r\n Data.CONTACT_ID + \"=\" + contactId + \" AND \" + Data.MIMETYPE + \"= '\" + Event.CONTENT_ITEM_TYPE + \"' AND \"\r\n + Event.TYPE + \"=\" + Event.TYPE_BIRTHDAY, null, Data.DISPLAY_NAME);\r\n if (c != null) {\r\n try {\r\n if (c.moveToFirst()) {\r\n return c.getString(0);\r\n }\r\n } finally {\r\n c.close();\r\n }\r\n }\r\n throw new IllegalStateException();\r\n }\r\n{code}\r\n\r\n*Native discussion*\r\nhttp://stackoverflow.com/questions/8579883/get-birthday-for-each-contact-in-android-application\r\nhttp://stackoverflow.com/questions/2396975/what-is-the-fieldname-to-store-a-birthday-for-a-contact-entry\r\n\r\n*Community discussion*\r\nhttp://developer.appcelerator.com/question/123848/coud-not-retrieve-birthday-from-picked-contact", "attachment": [], "flagged": false, "summary": "Android: Not possible to retrieve birthday for contact", "creator": { "name": "dsefton", "key": "dsefton", "displayName": "Daniel Sefton", "active": true, "timeZone": "America/Los_Angeles" }, "subtasks": [], "reporter": { "name": "dsefton", "key": "dsefton", "displayName": "Daniel Sefton", "active": true, "timeZone": "America/Los_Angeles" }, "environment": null, "comment": { "comments": [ { "id": "241094", "author": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "body": "PR: https://github.com/appcelerator/titanium_mobile/pull/3940", "updateAuthor": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-03-07T02:33:37.000+0000", "updated": "2013-03-07T02:33:37.000+0000" }, { "id": "243382", "author": { "name": "amittal", "key": "amittal", "displayName": "Anshu Mittal", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Tested with: \r\nSDK:3.1.0.v20130319222852\r\nStudio: 3.1.0.201303091040\r\nDevice: Samsung Galaxy note(2.3.6)\r\n\r\nOn Android, Titanium.Contacts.Person.getBirthday() still returns undefined", "updateAuthor": { "name": "amittal", "key": "amittal", "displayName": "Anshu Mittal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-03-21T10:33:47.000+0000", "updated": "2013-03-21T10:33:47.000+0000" }, { "id": "243454", "author": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Anshu, can you check if the contacts have already had the birthday set in the phone? If no birthday is set to the contact, it will surely return undefined.", "updateAuthor": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-03-21T17:54:52.000+0000", "updated": "2013-03-21T17:54:52.000+0000" }, { "id": "243632", "author": { "name": "amittal", "key": "amittal", "displayName": "Anshu Mittal", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Yes, I created a contact and added b'dayto this contact to verify this bug but still returned undefined.", "updateAuthor": { "name": "amittal", "key": "amittal", "displayName": "Anshu Mittal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-03-22T06:34:32.000+0000", "updated": "2013-03-22T06:34:32.000+0000" }, { "id": "243696", "author": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Hi Anshu, this PR was merged on 3/20/2013. You used the SDK from 3/19/2013 so you can still reproduce the issue. Can you use the latest SDK to test again?", "updateAuthor": { "name": "pwang", "key": "pwang", "displayName": "Ping Wang", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-03-22T16:54:49.000+0000", "updated": "2013-03-22T16:54:49.000+0000" }, { "id": "243801", "author": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "body": "[~amittal] please retest this and reopen it if you are still seeing it with the latest sdk.", "updateAuthor": { "name": "ayeung", "key": "ayeung", "displayName": "Allen Yeung", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-03-23T01:18:19.000+0000", "updated": "2013-03-23T01:18:19.000+0000" }, { "id": "247017", "author": { "name": "amittal", "key": "amittal", "displayName": "Anshu Mittal", "active": true, "timeZone": "America/Los_Angeles" }, "body": "Tested with:\r\nSDK: 3.1.0.v20130409124549\r\nStudio:3.1.0.201304011603\r\nDevice: Samsung galaxy note(v 2.3.6)\r\nOS: OSX 10.7.5\r\n\r\nworks as expected", "updateAuthor": { "name": "amittal", "key": "amittal", "displayName": "Anshu Mittal", "active": true, "timeZone": "America/Los_Angeles" }, "created": "2013-04-11T06:57:49.000+0000", "updated": "2013-04-11T06:57:49.000+0000" } ], "maxResults": 7, "total": 7, "startAt": 0 } } }