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

simple code to find the Number of lines text exists in a TextView.Because we get the TextView Height in android

//using the Formula->"(eachLineHeight)*(n.Of lines in TextView)"..
        //before using below code u must set textView Width in .xml file as "android:lavout_width="200px"
        textView1=(TextView) findViewById(R.id.TextView1);
        textView1.setWidth(200);
        int charSize=200/8;
        System.out.println("------charSize--------"+charSize);
        String str=textView1.getText().toString();
        int count=0;
        int nbLines = 1;
        for(int i=0;i<str.length();i++)
        {
            count++;
            if(count>charSize)
            {
                count=0;
                nbLines++;
            }           
        }
        if(count>0)
            nbLines++;           
        System.out.println("************LineCount*****************"+nbLines);

Comments