336x280(권장), 300x250(권장), 250x250, 200x200 크기의 광고 코드만 넣을 수 있습니다.
private void publishStory() { Session session = Session.getActiveSession(); if (session != null){ // Check for publish permissions Listpermissions = session.getPermissions(); if (!isSubsetOf(PERMISSIONS, permissions)) { pendingPublishReauthorization = true; Session.NewPermissionsRequest newPermissionsRequest = new Session .NewPermissionsRequest(this, PERMISSIONS); session.requestNewPublishPermissions(newPermissionsRequest); return; } Bundle postParams = new Bundle(); postParams.putString("name", "Facebook SDK for Android"); postParams.putString("caption", "Build great social apps and get more installs."); postParams.putString("description", "The Facebook SDK for Android makes it easier and faster to develop Facebook integrated Android apps."); postParams.putString("link", "https://developers.facebook.com/android"); postParams.putString("picture", "https://raw.github.com/fbsamples/ios-3.x-howtos/master/Images/iossdk_logo.png"); Request.Callback callback= new Request.Callback() { public void onCompleted(Response response) { JSONObject graphResponse = response .getGraphObject() .getInnerJSONObject(); String postId = null; try { postId = graphResponse.getString("id"); } catch (JSONException e) { Log.i(TAG, "JSON error "+ e.getMessage()); } FacebookRequestError error = response.getError(); if (error != null) { Toast.makeText(getActivity() .getApplicationContext(), error.getErrorMessage(), Toast.LENGTH_SHORT).show(); } else { Toast.makeText(getActivity() .getApplicationContext(), postId, Toast.LENGTH_LONG).show(); } } }; Request request = new Request(session, "me/feed", postParams, HttpMethod.POST, callback); RequestAsyncTask task = new RequestAsyncTask(request); task.execute(); } }
'프로그래밍 > 안드로이드' 카테고리의 다른 글
android webview에서 post방식으로 호출 방법 (0) | 2014.01.07 |
---|---|
[오픈 프로젝트 소개]안드로이드에서 대형맵(대형 이미지) 처리 (0) | 2013.12.30 |
안드로이드 디바이스 아이디를 얻는 코드~ (0) | 2013.10.03 |
px,in,mm,pt,sp 의 다른점 (0) | 2013.10.03 |
안드로이드에서 전역 변수~ 어느 액티비티에서나 쓸 수 있는 변수 생성법 (0) | 2013.10.03 |