PC에서 BOOK마크저장과 같이 모바일에서 클릭으로 핸드폰번호를 연락처에 저장할수있을까요?

PC에서 BOOK마크저장과 같이 모바일에서 클릭으로 핸드폰번호를 연락처에 저장할수있을까요?

QA

PC에서 BOOK마크저장과 같이 모바일에서 클릭으로 핸드폰번호를 연락처에 저장할수있을까요?

본문

내용 그대로 입니다~~!

 

PC에선 북마크버튼을 누르면 북마크에 저장되잖아요~

 

근데 모바일 화면에서 버튼을 누르면 휴대폰 번호가 상대방의 연락처에 저장되게 할 방법이

 

있을까요?

 

이 질문에 댓글 쓰기 :

답변 2

연락처 <a href="tel:전화번호">전화번호나 버튼이미지</a>

 

위처럼 http://대신에 tel:해놓으시면 휴대폰에서 전화번호를 누르면 통화를 할건지 저장을 할건지 뜹니다.

sms:하시면 문자전송이 될겁니다. 이건 제가 써보질 않아서요.

$data = '+11234567890';

if(  preg_match( '/^\+\d(\d{3})(\d{3})(\d{4})$/', $data,  $matches ) )
{
    $result = $matches[1] . '-' .$matches[2] . '-' . $matches[3];
    return $result;
}

서핑해서 갖고온 소스인데 이걸로 하면 될까요??ㅎㅎ

       public static final int PICK_CONTACT    = 1;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        // this opens the activity. note the  Intent.ACTION_GET_CONTENT
        // and the intent.setType
        ((Button)findViewById(R.id.btn_contacts)).setOnClickListener( new OnClickListener() {
            @Override
            public void onClick(View v) {
                // user BoD suggests using Intent.ACTION_PICK instead of .ACTION_GET_CONTENT to avoid the chooser
                Intent intent = new Intent(Intent.ACTION_GET_CONTENT);
                // BoD con't: CONTENT_TYPE instead of CONTENT_ITEM_TYPE
                intent.setType(ContactsContract.CommonDataKinds.Phone.CONTENT_ITEM_TYPE);
                startActivityForResult(intent, 1);                
            }
        });
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.activity_main, menu);
        return true;
    }


    @Override
    protected void onActivityResult(int requestCode, int resultCode, Intent data) {
        if (data != null) {
            Uri uri = data.getData();

            if (uri != null) {
                Cursor c = null;
                try {
                    c = getContentResolver().query(uri, new 
답변을 작성하시기 전에 로그인 해주세요.
전체 0
QA 내용 검색
  • 개별 목록 구성 제목 답변작성자조회작성일
  • 질문이 없습니다.

회원로그인

(주)에스아이알소프트 / 대표:홍석명 / (06211) 서울특별시 강남구 역삼동 707-34 한신인터밸리24 서관 1404호 / E-Mail: admin@sir.kr
사업자등록번호: 217-81-36347 / 통신판매업신고번호:2014-서울강남-02098호 / 개인정보보호책임자:김민섭(minsup@sir.kr)
© SIRSOFT