25 May 2017

feedAndroid Developers Blog

Welcome to your New Home on Android TV

Posted by Paul Saxman, Android Devices and Media Developer Relations Lead

Android TV brings rich app experiences and entertainment to the biggest screen in your house, and with Android O, we're making it even easier for users to access content from their favorite apps. We've built a new, content-centric home screen experience for Android TV, and we're bringing the Google Assistant to the platform as well. These features put content that users want to access a few clicks, or spoken words, away.

The New Android TV Home Screen

The new Android TV home screen organizes video content into channels and programs in a way that's familiar to TV viewers. Each Android TV app can publish multiple channels, which are represented as rows of programs on the home screen. Apps add relevant programs on each channel, and update these programs and channels as users access content or when new content is available. To help engage users, programs can include a video preview, which is automatically played when a user focuses on a program. Users can configure which channels they wish to see on the home screen, and the ordering of channels, so the themes and shows they're interested in are quick and easy to access.

In addition to channels for you app, the top of the new Android TV home screen includes a quick launch bar for users' favorite apps, and a special Watch Next channel. This channel contains programs based on the viewing habits of the user.

The APIs for creating and maintaining channels and programs are part of the TvProvider APIs, which are distributed as an Android Support Library module with Android O. To get started using these APIs, visit the Android O Developer Preview site for an overview, and try out the Android TV Channels and Programs codelab for a first-hand experience building an Android TV app for Android O.

Later this year, Nexus Players will receive the new Android TV home experience as an OTA update. If you wish build and test apps for the new interface today, however, you can use the Android TV emulator or Nexus Player device images that are part of the latest Android O Developer Preview.

The Google Assistant on Android TV

The Google Assistant on Android TV, coming later this year, will allow users to quickly find and access content using their voice. Because the Assistant is context-aware, it can help users narrow down what content to play. Users will also be able access the Assistant to control playback, even while a video or music is playing. And since the Assistant can control compatible smart home devices, a simple voice request can dim the lights to create an ideal movie viewing environment. When the Google Assistant comes to Android TV, it will launch in the US on Android devices running M, N, and O.

We're looking forward to seeing how developers take advantage of the new Android TV home screen. We welcome feedback, so please visit the Android TV Developer Community on G+ to share you thoughts and ideas!

25 May 2017 5:00pm GMT

24 May 2017

feedAndroid Developers Blog

Request a professional app translation from the Google Play Console and reach new users

Posted by Rahim Nathwani, Product Manager, Google Play
Localizing your app or game is an important step in allowing you to reach the widest possible audience. It helps you increase downloads and provide better experiences for your audience.
To help do this, Google Play offers an app translation service. The service, by professional linguists, can translate app user interface strings, Play Store text, in-app products and universal app campaign ads. We've made the app translation service available directly from inside the Google Play Console, making it easy and quick to get started.
  • Choose from a selection of professional translation vendors.
  • Order, receive and apply translations, without leaving the Play Console.
  • Pay online with Google Wallet.
  • Translations from your previous orders (if any) are reused, so you never pay for the same translation twice. Great if you release new versions frequently.
Using the app translation service to translate a typical app and store description into one language may cost around US$50. (cost depends on the amount of text and languages).
Find out more and get started with the app translation service.

How useful did you find this blogpost?

24 May 2017 5:45pm GMT

23 May 2017

feedAndroid Developers Blog

Group Messaging in Android Auto

Posted by David Nelloms, Software Engineer

Communicating with a group of people is a common use case for many messaging apps. However, it may be difficult to know how the Android Auto messaging API applies to group conversations. Here are some tips for getting started with group messaging in Android Auto:

Conversation Name

When constructing the UnreadConversation builder, you are required to pass in a name. This is the name of the conversation that is displayed to the user when messages arrive.

UnreadConversation.Builder unreadConvBuilder =
    new UnreadConversation.Builder(conversationName)
        .setReadPendingIntent(msgHeardPendingIntent)
        .setReplyAction(msgReplyPendingIntent, remoteInput);

For one-on-one conversations, this is simply the name of the other participant. For group conversations, it is best to choose one of two options for the name:

  1. Conversation title: If your app supports adding a title to group conversations, use the title for the name parameter to be consistent with your in-app experience. This field is similar to NotificationCompat.MessagingStyle#setConversationTitle.
  2. A list of participants: Build a comma-separated list of participants for the name parameter to identify the group. Note that this is read aloud by the text-to-speech system, so you may need to abbreviate the list for large groups. You should balance allowing users to uniquely identify the group with the time taken to listen to messages.

Text to Speech Formatting

Getting text to sound natural using a TTS system is a challenging problem. There are teams working hard to improve this, but there are steps you can take to create a better user experience with the current capabilities. The Android Auto messaging API does not yet have an option for pairing participants with individual messages in a group conversation. This is problematic for drivers when there are multiple unread messages from multiple participants in a group conversation, as the drivers cannot see which group member sent which message. One solution is to prepend the sender's name to the message whenever the sender changes so that the names are read aloud to the driver.

CharSequence currentSender = null;
for (Message message : myMessages) {
    StringBuilder messageText = new StringBuilder();
    CharSequence sender = message.getSender();
    // Maybe append sender to indicate who is speaking.
    if (!TextUtils.isEmpty(sender) && !sender.equals(currentSender)) {
        if (currentSender != null) {
            // Punctuation will briefly pause TTS readout between senders.
            messageText.append(". ");
        }
        currentSender = sender;
        messageText.append(sender.toString().toLowerCase(Locale.getDefault()));
        // Punctuation will separate sender from message in TTS readout.
        messageText.append(": ");
    }
    messageText.append(message.getText());
    unreadConvBuilder.addMessage(messageText.toString());
}

Some things to note about the above sample code:

Get participants

In searching for how to handle group messaging, you may have noticed UnreadConversation#getParticipants. This can be confusing as there is no mechanism to add multiple participants in the builder. The builder implementation populates the array with the conversation name passed to its constructor. Internally, Android Auto uses the singular UnreadConversation#getParticipant, which returns the first element of the participants array, to populate the title in the notification view.

Stay tuned

The Android Auto team is working on ways to make messaging with drivers simpler and more intuitive for app developers. Stay tuned for future updates so that you can continue to deliver a great user experience!

23 May 2017 8:48pm GMT