How would you check if a String was a number before parsing it?
If you using java to develop Android app, you could using TextUtils.isDigitsOnly function.