Wednesday, December 30, 2009

[Gd] As one of the leading social networking sites in China, renren

| More

OpenSocial API Blog: As one of the leading social networking sites in China, renren

As one of the leading social networking sites in China, renren has always been a close partner of OpenSocial, following all the product and technology progress of OpenSocial. After one month of intensive development and testing, the renren Open Platform formally announced the support for OpenSocial 0.9.

This OpenSocial upgrade on Renren consists of the following progress:
  • Full support of all the features of OpenSocial v0.9
  • A more friendly payment interface
  • Support for the RESTful API of OpenSocial
  • More useful info on the wiki
After one year’s growth, over 2,000 third party applications have been launched on the renren Open Platform. A batch of top applications have acquired millions of users. In order to build a healthy and open environment for the developers to unleash their talents and realize the entrepreneurship, the renren Open Platform keeps improving the functionality and efficiency of its own API, and firmly chose OpenSocial as a open API standard.

OpenSocial helps developers to reduce the cost of development and implement features effectively. Especially for the overseas developers, it is quite easy for them to transplant the hot oversea OpenSocial-supported applications to China. The Renren Open platform has benefited a lot from OpenSocial.

With innovation and openness, the Renren Open Platform will continue the partnership with OpenSocial, together with global developers, and drive the new Open Era of China internet.

Bo Li, Fusong Li and Jing Huang, renren.com
URL: http://blog.opensocial.org/2009/12/as-one-of-leading-social-networking.html

Tuesday, December 29, 2009

[Gd] 15 days, 8 countries and zillions of developers

| More

Google Wave Developer Blog: 15 days, 8 countries and zillions of developers

Leaving October spring weather in Sydney for a trip around Europe was not easy. But any doubts about the wiseness of our trip disappeared as we walked into the first GTUG event in London where 300+ developers showed up to learn more about the Google Wave APIs. We met two of the most prolific wave developers there (you might know them from extensions such as Rssybot and Votely) as well as meeting David Crane who asked for 1000 accounts for Global Youth Panel to debate climate change. As we flew from country to country, we continued to meet more developers whose enthusiasm for Wave gave us the energy to overcome our jetlag and see the sights of Europe.

Check out the lives waves, videos, and slides for the various events below:

London, England
Oct. 26:
GTUG London: Live waves, Blog post

Vienna, Austria
Oct 27:
TechEd SAP

Amsterdam, Netherlands
Oct. 28:
Dutch GTUG: Video
Oct. 30:
eComm Europe 2009: 30+ live waves, Many blog posts

Zurich, Switzerland
Nov. 2:
Google Wave Tech Talk: Live wave

Prague, Czech Republic
Nov. 6:
Google Developer Day: Prague: Wave APIs talk (and slides), Wave client talk

