If you think the Android project kakao-android-sdk-standalone listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
Java Source Code
/**
* Copyright 2014 Minyoung Jeong <kkungkkung@gmail.com>
* Copyright 2014 Kakao Corp.//fromwww.java2s.com
*
* Redistribution and modification in source or binary forms are not permitted without specific prior written permission.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/package com.kakao;
import android.os.Bundle;
import com.kakao.helper.ServerProtocol;
/*
* Param Name Param Type ?? ??
* content String ? ??
* permission enum o A : ?? ?? F : ?? ??
* image_url String X ????? URL
* android_exec_param String X ??????? custom url?? ???? ?????? ${???? ???? ?} + "?" + ${android_exec_param}
* ios_exec_param String X ??????? custom url?? ???? ?????? ${???? ???? ?} + "?" + ${ios_exec_param}
*//**
* ??? ?????? ??? ??? ???? Builder????.
* ????, ????, ?????, ???? ?? param.
* ????? ????? ?? ??????.
* @author MJ
*/publicclass KakaoStoryPostParamBuilder {
/**
* ??? ?????? ?? ??
*/publicenum PERMISSION {
/**
* ?? ??
*/
PUBLIC("A"),
/**
* ?? ??
*/
FRIENDS("F");
privatefinal String value;
PERMISSION(String value) {
this.value = value;
}
}
privatefinal String content;
privatefinal PERMISSION permission;
private String imageURL;
private String androidExecuteParam;
private String iosExecuteParam;
/**
* ?? ?? ????? Builder? ???.
* @param content ??????? ????? ????
*/public KakaoStoryPostParamBuilder(final String content) {
this(content, PERMISSION.FRIENDS);
}
/**
* ????? ??? ????? Builder? ???.
* @param content ??????? ????? ????
* @param permission ????? ?? ??
*/public KakaoStoryPostParamBuilder(final String content, final PERMISSION permission) {
this.content = content;
this.permission = permission;
}
/**
* ??????? ????? ????.
* @param imageURL ??????? ????? ????? ??. upload API? ?? ???? ??
* @return ????? ?? ? builder
*/public KakaoStoryPostParamBuilder setImageURL(final String imageURL) {
this.imageURL = imageURL;
returnthis;
}
/**
* Android ??? ??????? ??? ?????? ????.
* ??????? kakao[appkey]://kakaostory? ?????? ? ??? ??????? ????? ???? ? ????.
* @param androidExecuteParam ??? ??????
* @return ?????? ??? builder
*/public KakaoStoryPostParamBuilder setAndroidExecuteParam(final String androidExecuteParam) {
this.androidExecuteParam = androidExecuteParam;
returnthis;
}
/**
* iOS ??? ??????? ??? ?????? ????.
* ??????? kakao[appkey]://kakaostory? ?????? ? ??? ??????? ????? ???? ? ????.
* @param iosExecuteParam ??? ??????
* @return ?????? ??? builder
*/public KakaoStoryPostParamBuilder setIOSExecuteParam(final String iosExecuteParam) {
this.iosExecuteParam = iosExecuteParam;
returnthis;
}
/**
* ???? ????? ????? Bundle? ?????.
* @return ??? ????? ????? Bundle? ??
*/public Bundle build(){
final Bundle parameters = new Bundle();
parameters.putString(ServerProtocol.CONTENT_KEY, content);
parameters.putString(ServerProtocol.PERMISSION_KEY, permission.value);
if(imageURL != null)
parameters.putString(ServerProtocol.IMAGE_URL_KEY, imageURL);
if(androidExecuteParam != null)
parameters.putString(ServerProtocol.ANDROID_EXEC_PARAM_KEY, androidExecuteParam);
if(iosExecuteParam != null)
parameters.putString(ServerProtocol.IOS_EXEC_PARAM_KEY, iosExecuteParam);
return parameters;
}
}