Thursday, December 27, 2012

[Gd] Daydream: Interactive Screen Savers

| More

Android Developers Blog: Daydream: Interactive Screen Savers

Posted by Daniel Sandler, a software engineer on the Android System UI team
Daydream


I’ve always loved screen savers. Supposedly they exist for a practical purpose: protecting that big, expensive monitor from the ghosts of spreadsheets past.



But I’ve always imagined that your computer is secretly hoping you’ll stand up and walk away for a bit. Just long enough for that idle timer to expire…so it can run off and play for a little while. Draw a picture, set off fireworks, explore the aerodynamics of kitchen appliances, whatever—while always ready to get back to work at a keystroke or nudge of the mouse.



Daydream, new in Android 4.2, brings this kind of laid-back, whimsical experience to Android phones and tablets that would otherwise be sleeping. If you haven’t checked it out, you can turn it on in the Settings app, in Display > Daydream; touch When to Daydream to enable the feature when charging.



An attract mode for apps


Apps that support Daydream can take advantage of the full Android UI toolkit in this mode, which means it’s easy to take existing components of your app — including layouts, animations, 3D, and custom views—and remix them for a more ambient presentation. And since you can use touchscreen input in this mode as well, you can provide a richly interactive experience if you choose.



Daydream provides an opportunity for your app to show off a little bit. You can choose to hide some of your app’s complexity in favor of one or more visually compelling experiences that can entertain from across a room, possibly drawing the user into your full app, like a video game’s attract mode.



Figure 1. Google Currents scrolls stories past in a smooth, constantly-moving wall of news.



Google Currents is a great example of this approach: as a Daydream, it shows a sliding wall of visually-interesting stories selected from your editions. Touch a story, however, and Currents will show it to you full-screen; touch again to read it in the full Currents app.



The architecture of a Daydream



Each Daydream implementation is a subclass of android.service.dreams.DreamService. When you extend DreamService, you’ll have access to a simple Activity-like lifecycle API.



Key methods on DreamService to override in your subclass (don’t forget to call the superclass implementation):




Important methods on DreamService that you may want to call:




  • setContentView() — set the scene for your Daydream. Can be a layout XML resource ID or an instance of View, even a custom View you implement yourself.

  • setInteractive(boolean) — by default, your Daydream will exit if the user touches the screen, like a classic screen saver. If you want the user to be able to touch and interact with your Views, call setInteractive(true).

  • setFullscreen(boolean) — convenience method for hiding the status bar (see below).

  • setScreenBright(boolean) — by default, Daydreams keep the screen on at full brightness, which may not be appropriate for some situations (for example, dark rooms); setting this to false will reduce the display brightness to a very low level.



Finally, to advertise your Daydream to the system, create a <service> for it in your AndroidManifest.xml:



<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.app">
<uses-sdk android:targetSdkVersion="17" android:minSdkVersion="17" />

<application>
<service
android:name=".ExampleDaydream"
android:exported="true"
android:label="@string/my_daydream_name">
<intent-filter>
<action android:name="android.service.dreams.DreamService" />
<category android:name="android.intent.category.DEFAULT" />
</intent-filter>
<meta-data
android:name="android.service.dream"
android:resource="@xml/dream_info" />
</service>
</application>
</manifest>


The <meta-data> tag is optional; it allows you to point to an XML resource that specifies a settings Activity specific to your Daydream. The user can reach it by tapping the settings icon next to your Daydream’s name in the Settings app.



<!-- res/xml/dream_info.xml -->
<?xml version="1.0" encoding="utf-8"?>
<dream xmlns:android="http://schemas.android.com/apk/res/android"
android:settingsActivity="com.example.app/.ExampleDreamSettingsActivity" /&gt


Here's an example to get you going: a classic screen saver, the bouncing logo, implemented using a TimeAnimator to give you buttery-smooth 60Hz animation.




Figure 2. Will one of them hit the corner?



public class BouncerDaydream extends DreamService {
@Override
public void onDreamingStarted() {
super.onDreamingStarted();

// Our content view will take care of animating its children.
final Bouncer bouncer = new Bouncer(this);
bouncer.setLayoutParams(new
ViewGroup.LayoutParams(MATCH_PARENT, MATCH_PARENT));
bouncer.setSpeed(200); // pixels/sec

// Add some views that will be bounced around.
// Here I'm using ImageViews but they could be any kind of
// View or ViewGroup, constructed in Java or inflated from
// resources.
for (int i=0; i<5; i++) {
final FrameLayout.LayoutParams lp
= new FrameLayout.LayoutParams(WRAP_CONTENT, WRAP_CONTENT);
final ImageView image = new ImageView(this);
image.setImageResource(R.drawable.android);
image.setBackgroundColor(0xFF004000);
bouncer.addView(image, lp);
}

setContentView(bouncer);
}
}

