Antair Nightstand 1.5

Antair Nightstand 1.5 has been released for the BlackBerry PlayBook.

This release introduces two new animated themes.

The first, called Orion, has a beautiful background of a nebula, and features animated stars.

nightstand_orion_1

The second, called Fairies, features a relaxing scene with an animated moon and animated glowing fairies.

nightstand_fairies_1

Here is a short video of all the themes in Antair Nightstand 1.5

Watch it on YouTube in HD

Antair Nightstand running on a BlackBerry PlayBook

Here’s a short video we shot today of Antair Nightstand running on a BlackBerry PlayBook.

The Terminal theme really took a while to get right. As with the Digital Original and Blue Lagoon themes, the app needed to feel like a physical component from the real world that it was trying to mimic. But as where with Digital Original and Blue Lagoon, the app emulated the pixelated feel of a physical alarm clock, which is still a piece of consumer electronics, the Terminal theme needed to emulate something really physical; a panel of digits that physically flip over, as seen in airport or train station terminals.

After a *lot* of coding and experimentation and maths of various sorts, I think we finally got it right. Take a look:

Watch it on YouTube in HD

Listening to address book changes in your BlackBerry app.

Your BlackBerry application needs to know when the user adds, removes, or changes something in the BlackBerry address book. So, how would you go about implementing this?

Here is a simple class that will listen to changes in the BlackBerry address book:

import java.util.Enumeration;
import javax.microedition.pim.Contact;
import javax.microedition.pim.ContactList;
import javax.microedition.pim.PIMItem;
import javax.microedition.pim.PIMList;
import net.rim.blackberry.api.pdap.PIMListListener2;
 
final class MyPIMListener implements PIMListListener2
{
    public void itemAdded ( PIMItem item )
    {
        if ( item == null )
        {
            return;
        }
 
        Contact contact = (Contact)item;
        // ...
    }
 
    public void itemRemoved ( PIMItem item )
    {
        if ( item == null )
        {
            return;
        }
 
        Contact contact = (Contact)item;
        // ...
    }
 
    public void itemUpdated ( PIMItem oldItem, PIMItem newItem )
    {
        if ( oldItem == null || newItem == null )
        {
            return;
        }
 
        itemRemoved(oldItem);
        itemAdded(newItem);
    }
 
    public void batchOperation ( PIMList list )
    {
        if ( list == null )
        {
            return;
        }
 
        try
        {
            ContactList contactList = (ContactList)list;
            Enumeration e = contactList.items();
 
            while ( e.hasMoreElements() )
            {
                Contact contact = (Contact)e.nextElement();
                // ...
            }
        }
        catch ( Exception e )
        {
            // ...
        }
    }
}

To use the above class, you need to add an instance of it as a listener to the BlackBerry contact list. Here is how you would do that.

MyPIMListener listener = new MyPIMListener();
ContactList contactList = (ContactList)PIM.getInstance().openPIMList(
    PIM.CONTACT_LIST, PIM_READ_ONLY);
 
BlackBerryPIMList blackberryContactList = (BlackBerryPIMList)contactList;
blackberryContactList.addListener(listener);