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 display image in ImageView using URL(using URL we can download image and display),in Android

String fileUrl ="http://www.whitec0de.com/wp-content/uploads/2011/12/adobe-acrobat.png";
                            //labelTV1.setImageURI(myUri);
                           
                            Bitmap bmImg;
                            URL myFileUrl =null;         
                              try {
                                   myFileUrl= new URL(fileUrl);
                              } catch (MalformedURLException e) {
                                   // TODO Auto-generated catch block
                                   e.printStackTrace();
                              }
                              try {
                                   HttpURLConnection conn= (HttpURLConnection)myFileUrl.openConnection();
                                   conn.setDoInput(true);
                                   conn.connect();
                                   InputStream is = conn.getInputStream();
                                  
                                   bmImg = BitmapFactory.decodeStream(is);
                                   labelTV1.setImageBitmap(bmImg);
                              } catch (IOException e) {
                                   // TODO Auto-generated catch block
                                   e.printStackTrace();
                              }

Comments