Java code for App