Skip to content

Instantly share code, notes, and snippets.

@flushpot1125
Created July 4, 2017 10:37
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/d4f26eb7a4434747971dedbf4f5517d9 to your computer and use it in GitHub Desktop.
Save flushpot1125/d4f26eb7a4434747971dedbf4f5517d9 to your computer and use it in GitHub Desktop.
package com.microsoft.CognitiveServicesExample;
import android.app.Activity;
import android.content.Intent;
import android.util.Log;
import android.app.Service;
import android.os.Bundle;
import com.unity3d.player.UnityPlayer;
import com.unity3d.player.UnityPlayerActivity;
import android.content.Context;
import android.content.ServiceConnection;
import android.content.ComponentName;
import android.os.IBinder;
public class NativeBridge {
private static MainActivity m_MainActivityService;
private static boolean mServiceBound = false;
public static Context sContext;
private static ServiceConnection mServiceConnection = new ServiceConnection() {
MainActivity myBinder;
@Override
public void onServiceConnected(ComponentName componentName, IBinder service) {
MainActivity.MyServiceLocalBinder myBinder =(MainActivity.MyServiceLocalBinder) service;
m_MainActivityService = (MainActivity) myBinder.getService();
mServiceBound = true;
Log.e("Unity", "Service connected: " + myBinder);
}
// continue..
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment