31 Oct 2014

feedAndroid News, Rumours, and Updates

Gmail Updates Web Calendar

The next time you visit calendar.google.com, you may notice some slight changes. Now, when viewing your calendar, updates will happen without needing to be refreshed. So if you get an invite for a certain time, or another party updates and event, you will see that happen immediately instead of after a refresh. Also, when you […]


Come comment on this article: Gmail Updates Web Calendar

Visit TalkAndroid for Android news, Android guides, and much more!

31 Oct 2014 5:54am GMT

Verizon Releases two new ads for the Droid Turbo

Verizon has released two official advertisements with one of them featuring the star of the two "viral videos:" James Franco. The other video shows how tough and sturdy the device is, dropping, banging, washing, and even bending it to showcase just how much of a scrap this piece of tech can take. Check out both videos […]


Come comment on this article: Verizon Releases two new ads for the Droid Turbo

Visit TalkAndroid for Android news, Android guides, and much more!

31 Oct 2014 4:39am GMT

Samsung introduces the Galaxy A5 and Galaxy A3 for social-focused consumers

The phone a person own says a lot about them, right? Samsung, and other manufacturers, think so. The company has announced the Galaxy A5 and Galaxy A3. Consumers focused on social networking are the target with these two devices. The design is what is important here. The outside is a metal unibody and Samsung plans […]


Come comment on this article: Samsung introduces the Galaxy A5 and Galaxy A3 for social-focused consumers

Visit TalkAndroid for Android news, Android guides, and much more!

31 Oct 2014 3:37am GMT

feedAndroid Community

Metal unibody phones Samsung Galaxy A3, A5 get official announcements

We've covered Samsung's "A Series" pretty extensively before in terms of leaks and what to expect. We know that somehow - starting with the Samsung Galaxy Alpha - the South … Continue reading

31 Oct 2014 3:05am GMT

Latest Q3 2014 IDC figures show Xiaomi now 3rd in smartphones shipped

While some brands and markets may have already plateaued when it comes to smartphone consumption, there are still those in the emerging market that have just found their stride, as … Continue reading

31 Oct 2014 2:38am GMT

30 Oct 2014

feedAndroid Community

Major Gun lets you virtually save the day from terrorists

While it is sometimes fun to play games with elaborate stories, complicated gameplay and long-winded missions, there are times when you just want to virtually shoot stuff, straight-up. For those … Continue reading

30 Oct 2014 7:20pm GMT

29 Oct 2014

feedAndroid Developers Blog

The fastest route between voice search and your app

By Jarek Wilkiewicz, Developer Advocate, Google Search

How many lines of code will it take to let your users say Ok Google, and search for something in your app? Hardly any. Starting today, all you need is a small addition to your AndroidManifest.xml in order to connect the Google Now SEARCH_ACTION with your searchable activity:

<activity android:name=".SearchableActivity">
    <intent-filter>
        <action android:name="com.google.android.gms.actions.SEARCH_ACTION"/>
        <category android:name="android.intent.category.DEFAULT"/>
    </intent-filter>
</activity>

Once you make these changes, your app can receive the SEARCH_ACTION intent containing the SearchManager.QUERY extra with the search expression.

At Google, we always look for innovative ways to help you improve mobile search and drive user engagement back to your app. For example, users can now say to the Google app: "Ok Google, search pizza on Eat24" or "Ok Google, search for hotels in Maui on TripAdvisor."

This feature is available on English locale Android devices running Jelly Bean and above with the Google app v3.5 or greater. Last but not least, users can enable the Ok Google hot-word detection from any screen, which offers them the fastest route between their search command and your app!


Join the discussion on
+Android Developers


29 Oct 2014 7:46pm GMT

28 Oct 2014

feedAndroid Developers Blog

Tips for integrating with Google Accounts on Android

By Laurence Moroney, Developer Advocate

Happy Tuesday! We've had a few questions come in recently regarding Google Accounts on Android, so we've put this post together to show you some of our best practices. The tips today will focus on Android-based authentication, which is easily achieved through the integration of Google Play services. Let's get started.

Unique Identifiers

A common confusion happens when developers use the account name (a.k.a. email address) as the primary key to a Google Account. For instance, when using GoogleApiClient to sign in a user, a developer might use the following code inside of the onConnected callback for a registered GoogleApiClient.ConnectedCallbacks listener:

[Error prone pseudocode]
String accountName = Plus.AccountApi.getAccountName(mGoogleApiClient);
// createLocalAccount() is specific to the app's local storage strategy.
createLocalAccount(accountName);

While it is OK to store the email address for display or caching purposes, it is possible for users to change the primary email address on a Google Account. This can happen with various types of accounts, but these changes happen most often with Google Apps For Work accounts.

So what's a developer to do? Use the Google Account ID (as opposed to the Account name) to key any data for your app that is associated to a Google Account. For most apps, this simply means storing the Account ID and comparing the value each time the onConnected callback is invoked to ensure the data locally matches the currently logged in user. The API provides methods that allow you to get the Account ID from the Account Name. Here is an example snippet you might use:

[Google Play Services 6.1+]
String accountName = Plus.AccountApi.getAccountName(mGoogleApiClient);
String accountID = GoogleAuthUtil.getAccountId(accountName);
createLocalAccount(accountID);
[Earlier Versions of Google Play Services (please upgrade your client)]
Person currentUser = Plus.PeopleApi.getCurrentPerson(mGoogleApiClient);
String accountID = currentUser.getID();
createLocalAccount(accountID);

