한국어

스마트폰앱

온누리070 플레이스토어 다운로드
    acrobits softphone
     온누리 070 카카오 프러스 친구추가온누리 070 카카오 프러스 친구추가친추
     카카오톡 채팅 상담 카카오톡 채팅 상담카톡
    
     라인상담
     라인으로 공유

     페북공유

   ◎위챗 : speedseoul


  
     PAYPAL
     
     PRICE
     

pixel.gif

    before pay call 0088 from app



import android.app.Activity;
import android.content.ContentResolver;
import android.database.Cursor;
import android.os.Bundle;
import android.provider.ContactsContract;

public class TestContacts extends Activity {
    /** Called when the activity is first created. */
    @Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);
        ContentResolver cr = getContentResolver();
        Cursor cur = cr.query(ContactsContract.Contacts.CONTENT_URI,
                              null, null, null, null);
        if (cur.getCount() > 0) {
            while (cur.moveToNext()) {
                String id = cur.getString(cur.getColumnIndex(
                                ContactsContract.Contacts._ID));
                String name = cur.getString(cur.getColumnIndex(
                                ContactsContract.Contacts.DISPLAY_NAME));

                if (("1").equals(cur.getString(cur.getColumnIndex(
                            ContactsContract.Contacts.HAS_PHONE_NUMBER)))) {
                    Cursor pCur = cr.query(
                            ContactsContract.CommonDataKinds.Phone.CONTENT_URI,
                            null,
                            ContactsContract.CommonDataKinds.Phone.CONTACT_ID
                                    + " = ?", new String[] { id }, null);
                    int i = 0;
                    int pCount = pCur.getCount();
                    String[] phoneNum = new String[pCount];
                    String[] phoneType = new String[pCount];
                    while (pCur.moveToNext()) {
                        phoneNum[i] = pCur.getString(pCur.getColumnIndex(
                        ContactsContract.CommonDataKinds.Phone.NUMBER));
                        phoneType[i] = pCur.getString(pCur.getColumnIndex(
                                ContactsContract.CommonDataKinds.Phone.TYPE));
                        i++;
                    }
                }

            }

        }

    }
}





public static String getContactName(Context context, String phoneNumber) {
    ContentResolver cr = context.getContentResolver();
    Uri uri = Uri.withAppendedPath(PhoneLookup.CONTENT_FILTER_URI, Uri.encode(phoneNumber));
    Cursor cursor = cr.query(uri, new String[]{PhoneLookup.DISPLAY_NAME}, null, null, null);
    if (cursor == null) {
        return null;
    }
    String contactName = null;
    if(cursor.moveToFirst()) {
        contactName = cursor.getString(cursor.getColumnIndex(PhoneLookup.DISPLAY_NAME));
    }

    if(cursor != null && !cursor.isClosed()) {
        cursor.close();
    }

    return contactName;
}



