2월, 2014의 게시물 표시

안드로이드에서 트위터 연동하기 (web, twitter4j)

안드로이드에서 트위터를 연동하는 방법은 2가지가 있다. twitter4j를 이용하는 방법,  url을 이용하여 activity를 실행하는 방법이다. 1) url를 이용하는 방법 try {      String strLink = String.format(" http://twitter.com/intent/tweet?text=%s ",                                URLEncoder.encode(message, "utf-8"));        Intent intent = new Intent(Intent.ACTION_VIEW, Uri.parse(strLink));       startActivity(intent);  }  catch (UnsupportedEncodingException e)  {      e.printStackTrace();  } 2) twitter4j를 이용하는 방법 1. sdk를 다운로드 받는다. ( http://twitter4j.org/ko/index.html#download ) 2. lib 폴더에 twitter4j-core-3.0.5.jar 를 복사해 넣는다 3. eclipse에서 property ->Java Build Path -> Libraries 에 Add JaRs 버튼을 이용해 추가한다     Order and Export ...