public class Bouncer extends FrameLayout implements TimeAnimator.TimeListener {
private float mMaxSpeed;
private final TimeAnimator mAnimator;
private int mWidth, mHeight;

public Bouncer(Context context) {
this(context, null);
}

public Bouncer(Context context, AttributeSet attrs) {
this(context, attrs, 0);
}

public Bouncer(Context context, AttributeSet attrs, int flags) {
super(context, attrs, flags);
mAnimator = new TimeAnimator();
mAnimator.setTimeListener(this);
}

/**
* Start the bouncing as soon as we’re on screen.
*/
@Override
public void onAttachedToWindow() {
super.onAttachedToWindow();
mAnimator.start();
}

/**
* Stop animations when the view hierarchy is torn down.
*/
@Override
public void onDetachedFromWindow() {
mAnimator.cancel();
super.onDetachedFromWindow();
}

/**
* Whenever a view is added, place it randomly.
*/
@Override
public void addView(View v, ViewGroup.LayoutParams lp) {
super.addView(v, lp);
setupView(v);
}

/**
* Reposition all children when the container size changes.
*/
@Override
protected void onSizeChanged (int w, int h, int oldw, int oldh) {
super.onSizeChanged(w, h, oldw, oldh);
mWidth = w;
mHeight = h;
for (int i=0; i<getChildCount(); i++) {
setupView(getChildAt(i));
}
}

/**
* Bouncing view setup: random placement, random velocity.
*/
private void setupView(View v) {
final PointF p = new PointF();
final float a = (float) (Math.random()*360);
p.x = mMaxSpeed * (float)(Math.cos(a));
p.y = mMaxSpeed * (float)(Math.sin(a));
v.setTag(p);
v.setX((float) (Math.random() * (mWidth - v.getWidth())));
v.setY((float) (Math.random() * (mHeight - v.getHeight())));
}

/**
* Every TimeAnimator frame, nudge each bouncing view along.
*/
public void onTimeUpdate(TimeAnimator animation, long elapsed, long dt_ms) {
final float dt = dt_ms / 1000f; // seconds
for (int i=0; i<getChildCount(); i++) {
final View view = getChildAt(i);
final PointF v = (PointF) view.getTag();

// step view for velocity * time
view.setX(view.getX() + v.x * dt);
view.setY(view.getY() + v.y * dt);

// handle reflections
final float l = view.getX();
final float t = view.getY();
final float r = l + view.getWidth();
final float b = t + view.getHeight();
boolean flipX = false, flipY = false;
if (r > mWidth) {
view.setX(view.getX() - 2 * (r - mWidth));
flipX = true;
} else if (l < 0) {
view.setX(-l);
flipX = true;
}
if (b > mHeight) {
view.setY(view.getY() - 2 * (b - mHeight));
flipY = true;
} else if (t < 0) {
view.setY(-t);
flipY = true;
}
if (flipX) v.x *= -1;
if (flipY) v.y *= -1;
}
}

public void setSpeed(float s) {
mMaxSpeed = s;
}
}


This example code is handy for anything you want to show the user without burning it into the display (like a simple graphic or an error message), and it also makes a great starting point for more complex Daydream projects.



A few more idle thoughts




  • First, do no harm: Daydream is meant to run when a device is charging. However, if the Daydream consumes too much CPU, charging might happen very slowly or not at all! The system will stop your Daydream if it detects that the device is not charging, so make sure your code leaves enough power to charge the battery in a reasonable amount of time.

  • Respect the lockscreen: Daydream runs on top of the secure keyguard, which means that if you might be showing sensitive content, you need to give the user tools to control that content. For example, Photo Table and Photo Frame allow the user to select the albums from which photos will be displayed (avoiding embarrassing slideshows).

  • Screen brightness: Think about where you expect your Daydream to be used and adjust the screen brightness accordingly using setScreenBright() and possibly even using darker or brighter colors as necessary. A bedside clock will need to be dimmer than a desk clock; if you expect your Daydream to serve both purposes you'll need to give the user a choice.

  • To hide the status bar or not: Many users will need instant access to the battery level and time of day, so you should avoid using setFullscreen(), particularly if your Daydream is more informational than artistic. Daydream will start with the status bar in “lights out” mode (View.SYSTEM_UI_FLAG_LOW_PROFILE), where it’s quite unobtrusive but still shows the clock and charge status.

  • When to use settings: In general, you have a little latitude for adding extra knobs and dials to Daydream settings. After all, this is a personalization feature, so users should be encouraged to tweak things until they feel at home. Sometimes, though, a more compelling experience can come from taking an artistic stand: giving the user a choice from a small number of polished, beautiful configurations (rather than providing all the controls of a commercial airline cockpit).

  • There can be more than one: If you discover that your settings allow the user to pick between a few radically different display modes, consider splitting your Daydream into multiple DreamService implementations. For example, the photo gallery in Android 4.2 provides both the Photo Table and Photo Frame Daydreams.

  • Use an Activity for development: Most Android development tools are optimized for developing and debugging conventional Android apps; since DreamService and Activity are so similar, it can be useful to create a testing Activity that hosts the same content view as your DreamService. This way you can launch and test your code easily from your IDE as if it were any other Android project.



OK, that’s enough for now; you have the tools to go build Daydream support into your apps. Have fun with it — if you do, your users will have fun too. Oh, and when you upload your shiny new APK to Google Play, be sure to add a note to your app’s description so that users searching for Daydreams can discover it.



