Wednesday, February 29, 2012

Android Design V2: Now with stencils

[This post is by Android designer Alex Faaborg, on behalf of the entire User Experience team. —Tim Bray]

When we initially released Android Design, by far the number one request we received was for us to release stencils as well. The fine folks on the Android User Experience team are pleased today to release some official Android Design stencils for your mockup-creating pleasure.

With these stencils you can now drag and drop your way to beautifully designed Ice Cream Sandwich (Android 4.0) applications, with grace and ease. The stencils feature the rich typography, colors, interactive controls, and icons found throughout Ice Cream Sandwich, along with some phone and tablet outlines to frame your meticulously crafted creations.

Currently we have stencils available for those venerable interactive design powerhouses Adobe® Fireworks®, and Omni® OmniGraffle® and we may expand to other applications® in the future. The source files for the various icons and controls are also available, created in Adobe® Photoshop®, and Adobe® Illustrator®. Here are the downloads.

We’ll be updating these stencils over time so, as always, please send in your feedback!

Happy mockup making,

— Your friendly Android Design Droids

Tuesday, February 28, 2012

New App Stats for Publishers on Android Market



If you've published an app on Android Market, you’ve probably used Application Statistics to help tune your development and marketing efforts. Application Statistics is a set of dashboards in the Developer Console that shows your app’s installation performance across key dimensions such as countries, platform versions, device models, and others. Today we are making Application Statistics even more powerful for publishers, adding new metrics, new ways to analyze your data, and a redesigned UI that’s much easier to use.

First, we are adding important new installation metrics to the dashboards. You can now see your installations measured by unique users, as well as by unique devices. For user installations, you can view active installs, total installs, and daily installs and uninstalls. For devices, you can see active installs as well as daily installs, uninstalls, and upgrades.



Along with the new metrics, we’re also introducing two new data dimensions — Carrier and App Version. You can use them to track your app’s installation trends across mobile operators or monitor the launch metrics of specific app updates.



To give you visibility over your installation data over time, we’re adding timeline charts for all metrics and dimensions. At a glance, these charts highlight your app’s installation peaks and longer-term trends, which you can correlate to promotions, app improvements, or other factors. You can even focus in on data inside a dimension by adding specific points (such as individual platform versions or languages) to the timeline.



Finally, we’re bringing you all of the new metrics, dimensions, and timelines in a completely redesigned UI that is faster, more compact, and easier to use. Each dimension is now displayed in dedicated tab, making it easier to click through your stats daily or as often as needed. If you track your stats in another tool, we’re also adding an export capability that lets you download your stats in a single CSV file.



Check out the new Application Statistics next time you visit the Android Market Developer Console. We hope they’ll give you new insight into your app’s user base and installation performance. Watch for related announcements soon — we are continuing to work on bringing you the reporting features you need to manage your products successfully on Android Market.



Please feel free to share any new insights or tips on +Android Developers!

Open Mailto: Links Using Gmail in Google Chrome

A few months after Google Calendar added support for handling webcal: links in Chrome, Gmail can now become the default handler for mailto: links. If you open Gmail in Google Chrome, you'll see an infobar at the top of the page that asks if you "allow Gmail to open all email links". Just click "use Gmail" and all the mailto: links (like admin@google.com) will open using Gmail, instead of a native mail client like Outlook or Thunderbird.


"Chrome allows web services to ask if you'd like to use them to open certain links. While most links generally take you to another page, some links can open programs and perform other actions. For example, mailto: links can open your email program and webcal: links can add events to your calendar program. These links are referred to as protocols and the programs they use are called handlers. Many web services these days, including Gmail and Google Calendar, can act as handlers," explains Google.

To edit protocol handlers in Chrome, open the settings page, click "Show advanced settings" at the bottom of the page, click "Content settings", then "Manage handlers" and select "Gmail" from the site dropdown. Another option is to open a new tab and paste this in the address bar: chrome://settings/handlers. By default, you'll see an almost empty page with no active handler. You can add protocol handlers from the sites that support this feature: Gmail, Google Calendar (and other services in the future).


Chrome is a little late to the party: Mozilla added support for protocol handlers in Firefox 3, back in 2008 and you can set Gmail as default handler for mailto: from the options dialog.

{ Thanks, Kevin. }

Monday, February 27, 2012

Android@Mobile World Congress: It’s all about the ecosystem.

Each and every day, we are humbled by the trajectory of Android and our partners.

With a year-on-year growth rate of more than 250%, 850,000 new Android devices are activated each day, jetting the total number of Android devices around the world past 300 million. These numbers are a testament to the break-neck speed of innovation that defines the Android ecosystem.

Last year at Mobile World Congress (MWC), we announced that there were more than 150,000 apps in Android Market. That number tripled to more than 450,000 apps today, with over one billion app downloads happening every month. Think about the astonishing number of songs Shazam’ed, places Qype’ed and foursquare mayorships! To celebrate the hard work and success of our developer community, we’ve built special “app pods” into our Android stand at MWC. Many of these featured apps demonstrate the latest Android innovations, such as Android Beam, which lets you share content like web pages, videos, directions, and apps—just by touching two Android phones back to back.


The Android Stand on the eve of Mobile World Congress 2012

If you walk around the Android stand, it’s also evident that our hardware partners are thriving. There are 100+ devices on display at the conveyor belt bar, which is just a small portion of the 800+ Android devices that have launched to date. And what better sign of innovation than the Bling Bot—powered by the >Android ADK—which can bedazzle your Galaxy Nexus backplate with perfect precision.

We’re just getting started at Mobile World Congress, so keep checking android.com/mwc and the +Android page on Google+ for updates.

Friday, February 24, 2012

Towards the Perfect Browser

Chrome is clearly the most Apple-like Google product. Many of its features are copied by other browsers: from the simple interface to automatic updates, powerful JavaScript engines, unified address bar and search box, shorter release cycles and much more. When it was released, Chrome's team had a clear vision and no feature was there by accident. While there are many feature requests, Chrome's team only implements them if they make sense and fit the project.

