Back to project page kakao-android-sdk-standalone.
The source code is released under:
Apache License
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.
/** * Copyright 2014 Minyoung Jeong <kkungkkung@gmail.com> * Copyright 2014 Kakao Corp./*from w w w.j a v a 2 s . c o m*/ * * 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 com.kakao.internal.Action; import com.kakao.internal.ActionInfo; import java.util.HashSet; import java.util.Set; /** * ???????? ???? ? ??? ??? url??? ???? Builder * OS?, ??????? ????? ????. * @author MJ */ public class AppActionBuilder { /** * ??? ??? url??? ???????? ??? ? ??????. */ public enum DEVICE_TYPE { /** * ????? */ PHONE("phone"), /** * ?? */ PAD("pad"); private final String value; DEVICE_TYPE(String value) { this.value = value; } /** * ?????? ????? string ? * ???? json?? ??? ??????. * @return ?????? ????? string ?. ???? json?? ??? ??????. */ public String getValue() { return value; } } private final Set<ActionInfo> actionInfos; public AppActionBuilder() { actionInfos = new HashSet<ActionInfo>(); } /** * Android ????? ??? ??? ?? ??? ?? URL(kakao[appkey]://kakaolink)?? ??? ??????? ????. * ?????? ?? ???? ?? ??? ? ????. ?????? ????? ?????? ? ?? {@link #setAndroidExecuteURLParam(String, AppActionBuilder.DEVICE_TYPE)}??? ?????????? ??. * @param executeURLParam ? ?? URL?? ??? ?????? * @return ????? ? ?? ??? ? ?? ????? ????. */ public AppActionBuilder setAndroidExecuteURLParam(final String executeURLParam){ return setAndroidExecuteURLParam(executeURLParam, null); } /** * Android ????? ??? ??? ?? ??? ?? URL(kakao[appkey]://kakaolink)?? ??? ??????? ????. * ?????? ?? ???? ??? ? ????. ?????? ????? ??? ??? ?????? {@link #setAndroidExecuteURLParam(String)}??? ?????????? ??. * @param executeURLParam ? ?? URL?? ??? ?????? * @param deviceType ?????? ?? * @return ????? ? ?? ??? ? ?? ????? ????. */ public AppActionBuilder setAndroidExecuteURLParam(final String executeURLParam, final DEVICE_TYPE deviceType){ ActionInfo androidActionInfo = ActionInfo.createAndroidActionInfo(executeURLParam, deviceType); actionInfos.add(androidActionInfo); return this; } /** * iOS ????? ??? ??? ?? ??? ?? URL(kakao[appkey]://kakaolink)?? ??? ??????? ????. * ?????? ?? ???? ?? ??? ? ????. ?????? ????? ?????? ? ?? {@link #setIOSExecuteURLParam(String, AppActionBuilder.DEVICE_TYPE)}??? ?????????? ??. * @param executeURLParam ? ?? URL?? ??? ?????? * @return ????? ? ?? ??? ? ?? ????? ????. */ public AppActionBuilder setIOSExecuteURLParam(final String executeURLParam){ ActionInfo iosActionInfo = ActionInfo.createIOSActionInfo(executeURLParam, null); actionInfos.add(iosActionInfo); return this; } /** * iOS ????? ??? ??? ?? ??? ?? URL(kakao[appkey]://kakaolink)?? ??? ??????? ????. * ?????? ?? ???? ??? ? ????. ?????? ????? ??? ??? ?????? {@link #setIOSExecuteURLParam(String)}??? ?????????? ??. * @param executeURLParam ? ?? URL?? ??? ?????? * @param deviceType ?????? ?? * @return ????? ? ?? ??? ? ?? ????? ????. */ public AppActionBuilder setIOSExecuteURLParam(final String executeURLParam, final DEVICE_TYPE deviceType){ ActionInfo iosActionInfo = ActionInfo.createIOSActionInfo(executeURLParam, deviceType); actionInfos.add(iosActionInfo); return this; } /** * ? ?? URL ????? ?????? Action?? ???? ???? ????. * @return ? ?? URL??? ????? Action * @throws KakaoLinkParseException ?????? ?? ?? ????? ? ?? ????? ??? */ public Action build() throws KakaoLinkParseException { return Action.newActionApp(actionInfos.toArray(new ActionInfo[actionInfos.size()])); } }