Skip to content

Instantly share code, notes, and snippets.

@TomTasche
Last active April 5, 2017 14:54
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 TomTasche/27f9078cab3bf45e5aaa to your computer and use it in GitHub Desktop.
Save TomTasche/27f9078cab3bf45e5aaa to your computer and use it in GitHub Desktop.
Integrating indoo.rs localization is now easier than ever.
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
<uses-sdk
android:minSdkVersion="9"
android:targetSdkVersion="18" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.BLUETOOTH_ADMIN" />
<application>
<activity
android:name=".MainActivity"
android:configChanges="orientation|keyboardHidden|screenSize">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<service
android:name="com.customlbs.service.Worker"
android:process=":remote" >
</service>
<service android:name="com.customlbs.service.rest.batch.RestBatchService" >
</service>
<receiver
android:name="com.customlbs.service.rest.batch.ConnectivityReceiver"
android:enabled="false" >
<intent-filter>
<action android:name="android.net.conn.CONNECTIVITY_CHANGE" />
</intent-filter>
</receiver>
</application>
</manifest>
public class MainActivity extends FragmentActivity implements IndoorsLocationListener {
private IndoorsSurfaceFragment indoorsFragment;
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
IndoorsFactory.Builder indoorsBuilder = new IndoorsFactory.Builder();
IndoorsSurfaceFactory.Builder surfaceBuilder = new IndoorsSurfaceFactory.Builder();
indoorsBuilder.setContext(this);
// TODO: replace this with your API-key
indoorsBuilder.setApiKey("YOUR-API-KEY");
// TODO: replace 12345 with the id of the building you uploaded to
// our cloud using the MMT
indoorsBuilder.setBuildingId((long) 12345);
// callback for indoo.rs-events
indoorsBuilder.setUserInteractionListener(this);
surfaceBuilder.setIndoorsBuilder(indoorsBuilder);
indoorsFragment = surfaceBuilder.build();
FragmentTransaction transaction = getSupportFragmentManager().beginTransaction();
transaction.add(android.R.id.content, indoorsFragment, "indoors");
transaction.commit();
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment