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.
    public void onCreate(Bundle savedInstanceState) {
        String imageDates[]={"0105301213360198655510.jpg","010520121336019865556.jpg","010520121336019865557.jpg","010520121336019865558.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]);
    private void myMethod(String myImgName) {
        // TODO Auto-generated method stub


Popular posts from this blog

Custom Dialog with no title and full screen in Android

code to display .pdf,.text,.DOC,.DOCX,.doc extension files exists in SDCard

Best working code to set Date limits on Date Picker Dialog,in Android