Android: Minor changes to UserPreferences.java

- Use the character version of lastIndexOf
- Use a StringBuilder instead of a raw String. Doesn't destroy/recreate the string every time we append to it.