This will key the local data against a Google Account ID, which is unique and stable for the user even after changing an email address.

So, in the above scenario, if your data was keyed on an ID, you wouldn't have to worry if your users change their email address. When they sign back in, they'll still get the same ID, and you won't need to do anything with your data.

Multiple Accounts

If your app supports multiple account connections simultaneously (like the Gmail user interface shown below), you are calling setAccountName on the GoogleApiClient.Builder when constructing GoogleApiClients. This requires you to store the account name as well as the Google Account ID within your app. However, the account name you've stored will be different if the user changes their primary email address. The easiest way to deal with this is to prompt the user to re-login. Then, update the account name when onConnected is called after login. Any time a login occurs you, can use code such as this to compare Account IDs and update the email address stored locally for the Account ID.

[Google Play Services 6.1+]
String accountName = Plus.AccountApi.getAccountName(mGoogleApiClient);
String accountID = GoogleAuthUtil.getAccountId(accountName);
// isExistingLocalAccount(), createLocalAccount(), 
// getLocalDataAccountName(), and updateLocalAccountName() 
// are all specific to the app's local storage strategy.
boolean existingLocalAccountData = isExistingLocalAccount(accountID);
if (!existingLocalAccountData) {
    // New Login.
    createLocalAccount(accountID, accountName);
} else {
    // Existing local data for this Google Account.
    String cachedAccountName = getLocalDataAccountName(accountID);    
    if (!cachedAccountName.equals(accountName)) {
        updateLocalAccountName(accountID, accountName);
    }
}

This scenario reinforces the importance of using the Account ID to store data all data in your app.

Online data

The same best practices above apply to storing data for Google Accounts in web servers for your app. If you are storing data on your servers in this manner and treating the email address as the primary key:

ID [Primary Key] Field 1 Field 2 Field 3
user1@gmail.com Value 1 Value 2 Value 3

You need to migrate to this model where the primary key is the Google Account ID.:

ID [Primary Key] Email Field 1 Field 2 Field 3
108759069548186989918 user1@gmail.com Value 1 Value 2 Value 3

If you don't make Google API calls from your web server, you might be able to depend on the Android application to notify your web server of changes to the primary email address when implementing the updateLocalAccountName method referenced in the multiple accounts sample code above. If you make Google API calls from your web server, you likely implemented it using the Cross-client authentication and can detect changes via the OAuth2 client libraries or REST endpoints on your server as well.

Conclusion

When using Google Account authentication for your app, it's definitely a best practice to use the account ID, as opposed to the account name to distinguish data for the user. In this post, we saw three scenarios where you may need to make changes to make your apps more robust. With the growing adoption of Google for Work, users who are changing their email address, but keeping the same account ID, may occur more frequently, so we encourage all developers to make plans to update their code as soon as possible.


Join the discussion on
+Android Developers


28 Oct 2014 5:18pm GMT

Material Design on Android Checklist

By Roman Nurik, Design Advocate

Android 5.0 brings in material design as the new design system for the platform and system apps. Consumers will soon start getting Android 5.0 and they're already seeing glimpses of material design with apps like Google Play Newsstand, Inbox by Gmail and Tumblr. Meanwhile, developers now have the Android 5.0 SDK, along with AppCompat for backward compatibility. And designers now have access to Photoshop, Illustrator and Sketch templates. All this means that now-yes now!-is the time to start implementing material design in your Android apps. Today, let's talk about what implementing material design really boils down to.

Below, you'll find a material design checklist that you can use to mark progress as you implement the new design system. The checklist is divided into 4 key sections based on the 4 key aspects of material design.

If you include a good chunk of the items in the checklist below, especially the ones indicated as signature elements, and follow traditional Android design best practices (i.e. these, these, and things we discussed on ADiA), you'll be well on your way to material design awesomeness!

Tangible Surfaces

UIs consist of surfaces (pieces of "digital paper") arranged at varying elevations, casting shadows on surfaces behind them.

Figure 1. Surfaces and layering.

A Bold, Print-Like Aesthetic

The "digital ink" you draw on those pieces of digital paper is informed by classic print design, with an emphasis on bold use of color and type, contextual imagery, and structured whitespace.

Figure 2. Primary and accent colors.

Figure 3. Keylines.

Authentic Motion

Motion helps communicate what's happening in the UI, providing visual continuity across app contexts and states. Motion also adds delight using smaller-scale transitions. Motion isn't employed simply for motion's sake.

Figure 4. "Hero" transitions.

Adaptive Design (and UI Patterns)

Tangible surfaces, bold graphic design, and meaningful motion work together to bring a consistent experience across any screen, be it phones, tablets, laptops, desktops, TVs, wearables, or even cars. Additionally, the key UI patterns below help establish a consistent character for the app across devices.

Figure 5. The floating action button.

App bar

Tabs


Figure 6. Tabs with material design.

Navigation drawer


Figure 7. Navigation drawers
with material design.

More and more apps from Google and across the Google Play ecosystem will be updating with material design soon, so expect Winter 2014 to be a big quarter for design on Android. For more designer resources on material design, check out the DesignBytes series. For additional developer resources, check the Creating Apps with Material Design docs!

Join the discussion on

+Android Developers

28 Oct 2014 1:00pm GMT