Android Open Source - feeligo_android_sdk U R L Builder






From Project

Back to project page feeligo_android_sdk.

License

The source code is released under:

MIT License

If you think the Android project feeligo_android_sdk 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

package fr.baloomba.feeligo.network;
/*from   w  w  w.ja  v a2 s.com*/
import fr.baloomba.feeligo.BuildConfig;
import fr.baloomba.feeligo.FeeligoLog;
import fr.baloomba.feeligo.helper.FeeligoSettings;

import java.net.URLEncoder;

public class URLBuilder {

    // <editor-fold desc="VARIABLES">

    private static final String STICKER_BASE = "/stickers";
    private static final String STICKER_SEARCH = "/search";
    private static final String STICKER_RECOMMEND = "/recommend";
    private static final String STICKER_POPULAR = "/popular";

    private static final String STICKER_USER_BASE = "/users";
    private static final String STICKER_RECENT = "/recent";
    private static final String STICKER_USER_STICKER_PACK = "/user_sticker_packs";

    private static final String STICKER_PACK_BASE = "/sticker_packs";

    // </editor-fold>

    // <editor-fold desc="METHODS">

    private static String base() {
        return BuildConfig.FEELIGO_API_BASE_URL
                + "/" + FeeligoSettings.getDomain();
    }

    private static String stickerBase() {
        return base() + STICKER_BASE;
    }

    private static String userBase(String user_id) {
        return base() + STICKER_USER_BASE + "/" + user_id;
    }

    private static String stickerPackBase() {
        return base() + STICKER_PACK_BASE;
    }

    public static String stickerSearch(String searchString) {
        try {
            searchString = URLEncoder.encode(searchString, "UTF-8");
        } catch (Exception e) {
            FeeligoLog.e(e.getMessage());
        }
        searchString = searchString.replaceAll("\\+", "%20");
        return stickerBase() + STICKER_SEARCH + "/" + searchString;
    }

    public static String recommendedStickers(String searchString) {
        try {
            searchString = URLEncoder.encode(searchString, "UTF-8");
        } catch (Exception e) {
            FeeligoLog.e(e.getMessage());
        }
        searchString = searchString.replaceAll("\\+", "%20");
        return stickerBase() + STICKER_RECOMMEND + "/" + searchString;
    }

    public static String popularStickers() {
        return stickerBase() + STICKER_POPULAR;
    }

    public static String recentStickers(String user_id) {
        return userBase(user_id) + STICKER_BASE + STICKER_RECENT;
    }

    public static String userStickerPack(String user_id) {
        return userBase(user_id) + STICKER_USER_STICKER_PACK;
    }

    public static String userStickerPack(String user_id, Long pack_id) {
        return userStickerPack(user_id) + "/" + pack_id;
    }

    public static String stickerPack() {
        return stickerPackBase();
    }

    // </editor-fold>

}




Java Source Code List

fr.baloomba.feeligo.FeeligoKeyboard.java
fr.baloomba.feeligo.FeeligoLog.java
fr.baloomba.feeligo.Feeligo.java
fr.baloomba.feeligo.helper.ActionBarHelper.java
fr.baloomba.feeligo.helper.DisplayHelper.java
fr.baloomba.feeligo.helper.FeeligoHelper.java
fr.baloomba.feeligo.helper.FeeligoLog.java
fr.baloomba.feeligo.helper.FeeligoSettings.java
fr.baloomba.feeligo.helper.JSONHelper.java
fr.baloomba.feeligo.helper.ViewHelper.java
fr.baloomba.feeligo.keyboard.FeeligoKeyboardGridAdapter.java
fr.baloomba.feeligo.keyboard.FeeligoKeyboardListener.java
fr.baloomba.feeligo.keyboard.FeeligoKeyboardPageAdapter.java
fr.baloomba.feeligo.keyboard.FeeligoKeyboardStickerPackPage.java
fr.baloomba.feeligo.model.StickerImage.java
fr.baloomba.feeligo.model.StickerPack.java
fr.baloomba.feeligo.model.Sticker.java
fr.baloomba.feeligo.model.UserStickerPack.java
fr.baloomba.feeligo.network.RequestBuilder.java
fr.baloomba.feeligo.network.URLBuilder.java
fr.baloomba.feeligo.store.FeeligoStickerStoreActivity.java
fr.baloomba.feeligo.store.FeeligoStickerStoreAdapter.java
fr.baloomba.feeligo.store.FeeligoStickerStoreDetailActivity.java
fr.baloomba.feeligo.store.FeeligoStoreDetailAdapter.java
fr.baloomba.feeligo.widget.FeeligoStickerImageView.java
fr.baloomba.feeligo.widget.FeeligoStickerPackTextView.java