Exemplo n.º 1
0
            public DataExportServiceProxy()
                : base("org.ekstep.genieservices.sdks.export.IManageDataExport")
            {
                AndroidJavaObject sdkService = new AndroidJavaObject("org.ekstep.genieservices.sdks.SdkFactory");

                sdkService.Call("initializeExportService", AndroidHelper.GetCurrentActivity(), this);
            }
Exemplo n.º 2
0
        public void ShowAndDispose()
        {
            AndroidJavaObject context    = AndroidHelper.GetCurrentActivity().Call <AndroidJavaObject>("getApplicationContext");
            AndroidJavaObject toastClass = new AndroidJavaClass("android.widget.Toast");

            AndroidJavaObject toastObject = toastClass.CallStatic <AndroidJavaObject>("makeText", context, m_Message, (int)m_Duration);

            toastObject.Call("show");

            toastClass.Dispose();
            toastObject.Dispose();
            context.Dispose();
        }
Exemplo n.º 3
0
    static public void KillActivity()
    {
        Application.Quit();
#if UNITY_ANDROID && !UNITY_EDITOR
        try
        {
            AndroidJavaObject currentActivity = AndroidHelper.GetCurrentActivity();
            currentActivity.Call("finish");
        }
        catch (System.Exception e)
        {
            Debug.LogFormat("Unable to kill application: {0}", e.Message);
        }
#endif
    }
Exemplo n.º 4
0
    static public void Vibrate(float inSeconds)
    {
#if UNITY_ANDROID
        AndroidJavaClass context    = new AndroidJavaClass("android.content.Context");
        string           serviceKey = context.GetStatic <string>("VIBRATOR_SERVICE");
        context.Dispose();

        AndroidJavaObject service = AndroidHelper.GetCurrentActivity().Call <AndroidJavaObject>("getSystemService", serviceKey);
        bool bHasVibrator         = service.Call <bool>("hasVibrator");
        if (bHasVibrator)
        {
            service.Call("vibrate", (long)(inSeconds * 1000));
        }
        service.Dispose();
#endif
    }
Exemplo n.º 5
0
    static public bool LaunchActivity(string inActivityName)
    {
#if UNITY_ANDROID && !UNITY_EDITOR
        try
        {
            AndroidJavaObject currentActivity = AndroidHelper.GetCurrentActivity();
            AndroidJavaObject packageManager  = currentActivity.Call <AndroidJavaObject>("getPackageManager");
            AndroidJavaObject launchIntent    = packageManager.Call <AndroidJavaObject>("getLaunchIntentForPackage", inActivityName);
            currentActivity.Call("startActivity", launchIntent);
            return(true);
        }
        catch (System.Exception e)
        {
            Debug.LogFormat("Unable to open '{0}': {1}", inActivityName, e.Message);
            return(false);
        }
#else
        return(false);
#endif
    }
Exemplo n.º 6
0
 public AlertDialogBuilder()
     : base(new AndroidJavaObject("android.app.AlertDialog$Builder", AndroidHelper.GetCurrentActivity()))
 {
     SetCancelable(false);
 }
Exemplo n.º 7
0
 public TelemetryProxy()
     : base(new AndroidJavaObject("org.ekstep.genieservices.sdks.Telemetry", AndroidHelper.GetCurrentActivity()))
 {
 }
Exemplo n.º 8
0
 public UserProfileProxy()
     : base(new AndroidJavaObject("org.ekstep.genieservices.sdks.UserProfile", AndroidHelper.GetCurrentActivity()))
 {
 }