In an interesting response to Kevin Fox's question about the updated "new tab" button, Chrome's Peter Kasting said that "good design involves hav[ing] a clear and consistent vision for the product which is then informed by user input, not enslaved to it. I think Chrome as a whole shows a remarkable design consistency and focus that Google products as a whole have not always had. I don't think that's an accident. It's a direct result of a process that uses a small group of consistent leaders, rather than endless end-user trials of everything, to make decisions."

Glen Murphy, Chrome's design lead, makes it more obvious: "We're trying to sculpt Chrome down to the perfect browser, and sometimes that means making painful consistency changes in aid of that long-term vision. While we want to minimize disruption for existing users, most people on earth haven't used Chrome, and we have to make the best and most awesome browser possible for them."

Chrome is the browser that has great default options, few settings and an interface that hasn't changed all that much over the years because it was carefully thought out and reduced to the essence. Just like the iPhone and its OS.

A Strange Google Mobile Experiment

Sometimes it's difficult to understand Google. A few weeks after dropping the non-obvious navigation menu from the desktop UI, Google tests a new mobile interface that uses the same menu.




Cascading menus on a mobile device? They're too large and many Google services are missing (Reader, Blog Search, iGoogle, Product Search, Google Finance, Picasa Web, Google Talk, Google Tasks), not to mention that there's no room for displaying Google+ notifications.

Thursday, February 23, 2012

Google Drive Will Support Third Party Apps

Back in November 2010, a comment from the Google Docs source code revealed some new features that will be available: third party apps, Cloud Print integration and sync.

It turns out that the upcoming Google Drive release will add support for third party apps and Google will also include a SDK for developers. This way, you'll be able to open the files stored in Google Drive using non-Google apps. The Google Docs source code mentions "SDK" several times in connection with Google Drive and the "open with" feature.



There's also an interesting message that suggests Google Drive will integrate even more with Gmail: "Say goodbye [to] email attachments and hello to real time collaboration. Drag anything shared with you to My Drive for easy access."

In a recent article, Wall Street Journal reported that GDrive "is expected to launch in the coming weeks or months and will be free for most consumers and businesses. Google will charge a fee to those who want to store a large amount of files."

Most likely, Google Drive is an important upgrade to Google Docs that will detach the online storage service from the Google Docs apps and will make it more useful by offering more free storage, syncing apps and integration with web apps developed by other companies.

Wednesday, February 22, 2012

Google Docs for Android Adds Real-Time Collaboration

When Google released the Android app for Google Docs, the application didn't include many features that weren't available from the browser. The latest updates made the app more useful: there's a better tablet interface, offline access to your documents and now you can edit documents collaboratively.

The most powerful Google Docs feature (real-time collaboration) is now available on Android devices and you don't have to switch to the desktop interface. You can see the changes in real-time and all you edits are saved almost instantly. While the Android editor lacks many features that are available in the desktop version, you can use rich text formatting: bold the text, change the color, create lists, indent paragraphs, undo and redo the changes.


"We've brought the collaborative experience from Google Docs on the desktop to your Android device. You'll see updates in real time as others type on their computers, tablets and phones, and you can just tap the document to join in. We also updated the interface to make it easier to work with your documents on the go. For example, you can pinch to zoom and focus on a specific paragraph or see the whole document at a glance," informs Google.

Suddenly, the mobile web app pales when compared to the native app and that's probably the reason why the Google Docs mobile site promotes the app every time you go there.

Collaborate and edit anywhere with the updated Google Docs for Android

As I was sitting on the ferry commuting to Google’s Sydney office this morning, two thoughts occurred to me. First, Australia is beautiful. If you’ve never been here, you really should visit. And second, it’s amazing how productive I can be with just my Android phone and an Internet connection. I was responding to email, reading news articles, and editing documents—just like I do at the office. Only the view was better!

We want to give everyone the chance to be productive no matter where they are, so today we’re releasing a new update to the Google Docs app for Android. We've brought the collaborative experience from Google Docs on the desktop to your Android device. You'll see updates in real time as others type on their computers, tablets and phones, and you can just tap the document to join in.

We also updated the interface to make it easier to work with your documents on the go. For example, you can pinch to zoom and focus on a specific paragraph or see the whole document at a glance. We also added rich text formatting so you can do things like create a quick bullet list, add color to your documents, or just bold something important. Watch the new Google Docs app in action:



If you want to hear about the latest Docs news or send us feedback on the new app, visit Google Docs on Google+.

Gotta run—I’ve got another ferry to catch!

Monday, February 13, 2012

Google's Knowledge Graph

Google usually returns pretty good search results, but only if there are pages that include the words from your query or some synonyms. Google doesn't understand the query, it only tries to match the words from that query. Sometimes Google can answer questions like "How tall was Albert Einstein?" or "What's the real name of Al Pacino?", but it can't go beyond simple facts.

Amit Singhal, Senior Vice President at Google, says that Google works on building "a huge knowledge graph of interconnected entities and their attributes". Freebase was just the starting point: Google's knowledge graph has 200 million entities, while Freebase only has 22 million entities. The graph is actually an encyclopedia with structured information obtained from the web. This will help Google understand your queries, provide answers to complex questions and find more relevant results.

Right now, Google only uses the graph to show a list of related searches for singers, actors, painters etc. As Google improves its infrastructure, the knowledge graph will be used more and more.

Gmail's YouTube Group

For some reason, Google added a YouTube contact group to many Gmail accounts. I currently have 82 contacts in the YouTube group and they have only one thing in common: they sent me or I sent them an email in 2006, 2007 or 2008. They don't have anything to do with YouTube and some of the email addresses couldn't be used to create Google accounts (for example, the Writely email address for importing documents).


The YouTube group can be renamed or deleted, but it's strange that it was automatically created. Gmail has some system groups for Google Latitude, Google Talk, Google Buzz, but they're hidden and can't be removed.

Do you see the YouTube group in your Gmail account?

