Posts

Using jquery date-time picker

It's very easy to use jquery date-timer picker in webpages. Here is a very simple way on how to do this. I'm going to create a html file that will demonstrate this so, first of all, create a html file and give it a name. In the header section of the html file, add the following link <link rel="stylesheet" href="jquery-ui-1.8.6.custom.css" type="text/css"> Download this css file from here and put it in the current directory. Create a folder in the current directory and give it name 'images'. Download this file and put it in the images folder. Now, add the following css code in the header <style type="text/css"> .ui-timepicker-div .ui-widget-header{ margin-bottom: 8px; } .ui-timepicker-div dl{ text-align: left; } .ui-timepicker-div dl dt{ height: 25px; } .ui-timepicker-div dl dd{ margin: -25px 0 10px 65px; } .ui-timepicker-div td { font-size: 90%; } </style> Now, download these three files fr...

Simple animation in android

Hi, here is a way to create a very simple animation in android. Probably you know that there are tow types of animations in android. 1. tween animation and 2. Frame animation I'm describing a simple example of tween animation. Let's start. suppose we have a ImageView on a LinearLayout. we want to create a animation so that the image will move from a point to another point. First we have to create a xml file in the res/layout folder in which we'll show the image. It may be something like this - <?xml version="1.0" encoding="utf-8"? > < LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:gravity="center" android:layout_gravity="center" android:layout_height="fill_parent" android:layout_width="fill_parent" > < ImageView android:background="@drawable/animtest" android:layout_w...

to get email address from the addressbook in android

courtesy to http://www.anddev.org/viewtopic.php?p=19672 first add uses_permissions for reading contacts in the manifest file. then add this code inside any function(i.e onCreate() of activity) Uri mContacts = Contacts.ContactMethods.CONTENT_URI; String[] projection = new String[] { Contacts.ContactMethods.PERSON_ID, Contacts.ContactMethods.DISPLAY_NAME, Contacts.ContactMethods.KIND, Contacts.ContactMethods.DATA }; Cursor c = this.managedQuery(mContacts, projection, null, null, Contacts.ContactMethods.DISPLAY_NAME + " ASC"); c.moveToFirst(); int previousId = -1; do { int personId = c.getInt(c .getColumnIndex(Contacts.ContactMethods.PERSON_ID)); if (personId != previousId) { String personName = c.getString(c .getColumnIndex(Contacts.ContactMethods.DISPLAY_NAME)); Log.i("name",personName); } int dataKind = c.getInt(c .getColumnIndex(Contacts.ContactMethods.KIND)); if (dataKind == 1) { String personE...