标签: contact-list

如何将联系人列表从iphone地址簿导入我的应用程序?

- (void)viewDidLoad {
    [super viewDidLoad];

    // Uncomment the following line to display an Edit button in the navigation bar for this view controller.

    UIBarButtonItem *btn = [[UIBarButtonItem alloc] initWithImage:[UIImage imageNamed:@"2.png"] style:UIBarButtonItemStyleBordered target:self action:nil];
    self.navigationItem.rightBarButtonItem = btn;

    self.navigationItem.title = @"Contacts";

    sBar = [[UISearchBar alloc]initWithFrame:CGRectMake(0,0,320,30)];
    sBar.delegate = self;

    [self.view addSubview:sBar];
    sBar.placeholder=@"Search";


    searchedData = [[NSMutableArray alloc]init];

    tableData = [[NSMutableArray alloc]init];

    [tableData addObjectsFromArray:dataSource]; 
}
Run Code Online (Sandbox Code Playgroud)

iphone contact-list

5
推荐指数
1
解决办法
894
查看次数

Android:获取本地地址簿的所有联系人

我在我的应用程序中显示那些联系人时遇到问题,这些联系人位于我手机的地址簿中.

从谷歌联系人应用程序我发现了许多不同的版本,如何查询这些联系人:

  1. 不使用选择

    Uri uri = ContactsContract.CONTACT.CONTENT_URI;
    getActivity().getContentResolver().query(uri,PROJECTION, null, null, null);
    
    Run Code Online (Sandbox Code Playgroud)
  2. 仅使用具有可见组= = 1的联系人

    Uri uri = ContactsContract.CONTACT.CONTENT_URI;
    String selection = Contacts.IN_VISIBLE_GROUP + "=1"
    getActivity().getContentResolver().query(uri,PROJECTION, selection, null, null);
    
    Run Code Online (Sandbox Code Playgroud)
  3. 或者使用目录查询参数

    Uri uri = Contacts.CONTENT_URI.buildUpon().appendQueryParameter(ContactsContract.DIRECTORY_PARAM_KEY, String.valueOf(Directory.DEFAULT)).build();
    getActivity().getContentResolver().query(uri, PROJECTION, null, null, null);
    
    Run Code Online (Sandbox Code Playgroud)

最后一次提供最佳结果,但没有任何查询真正令人满意!:(我在不同的设备上测试了所有这些,但从来没有能够准确地获得电话簿中的联系人数量.

有人有一个想法,为什么没有查询适用于所有设备?


以下是我的测试结果:

================================================== ===============

| 设备\选择| 电话簿 | 不(1)| 可见组(2)| Directory.Default(3)|

================================================== ===============

| Galaxy S | 288             | 302 | 288                       | …

android contact-list contactscontract android-contacts

5
推荐指数
0
解决办法
829
查看次数

如何使用AngularJS将带标题的联系人列表按字母顺序排列为第一个字符?

我有一个这样的清单

一个人

Cperson

APerson2

BPerson

我希望它如此出现

一个

Aperson Aperson2

Bperson

C

Cperson

我在这里发现了一篇解释它的帖子:http: //pmosd.blogspot.com/2013/07/headers-in-angularjs-ng-repeats.html

但作为一个Angular noob,我不知道在js文件中放置函数和过滤器的位置以及如何将其正确编码到我的html中.我试着关注我链接的帖子,但是我的无序列表中的联系人名称不会显示在浏览器中.这是我目前的JS和HTML文件.我曾尝试将过滤器和功能放在不同的地方,但这是我最近的尝试.

Directory.js:

'use strict';

var myApp = angular.module('myappname');

myApp.controller('DirectoryCtrl', function ($scope) {
    $scope.contacts = [{
        'fname': 'Randy',
        'lname': 'Johnson',
        'location': 'Seattle, WA'
    }, {
        'fname': 'Andy',
        'lname': 'Pettite',
        'location': 'Bronx, NY'
    }, {
        'fname': 'Jon',
        'lname': 'Lester',
        'location': 'Boston, MA'
    }];

});


myApp.filter("headerChunk", function () {
    return function (orig, same, getChunkID) {
        if (!(orig instanceof Array)) return orig;
        if (orig.length == 0) …
Run Code Online (Sandbox Code Playgroud)

javascript contact-list angularjs angularjs-ng-repeat angularjs-filter

1
推荐指数
1
解决办法
2639
查看次数

无法通过angularjs在phonegap中显示联系人照片

我能够从简单的html和javascript中获取并显示联系人照片,但是当我使用angularjs模型显示联系人照片时,我收到错误.以下是我的源代码:

列出我要显示联系人的位置:

<ul class="list">

   <li class="item item-thumbnail-left" ng-repeat="contact in contactList">
            <img ng-src="{{contact.mphoto}}"/> <!--When I put this path directly ( ie "content://com.android.contacts/contacts/30/photo"), I am able to display the image, but when I fetch it from the controller, I am getting error: "unable to read contacts from asset folder" -->
           <h2>{{contact.name}}</h2>
           <p >{{contact.number}}</p>

   </li>
</ul>
Run Code Online (Sandbox Code Playgroud)

这是我设置ContactList的控制器:

ContactService.find("").then(function(contacts) {
        for (var i = 0; i < contacts.length; i++)
        {
            if (contacts[i].phoneNumbers !== null)
            {
                for (var j = 0; j < contacts[i].phoneNumbers.length; j++) …
Run Code Online (Sandbox Code Playgroud)

javascript android contact-list angularjs cordova

1
推荐指数
1
解决办法
2198
查看次数