{ Thanks, Katty and everyone who commented on Google+. }

Google's Doodle for Valentine's Day

This year's doodle is actually a video that uses Tony Bennett's song "Cold, Cold Heart" to tell the story of a boy who tries to find a gift for the girl he loves, but fails to impress her.



The doodle is available if you visit Google Australia, Google Japan and other domains for countries that celebrate Valentine's Day because it's already February 14 there.


Here are the other Google doodles for Valentine's Day.

{ Thanks, Dan. }

Sunday, February 12, 2012

Back to the Black Bar

Google admitted that the navigation UI launched last year wasn't good enough and brought back the black bar (the color is actually dark gray). Some of the features from the old interface are still available: the list of services, the notification and sharing boxes, the settings menu.

"The new design retains many of the feature changes we made in November that proved popular, including a unified search box and Google+ sharing and notifications across Google. The biggest change is that we’ve replaced the drop-down Google menu with a consistent and expanded set of links running across the top of the page," explains Google.


The black bar doesn't look that great in Google's redesigned interfaces, but it's more functional than the "invisible" menu hidden behind the Google logo. It's always a bad idea to hide important navigational features, even if they clutter the interface. When you have to explain basic features because they're not obvious, you've already failed:


{ Thanks, Cougar and Matan. }

Thursday, February 9, 2012

New Interface for Google Feedback

Google's feedback tool that's used in many services for reporting bugs has a new interface. It looks much better and it doesn't open a new page to show the information that's sent to Google. You can also see a list of all your bug reports.





"Google Feedback lets you send Google suggestions about our products. We welcome problem reports, feature ideas and general comments," informs Google.

To try Google Feedback, go to Gmail, click the "settings" menu and then "report a bug". A similar feature is available in Google Docs, YouTube and many other Google services. You can see the old version of Google Feedback if you click "Report a bug" in YouTube's footer when you watch a video.


Google Feedback started as an extension and now it's a web app.

{ Thanks, Sterling. }

Find More About a Google Image Search Result

Here's a simple way to learn more about a Google image search result without actually clicking it. Just drag the image to the search box and you'll be able to use "search by image" to find similar images and pages that include the image.



You can also mouse over the result and click "similar" or click the result and use the "search by image" feature, but drag-and-drop is faster. Another advantage is that you can edit the query and filter the results. For example, you can find pages that include the image and the word "hotel".

{ Thanks, Itamar. }

Keyboard Accelerators in Google Spreadsheets

Google Spreadsheets has recently added an interesting feature: keyboard accelerators for menus, but it only works in Chrome. You can now press Alt+F (or Ctrl-Option-F for Mac) to open the File menu. Then type one of the underlined characters to select an option. It's now much easier to use features that don't have keyboard shortcuts, just like in a native application.


Chrome is the only important desktop browser born without menus and that's probably the reason why web apps can override shortcuts like Alt+F. It's important to point out that you can use shortcuts like Alt+F and Alt+E to open Chrome's wrench, but not in Google Spreadsheets.

While Chrome's interface was so great that many other browsers used it as an inspiration, Google Docs continues to use the old-school menus from Microsoft Office 2000.

Share With Intents

[This post is by Alexander Lucas, an Android Developer Advocate bent on saving the world 5 minutes. —Tim Bray]

[Please join the discussion on Google+.]

Intents are awesome. They are my favorite feature of Android development. They make all sorts of stuff easier. Want to scan a barcode? In the olden platforms, if you were lucky, this involved time and effort finding and comparing barcode-scanning libraries that handled as much as possible of camera interaction, image processing, an internal database of barcode formats, and UI cues to the user of what was going on. If you weren’t lucky, it was a few months of research & haphazard coding to figure out how to do that yourself.

On Android, it’s a declaration to the system that you would like to scan a barcode.

public void scanSomething() {
// I need things done! Do I have any volunteers?
Intent intent = new Intent("com.google.zxing.client.android.SCAN");

// This flag clears the called app from the activity stack, so users arrive in the expected
// place next time this application is restarted.
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);

intent.putExtra("SCAN_MODE", "QR_CODE_MODE");
startActivityForResult(intent, 0);
}
...
public void onActivityResult(int requestCode, int resultCode, Intent intent) {
if (requestCode == 0) {
if (resultCode == RESULT_OK) {
// The Intents Fairy has delivered us some data!
String contents = intent.getStringExtra("SCAN_RESULT");
String format = intent.getStringExtra("SCAN_RESULT_FORMAT");
// Handle successful scan
} else if (resultCode == RESULT_CANCELED) {
// Handle cancel
}
}
}

See that? That’s nothing. That’s 5 minutes of coding, 3 of which were just to look up the name of the result you wanted to pull. And that was made possible because the Barcode Scanner application is designed to be able to scan barcodes for whatever other applications may need it.

More important, our app is completely decoupled from the BarcodeScanner app. There’s no integration- in fact, neither application is checking to verify that the other exists. If the user preferred, they could remove “Barcode Scanner” and replace it with a competing app. As long as that app supported the same intent, functionality would remain the same. This decoupling is important. It’s the easy way. It’s the lazy way. It’s the Android way.

Sharing Data Using Intents

One of the most inherently useful Android intents is the Share intent. You can let the user share data to any service they want, without writing the sharing code yourself, simply by creating a share intent.

Intent intent=new Intent(android.content.Intent.ACTION_SEND);
intent.setType("text/plain");
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);

// Add data to the intent, the receiving app will decide what to do with it.
intent.putExtra(Intent.EXTRA_SUBJECT, “Some Subject Line”);
intent.putExtra(Intent.EXTRA_TEXT, “Body of the message, woot!”);

... and starting it with a chooser:

startActivity(Intent.createChooser(intent, “How do you want to share?”));

With these 5 lines of code, you get to bypass authenticating, credential storage/management, web API interaction via http posts, all sorts of things. Where by “bypass”, I mean “have something else take care of.” Like the barcode scanning intent, all you really had to do was declare that you have something you’d like to share, and let the user choose from a list of takers. You’re not limited to sending text, either. Here’s how you’d create an intent to share an image:

