Skip to content

Instantly share code, notes, and snippets.

@flushpot1125
Created July 2, 2017 01:52
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save flushpot1125/1c06bc192c8f65903dddb081e1f385b3 to your computer and use it in GitHub Desktop.
Save flushpot1125/1c06bc192c8f65903dddb081e1f385b3 to your computer and use it in GitHub Desktop.
using UnityEngine;
using System.Collections;
using UnityEngine.UI;
public class Unity_Android.cs : MonoBehaviour {
public Text text;
/*part of the github
* https://github.com/flushpot1125/CognitiveSpeech-STT-Android_Unity
*/
public void bindService_Start(){
Debug.Log("Unity test bindService Start");
AndroidJavaClass unityPlayer = new AndroidJavaClass("com.unity3d.player.UnityPlayer");
AndroidJavaObject currentUnityActivity = unityPlayer.GetStatic<AndroidJavaObject>("currentActivity");
AndroidJavaClass plugin = new AndroidJavaClass("com.microsoft.CognitiveServicesExample.NativeBridge");
plugin.CallStatic("startBindService",currentUnityActivity);
}
//以後続く
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment