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 read a .txt file from SDCard and display its contents(data in Text file) on TextView in Android

TextView textView=(TextView)findViewById(R.id.TextView1);
        try{
            File f = new File(Environment.getExternalStorageDirectory()+"/displayPDFinWebView.txt");
            FileInputStream fileIS = new FileInputStream(f);
            StringBuilder builder=new StringBuilder();
            BufferedReader buf = new BufferedReader(new InputStreamReader(fileIS));
            String readString = new String();
            //just reading each line and pass it on the debugger
            while((readString = buf.readLine())!= null){
                //textView.setText(readString);
                builder.append(readString);
               Log.d("line: ", readString);
            }
            textView.setText(builder);
         } catch (FileNotFoundException e) {
            e.printStackTrace();
         } catch (IOException e){
            e.printStackTrace();
         }

Comments