Friday, September 25, 2009

[Gd] A Note on Google Apps for Android

| More

Android Developers Blog: A Note on Google Apps for Android

Lately we've been busy bees in Mountain View, as you can see from the recent release of Android 1.6 to the open-source tree, not to mention some devices we're working on with partners that we think you'll really like. Of course, the community isn't sitting around either, and we've been seeing some really cool and impressive things, such as the custom Android builds that are popular with many enthusiasts. Recently there's been some discussion about an exchange we had with the developer of one of those builds, and I've noticed some confusion around what is and isn't part of Android's open source code. I want to take a few moments to clear up some of those misconceptions, and explain how Google's apps for Android fit in.

Everyone knows that mobile is a big deal, but for a long time it was hard to be a mobile app developer. Competing interests and the slow pace of platform innovation made it hard to create innovative apps. For our part, Google offers a lot of services — such as Google Search, Google Maps, and so on — and we found delivering those services to users' phones to be a very frustrating experience. But we also found that we weren't alone, so we formed the Open Handset Alliance, a group of like-minded partners, and created Android to be the platform that we all wished we had. To encourage broad adoption, we arranged for Android to be open-source. Google also created and operates Android Market as a service for developers to distribute their apps to Android users. In other words, we created Android because the industry needed an injection of openness. Today, we're thrilled to see all the enthusiasm that developers, users, and others in the mobile industry have shown toward Android.

With a high-quality open platform in hand, we then returned to our goal of making our services available on users' phones. That's why we developed Android apps for many of our services like YouTube, Gmail, Google Voice, and so on. These apps are Google's way of benefiting from Android in the same way that any other developer can, but the apps are not part of the Android platform itself. We make some of these apps available to users of any Android-powered device via Android Market, and others are pre-installed on some phones through business deals. Either way, these apps aren't open source, and that's why they aren't included in the Android source code repository. Unauthorized distribution of this software harms us just like it would any other business, even if it's done with the best of intentions.

I hope that clears up some of the confusion around Google's apps for Android. We always love seeing novel uses of Android, including custom Android builds from developers who see a need. I look forward to seeing what comes next!

URL: http://android-developers.blogspot.com/2009/09/note-on-google-apps-for-android.html

[Gd] Using named anchors to identify sections on your pages

| More

Official Google Webmaster Central Blog: Using named anchors to identify sections on your pages

We just announced a couple of new features on the Official Google Blog that enable users to get to the information they want faster. Both features provide additional links in the result block, which allow users to jump directly to parts of a larger page. This is useful when a user has a specific interest in mind that is almost entirely covered in a single section of a page. Now they can navigate directly to the relevant section instead of scrolling through the page looking for their information.

We generate these deep links completely algorithmically, based on page structure, so they could be displayed for any site (and of course money isn't involved in any way, so you can't pay to get these links). There are a few things you can do to increase the chances that they might appear on your pages. First, ensure that long, multi-topic pages on your site are well-structured and broken into distinct logical sections. Second, ensure that each section has an associated anchor with a descriptive name (i.e., not just "Section 2.1"), and that your page includes a "table of contents" which links to the individual anchors. The new in-snippet links only appear for relevant queries, so you won't see it on the results all the time — only when we think that a link to a section would be highly useful for a particular query.

Posted by Raj Krishnan, Snippets Team
URL: http://googlewebmastercentral.blogspot.com/2009/09/using-named-anchors-to-identify.html

[Gd] GWT Community Updates

| More

Google Web Toolkit Blog: GWT Community Updates

Community announcements

GWT on the go with gwt-mobile-webkit: A new project is underway started by a developer in the GWT community that provides GWT API bindings to HTML 5 features supported by Mobile WebKit. While the project more closely follows the WebKit implementation for HTML 5 features and other WebKit libraries, other browsers are also supported for various HTML 5 APIs. Check out the project homepage for more details.

GWT Gadgets riding the Wave: The Google Wave Gadget API is an awesome way to leverage the power of Wave in your gadgets. Thanks to the efforts of yet another great GWT community member, you can now more easily use the Google Wave Gadget API in your GWT developed Gadgets using the cobogwave project. This library builds on the existing GWT Gadgets support available in the Google API Libraries for GWT project.

GWT-GData v 1.10.1 released: Developed through the guidance of the GWT team, GWT community contributors and the main project lead, Bobby Soares, the gwt-gdata project recently had its 1.10.1 release. This is a nice library to access many of the GData APIs from Google Analytics to Google Maps Data. The full list of supported GData APIs can be found on the project page.

GWT-MVC 0.3 released: The MVC pattern has proven its usefulness in the domain of web application development time and time again. If this pattern is a good fit for the project you're planning or currently working on, you may want to check out the gwt-mvc project, which provides a layer of abstraction to make MVC modeled development easier in GWT.

GWT-Connectors 1.7 released: The gwt-connectors project is a really cool tool for developers who need to connect boxed components with connectors, and now includes connectors with arrow tips. You can check out the demo here, and if you like what you see and need it for your application, check out the project page for more information.

URL: http://googlewebtoolkit.blogspot.com/2009/09/gwt-community-updates.html

Thursday, September 24, 2009

[Gd] Dev Channel Updated: Bug fixes

| More

Google Chrome Releases: Dev Channel Updated: Bug fixes


Version: 4.0.212.1 for Macintosh and 4.0.213.1 for Windows and Linux.

All Platforms
  • [r26815] New-FTP: Requires re-authentication when navigating around. (Issue: 21184)
  • [r26860] [DEPS] Move FTP LIST parsing code to the renderer process, limiting potential damage from security issues.
Windows
  • Issues with drop down select boxes fixed.
  • [r26359] BiDi-language filenames now displayed correctly in download shelf. (Issue: 10860)
