Java.Lang.Thread thread = new Java.Lang.Thread(); IntPtr threadPointer = thread.Handle; IntPtr methodId = JNIEnv.GetMethodID(thread.Class.Handle, "getId", "()J"); long threadId = JNIEnv.CallNonVirtualLongMethod(threadPointer, thread.Class.Handle, methodId);
Java.IO.File file = new Java.IO.File("/sdcard/test.txt"); IntPtr filePointer = file.Handle; IntPtr methodId = JNIEnv.GetMethodID(file.Class.Handle, "lastModified", "()J"); long lastModifiedTime = JNIEnv.CallNonVirtualLongMethod(filePointer, file.Class.Handle, methodId);In this example, the last modified time of a file on the Android device's SD card is retrieved using the `lastModified()` method from C# code. The method ID of the `lastModified()` method is obtained using the `JNIEnv.GetMethodID` method. Package library: The `global::MonoJavaBridge.JNIEnv` class is part of the Mono.Android assembly, which is part of the Xamarin framework for developing Android apps using C#.