Moscow, Russia
Nov. 10:
Google Developer Day: Moscow: Wave APIs talk (in Vadim's native Russian!), Wave client talk, Live waves

Munich, Germany
Nov. 11:
GTUG Munich: Live wave, Video


We look forward to hearing about future Wave events put on by European developers, like the recently held 2-day Wave Hackathon in Munich.
See you next year, Europe!




Posted by Pamela Fox, Developer Relations
URL: http://googlewavedev.blogspot.com/2009/12/15-days-8-countries-and-zillions-of.html

Thursday, December 24, 2009

[Gd] Helping webmasters from user to user

| More

Official Google Webmaster Central Blog: Helping webmasters from user to user

You have to have some kind of super-powers to keep up with all of the issues posted in our Webmaster Help Forum—that's why we call our Top Contributors the "Bionic Posters." They're able to leap through tall questions in a single bound, providing helpful and solid information all around. We're thankful to the Bionics for tackling problems both hard and easy (well, easy if you know how). Our current Bionic Posters are: Webado (Christina), Phil Payne, Red Cardinal (Richard), Shades1 (Louis), Autocrat, Tim Abracadabra, Aaron, Cristina, Robbo, John, Becky Sharpe, Sasch, BbDeath, Beussery (Brian), Chibcha (Terry), Luzie (Herbert), 奥宁 (Andy), Ashley, Kaleh and Redleg!

With thousands of webmasters visiting the English Help Forum every day, some questions naturally pop up more often than others. To help catch these common issues, the Bionic Posters have also helped to create and maintain a comprehensive list of frequently asked questions and their answers. These FAQs cover everything from "Why isn't my site indexed?" to diagnosing difficult issues with the help of Google Webmaster Tools, often referring to our Webmaster Help Center for specific topics. Before you post in the forum, make sure you've read through these resources and do a quick search in the forum; chances are high that your question has been answered there already.

Besides the Bionic Posters, we're lucky to have a number of very active and helpful users in the forum, such as: squibble, Lysis, yasir, Steven Lockey, seo101, RickyD, MartinJ and many more. Thank you all for making this community so captivating and—most of the time—friendly.

Here are just a few (well, a little more than a few) of the many comments that we've seen posted in the forum:

  • "Thank you for this forum... Thank you to those that take the time to answer and care!"
  • "I've only posted one question here, but have received a wealth of knowledge by reading tons of posts and answers. The time you experts put into helping people with their problems is very inspiring and my hat's off to each of you. Anyway, I just wanted to let you know that your services aren't going unnoticed and I truly appreciate the lessons."
  • "Thank you very much cristina, what you told me has done the trick. I really appriciate the help as this has been bugging me for a while now and I didn't know what was wrong."
  • "thank you ssssssssssoooo much kaleh. "
  • "OK, Phil Payne big thanks to You! I have made changes and maybe people are starting to find me in G! Thanks to Ashley, I've started to make exclusive and relevant content for people."
  • "If anything, it has helped me reflect on the sites and projects of days gone by so as to see what I could have done better - so that I can deliver that much more and better results going forward. I've learned that some things I had done right, were spot on, and other issues could have been handled differently, as well as a host of technical information that I've stored away for future use. Bottom Line: this forum rocks and is incredibly helpful."
  • "I asked a handful of questions, got GREAT help while doing a whole lot of lurking, and now I've got a site that rocks!! (...) Huge thanks to all the Top Contributors, and a very special mention to WEBADO, who helped me a TON with my .htaccess file."
  • "Over the years of reading (and sometimes contributing) to this forum I think it has helped to remove many false assumptions and doubts over Google's ranking systems. Contrary to what many have said I verily believe Google can benefit small businesses. Keep up the good work. "
  • "The forum members are awesome and are a most impressive bunch. Their contribution is immeasurable as it is huge. Not only have they helped Google in their success as a profitable business entity, but also helped webmasters both aspiring and experienced. There is also an engender(ment) of "family" or "belonging" in the group that has transcended the best and worst of times (Current forum change still TBD :-) ). We can agree, disagree and agree to disagree but remain respectful and civil (Usually :-) )."
  • "Hi Redleg, Thank you very much for all of the information. Without your help, I don't think I would ever have known how to find the problem. "
  • "What an amazing board. Over the last few days I have asked 1 question and recieved a ton of advice mainly from Autocrat. "
  • "A big thank you to the forum and the contributors that helped me get my site on Google . After some hassle with my web hosters and their naff submission service, issues over adding pages Google can see, issues over Sitemaps, I can now say that when I put my site name into the search and when i put in [custom made watch box], for instance, my site now comes up."
  • "Thank you Autocrat! You are MAGNIFICENT! (...) I am your biggest fan today. : ) Imagine Joe Cocker singing With a Little Help from My Friends...that's my theme song today."
  • "I've done a lot of reading since then and I've learned more in the last year than I learned in the previous 10. When I stumbled into this forum I had no idea what I was getting into but finding this forum was a gift from God! Words cannot express the amount of gratitude I feel for the help you have given me and I wish I could repay you some how.... I don't mean to sound so mushy, but I write this with tears in my eyes and I am truly, truly grateful..."

Are you new to the Webmaster Help Forum? Tell us a little bit about yourself and then join us to learn more and help others!

Posted by John Mueller, Webmaster Trends Analyst, Google Zürich
URL: http://googlewebmastercentral.blogspot.com/2009/12/helping-webmasters-from-user-to-user.html

Wednesday, December 23, 2009

[Gd] Discover v2009: Location Extensions

| More

AdWords API Blog: Discover v2009: Location Extensions

Location, location, location: so goes the mantra of the real estate business. Although, in this constantly connected world where people are carrying Internet-enabled mobile devices more and more, location is important to every retail business. Often, users are looking for the closest provider of a service or a product, rather than your specific business.

So how can you get your business on the map? In the past, we had an entirely separate ad type: the Local Business Ad (LBA). But with the new AdWords interface and AdWords API v2009, we have a much simpler solution available: Location Extensions. These allow you to easily add location information to any text ad in your campaigns.

Let's look at an example. Say your business has a few branches open throughout the city, and you want to add location information to your existing ads. The first step is to retrieve the location of each branch, based on its address. That means making a call to the new GeoLocationService, which uses a process known as "geocoding."

// Create address object.
Address address = new Address();
address.setStreetAddress("123 Easy Street");
address.setCityName("Mountain View");
address.setProvinceCode("US-CA");
address.setPostalCode("94043");
address.setCountryCode("US");
// Get location information from the service.
GeoLocationSelector selector = new GeoLocationSelector();
selector.setAddresses(new Address[] {address});
GeoLocation[] locations = geoLocationService.get(selector);
location = locations[0];

The next step is to use the CampaignAdExtensionService to add a location extension to your campaign using the information returned by the GeoLocationService:

// Create LocationExtension.
LocationExtension locationExtension = new LocationExtension();
locationExtension.setAddress(location.getAddress());
locationExtension.setGeoPoint(location.getGeoPoint());
locationExtension.setEncodedLocation(location.getEncodedLocation());
locationExtension.setCompanyName("Foo");
locationExtension.setPhoneNumber("650-555-5555");
locationExtension.setSource(LocationExtensionSource.ADWORDS_FRONTEND);
// Create CampaignAdExtension.
CampaignAdExtension campaignAdExtension = new CampaignAdExtension();
campaignAdExtension.setCampaignId(campaignId);
campaignAdExtension.setAdExtension(locationExtension);
// Add location extension to the campaign.
CampaignAdExtensionOperation operation = new CampaignAdExtensionOperation();
operation.setOperand(campaignAdExtension);
operation.setOperator(Operator.ADD);
CampaignAdExtensionOperation[] operations =
new CampaignAdExtensionOperation[] {operation};
CampaignAdExtensionReturnValue result =
campaignAdExtensionService.mutate(operations);

Multiple location extensions can be added to the same campaign, and by default each ad in the campaign will be associated with every location. When serving your ad the AdWords system will choose the most relevant location to display to the user. Do keep in mind that there is a limit of 9 manually created location extensions per campaign. Alternatively you can have AdWords pull addresses directly from your Local Business Center (LBC) account, which isn't subject to the same restriction. For now, LBC synchronization is only supported via the AdWords interface, but the next API version will include support for it as well.

Of course, not all ads are created equal, and you may want some ads to target only a single store. In that case, the solution is to create an Ad Extension Override for the one location extension that you do want to associate with that ad:

// Create ad extension override for the specified ad Id.
AdExtensionOverride adExtensionOverride = new AdExtensionOverride();
adExtensionOverride.setAdId(adId);
// Create ad extension object using specified campaign ad extension Id.
// This will be the only extension used for the specified ad.
AdExtension adExtension = new AdExtension();
adExtension.setId(campaignAdExtensionId);
adExtensionOverride.setAdExtension(adExtension);
// Add the override.
AdExtensionOverrideOperation operation = new AdExtensionOverrideOperation();
operation.setOperand(adExtensionOverride);
operation.setOperator(Operator.ADD);
AdExtensionOverrideOperation[] operations =
new AdExtensionOverrideOperation[] {operation};
AdExtensionOverrideReturnValue result =
adExtensionOverrideService.mutate(operations);

If you're looking for more detailed examples, be sure to check the 'examples' directory for the client library of your choice.

Extending your ads with location information will enable them to be shown on Google.com and other properties (such as Google Maps), bringing you closer to your customers' local searches. That way they'll not only find out about your offers, they'll actually be able to find you.

-- Sérgio Gomes, AdWords API Team

URL: http://adwordsapi.blogspot.com/2009/12/discover-v2009-location-extensions.html

[Gd] "Enterprise OpenSocial White paper" now available!

| More

OpenSocial API Blog: "Enterprise OpenSocial White paper" now available!

OpenSocial emerged from the demands of consumer-facing social networking sites, including MySpace, LinkedIn, and Ning. The rise of online social networking, and the changing nature of the consumer web, have both made OpenSocial increasingly relevant to business and enterprises. Beyond social capabilities for accessing and sharing user profile, relationship and activity data, OpenSocial can also be used as a general purpose web application integration technology, providing open standards for browser-based components known as gadgets. For non-browser/ui data transfer OpenSocial also includes a REST based server-to-server protocol

Over the last few months, a small group of enterprise vendors have been working together to understand how each is using OpenSocial within their organizations, and identify requirements based upon their enterprise use cases. What started out as a panel session at Google IO in May of 2009, led to larger face to face meeting in September consisting of representatives from IBM, SAP, Atlassian, Alfresco, SocialText, Cisco, Cubetree, eXo Platform, Google and others. The result of that face to face meeting is the Enterprise OpenSocial white paper, a collaborative effort that discusses general requirements for enterprise social systems and describes how OpenSocial can be used today to address them. Not all requirements are met today, however, so the paper also outlines the current gaps and discusses how the specification might evolve to meet them.

The white paper is intended for IT professionals, development managers, and Chief Technology Officers (CTOs) who are leading organizational changes through social computing by embracing standards and Web 2.0 approaches. Our next face to face meeting is in late January 2010, so check out the Enterprise OpenSocial page on OpenSocial.org for more details. We hope that you find the paper enjoyable and educational. However, we recognize this is only the first step. Like the paper, we'll conclude with a call to action and encourage you to become involved and help shape OpenSocial.

Click here to read the "Enterprise OpenSocial White paper"!


Posted on behalf of the Enterprise OpenSocial team by Mark Weitzel (IBM) and Chris Schalk (Google)
URL: http://blog.opensocial.org/2009/12/enterprise-opensocial-white-paper-now.html

Tuesday, December 22, 2009

[Gd] JPA/JDO Java Persistence Tips - The Year In Review

| More

Google App Engine Blog: JPA/JDO Java Persistence Tips - The Year In Review

If you’re developing a Java application on App Engine you probably already know that you can use JPA and JDO, both standard Java persistence APIs, to interact with the datastore. What you may not know, and what I’m here to point out, is that for the past few months I’ve been accumulating a collection of practical, real-world examples that can help you take full advantage of these powerful APIs.



In episode one I put together a working example of an owned, bidirectional, one-to-many relationship and demonstrated how you can persist child objects just by associating them with parent objects. In episode two I demonstrated how to perform a batch get by issuing a query that only filters on the primary key property of your model object. In episode three I explored the exciting world of “transparent persistence,” explaining how you can modify the persistent state of objects without making any explicit calls to repersist them. In episode four I issued a keys-only query and got the results back crazy-fast because the datastore skipped the extra scan that turns keys into full-fledged entities. And in episode five I demonstrated how serialized fields can help you store arbitrary objects in the datastore.



After episode five I got a little bit tired, but there was still so much more to say, so I pressed on.



In episode six I powered through a discussion of long-running transactions and unearthed the ancient secret of how you can use optimistic locking to prevent users from updating stale data. In episode seven I explained how using unindexed properties can speed up your writes and save you valuable CPU time. In episode eight I attempted (cautiously) to blow your mind with a solution for case-insensitive queries. And finally, in episode nine, mere hours after releasing support for != and IN query operators in the SDK, I dove under the hood of these operators to help you understand their performance characteristics.



Many of these topics were inspired by questions from you, our users, so if there are topics you’d like to see covered in the coming year please let me know via the forum. As long as you keep reading and asking questions, I’ll keep writing.



Max Ross, App Engine Engineer
URL: http://googleappengine.blogspot.com/2009/12/jpajdo-java-persistence-tips-year-in.html

Monday, December 21, 2009

[Gd] This year in Custom Search

| More

Google Custom Search: This year in Custom Search


The Custom Search team has had a busy 2009. This is the year we turned 3. And now Custom Search is powering many tens of millions of queries a day on millions of small and large websites. We believe that search should be easy to deploy on your website, and, in addition to providing great relevance, should be flexible, customizable and feature-rich. With the help of your suggestions, we hope we are delivering on these goals.

This year, we hit many milestones. Here are some of the key developments:
  • integration with several hosters to bring Custom Search to your doorstep
  • enabled support for rich snippets, giving you more control over presentation of results
  • it's now easier for you to promote specific content to the top of your search results
  • we deployed contextual search within Blogger, Google Sites and Wikipedia
  • automatic transliteration is now integrated into the search box
  • improved results rendering flexibility with the Custom Search Element
  • plug-n-play with themes for enhanced customizability of results look and feel
  • added support for structured metadata and the ability to restrict results by specific attributes
  • we got you ready for the growing population of users searching your websites with mobile devices, such as Android phones, iPhone, iPod Touch, Palm Pre, etc.
And there's so much more to do with Custom Search. We'll be working next year to give you additional metadata support, more results customization, and search features that will make it even easier for your users to find the right information faster on your websites. Your users will be happier and you can focus on more important things.

As always, we're looking at your feedback to guide our efforts. And don't forget to follow us on Twitter. Meanwhile, happy holidays, and we'll see you soon ... in the next decade!

Posted by: Rajat Mukherjee for the Custom Search Team
URL: http://googlecustomsearch.blogspot.com/2009/12/this-year-in-custom-search.html

[Gd] A look back on 2009

| More

Google Code Blog: A look back on 2009

2009 was a remarkable year for developers. Vic Gundotra, VP of our developer team declared at Google I/O, "The web has won!" and this year was full of launches and announcements that remind us how the web has become the platform of our day. We found lots of inspiration from the developers at Google I/O in San Francisco and at our Google Developer Days in Japan, China, Brazil, Russia and the Czech Republic.



Here's a look back at some of our favorite highlights from 2009:
It is a very exciting time to be a developer...we are just starting to see what is possible with the web as the platform. It will be a lot of fun to see where all of us, together, can take the web in 2010!

Happy Holidays from the Google Developer Team!

By Mike Marchak, on behalf of the Google Developer Team
URL: http://googlecode.blogspot.com/2009/12/look-back-on-2009.html

Friday, December 18, 2009

[Gd] Hello, Stack Overflow!

| More

Android Developers Blog: Hello, Stack Overflow!

Over the past year, an Android presence has been growing on a relatively new technical Q&A web site called Stack Overflow. The site was designed specifically for programmers, with features like syntax highlighting, tagging, user reputation, and community editing. It's attracted a loyal software developer community, and developers continue to express great praise for this new tool. Well, the Android team has been listening...and we agree.

Today, I'm happy to announce that we're working with Stack Overflow to improve developer support, especially for developers new to Android. In essence, the Android tag on Stack Overflow will become an official Android app development Q&A medium. We encourage you to post your beginner-level technical questions there. It's also important to point out that we don't plan to change the android-developers group, so intermediate and expert users should still feel free to post there.

I think that this will be a great new resource for novice Android developers, and our team is really excited to participate in the growth of the Android developer community on Stack Overflow. I hope to see you all there!

URL: http://android-developers.blogspot.com/2009/12/hello-stack-overflow.html

[Gd] Back and other hard keys: three stories

| More

Android Developers Blog: Back and other hard keys: three stories

Android 2.0 introduces new behavior and support for handling hard keys such as BACK and MENU, including some special features to support the virtual hard keys that are appearing on recent devices such as Droid.

This article will give you three stories on these changes: from the most simple to the gory details. Pick the one you prefer.

Story 1: Making things easier for developers

If you were to survey the base applications in the Android platform, you would notice a fairly common pattern: add a little bit of magic to intercept the BACK key and do something different. To do this right, the magic needs to look something like this:

@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_BACK && event.getRepeatCount() == 0) {
// do something on back.
return true;
}