Further reading and samples



  • API docs for DreamService

  • Sample code: BouncerDaydream, complete project for the code snippets in this post

  • Sample code: WebView, a Daydream that shows an HTML page

  • Sample code: Colors, a Daydream that demonstrates OpenGL ES 2.0 and TextureView


URL: http://android-developers.blogspot.com/2012/12/daydream-interactive-screen-savers.html

Saturday, December 22, 2012

[Gd] No WebView required, with native YouTube Player API for Android

| More

Google Developers Blog: No WebView required, with native YouTube Player API for Android

Author Photo
By Scott Knaster, Google Developers Blog Editor

This post is abridged and cross-posted from the YouTube API Blog.


Adding a high-quality video experience to your Android application just got a whole lot easier. Starting today, you can embed and play YouTube videos in your app using the new YouTube Android Player API.

The API, which was pre-announced at Google I/O 2012, offers these benefits:
We are launching the API as experimental, although we do not expect major interface changes going forward.

The only limit now is your imagination (and ToS)

These instructions explain how to include the API client library in your Android application. The library is supported on Android devices running version 4.2.16 or newer of the Android YouTube app. By including the library in your project, you can create rich video playback experiences through the ability to control and customize the video player. Flipboard, shown below, is a good example. See the full post for more cool app examples.


Flipboard
Flipboard

Learn more

If you would like to learn more about the YouTube Android Player API, read the full post on The YouTube API Blog. The post features several companies already using the API and contains useful links to source code examples and documentation. Alternatively, get started by watching some of the videos from our YouTube Android Player API playlist.




Scott Knaster is the Editor of Google Developers Blog. His programming books have been translated into several languages, including Japanese and Pascal.
URL: http://googledevelopers.blogspot.com/2012/12/no-webview-required-with-native-youtube.html

Friday, December 21, 2012

[Gd] No WebView required, with native YouTube Player API for Android

| More

YouTube API Blog: No WebView required, with native YouTube Player API for Android

Adding a high-quality video experience to your Android application just got a whole lot easier. Starting today, you can embed and play YouTube videos in your app using the new YouTube Android Player API.

The API, which was pre-announced at Google I/O 2012, offers these benefits:
We are launching the API as experimental, though we do not expect major interface changes going forward.

The Only Limit Now is Your Imagination (and ToS)

These instructions explain how to include the YouTubeAndroidPlayerApi.jar client library in your Android application. The library is supported on Android devices running version 4.2.16 or newer of the Android YouTube app.

You can use the YouTubeApiServiceUtil class' isYouTubeApiServiceAvailable method to confirm that a device is compatible.

For a simple embed, use the YouTubeStandalonePlayer. To build a more sophisticated user interface, try the YouTubePlayerView or the YouTubePlayerFragment. Fragments can help create an engaging experience as shown in the Video Wall app example.


Play With These Apps

Here are a few interesting apps available for you to explore:
  • See everything on Flipboard, all your news and life’s great moments in one place. Now you can watch YouTube videos from wherever you are in Flipboard without leaving the application, providing a more integrated and seamless experience.
  • BuzzFeed delivers original reporting, scoops, and the hottest social content on the web. Android users can now view their favorite BuzzFeed content featuring YouTube videos in the BuzzFeed app and share with their friends.
  • 9x9.tv enables users to discover and watch curated, topical videos that are organized into TV-like channels. Their blog describes their experience developing with the API.
  • SoundTracking lets people use their mobile phone or tablet to share their music moments and favorite jams with friends and family.  Users can now discover and play YouTube music videos of the songs within their music timeline.
  • Fitness Flow by Skimble helps you get in shape with high-quality exercise videos led by professional trainers. Skimble uses YouTube to stream workout content on your Android phone and tablets.
Check out a few screen shots below or download the apps from Google Play today!
Flipboard BuzzFeed Skimble Workout Trainer
FlipboardBuzzFeedSkimble Workout Trainer
Learn More

If you would like to learn more about the YouTube Android Player API, the documentation is a great place to start. In addition, we have curated useful videos in this playlist. Please subscribe to the YouTube for Developers' channel to keep up on the latest.


Check Out The Sample Code

We’ve prepared several code examples to make it easy for you to get started with the new API. You will find them on code.google.com. The description of the examples is available in our documentation. If you need additional help with the API feel free to use our support resources.

Cheers,
-- Ross McIlroy, Anton Hansson, and Horia Ciurdar, YouTube Mobile Team





URL: http://apiblog.youtube.com/2012/12/no-webview-required-with-native-youtube.html

[Gd] No more silent extension installs

| More

Chromium Blog: No more silent extension installs

It’s important for users to know what extensions they have enabled since extensions can sometimes influence Chrome’s functionality and performance. Many users have installed extensions from the Chrome Web Store, but some users have extensions that were silently installed without their knowledge.