Mac
  • Extension shelf (that weird gray box at the bottom) is only displayed if you have extensions installed.
  • [r26495] Add Command-0..8 shortcuts to "select Nth tab" and Command-9 to "select last tab".
  • [r26694] Basic emacs key bindings in text fields should work. (e.g., ctrl-e, ctrl-a, ctrl-d) (Issue: 12538)
  • [r26603] Paste-and-Go for Mac omnibox, cleaned up omnibox context menu. (Issues: 1302110937)
  • [r26471] Form controls now draw correctly in 10.6. (Issue: 19604)
  • [r26646] Search Engine Manager UI improved.
  • [r26567] Find bar now animates open and close.
  • [r26527] Pressing Up/Down arrows in find bar now scrolls page.
  • [r26853] Empty bookmark bar should show IDS_BOOKMARKS_NO_ITEMS. (Issue: 17360)
  • [r26792] Add favicons to items in folders on the bookmark bar. (Issue: 22601)
Linux
  • Issues with drop down select boxes fixed.
  • [r26590] "Create application shortcuts" doing nothing: More reliably find the .desktop file for the browser. (Issue: 21995)
  • [r26647] Implement GetCPUUsage() so the task manager shows CPU. (Issue: 19864)
  • [r26891] Added download in progress dialog. (Issue: 21652)
