add a class for code used in Activity, add a function to open keyboard