Until now, it has been possible to silently install extensions into Chrome on Windows using the Windows registry mechanism for extension deployment. This feature was originally intended to allow users to opt-in to adding a useful extension to Chrome as a part of the installation of another application. Unfortunately, this feature has been widely abused by third parties to silently install extensions into Chrome without proper acknowledgment from users.

Two new features in Chrome 25 will help users run only the extensions they want to use:

Extensions installed by third party programs using external extension deployment options will be disabled by default. When a third party program installs an extension, the Chrome menu will be badged, and users can click through the Chrome menu to see a dialog containing an option to enable the extension or to remove it from their computer.

In addition, all extensions previously installed using external deployment options will be automatically disabled. Chrome will show a one-time prompt to allow the re-enabling of any of the extensions.

Windows application developers should ask users to install Chrome extensions from within Chrome. A great way to allow users to install a Chrome extension related to your Windows application is to link users to your website and use inline installation.

If you have questions, please get in touch with us on the Chromium extensions group.

Posted by Peter Ludwig, Product Manager

URL: http://blog.chromium.org/2012/12/no-more-silent-extension-installs.html

[Gd] Managing Projects with Gantt Charts using Google Apps Script

| More

Google Apps Developer Blog: Managing Projects with Gantt Charts using Google Apps Script

Editor’s Note: Guest author Ronald Dahrs runs Forscale, an IT and project management company based in the Netherlands. -- Arun Nagarajan

Google Apps is well-suited for project management because it’s a cloud-based productivity suite that helps you and your team connect and get work done from anywhere on any device. Using Google Apps Script, we can push the capabilities even further to create advanced scheduling and management tools. A common tool in project management circles is the Gantt chart: a schedule of the tasks in the project and how they relate to each other over time.

The spreadsheet that generated that Gantt chart is available in the template gallery today. In this post, we’ll explore the basics of how the template works and explain a few of the Apps Script techniques that transform Google Sheets into such a powerful project management tool.

When you open the template, you’ll see stubs for each type of task, but the screenshot above shows an example of a slightly larger project plan — in fact, the same data used to generate the Gantt chart below.

The template’s sophisticated formulas rely on the structure of the table to enable schedule awareness and task dependencies. However, we still ensure that the user can rename, rearrange, or add columns by using a hidden header to identify each column. This diagram demonstrates the spreadsheet’s structure:

In Apps Script, we use the spreadsheet’s onEdit() event to monitor user interaction with the schedule portion of the spreadsheet and update the Gantt chart accordingly. The powerful JavaScript language does all the required summary calculations based on the provided dates and completion percentages.

We have also used Apps Script’s addMenu() method to build a custom menu that calls row-oriented functions like indenting tasks to get a so-called Work Breakdown Structure with summary tasks. If you just want to see an overview, the custom menu allows you to collapse tasks, which we accomplished through the hideRows() method.

For changes that do not trigger an onEdit() event (for example, clearing a row), the user can use the menu’s Refresh command to recalculate the schedule.

The template stores user preferences as Script Properties and offers an interactive user interface built in UiApp to change those settings:

Finally, to render the Gantt chart, we use cell background colors to visually group and highlight the appropriate cells. This creates the effect of a continuous calendar with clearly visible start and finish dates for each task.

var ganttColors = ganttRange.getBackgroundColors();
var ganttValues = ganttRange.getValues();

// update Gantt colors and values
ganttRange.setBackgroundColors(ganttColors).setValues(ganttValues);
Ronald Dahrs

Ronald combines his knowledge of project management and software solutions at his company, Forscale. He believes Google Apps is an excellent platform for online project management. He uses Google Apps Script to integrate the services to manage a wide range of projects.


URL: http://googleappsdeveloper.blogspot.com/2012/12/managing-projects-with-gantt-charts.html

[Gd] To the Google developer community, 2012’s a wrap

| More

Google Developers Blog: To the Google developer community, 2012’s a wrap

Author Photo
By Phoebe Peronto, Developer Marketing

‘Tis the season to reflect on all that you have done this year: developers and other friends in the Google Developer community. From a Gangnam style-inspired app, to growing the GDG community beyond 330 active chapters, let’s just say that 2012 has been nothing short of amazing.

You have...

...helped Google I/O 2012 reach more than 13,000 developers by hosting over 50 I/O Extended events all over the world. Looking forward to Google I/O 2013!

...hosted a massive DevFest season, with 75 DevFests conducted in only 3 short months. During the season, these events reached over 14,000 developers in 39 countries worldwide.




...grown the GDG community to an astounding 335 active and incubating chapters in over 90 countries.



...attended dozens of Google+ Hangouts on Google Developers Live to learn more about how to make cool apps with Google tools and technologies.



...made countless great apps at DevFest hackathons.

Here’s to a great year, and many more to come!

Want to learn more? Find your nearest GDG chapter to get involved in local events, and connect with Google developers 24/7/365 on Google Developers Live and +Google Developers.


Phoebe Peronto is on the Google Developer Product Marketing team. Her mission is to make developer magic by sharing Google tools, technologies, and programs with the community to make super cool apps. She's also a foodie, globetrotter, and avid runner.