private Intent createShareIntent() {
...
Intent shareIntent = new Intent(Intent.ACTION_SEND);
shareIntent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_WHEN_TASK_RESET);
shareIntent.setType("image/*");

// For a file in shared storage. For data in private storage, use a ContentProvider.
Uri uri = Uri.fromFile(getFileStreamPath(pathToImage));
shareIntent.putExtra(Intent.EXTRA_STREAM, uri);
return shareIntent;
}

Note that just by using setType() to set a MIME type, you’ve filtered down the list of apps to those that will know what to do with an image file.

Intents over Integration

Think about this for a second. By making the simple assumption that any user of any service (Task Manager, Social Network, Photo sharing site) already has some app on their phone that can share to that service, you can leverage the code that they’ve already written. This has several awesome implications:

  • Less UI — You don’t have to clog up your UI with customized, clickable badges of services you support. Just add a “share” button. It’s okay, we’ve made sure all your users know what it does [insert smiley here].

  • Leveraged UI — You can bet that every high-quality web service out there has spent serious time on the UI of their Android app’s “share” activity. Don’t reinvent the wheel! Just grab a couple and go for a ride.

  • Filtered for the user — If I don’t have a Foo-posting app on my phone, there’s a good chance I don’t care about posting to Foo. Now I won’t see Foo icons everywhere that are useless to me.

  • Client App Ecosystem — Much like an email client, anyone can write a client for any service. Users will use the ones they want, uninstall the ones they don’t. Your app supports them all.

  • Forward Compatible with new services — If some swanky new service springs up out of nowhere with an Android Application, as long as that application knows how to receive the share intent, you already support it. You don’t spend time in meetings discussing whether or not to wedge support for the new service into your impending Next Release(tm), you don’t burn engineering resources on implementing support as fast as possible, you don’t even upload a new version of anything to Android Market. Above all, you don’t do any of that again next week, when another new service launches and the whole process threatens to repeat itself. You just hang back and let your users download an application that makes yours even more useful.

Avoid One-Off Integrations

For each pro of the Intent approach, integrating support to post to these services one-at-a-time has a corresponding con.

  • Bad for UI — If your photo-sharing app has a Foo icon, what you might not immediately understand is that while you’re trying to tell the user “We post to Foo!” what you’re really saying is “We don’t post to Bar, Baz, or let you send the photo over email, sms, or bluetooth. If we did, there would be icons. In fact, we probably axed those features because of the space the icons would take on our home screen. Oh, and we’ll probably use some weird custom UI and make you authenticate through a browser, instead of the Foo client you already have installed.” I’m not going to name names, but a lot of you are guilty of this. It’s time to stop. (I mean it. Stop.)

  • Potentially wasted effort — Let’s say you chose one service, and integrated it into your UI perfectly. Through weeks of back-and-forth with Foo’s staff, you’ve got the API and authentication mechanisms down pat, the flow is seamless, everything’s great. Only problem is that you just wasted all that effort, because none of your user-base particularly cares for Foo. Ouch!

  • Not forward compatible for existing services — Any breaking changes in the API are your responsibility to fix, quickly, and that fix won’t be active until your users download a newer version of your app.

  • Won’t detect new services — This one really hurts. If a brand new service Baz comes out, and you’ve actually got the engineering cycles to burn, you need to get the SDK, work out the bugs, develop a sharing UI, have an artist draw up your own “edgy” (ugh) but legally distinct version of the app’s logo so you can plaster it on your home screen, work out all the bugs, and launch.

You will be judged harshly by your users. And deservedly so.

Ice Cream Sandwich makes it even easier

With the release of ICS, a useful tool for sharing called ShareActionProvider was added to the framework, making the sharing of data across Android applications even easier. ShareActionProviders let you populate lists of custom views representing ACTION_SEND targets, facilitating (for instance) adding a “share” menu to the ActionBar, and connecting it to whatever data the user might want to send.

Doing so is pretty easy. Configure the menu items in your Activity’s onCreateOptionsMenu method, like so:

@Override
public boolean onCreateOptionsMenu(Menu menu) {
// Get the menu item.
MenuItem menuItem = menu.findItem(R.id.menu_share);
// Get the provider and hold onto it to set/change the share intent.
mShareActionProvider = (ShareActionProvider) menuItem.getActionProvider();

// Attach an intent to this ShareActionProvider. You can update this at any time,
// like when the user selects a new piece of data they might like to share.
mShareActionProvider.setShareIntent(yourCreateShareIntentMethod());

// This line chooses a custom shared history xml file. Omit the line if using
// the default share history file is desired.
mShareActionProvider.setShareHistoryFileName("custom_share_history.xml");
. . .
}

Note that you can specify a history file, which will adapt the ordering of share targets based on past user choices. One shared history file can be used throughout an application, or different history files can be used within the same application, if you want to use a separate history based on what kind of data the user wants to share. In the above example, a custom history file is used. If you wish to use the default history for the application, you can omit that line entirely.

This will help optimize for an important feature of the ShareActionProvider: The user’s most common ways to share float to the top of the drop-down, with the least used ones disappearing below the fold of the “See More” button. The most commonly selected app will even become a shortcut right next to the dropdown, for easy one-click access!

You’ll also need to define a custom menu item in XML. Here’s an example from the ActionBar Dev Guide.

<?xml version="1.0" encoding="utf-8"?>
<menu xmlns:android="http://schemas.android.com/apk/res/android">
<item android:id="@+id/menu_share"
android:title="@string/share"
android:showAsAction="ifRoom"
android:actionProviderClass="android.widget.ShareActionProvider" />
</menu>

And with that, you can have an easy sharing dropdown that will look like the screenshot here. Note that you get the nice standard three-dots-two-lines “Share” glyph for free.

Remember: Smart and Easy

