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

method used to convert date from integer to string(e.g: '12/29/2011 9:17:21 PM' to 'Tuesday,December 29th 2011'),in Android


where dateStr="12/29/2011 9:17:21 PM",and below method will convert this date to String format in Android..


public static String dateConverter(String dateStr){
            String violationdate = null;
            try{
                String s[]=dateStr.split("/");
               
                Log.d("****","dateStr"+dateStr);
               
                String month=SharedVariables.convertFromNumberToMonth(Integer.parseInt(s[0]));
                String day=s[1];
               
                String year=s[2].substring(0,4);
               
                int monthposition=0;
                for(int i=0;i<SharedVariables.months.length;i++)
                {
                    if(SharedVariables.months[i].equals(month))
                    {
                        monthposition=i;
                    }
                }
               
                Calendar xmas = new GregorianCalendar(Integer.parseInt(year),monthposition,Integer.parseInt(day));
                int dayOfWeek = xmas.get(Calendar.DAY_OF_WEEK);
               
                String weekdayname=SharedVariables.days[dayOfWeek-1]+", ";
               
                violationdate=weekdayname+month+" "+Integer.parseInt(day)+", "+year;
                }catch (Exception e) {
                    e.printStackTrace();
                    // TODO: handle exception
                }
            return violationdate;
           
           
        }

Comments