Titanium JIRA Archive
Appcelerator Community (AC)

[AC-3585] Android: Ti.Contacts.getAllPeople() has noticeably slow performance

GitHub Issuen/a
TypeBug
Priorityn/a
StatusClosed
ResolutionDuplicate
Resolution Date2016-05-10T17:40:27.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsTitanium SDK & CLI
Labelsn/a
ReporterKiley Williams
AssigneeShak Hossain
Created2016-05-03T01:14:49.000+0000
Updated2018-11-11T12:04:47.000+0000

Description

Comments

  1. Kiley Williams 2016-05-03

    I suspect the performance issue on Android >= 6 devices might have to do with what is breaking for Android < 6 devices.
  2. Nazmus Salahin 2016-05-04

    Hello, I am able to reproduce this issue with given code and given step. Android device takes almost 7 seconds to process a contact list of 3,000 contacts on the device for the command Ti.Contacts.getAllPeople(). *Steps:* 1. Create a dummy csv file of contacts from this [link](http://www.convertcsv.com/generate-test-data.htm). 2. Import the contact list on Android device. 3. Create a default classic project with following code.
       var win1=Titanium.UI.createWindow({
       	title:'Tab 1',backgroundColor:'#fff'
       });
       var label=Ti.UI.createLabel({
       	color:'blue',text:'Get Contacts',top:30,width:300,height:200
       });
       win1.add(label);
       win1.open();
       label.addEventListener("click", function(e) {
       	var contactsAuthorizationValue=Ti.Contacts.getContactsAuthorization();
       	
       	if(contactsAuthorizationValue===Ti.Contacts.AUTHORIZATION_AUTHORIZED) {
       		Ti.API.log("starting to take contacts");
       		var rawContacts=Ti.Contacts.getAllPeople();
       		Ti.API.log("Done");
       	}
       });
       
       
    4. Build and run the app on android device. 5. Click the label. >> In console log it comes "starting to take contacts" and after almost 7 seconds comes the log "Done". Thanks *Environment*: *Device info:* HTC One (Android 4.4.3) *Node.js Version:* 0.12.7 *npm Version:* 2.11.3 *Titanium SDKs:* 5.2.2.GA and 5.2.1.GA *Java Development Kit Version:* 1.8.0_73 *Titanium CLI Version:* 5.0.5 *Appcelerator CLI Version:* 5.2.2 *Appcelerator Studio:* 4.5.0
  3. Sharif AbuDarda 2016-05-10

  4. said chaouche 2018-11-11

    Hi, the problem is still here on SDK 7.4.x and 7.5.x, Ti.Contacts.getAllPeople() take more than 7 seconde to read 4000 contacts Any workaround to fix the bug Thank's
  5. said chaouche 2018-11-11

    is not a duplicate TIMOB-20279, its a problème of latency

JSON Source