Extensions
  • [r26526] Fix crashy toolstrips. (Issues: 2207022135)
  • [r26532] Audio and video tag doesn't work for extension resources. (Issue 22152)
  • [r26685] Fix an issue where we do not initiate the extension install UI with certain combinations of HTTP headers.
  • [r26556Introduce chrome.tabs.executeScriptInTab() and chrome.tabs.insertCSSInTab(). (Issue: 12465)
  • [r26706] Hide the mole handle by default. (Issue: 15494)
  • [r26658] Remove the right-click devtools behavior. (Issue: 20634)
  • [r26654] Add CSS classes to the document when switching between toolstrip and mole mode.
  • --show-extensions-on-top works pretty well now (on windows). Try it out!
Sync
  • Sync library now built entirely from trunk.
Known Issues
  • (Issue 22585) - CMD+Down, CMD+Up no longer scrolling to top/bottom of page on Mac.
  • One machine in our QA group is seeing blank pages on Facebook.  (Issue 22978)


More details about additional changes are available in the svn log of all revisions.

You can find out about getting on the Dev channel here: http://dev.chromium.org/getting-involved/dev-channel.

If you find new issues, please let us know by filing a bug at http://code.google.com/p/chromium/issues/entry.

Jonathan Conradt
Engineering Program Manager
URL: http://googlechromereleases.blogspot.com/2009/09/dev-channel-updated-bug-fixes.html

[Gd] Google Sites: Now with an API!

| More

Google Code Blog: Google Sites: Now with an API!

Today, we launched a new Google Data API for Google Sites. The API supports most of the functionality found in Google Sites, which includes the ability to:
  • Retrieve, create, modify, and delete pages and content.
  • Upload/download attachments.
  • Review the revision history across a site.
  • Display recent user activity.
To get started, see the full documentation, Java Developer's Guide, or dive into our code samples. We're also open-sourcing an import/export tool that uploads or creates a local back-up of an entire Google Site.

Visit us in our new developer forum if you have questions!

By Eric Bidelman, Google Sites API Team
URL: http://googlecode.blogspot.com/2009/09/google-sites-now-with-api.html

[Gd] New Data API for Google Sites!

| More

Official Google Data APIs Blog: New Data API for Google Sites!

We're very excited to announce a brand new Data API for Google Sites!

If you're new to the application, Google Sites is a powerful collaborative content creation tool that can be used to centralize file attachments, information from other Google applications (like Google Docs, Google Calendar, YouTube and Picasa), and free-form content. Creating a site together is as easy as editing a document, and you always control who has access, whether it's just yourself, your team, or your whole organization. You can even publish sites to the world.

Now, all of your Google Sites content can be accessed using the Google Data protocol. That means porting over an old webpage or backing up an existing site got much easier! In fact, check out our open-source Google Sites import/export tool that does just that.

So what can you do with the Google Sites API? Glad you asked! The API supports most of the functionality found in Google Sites, which includes the ability to:
  • Retrieve, create, modify, and delete pages and content.
  • Upload/download attachments.
  • Review the revision history across a site.
  • Display recent user activity.
For now, the API is being released in labs as we continue to rapidly add and change features. You can get the full scoop in the documentation. There, you'll also find an updated Java library and several code samples to get you started. We'll be updating the other clients soon.

Visit us in our new developer forum if you have questions!

Posted by Eric Bidelman, Google Sites API Team
URL: http://googledataapis.blogspot.com/2009/09/new-data-api-for-google-sites.html

[Gd] ADC 2 Judging Has Begun!

| More

Android Developers Blog: ADC 2 Judging Has Begun!

ADC 2 App LogoADC 2 Judging App ScreenshotI am happy to announce that Android Developer Challenge 2's first round of judging has begun!

As a reminder, user voting determines which apps will make it to the second round. Voting will occur through an application called Android Developer Challenge 2, which is now available for download from Android Market. Android Developer Challenge 2 presents apps for each user to download and score according to a set of criteria, such as originality and effective use of the Android platform, among others. The first round of judging will last at least two weeks from today. Judging will continue until we receive a sufficient number of votes to identify the top 20 applications in each of the 10 categories (200 apps total) that qualify for the second round.

During the second round, judging will occur through a combination of user voting and input from a panel of industry experts. User voting will continue to occur via Android Developer Challenge 2 and will account for 40% of the final score that each app receives in round two. The remaining 60% of the final score will be determined by the industry expert panel.

It has been a little less than a year since the first Android-powered phones became available. Today, there are more than 10,000 applications available in Android Market. We are pleased by the energy and commitment demonstrated by developers in such a short period of time. Our goal with Android Developer Challenge 2 is to inspire the developer community to produce even more innovative apps for Android. Now on to the voting!

URL: http://android-developers.blogspot.com/2009/09/adc-2-judging-has-begun.html

[Gd] App Engine talks at a conference near you

| More

Google App Engine Blog: App Engine talks at a conference near you

It's September and the fall conference calendar is starting to fill up. Members of the App Engine team will present at these conferences: join us if you are in the area, and feel free to tweet @app_engine if you want us to participate in local developer community events around these dates!

We look forward to meeting you during these trips, if you can make it.



Posted by Patrick Chanezon, App Engine Team

URL: http://googleappengine.blogspot.com/2009/09/app-engine-talks-at-conference-near-you.html

Wednesday, September 23, 2009

[Gd] Write a Gadget, Win $5000!

| More

OpenSocial API Blog: Write a Gadget, Win $5000!

Mark Halvorson from Atlassian Software here! You may have read my blog post a while back about Why Enterprise Software Provider Atlassian chose OpenSocial Atlassian. We've been working hard over the past year adding an OpenSocial container based on Shindig into JIRA 4.  I'm writing today because we've got some cool news for all you gadget developers out there.

But before I mention that, I wanted to give you a heads up about Atlassian. We build affordable, lightweight software that helps enterprises collaborate better. Our products include Confluence, recognized as the most widely-used enterprise wiki, and JIRA, one of the world's most popular issue trackers for IT project management. We also make a bunch of developer tools to help you write great code. Check us out.

We're excited to announce Atlassian Codegeist IV, our fourth annual plugin competition. We're giving away over $50,000 in prizes for the coolest, most useful, most elegant plugin or integration for any of Atlassian's products. There are six prizes, each worth $5,000 in cash, and thousands
more in software, conference tickets, and even a new MacBook!

But the interesting thing for the OpenSocial community is that because JIRA 4 is now an OpenSocial Container, and gadgets are now a big part of our plugin competition! To jumpstart our gadget development, we're sponsoring a category for best OpenSocial gadget inside JIRA. In JIRA 4, we're focusing on the gadgets part of the spec, with more Social features to come in our next release. OpenSocial is a brand new technology for our community, so the field is wide open.

We've also got a first- and second-place Best Plugin prizes, and three other specific categories for different types of plugins (each still worth $5,000). There's something here for everyone, including opportunities beyond traditional Java development.

This year we will even be announcing the winners live on October 21 at AtlasCamp, our premier developer conference. You need not be present to win, but it sure will be more fun!

You can use the Developer Forums to communicate with your peers, find team-members, ask questions, and publicize your awesome new plugin. The Atlassian Developer Community is strong, and Codegeist is a wonderful chance to collaborate with other developers.

Check out the Codegeist website for more information and get started today.

Thanks, and Happy Coding!
http://www.atlassian.com/

Posted by Mark Halvorson, Atlassian Software
URL: http://blog.opensocial.org/2009/09/write-gadget-win-5000.html

[Gd] Gmail for Mobile HTML5 Series: CSS Transforms and Floaty Bars

| More

Google Code Blog: Gmail for Mobile HTML5 Series: CSS Transforms and Floaty Bars

On April 7th, Google launched a new version of Gmail for mobile for iPhone and Android-powered devices. We shared the behind-the-scenes story through this blog and decided to share more of what we've learned in a brief series of follow-up blog posts. This week, I'll talk about different ways to animate the floaty bar.

Even from the earliest brainstorming days for our new version of Gmail for iPhone and Android-powered devices, we knew we wanted to try something novel with menu actions: a context-sensitive, always-accessible UI element that follows conveniently as a user scrolls. Thus, the "floaty bar" was born! It took us a surprisingly long time, experimenting with different techniques and interactions, to converge on the design you see today. Let's look under the covers to see how the animation is achieved. You may be surprised to find that the logic is actually quite simple!


Screenshots of the floaty bar in action

In CSS:
.CSS_FLOATY_BAR {
...
top: -50px; /* start off the screen, so it slides in nicely */
-webkit-transition: top 0.2s ease-out;
...
}
In JavaScript:
// Constructor for the floaty bar
gmail.FloatyBar = function() {
this.menuDiv = document.createElement('div');
this.menuDiv.className = CSS_FLOATY_BAR;
...
};

// Called when it's time for the floaty bar to move
gmail.FloatyBar.prototype.setTop = function() {
this.menuDiv.style.top = window.scrollY + 'px';
};

// Called when the floaty bar menu is dismissed
gmail.FloatyBar.prototype.hideOffScreen = function() {
this.menuDiv.style.top = '-50px';
};

gmail.floatyBar = new gmail.FloatyBar();

// Listen for scroll events on the top level window
window.onscroll = function() {
...
gmail.floatyBar.setTop();
...
};
The essence here is that when the viewport scrolls, the floaty bar 'top' is set to the new viewport offset. The -webkit-transition rule specifies the animation parameters. (The 'top' property is to be animated, over 0.2s, using the ease-out timing function.) This is the animation behavior we had at launch, and it works just fine on Android and mobile Safari browsers.

However, there's actually a better way to achieve the same effect, and the improvement is particularly evident on mobile Safari. The trick is to use "CSS transforms". CSS transforms is a mechanism for applying different types of affine transformations to page elements, specified via CSS. We're going to use a simple one which is translateY. Here's the same logic, updated to use CSS transforms.

In CSS:
.CSS_FLOATY_BAR {
...
top: -50px; /* start off the screen, so it slides in nicely */
-webkit-transition: -webkit-transform 0.2s ease-out;
...
}
In JavaScript:
// Called when it's time for the floaty bar to move
gmail.FloatyBar.prototype.setTop = function() {
var translate = window.scrollY - (-50);
this.menuDiv.style['-webkit-transform'] = 'translateY(' + translate + 'px)';
};

// Called when the floaty bar menu is dismissed
gmail.FloatyBar.prototype.hideOffScreen = function() {
this.menuDiv.style['-webkit-transform'] = 'translateY(0px)';
};
Upon every scroll event, the floaty bar is translated vertically to the new viewport offset (modulo the offscreen offset which is important to the floaty bar's initial appearance). And, why exactly is this such an improvement? Even though the logic is equivalent, iPhone OS's implementation of CSS transforms is "performance enhanced", whilst our first iteration (animating the 'top' property) is performed by the OS in software. That's why the experience was unfortunately somewhat chunky at times, depending on the speed of the iPhone hardware.

You'll see smoother looking floaty bars coming very soon to an iPhone near you. This is just the first in a series of improvements we're planning for the mobile Gmail floaty bar. Watch for them in our iterative webapp, rolling out over the next couple of weeks and months!

By Joanne McKinley, Software Engineer, Google Mobile

Previous posts from Gmail for Mobile HTML5 Series:
HTML5 and Webkit pave the way for mobile web applications
Using AppCache to launch offline - Part 1
Using AppCache to launch offline - Part 2
Using AppCache to launch offline - Part 3
A Common API for Web Storage
Suggestions for better performance
Cache pattern for offline HTML5 web application
Using timers effectively
Autogrowing Textareas
Reducing Startup Latency
URL: http://googlecode.blogspot.com/2009/09/gmail-for-mobile-html5-series-css.html

[Gd] GWT 1.7.1 release fixes Mac OS X Snow Leopard issues

| More

Google Web Toolkit Blog: GWT 1.7.1 release fixes Mac OS X Snow Leopard issues


If you don't use Mac OS X 10.6 (Snow Leopard), the GWT 1.7.1 release shouldn't interest you much -- you shouldn't see any changes. If you do use Mac OS X 10.6, good news. Running GWT with Java 6 has become simpler. Download it here.



What's in the point release



GWT's hosted mode uses the Standard Widget Toolkit (SWT), which only supports 32-bit operation. Hosted mode must therefore also run a 32-bit version of Java. Mac OS X 10.5 (Leopard) shipped with a 32-bit Java 5 and a 64-bit only Java 6. Java 5 was compatible with the 32-bit SWT bindings, so the GWT SDK directed users to use Java 5 only. With the Snow Leopard release, Apple only includes Java 6, but it now runs in both 32-bit and 64-bit modes.



In short, you can now run GWT on Snow Leopard using the Java command line argument -d32 without further modification. The GWT SDK no longer directs you to only use Java 5, and the ant scripts (including scripts generated by the webAppCreator tool) have been updated to include the -d32 flag where necessary. Also, Linux users will see a more informative error message when a non-32-bit Java runtime is used..

URL: http://googlewebtoolkit.blogspot.com/2009/09/gwt-171-release-fixes-mac-os-x-snow.html

[Gd] An introduction to Text-To-Speech in Android

| More

Android Developers Blog: An introduction to Text-To-Speech in Android

We've introduced a new feature in version 1.6 of the Android platform: Text-To-Speech (TTS). Also known as "speech synthesis", TTS enables your Android device to "speak" text of different languages.

Before we explain how to use the TTS API itself, let's first review a few aspects of the engine that will be important to your TTS-enabled application. We will then show how to make your Android application talk and how to configure the way it speaks.

Languages and resources

About the TTS resources

The TTS engine that ships with the Android platform supports a number of languages: English, French, German, Italian and Spanish. Also, depending on which side of the Atlantic you are on, American and British accents for English are both supported.

The TTS engine needs to know which language to speak, as a word like "Paris", for example, is pronounced differently in French and English. So the voice and dictionary are language-specific resources that need to be loaded before the engine can start to speak.

Although all Android-powered devices that support the TTS functionality ship with the engine, some devices have limited storage and may lack the language-specific resource files. If a user wants to install those resources, the TTS API enables an application to query the platform for the availability of language files and can initiate their download and installation. So upon creating your activity, a good first step is to check for the presence of the TTS resources with the corresponding intent:

Intent checkIntent = new Intent();
checkIntent.setAction(TextToSpeech.Engine.ACTION_CHECK_TTS_DATA);
startActivityForResult(checkIntent, MY_DATA_CHECK_CODE);

A successful check will be marked by a CHECK_VOICE_DATA_PASS result code, indicating this device is ready to speak, after the creation of our android.speech.tts.TextToSpeech object. If not, we need to let the user know to install the data that's required for the device to become a multi-lingual talking machine! Downloading and installing the data is accomplished by firing off the ACTION_INSTALL_TTS_DATA intent, which will take the user to Android Market, and will let her/him initiate the download. Installation of the data will happen automatically once the download completes. Here is an example of what your implementation of onActivityResult() would look like:

private TextToSpeech mTts;
protected void onActivityResult(
int requestCode, int resultCode, Intent data) {
if (requestCode == MY_DATA_CHECK_CODE) {
if (resultCode == TextToSpeech.Engine.CHECK_VOICE_DATA_PASS) {
// success, create the TTS instance
mTts = new TextToSpeech(this, this);
} else {
// missing data, install it
Intent installIntent = new Intent();
installIntent.setAction(
TextToSpeech.Engine.ACTION_INSTALL_TTS_DATA);
startActivity(installIntent);
}
}
}

In the constructor of the TextToSpeech instance we pass a reference to the Context to be used (here the current Activity), and to an OnInitListener (here our Activity as well). This listener enables our application to be notified when the Text-To-Speech engine is fully loaded, so we can start configuring it and using it.

Languages and Locale

At Google I/O, we showed an example of TTS where it was used to speak the result of a translation from and to one of the 5 languages the Android TTS engine currently supports. Loading a language is as simple as calling for instance:

mTts.setLanguage(Locale.US);

to load and set the language to English, as spoken in the country "US". A locale is the preferred way to specify a language because it accounts for the fact that the same language can vary from one country to another. To query whether a specific Locale is supported, you can use isLanguageAvailable(), which returns the level of support for the given Locale. For instance the calls:

mTts.isLanguageAvailable(Locale.UK))
mTts.isLanguageAvailable(Locale.FRANCE))
mTts.isLanguageAvailable(new Locale("spa", "ESP")))

