Skip to main content

Featured

Android studio “SDK tools directory is missing”

Following 2 possible solutions will resolve this problem :  Solution1 : To fix the problem, it was required that I list the path to my corporate PAC file by using  Configure -> "Appearance and Behavior" -> System Settings -> HTTP Proxy . I selected "Automatic proxy configuration url:" Delete your  ~/.Android*  folders (losing all of your settings :/). Run Android Studio. It will show you a welcome wizard where it tries to download the SDK again (and fails due to my rubbish internet). Click the X on the wizard window. That will enable you to get to the normal welcome dialog. Go to Settings->Project Defaults->Project Structure and change the Android SDK location to the correct one. Solution 2 : To fix the problem, it was required that I list the path to my corporate PAC file by using  Configure -> "Appearance and Behavior" -> System Settings -> HTTP Proxy . I selected "Automatic proxy configuration url:&quo

Code to get diffrence between two days in the form of totalHours and Days

 
long diffInMillisec = eventdate.getTime() -eventEndDate.getTime();
         long diffInSec = TimeUnit.MILLISECONDS.toSeconds(diffInMillisec);
         System.out.println("-----------diffInSec------------"+diffInSec);
         
         long diffInHours = TimeUnit.HOURS.toSeconds(diffInMillisec);
         System.out.println("-----------diffInHours------------"+diffInHours);
         
         long seconds = diffInSec % 60;
         System.out.println("-----------seconds------------"+seconds);
         diffInSec/= 60;
         long minutes =diffInSec % 60;
         System.out.println("-----------minutes------------"+minutes);
         diffInSec /= 60;
         long hours = diffInSec % 24;
         System.out.println("-----------hours------------"+hours);
         diffInSec /= 24;
         long days = diffInSec;
         System.out.println("-----------days------------"+days);
         
         long totalHours=(days*24)+hours;
         System.out.println("-----------Total no.of Hours------------"+totalHours);

Comments