The share intent is the preferred method of sharing throughout the Android ecosystem. It’s how you share images from Gallery, links from the browser, and apps from Android Market. Intents are the easiest path to writing flexible applications that can participate in a rapidly expanding ecosystem, but they’re also the smart path to writing applications that will stay relevant to your users, letting them share their data to any service they want, no matter how often their preferences change over time. So take a step back and stop worrying about if your user wants to tweet, digg, post, email, im, mms, bluetooth, NFC, foo, bar or baz something. Just remember that they want to share it. Android can take it from there.

Wednesday, February 8, 2012

No New Mail? Try Google+

What's the message displayed by Gmail when there's no message in your inbox? If you answered "No new mail! Want to read updates from your favorite sites? Try Google Reader", you are right. It was Google's subtle way to promote Google Reader.


Before Google Reader was released, Gmail's "inbox zero" message used to be: "No new mail! There's always Google News if you're looking for something to read."

Now that Google focuses on developing Google+, a modern version of Google Reader, Gmail's new message is: "No new mail! See what people are talking about on Google+." The links sends Gmail users to the "what's hot" section of Google+ which "highlights selected content thought to be exemplary, interesting, and appropriate: showing you serendipitous and diverse information".


From Google News to Google Reader and now Google+, Gmail illustrates three different ways to read news. Google News ranks and clusters articles from the web, Google Reader allows you to read news from your favorite sites, while Google+ lets you read the articles shared by the people you follow. From news that are important to everyone to news that are important to the people you trust.

Tuesday, February 7, 2012

Chrome for Android

Many people wondered why Android's built-in browser is not called Chrome. One of the reasons is that Android's browser doesn't have many of the features of the desktop browser: data sync (bookmark sync is available in Android 4.0), extensions, themes, apps. Another reason is that Android's browser is updated less frequently than the Chrome browser because it's included in the operating system. Most OEMs ship their own browsers, so not many people use the stock Android browsers.

Now Chrome is available for Android 4.0 and it won't replace the standard browser on your device. "Like the desktop version, Chrome for Android Beta is focused on speed and simplicity, but it also features seamless sign-in and sync so you can take your personalized web browsing experience with you wherever you go, across devices," explains Google.


Chrome for Android brings a new gesture for navigating to the next tab (flick instead of Ctrl+Tab), support for page prerendering (used by Google Search to fetch the top result), incognito mode, link preview and data sync for bookmarks, typed URLs and browser sessions. That means you can open a few tabs in the desktop Chrome, close your computer and continue reading the same pages on your Android phone or tablet. In addition to these features, Chrome for Android "brings support for many of the latest HTML5 features to the Android platform: hardware-accelerated canvas, overflow scroll support, strong HTML5 video support, and new capabilities such as Indexed DB, WebWorkers and Web Sockets". There's also support for remote debugging.


"Chrome for Android is designed from the ground up for mobile devices. We reimagined tabs so they fit just as naturally on a small-screen phone as they do on a larger screen tablet. You can flip or swipe between an unlimited number of tabs using intuitive gestures, as if you're holding a deck of cards in the palm of your hands, each one a new window to the web," mentions Google.


At the moment, Chrome for Android doesn't sandbox tabs and there's no support for Safe Browsing, but these features could be added in the feature.

