Android Open Source - Webby Test Webby Request






From Project

Back to project page Webby.

License

The source code is released under:

MIT License

If you think the Android project Webby 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 com.swampmobile.webby.examples.requests;
//from   w  w w  . j a v a2s .c  o m
import android.net.Uri;

import com.swampmobile.webby.examples.apis.FeedzillaApi;
import com.swampmobile.webby.requests.WebbyRequest;
import com.swampmobile.webby.util.time.Duration;

import retrofit.client.Response;

/**
 * A WebbyRequest must provide at least 2 pieces of functionality: - a constructor which
 * parameterizes the call to the super constructor - an implementation of doWebServiceCall where you
 * call the desired REST endpoint for this request.
 * <p/>
 * The URI which defines this request should be unique to the extent that two URIs are equals if and
 * only if the data they are retrieving is the same.  Webby throws away duplicate requests as
 * determined by URI comparison.
 */
public class TestWebbyRequest extends WebbyRequest<FeedzillaApi>
{
    private static final Uri BASE_URI = new Uri.Builder().scheme("feedzilla").path("categories").build();

    public TestWebbyRequest()
    {
        super(
                BASE_URI.buildUpon().appendQueryParameter("timestamp", System.currentTimeMillis() + "").build(),
                FeedzillaApi.FEEDZILLA_URL,
                FeedzillaApi.class,
                Duration.IMMEDIATELY
        );
    }

    @Override
    public Response doWebServiceCall(FeedzillaApi webservice)
    {
        return webservice.getCategories();
    }
}




Java Source Code List

com.swampmobile.webby.WebbyManager.java
com.swampmobile.webby.Webby.java
com.swampmobile.webby.examples.activities.MainActivity.java
com.swampmobile.webby.examples.activities.WebbyActivity.java
com.swampmobile.webby.examples.activities.WebbyFragmentActivity.java
com.swampmobile.webby.examples.apis.FeedzillaApi.java
com.swampmobile.webby.examples.fragments.WebbyFragment.java
com.swampmobile.webby.examples.requests.TestWebbyRequest.java
com.swampmobile.webby.requests.WebbyRequest.java
com.swampmobile.webby.requests.WebbyResponse.java
com.swampmobile.webby.services.WebbyService.java
com.swampmobile.webby.util.cache.DataCache.java
com.swampmobile.webby.util.cache.FlatFileDataCache.java
com.swampmobile.webby.util.logging.WebbyLog.java
com.swampmobile.webby.util.time.Duration.java