This tutorial shows how to implement a RemoteView inside a template or skeleton Android application.
This tutorial requires either that you use the public sandbox or have your own private sandbox or internal Jabber Guest server environment. This document also assumes the reader is comfortable with Java for Android.
This is a very quick tutorial on how quickly you can set up a new project to incorporate Jabber Guest video technology. It intentionally eschews safety and error checking for speed so view it only as an example of the general steps to take to get Jabber Guest integrated into your application.
The following steps show how to piece together the application.
Create a default Android Application Project from the Eclipse wizard.
Create a default Android Application Project from the Eclipse wizard.
Add or modify the following entries within your application’s manifest AndroidManifest.xml file:
<uses-sdk
android:minSdkVersion="15"
android:targetSdkVersion="17" />
<uses-feature
android:glEsVersion="0x00020000"
android:required="true"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.BLUETOOTH"/>
<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.camera.autofocus" />
<uses-feature android:name="android.hardware.camera.front" />
<uses-feature android:name="android.hardware.camera.back" />
<uses-feature android:name="android.hardware.microphone" />
<uses-feature android:name="android.hardware.audio.low_latency" />
Within your activity_main.xml file, add the RemoteView to the layout.
<com.cisco.jabber.guest.RemoteView
android:id="@+id/remoteView"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
</com.cisco.jabber.guest.RemoteView>
Add import statements for the required components to the top of your MainActivity.java file.
<com.cisco.jabber.guest.RemoteView
android:id="@+id/remoteView"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
</com.cisco.jabber.guest.RemoteView>
Add onPause() and replace onCreate with the following code to your MainActivity.java class. You will need to specify your own URI target in the JabberCall.createInstance() method.
<com.cisco.jabber.guest.RemoteView
android:id="@+id/remoteView"
android:layout_width="wrap_content"
android:layout_height="wrap_content" >
</com.cisco.jabber.guest.RemoteView>
When you launch the application, a call should be made to your specified URI.