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 for converting the date in String format to Date format..and compare those two Dates in android..

String date=(String) android.text.format.DateFormat.format("MM/dd/yy", new java.util.Date());
        System.out.println("---date----"+date);
        String Date1 = "11-01-2011";
        String Date2 = "12-01-2011";
        ////String formatString = "MM-dd-yyyy"; // for example
        SimpleDateFormat df = new SimpleDateFormat("MM-dd-yyyy");
        Date date1=null;
        try {
            date1 = df.parse(Date1);
        } catch (ParseException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        Date date2=null;
        try {
            date2 = df.parse(Date2);
        } catch (ParseException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        if (date1.before(date2))
        System.out.println("first date is (smaller)earlier");
        else
        System.out.println("second date is (smaller)earlier");   

Comments