Android Open Source - Android-SDK Cloud Engine Receiver






From Project

Back to project page Android-SDK.

License

The source code is released under:

MIT License

If you think the Android project Android-SDK 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.getcloudengine;
/*from  w ww .jav  a 2s.  c om*/

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;


public class CloudEngineReceiver extends BroadcastReceiver {

  @Override
  public void onReceive(Context context, Intent intent) {
    
    CloudEngineUtils utils = CloudEngineUtils.getInstance();
    
    if(!utils.isNetworkAvailable(context))
      {
        return;
      }
    else{
      
      SharedPreferences sharedPref = context.getSharedPreferences(
          CloudEngine.PREFERENCE_FILE , Context.MODE_PRIVATE);
      
      String apiKey = sharedPref.getString(CloudEngine.API_KEY, null);
      String appId = sharedPref.getString(CloudEngine.APP_ID, null);
      
      if(apiKey != null && appId !=null)
      {
        CloudEngine.initialize(context, apiKey, appId);
        CloudObject.syncServer(context);
      }
      
    }
      

  }

}




Java Source Code List

net.getcloudengine.CloudAuthException.java
net.getcloudengine.CloudEndPoints.java
net.getcloudengine.CloudEngineReceiver.java
net.getcloudengine.CloudEngineSdkVersion.java
net.getcloudengine.CloudEngineUtils.java
net.getcloudengine.CloudEngine.java
net.getcloudengine.CloudException.java
net.getcloudengine.CloudFile.java
net.getcloudengine.CloudObjectException.java
net.getcloudengine.CloudObject.java
net.getcloudengine.CloudPushService.java
net.getcloudengine.CloudQuery.java
net.getcloudengine.CloudUser.java
net.getcloudengine.DeleteObjectCallback.java
net.getcloudengine.FetchFileCallback.java
net.getcloudengine.FetchObjectCallback.java
net.getcloudengine.FindObjectsCallback.java
net.getcloudengine.GetObjectCallback.java
net.getcloudengine.LoginCallback.java
net.getcloudengine.LogoutCallback.java
net.getcloudengine.PasswordResetCallback.java
net.getcloudengine.PushCallback.java
net.getcloudengine.SaveFileCallback.java
net.getcloudengine.SaveObjectCallback.java
net.getcloudengine.SignupCallback.java