Posted by Scott Knaster, Editor
URL: http://googledevelopers.blogspot.com/2012/12/to-google-developer-community-2012s-wrap.html

Thursday, December 20, 2012

[Gd] Dev Channel Update for Chrome OS

| More

Chrome Releases: Dev Channel Update for Chrome OS

The Dev channel has been updated to 25.1364.2 (Platform version: 3428.0.0) for all Chrome OS devices. This build contains a number of stability fixes and feature enhancements.

Some highlights of these changes are:


  • Encrypted Media Extensions are enabled by default 
  • Updated the 32bit Netflix plugin to 2.0.8 which fixes video corruption seen on some videos.
  • Fixed several crashes

Known Issues:

  • In a user’s first login session, going to ‘Report an issue...’ can cause the Chrome browser to hang. (166988)
  • Audio is not heard when spoken accessibility feedback is enabled (37391)

If you find new issues, please let us know by visiting our help site or filing a bug. Interested in switching channels? Find out how. You can submit feedback using ‘Report an issue...’ in the Chrome menu (3 horizontal bars in the upper right corner of the browser).

Danielle Drew
Google Chrome
URL: http://googlechromereleases.blogspot.com/2012/12/dev-channel-update-for-chrome-os_20.html

[Gd] Dev Channel Update

| More

Chrome Releases: Dev Channel Update

The Dev channel has been updated to 25.0.1364.5 for Windows, Mac, Linux, and Chrome Frame. This update contains stability and memory fixes. A full list of changes in this build is available in the SVN revision log. Interested in switching release channels? Find out how. If you find a new issue, please let us know by filing a bug.

Jason Kersey
Google Chrome
URL: http://googlechromereleases.blogspot.com/2012/12/dev-channel-update_20.html

[Gd] Localize Your Promotional Graphics on Google Play

| More

Android Developers Blog: Localize Your Promotional Graphics on Google Play

Posted by Ellie Powers, Product Manager on the Google Play team



Google Play is your way to reach millions and millions of Android users around the world. In fact, since the start of 2011, the number of countries where you can sell apps has increased from 30 to over 130 — including most recently, the launch of paid app support in Israel, Mexico, the Czech Republic, Poland, Brazil and Russia, and fully two-thirds of revenue for apps on Google Play comes from outside of the United States.



To help you capitalize on this growing international audience, it’s now even easier to market your apps to users around the world, by adding images and a video URL to your Google Play store listing for each of Google Play’s 49 languages, just as you’ve been able to add localized text.






A localized feature graphic can show translated text or add local flavor to your app — for example, changing its theme to reflect local holidays. Always make sure that your feature graphic works at different sizes.



Once you’ve localized your app, you’ll want to make sure users in all languages can understand what your app does and how it can benefit them. Review the graphics guidelines and get started with localized graphics.



Localized screenshots make it clear to the user that they’ll be able to use your app in their language. As you’re adding localized screenshots, remember that a lot of people will be getting new tablets for the holidays, and loading up with new apps, so you’ll want to include localized tablet screenshots to show off your tablet layouts.



With localized videos, you can now include a language-appropriate voiceover and text, and of course show the app running in the user’s language.



Ready to add localized images and videos to your store listing? To add localized graphics and video to your apps, you need to use the Google Play Developer Console preview — once you add localized graphics, you won’t be able to edit the app using the old version anymore. Those of you who use APK Expansion Files will now want to try the new Developer Console because it now includes this feature. We’ll be adding support for Multiple APK very soon. Once you’ve saved your application in the new Developer Console, automated translations become available to users on the web and devices — with no work from you.



What are you doing to help your app reach a global audience?


URL: http://android-developers.blogspot.com/2012/12/localize-your-promotional-graphics-on.html

[Gd] Localize your Promotional Graphics in Google Play

| More

Android Developers Blog: Localize your Promotional Graphics in Google Play

Google Play is your way to reach millions and millions of Android users around the world. In fact, since the start of 2011, the number of countries where you can sell apps has increased from 30 to over 130 -- including most recently, the launch of paid app support in Israel, Mexico, the Czech Republic, Poland, Brazil and Russia. In fact, fully two-thirds of revenue for apps on Google Play comes from outside of the United States.

To help you capitalize on this growing international audience, it’s now even easier to market your apps to users around the world, by adding images and a video URL to your Google Play store listing for each of Google Play’s 49 languages, just as you’ve been able to add localized text.

A localized feature graphic can show translated text or add local flavor to your app -- for example, changing its theme to reflect local holidays. Always make sure that your feature graphic works at different sizes.

Once you’ve localized your app, you’ll want to make sure users in all languages can understand what your app does and how it can benefit them. Review the graphics guidelines and get started with localized graphics.

Localized screenshots make it clear to the user that they’ll be able to use your app in their language. As you’re adding localized screenshots, remember that a lot of people will be getting new tablets for the holidays, and loading up with new apps, so you’ll want to include localized tablet screenshots to show off your tablet layouts.

With localized videos, you can now include a language-appropriate voiceover and text, and of course show the app running in the user’s language.

