Table data is normally repeatable by nature. ng-repeat directive can be used to draw table easily. Following example states the use of ng-repeat directive to draw a table. <table> <tr> <th> Name </th> <th> Marks </th> </tr> <tr ng-repeat = "subject in student.subjects" > <td> {{ subject.name }} </td> <td> {{ subject.marks }} </td> </tr> </table> Table can be styled using CSS Styling. <style> table , th , td { border : 1px solid grey ; border - collapse : collapse ; padding : 5px ; } table tr : nth - child ( odd ) { background - color : #f2f2f2; } table tr : nth - child ( even ) { background - color : #ffffff; } </style> Example Following example will showcase all the above mentioned directive. <html> <head> <...
Download Demo Application
Voxeet Android SDK
The SDK is a Java library allowing users to:
- Create demo/normal conferences
- Join conferences
- Change sounds angle and direction for each conference user
- Broadcast messages to other participants
- Mute users/conferences
- If you use External login like O365, LDAP, or custom login to retrieve contact details, it is now possible to also add your contact ID with the display name and the photo urrl avatar. This allows you to ask guest users to introduce themselves and provide their display name and for your authenticated users in your enterprise or for your clients the ID that can be retrieved from O365 (name, department, etc).
Installing the Android SDK using Gradle
To install the SDK directly into your Android project using the Grade build system and an IDE like Android Studio, add the following entry: "compile 'com.voxeet.sdk:core:0.7.750'" to your build.gradle file as shown below:
dependencies {
compile 'com.voxeet.sdk:core:0.7.750'
}
Recommended settings for API compatibility:
apply plugin: 'com.android.application'
android {
compileSdkVersion 21+
defaultConfig {
minSdkVersion 16
targetSdkVersion 21+
}
}
Permissions
Add the following permissions to your Android Manifest file:
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
// Used to change audio routes
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />
In order to target Android API level 23 or later, you will need to ensure that your application requests runtime permissions for microphone access. To do this, perform the following step:
Request microphone permissions from within your application code:
ActivityCompat.requestPermissions(this,
new String[]{Manifest.permission.RECORD_AUDIO}, MIC_PERMISSION_REQUEST_CODE);
}
See the Official Android Documentation for more details.
Consumer Key & Secret
Add your consumer key & secret to the xml string file of your application.
<string name="consumer_key">your consumer key</string>
<string name="consumer_password">your consumer password</string>
Available methods
Initializing
// To be called from the application class
VoxeetSdk.sdkInitialize(Context context, String consumerKey, String consumerSecret, null);
Creating a demo conference
VoxeetSdk.createDemoConference();
Creating a conference
VoxeetSdk.createConference();
Joining a conference
// Used to join someone's conference otherwise joining is automatic
VoxeetSdk.joinSdkConference(String conferenceId);
Leaving a conference
VoxeetSdk.leaveSdkConference();
Checking if a conference is live
VoxeetSdk.isSdkConferenceLive();
Changing user position
// Change user position using an angle and a distance
// Values for x, y are between : x = [-1, 1] and y = [0, 1]
VoxeetSdk.changePeerPosition(String userId, double x, double y);
Sending message in a conference
// Send messages such as JSON commands...
VoxeetSdk.sendBroadcastMessage(String message);
Getting current conference users
// Get current conference users
VoxeetSdk.sendSdkBroadcast();
Getting microphone state
// Get current conference users
VoxeetSdk.isSdkMuted();
Muting microphone
// Get current conference users
VoxeetSdk.muteSdkConference(boolean mute);
Muting user
// Muting or unmmuting an user depending on the boolean value
VoxeetSdk.muteSdkUser(String userId, boolean mute);
Checking if a user is muted
VoxeetSdk.isSdkUserMuted(String userId);
Getting available audio routes
// Get available audio routes
VoxeetSdk.getSdkAvailableRoutes();
Getting current audio route
VoxeetSdk.currentSdkRoute();
Setting audio route
VoxeetSdk.setSdkoutputRoute(AudioRoute route);
Registering the SDK
// Susbcribe to the SDK events
VoxeetSdk.register(Context context);
Unregistering the SDK
// Unsusbcribe from the SDK events
VoxeetSdk.unregister(Context context);
SDK Initialization
Initialize the SDK in the onCreate() method of your application class:
@Override
public void onCreate() {
super.onCreate();
VoxeetSdk.sdkInitialize(this, consumerKey, consumerSecret);
}
Activity Structure
In order to work properly, it is necessary to register and unregister the SDK respectively in the onCreate() and onDestroy() methods of your activity/fragment holding the conference.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
VoxeetSdk.register(this);
}
@Override
protected void onDestroy() {
super.onDestroy();
VoxeetSdk.unregister(this);
}
ConferenceUser Model
ConferenceUser model now has an userInfo object where infos are stored such as the external user id, the url avatar and display name.
public UserInfo getUserInfo();
Events
The SDK will dispatch events to the suscribed classes such as activities and fragments holding the conferences. To get notified, the only necessary step is to add those 4 methods below:
Conference joined
@Subscribe
public void onEvent(final ConferenceJoinedSuccessEvent event) {
// Action to be called when joining successfully the conference
}
Conference joined error
@Subscribe
public void onEvent(final ConferenceJoinedError event) {
// Action to be called if joining failed
}
Conference left
@Subscribe
public void onEvent(final ConferenceLeftSuccessEvent event) {
// Action to be called when leaving successfully the conference
}
Conference left error
@Subscribe
public void onEvent(final ConferenceLeftError event) {
// Action to be called when leaving the conference failed
}
Participant added
@Subscribe
public void onEvent(final ConferenceUserJoinedEvent event) {
// Action to be called when a new participant joins the conference
}
Participant status updated
@Subscribe
public void onEvent(final ConferenceUserUpdateEvent event) {
// Action to be called when a participant has left for example
}
Message received
@Subscribe
public void onEvent(MessageReceived event) {
// Action to be called when a message is received
}
Best practice regarding conferences
Only one instance of a conference is allowed to be live. Leaving the current conference before creating or joining another one is mandatory. Otherwise, a IllegalStateException will be thrown.
Version
0.7.750
Tech
The Voxeet Android SDK uses a number of open source projects to work properly:
- Retrofit2 - A type-safe HTTP client for Android and Java.
- GreenRobot/EventBus - Android optimized event bus.
- Jackson - Jackson is a suite of data-processing tools for Java.
- RxAndroid - RxJava is a Java VM implementation of Reactive Extensions: a library for composing asynchronous and event-based programs by using observable sequences.
Comments
Post a Comment
Comment