Android Open Source - GitHubContributionsApp Git Hub Activity Online User Repositories Async Task






From Project

Back to project page GitHubContributionsApp.

License

The source code is released under:

GNU General Public License

If you think the Android project GitHubContributionsApp 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.githubcardandroidapp.app.GitHubContributionsIO.Repositories;
/*from w w w  . ja v a 2 s . c  o  m*/
import android.util.Log;

import com.githubcardandroidapp.app.GitHubCardActivity;
import com.githubcardandroidapp.app.BusinessObjects.GitHubUserRepositories;
import com.githubcardandroidapp.app.BusinessObjects.GitHubUserRepositoriesImpl;
import com.githubcardandroidapp.app.GitHubContributionsIO.HttpClientProfileDetailsDownloader;
import com.githubcardandroidapp.app.GitHubContributionsIO.Services.GitHubSyncService;
import com.githubcardandroidapp.app.Serialization.PersistenceHandler;
import com.githubcardandroidapp.app.Serialization.PersistenceHandlerImpl;

import org.json.JSONException;
import java.io.IOException;
import java.util.List;

public class GitHubActivityOnlineUserRepositoriesAsyncTask extends GitHubUserRepositoriesAsyncTask {

    public GitHubActivityOnlineUserRepositoriesAsyncTask(GitHubSyncService gitHubSyncService) {

        super(gitHubSyncService);
    }

    @Override
    protected GitHubUserRepositories doInBackground(String... params) {

        GitHubUserRepositories userRepositories = null;

        String userName = params[0];
        try {
            userRepositories = GetOnlineRepositories(userName);
            new PersistenceHandlerImpl(this.gitHubSyncService).serializeRepositories(userName, userRepositories);
        }
        catch (IOException exception) {
            Log.i("IO exception : repositories", exception.getMessage());
        }
        catch(Exception ex) {
            Log.i("Exception", ex.getMessage());
        }

        return userRepositories;
    }

    private GitHubUserRepositories GetOnlineRepositories(String login) throws IOException{

        GitHubUserRepositories userRepositories = null;
        try {
            List<String> repositories =
                    new HttpClientProfileDetailsDownloader().downloadUserRepositories(login);

            userRepositories = new GitHubUserRepositoriesImpl(repositories);

        } catch (JSONException e) {

            Log.i("JSON exception : repositories", e.getMessage());
        }

        return userRepositories;
    }
}




Java Source Code List

com.githubcardandroidapp.app.GitHubCardActivity.java
com.githubcardandroidapp.app.SettingsActivity.java
com.githubcardandroidapp.app.BusinessObjects.GitHubProfileDetailsImpl.java
com.githubcardandroidapp.app.BusinessObjects.GitHubProfileDetails.java
com.githubcardandroidapp.app.BusinessObjects.GitHubUserRepositoriesImpl.java
com.githubcardandroidapp.app.BusinessObjects.GitHubUserRepositories.java
com.githubcardandroidapp.app.GitHubContributionsIO.GitHubProfileDetailsDownloaderBase.java
com.githubcardandroidapp.app.GitHubContributionsIO.GitHubProfileDetailsDownloader.java
com.githubcardandroidapp.app.GitHubContributionsIO.HttpClientProfileDetailsDownloader.java
com.githubcardandroidapp.app.GitHubContributionsIO.HttpUrlConnectionProfileDetailsDownloader.java
com.githubcardandroidapp.app.GitHubContributionsIO.Profile.GitHubActivityInternalStorageAsyncTask.java
com.githubcardandroidapp.app.GitHubContributionsIO.Profile.GitHubActivityOnlineUserProfileAsyncTask.java
com.githubcardandroidapp.app.GitHubContributionsIO.Profile.GitHubProfileAsyncTask.java
com.githubcardandroidapp.app.GitHubContributionsIO.Repositories.GitHubActivityOnlineUserRepositoriesAsyncTask.java
com.githubcardandroidapp.app.GitHubContributionsIO.Repositories.GitHubInternalStorageUserRepositoriesAsyncTask.java
com.githubcardandroidapp.app.GitHubContributionsIO.Repositories.GitHubUserRepositoriesAsyncTask.java
com.githubcardandroidapp.app.GitHubContributionsIO.Services.DeviceStartupReceiver.java
com.githubcardandroidapp.app.GitHubContributionsIO.Services.GitHubCardActivityReceiver.java
com.githubcardandroidapp.app.GitHubContributionsIO.Services.GitHubSyncService.java
com.githubcardandroidapp.app.Network.ConnectivityChecker.java
com.githubcardandroidapp.app.Network.ConnectivityReceiver.java
com.githubcardandroidapp.app.Serialization.PersistenceHandlerImpl.java
com.githubcardandroidapp.app.Serialization.PersistenceHandler.java
com.githubcardandroidapp.app.Serialization.UserNamePicker.java