New in Telligent Evolution Platform SDK 5.5.1.
The Telligent Mobile Dashboard sample Android application included in version 5.5.1 of the Telligent Evolution Platform SDK was developed as a reference application for using many of the Platform APIs, including the new conversations/conversation messages endpoints. In this article you will find detailed implementation details of the sample application that will help you better understand the source code.
REST v2 Web Services conversations and conversation messages endpoints
The Telligent Mobile Dashboard makes use of many of the existing Platform APIs include friends, following, search, activity messages, status messages and two new Platform APIs: conversations and conversation messages. See the Conversations and Conversation Messages endpoint documentation for details.
Telligent Mobile Dashboard (Android) source code
The Telligent Mobile Dashboard (Android) sample application is made up of several types of files::
We have included several XML layout files in the project's \res\layout folder. Each of these files defines the layout for a specific portion of the application. Some files, like friends_tab.xml, friends.xml, pendingfriends.xml, and friend_row.xml work in conjunction to provide the layout for a singe screen. In this specific case, the friends_tab.xml file is a tabbed container, with the friends.xml and pendingfriends.xml files being specific tabs. The friend_row.xml file defines how each result row in the tab should look.
Inside the project's \src folder are several classes that are basically nothing more than simple local representations of Telligent Evolution objects. Some of these files include: ActivityMessage.java, Conversation.java, ConversationMessage.java, Friend.java, ReplyMessage.java, and StatusMessage.java.
Views (or activities) contain the logic for what information to display in a layout and how to wire up the functionality of a layout. The code in a view looks very similar to a code-behind page for those who have done .NET Web Forms development. Nearly all of the views in the sample application, except for Dashboard.java, have "View" in the file name so they are easily recognizable. View files in the application include: ActivityMessagesView.java, ConversationMessagesView.java, ConversationsView.java, and FollowersView.java.
The WebServiceHelper.java class does all the work of calling the Telligent Evolution REST v2 Web service endpoints and translating the Web service's JSON result into a local entity (or list of entities). This class returns a list of activity messages for the calling user, adds a status message, gets a list of friends, approve friendships, etc.
Working with the Telligent Mobile Dashboard (Android) source code
The Telligent Mobile Dashboard (Android) sample is a Java application written on the Android framework that targets Android mobile devices. You can examine the source code of the sample application by simply browsing the folder structure and opening the source code files in any text editor. To fully explore, modify, and deploy the code you will need the following:
- Recent Java Development Kit (JDK)
- Android SDK
- Java-capable IDE, like Eclipse
- (Optional) Android Development Kit (ADK) plugin for Eclipse
The Android Developer site provides a great step-by-step tutorial for installing an IDE, the Android SDK and getting started with Android development.
Before building the application you will have to download the Samba Java CIFS JAR file from the Samba project site and place it in the lib folder of the source code. The Samba Java CIFS library provides support for NTLM authentication.
You do not need an Android device for Android development, though it is useful. The Android SDK provides very capable device emulators that will prove more than sufficient for your development needs.
Using the Telligent Mobile Dashboard (Android)
Once you run the application, either on your Android device or in an emulator, you see the dashboard:
From the dashboard you can view status messages (of you, your friends, your groups), activity messages (of you, your friends, your groups), your conversations, your friends, search the site and more.
Before accessing any of the menu items you will be asked to provide your site's URL and your login information:
- Site Url: The base Url to your Telligent Evolution site.
- Site Username: Your username on the Telligent Evolution site.
- Site ApiKey: Your Api Key on the Telligent Evolution site.
- User to Impersonate: Normally blank, but can be used to impersonate another user. Typically used in conjunction with logging in as admin or a service account.
- Windows Username: if your Telligent Evolution site is behind windows authentication, typical for Telligent Enterprise using AD integration, you will have to provide your windows account username.
- Windows Password: the password for the username entered in the box above.
- Windows Domain: If you added a username and password in the two boxes above then you may need to provide a windows domain here. If your windows login looks like "company\username" then you will need to add the value for "company" from the example here.
- Show Online: Checking this will show you as online from the Telligent Mobile Dashboard (Android) application on your site.
You can change these settings at any time my accessing the menu from the home page and selecting "Settings".
Once your settings are correctly entered you can browse the application. Viewing activity messages, status messages, adding status messages, replying to messages, searching, etc. are all fairly self-explanatory.