return super.onKeyDown(keyCode, event);
}

How to intercept the BACK key in an Activity is also one of the common questions we see developers ask, so as of 2.0 we have a new little API to make this more simple and easier to discover and get right:

@Override
public void onBackPressed() {
// do something on back.
return;
}

If this is all you care about doing, and you're not worried about supporting versions of the platform before 2.0, then you can stop here. Otherwise, read on.

Story 2: Embracing long press

One of the fairly late addition to the Android platform was the use of long press on hard keys to perform alternative actions. In 1.0 this was long press on HOME for the recent apps switcher and long press on CALL for the voice dialer. In 1.1 we introduced long press on SEARCH for voice search, and 1.5 introduced long press on MENU to force the soft keyboard to be displayed as a backwards compatibility feature for applications that were not yet IME-aware.

(As an aside: long press on MENU was only intended for backwards compatibility, and thus has some perhaps surprising behavior in how strongly the soft keyboard stays up when it is used. This is not intended to be a standard way to access the soft keyboards, and all apps written today should have a more standard and visible way to bring up the IME if they need it.)

Unfortunately the evolution of this feature resulted in a less than optimal implementation: all of the long press detection was implemented in the client-side framework's default key handling code, using timed messages. This resulted in a lot of duplication of code and some behavior problems; since the actual event dispatching code had no concept of long presses and all timing for them was done on the main thread of the application, the application could be slow enough to not update within the long press timeout.