rivate void uploadContactPhoto(Context context, String number) {

Log.v("ffnet", "Started uploadcontactphoto...");

String name = null;
String contactId = null;
InputStream input = null;

// define the columns I want the query to return
String[] projection = new String[] {
        ContactsContract.PhoneLookup.DISPLAY_NAME,
        ContactsContract.PhoneLookup._ID};

// encode the phone number and build the filter URI
Uri contactUri = Uri.withAppendedPath(ContactsContract.PhoneLookup.CONTENT_FILTER_URI, Uri.encode(number));

// query time
Cursor cursor = context.getContentResolver().query(contactUri, projection, null, null, null);

if (cursor.moveToFirst()) {

    // Get values from contacts database:
    contactId = cursor.getString(cursor.getColumnIndex(ContactsContract.PhoneLookup._ID));
    name =      cursor.getString(cursor.getColumnIndex(ContactsContract.PhoneLookup.DISPLAY_NAME));

    // Get photo of contactId as input stream:
    Uri uri = ContentUris.withAppendedId(ContactsContract.Contacts.CONTENT_URI, Long.parseLong(contactId));
    input = ContactsContract.Contacts.openContactPhotoInputStream(context.getContentResolver(), uri);

    Log.v("ffnet", "Started uploadcontactphoto: Contact Found @ " + number);            
    Log.v("ffnet", "Started uploadcontactphoto: Contact name  = " + name);
    Log.v("ffnet", "Started uploadcontactphoto: Contact id    = " + contactId);

} else {

    Log.v("ffnet", "Started uploadcontactphoto: Contact Not Found @ " + number);
    return; // contact not found

}

// Only continue if we found a valid contact photo:
if (input == null) {
    Log.v("ffnet", "Started uploadcontactphoto: No photo found, id = " + contactId + " name = " + name);
    return; // no photo
} else {
    this.type = contactId;
    Log.v("ffnet", "Started uploadcontactphoto: Photo found, id = " + contactId + " name = " + name);
}
조회 수 :
24849
등록일 :
2015.04.13
07:40:43 (*.160.89.217)
엮인글 :
http://webs.co.kr/index.php?document_srl=365324&act=trackback&key=71c
게시글 주소 :
http://webs.co.kr/index.php?document_srl=365324
List of Articles
번호 제목 글쓴이 날짜 조회 수
66 mjsip sip sample code program admin 2019-09-07 48
65 Package org.linphone.core Description admin 2017-10-22 4760
64 Sqlite detail easy tutorial. admin 2017-09-09 4932
63 Change package name Linphone Android admin 2017-08-25 5092
62 Liblinphone - import Linphone library in Android Studio 2017 admin 2017-08-25 5449
61 I am able to build the limphone on mac by follow the steps describe here admin 2017-08-25 5006
60 To build liblinphone for Android, you must COMPILATION INSTRUCTIONS admin 2017-08-25 5325
59 sipdroid source code admin 2017-08-08 5105
» 안드로이드 주소록 전체가져오기 이름만가져오기 사진가져오기 코드 admin 2015-04-13 24849
57 the sipdroid Research Miscellaneous admin 2015-03-26 8383
56 HSS070 English Korean 무료 국제전화 미국 중국 카나다 무료 통화 제공 admin 2014-12-28 14424
55 Softphones admin 2014-09-20 10768
54 /xxxxx/gen already exists but is not a source folder. Convert to a source folder or rename it. admin 2014-09-03 13946
53 CSIPSimple building Rebuilding Detail on Eclips Good All is heare perfect admin 2014-08-15 11691
52 Improving QoE of SIP-based Automated Voice Interaction in Mobile Networks file admin 2014-03-20 12514
51 speex support in android admin 2014-03-19 11890
50 voxmobile Source and how to build admin 2014-02-18 13206
49 PJSIP hung the phone constantly corrected the problem admin 2014-02-09 13181
48 Csipsimple code rebuilding source sip 통신 Call Mechanism admin 2014-02-09 73231
47 Csipsimple code rebuilding source sip 통신 technical interviewer admin 2014-02-09 13200
46 Csipsimple code rebuilding source 주요인터페이스분석 admin 2014-02-09 177235
45 Csipsimple code rebuilding source 다운로드 구성 csipsimple 소스 프로젝트 admin 2014-02-09 15036
44 Android DialogFragment Tutorial admin 2014-02-09 12937
43 Creating a fullscreen DialogFragment with a custom background admin 2014-02-09 16096
42 [Android API] 네트워크 상태 체크하기 admin 2013-12-19 18193
41 [안드로이드] 네트워크 연결 상태 체크 함수. admin 2013-12-19 14776
40 안드로이드 인터넷연결체크 ( 3g/lte/wifi ) 메서드 admin 2013-12-19 20752
39 Android Get Phone Contacts details with Contact Image admin 2013-12-15 13835
38 안드로이드 커스텀 타이틀바 How to add custom title bar to android application admin 2013-10-02 17017
37 How to create a custom title bar admin 2013-07-15 15445