will return TextToSpeech.LANG_COUNTRY_AVAILABLE to indicate that the language AND country as described by the Locale parameter are supported (and the data is correctly installed). But the calls:

mTts.isLanguageAvailable(Locale.CANADA_FRENCH))
mTts.isLanguageAvailable(new Locale("spa"))

will return TextToSpeech.LANG_AVAILABLE. In the first example, French is supported, but not the given country. And in the second, only the language was specified for the Locale, so that's what the match was made on.

Also note that besides the ACTION_CHECK_TTS_DATA intent to check the availability of the TTS data, you can also use isLanguageAvailable() once you have created your TextToSpeech instance, which will return TextToSpeech.LANG_MISSING_DATA if the required resources are not installed for the queried language.

Making the engine speak an Italian string while the engine is set to the French language will produce some pretty interesting results, but it will not exactly be something your user would understand So try to match the language of your application's content and the language that you loaded in your TextToSpeech instance. Also if you are using Locale.getDefault() to query the current Locale, make sure that at least the default language is supported.

Making your application speak

Now that our TextToSpeech instance is properly initialized and configured, we can start to make your application speak. The simplest way to do so is to use the speak() method. Let's iterate on the following example to make a talking alarm clock:

String myText1 = "Did you sleep well?";
String myText2 = "I hope so, because it's time to wake up.";
mTts.speak(myText1, TextToSpeech.QUEUE_FLUSH, null);
mTts.speak(myText2, TextToSpeech.QUEUE_ADD, null);