In Android 2.0 this all changes, with a real KeyEvent API and callback functions for long presses. These greatly simplify long press handling for applications, and allow them to interact correctly with the framework. For example: you can override Activity.onKeyLongPress() to supply your own action for a long press on one of the hard keys, overriding the default action provided by the framework.

Perhaps most significant for developers is a corresponding change in the semantics of the BACK key. Previously the default key handling executed the action for this key when it was pressed, unlike the other hard keys. In 2.0 the BACK key is now execute on key up. However, for existing apps, the framework will continue to execute the action on key down for compatibility reasons. To enable the new behavior in your app you must set android:targetSdkVersion in your manifest to 5 or greater.

Here is an example of code an Activity subclass can use to implement special actions for a long press and short press of the CALL key:

@Override
public boolean onKeyLongPress(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_CALL) {
// a long press of the call key.
// do our work, returning true to consume it. by
// returning true, the framework knows an action has
// been performed on the long press, so will set the
// canceled flag for the following up event.
return true;
}
return super.onKeyLongPress(keyCode, event);
}
@Override
public boolean onKeyUp(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_CALL && event.isTracking()
&& !event.isCanceled()) {
// if the call key is being released, AND we are tracking
// it from an initial key down, AND it is not canceled,
// then handle it.
return true;
}
return super.onKeyUp(keyCode, event);
}

Note that the above code assumes we are implementing different behavior for a key that is normally processed by the framework. If you want to implement long presses for another key, you will also need to override onKeyDown to have the framework track it:

@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (keyCode == KeyEvent.KEYCODE_0) {
// this tells the framework to start tracking for
// a long press and eventual key up. it will only
// do so if this is the first down (not a repeat).
event.startTracking();
return true;
}
return super.onKeyDown(keyCode, event);
}

Story 3: Making a mess with virtual keys

Now we come to the story of our original motivation for all of these changes: support for virtual hard keys, as seen on the Droid and other upcoming devices. Instead of physical buttons, these devices have a touch sensor that extends outside of the visible screen, creating an area for the "hard" keys to live as touch sensitive areas. The low-level input system looks for touches on the screen in this area, and turns these into "virtual" hard key events as appropriate.

