Chilkat Examples

ChilkatHOMEAndroid™Classic ASPCC++C#Mono C#.NET Core C#C# UWP/WinRTDataFlexDelphi ActiveXDelphi DLLVisual FoxProJavaLianjaMFCObjective-CPerlPHP ActiveXPHP ExtensionPowerBuilderPowerShellPureBasicCkPythonChilkat2-PythonRubySQL ServerSwift 2Swift 3/4TclUnicode CUnicode C++Visual Basic 6.0VB.NETVB.NET UWP/WinRTVBScriptXojo PluginNode.jsExcelGo

Android™ Web API Examples

Primary Categories

Facebook
GeoOp
Jira
PayPal
Peoplevox
QuickBooks

Shopify
Stripe
SugarCRM
Twitter
VoiceBase
Walmart
Xero
eBay
effectconnect

 

 

 

(Android™) VoiceBase -- Retrieve Plain Text Transcript

Retrieves a plain text transcript for a media file.

Chilkat Android™ Downloads

Android™ Java Libraries

Android C/C++ Libraries

// Important: Don't forget to include the call to System.loadLibrary
// as shown at the bottom of this code sample.
package com.test;

import android.app.Activity;
import com.chilkatsoft.*;

import android.widget.TextView;
import android.os.Bundle;

public class SimpleActivity extends Activity {

  private static final String TAG = "Chilkat";

  // Called when the activity is first created.
  @Override
  public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);

    // This example assumes the Chilkat HTTP API to have been previously unlocked.
    // See HTTP Unlock Sample for sample code.

    // Insert your Bearer token here:
    String accessToken = "VOICEBASE_TOKEN";

    CkHttp http = new CkHttp();

    // Add the access (bearer) token to the request, which is a header
    // having the following format:
    // Authorization: Bearer <userAccessToken>
    CkStringBuilder sbAuth = new CkStringBuilder();
    sbAuth.Append("Bearer ");
    sbAuth.Append(accessToken);
    http.SetRequestHeader("Authorization",sbAuth.getAsString());

    CkStringBuilder sbUrl = new CkStringBuilder();
    sbUrl.Append("https://apis.voicebase.com/v2-beta/media/$MEDIA_ID/transcripts/latest");
    int replaceCount = sbUrl.Replace("$MEDIA_ID","f9b9bb88-d52c-4960-bcef-d516a9f85594");

    http.put_Accept("text/plain");

    String strText = http.quickGetStr(sbUrl.getAsString());
    if (http.get_LastMethodSuccess() != true) {
        Log.i(TAG, http.lastErrorText());
        return;
        }

    Log.i(TAG, "Response status code = " + String.valueOf(http.get_LastStatus()));
    Log.i(TAG, strText);

    if (http.get_LastStatus() != 200) {
        Log.i(TAG, "Failed");
        }
    else {
        Log.i(TAG, "Success");
        }


  }

  static {
      System.loadLibrary("chilkat");

      // Note: If the incorrect library name is passed to System.loadLibrary,
      // then you will see the following error message at application startup:
      //"The application <your-application-name> has stopped unexpectedly. Please try again."
  }
}

 

© 2000-2019 Chilkat Software, Inc. All Rights Reserved.