welcome to linkAR technical documentation


User Interactions

The actions added to the POI through mPoi.addPoiActionToList(action); gives the user the ability to share the poi's content or interact with it:

arb2d_and_poi3.jpg arb2d_and_poi4.jpg

6.1.- Setting Twitter functionality

First is needed to obtain valid consumer key and secret key of the twitter Api: https://dev.twitter.com/

Then, in the Class that loads the ARBrowser, add the following line:

aRbrowserView.setTwitterAppCredentials(CONSUMERKEY, CONSUMERSECRET, "callback", "mycallbackidentifier");

In the Manifest, add the following intent-filter, in the activity that loads the ARBrowser

   <action android:name="android.intent.action.VIEW" />  
   <category android:name="android.intent.category.DEFAULT" />  
   <category android:name="android.intent.category.BROWSABLE" />  
  <data  android:scheme="callback" android:host="mycallbackidentifier"/>   					      									

In the OnResume method, or in the onNewIntent method (SingleTask launchMode), add the following lines:

if (intent != null && intent.getData() != null) {
  Uri uri = intent.getData();
  //Log.i("URI", uri.toString());
  if (uri != null&& uri.toString().startsWith("callback")) {

Remember to add the action into the POI, when loading the POI list:

POIaction action = new POIaction();
action.setTwitterAction("Text To Share");

6.2.- GPS updates

The GPS is managed through a service (LocationService.java), this allows the app to keep updated at any time and independently of the state of the app. The location Service launches the UpdateJsonData to reload the information when the user has moved. After the new information is downloaded and processed, the service updates its listener. For every screen we load (ARView, Map, List, Options) we set it as the location listener in the OnResume method. Therefore the service listener has always the reference to the screen that is being displayed.