Introduction

Vistrav provides very nice socialize feature. It is very easy to implement and maintain this feature into your application.

Install

Vistrav SDK available as zip file.Unzip the VistravSDK-x.x.zip file. The SDK contains the vistrav_sdk_x.x.jar file and vistrav.xml android layout file.

Setup

Drop the few lines of the code inside layout xml file on which you want to include vistrav functionality. Make sure that the layout where you include the vistrav.xml file shoul be either RelativeLayout or FrameLayout.

<?xml version="1.0" encoding="utf-8"?>

<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"

    android:layout_width="fill_parent"

    android:layout_height="fill_parent"

    android:orientation="vertical" >

 

    <TextView android:layout_width="fill_parent"  android:layout_height="wrap_content"  android:text="@string/hello" />

 

    <include  android:id="@+id/myVistrav" layout="@layout/vistrav" />

 

</RelativeLayout>

Drop the few lines of the code in your landing page of application as shown here(underlined). The application key will be the key generated on vistrav.com when you create application.

package com.vistrav.va.sample;

 

import android.app.Activity;

import android.os.Bundle;

 

import com.vistrav.sdk.VistravDialog;

import com.vistrav.sdk.VistravProxyActivity;

 

public class VistravAndroidActivity extends Activity {

      /**

       * application key provided by vistrav.com

       */

      private static final String APP_KEY = "aNZOBZ7XwGMMxxX";

 

      @Override

      public void onCreate(Bundle savedInstanceState) {

            super.onCreate(savedInstanceState);

            setContentView(R.layout.main);

            /* for notification */

            new VistravDialog(this, APP_KEY).webDialog();

            /* for comments */

            VistravProxyActivity.init(this, APP_KEY);

      }

}

Configure AndroidManifest.xml

Drop the few lines of the code for user-permissions in your application AndroidManifest.xml file as shown here.

<?xml version="1.0" encoding="utf-8"?>

<manifest ...>

 

    <uses-permission android:name="android.permission.INTERNET" />

    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

    <uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />

    <uses-permission android:name="android.permission.READ_PHONE_STATE" />

 

    <application>....    </application>

</manifest>