Ready to add localized images and videos to your store listing? To add localized graphics and video to your apps, you need to use the Google Play Developer Console preview - once you add localized graphics, you won’t be able to edit the app using the old version anymore. Those of you who use APK Expansion Files will now want to try the new Developer Console because it now includes this feature. We’ll be adding support for Multiple APK very soon. Once you’ve saved your application in the new Developer Console, automated translations become available to users on the web and devices -- with no work from you.

What are you doing to help your app reach a global audience?
URL: http://android-developers.blogspot.com/2012/12/localize-your-promotional-graphics-in.html

[Gd] Chrome for iOS Update

| More

Chrome Releases: Chrome for iOS Update

Chrome for iPhone and iPad has been updated to Chrome 23.0.1271.100. This release fixes issues with playing audio in the browser. You can get the update via the App Store, or from the prompt inside of Chrome. Known issues are available on the Chrome support site. If you find a new issue, please let us know by filing a bug.

Jason Kersey
Google Chrome
URL: http://googlechromereleases.blogspot.com/2012/12/chrome-for-ios-update.html

[Gd] Developer Insights: Mobile voucher sales terminal in Africa powered by App Engine

| More

Google App Engine Blog: Developer Insights: Mobile voucher sales terminal in Africa powered by App Engine



Today’s guest blogger is Dale Humby, CTO of Nomanini.  Nomanini is a startup based in South Africa which provides a platform to sell prepaid products such as airtime, electricity and insurance electronically.  In this post, Dale explains how the backend systems of their flagship device, Lula, run on App Engine.


Introduction



In rural markets, it is often difficult to distribute physical vouchers, which can be used to provide access to services such as electricity, insurance, and airtime for mobile phones.  Nomanini enables entrepreneurs in Africa to earn income selling prepaid vouchers in their local communities.  We do this by distributing a portable, user-friendly voucher sales terminal, known as the Lula, which can be used on-the-go by people ranging from taxi drivers to street vendors.









The Lula, Nomanini's portable voucher sales terminal





Running Lula on App Engine












Nomanini uses Google App Engine to support the backend system for our network of point of sale terminals.

Terminals in the field connect to our App Engine application through the GSM mobile network.  The terminals synchronize when a connection becomes available, allowing sales to be processed even when devices are offline.

The devices make an https post to a URL endpoint. Any data uploaded by the device is queued for processing as multiple tasks, and the App Engine application sends information back to the device within the returned body.  Often the only responsibility a URL endpoint has is to create a task. If work can be broken into discrete areas we fan out to other tasks which run in parallel on separate App Engine instances. By controlling how many concurrent tasks are run in each queue, we are able to prioritize specific parts of our application ensuring the best quality of service for our customers.

By utilizing cross entity group transactions, transactional tasks and appropriate key naems for entities in the Datastore, we have been able to build an extremely resilient application capable of processing data.  

Services we use






  • ProdEagle (another application built on top of Google App Engine) for real time metrics visualization




Benefits of building on App Engine


Saves time
App Engine’s High Replication Datastore gives us the peace of mind that our data will be available and accurate to a degree that we couldn’t easily replicate ourselves. As a start up, capital and time are in short supply. With App Engine, we can focus on building our unique application rather than worrying about infrastructure.  App Engine Task Queues allow parallel data execution and retrying on failure, with little code overhead for developers.

Scalability
Nomanini has very cyclical traffic patterns: our peak traffic occurs in the early morning and late afternoon, with a monthly peak around payday in South Africa. Google App Engine automatically scales our application so that we don’t have to pay for excess server capacity during off-peak times, but have capacity available when we need it.

Ease of operation
Deployment is a breeze on App Engine.  With just a few scripts tied in to our continuous integration server we can:

  • write the version number and app name into app.yaml

  • deploy automatically

  • run data migration scripts

  • change the default version once all indexes are serving



Monitoring is simplified by using built in dashboards. We can also export logs to Google Cloud Storage and run ad-hoc queries on analytics using Google BigQuery.

Conclusion



To reduce our time to market we used as many off-the-shelf components as possible, including Google App Engine.

We chose App Engine because it offers a platform with a consistent, well documented, ready-to-use set of services and allows our developers to test within an environment that is identical to our production environment - a practice that used to be prohibitively expensive.

Using the Google App Engine platform has saved our small development team time that we would have had to use to design, build and test a highly reliable backend to support our network of vending terminals in farflung places.  Instead, we can focus our time on building a device that we hope will impact the way local commerce is done in rural economies.




To read more about the story of Nomanini, check out the post about us on the Official Google Blog.  




-Contributed by Dale Humby, CTO, Nomanini

Posted by Zafir Khan, Product Marketing Manager, Google App Engine
URL: http://googleappengine.blogspot.com/2012/12/developer-insights-mobile-voucher-sales.html

Wednesday, December 19, 2012

[Gd] New mod_pagespeed: cache advances, progressive JPEGs

| More

Google Developers Blog: New mod_pagespeed: cache advances, progressive JPEGs

Bharath
Jan-Willem
Joshua
By Joshua Marantz, Jan-Willem Maessen, and Bharath Bhushan, PageSpeed Team

