Tuesday, May 26, 2009

Android Icon Guidelines


Media_httpdocsgooglec_aeshr

For our second post in our series on Android UI, we're releasing our Icon Design Guidelines and an Android Icon Templates Pack. These should make it a lot easier for you (or your designer) to develop all the icons your applications need, so they fit with the other icons in the Android environment.

The Icon Design Guidelines document describes how to design and export icons that fit within the Android framework. It includes a wealth of detail about icons in the Home screen, menus, the status bar, tabs, dialogs, and lists.

The Android Icon Templates Pack is a collection of template designs, filters, and settings that make it easier for you to create icons that conform to the general specifications given in this Guidelines document. We recommend downloading the template pack archive before you get started with your icon design.

The Templates Pack provides templates in Adobe Photoshop and Adobe Illustrator file formats, which preserves the layers and design treatments we used when creating the standard icons for the Android platform. You can load the template files into any compatible image-editing program, although your ability to work directly with the layers and treatments may vary based on the program you are using.

Friday, May 22, 2009

Lightning talks at Google I/O

Google I/O is approaching, and with over ten quality talks lined up, we should all strive to be attentive, avid learners. But for the last Android session of the conference, we thought it would be fun to unwind and open up the podium for lightning talks. This is where anyone can take the stage for six minutes and talk about anything. If you've done a cool hack involving Android, if you've devised a clever technique for a common problem, or even if you just want to get up on your soapbox for six minutes to appeal to your fellow developers, this is your time to be heard.

For those planning on attending Google I/O, we need you to submit and judge lightning talk proposals through a Google Moderator series we've set up. Please go ahead and start submitting your proposals. You only have 250 characters to describe the talk, which may be 110 more characters than you've been used to these days.

Voting is open from now until the moment the session starts. We'll take the eight highest rated talks and will call upon each speaker to take the stage. Remember you only have six minutes. Exceed that, and our security force tackles you off the stage. Thanks and see you all at I/O!


Media_http1bpblogspot_brnaz

Monday, May 18, 2009

Natalie Portman Denies Rumors She Is Dating Sean Penn Photos



Media_httpstupidceleb_qpchk


Actress Natalie Portman is shooting down rumors that she is romantically linked to actor Sean Penn, who recently filed for “legal separation” from his wife Robin Wright Penn after 13 years of marriage. Read more on this story below.



Let’s hope this is truly a rumor. Natalie Portman is way too pretty and smart to be with Sean Penn.



Portman has denied dating Sean Penn.



“Sean Penn is a friend and colleague,” Portman said. “The reports that we are romantically involved are completely untrue. I normally do not respond to rumors about my private life, however, this repeatedly fabricated story has forced me to do so.”



Tabloids stated that Natalie Portman and Sean Penn were seen together at a West Hollywood bar shortly after Sean Penn had separated from Robin Wright Penn.



Both Sean Penn and Natalie Portman served on the 2008 Cannes Film Festival jury.



Sean Penn is separated from Robin Wright Penn and Natalie Portman broke off her relationship with folk rocker Devendra Banhart last year.


Sandiago Earthquake Long Beach

Whoa...just felt my first official San Diego earthquake ! The whole building trembled - enough that I was worried about our wine glasses which were banging into each other quite hard. DH says that the quake started up in LA.

