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 search is given string exists or not in a Sentence in Android

String haystack = "/mnt/sdcard/M_T_SURYA/M_T_SURYA/.DS_Store ";
        String needle1 = ".DS_Store";        
        int index1 = haystack.indexOf(needle1);      
        if (index1 != -1)
            System.out.println("The string contains the substring " + needle1);
        else
            System.out.println("The string does not contain the substring " + needle1);*/
       
        /*///code to devide a String into different parts based on given symbol (eg:'/')..
        String str = "http://9.dharani.org/Upendra/M_T_MAHESH.zip";
        StringTokenizer st = new StringTokenizer(str, "/");
        System.out.println("Tokens Count:  " + st.countTokens());
        String arrayString[]=new String[st.countTokens()];
        String lastString=null;
        int tokenCount=st.countTokens();
        for(int i=0;i<tokenCount;i++)
        {
            arrayString[i]=st.nextToken();
            lastString=arrayString[i];
             System.out.println("lastString :  " + lastString);
        }
        st = new StringTokenizer(lastString, ".");
        String folderName=st.nextToken();
        System.out.println("folderName :  " + folderName);

Comments