How to read OTP and paste into application using Java code

Hi Sachin,
use the switching concept …you can handle the OTP.!!!
1.Before switching to another application i.e(message) you should know the Activity and package name of it.
2.Read the OTP message and store/write the OTP in Excel sheet.
3.Switch to main application with it Activity and package name.
4.Read the the OTP from excel sheet and write into application.

Thanks,
Amit