Created
July 25, 2016 15:05
-
-
Save Soufien/52c1d42399d1e013d02e84efd0c6c8fa to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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