Android Layout XML File is case-sensitive!
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
The Easiest Form Validation - JQuery Validation
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
Code
$([form element]).validate({rules: { | |
[field name]: { | |
[built-in Validation methods] | |
... | |
} | |
} | |
}); |
This is the validation rule.
I think that is easier to explain in an example.
I got a form like this:
Code
<form id="frm" method="POST"> | |
Name : <input type="text" id="name" name="name" /> <br/> | |
Email: <input type="text" id="email" name="email" /> | |
<input type="submit" id="submit" value="Submit"/> | |
</form> |
Then I just need add those code in $(document).ready
Code
$("#frm").validate({rules: { | |
email: { | |
required: true, | |
email: true | |
}, | |
name: "required" | |
} | |
}); |
Then the form will be validated when the user submits the data.
Android - On Screen Notification
In the C# Wolrd, we always use "MessageBox.Show (String)" to generate on screen notification (Pop-Up Message Box). In the Android, it has a similar thing calls toast. That is a small square box on the screen. Well, this is not just a single line of code, like Toast.Show(string). But that is just a few lines of codes more.
Code
Context context = getApplicationContext(); | |
CharSequence msgText= "Test"; | |
Toast toast = Toast.makeText(context,msgText, Toast.LENGTH_LONG); | |
toast.show(); |
Android 4.0
Apple has announced iPhone 4S and iOS 5 update. I need Google to response this news too! Last week, they has announced Galaxy Nexus and Android 4.0. That is the new generation of Google Phone! Moreover, that is the first Android which can use in Tablet and Phone! I hope we can get a Galaxy Nexus soon too!
Reference:
Android Blog
Good jQuery Drop down list
The traditional form drop down list is not very good for JSON and that is very hard to create some advanced css layout for it. So, I choose to use jQuery dropdown list. Finally, I shortlisted jALDropdown to be my choice. It supports JSON and CSS layout too! The documentation is comprehensive too!