Saturday, April 16, 2011

[Gd] Fridaygram

| More

The official Google Code blog: Fridaygram

This post is by Scott Knaster of Google Developer Relations. Scott works on technical docs at Google and is editor of this very blog. Scott is a fan of baseball and hockey, but finds it challenging when their seasons overlap.

It’s been a very light posting week here on the Google Code Blog. While our author community was focused on other work this week, I picked out a few items you might have missed.

If you use the URL shortener, you might be interested in new features that were added this week, including automatically selecting newly created short URLs so you can copy them more easily. If you create a lot of URLs, and you use Chrome, check out this handy Chrome extension that makes short URL creation extremely easy. Or, write your own code using our Google URL Shortener API.

Here’s one especially for my fellow writers. Google Docs now does pagination, which enables some related improvements too. This is useful when writing user’s guides, school papers, or other documents that might have to be printed. Just last week I was working on a doc and wishing for this feature, and now here it is, proving the old adage “Wishing makes it so”.

On a more serious note, it’s now been more than a month since a devastating earthquake and tsunami struck Japan. Here’s an update on crisis response and relief efforts, and a way you can help simply by posting messages of support for the people of Japan.

Finally, I want to share the coolest hack I saw all week: a wedding invitation that includes a paper record and player. Beautiful!

[Gd] Google APIs Python Library goes to Beta

| More

The official Google Code blog: Google APIs Python Library goes to Beta

This post is by Anton Lopyrev and Joe Gregorio.
Anton Lopyrev is an Associate Product Manager for Google APIs Infrastructure and was previously a software engineer on Street View. He is a computer graphics enthusiast who is also passionate about product design.

Joe Gregorio is a Software Engineer. In the past four years at Google he's worked on APIs, then Google App Engine, then Google Wave, and now has come full circle and is back working on APIs. -scottk

Over the last several months we have launched a number of tools, such as the Google APIs Explorer and the Google APIs Console, that help you explore Google APIs based on our brand new API infrastructure and manage your API access directly in your browser. However, most of the day-to-day usage of the APIs is still via client libraries in various programming languages.

Today, we are announcing a major milestone for one of the Google APIs client libraries. The Google APIs Client Library for Python has officially reached Beta. This means that we're comfortable enough with the stability and features of the library that we'd like you to start building real production applications on top of it and send us your feedback. Client libraries in other languages are soon to follow.

If you are interested in getting more familiar with our new client libraries, we hope to see you at the “Introduction to Google APIs” lecture at I/O Bootcamp and the “Life of a Google API Developer” session at Google I/O, where you can chat with the developers of the libraries face-to-face.

Friday, April 15, 2011

[Gd] Beta Channel Update

| More

Google Chrome Releases: Beta Channel Update

Note: Chrome Beta Channel has been updated to 11.0.696.48 for Linux with the same changes as below.

The Chrome Beta channel has been updated to 11.0.696.44 for Windows, Mac and Chrome Frame.

This release contains a new version of Adobe Flash which includes a fix for security vulnerability.

If you find new issues, please let us know by filing a bug.

Want to change to another Chrome release channel? Find out how.

Karen Grunberg
Google Chrome

[Gd] Stable Channel Update

| More

Google Chrome Releases: Stable Channel Update

The Chrome Stable channel has been updated to 10.0.648.205 for Windows, Mac, Linux and Chrome Frame.  This release contains a new version of Adobe Flash which includes a fix for a security vulnerability, as well as the security fixes listed below.