You can only try Chrome for Android if your phone runs Android 4.0 (you're using Galaxy Nexus, Nexus S, Transformer Prime or a different device with a custom ROM). Another limitation is that Chrome for Android is only available if you're in the US, Canada, UK, France, Germany, Spain, Australia, Japan, Korea, Mexico, Argentina, Brazil, but I'm sure you can use Market Enabler or the .apk linked here to bypass this restriction.

Introducing Chrome for Android

In 2008, we launched Google Chrome to help make the web better. We’re excited that millions of people around the world use Chrome as their primary browser and we want to keep improving that experience. Today, we're introducing Chrome for Android Beta, which brings many of the things you’ve come to love about Chrome to your Android 4.0 Ice Cream Sandwich phone or tablet. Like the desktop version, Chrome for Android Beta is focused on speed and simplicity, but it also features seamless sign-in and sync so you can take your personalized web browsing experience with you wherever you go, across devices.




Speed
With Chrome for Android, you can search, navigate and browse fast—Chrome fast. You can scroll through web pages as quickly as you can flick your finger. When searching, your top search results are loaded in the background as you type so pages appear instantly. And of course, both search and navigation can all be done quickly from the Chrome omnibox.


Simplicity
Chrome for Android is designed from the ground up for mobile devices. We reimagined tabs so they fit just as naturally on a small-screen phone as they do on a larger screen tablet. You can flip or swipe between an unlimited number of tabs using intuitive gestures, as if you’re holding a deck of cards in the palm of your hands, each one a new window to the web. One of the biggest pains of mobile browsing is selecting the correct link out of several on a small-screen device. Link Preview does away with hunting and pecking for links on a web page by automatically zooming in on links to make selecting the precise one easier. And as with Chrome on desktop, we built Chrome for Android with privacy in mind from the beginning, including incognito mode for private browsing and fine-grained privacy options (tap menu icon, ‘Settings,’ and then ‘Privacy’).


Sign in
You can now bring your personalized Chrome experience with you to your Android phone or tablet. If you sign in to Chrome on your Android device, you can:
  • View open tabs: Access the tabs you left open on your computer (also signed into Chrome)—picking up exactly where you left off.
  • Get smarter suggestions: If you visit a site often on your computer, you'll also get an autocomplete suggestion for it on your mobile device, so you can spend less time typing.
  • Sync bookmarks: Conveniently access your favorite sites no matter where you are or which device you’re using.
Chrome is now available in Beta from Android Market, in select countries and languages for phones and tablets with Android 4.0, Ice Cream Sandwich. We’re eager to hear your feedback. Finally, we look forward to working closely with the developer community to create a better web on a platform that defines mobile.



(Cross-posted from the Chrome blog and the Official Google blog)

Monday, February 6, 2012

Google's Experimental Interface for Related Image Searches

Google's image search engine tests a new interface for related searches. Instead of only displaying a list of queries, Google also shows small thumbnails. Mouse over a query and you'll see 3 image results in a preview box.


{ Thanks, Pontus. }

Saturday, February 4, 2012

Google Tests a New Version of the Black Bar

While Google hasn't abandoned the navigation bar launched last year, both the old and the new interface are used today. If you load google.com in Chrome's incognito mode, the old interface shows up more often than the new UI. The simplified interface made navigation more complicated, even if it looks better than the black bar.

Google even tests a slightly updated version of the old bar that uses the services from the new UI, more spacing and a different color scheme.



Here's how you can try the latest Google experiment. If you use Chrome, Firefox, Safari or Internet Explorer 8+, open google.com in a new tab, load:

* Chrome's JavaScript console (Ctrl+Shift+J)
* Firefox's Web Console (Ctrl+Shift+K)
* Safari's Web Inspector (how to do that?)
or
* IE's Developer Tools (press F12 and select the "console" tab)

and paste the following code:

document.cookie="PREF=ID=381502750b6e9119:U=aaee74aefea7315a:FF=0:LD=en:CR=2:TM=1328391998:LM=1328392000:S=yPtlCgLbEnezu5b4; path=/; domain=.google.com";window.location.reload();

Then press Enter and close the console. If you're not in the US and you're using a different Google domain, replace ".google.com" with your domain in the code (for example: ".google.co.uk" in the UK).

If you'd like to go back to the old interface and reset the Google PREF cookie, repeat the same steps, but use the following code:

document.cookie="PREF=; path=/; domain=.google.com";window.location.reload();

Google Instant, Disabled For Slow Computers

Google Instant is supposed to make searching faster, but you need a pretty good Internet connection, a modern browser and a decent computer. Google Instant is not available if you use IE6 or other outdated browsers and it's automatically disabled if you have a slow Internet connection.

Now Google also disables Instant if you have a slow computer. "If Instant gets automatically disabled, we continue to check your computer speed and will re-enable Instant if your performance improves," informs Google. If you don't like this change, you can disable it from the search preferences page. Just select "always show Instant results" in the "Google Instant predictions" section.


I've tested this feature on an old laptop and Google's implementation isn't great. Google Instant continues to be enabled for the initial query even if it's slow, then it's suddenly disabled when you visit Google Search again. Google doesn't show a message next to the search box to explain why Instant is disabled and not many people will visit the search preferences page, which both an explanation and a fix.


This is just one of the 17 updates from last month that improved Google Search.

Google Groups Themes

Just in case you don't like the Google Groups interface and want to customize it, there's a new light gray theme you can try. Just click the settings button, click "Themes" and select the "soft gray" theme. This only works in the new Google Groups interface.



A similar theme is also available for Gmail and it will be interesting to see if Google Groups will add support for the other Gmail themes. Maybe apps like Google+, Google Docs, Google Reader and even services like Google Search will support Gmail's color themes.

{ Thanks , Herin. }

Thursday, February 2, 2012

Android Market's Malware Scanner

Google doesn't like to manually review user-generated content. It's not efficient and algorithms can do a better job. Imagine how many people would need to be hired to watch all the videos submitted to YouTube (60 hours of videos uploaded every minute).

In some ways, uploading an application to the Android Market is just like uploading a video to YouTube. Sure, you need to pay a fee, but you don't have to wait until a Google employee checks the application. Unfortunately, this also means that the application can include malware, deceive users, crash or spam your contacts. Google usually reviewed the app only after enough users reported that the app is malicious.

Now there's a new service called Bouncer "which provides automated scanning of Android Market for potentially malicious software without disrupting the user experience of Android Market or requiring developers to go through an application approval process. The service performs a set of analyses on new applications, applications already in Android Market, and developer accounts. Here's how it works: once an application is uploaded, the service immediately starts analyzing it for known malware, spyware and trojans. It also looks for behaviors that indicate an application might be misbehaving, and compares it against previously analyzed apps to detect possible red flags. We actually run every application on Google's cloud infrastructure and simulate how it will run on an Android device to look for hidden, malicious behavior".

That seems like a great idea: Google actually tests the apps without having to wait until other users install them and notice there's something wrong. The bad news is that this service was tested last year and was used to find potentially-malicious apps. Despite that, the apps infected by DroidDream were found by a security vendor and not by Google.

"The service has been looking for malicious apps in Market for a while now, and between the first and second halves of 2011, we saw a 40% decrease in the number of potentially-malicious downloads from Android Market. This drop occurred at the same time that companies who market and sell anti-malware and security software have been reporting that malicious applications are on the rise," says Google. Another explanation could be that Google's service is not good enough.

Google also says that Android "makes malware less potent" because it uses sandboxing, it displays the list of permissions and Android Market can remotely remove malware. I don't think that most of the users read the list of permissions. They simply ignore them, click "OK" and install the application. Maybe it would be a better idea to require users to explicitly enable sensitive permissions when they're using the apps.

While security vendors try to scare Android users and push their products, Google should focus on removing spam and malware from the Android Market and make it a safer place. Improving Android's security model and finding ways to install security updates faster are also important.

Android Security Update

Recently, there’s been a lot of news coverage of malware in the mobile space. Over on our Mobile blog, Hiroshi Lockheimer, VP of Android engineering, has posted Android and Security. We think most Android developers will find it interesting reading.

Android and Security

By Hiroshi Lockheimer, VP of Engineering, Android

The last year has been a phenomenal one for the Android ecosystem. Device activations grew 250% year-on-year, and the total number of app downloads from Android Market topped 11 billion. As the platform continues to grow, we’re focused on bringing you the best new features and innovations - including in security.

Adding a new layer to Android security
Today we’re revealing a service we’ve developed, codenamed Bouncer, which provides automated scanning of Android Market for potentially malicious software without disrupting the user experience of Android Market or requiring developers to go through an application approval process.

The service performs a set of analyses on new applications, applications already in Android Market, and developer accounts. Here’s how it works: once an application is uploaded, the service immediately starts analyzing it for known malware, spyware and trojans. It also looks for behaviors that indicate an application might be misbehaving, and compares it against previously analyzed apps to detect possible red flags. We actually run every application on Google’s cloud infrastructure and simulate how it will run on an Android device to look for hidden, malicious behavior. We also analyze new developer accounts to help prevent malicious and repeat-offending developers from coming back.

Android malware downloads are decreasing
The service has been looking for malicious apps in Market for a while now, and between the first and second halves of 2011, we saw a 40% decrease in the number of potentially-malicious downloads from Android Market. This drop occurred at the same time that companies who market and sell anti-malware and security software have been reporting that malicious applications are on the rise. While it’s not possible to prevent bad people from building malware, the most important measurement is whether those bad applications are being installed from Android Market - and we know the rate is declining significantly.

Android makes malware less potent
In addition to using new services to help prevent malware, we designed Android from the beginning to make mobile malware less disruptive. In the PC model, malware has more potential to misuse your information. We learned from this approach, designing Android for Internet-connected devices. Some of Android’s core security features are:

  • Sandboxing: The Android platform uses a technique called “sandboxing” to put virtual walls between applications and other software on the device. So, if you download a malicious application, it can't access data on other parts of your phone and its potential harm is drastically limited.
  • Permissions: Android provides a permission system to help you understand the capabilities of the apps you install, and manage your own preferences. That way, if you see a game unnecessarily requests permission to send SMS, for example, you don’t need to install it.
  • Malware removal: Android is designed to prevent malware from modifying the platform or hiding from you, so it can be easily removed if your device is affected. Android Market also has the capability of remotely removing malware from your phone or tablet, if required.

No security approach is foolproof, and added scrutiny can often lead to important improvements. Our systems are getting better at detecting and eliminating malware every day, and we continue to invite the community to work with us to keep Android safe.

Google Docs Will Improve Paragraph Styles and Add More Fonts

An upcoming Google Docs update will bring a better interface for selecting paragraph styles and new features that lets you customize styles.



Google Docs will also add some new open source fonts from the Web Fonts project: Amaranth, Arvo, Dancing Script, Lobster, Merriweather, Open Sans, Philosopher, Quattrocento.


Google has recently updated the Android app for Google Docs and added offline support, while also improving the reading layout for tablets.

Update (February 6): Custom styles are now available.

{ Thanks, J. }

New Social APIs in Android ICS

[This post is by Daniel Lehmann, Tech Lead on the Android Apps team. — Tim Bray]

[We’re trying something new; There’s a post over on Google+ where we’ll host a discussion of this article. Daniel Lehmann has agreed to drop by and participate. Come on over and join in!]

With Android Ice Cream Sandwich, we set out to build software that supports emotional connections between humans and the devices they carry. We wanted to build the most personal device that the user has ever owned.

The first ingredient in our recipe is to show users the people that they care about most in a magazine-like way. High-resolution photos replace simple lists of text.

The second ingredient is to more prominently visualize their friends’ activities. We show updates from multiple sources wherever a contact is displayed, without the need to open each social networking app individually.

Android is an open platform, and in Ice Cream Sandwich we provide a rich new API to allow any social networking application to integrate with the system. This post explains how apps like Google+ use these APIs, and how other social networks can do the same.

A few basics

Since Eclair (Android 2.0), the system has been able to join contacts from different sources. Android can notice if you are connected to the same person and different networks, and join those into aggregate contacts.

Essential terms to understand throughout the remainder of this post are:

  • RawContact is a contact as it exists in one source, for example a friend in Skype.

  • Data rows exists for each piece of information that the raw contact contains (name, phone number, email address, etc.).

  • A Contact joins multiple raw contacts into one aggregate. This is what the user perceives as a real contact in the People and Phone apps.

  • A sync adapter synchronizes its raw contacts with its cloud source. It can be bundled with a Market application (examples: Skype, Twitter, Google+).

While users deal with contacts, sync adapters work with their raw contact rows. They own the data inside a raw contact, but by design it is left up to Android to properly join raw contact rows with others.

Contacts sync adapters have a special xml file that describes their content, which is documented in the Android SDK. In the following paragraphs, we’ll assume this file is named contacts.xml.

The Android SDK also contains the application SampleSyncAdapter (and its source code) that implements everything mentioned in here in an easy to understand way.

High resolution photos

In Android versions prior to Honeycomb (3.0), contact photos used to be 96x96. Starting with ICS, they now have a thumbnail (which is the 96x96 version) and a display photo. The display photo’s maximum size can vary from device to device (On Galaxy Nexus and Nexus S, it is currently configured to be 256x256, but expect this to vary with future devices). The size as configured can be queried like this:

private static int getPhotoPickSize(Context context) {
// Note that this URI is safe to call on the UI thread.
Cursor c = context.getContentResolver().query(DisplayPhoto.CONTENT_MAX_DIMENSIONS_URI,
new String[]{ DisplayPhoto.DISPLAY_MAX_DIM }, null, null, null);
try {
c.moveToFirst();
return c.getInt(0);
} finally {
c.close();
}
}

This value is useful if you need to query the picture from the server (as you can specify the right size for the download). If you already have a high resolution picture, there is no need for any resizing on your side; if it is too big, the contacts provider will downsample it automatically.

Up until now, pictures were written using a ContentValues object, just like all the other data rows of the raw contact. While this approach is still supported, it might fail when used with bigger pictures, as there is a size limit when sending ContentValues across process boundaries. The prefered way now is to use an AssetFileDescriptor and write them using a FileOutputStream instead:

private static void saveBitmapToRawContact(Context context, long rawContactId, byte[] photo) throws IOException {
Uri rawContactUri = ContentUris.withAppendedId(RawContacts.CONTENT_URI, rawContactId);
Uri outputFileUri =
Uri.withAppendedPath(rawContactUri, RawContacts.DisplayPhoto.CONTENT_DIRECTORY);
AssetFileDescriptor descriptor = context.getContentResolver().openAssetFileDescriptor(
outputFileUri, "rw");
FileOutputStream stream = descriptor.createOutputStream();
try {
stream.write(photo);
} finally {
stream.close();
descriptor.close();
}
}

For best results, store uncompressed square photos and let the contacts provider take care of compressing the photo. It will create both a thumbnail and a display photo as necessary.

This API is available on API version 14+. For older versions, we recommend to fallback to the old method using ContentValues and assuming a constant size of 96x96.

Update streams

The API for update streams is the biggest new addition for contacts in Ice Cream Sandwich. Sync adapters can now enrich their contact data by providing a social stream that includes text and photos.

This API is intended to provide an entry point into your social app to increase user engagement. We chose to only surface the most recent few stream items, as we believe that your social app will always be the best way to interact with posts on your network.

StreamItems rows are associated with a raw contact row. They contain the newest updates of that raw contact, along with text, time stamp and comments. They can also have pictures, which are stored in StreamItemPhotos. The number of stream items per raw contact has a limit, which on the current Nexus devices is set to 5, but expect this number to change with future devices. The limit can be queried like this:

private static int getStreamItemLimit(Context context) {
// Note that this URI is safe to call on the UI thread.
Cursor c = context.getContentResolver().query(StreamItems.CONTENT_LIMIT_URI,
new String[]{ StreamItems.MAX_ITEMS }, null, null, null);
try {
c.moveToFirst();
return c.getInt(0);
} finally {
c.close();
}
}

When displayed in the People app, stream items from all participating raw contacts will be intermixed and shown chronologically.

The following function shows how to add a stream item to an existing raw contact:

private static void addContactStreamItem(Context context, long rawContactId, String text,
String comments, long timestamp, String accountName, String accountType){
ContentValues values = new ContentValues();
values.put(StreamItems.RAW_CONTACT_ID, rawContactId);
values.put(StreamItems.TEXT, "Breakfasted at Tiffanys");
values.put(StreamItems.TIMESTAMP, timestamp);
values.put(StreamItems.COMMENTS, comments);
values.put(StreamItems.ACCOUNT_NAME, accountName);
values.put(StreamItems.ACCOUNT_TYPE, accountType);
context.getContentResolver().insert(StreamItems.CONTENT_URI, values);
}

You can also specify an action that should be executed when a stream item or one of its photos is tapped. To achieve this, specify the receiving Activities in your contacts.xml using the tags viewStreamItemActivity and viewStreamItemPhotoActivity:

<ContactsAccountType
xmlns:android="http://schemas.android.com/apk/res/android"
viewStreamItemActivity="com.example.activities.ViewStreamItemActivity”
viewStreamItemPhotoActivity="com.example.activities.ViewStreamItemPhotoActivity">
<!-- Description of your data types -->
</ContactsAccountType>

Update streams are available on API version 15+ and are intended to replace the StatusUpdate API. For previous versions, we recommend that you fall back to the StatusUpdates API, which only shows a single text item and no pictures.

“Me” profile

Ice Cream Sandwich is the first version of Android that supports the “Me” contact, which is prominently shown at the top of the list of the new People app. This simplifies use-cases that used to be a multi-tap process in previous versions — for example, sharing personal contact data with another person or “navigating home” in a navigation app. Also it allows applications to directly address the user by name and show their photo.

The “Me” profile is protected by the new permissions READ_PROFILE and WRITE_PROFILE. The new functionality is powerful; READ_PROFILE lets developers access users’ personally identifying information. Please make sure to inform the user on why you require this permission.

The entry point to the new API is ContactsContract.Profile and is available on API version 14+.

Add connection

Previously, connecting with users on a social network involved opening the respective social networking app, searching for the person and then connecting (“Friend”, “Follow” etc.). Ice Cream Sandwich has a much slicker approach: When looking at an existing contact in the People application, the user can decide to add this person to another network as well. For example, the user might want to follow a person on Google+ that they already have as a contact in Gmail.

Once the user taps one of the “Add connection” commands, the app is launched and can look for the person using the information that is already in the contact. Search criteria are up to the app, but good candidates are name, email address or phone number.

To specify your “Add connection” menu item, use the attributes inviteContactActivity and inviteContactActionLabel in your contacts.xml:

<ContactsAccountType
xmlns:android="http://schemas.android.com/apk/res/android"
inviteContactActivity="com.example.activities.InviteContactActivity"
inviteContactActionLabel="@string/invite_action_label">
<!-- Description of your data types -->
</ContactsAccountType>

Be sure to use the same verb as you typically use for adding connections, so that in combination with your app icon the user understands which application is about to be launched.

The “Add connection” functionality is available on API version 14+.

Contact-view notification

High-resolution pictures need a lot of space, and social streams quickly become outdated. It is therefore not a good idea to keep the whole contacts database completely in sync with the social network. A well-written sync adapter should take importance of contacts into account; as an example, starred contacts are shown with big pictures, so high-resolution pictures are more important. Your network might also have its own metrics that can help to identify important contacts.

For all other contacts, you can register to receive a notification which is sent by the People app to all sync adapters that contribute to a contact whenever the contact’s detail page is opened. At that point, you can provide additional information. As an example, when the Google+ sync adapter receives this notification, it pulls in the high-resolution photo and most recent social stream posts for that user and writes them to the contacts provider. This can be achieved by adding the viewContactNotifyService attribute to contacts.xml:

<ContactsAccountType
xmlns:android="http://schemas.android.com/apk/res/android"
viewContactNotifyService="com.example.notifier.NotifierService">
<!-- Description of your data types -->
</ContactsAccountType>

When this Intent is launched, its data field will point to the URI of the raw contact that was opened.

These notifications are available with API version 14+.

Summary

With Ice Cream Sandwich, we improved key areas around high resolution photos and update streams, and simplified the creation of new connections.

Everything outlined in here is done using open APIs that can be implemented by any network that wants to participate. We’re excited to see how developers take advantage of these new features!