To applications these basically look like real hard keys, though the generated events will have a new FLAG_VIRTUAL_HARD_KEY bit set to identify them. Regardless of that flag, in nearly all cases an application can handle these "hard" key events in the same way it has always done for real hard keys.

However, these keys introduce some wrinkles in user interaction. Most important is that the keys exist on the same surface as the rest of the user interface, and they can be easily pressed with the same kind of touches. This can become an issue, for example, when the virtual keys are along the bottom of the screen: a common gesture is to swipe up the screen for scrolling, and it can be very easy to accidentally touch a virtual key at the bottom when doing this.

The solution for this in 2.0 is to introduce a concept of a "canceled" key event. We've already seen this in the previous story, where handling a long press would cancel the following up event. In a similar way, moving from a virtual key press on to the screen will cause the virtual key to be canceled when it goes up.

In fact the previous code already takes care of this — by checking isCanceled() on the key up, canceled virtual keys and long presses will be ignored. There are also individual flags for these two cases, but they should rarely be used by applications and always with the understanding that in the future there may be more reasons for a key event to be canceled.

For existing application, where BACK key compatibility is turned on to execute the action on down, there is still the problem of accidentally detecting a back press when intending to perform a swipe. Though there is no solution for this except to update an application to specify it targets SDK version 5 or later, fortunately the back key is generally positioned on a far side of the virtual key area, so the user is much less likely to accidentally hit it than some of the other keys.

Writing an application that works well on pre-2.0 as well as 2.0 and later versions of the platform is also fairly easy for most common cases. For example, here is code that allows you to handle the back key in an activity correctly on all versions of the platform:

@Override
public boolean onKeyDown(int keyCode, KeyEvent event) {
if (android.os.Build.VERSION.SDK_INT < android.os.Build.VERSION_CODES.ECLAIR
&& keyCode == KeyEvent.KEYCODE_BACK
&& event.getRepeatCount() == 0) {
// Take care of calling this method on earlier versions of
// the platform where it doesn't exist.
onBackPressed();
}

return super.onKeyDown(keyCode, event);
}

@Override
public void onBackPressed() {
// This will be called either automatically for you on 2.0
// or later, or by the code above on earlier versions of the
// platform.
return;
}

For the hard core: correctly dispatching events

One final topic that is worth covering is how to correctly handle events in the raw dispatch functions such as onDispatchEvent() or onPreIme(). These require a little more care, since you can't rely on some of the help the framework provides when it calls the higher-level functions such as onKeyDown(). The code below shows how you can intercept the dispatching of the BACK key such that you correctly execute your action when it is release.

@Override
public boolean dispatchKeyEvent(KeyEvent event) {
if (event.getKeyCode() == KeyEvent.KEYCODE_BACK) {
if (event.getAction() == KeyEvent.ACTION_DOWN
&& event.getRepeatCount() == 0) {

// Tell the framework to start tracking this event.
getKeyDispatcherState().startTracking(event, this);
return true;

} else if (event.getAction() == KeyEvent.ACTION_UP) {
getKeyDispatcherState().handleUpEvent(event);
if (event.isTracking() && !event.isCanceled()) {

// DO BACK ACTION HERE
return true;

}
}
return super.dispatchKeyEvent(event);
} else {
return super.dispatchKeyEvent(event);
}
}

The call to getKeyDispatcherState() returns an object that is used to track the current key state in your window. It is generally available on the View class, and an Activity can use any of its views to retrieve the object if needed.

URL: http://android-developers.blogspot.com/2009/12/back-and-other-hard-keys-three-stories.html

Thursday, December 17, 2009

[Gd] An update on the legacy API deprecation

| More

iGoogle Developer Blog: An update on the legacy API deprecation

Three months ago we announced the deprecation of the legacy gadgets API. Since then we've released a legacy migration guide for converting legacy gadgets to "gadgets.*" by hand, and we're continuing to work on a migration tool to help perform this conversion automatically.

Since the migration tool isn't yet available, we've decided to delay the next step of the migration process, the requirement that all new gadgets be written using gadgets.*, for an indefinite period. So, while we still recommend using the gadgets.* API, as it will save you time later, we're holding off on this requirement. Stay tuned for another update on the migration process, with a link to the migration tool, in early 2010.

Posted by Dan Holevoet, Developer Programs
URL: http://igoogledeveloper.blogspot.com/2009/12/update-on-legacy-api-deprecation.html

[Gd] AdWords API v2009 Hack Days

| More

AdWords API Blog: ​AdWords API v2009 Hack Days

​Have you been putting off migrating to v2009? Not sure where to start? Been way too busy? Well it's time to jump start your v2009 development with some in-person help from Google. Join us in San Francisco (January 7th) or New York (January 14th) for a full day of non-stop v2009 hacking.

To keep things interesting throughout the day, we'll do some coding demos of the cool things you can do with v2009 that weren't possible in v13, like asynchronous calls, dynamic ad parameters, and more.

Non-engineers beware! This is a developer-only event, and there will be no content or activities for attendees who don't plan to write code.

Space is very limited, and signups are on a first come, first serve basis. We ask that you limit attendance to two people per company. If you are based in Europe, please don't register yet, as a separate event for you is in the works and will be announced shortly.

More information and the signup form are available here: http://sites.google.com/site/v2009hackdays/

- Aaron Karp, AdWords API Team
URL: http://adwordsapi.blogspot.com/2009/12/adwords-api-v2009-hack-days.html

[Gd] Google Analytics API v2 Python Client Library

| More

Google Code Blog: Google Analytics API v2 Python Client Library

We know it's easier for developers to program in the languages they know. So we updated the Google Analytics API Python Client library with all the new API version 2 features and added reference exampels for both the Account Feed and Data Feed. Now it's easier than ever to automate your analysis workflow using our API.

Taking The Library For a Spin

