Android Open Source - feeligo_android_sdk Request 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.  j a  v a  2s.  c  o  m*/
import fr.baloomba.feeligo.helper.FeeligoSettings;

import fr.baloomba.wsvolley.WSManager;
import fr.baloomba.wsvolley.WSMethod;
import fr.baloomba.wsvolley.WSRequest;
import fr.baloomba.wsvolley.WSResponseListener;

public class RequestBuilder {

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

    public static void searchStickers(String keyword, WSResponseListener callbacks) {
        String url = URLBuilder.stickerSearch(keyword);
        WSRequest request = new WSRequest.Builder(WSMethod.GET, url, "feeligo_search_stickers")
                .setListener(callbacks)
                .addHeader("Referer", "http://android-app." + FeeligoSettings.getDomain())
                .setShouldCache(true)
                .build();
        WSManager.getInstance().send(request);
    }

    public static void getRecommendedStickers(String phrase, WSResponseListener callbacks) {
        String url = URLBuilder.recommendedStickers(phrase);
        WSRequest request = new WSRequest.Builder(WSMethod.GET, url, "feeligo_recommended_stickers")
                .setListener(callbacks)
                .addHeader("Referer", "http://android-app." + FeeligoSettings.getDomain())
                .setShouldCache(true)
                .build();
        WSManager.getInstance().send(request);
    }

    public static void getPopularStickers(WSResponseListener callbacks) {
        String url = URLBuilder.popularStickers();
        WSRequest request = new WSRequest.Builder(WSMethod.GET, url, "feeligo_popular_stickers")
                .setListener(callbacks)
                .addHeader("Referer", "http://android-app." + FeeligoSettings.getDomain())
                .setShouldCache(true)
                .build();
        WSManager.getInstance().send(request);
    }

    public static void getRecentStickers(String id, WSResponseListener callbacks) {
        String url = URLBuilder.recentStickers(id);
        WSRequest request = new WSRequest.Builder(WSMethod.GET, url, "feeligo_get_recent_stickers")
                .setListener(callbacks)
                .addHeader("Referer", "http://android-app." + FeeligoSettings.getDomain())
                .setShouldCache(true)
                .build();
        WSManager.getInstance().send(request);
    }

    public static void setRecentSticker(String id, Long stickerId, WSResponseListener callbacks) {
        String url = URLBuilder.recentStickers(id);
        WSRequest request = new WSRequest.Builder(WSMethod.POST, url, "feeligo_set_recent_sticker")
                .setListener(callbacks)
                .addHeader("Referer", "http://android-app." + FeeligoSettings.getDomain())
                .addParam("sticker[id]", stickerId.toString())
                .build();
        WSManager.getInstance().send(request);
    }

    // </editor-fold>

    // <editor-fold desc="STICKER PACKS">

    public static void getStickerPack(WSResponseListener callbacks) {
        String url = URLBuilder.stickerPack();
        WSRequest request = new WSRequest.Builder(WSMethod.GET, url, "feeligo_sticker_packs")
                .setListener(callbacks)
                .addHeader("Referer", "http://android-app." + FeeligoSettings.getDomain())
                .setShouldCache(true)
                .build();
        WSManager.getInstance().send(request);
    }

    // </editor-fold>

    // <editor-fold desc="USER STICKER PACKS">

    public static void getUserStickerPack(String id, WSResponseListener callbacks) {
        String url = URLBuilder.userStickerPack(id);
        WSRequest request = new WSRequest.Builder(WSMethod.GET, url, "feeligo_user_sticker_packs")
                .setListener(callbacks)
                .addHeader("Referer", "http://android-app." + FeeligoSettings.getDomain())
                .setShouldCache(true)
                .build();
        WSManager.getInstance().send(request);
    }

    public static void addUserStickerPack(String id, Long packId, WSResponseListener callbacks) {
        String url = URLBuilder.userStickerPack(id);
        WSRequest request = new WSRequest.Builder(WSMethod.POST, url, "feeligo_user_sticker_packs")
                .addParam("user_sticker_pack[sticker_pack_id]", packId.toString())
                .setListener(callbacks)
                .addHeader("Referer", "http://android-app." + FeeligoSettings.getDomain())
                .setShouldCache(false)
                .build();
        WSManager.getInstance().send(request);
    }

    public static void removeUserStickerPack(String id, Long packId,  WSResponseListener callbacks) {
        String url = URLBuilder.userStickerPack(id, packId);
        WSRequest request = new WSRequest.Builder(WSMethod.DELETE, url,
                "feeligo_user_sticker_packs")
                .setListener(callbacks)
                .addHeader("Referer", "http://android-app." + FeeligoSettings.getDomain())
                .setShouldCache(false)
                .build();
        WSManager.getInstance().send(request);
    }

    // </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