I have tried to get a string resource via getResources().getString(R.string.msg_err). Under values/strings.xml. I am 100% sure there is msg_err value. But I still got Resource$NotFoundException. But after I added msg_err1 value in text view mode, that works. I found the problem it cannot get the value if you create key value pair in "Resources" Tab in the string.xml. That is very strange!
DhcpInfo.dns1 and DhcpInfo.dns2 is an integer, not a readable IP string,"x.x.x.x". That is hard to understand. I did a search in internet. There are a number of people to write their own function to do that. Actually, Android SDK has a formatter to do that.
I found the jQuery validation is very good! Moreover, that is very easy to customize the error message. You just need to put the message in the "title" attribute.
In the most situation, XML file is case-insensitive. I thought that is the same case as Android Layout XML. There is no different between
I tried to use JQuery Validation. That is the easiest form validation library!!!!!
I just need to include the jquery library and its js file. Then I add these code in $(document).ready
This is the validation rule.
I think that is easier to explain in an example.
I got a form like this:
Then I just need add those code in $(document).ready
Then the form will be validated when the user submits the data.