With the updated library, we thought it would be a great time to highlight the power of the new v2 features. So we created a sample application to do just that. The application uses the new Google Analytics Python client library to retrieve metrics for a series of segments. It then performs some calculations on the data and creates bar charts using the GChartWrapper package, an open source Python wrapper for the Google Charts API. Finally, it uses the Python Imaging Library to add a title and legend, and stitches all the charts together into a single image. We decided to release this application as open source so you can create visualizations with your own data.

Solving Business Problems

With social media all the rage, we wanted to use this new application to help Avinash Kaushik, our Analytics Evangelist, to measure "engagement" on his popular Occam's Razor blog. We also wanted to determine if the time he spends participating in social media sites is valuable and sends new readers to his blog.

First we created segments to pull all the referrals from Facebook and Twitter. Second, we chose five calculations and corresponding metrics to compare the performance of thee two segments. We then compared the segments to each other and, for context, to all the visits to the site as a control.

They say a picture is worth a thousand words, here are the results:



Let's Analyze

Some interesting observations become apparent.
  • Far more visits originate from Twitter (3.6x) when compared to Facebook, perhaps not surprising given Avinash's Twitter followers (~16,120)
  • Visitors from Twitter tend to be new visitors, a good thing, but they view fewer pages and spend significantly less time on the blog.
  • On the other hand Facebook delivers an audience that is loyal. These visitors come back to the site more often and spend a significant time on the blog (compared to Twitter and all other visitors).
The bottom line? Even though social networking sites are all the rage, they actually contribute very little to Avinash's blog. If this blog were a company, it would be wise to ensure the time and effort put into driving traffic from social media is proportionate to the actual volume of traffic and goal conversions from those sites.

Hopefully this example shows how powerful our new features can be.

If you're interested in running this report against your own data, the application is free and open sourced. Additionally, we made it really easy to change the metrics, segments, calculations and all the other visual properties to power your own visualizations. So please download it here and give it a whirl, we would love to hear your feedback.

By Nick Mihailovski, Google Analytics API Team
URL: http://googlecode.blogspot.com/2009/12/google-analytics-api-v2-python-client.html

[Gd] New resources and sample code on developer.android.com

| More

Android Developers Blog: New resources and sample code on developer.android.com

Hey Android developers—if you've visited the online Android SDK documentation recently, you may have noticed a few changes. That's right, there's a new Resources tab, which was designed to take some of the load off the Developer's Guide. We've moved a number of existing resources to the Resources tab, including tutorials, sample code, and FAQs. We've also formalized a few of our most popular developer blog posts into technical articles; watch for more of these to appear in the future.

In addition, we just released a new batch of sample code, available now as a ZIP file download on the samples index page. And we're working on updating the way in which we distribute official sample code; more on that some other time.

New sample screenshots

The new sample code includes:

  • Multiple Resolutions: a simple example showing how to use resource directory qualifiers to support multiple screen configurations and Android SDK versions.
  • Wiktionary and WiktionarySimple: sample applications that illustrate how to create an interactive home screen widget.
  • Contact Manager: an example on using the new ContactsContract interface to query and manipulate a user's various accounts and contact providers.
  • Bluetooth Chat: a fun little demo that allows two users to have a 1 on 1 chat over Bluetooth. It demonstrates how to discover devices, initiate a connection, and transfer data.
  • API Demos > App > Activity > QuickContactsDemo: a demo showing how to use the android.widget.QuickContactsBadge class, new in Android 2.0.
  • API Demos > App > Activity > SetWallpaper: a demo showing how to use the new android.app.WallpaperManager class to allow users to change the system wallpaper.
  • API Demos > App > Text-To-Speech: a sample using Text-To-Speech (speech synthesis) to make your application talk.
  • NotePad (now with Live Folders): this sample now includes code for creating Live Folders.

We hope these new samples can be a valuable resource for learning some of the newer features in Android 1.6 and 2.0. Let us know in the android-developers Google Group if you have any questions about these new samples or about the new Resources tab.

Thanks for tuning in, and 'til next time, happy coding!

URL: http://android-developers.blogspot.com/2009/12/new-resources-and-sample-code-on.html

[Gd] Knowing is half the battle

| More

Android Developers Blog: Knowing is half the battle

As a developer, I often wonder which Android platforms my applications should support,especially as the number of Android-powered devices grows. Should my application only focus on the latest version of the platform or should it support older ones as well?

To help with this kind of decision, I am excited to announce the new
device dashboard. It provides information about deployed Android-powered devices that is helpful to developers as they build and update their apps. The dashboard provides the relative distribution of Android platform versions on devices running Android Market.


Android PlatformPercentage of Devices
1.10.3%
1.527.7%
1.654.2%
2.02.9%
2.0.114.8%

The above graph shows the relative number of Android devices that have accessed Android Market during the first 14 days of December 2009.

From a developer's perspective, there are a number of interesting points on this graph:

  • At this point, there's little incentive to make sure a new application is
    backward compatible with Android 1.0 and Android 1.1.
  • Close to 30% of the devices are running Android 1.5. To take advantage of this significant install base, you may consider support for Android 1.5.
  • Starting with Android 1.6, devices can have different screen densities & sizes. There are several devices out there that fall in this category, so make sure to adapt your application to support different screen sizes and take advantage of devices with small, low density (e.g QVGA) and normal, high density (e.g. WVGA) screens. Note that Android Market will not list your application on small screen devices unless its manifest explicitly indicates support for "small" screen sizes. Make sure you properly configure the emulator and test your application on different screen sizes before uploading to Market.
  • A new SDK for Android 2.0.1 was released last week. All Android 2.0 devices will be updated to 2.0.1 before the end of the year, so if your application uses features specific to Android 2.0, you are encouraged to update it to take advantage of the latest Android 2.0.1 API instead.

In summary, Android 1.5, 1.6, and 2.0.1 are the 3 versions of the platform that are deployed in volume. Our goal is to provide you with the tools and information to make it easy for you to target specific versions of the platform or all the versions that are deployed in volume.

We plan to update the dashboard regularly to reflect deployment of new Android platforms. We also plan to expand the dashboard to include other information like devices per screen size and so on.

URL: http://android-developers.blogspot.com/2009/12/knowing-is-half-battle.html