When mod_pagespeed launched in November 2010, one of its benefits was to help websites better exploit browser caching by signing URLs with the resource content hash. This improves the user experience coming back to the same site, and navigating within a site.

In mod_pagespeed 1.2 we have released two new features that improve the caching experience for users coming to a site for the first time: canonicalize_javascript_libraries and insert_dns_prefetch. For additional speedups, converting jpegs to progressive format has been added to the Core Filter Set, and the scope of optimization has been extended to include resources served by external servers, even if they are not running mod_pagespeed.

Your web page loads faster when JQuery is preloaded in users' browser

Numerous web sites use common JavaScript libraries such as jQuery and jQuery UI. But when one library is stored on many sites, browsers end up re-downloading that library for each new site – a waste of time and bandwidth. The new canonicalize_javascript_libraries filter in mod_pagespeed finds such libraries on your site and replaces them with links to the equivalent libraries on ajax.googleapis.com. With the optimization, a browser will notice that your site is requesting the library from the same shared library provider as a previous site it visited, and will use the copy in its cache.

It’s possible to do this by hand, but there are a number of reasons why you might prefer to automate the process. Most important is that you may be using third-party code on your web sites that includes some of these libraries. Using canonicalize_javascript_libraries lets you replace these with hosted versions without having to touch third-party code. It also lets you use local, un-minified JavaScript source code for these libraries while you are debugging your site, and then transition automatically to using minified hosted code when you deploy. The filter spots external libraries using a hash signature; we’ve added a new configuration file, pagespeed_libraries.conf, that stores these signatures, so that you can upgrade the signature configuration without disrupting the rest of your apache installation.

Resolving DNS entries early for critical assets saves hundreds of milliseconds

DNS resolution time varies from <1ms for locally cached results, to hundreds of milliseconds due to the cascading nature of DNS. This can contribute significantly to total page load time. Below is a WebPagetest waterfall showing how DNS lookup time can affect page load time.


The new insert_dns_prefetch filter inserts <link rel="dns-prefetch"> tags to allow the browser to pre-resolve DNS for resources on the page. The waterfall below shows the improvement after inserting the hints.


<link rel="dns-prefetch"> is supported on Chrome, Firefox and Internet Explorer.

Improved performance by optimizing external resources and progressive JPEG

In addition to these new capabilities, mod_pagespeed 1.2 can proxy and optimize resources from trusted domains. This feature enables you to optimize resources even from servers that don't run mod_pagespeed. Beyond compressing and cache-extending such resources, this can improve performance of sites running SPDY where the best practices for performance are to serve all resources from the same domain (see mod_spdy).

Further, convert_jpeg_to_progressive is now a ‘core’ filter. Large JPEG images are now transcoded to progressive. This both improves the browser experience and makes such files smaller.

To see more details about the release, check out the release notes and mod_pagespeed download page.


Joshua Marantz runs Google’s PageSpeed team in Cambridge, MA, which is dedicated to making the web faster for everyone. Josh has been working on making software run fast for several decades, at Google and before that on accelerated chip simulation.

Jan Maessen wrote the earliest version of the image and JavaScript filters in mod_pagespeed and has been with the team ever since. Before joining Google, he was a co-designer and library implementer for the Fortress programming language.

Bharath Bhushan works on making website performance better. He has a Masters in CS from IIT Madras, India.


Posted by Scott Knaster, Editor
URL: http://googledevelopers.blogspot.com/2012/12/new-modpagespeed-cache-advances.html

[Gd] Putting Zürich before Århus

| More

Google Developers Blog: Putting Zürich before Århus

Author Photo
By Mark Davis, International Software Architect

Until now, it has been very difficult for web application designers to do something as simple as sort names correctly according to the user's language. And it matters: English readers wouldn’t expect Århus to sort below Zürich, but Danish speakers would.

Because linguistic sorting requires a sophisticated algorithm and lots of data, it was impractical to do this natively in JavaScript. Until now, the only full solution for sorting on the client side was to generate on a server a sortKey for every string that needed to be sorted, and send the sortkeys — base64-encoded — down to the client along with the strings. Pretty ugly! And what’s doubly frustrating is that the underlying operating systems have all been able to handle this, whether through International Components for Unicode (ICU) or Windows APIs.

The new internationalization specification for ECMAScript (the “official” name for JavaScript) changes this picture. It is already in the production version of Chrome, and is on track for other major browsers.

Linguistic sorting is not the only benefit—not only will users be able to see names sorted correctly, but also correct numeric values (“1,234.56” in English, but “1.234,56” in German), dates (“March 10, 2012” vs “10. März 2012”), and so on. While the results might not be precisely the same in every browser, they should be appropriate to the language, and are returned using a uniform API.

On any enabled browser — in its supported languages — web application developers can:
  • compare strings correctly: choosing whether or not to ignore accents, case differences, etc.
  • format numbers correctly: choosing decimal places, currencies, whether to use thousands-separator, etc.
  • format dates and times correctly: choosing decimal places, numeric vs named months, etc.
  • match locales: comparing the user’s desired locales (say Arabic and French) against the supported locales (say French, German, and English), to get the best match.
