Android Open Source - Sunshine Weather Authenticator






From Project

Back to project page Sunshine.

License

The source code is released under:

MIT License

If you think the Android project Sunshine 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 net.alteridem.sunshine.sync;
//w  w  w  . ja v a2s  . co m
import android.accounts.AbstractAccountAuthenticator;
import android.accounts.Account;
import android.accounts.AccountAuthenticatorResponse;
import android.accounts.NetworkErrorException;
import android.content.Context;
import android.os.Bundle;

/**
 * Manages "Authentication" to Sunshine's backend service.  The SyncAdapter framework
 * requires an authenticator object, so syncing to a service that doesn't need authentication
 * typically means creating a stub authenticator like this one.
 * This code is copied directly, in its entirety, from
 * http://developer.android.com/training/sync-adapters/creating-authenticator.html
 * Which is a pretty handy reference when creating your own syncadapters.  Just sayin'.
 */
public class WeatherAuthenticator extends AbstractAccountAuthenticator {

    public WeatherAuthenticator(Context context) {
        super(context);
    }

    @Override
    public Bundle editProperties(AccountAuthenticatorResponse response, String accountType) {
        throw new UnsupportedOperationException();
    }

    @Override
    public Bundle addAccount(AccountAuthenticatorResponse response, String accountType, String authTokenType, String[] requiredFeatures, Bundle options) throws NetworkErrorException {
        return null;
    }

    @Override
    public Bundle confirmCredentials(AccountAuthenticatorResponse response, Account account, Bundle options) throws NetworkErrorException {
        return null;
    }

    @Override
    public Bundle getAuthToken(AccountAuthenticatorResponse response, Account account, String authTokenType, Bundle options) throws NetworkErrorException {
        throw new UnsupportedOperationException();
    }

    @Override
    public String getAuthTokenLabel(String authTokenType) {
        throw new UnsupportedOperationException();
    }

    @Override
    public Bundle updateCredentials(AccountAuthenticatorResponse response, Account account, String authTokenType, Bundle options) throws NetworkErrorException {
        throw new UnsupportedOperationException();
    }

    @Override
    public Bundle hasFeatures(AccountAuthenticatorResponse response, Account account, String[] features) throws NetworkErrorException {
        throw new UnsupportedOperationException();
    }
}




Java Source Code List

net.alteridem.sunshine.DetailActivity.java
net.alteridem.sunshine.ForecastAdapter.java
net.alteridem.sunshine.ForecastFragment.java
net.alteridem.sunshine.ForecastItemViewHolder.java
net.alteridem.sunshine.IForecastFragmentHost.java
net.alteridem.sunshine.MainActivity.java
net.alteridem.sunshine.SettingsActivity.java
net.alteridem.sunshine.Utility.java
net.alteridem.sunshine.WeatherDataParser.java
net.alteridem.sunshine.WeatherDetailFragment.java
net.alteridem.sunshine.data.WeatherContract.java
net.alteridem.sunshine.data.WeatherDbHelper.java
net.alteridem.sunshine.data.WeatherProvider.java
net.alteridem.sunshine.sync.WeatherAuthenticatorService.java
net.alteridem.sunshine.sync.WeatherAuthenticator.java
net.alteridem.sunshine.sync.WeatherSyncAdapter.java
net.alteridem.sunshine.sync.WeatherSyncService.java