Android Open Source - Udacity-Android-Course Sunshine Sync Service






From Project

Back to project page Udacity-Android-Course.

License

The source code is released under:

MIT License

If you think the Android project Udacity-Android-Course 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.example.assafg.sunshine.app.sync;
// w ww . j  a  va  2s.  c  om
import android.app.Service;
import android.content.Intent;
import android.os.IBinder;
import android.util.Log;

/**
 * Created by assafg on 12/23/14.
 */
public class SunshineSyncService extends Service {

  private static final Object sSyncAdapterLock = new Object();
  private static SunshineSyncAdapter sSunshineSyncAdapter = null;

  @Override
  public void onCreate() {
    Log.d("SunshineSyncService", "onCreate - SunshineSyncService");
    synchronized (sSyncAdapterLock) {
      if (sSunshineSyncAdapter == null) {
        sSunshineSyncAdapter = new SunshineSyncAdapter(getApplicationContext(), true);
      }
    }
  }

  @Override
  public IBinder onBind(Intent intent) {
    return sSunshineSyncAdapter.getSyncAdapterBinder();
  }
}




Java Source Code List

com.example.assafg.sunshine.app.ApplicationTest.java
com.example.assafg.sunshine.app.DetailActivity.java
com.example.assafg.sunshine.app.DetailsFragment.java
com.example.assafg.sunshine.app.ForecastAdapter.java
com.example.assafg.sunshine.app.ForecastFragment.java
com.example.assafg.sunshine.app.MainActivity.java
com.example.assafg.sunshine.app.SettingsActivity.java
com.example.assafg.sunshine.app.Utility.Utility.java
com.example.assafg.sunshine.app.data.WeatherContract.java
com.example.assafg.sunshine.app.data.WeatherDbHelper.java
com.example.assafg.sunshine.app.data.WeatherProvider.java
com.example.assafg.sunshine.app.sync.SunshineAuthenticatorService.java
com.example.assafg.sunshine.app.sync.SunshineAuthenticator.java
com.example.assafg.sunshine.app.sync.SunshineSyncAdapter.java
com.example.assafg.sunshine.app.sync.SunshineSyncService.java