The API also allows for linguistic support in offline web applications, which wasn’t practical before. It builds on the industry standards BCP47 (for identifying languages and locales) and LDML (part of the Unicode Common Locale Data Repository (CLDR) project). For the gory details of the spec, see ECMA-402: ECMAScript Internationalization API Specification (just approved by the Ecma General Assembly).


Mark Davis is president and cofounder of the Unicode consortium, and founder of ICU and CLDR. Mark is fond of food, film, travel, and RPGs. Mark lived for 4 years in Switzerland, and is moving back in February.

Posted by Scott Knaster, Editor
URL: http://googledevelopers.blogspot.com/2012/12/putting-zurich-before-arhus.html

[Gd] Beta Channel Update

| More

Chrome Releases: Beta Channel Update

The Beta channel has been updated to 24.0.1312.45  for Windows, Mac, Linux, and Chrome Frame.  This build contains stability fixes. Full details about what changes are in this build are available in the SVN revision log. Interested in switching release channels? Find out how. If you find a new issue, please let us know by filing a bug.

Dharani Govindan
Google Chrome
URL: http://googlechromereleases.blogspot.com/2012/12/beta-channel-update_19.html

[Gd] Stable Channel Update for Chrome OS

| More

Chrome Releases: Stable Channel Update for Chrome OS


The Stable channel has been updated to 23.0.1271.110 (Platform version: 2913.276.0) for Samsung Series 5 and Acer C7 Chromebooks. Machines will receive this update over the next several days.

Some highlights of these changes are: 
  • Updated the 32bit Netflix plugin to 2.0.8 which fixes video corruption seen on some videos.

If you find new issues, please let us know by visiting our help site or filing a bug. Interested in switching channels? Find out how. You can submit feedback using ‘Report an issue...’ in the Chrome menu (3 horizontal bars in the upper right corner of the browser).

Danielle Drew
Google Chrome
URL: http://googlechromereleases.blogspot.com/2012/12/stable-channel-update-for-chrome-os_19.html

[Gd] The Hottest Script in Hollywood

| More

Google Apps Developer Blog: The Hottest Script in Hollywood

In just a few hours at the recent Apps Script hackathon in Los Angeles, we saw attendees build everything from website monitoring to room booking to financial tracking apps. For those of you who couldn’t make it, attendees were given a brief introduction to Apps Script and a few hours to let their imaginations run wild. Apps Script’s ease of use enabled them to quickly create fully functioning, useful apps. Here are a few interesting things we saw from local developers:


Website Monitor by Eduardo Arino de la Rubina

These days, small businesses are quickly increasing their online presence; a website outage during a critical period can be devastating to a mom-and-pop shop. Eduardo realized that existing network-monitoring solutions require a significant investment in technology and infrastructure that is beyond the reach of many small-business users. Using Apps Script’s UrlFetch and Spreadsheet services, he was able to quickly create a website monitor packaged in an easy-to-use spreadsheet that, given a list of URLs, tries to fetch each one and records the latency and content length.

The code is available here.


Get A Room by Danny Favela

Get A Room allows users to book meeting rooms by taking advantage of Apps Script’s tight integration with Google Calendar and events. The app, built entirely on a Chromebook utilizing Apps Script's cloud friendliness, displays building floorplans with buttons that users can click to book a room. In response to a booking request, the app fetches the room’s calendar and creates a new event. It also updates the UI by replacing the floor plan with a modified image to show the newly booked room. Here is a snippet of the booking code:


// Click handler for the interaction to book a room
function bookBoardroomHandler(e) {
var app = UiApp.getActiveApplication();

// Perform the calendar-booking operations
bookBoardroom();

// Swap the images as visual confirmation
app.remove(app.getElementById('imageDefaultLayout'));
app.add(app.getElementById('imageBoardroom'));

app.close();
return app;
}

function bookBoardroom(e) {
var calendarBoardroom = CalendarApp.getCalendarsByName("Boardroom");
calendarBoardroom[0].createEventFromDescription("Boardroom Meeting");
}


Stock Info by Matt Kaufman

Matt decided to build a web service that provides information about publicly traded stocks. The app’s backend consists of a spreadsheet with stock symbols of interest. Using Apps Script’s FinanceService, Matt loops through the spreadsheet on a timed trigger and appends the latest stock information for each symbol. He then uses HtmlService to create a web app that outputs an XML page of the stock info based on a symbol parameter in the URL. Here’s a picture of his script in action:

These are just some examples of how quickly useful apps can be created with Apps Script. Thanks to all the attendees for coming out! If you couldn’t make it to the hackathon, check out these tutorials to see how you can get started making great apps.


Kalyan Reddy profile | Stack Overflow

Kalyan is a Developer Programs Engineer on the Google Apps Script team based in NYC. He is committed to increasing developer productivity by helping them fully utilize the power of Apps Script. In his free time, he enjoys participating in the Maker community and hacking together robots.

URL: http://googleappsdeveloper.blogspot.com/2012/12/the-hottest-script-in-hollywood.html