The TTS engine manages a global queue of all the entries to synthesize, which are also known as "utterances". Each TextToSpeech instance can manage its own queue in order to control which utterance will interrupt the current one and which one is simply queued. Here the first speak() request would interrupt whatever was currently being synthesized: the queue is flushed and the new utterance is queued, which places it at the head of the queue. The second utterance is queued and will be played after myText1 has completed.

Using optional parameters to change the playback stream type

On Android, each audio stream that is played is associated with one stream type, as defined in android.media.AudioManager. For a talking alarm clock, we would like our text to be played on the AudioManager.STREAM_ALARM stream type so that it respects the alarm settings the user has chosen on the device. The last parameter of the speak() method allows you to pass to the TTS engine optional parameters, specified as key/value pairs in a HashMap. Let's use that mechanism to change the stream type of our utterances:

HashMap<String, String> myHashAlarm = new HashMap();
myHashAlarm.put(TextToSpeech.Engine.KEY_PARAM_STREAM,
String.valueOf(AudioManager.STREAM_ALARM));
mTts.speak(myText1, TextToSpeech.QUEUE_FLUSH, myHashAlarm);
mTts.speak(myText2, TextToSpeech.QUEUE_ADD, myHashAlarm);

Using optional parameters for playback completion callbacks

Note that speak() calls are asynchronous, so they will return well before the text is done being synthesized and played by Android, regardless of the use of QUEUE_FLUSH or QUEUE_ADD. But you might need to know when a particular utterance is done playing. For instance you might want to start playing an annoying music after myText2 has finished synthesizing (remember, we're trying to wake up the user). We will again use an optional parameter, this time to tag our utterance as one we want to identify. We also need to make sure our activity implements the TextToSpeech.OnUtteranceCompletedListener interface:

mTts.setOnUtteranceCompletedListener(this);
myHashAlarm.put(TextToSpeech.Engine.KEY_PARAM_STREAM,
String.valueOf(AudioManager.STREAM_ALARM));
mTts.speak(myText1, TextToSpeech.QUEUE_FLUSH, myHashAlarm);
myHashAlarm.put(TextToSpeech.Engine.KEY_PARAM_UTTERANCE_ID,
"end of wakeup message ID");
// myHashAlarm now contains two optional parameters
mTts.speak(myText2, TextToSpeech.QUEUE_ADD, myHashAlarm);

And the Activity gets notified of the completion in the implementation of the listener:

public void onUtteranceCompleted(String uttId) {
if (uttId == "end of wakeup message ID") {
playAnnoyingMusic();
}
}

File rendering and playback

While the speak() method is used to make Android speak the text right away, there are cases where you would want the result of the synthesis to be recorded in an audio file instead. This would be the case if, for instance, there is text your application will speak often; you could avoid the synthesis CPU-overhead by rendering only once to a file, and then playing back that audio file whenever needed. Just like for speak(), you can use an optional utterance identifier to be notified on the completion of the synthesis to the file:

HashMap<String, String> myHashRender = new HashMap();
String wakeUpText = "Are you up yet?";
String destFileName = "/sdcard/myAppCache/wakeUp.wav";
myHashRender.put(TextToSpeech.Engine.KEY_PARAM_UTTERANCE_ID, wakeUpText);
mTts.synthesizeToFile(wakuUpText, myHashRender, destFileName);

Once you are notified of the synthesis completion, you can play the output file just like any other audio resource with android.media.MediaPlayer.

But the TextToSpeech class offers other ways of associating audio resources with speech. So at this point we have a WAV file that contains the result of the synthesis of "Wake up" in the previously selected language. We can tell our TTS instance to associate the contents of the string "Wake up" with an audio resource, which can be accessed through its path, or through the package it's in, and its resource ID, using one of the two addSpeech() methods:

mTts.addSpeech(wakeUpText, destFileName);

This way any call to speak() for the same string content as wakeUpText will result in the playback of destFileName. If the file is missing, then speak will behave as if the audio file wasn't there, and will synthesize and play the given string. But you can also take advantage of that feature to provide an option to the user to customize how "Wake up" sounds, by recording their own version if they choose to. Regardless of where that audio file comes from, you can still use the same line in your Activity code to ask repeatedly "Are you up yet?":

mTts.speak(wakeUpText, TextToSpeech.QUEUE_ADD, myHashAlarm);

When not in use...

The text-to-speech functionality relies on a dedicated service shared across all applications that use that feature. When you are done using TTS, be a good citizen and tell it "you won't be needing its services anymore" by calling mTts.shutdown(), in your Activity onDestroy() method for instance.

Conclusion

Android now talks, and so can your apps. Remember that in order for synthesized speech to be intelligible, you need to match the language you select to that of the text to synthesize. Text-to-speech can help you push your app in new directions. Whether you use TTS to help users with disabilities, to enable the use of your application while looking away from the screen, or simply to make it cool, we hope you'll enjoy this new feature.

URL: http://android-developers.blogspot.com/2009/09/introduction-to-text-to-speech-in.html

[Gd] Announcing the Google Sidewiki API

| More

Google Code Blog: Announcing the Google Sidewiki API

Alongside the exciting release of Google Sidewiki today, we're also happy to announce the availability of the first version of the Google Sidewiki Data API. Google Sidewiki is a new feature of Google Toolbar (for Firefox and Internet Explorer) that lets everyone contribute helpful information next to any webpage. Our post over on the Google Blog goes into more detail and also has a video that shows Sidewiki in action. To start using it yourself, go to google.com/sidewiki and install Google Toolbar with Sidewiki.

On the developer side, we're releasing a Google Sidewiki Data API today that lets you work freely with the content that's created in Google Sidewiki. You can use it to retrieve all entries written about a particular webpage as well as all entries written by a given Sidewiki author.

So after you've played with Sidewiki in the browser, give it a whirl in your console too -- we have client libraries, documentation and code samples ready to go for you. We'll be excited to see what gadgets, projects and extensions you'll think of. A translation gadget that displays and translates Sidewiki entries on the fly? A Google App Engine-powered browser of all Sidewiki entries? Your own browser extension or Greasemonkey script?

The Google Sidewiki API is available in Google Code Labs and is read-only at the moment. We've set up a developer-oriented discussion group and issue tracker where you can discuss your experiences with the API and where we'd love to hear about your feedback and projects. Keep us posted!

By Roman Shuvaev, Google Sidewiki engineer
URL: http://googlecode.blogspot.com/2009/09/announcing-google-sidewiki-api.html

[Gd] Announcing the Google Sidewiki API

| More

Google Code Blog: Announcing the Google Sidewiki API

Alongside the exciting release of Google Sidewiki today, we're also happy to announce the availability of the first version of the Google Sidewiki Data API. Google Sidewiki is a new feature of Google Toolbar (for Firefox and Internet Explorer) that lets everyone contribute helpful information next to any webpage. Our post over on the Google Blog goes into more detail and also has a video that shows Sidewiki in action. To start using it yourself, go to google.com/sidewiki and install Google Toolbar with Sidewiki.

On the developer side, we're releasing a Google Sidewiki Data API today that lets you work freely with the content that's created in Google Sidewiki. You can use it to retrieve all entries written about a particular webpage as well as all entries written by a given Sidewiki author.

So after you've played with Sidewiki in the browser, give it a whirl in your console too -- we have client libraries, documentation and code samples ready to go for you. We'll be excited to see what gadgets, projects and extensions you'll think of. A translation gadget that displays and translates Sidewiki entries on the fly? A Google App Engine-powered browser of all Sidewiki entries? Your own browser extension or Greasemonkey script?

The Google Sidewiki API is available in Google Code Labs and is read-only at the moment. We've set up a developer-oriented discussion group and issue tracker where you can discuss your experiences with the API and where we'd love to hear about your feedback and projects. Keep us posted!

By Roman Shuvaev, Google Sidewiki engineer
URL: http://googlecode.blogspot.com/2009/09/announcing-google-sidewiki-api.html

Tuesday, September 22, 2009

[Gd] Delivering faster, richer GWT applications to your users

| More

Google Web Toolkit Blog: Delivering faster, richer GWT applications to your users


GWT has always been about providing a better experience for your users. Today GWT received a helping hand with the release of an early version of Google Chrome Frame, an open source plug-in that brings HTML5, a faster JavaScript engine and other open web technologies to Internet Explorer.



You're probably wondering how your users can take advantage of Google Chrome Frame. Simply add the following tag to the section of your application's HTML page, just like you would for any other web application:


  <meta equiv="X-UA-Compatible" content="chrome=1">






  




As you probably know GWT automatically builds a different version of your application for each major browser. It uses a special selection script to launch the version which has been specifically optimized for the user's browser and personal settings.







Now you might be wondering how your existing apps will behave when your IE users with Google Chrome Frame installed visit your site. Will GWT try to launch the IE version or the WebKit version of your application?







GWT's selection script detects your browser's rendering engine so that it can launch a version of your app which is optimized for your browser. When the Google Chrome Frame plug-in is installed and the meta tag is present the WebKit rending engine is used instead of the IE rendering engine. Since your app's existing selection script already recognizes WebKit based browsers it will know to launch a version of your app which has been optimized for Google Chrome Frame. If you don't include the meta tag or if your users don't have Google Chrome Frame installed the GWT selection script will still know to launch the IE version of your app.







In other words, your existing GWT apps are already be setup to work with Google Chrome Frame. All you have to do is add the meta tag to your HTML pages.







If you like'd to encourage your IE users to install Google Chrome Frame or would simply like to learn more you can checkout the developer docs.



URL: http://googlewebtoolkit.blogspot.com/2009/09/delivering-faster-richer-gwt.html

[Gd] Video Introduction to HTML 5

| More

Google Code Blog: Video Introduction to HTML 5

Are you interested in HTML 5 and what's coming down the pipeline but haven't had time to read any articles yet? We've put together an educational Introduction to HTML 5 video that goes over many of the major aspects of this new standard, including:
  • Web vector graphics with the Canvas tag and Scalable Vector Graphics (SVG)
  • The Geolocation API
  • HTML 5 Video
  • The HTML 5 Database and Application Cache
  • Web workers
In the video we also crack open the HTML 5 YouTube Video prototype to show you some of the new HTML 5 tags, such as nav, article, etc. It's chock full of demos and sample source code.



By Brad Neuberg, Google Developer Programs
URL: http://googlecode.blogspot.com/2009/09/video-introduction-to-html-5.html

[Gd] Google Wave in Internet Explorer

| More

Google Wave Developer Blog: Google Wave in Internet Explorer

When we extend our Google Wave preview next week, we will encourage users of Internet Explorer to install Google Chrome Frame, an open source plug-in that brings HTML5 and other open web technologies to Internet Explorer.

On first login to Google Wave, Internet Explorer 6, 7, and 8 users will see this message:


A few clicks later, the user will be running Google Wave in Internet Explorer, but it will be every bit as fast as in Google Chrome!

Google Wave depends on strong JS and DOM rendering performance to provide a desktop-like experience in the browser. HTML5's offline storage and web workers will enable us to add great features without having to compromise on performance. Unfortunately, Internet Explorer, still used by the majority of the Web's users, has not kept up with such fairly recent developments in Web technology. Compared with other browsers, the JavaScript performance is many times slower and HTML5 support is still far behind. Likewise, the many different versions of IE still in use -- each with its own set of CSS quirks and layout limitations -- further complicates building rich Web applications.

In the past, the Google Wave team has spent countless hours solely on improving the experience of running Google Wave in Internet Explorer. We could continue in this fashion, but using Google Chrome Frame instead lets us invest all that engineering time in more features for all our users, without leaving Internet Explorer users behind.

It is remarkable how quickly the browser landscape has changed since Lars and his brother Jens wrote the first prototype of Google Maps back in early 2004. Back then, Internet Explorer was their browser of choice. These are exciting times indeed to be developing for the Web!

Happy waving!

Posted by Lars Rasmussen, Google Wave team manager, and Adam Schuck, Google Wave client tech lead.
URL: http://googlewavedev.blogspot.com/2009/09/google-wave-in-internet-explorer.html

[Gd] Product Ideas for Custom Search

| More

Google Custom Search: Product Ideas for Custom Search

Posted by: Christine Moschella, Online Operations

Your feedback is one of the most important things we consider when planning updates and improvements to Google Custom Search. In addition to reviewing the feedback and suggestions that you make in our user group, we're opening up a Product Ideas page for you to share your opinions about Custom Search. Just like other Product Ideas series, you'll be able to submit your own idea and vote for ideas from other users.


If you've got ideas or suggestions for Custom Search - features you want, things we can do better - tell us! We want to hear from you. We've created a set of categories, so please try to find the most appropriate category for your suggestion or idea. Product Ideas for Custom Search will remain open for you for the next month.

If you have questions, visit the Product Ideas FAQ - but if you want to get started right away, go for it! Vote for a suggestion, or enter your own idea on the Custom Search Product Ideas page.
URL: http://googlecustomsearch.blogspot.com/2009/09/product-ideas-for-custom-search.html

[Gd] Introducing Google Chrome Frame

| More

Chromium Blog: Introducing Google Chrome Frame

Today, we're releasing an early version of Google Chrome Frame, an open source plug-in that brings HTML5 and other open web technologies to Internet Explorer.

We're building Google Chrome Frame to help web developers deliver faster, richer applications like Google Wave. Recent JavaScript performance improvements and the emergence of HTML5 have enabled web applications to do things that could previously only be done by desktop software. One challenge developers face in using these new technologies is that they are not yet supported by Internet Explorer. Developers can't afford to ignore IE — most people use some version of IE — so they end up spending lots of time implementing work-arounds or limiting the functionality of their apps.

With Google Chrome Frame, developers can now take advantage of the latest open web technologies, even in Internet Explorer. From a faster Javascript engine, to support for current web technologies like HTML5's offline capabilities and <canvas>, to modern CSS/Layout handling, Google Chrome Frame enables these features within IE with no additional coding or testing for different browser versions.

To start using Google Chrome Frame, all developers need to do is to add a single tag:

<meta equiv="X-UA-Compatible" content="chrome=1">

When Google Chrome Frame detects this tag it switches automatically to using Google Chrome's speedy WebKit-based rendering engine. It's that easy. For users, installing Google Chrome Frame will allow them to seamlessly enjoy modern web apps at blazing speeds, through the familiar interface of the version of IE that they are currently using.

We believe that Google Chrome Frame makes life easier for web developers as well as users. While this is still an early version intended for developers, our team invites you to try out this for your site. You can start by reading our documentation. Please share your feedback in our discussion group and file any bugs you find through the Chromium issue tracker.




Posted by Amit Joshi, Software Engineer, Alex Russell, Software Engineer and Mike Smith, Product Manager
URL: http://blog.chromium.org/2009/09/introducing-google-chrome-frame.html

[Gd] Introducing Google Chrome Frame

| More

Google Code Blog: Introducing Google Chrome Frame

Today, we're releasing an early version of Google Chrome Frame, an open source plug-in that brings HTML5 and other open web technologies to Internet Explorer.

We're building Google Chrome Frame to help web developers deliver faster, richer applications like Google Wave. Recent JavaScript performance improvements and the emergence of HTML5 have enabled web applications to do things that could previously only be done by desktop software. One challenge developers face in using these new technologies is that they are not yet supported by Internet Explorer. Developers can't afford to ignore IE -- most people use some version of IE -- so they end up spending lots of time implementing work-arounds or limiting the functionality of their apps.

With Google Chrome Frame, developers can now take advantage of the latest open web technologies, even in Internet Explorer. From a faster Javascript engine,  to support for current web technologies like HTML5's offline capabilities and <canvas>, to modern CSS/Layout handling, Google Chrome Frame enables these features within IE with no additional coding or testing for different browser versions.

To start using Google Chrome Frame, all developers need to do is to add a single tag:

<meta http-equiv="X-UA-Compatible" content="chrome=1">

When Google Chrome Frame detects this tag it switches automatically to using Google Chrome's speedy WebKit-based rendering engine. It's that easy. For users, installing Google Chrome Frame will allow them to seamlessly enjoy modern web apps at blazing speeds, through the familiar interface of the version of IE that they are currently using.

We believe that Google Chrome Frame makes life easier for web developers as well as users. While this is still an early version intended for developers, our team invites you to try out this for your site. You can start by reading our documentation. Please share your feedback in our discussion group and file any bugs you find through the Chromium issue tracker.



(Cross-posted on the Chromium Blog)

By Amit Joshi, Alex Russell and Mike Smith, Google Chrome Frame Team
URL: http://googlecode.blogspot.com/2009/09/introducing-google-chrome-frame.html

[Gd] Agile paddling with App Engine: lessons learned building the Canoe '09 website

| More

Google App Engine Blog: Agile paddling with App Engine: lessons learned building the Canoe '09 website

I work for Norex, a web development company in Halifax, Nova Scotia. As part of our sponsorship of the 2009 ICF Canoe Sprint World Championships in Halifax (Canoe '09), we developed an application to deliver real time race results to standard and mobile web browsers. Thanks to the ability to rapidly develop and deploy a scalable application on Google App Engine, and to do so live during the event, what began as a small experiment became a huge success for Norex.



Our goal was to import instant results (directly from the timing system FinishLynx), upcoming race information, athlete bios, teams, and past race results from a system used by the race organizers, and to reformat that data for distribution to web browsers. We chose to develop in Google App Engine (with Django and appengine patch) and iUI (iPhone User Interface) frameworks. In fact, this was our first time deploying an app using any of these technologies! While we had a few weeks to build the prototype, we also had to deal with the added challenges of a varying data format and special cases that could occur during live races. As with many software projects, these specifications were not provided on a regular or consistent basis from the race organizers, so we had to anticipate the unknowns and work to adjust to the conditions at the time.



The Canoe 09 Web Interface
The Canoe 09 Web Interface


To give you a taste for just how agile we were able to be on App Engine, here are some events during the race which we were able to cope with:



  • After the first day, the closed-circuit TV system which the race organizers planned to use for the event was down. Before it was back up and running, we were able to deploy a new view appropriate for display on the TVs.
  • By the end of the first day, the application had handled 840,000 requests at a peak of 60 requests/second. This was already several orders of magnitude higher than we had expected. At the start of the second day, we reached 10% of our CPU quota before 7:45am and were processing 100 request/second. While we had originally cached only the main pages, with a few lines of code, we extended our caching strategy to cache every possible page request, a different version for each web platform, and re-deployed during the day's races.
  • The rules of the events changed at 2pm on day 3 of the event to allow crew changes. By 4pm, I had reworked the models and views to support the change.
  • At 11am on the final day of races, someone in the control booth manually deleted inaccurate records, but this created inconsistencies in the model causing errors. By 11:05am, we had deployed a patch to stop the errors, and by 1pm had deployed a version which gracefully failed when referenced objects were inadvertently deleted.
  • Every night we deployed new views of the data as requested by race organizers, participants, and spectators.


We found that new deployments were possible (and quick) because we could stage versions of the application to the App Engine servers, and test these staged versions on live data. Switching from the live version to the staged version and back again takes seconds, thus we could paddle as confidently and rapidly as the racers.



The International Canoe Federation was so impressed by the dependability and versatility of the solution, that they elected to replace their usual channels with our application to serve up the official results for news organizations and to Sport Federation sites all over the world, and to be used internally for calculating medal counts.



All in all, we saw over 1,000,000 page views from 93 countries around the world, and experienced incredible stability and scalability from Google App Engine even when we were spiking 350 requests per second during the finals. It was a big win for Norex, and App Engine has proven itself to be a serious contender for developing scalable web applications. Thanks so much to the Google App Engine team for providing such an outstanding product!



Link to: ZAP Results Application



Guest Post by Adam Thurlow, Web Application Developer, Norex.ca

URL: http://googleappengine.blogspot.com/2009/09/agile-paddling-with-app-engine-lessons.html

[Gd] MySpace Full Support of OpenSocial 0.9 REST APIs Now Available

| More

OpenSocial API Blog: MySpace Full Support of OpenSocial 0.9 REST APIs Now Available

MySpace is pleased to unleash our full support of OpenSocial 0.9. MySpace's OpenSocial 0.9 implementation was built on an entirely new framework with three main goals in mind for developers; stability, performance and compliance to the OpenSocial 0.9 specification.  These three goals will yield more consistent results, fewer errors, and means that your code should be even more portable to other social networks that support OpenSocial.

While we're labeling this as a BETA, we feel our APIs are in a very solid state and are ready for widespread use. The PHP and C# SDKs have been fully updated to use all of the new 0.9 APIs we have available.  The other SDKs are currently being updated for your use and we've started to update the community-supported SDKs found at opensocial.org.

Documentation for all the APIs can be found here:
  • Activities : Provides the event data found in the MySpace Activity Stream.
  • Albums : Support for fetching, creating and updating photo albums.
  • AppData : A generic key/value store that your app can use to fetch, update and delete data relevant to your app.
  • Groups : Provides information on a user's friend categories.
  • MediaItems : Photo support, including photo uploads.
  • People : Gives access to a user's profile data, as well as their friends' profile data.
  • StatusMood : Allows support for updating and fetching a user's status and mood, as well as fetching their friends' status and mood.
  • Notifications : Create app notifications that are displayed in the recipient's mail center.

Posted by Chad Russell, MySpace Team
URL: http://blog.opensocial.org/2009/09/myspace-full-support-of-opensocial-09.html

[Gd] Google Wave Extension Updates

| More

Google Wave Developer Blog: Google Wave Extension Updates

Over the past few months we've learned more about how extensions are used in Google Wave, and made it easier to create and install extensions. To help you build user-friendly extensions, we've prepared two new documents:

1) Google Wave Extension Design Principles
  • Make it Wave-y
  • Make it Easy to Use
  • Make it Easy to Install
  • Make it Look Good
  • Make it Useful -- or Fun!

2) Extension Installers Guide
  • Understand the extension manifest file
  • Learn about extension hooks and actions
  • Walk through installing an extension
We're looking forward to promoting extensions to users as they get access to Google Wave. If you're building extensions, please check out the above documents, and then let us know when your extension is ready.

The Extension Design Principles are perhaps more aspirational than attainable with our current, preview-quality APIs. We are working hard on making things better. For example, we are adding hooks that let robots be added automatically to the right waves at the right time, we are adding OAuth-based RPC access so robots can initiate requests to modify waves (which among other things will supercede our cron mechanism), and we are adding to gadgets the ability to display diffs when users open waves and during playback.

As always, our goal is to make it possible to write rich, collaborative applications with Google Wave that feel to users as natural as Google Wave's own features. We appreciate the vocal and detailed feedback that we have received during these first few months of our developer preview. Thank you for your patience and testing of the Wave APIs.

Happy hacking!

Posted by Dan Peterson, Product Manager, Google Wave
URL: http://googlewavedev.blogspot.com/2009/09/google-wave-extension-updates.html