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

Best code to compare Two large Numbers,in Java/Android



///code to call a method if the value in array is greater than the given value.
@Override
    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.dummy);.
        String imageDates[]={"0105301213360198655510.jpg","010520121336019865556.jpg","010520121336019865557.jpg","010520121336019865558.jpg"
                ,"010520121336019865559.jpg","0105201213360198655510.jpg"};
        String myImgName="010520121336019865558.jpg";
        BigInteger notSoBig = new BigInteger(new StringTokenizer(myImgName, ".jpg").nextToken());//for removing .jpg extention from number
        for(int i=0;i<imageDates.length;i++)
        {
           
            BigInteger reallyBig = new BigInteger(new StringTokenizer(imageDates[i], ".jpg").nextToken());//for removing .jpg extention from number
           
            if(!notSoBig.equals(imageDates[i])){//if Both strings r equal control not enters into if condition
            reallyBig = reallyBig.max(notSoBig);//returns Big value
           
            if(!reallyBig.equals(notSoBig)){//if Both are not equal then we got max value from array
            System.out.println("=====reallyBig value=="+reallyBig);
            System.out.println("=====arrayBig value=="+imageDates[i]);
            myMethod(imageDates[i]);
            }//inner-if
           
            }//outer-if
           
           
        }//for
       
       
               
    }///onCreate()..
   
   
    private void myMethod(String myImgName) {
        // TODO Auto-generated method stub
       
    }

Comments