@@ -0,0 +1,2398 @@
+package com.jmlb0003.jokes.gradlejokesproject;%0A%0Aimport android.os.AsyncTask;%0A%0Aimport com.example.jose.myapplication.backend.jokeApi.JokeApi;%0Aimport com.google.api.client.extensions.android.http.AndroidHttp;%0Aimport com.google.api.client.extensions.android.json.AndroidJsonFactory;%0Aimport com.google.api.client.googleapis.services.AbstractGoogleClientRequest;%0Aimport com.google.api.client.googleapis.services.GoogleClientRequestInitializer;%0A%0Aimport java.io.IOException;%0A%0Apublic final class JokeAsyncTask%0A        extends AsyncTask%3CVoid, Void, String%3E %7B%0A%0A    private final static String LOCAL_SERVER_ROOT = %22http://10.0.2.2:8080/%22;%0A    private final static String API_ENDPOINT = %22_ah/api/%22;%0A    private static JokeApi myApiService = null;%0A    private final JokeAsyncTaskListener asyncTaskListener;%0A%0A    public JokeAsyncTask(final JokeAsyncTaskListener listener) %7B%0A        asyncTaskListener = listener;%0A    %7D%0A%0A    @Override%0A    protected String doInBackground(Void... params) %7B%0A        if (myApiService == null) %7B  // Only do this once%0A            final JokeApi.Builder builder = new JokeApi%0A                    .Builder(AndroidHttp.newCompatibleTransport(), new AndroidJsonFactory(), null)%0A                    // options for running against local devappserver%0A                    // - 10.0.2.2 is localhost's IP address in Android emulator%0A                    // - turn off compression when running against local devappserver%0A                    .setRootUrl(LOCAL_SERVER_ROOT + API_ENDPOINT)%0A                    .setGoogleClientRequestInitializer(new GoogleClientRequestInitializer() %7B%0A%0A                        @Override%0A                        public void initialize(AbstractGoogleClientRequest%3C?%3E abstractGoogleClientRequest) %7B%0A                            abstractGoogleClientRequest.setDisableGZipContent(true);%0A                        %7D%0A%0A                    %7D);%0A            // end options for devappserver%0A%0A            myApiService = builder.build();%0A        %7D%0A%0A        try %7B%0A            return myApiService.getJoke().execute().getData();%0A        %7D catch (IOException e) %7B%0A            asyncTaskListener.thereIsNoJokes();%0A            return null;%0A        %7D%0A    %7D%0A%0A    @Override%0A    protected void onPostExecute(final String joke) %7B%0A        asyncTaskListener.showAJoke(joke);%0A    %7D%0A%0A    interface JokeAsyncTaskListener %7B%0A%0A        void showAJoke(String joke);%0A%0A        void thereIsNoJokes();%0A%0A    %7D%0A%0A%7D

Create the asynctask to fetch jokes from the gce endpoint