a sample code for register native method