I was wondering what the best way to do a live character count of an edit-text box is in Android. I was looking at this but I couldn\'t seem to make any sense of it.
<
You can do character counting from xml itself using TextInputLayout wrapper for EditText introduced in SupportLibrary v23.1
Just wrap your EditText with a TextInputLayout and set CounterEnabled to true and Set a counterMaxLength.
You'll get a material effect like this
You may use counterOverflowTextAppearance , counterTextAppearance to style the counter.
EDIT
From Android documentation.
The TextInputEditText class is provided to be used as a child of this layout. Using TextInputEditText allows TextInputLayout greater control over the visual aspects of any text input. An example usage is as so:
TextInputLayout TextInputEditText