Skip to content

Instantly share code, notes, and snippets.

@Soufien
Created July 25, 2016 15:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save Soufien/52c1d42399d1e013d02e84efd0c6c8fa to your computer and use it in GitHub Desktop.
Save Soufien/52c1d42399d1e013d02e84efd0c6c8fa to your computer and use it in GitHub Desktop.
import android.app.Application;
import android.content.Context;
import android.util.Log;
import com.strongloop.android.loopback.RestAdapter;
public class MyApplication extends Application {
public static RestAdapter adapter=null;
public static Context context=null;
@Override
public void onCreate(){
super.onCreate();
// Initialise application contexte
context=getApplicationContext();
// Initialise rest adapter
if (adapter == null){
adapter = new RestAdapter(context,"http://0.0.0.0:3000/api");
}
}
public static RestAdapter getLoopbackAdapter(){
return adapter;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment