Android Open Source - RecipeBook Sync Service

From Project

Back to project page RecipeBook.


The source code is released under:

Copyright (c) 2013, Ian Lake All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - Red...

If you think the Android project RecipeBook 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.ianhanniballake.recipebook.sync;
//from  w w w .j av  a2  s  . c o  m
import android.content.Intent;
import android.os.IBinder;

 * Service to handle sync with Drive. It instantiates the SyncAdapter and returns its IBinder.
public class SyncService extends Service
  private static SyncAdapter sSyncAdapter = null;
  private static final Object sSyncAdapterLock = new Object();

  public IBinder onBind(final Intent intent)
    return sSyncAdapter.getSyncAdapterBinder();

  public void onCreate()
    synchronized (sSyncAdapterLock)
      if (sSyncAdapter == null)
        sSyncAdapter = new SyncAdapter(getApplicationContext(), true);

Java Source Code List