<commit_before>Android-Features
================

Features is a utility class for Android that helps you manage the features of your app.

## How it works

Features loads and parses .properties files placed in **res/raw** of your application (it loads a debug file if debuggable is true), then uses a singleton pattern to front a hasFeature method that enables you to check if a feature is enabled or not.

## Implementation

First create a folder in your res folder named raw, then place two files there, one for the live build and one for the debug/dev (I usually name them features_app_debug.properties and features_app.properties)

Then open the files and specify the features using the following format (we parse them with java.util.Properties).

    YOURFEATURE1 = 0
    YOURFEATURE2 = 1


After that you need to include the utility and run createInstance when your app starts, I recommend you place it in application onCreate, like this:


    public class YourApplication extends Application {
        @Override
        public void onCreate() {
            Features.createInstance().load(this,
                R.raw.features_app_debug,
                R.raw.features_app);
        }
    }

You can also skip the validation part and load the features file directly.

    public class YourApplication extends Application {
        @Override
        public void onCreate() {
            Features.createInstance().load(this, R.raw.features_app_debug);
        }
    }




Then implement the feature by running something like this:

    if (Features.getInstance().hasFeature("YOURFEATURE")) {
        // Feature is enabled, do stuff!
    }<commit_msg>Added license info<commit_after>Android-Features
================

Features is a utility class for Android that helps you manage the features of your app.

## How it works

Features loads and parses .properties files placed in **res/raw** of your application (it loads a debug file if debuggable is true), then uses a singleton pattern to front a hasFeature method that enables you to check if a feature is enabled or not.

## Implementation

First create a folder in your res folder named raw, then place two files there, one for the live build and one for the debug/dev (I usually name them features_app_debug.properties and features_app.properties)

Then open the files and specify the features using the following format (we parse them with java.util.Properties).

    YOURFEATURE1 = 0
    YOURFEATURE2 = 1


After that you need to include the utility and run createInstance when your app starts, I recommend you place it in application onCreate, like this:


    public class YourApplication extends Application {
        @Override
        public void onCreate() {
            Features.createInstance().load(this,
                R.raw.features_app_debug,
                R.raw.features_app);
        }
    }

You can also skip the validation part and load the features file directly.

    public class YourApplication extends Application {
        @Override
        public void onCreate() {
            Features.createInstance().load(this, R.raw.features_app_debug);
        }
    }




Then implement the feature by running something like this:

    if (Features.getInstance().hasFeature("YOURFEATURE")) {
        // Feature is enabled, do stuff!
    }


## License

Android-Features is released under the [MIT License](http://www.opensource.org/licenses/MIT).
{'fraction_non_alphanumeric': 0.06693949137679041, 'fraction_numerical': 0.00233849751534639, 'mean_word_length': 3.1884944920440637, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '7089923', 'n_tokens_mistral': 836, 'n_tokens_neox': 805, 'n_words': 398}