[Gd] Tab-Modality and You

| More

Chromium Blog: Tab-Modality and You

Years ago, I remember watching a webcast of the introduction of the Aqua user interface when Mac OS X Public Beta was first demoed. The part I distinctly remember was realizing the brilliance of sheets. Like many great innovations, they were simple in retrospect and solved a problem you didn't realize you had: the modality problem — the fact that dialog boxes blocked interacting with the whole application even though only one window needed the information that you, as the user, had to provide. I watched in wonder as a save dialog blocked only the one window that needed saving, leaving all the other windows free. Finally, a solution to limit the modality.

Because modality sucks.

Back in 2000, sheets worked well because the smallest unit of user interaction with an application was a window. Soon after, though, things started to change. Web browsers in particular were among the first to start using tabs to put more than one document in a window. This caused a snag. A web page can require modal interaction from the user: picking a file, or supplying a username and password. Yet we don't want to prevent the user from switching to a different tab and continuing to interact with other websites. If the finest-grained modality control we have is per-window, how can we achieve that outcome?

Chromium's current answer comes from combining Cocoa's child window support with sheets to get tab-modal sheets:

While this looks like a normal sheet, you can switch between open tabs while the password request is up. You can't, however, interact with the web page.

The implementation, like all of the code used in Chromium, is open source, and can be found in the Google Toolbox for Mac, a collection of reusable components from the Mac developers at Google. The technical details of the GTMWindowSheetController can be found on the Google Mac blog. The other thing to note is that right now tab-modal sheets are only used for website authentication. The other sheets we use (for file selection, etc) are currently window-modal; we hope to convert them over soon.

The fate of tab modal sheets, however, isn't certain. A way to enforce tab-modal interaction is certainly needed. But is attaching sheets to the tabs the right way to achieve that goal? At the last WWDC, I talked to some graphic designers who were opposed to the idea. "Reusing sheets in a context that isn't window modality will only confuse the user!" On the other hand, my position is that the concept of modality is the same, and the context is similar enough that users will find that sheets help them understand the modality in which they must interact.

So the story isn't over. Tab-modal sheets are our contribution to the ongoing discussion, an experiment to see what works and what doesn't. Together we can work out the best way to help users interact with their computers.

Posted by Avi Drissman, Software Engineer
URL: http://blog.chromium.org/2009/12/tab-modality-and-you.html

[Gd] 2 days of ideas, hacks, and pufferfish in Tokyo

| More

Google Wave Developer Blog: 2 days of ideas, hacks, and pufferfish in Tokyo

I am never one to turn down a trip to Japan. Firstly, because a friend of mine has become entirely dependent on a constantly flowing supply of authentic Pocky (a surprisingly addictive chocolate-covered pretzel snack that I once ate for breakfast every day for 2 weeks). Secondly, because the Japanese developer community has a creativity and energy that both infects and inspires me.



I stopped by Japan on my way back to Australia, for 2 days of Google Wave developer events. I arrived on the first night in a strangely alert jet-lagged state to find myself amidst what they called an "Idea-a-thon". This was basically a pre-party for the hackathon the next day, where groups of developers would brainstorm ideas and then present them. I didn't understand much of what they said, but luckily, they sketched out logos and diagrams on sheets of paper. I saw a Wave/Twitter logo, where the "w" was Wave's "w", and a diagram involving a flow between Eclipse and SVN... enough info to get me excited.



After the idea-a-thon, we all headed upstairs to a real party (beer = party, right?), where a mix of developers and journalists gathered to hear the latest about Google Wave. Ando Yasushi started off the night with an introduction of the APIs, and a demo of his own Animal Chess ("Dobutsu Shogi") gadget (which is now near and dear to my heart, as I was actually able to win the game.. that never happens). I then showed off a series of my favorite demos - using Napkin Gadget to collaboratively draw a demon love-child, AJAX Animator to show my flight across the Pacific, and AmazonBot to aid my purchase of an inflatable castle and a pony (childhood dreams never die). Googler Hiroshi Ichikawa demo'd his own extensions - an HTML5 drawing gadget and a Kanjy robot, and then blazed through a wave of Japanese-created games, like Donpachi, Reversi, Tetris, Tictactoe, and yet another Shogi implementaton. After a few more talks and rounds of beer, we headed home to rest up for a full day of hacking the next day (well, that would have been the plan, if I hadn't sold my soul to the jet lag devil).



Bright and early, at 10am, I kicked off the hackathon with several debugging tips, and presented "Making Wave-y Extensions", a talk about how to make gadgets and robots that take full advantage of the collaborative & real-time experience of Google Wave. For the next 8 hours, the developers dilligently worked together to make their idea come to life, each group huddled around a 30inch monitor.



Finally, my favorite part: demos! The first team showed "Weclipse", a plugin for Eclipse that embedded the Google Wave client as a tab in the IDE, with the hope of making coding more social. In that embedded wave, they also showed a robot that received messages from an Android and posted them as blips. Then, Maripo Goda, author of the Brainstorming gadget and tDiary plug-in, showed her team's project: an end-to-end message translation system. One of her team members is on the Debian JP project, and wanted an extension to expedite translations for the operating system. The extension starts with a gadget that loads in translation files, lets the participants set the translations, and then it commits them to an SVN repository. There have been multiple translation helper extensions created by international developers over the last few months, but this is the first I've seen that tackles the software message translation problem.



Atsushi Nakamura, who also attended the Tokyo Chrome Extensions hackathon the week before, then demo'd his Chrome+Google Wave hack, a bookmarklet which pops down an embedded Wave - "ChroMemo." I can see that being really useful for storing little notes, a to-do list, or a schedule. Ando Yasushi demoed his own prototype of operational transforms - in JavaScript. Well, that's certainly one way of learning how Wave works. :)



