hi, For an app i need to check whether TalkBack is active or not on the device and issue a message. How can this be done without plugins and just using Android Helper classes in unity. From a stack overflow thread i got the native code for this : Code (JavaScript): AccessibilityManager am = (AccessibilityManager) getSystemService(ACCESSIBILITY_SERVICE); boolean isAccessibilityEnabled = am.isEnabled(); boolean isExploreByTouchEnabled = am.isTouchExplorationEnabled(); How can we access this using android helper functions.. thanks in advance...
hi, I was able to figure it out myself. Here is the code: Code (CSharp): using (var unityPlayer = new AndroidJavaClass("com.unity3d.player.UnityPlayer")) { using (var activity = unityPlayer.GetStatic<AndroidJavaObject>("currentActivity")) { using (var context = activity.Call<AndroidJavaObject>("getApplicationContext")) { using (AndroidJavaObject accManager = context.Call<AndroidJavaObject>("getSystemService",new object[]{context.GetStatic<string>("ACCESSIBILITY_SERVICE")})) { return accManager.Call<bool>("isEnabled"); } } } }