среда, 15 июня 2011 г.

Using the Contact Picker. Getting phone and send sms

How to get email or phone from contacts and use it in your app?
This tutorial will start out simple, but then we’ll get in to some of the technical details of using Contacts with the ContactsContract class, which was introduced in API Level 5.

Step 1: Launching the Contact Picker

import android.provider.ContactsContract.Contacts;  
import android.provider.ContactsContract.CommonDataKinds.Phone;  

private static final int CONTACT_PICKER_RESULT = 1001;  
  
public void doLaunchContactPicker(View view) {  
    Intent contactPickerIntent = new Intent(Intent.ACTION_PICK,  
            Contacts.CONTENT_URI);  
    startActivityForResult(contactPickerIntent, CONTACT_PICKER_RESULT);  
}

Once launched, the contacts picker in your application will look something like this:

пятница, 29 апреля 2011 г.

воскресенье, 3 апреля 2011 г.

Simon Sinek: How great leaders inspire action | Video on TED.com

Simon Sinek: How great leaders inspire action | Video on TED.com
Замечательная лекция с не менее замечательными примерами, в которой показано, что нужно все начинать с вопроса Зачем?, а уже потом подходить к вопросам Как? и Что?

пятница, 1 апреля 2011 г.

How to show/hide the Android Soft Keyboard

If You need to show or to hide a virtual (soft) keyboard in Android app:
To hide:
InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
imm.hideSoftInputFromWindow(myEditText.getWindowToken(), 0);
This will force the keyboard to be hidden in all situations. In some cases you will want to pass in InputMethodManager.HIDE_IMPLICIT_ONLY as the second parameter to ensure you only hide the keyboard when the user didn't explicitly force it to appear (by holding down menu).

To show:
InputMethodManager imm = (InputMethodManager)getSystemService(Context.INPUT_METHOD_SERVICE);
imm.showSoftInput(myEditText, 0);

понедельник, 7 марта 2011 г.

Android Gingerbread Easter Egg

For the Android device owners out there who have upgraded to Gingerbread, have you found the Gingerbread Easter Egg?
Just go to the ‘About Phone’ menu under Settings, and tap multiple times on the Android version field and you should get the ‘Zombie Art’ featured in the thumbnail.
If you found this yourself with no help, well done and if you find anymore, make sure to post where you found it in the comments below!

Watch Android Take Over the World

The official Android Developers channel on YouTube has posted a beautiful vizualization of Android activations around the world starting in October, 2008, and progressing through January 2011. Quite impressive to watch -- especially the huge jump in activity when the Droid launched.
The video has no sound, so don't bother checking to see if you have mute on like I did. I'd recommend cuing up some dramatic musicbefore you hit play to enhance the experience.
Today finds us learning of another video which puts the more than 350,000 current daily activations into perspective.  Check out the video below for a clever infographic-like take on how Android is quickly becoming the preferred mobile OS around the world.