Back to project page loopback-android-getting-started.
The source code is released under:
MIT License
If you think the Android project loopback-android-getting-started listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package com.strongloop.android.loopback.guide; //from w w w . jav a 2 s.c o m import android.app.Application; import com.strongloop.android.loopback.RestAdapter; import com.strongloop.android.remoting.adapters.RestContractItem; public class GuideApplication extends Application { RestAdapter adapter; public RestAdapter getLoopBackAdapter() { if (adapter == null) { // Instantiate the shared RestAdapter. In most circumstances, // you'll do this only once; putting that reference in a singleton // is recommended for the sake of simplicity. // However, some applications will need to talk to more than one // server - create as many Adapters as you need. adapter = new RestAdapter( getApplicationContext(), "http://10.0.2.2:3000/api"); // This boilerplate is required for Lesson Three. adapter.getContract().addItem( new RestContractItem("locations/nearby", "GET"), "location.nearby"); } return adapter; } }