My trip ended with a dinner of traditional "Fugu" - pufferfish, cooked (and not cooked) in every way possible: sashimi, grilled, boiled, and my favorite: deep fried. I learnt over dinner that a dish of pufferfish can cause instantaneous death, if the internal organs aren't plucked out properly. Well, luckily, my new Japanese friends took me to a properly licensed restaurant, and I'm alive now to tell you about the trip and enjoy my souvenirs - 10 flavors of Pocky and 3 flavors of Mochi.



The Japanese developers are going full speed ahead into Wave development, with another two events planned in the next month: Kyoto GTUG Wave Hackathon, and a Tokyo "Demo Tournament". I'm too bloated on my pocky to make it out there for those events, but I expect to hear about more innovative ideas and exciting extensions coming from my new developer friends in Japan. Until next time, Tokyo!




Posted by Pamela Fox, Developer Relations
URL: http://googlewavedev.blogspot.com/2009/12/2-days-of-ideas-hacks-and-pufferfish-in.html

Wednesday, December 16, 2009

[Gd] Beta Update: Linux and Windows

| More

Google Chrome Releases: Beta Update: Linux and Windows

The Beta channel has been updated to 4.0.249.43 for Linux, Windows and Mac. It was cut at r34532.

The release includes stability improvements for Linux and Linux, Windows and Mac.

All:

-- Fixed several common crashes

Windows & Linux
-- Fix bug 28795 - Added a notification says "xxx is synched." if you are already synced and click that button.

Linux
-- Fixed bug 28061 - Add popup support for page action extensions.

Known issues:
-Mac only: bug 29121 - You'll get an error when checking for updates using the About Google Chrome dialog. 'Update server not available' (error : 12). Regardless of the error message, the update is successful.

Orit Mazor, Google Chrome
URL: http://googlechromereleases.blogspot.com/2009/12/beta-update-linux-and-windows.html

[Gd] Introducing Google Browser Size

| More

Google Code Blog: Introducing Google Browser Size

When I started work at Google, I visited the Google Earth team, hoping to find a 20% project on my favorite Google product. There I met Bruno Bowden, who introduced me to a problem I had never thought much about: how to take browser sizes into account when designing a page.

Bruno had noticed that many people who visit the “Download Google Earth” page never actually download, even though, as you can see, the button is pretty hard to miss:



He wondered if a significant number of users might have their browser windows too small to see the button:



To analyze this, Bruno looked at how large people's browser windows were when they visited this page. His first key idea was to measure not the entire browser window, but just the client area -- no toolbars, status bars, or other chrome.

Bruno's second key idea was to render several weeks' worth of page visitor browser sizes in a contour visualization:



Using this visualization, Bruno confirmed that about 10% of users couldn't see the download button without scrolling, and thus never noticed it. 10% may not sound like a lot, but in this context it turns out to mean a significant number of people weren't downloading Google Earth. Using this data, the team was able to redesign the page to good effect.

Bruno and I realized that Web designers might benefit from this information if it could be made more generally available. We constructed a page that could overlay a DIV containing the contour visualization atop an IFRAME containing any other Web page:



This turned out to be a good way to see which controls were and weren't visible at typical browser sizes. The only problem was, the overlay DIV prevented mouse events from getting to the page IFRAME, so it wasn't possible to interact with the page.

To solve this, we split the overlay DIV into four:



Each of the outlines above (red, yellow, blue, green) represents a separate DIV. As the mouse pointer moves, we resize and reposition the DIVs to leave a small window of blank space around the pointer, and adjust background offsets for each DIV to make the overlay look like one seamless graphic. (We originally did this on a timer, but we found a simpler way: when the mouse touches any of the DIVs, resize/reposition all of the DIVs.) End result: a designer can click and otherwise interact with the page with the mouse, and thus interact with the site normally instead of repeatedly typing in URLs.

We are now making this tool available to the public on Google Labs. To try it, simply visit browsersize.googlelabs.com and enter the URL of a page you'd like to examine. The size overlay you see is using latest data from visitors to google.com, so this should give you a pretty good indication of what parts of your UI are generally visible and what aren't.

We look forward to receiving your comments at browser-size-external-feedback!

By Arthur Blume on behalf of the Google Browser Size team
URL: http://googlecode.blogspot.com/2009/12/introducing-google-browser-size.html

[Gd] Google Chrome Extensions: A quick recap of our first week in beta

| More

Chromium Blog: Google Chrome Extensions: A quick recap of our first week in beta

The seven days since our beta launch have been busy and exciting for the Google Chrome Extensions team.

Besides having fun trying out some of the 800+ new extensions in our gallery, we hosted an event for developers on our Mountain View campus to discuss the design principles of the Google Chrome's extensions system and to present the team's roadmap. Approximately 140 developers attended, representing more than 50 companies. Aaron Boodman and Erik Kay, technical leads for the extensions platform, provided insights across several topics, including the UI design and the security model for the extensions system. They also demonstrated the platform's flexibility by building and publishing an "Email this page" extension in less than 5 minutes.





Aaron and Erik were joined on stage by the Xmarks, eBay and Google Translate teams, who discussed their own experiences with Google Chrome Extensions, highlighting the ease of development and the advanced capabilities that HTML5 provides to extension developers. Finally, Nick Baum, product manager for Google Chrome Extensions, closed the event by walking through the extensions gallery approval process, tips for successful extensions, as well as the team's near-term goals.

To learn more on these topics you can check out the videos from the event below:



We also met many extensions developers last week at Add-on Con, an annual conference for browser add-ons. Erik and Aaron presented a quick overview of the extension system's design for those who had missed our earlier event. In addition, Aaron shared his thoughts on a panel about cross-browser extension development while Linus Upson, Google's engineering lead for client products, presented his views on a panel about the future of the browser.

We'd like to thank developers for building and uploading some great extensions in our gallery and for giving us plenty of feedback. This week, we plan to continue our discussions with the developer community by hosting several online tutorial sessions. You can still sign up for one of these sessions, but if you aren't able to attend, we encourage you to submit your questions through our discussion group.

Posted by Arne Kurrik, Developer Advocate, Google Chrome Extensions
URL: http://blog.chromium.org/2009/12/google-chrome-extensions-quick-recap-of.html