Sunday, June 16, 2013

Android Volume Booster

Android Volume Booster is the great tool to optimize your phone's volume.

Android Volume Booster will make your phone sound and overall volume much more stronger.




Download Link :
https://play.google.com/store/apps/details?id=com.pratik.androidvolumebooster

Enjoy !!

Love Calculator Test HD

Love Calculator Test HD is an excellent tool to find love between your loved ones.

If you are in love with someone then you must give a try to Love Calculator Test HD app and find how much you are in love with your partner.









Download Link :

Friday, June 7, 2013

Way to Identify Mobile and Tablet Devices with simple flag condition

You can identify Mobile and Tablet Devices with simple flag condition.

Set a boolean value in a specific value file like say (res/values-xlarge/):

<resources>
    <bool name="isTabletDevice">true</bool>
</resources>

Then, in the "standard" value file like say (res/values/):

<resources>
    <bool name="isTabletDevice">false</bool>
</resources>

Then from your activity, fetch this flag value to check device type :

boolean tabletDeviceSize = getResources().getBoolean(R.bool.isTabletDevice);
if (tabletDeviceSize) {
    //use tablet code
} else {
    //use mobile code
}

Thanks.

Way to define a min and max value for EditText in Android

First make this class :

public class InputFilterMinMax implements InputFilter {

    private int min, max;

    public InputFilterMinMax(int min, int max) {
        this.min = min;
        this.max = max;
    }

    public InputFilterMinMax(String min, String max) {
        this.min = Integer.parseInt(min);
        this.max = Integer.parseInt(max);
    }

    @Override
    public CharSequence filter(CharSequence source, int start, int end, Spanned dest, int dstart, int dend) {   
        try {
            int input = Integer.parseInt(dest.toString() + source.toString());
            if (isInRange(min, max, input))
                return null;
        } catch (NumberFormatException nfe) { }     
        return "";
    }

    private boolean isInRange(int a, int b, int c) {
        return b > a ? c >= a && c <= b : c >= b && c <= a;
    }
}

Then use this from your Activity :

EditText et = (EditText) findViewById(R.id.myEditText);
et.setFilters(new InputFilter[]{ new InputFilterMinMax("1", "12")});

This will allow user to enter values from 1 to 12 only.
NOTE : Set your edittext with android:inputType="number".
Thanks.