Even tho they are quite insignificant in San Diego. I am personally all for dying tho by the hands of a natural disaster. Or a fighter jet crashing into me (yes, that actually does happen and no I am being serious about that being a way.

A magnitude 5.0 earthquake occurred in the Los Angeles, California area at about 8:39 PM local time. Several thousand people reported to the USGS “Did you feel it?” page within twenty minutes of the earthquake.

The quake jiggled the greater Los Angeles region and was felt as far south as San Diego, said USGS seismologist Susan Hough. “This was a serious jolt. It was probably felt within 100 miles

Saturday, May 16, 2009

Shannen Doherty Photos Labeled A Homewrecker



Media_httpstupidceleb_miiia



Shannen Doherty has been dating photographer Kurt Iswarienko since last November, but guess what? He’s still married! Read more on Shannen Doherty and her hubby-stealing ways below.

According to Star Magazine’s May issue, which is out today, Shannen Doherty is a homewrecker.

Kurt Iswarienko reportedly filed for divorce from fashion designer Taryn Band last Christmas Eve. Of course Doherty’s rep says the couple didn’t start dating until after the split, but Taryn’s mom has disagrees.

“Shannen broke up a marriage… and that’s all I’m going to say!” Taryn’s mother, Debra, told Star Magazine.

And this isn’t Shannen Doherty’s first rendezvous with a married man! Doherty dated Australian actor, Julian McMahon, when he appeared on her WB series. Shannen and Julian were seen together on the isle of St. Barts, while McMahon was still married to actress Brooke Burns.

But truly… what did we expect from 90210’s evil “Brenda”?


Thursday, May 7, 2009

Jon & Kate Plus 8’s Jon Gosselin Cheating With Deanna Hummel Confirmed Video



Media_httpstupidceleb_zjegb


Jon Gosselin of “Jon and Kate Plus 8 has been caught cheating with a third grade teacher named Deanna Hummel. Hummel’s relatives confirm the affair. Read more on Jon Gosselin’s cheating and see video below.


In the new issue of Us Weekly, five people have come forward to confirm that Jon Gosselin, 32, has been having an affair with a third grade schoolteacher, Deanna Humel.


Deanna’s older brother and roommate, Jason, told US Weekly that he is speaking out to protect his sister and to set the record straight.

“She’s a nice girl, not a homewrecker,” Jason told Us Weekly. “He is a bad liar. This isn’t healthy for her. But she is refusing to help herself, so here I am trying to help her myself. I hope this clears the air.”

Jon Gosselin met Deanna Hummel in mid-January at Chill Lounge in Reading, Pennsylvania. Then Jon Gosselin, who has twins, age 8, and sextuplets, age 5, began pursuing a relationship with his sister. Then in February, Gosselin as coming over to their house.

While Kate Gosselin was traveling, Jon had Deanna come over to sunbathe in his front lawn. This went on just a week after they were seen together at Legends Lounge at 2 a.m. Photos taken that night show Jon not wearing his wedding band.

Deanna’s big brother Jason says Deanna and Jon would “pretty much stay locked away like two teenagers. It was weird. He’s a grown man.”

Jason added even more intimate details saying, “A lot of the time, it was pretty, um, gross listening to her, you know, um — how do I say this? The walls are thin. Let’s just say that. I mean, no one wants to hear his sister having sex, let alone with a married dude who’s, like, almost twice her age and who has eight kids and a maybe-crazy wife. Ick. Nast.”

This is some pretty damning evidence US Magazine has produced, what do you guys think?


Wednesday, May 6, 2009

Painless threading

Whenever you first start an Android application, a thread called "main" is automatically created. The main thread, also called the UI thread, is very important because it is in charge of dispatching the events to the appropriate widgets and this includes the drawing events. It is also the thread you interact with Android widgets on. For instance, if you touch the a button on screen, the UI thread dispatches the touch event to the widget which in turn sets its pressed state and posts an invalidate request to the event queue. The UI thread dequeues the request and notifies the widget to redraw itself.

This single thread model can yield poor performance in Android applications that do not consider the implications. Since everything happens on a single thread performing long operations, like network access or database queries, on this thread will block the whole user interface. No event can be dispatched, including drawing events, while the long operation is underway. From the user's perspective, the application appears hung. Even worse, if the UI thread is blocked for more than a few seconds (about 5 seconds currently) the user is presented with the infamous "application not responding" (ANR) dialog.

If you want to see how bad this can look, write a simple application with a button that invokes Thread.sleep(2000) in its OnClickListener. The button will remain in its pressed state for about 2 seconds before going back to its normal state. When this happens, it is very easy for the user to perceive the application as slow.

Now that you know you must avoid lengthy operations on the UI thread, you will probably use extra threads (background or worker threads) to perform these operations, and rightly so. Let's take the example of a click listener downloading an image over the network and displaying it in an ImageView:


public void onClick(View v) {
new Thread(new Runnable() {
public void run() {
Bitmap b = loadImageFromNetwork();
mImageView.setImageBitmap(b);
}
}).start();
}


At first, this code seems to be a good solution to your problem, as it does not block the UI thread. Unfortunately, it violates the single thread model: the Android UI toolkit is not thread-safe and must always be manipulated on the UI thread. In this piece of code, the ImageView is manipulated on a worker thread, which can cause really weird problems. Tracking down and fixing such bugs can be difficult and time-consuming.

Android offers several ways to access the UI thread from other threads. You may already be familiar with some of them but here is a comprehensive list:

Any of these classes and methods could be used to correct our previous code example:


public void onClick(View v) {
new Thread(new Runnable() {
public void run() {
final Bitmap b = loadImageFromNetwork();
mImageView.post(new Runnable() {
public void run() {
mImageView.setImageBitmap(b);
}
});
}
}).start();
}


Unfortunately, these classes and methods also tend to make your code more complicated and more difficult to read. It becomes even worse when your implement complex operations that require frequent UI updates. To remedy this problem, Android 1.5 offers a new utility class, called AsyncTask, that simplifies the creation of long-running tasks that need to communicate with the user interface.

AsyncTask is also available for Android 1.0 and 1.1 under the name UserTask. It offers the exact same API and all you have to do is copy its source code in your application.

The goal of AsyncTask is to take care of thread management for you. Our previous example can easily be rewritten with AsyncTask:


public void onClick(View v) {
new DownloadImageTask().execute("http://example.com/image.png");
}

private class DownloadImageTask extends AsyncTask<string, void,="" bitmap=""> {
protected Bitmap doInBackground(String... urls) {
return loadImageFromNetwork(urls[0]);
}

protected void onPostExecute(Bitmap result) {
mImageView.setImageBitmap(result);
}
}


As you can see, AsyncTask must be used by subclassing it. It is also very important to remember that an AsyncTask instance has to be created on the UI thread and can be executed only once. You can read the AsyncTask documentation for a full understanding on how to use this class, but here is a quick overview of how it works:

In addition to the official documentation, you can read several complex examples in the source code of Shelves (ShelvesActivity.java and AddBookActivity.java) and Photostream (LoginActivity.java, PhotostreamActivity.java and ViewPhotoActivity.java). I highly recommend reading the source code of Shelves to see how to persist tasks across configuration changes and how to cancel them properly when the activity is destroyed.

Regardless of whether or not you use AsyncTask, always remember these two rules about the single thread model: do not block the UI thread and make sure the Android UI toolkit is only accessed on the UI thread. AsyncTask just makes it easier to do both of these things.

If you want to learn more cool techniques, come join us at Google I/O. Members of the Android team will be there to give a series of in-depth technical sessions and answer all your questions.