Android SpringAndroidSpiceRequest - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android SpringAndroidSpiceRequest class.

This code example shows how to use the following methods:
public abstract class FlickrRequest<RESULT> extends SpringAndroidSpiceRequest<RESULT> { 
 
    private static final String FLICKR_SERVICE_URL = "http://api.flickr.com/services/rest/"; 
 
    protected FlickrRequest(Class<RESULT> clazz) { 
        super(clazz); 
    } 
 
    protected String getServiceUrl() { 
        return FLICKR_SERVICE_URL; 
    } 
 
} 
5
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:
public class StatusRequest extends SpringAndroidSpiceRequest<StatusList> { 
    private String apiUrl; 
    private String apiToken; 
 
    public StatusRequest(Context ctx) { 
        super(StatusList.class); 
 
        // TODO: cleanup 
        SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(ctx); 
        apiUrl = prefs.getString(ctx.getString(R.string.const_pref_api_url), ""); 
        apiToken = prefs.getString(ctx.getString(R.string.const_pref_api_token), ""); 
    } 
 
    @Override 
    public StatusList loadDataFromNetwork() throws Exception { 
 
        Uri.Builder uriBuilder = Uri.parse(apiUrl).buildUpon(); 
        uriBuilder.appendQueryParameter(Constants.CONST_API_PARAM_TYPE_PATH, Constants.CONST_API_PARAM_TYPE_PATH_STATUS); 
        uriBuilder.appendQueryParameter(Constants.CONST_API_PARAM_TYPE_FORMAT, Constants.CONST_API_PARAM_TYPE_FORMAT_JSON); 
        uriBuilder.appendQueryParameter(Constants.CONST_API_STATUS_PARAM_TOKEN, apiToken); 
3
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:
    private String apiUrl; 
    private String apiToken; 
    private Status status; 
 
    public PostStatusRequest(Status status, Context ctx) { 
        super(Status.class); 
        this.status = status; 
 
        // TODO: cleanup 
        SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(ctx); 
        apiUrl = prefs.getString(ctx.getString(R.string.const_pref_api_url), ""); 
        apiToken = prefs.getString(ctx.getString(R.string.const_pref_api_token), ""); 
    } 
 
    @Override 
    public Status loadDataFromNetwork() throws Exception { 
 
        Uri.Builder uriBuilder = Uri.parse(apiUrl).buildUpon(); 
        uriBuilder.appendQueryParameter(Constants.CONST_API_PARAM_TYPE_PATH, Constants.CONST_API_PARAM_TYPE_PATH_STATUS); 
        uriBuilder.appendQueryParameter(Constants.CONST_API_PARAM_TYPE_FORMAT, Constants.CONST_API_PARAM_TYPE_FORMAT_JSON); 
3
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:
public class FinishedTaskListRequest extends 
		SpringAndroidSpiceRequest<FinishedTaskListResponse> { 
	private Activity context; 
 
	public FinishedTaskListRequest(Activity context) { 
		super(FinishedTaskListResponse.class); 
		this.context = context; 
	} 
 
	@Override 
	public FinishedTaskListResponse loadDataFromNetwork() throws Exception { 
 
		Uri.Builder uriBuilder = Uri.parse( 
				Util.getUrl(context, "/getFinishedTaskList")).buildUpon(); 
		uriBuilder.appendQueryParameter("uid", Config.User.uid.toString()); 
		uriBuilder.appendQueryParameter("password", Config.User.password); 
		uriBuilder.appendQueryParameter("startRecord", 
				Config.Data.startRecord.toString()); 
		System.out.println(uriBuilder.build().toString()); 
		return getRestTemplate().getForObject(uriBuilder.build().toString(), 
4
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:
public class HasImageRequest extends SpringAndroidSpiceRequest<ListHasImageModel> { 
 
    private String keyword; 
 
    public HasImageRequest(String keyword) { 
        super(ListHasImageModel.class); 
        this.keyword = keyword; 
    } 
 
    @Override 
    public ListHasImageModel loadDataFromNetwork() throws Exception { 
//		Uri.Builder uriBuilder = Uri.parse( 
//				"http://search.twitter.com/search.json").buildUpon(); 
//		uriBuilder.appendQueryParameter("q", keyword); 
//		uriBuilder.appendQueryParameter("rpp", "20"); 
//		uriBuilder.appendQueryParameter("lang", "en"); 
 
//		String url = uriBuilder.build().toString(); 
        String url =  "https://api.github.com/legacy/user/search/:" + keyword; 
        return getRestTemplate().getForObject( url, ListHasImageModel.class ); 
4
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:
public class UserInfoRequest extends 
		SpringAndroidSpiceRequest<UserInfoResponse> { 
	private Activity context; 
 
	public UserInfoRequest(Activity context) { 
		super(UserInfoResponse.class); 
		this.context = context; 
	} 
 
	@Override 
	public UserInfoResponse loadDataFromNetwork() throws Exception { 
		Uri.Builder uriBuilder = Uri 
				.parse(Util.getUrl(context, "/getUserInfo")).buildUpon(); 
		uriBuilder.appendQueryParameter("uid", Config.User.uid.toString()); 
		uriBuilder.appendQueryParameter("password", Config.User.password); 
 
		return getRestTemplate().getForObject(uriBuilder.build().toString(), 
				UserInfoResponse.class); 
	} 
 
4
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:
 */ 
public class MovieDetailRequest extends SpringAndroidSpiceRequest<Movie> { 
    private final String movieId; 
 
    public MovieDetailRequest(String movieId) { 
        super(Movie.class); 
        this.movieId = movieId; 
 
    } 
 
    public String createCacheKey() { 
        return "moviedetail." + movieId; 
    } 
 
    @Override 
    public Movie loadDataFromNetwork() throws Exception { 
 
        Uri.Builder builder = Uri.parse("http://api.themoviedb.org/3/movie/" + movieId).buildUpon(); 
 
        builder.appendQueryParameter("api_key", Constants.TMDB_API_KEY); 
4
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:
 */ 
public class MovieSearchRequest extends SpringAndroidSpiceRequest<ListMovies> { 
    private final String query; 
 
    public MovieSearchRequest(String query) { 
        super(ListMovies.class); 
        this.query = query; 
    } 
 
    public String createCacheKey() { 
        return "movies." + query; 
    } 
 
    @Override 
    public ListMovies loadDataFromNetwork() throws Exception { 
 
        Uri.Builder builder = Uri.parse("http://api.themoviedb.org/3/search/movie").buildUpon(); 
 
        builder.appendQueryParameter("api_key", Constants.TMDB_API_KEY); 
        builder.appendQueryParameter("query", query); 
4
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:
public class Accountrequest extends SpringAndroidSpiceRequest<Accountmodel> { 
    private String username; 
    private String password; 
 
    public Accountrequest(String username,String password) { 
        super(Accountmodel.class); 
        this.username=username; 
        this.password=password; 
    } 
 
 
    @Override 
    public Accountmodel loadDataFromNetwork() throws Exception { 
        return new AccountService().login(this,username,password); 
    } 
 
    /** 
     * 创建缓存key 
     * */ 
    public String createCacheKey() { 
4
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
This code example shows how to use the following methods:
 
    private String mUrl; 
    private Object[] mParams; 
 
    public GetRequest(String url,String... urlParams) { 
        super(String.class); 
        mUrl=url; 
        mParams=urlParams; 
    } 
 
    @Override 
    public String loadDataFromNetwork() throws Exception { 
        return getRestTemplate().getForObject(mUrl, String.class, mParams); 
    } 
} 
4
CodeRank
Contextual code suggestions in your IDE  Get Codota for Java
See Code Examples for Android SpringAndroidSpiceRequest Methods: