Android Open Source - spring-for-android-starter-book Recipe Abstract Async Task

From Project

Back to project page spring-for-android-starter-book.


The source code is released under:

Apache License

If you think the Android project spring-for-android-starter-book 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

//from   w w  w  . j  av a 2s.c o  m
import java.util.ArrayList;
import java.util.List;

import org.springframework.http.HttpAuthentication;
import org.springframework.http.HttpBasicAuthentication;
import org.springframework.http.HttpHeaders;
import org.springframework.http.MediaType;
import org.springframework.web.client.RestClientException;

import android.os.AsyncTask;

public abstract class RecipeAbstractAsyncTask<Params, Progress, Result> extends AsyncTask<Params, Progress, Result> {
  private static final String USERNAME = "s4a";
  private static final String PASSWORD = "s4a";
  protected RestClientException exception;
  protected HttpHeaders prepareHeadersWithMediaTypeAndBasicAuthentication() {
    HttpHeaders requestHeaders = new HttpHeaders();
    List<MediaType> acceptableMediaTypes = new ArrayList<MediaType>();
    HttpAuthentication authHeader = new HttpBasicAuthentication(USERNAME, PASSWORD);
    return requestHeaders;

Java Source Code List