Security fixes and rewards:
Please see the Chromium security page for more detail. Note that the referenced bugs may be kept private until a majority of our users are up to date with the fix.

  • [$500] [Windows only] [70070] Critical CVE-2011-1300: Off-by-three in GPU process. Credit to yuri.ko616.
  • [75629] Critical CVE-2011-1301: Use-after-free in the GPU process. Credit to Google Chrome Security Team (Inferno).
  • [$1000] [78524] Critical CVE-2011-1302: Heap overflow in the GPU process. Credit to Christoph Diehl.

    The full list of changes is available from the SVN revision log.  If you find new issues, please let us know by filing a bug. Want to change to another Chrome release channel? Find out how.

    Jason Kersey
    Google Chrome

    [Gd] OpenSocial State of the Union 2011!!

    | More

    OpenSocial API Blog: OpenSocial State of the Union 2011!!

    The OpenSocial Foundation cordially invites you to attend the annual State of the Union event on May 12, 2011, from 1:00pm to 5:00pm. This is your chance to learn first hand about the exciting new happenings taking place in the community. In addition to presentations from members of our community, there will be two additional opportunities for you to be directly involved, the pre-SOTU interop event, and the Happy Hour/Poster Session!

    Don't sit on the sidelines--get involved!!
    There will be a Happy Hour & Poster Session immediately following the State of the Union from 5:00pm ~ 7:00pm. You are welcome, and encouraged to use this as an opportunity to share your ides. Simply sign up on the OpenSocial wiki page. This will be a great chance to learn about all the wickedly cool stuff happening with OpenSocial. And don't forget to bring your laptop. What goes better with a cold beverage than a bit of hot code?

    Attend the pre-SOTU interop & spec working session!
    Got a gadget? Got a container? Now's your chance to meet the developers of applications and containers and get "interoping". From 8:30am to 12:00pm (location TBD) there will be an an opportunity for application providers to work directly with container providers to demonstrate the interoperability and portability of OpenSocial based applications. The wiki page is under construction and will be updated as we fill in the details.

    OpenSocial 2.0 is under development!
    There are some incredibly exciting proposals out there, e.g Embedded Experiences and Activity Streams. Not to mention mobile. The pre-SOTU event will also be an opportunity for specification authors to work together on many of the exciting 2.0 proposals.

    I look forward to seeing you and, of course, encourage you to get involved and participate. All are welcome to attend both events. However, space is limited so please use eventbrite to register in advance.

    If you've got any questions, drop a note on the OpenSocial Community group.

    The Web is better when it's OpenSocial!

    Mark Weitzel
    President, OpenSocial Foundation

    [Gd] Introducing ProtoRPC for writing App Engine Web Services in Python

    | More

    Google App Engine Blog: Introducing ProtoRPC for writing App Engine Web Services in Python

    Here on the App Engine team, we’re always looking for new ways to make it easier for developers to build applications and services. Today, I’m happy to introduce ProtoRPC, a new tool for creating simple Python services, which requires minimal set up and configuration to create new services.

    What can you use ProtoRPC web-services for? Most web applications have the need to send and receive data between different components and/or applications. Typically, developers come up with ad-hoc ways of doing this as quickly as possible. As the application grows larger and the need to share information across components grows, it becomes more difficult to manage. URL end-points are defined and appear inconsistent from one another and a lot of boiler plate code is added checking parameters. This quickly becomes a maintenance nightmare and is a problem that ProtoRPC is built to solve.

    ProtoRPC makes it easy to write consistent, reliable web interfaces that can be used, for example, to do the following:

    • Create AJAX URL end-points for use by dynamic web pages and forms.

    • Provide simple and understandable server-to-server communications.

    • Become a back-end for command-line tools or other non-web based clients.

    Using ProtoRPC, you can define structured web-services right in the application’s Python code without having to first learn and write a new interface definition language such as Thrift and Protocol Buffers, however still retain the same powerful features such as interface introspection and automatic client generation.

    The way to go about defining a web service should be familiar to you if you already have experience working with App Engine db.Models and the webapp framework. The data sent between client and web service are defined in a similar way as Datastore models. The services classes that handle requests are defined similarly to webapps RequestHandler classes. Let’s take a look at a simple example from the ProtoRPC getting started guide. This simple web service says hello to its client:

    class HelloRequest(messages.Message):
    my_name = messages.StringField(1, required=True)

    class HelloResponse(messages.Message):
    hello = messages.StringField(1, required=True)

    class HelloService(remote.Service):

    @remote.method(HelloRequest, HelloResponse)
    def hello(self, request):
    return HelloResponse(hello='Hello there, %s!' % request.my_name)

    If this web services was used as the URL end-point for an AJAX based form, Javascript to communicate with the service might look like this:

    $.ajax({url: ‘/helloservice.hello’,
    type: 'POST',
    contentType: 'application/json',
    data: ‘{ my_name: Bob }’,
    dataType: 'json',
    success: function(response) {
    // The response is { hello: “Hello there, Bob!” }

    As you can see from the example, ProtoRPC can speak JSON right out of the box. In addition, it is compatible with the protocol buffer binary format and can therefore communicate with clients and servers written using traditionally compiled .proto files.

    Right now, ProtoRPC is available as an separate project that can be downloaded here. It’s still considered experimental and may change in substantial ways before being integrated in to the SDK. But even though it’s in preview, it already has a number of useful features, such as a remote service discovery mechanism and a forms interface for easy testing. At the moment, ProtoRPC is only available in Python. As always, we plan to offer it for Java developers in the near future.

    Check out the getting started guide for a more complete overview to try out writing a few services of your own!


    Rafe Kaplan, Software Engineer, App Engine Team

    Thursday, April 14, 2011

    [Gd] Customizing the Action Bar

    | More

    Android Developers Blog: Customizing the Action Bar

    [This post is by Nick Butcher, an Android engineer who notices small imperfections, and they annoy him. — Tim Bray]

    Since the introduction of the Action Bar design pattern, many applications have adopted it as a way to provide easy access to common actions. In Android 3.0 (or Honeycomb to its friends) this pattern has been baked in as the default navigation paradigm and extended to take advantage of the extra real-estate available on tablets. By using the Action Bar in your Honeycomb-targeted apps, you'll give your users a familiar way to interact with your application. Also, your app will be better prepared to scale across the range of Android devices that will be arriving starting in the Honeycomb era.

    Just because Action Bars are familiar, doesn’t mean that they have to be identical! The following code samples and accompanying project demonstrate how to style the Action Bar to match your application’s branding. I’ll demonstrate how to take Honeycomb’s Holo.Light theme and customise it to match this blog’s colour scheme.

    <style name="Theme.AndroidDevelopers" parent="android:style/Theme.Holo.Light">



    This step is easy; I’ll use the wonderful Android Asset Studio to create an icon in my chosen colour scheme. For extra credit, I’ll use this image as a starting point to create a more branded logo.


    Next up, the navigation section of the Action Bar operates in three different modes; I’ll tackle each of these in turn.


    The Action Bar’s standard navigation mode simply displays the title of the activity. This doesn’t require any styling... next!


    To the left, a standard list drop-down; to the right, the effect we want to achieve.

    The default styling in list navigation mode has a blue colour scheme. This is evident when touching the collapsed control in both the top bar, and the selection highlight in the expanded list. We can theme this element by overriding android:actionDropDownStyle with a custom style to implement our colour scheme:

    <!-- style the list navigation -->
    <style name="MyDropDownNav" parent="android:style/Widget.Holo.Light.Spinner.DropDown.ActionBar">
    <item name="android:background">@drawable/ad_spinner_background_holo_light</item>
    <item name="android:popupBackground">@drawable/ad_menu_dropdown_panel_holo_light</item>
    <item name="android:dropDownSelector">@drawable/ad_selectable_background</item>

    The above uses a combination of state list drawables and 9 patch images to style the collapsed spinner, the top bar of the expanded list and sets the highlight colour when picking an item.


    Here are the before-and-after shots on the tab navigation control:

    The tab navigation control uses the standard blue colouring. We can apply a custom style to android:actionBarTabStyle to set our own custom drawable that uses our desired palette:

    <!-- style for the tabs -->
    <style name="MyActionBarTabStyle" parent="android:style/Widget.Holo.Light.ActionBarView_TabView">
    <item name="android:background">@drawable/actionbar_tab_bg</item>
    <item name="android:paddingLeft">32dp</item>
    <item name="android:paddingRight">32dp</item>


    Before-and-after on the individual items in the Action Bar:

    The individual action items inherit the default blue background when selected. We can customise this behaviour by overriding android:selectableItemBackground and setting a shape drawable with our desired colouring:

    <item name="android:selectableItemBackground">@drawable/ad_selectable_background</item>

    The overflow menu also needs some attention as when expanded it shows a blue bar at the top of the list. We can override android:popupMenuStyle and set a custom drawable (in fact the very same drawable we previously used for list navigation) for the top of the overflow menu:

    <!-- style the overflow menu -->
    <style name="MyPopupMenu" parent="android:style/Widget.Holo.Light.ListPopupWindow">
    <item name="android:popupBackground">@drawable/ad_menu_dropdown_panel_holo_light</item>

    Selecting items within the overflow menu also show the default selection colour. We can set our customised selection colour by overriding android:dropDownListViewStyle:

    <!-- style the items within the overflow menu -->
    <style name="MyDropDownListView" parent="android:style/Widget.Holo.ListView.DropDown">
    <item name="android:listSelector">@drawable/ad_selectable_background</item>

    These changes gets us most of the way there but it’s attention to detail that makes an app. Check boxes and radio buttons within menu items in the overflow section are still using the default assets which have a blue highlight. Let’s override them to fit in with our theme:

    <item name="android:listChoiceIndicatorMultiple">@drawable/ad_btn_check_holo_light</item>
    <item name="android:listChoiceIndicatorSingle">@drawable/ad_btn_radio_holo_light</item>


    I’ve left the background transparent as inheriting form Holo.Light works well for our desired palette. If you’d like to customise it you easily override the android:background item on the android:actionBarStyle style:

    <style name="MyActionBar" parent="android:style/Widget.Holo.Light.ActionBar">
    <item name="android:background">@drawable/action_bar_background</item>

    Bringing it all together

    Putting all of these components together we can create a custom style:

    <style name="Theme.AndroidDevelopers" parent="android:style/Theme.Holo.Light">
    <item name="android:selectableItemBackground">@drawable/ad_selectable_background</item>
    <item name="android:popupMenuStyle">@style/MyPopupMenu</item>
    <item name="android:dropDownListViewStyle">@style/MyDropDownListView</item>
    <item name="android:actionBarTabStyle">@style/MyActionBarTabStyle</item>
    <item name="android:actionDropDownStyle">@style/MyDropDownNav</item>
    <item name="android:listChoiceIndicatorMultiple">@drawable/ad_btn_check_holo_light</item>
    <item name="android:listChoiceIndicatorSingle">@drawable/ad_btn_radio_holo_light</item>

    We can then apply this style to either an individual activity or to the entire application:

    <activity android:name=".MainActivity"

    Note that some of the system styles that we have overridden in this example will affect much more than the Action Bar. For example overriding android:selectableItemBackground will effect many widgets which support a selectable state. This is useful for styling your entire application but be sure to test that your customisations are applied consistently throughout.

    Familiar but styled

    Customising the action bar is a great way to extend your application’s branding to the standard control components. With this power, as they say, comes great responsibility. When customising the user interface you must take great care to ensure that your application remains legible and navigable. In particular, watch out for highlight colours which contrast poorly with text and provide drawables for all relevant states. Explore this demo application which exercises the functionality offered by the Action Bar and demonstrates how to theme it.


    [Gd] Android Developer Challenge, Sub-Saharan Africa!

    | More

    Android Developers Blog: Android Developer Challenge, Sub-Saharan Africa!

    [This post is by Bridgette Sexton, an innovation advocate for the African tech community. — Tim Bray]

    En Fran├žais.

    In the past year alone, we have met with over 10,000 developers and techies across Sub Saharan Africa. We are continually impressed by the ingenuity and enthusiasm of this community in solving real problems with technology. From applications that crowd-source traffic info to mobile registration of local businesses, handheld devices have taken center stage for consumers and developers in Africa. With a number of countries in the region hovering around 80-90% mobile penetration, mobile is the screen size for the web and the communication experience.

    Correspondingly, at every Google event in Africa, Android is the hottest topic; we know why. Every day over 300,000 Android devices are activated globally! A growing number of these mobile devices are powering on for the first time in emerging markets like those in Africa. As Android users multiply, so does the appeal to for developers of building apps on this free open-source platform.

    An increasing number of users are searching for 'Android' on Google in Sub-Saharan Africa

    For all these reasons and more, we are proud to be launching the Android Developer Challenge for Sub-Saharan Africa!

    The Android Developer Challenge is designed to encourage the creation of cool and innovative Android mobile apps built by developers in Sub-Saharan Africa. Invent apps that delight users and you stand a chance to win an Android phone and $25,000 USD. To get started, choose from one of three defined eligible categories (see below), build an Android app in a team or by yourself, and submit it via the competition website by July 1st. The winning app will be announced on September 12th at G-Kenya. Get more details as well as Terms and Conditions on our site.

    Categories for Entry:

    • Entertainment / Media / Games

    • Social Networking / Communication

    • Productivity / Tools / Lifestyle

    (See Terms & Conditions for more details!)

    To launch this competition, we have teamed up with Google Technology User Groups (GTUGs) across Africa to host Android Developer Challenge events. Check out our website for Android gatherings near you, and get coding!


    Wednesday, April 13, 2011

    [Gd] New Carrier Billing Options on Android Market

    | More

    Android Developers Blog: New Carrier Billing Options on Android Market

    [This post is by Eric Chu, Android Developer Ecosystem. —Dirk Dougherty]

    Since last year, we’ve been working to bring the convenience of Direct Carrier Billing to more Android Market users on more carrier networks. Building on the launches to T-Mobile US and AT&T users in 2010, we’ve recently launched Direct Carrier Billing to users on three popular networks in Japan -- SoftBank, KDDI, and NTT DOCOMO.

    The momentum continues and today we’re excited to announce that Direct Carrier Billing is now available on Sprint. We've begun a phased roll-out of the service that will reach all users in the next few days. When complete, Android users on the Sprint network will be able to charge their Android Market purchases to their Sprint mobile bill with only a few clicks.

    We believe that Direct Carrier Billing is a key payment option because it lets users purchase and pay for apps more easily. It’s also important because it offers a convenient way to buy in regions where credit cards are less common.

    We are continuing to partner with more carriers around the world to offer carrier billing options to their subscribers. Watch for announcements of new payment options coming in the months ahead.


    Tuesday, April 12, 2011

    [Gd] Dev Channel Update

    | More

    Google Chrome Releases: Dev Channel Update

    The Chrome Dev channel has been updated to 12.0.733.0 for all platforms.  This release contains updates focused on stability and UI tweaks.  The full list of changes is available from the SVN revision log.  If you find new issues, please let us know by filing a bug. Want to change to another Chrome release channel? Find out how.

    Jason Kersey
    Google Chrome

    [Gd] Beta Channel Update

    | More

    Google Chrome Releases: Beta Channel Update

    The Beta channel has been updated to 11.0.696.43 for Macintosh, Windows, Linux and Chrome Frame platforms

    The following bugs were fixed
    • Passwords sync: passwords sync commits after EVERY browser restart (Issue 78548).
    • Autofill fails to fill forms (Issue 78509).
    • a few known crashes (Issue 78688, Issue 68350, Issue 77665, Issue 74585, Issue 76092, Issue 77219 and Issue 77447).
    • Redirect to my site without CFInstall.js (Issue 60018).
    • Update Silverlight v3 version metadata (Issue 78005).
    • Blocked plug-in dialog: make sure "Run this time" button is the first one (Issue 78120).
    • Policy: Proxy configuration over policy does not work. (Issue 78016).
    • Editing style adds the word "initial" for any property value that uses a paren (Issue 75302).
    • Google Chrome Helper doesn't quit, killing it relaunches a new helper process (Issue 74983).
    You can find full details about the changes that are in this version of Chrome 11 in the SVN revision log.

    If you find new issues, please let us know by filing a bug.

    Want to change to another Chrome release channel? Find out how.

    Karen Grunberg
    Google Chrome

    [Gd] Experiment with ads in v201101

    | More

    AdWords API Blog: Experiment with ads in v201101

    When introduced last year, AdWords Campaign Experiments (ACE) allowed for experimental changes to be applied to ad groups and criteria. To allow for even greater flexibility, in v201101 we’ve added the ability to apply experimental changes to individual ads as well. Just like other entities, experiment data can be added to an AdGroupAd to indicates its status in the experiment. For example, the following code can be used to add an existing ad to the experimental split.

    // Create ad using an existing ID.
    $ad = new Ad();
    $ad->id = $adId;

    // Create ad group ad.
    $adGroupAd = new AdGroupAd();
    $adGroupAd->adGroupId = $adGroupId;
    $adGroupAd->ad = $ad;
    $adGroupAd->status = 'ENABLED';

    // Create experiment data for experiment-only split.
    $experimentData = new AdGroupAdExperimentData();
    $experimentData->experimentId = $experimentId;
    $experimentData->experimentDeltaStatus = 'EXPERIMENT_ONLY';
    $adGroupAd->experimentData = $experimentData;

    // Create operation.
    $operation = new AdGroupAdOperation();
    $operation->operator = 'SET';
    $operation->operand = $adGroupAd;
    $operations = array($operation);

    // Update ad.
    $result = $adGroupAdService->mutate($operations);

    Experiment data can only be used to include or exclude an ad from an experiment; all other properties of the ad will remain the same. If you have any questions about setting up experiments with the API you can ask us on the forum.

    - Eric Koleda, AdWords API Team