Showing posts with label updates. Show all posts
Showing posts with label updates. Show all posts

Tuesday, February 7, 2017

API Updates for Sign In with Google

API Updates for Sign In with Google


Posted by Laurence Moroney

With the release of Google Play services 8.3, we’ve made a lot of improvements to Sign-In with Google. In the first blog post of this ongoing series, we discussed the user interface improvements. Today, we will look further into the changes to the API to make building apps that Sign-In with Google easier than ever before.

Changes to basic sign in flow

When building apps that sign in with Google, you’ll notice that there are a lot of changes to make your code easier to understand and maintain.

Prior to this release, if you built an app that used Sign-In with Google, you would build one that attempted to connect to a GoogleApiClient. At this point the user was presented with an account picker and/or a permissions dialog, both of which would trigger a connection failure. You would have to handle these connection failures in order to sign in. Once the GoogleApiClient connected, then the user was considered to be signed in and the permissions could be granted. The process is documented in a CodeLab here.

Now, your code can be greatly simplified.

The process of signing in and connecting the GoogleApiClient are handled separately. Signing in is achieved with a GoogleSignInOptions object, on which you specify the parameters of the sign in, such as scopes that you desire. Here’s a code example:

 GoogleSignInOptions gso = new GoogleSignInOptions.Builder(GoogleSignInOptions.DEFAULT_SIGN_IN) .requestEmail() .build(); 

Once you have a GoogleSignInOptions object, you can use it to configure the GoogleApiClient:

Here’s where your code will diverge greatly in the new API. Now, if you want to connect with a Google Account, instead of handling errors on the GoogleApiClient, you’ll instead use an intent that is initialized using the client.

Intent signInIntent = Auth.GoogleSignInApi.getSignInIntent(mGoogleApiClient); startActivityForResult(signInIntent, RC_SIGN_IN);

Starting the intent will give you the account picker, and the scopes permission dialog if your GoogleSignInOptions requested anything other than basic scope. Once the user has finished interacting with the dialogs, an OnActivityResult callback will fire, and it will contain the requisite sign-in information.

 @Override public void onActivityResult(int requestCode, int resultCode, Intent data) { super.onActivityResult(requestCode, resultCode, data); // Result returned from launching the Intent from GoogleSignInApi.getSignInIntent(...); if (requestCode == RC_SIGN_IN) { GoogleSignInResult result = Auth.GoogleSignInApi.getSignInResultFromIntent(data); handleSignInResult(result); } } 

You can learn more about this code in the Integrating Google Sign-In quickstart, or by looking at the sample code.

Silent Sign-In

To further reduce friction for users in a multi-device world, the API supports silent sign in. In this case, if your user has given authorization to the app on a different device, the details will follow their account, and they don’t need to re-give them on future devices that they sign into, unless they deauthorize. An existing sign-in is also cached and available synchronously on the current device is available.

Using it is as simple as calling the silentSignIn method on the API.

OptionalPendingResult opr = Auth.GoogleSignInApi.silentSignIn(mGoogleApiClient);

Then, you can check the isDone() method on the pending result -- and if it returns true, the user is signed in, and you can get their status from the PendingResult. If it isn’t then you have to wait for a callback with the SignInResult

 if (pendingResult.isDone()) { doStuffWith(pendingResult.get()); } else { // Theres no immediate result ready, displays some progress indicator and waits for the // async callback. showProgressIndicator(); pendingResult.setResultCallback(new ResultCallback<GoogleSignInResult>() { @Override public void onResult(@NonNull GoogleSignInResult result) { updateButtonsAndStatusFromSignInResult(result); hideProgressIndicator(); } }); } 

Customizing the Sign-In Button

When building apps that Sign-In with Google, we provide a SignInButton object that has the Google branding, and which looks like this:


You can customize this button with a number of properties and constants that are documented in the API here.

The branding guidelines are available here, and they include versions of the buttons in PNG, SVG, EPS and other formats in many resolutions, including all the different states of the button. These files may be used for localization of the button, and if you need to match the style of the button to your app, guidelines are provided.

This only deals with the Android side of your app. You’ll likely have a server back end, and you may want to use the credentials on that securely.

In the next blog post, we’ll discuss how to use Sign-In with Google in server-side scenarios, including how to securely pass your credentials to your own server, and how to use Google back-end services, such as Google Drive, with the permission and credentials from users.


Available link for download

Read more »

Sunday, October 9, 2016

Google Play services 9 0 updates

Google Play services 9 0 updates


Posted by Laurence Moroney, Developer Advocate


It’s been a little while since we made a release of Google Play services, because we’ve been busy integrating Firebase. While Firebase will contain the SDKs you’ve come to know and love for building mobile applications that run cross platform, we’ll also continue to ship Google Play services updates with new SDKs regularly. Firebase was built using Google Play services 9.0, so let’s dig a little deeper into some of the new and cool APIs that are available in this release.

Ads

If you build apps that monetize with ads, we’ve added a lot of updates since 8.4. Theres a new Initialization method that publishers can use to kick off the SDK at app start. Theres also a new native ads format: Native Ads Express. With Native Ads Express, publishers can define CSS templates for their ad units that define fonts, colors, positioning, and other style information. AdMob combines these with advertiser assets like headlines and calls to action to make a finished ad, which is displayed in a NativeExpressAdView. Moving the work of customizing presentation off the device means theres less mobile code required, plus its possible to update templates without redeploying the app.

Nearby

We’re continuing to update BLE beacon scanning in Nearby Messages. Any app with ACCESS_FINE_LOCATION will be able to scan for beacons via Nearby without any additional permissions. We recommend developers check to see if the app has the location permission prior to calling GoogleApiClient.connect(). Get started here.

For peer-to-peer Nearby Messages, there’s now an option to show the opt-in dialog upon connection to the GoogleApiClient which significantly reduces boilerplate for obtaining the Nearby permission.

Player Stats API

We’re also continuing to update the Play Games Client SDK with improvements to the Player Stat API and the public launch of the video recording API. The Player Stats API now has Predictive Analytics to help you identify which groups of players are likely to spend or churn, and we are adding new predictions for how much a player is likely to spend within 28 days and the probability that a player is a high spender. This allows you to tailor experiences for these players to try to increase their spend or engagement. Learn more about the Player Stats API.

Video recording API

You will be able to easily add video recording to your app and let users share their videos with their friends and on YouTube in a few simple steps. In the coming months, we are also adding live streaming functionality to allow your fans to broadcast their gameplay experiences in real time on YouTube.

That’s it for this release of Google Play services 9.0 -- we’re continuing to ship new APIs all the time so watch this blog for future announcements.

Available link for download

Read more »

Saturday, October 8, 2016

Google’s new Play Store algorithm to halve size of updates

Google’s new Play Store algorithm to halve size of updates


Google Play Store new icon crop

The amount of data required for updating Google Play apps can really send your mobile bill through the roof, especially if you arent using Wi-Fi. Fortunately, Google has heard your concerns, and rolled out a new Delta algorithm, bsdiff, which reduces the app update size and lets you save on the data required for updating them.

Googles new algorithm does this by further compressing the size of patches for apps and games. According to a blog post by Anthony Morris, SWE Google Play, for about 98 percent of app updates from the Play Store, only deltas to APK files are downloaded and merged with the existing files to reduce the size of the updates. Now, Googles new algorithm will further reduce the patches by up to 50 percent. As he explains in the post,

"For approximately 98 percent of app updates from the Play Store, only changes (deltas) to APK files are downloaded and merged with the existing files, reducing the size of updates. We recently rolled out a delta algorithm, bsdiff, that further reduces patches by up to 50 percent or more compared to the previous algorithm. Bsdiff is specifically targeted to produce more efficient deltas of native libraries by taking advantage of the specific ways in which compiled native code changes between versions. To be most effective, native libraries should be stored uncompressed (compression interferes with delta algorithms)."

Google has also applied the new algorithm to APK Expansion Files to allow users to include additional large files of up to 2GB in size with their apps. This means that the download size of your initial installs will now be lower by about 12 percent, and your updates by approximately 65 percent.

"APK Expansion Files allow you to include additional large files up to 2GB in size (e.g. high resolution graphics or media files) with your app, which is especially popular with games. We have recently expanded our delta and compression algorithms to apply to these APK Expansion Files in addition to APKs, reducing the download size of initial installs by 12 percent, and updates by 65 percent on average."

Google-Play-Store-11

Google really cares about you and doesnt want you to pay unnecessarily high data charges when you update your favorite apps. So it has also updated the Play Store descriptions to include the actual download size of the apps instead of the size of their APKs. So instead of seeing just the app size earlier on Google Play and remaining in the dark about how much data and storage the update would actually consume, youll now get to see the precise size of the app you want to install or update. Cool, huh?

If the changes made to Google Play arent reflecting on your screen yet, dont panic because, as always, they are being rolled out to all users and should reach you sometime in the coming weeks.

Let us know in the comments below if you think Google Plays new algorithm will help reduce your data usage!



from Android Authority http://ift.tt/2akMHpT
via IFTTT

Available link for download

Read more »

Thursday, October 6, 2016

Android 6 0 updates for T Mobile and MetroPCS versions of HTC Desire 626s announced

Android 6 0 updates for T Mobile and MetroPCS versions of HTC Desire 626s announced


HTC Desire 626s red T-Mobile

When it comes to Android updates, much of the focus lately has been turned to Android 7.0 Nougat. There are still some devices receiving their Android 6.0 Marshmallow updates, though, and HTC today announced two of them.

HTC Desire 626s
T-Mobile
MetroPCS
HTC


from PhoneDog.com - Latest videos, reviews, articles, news and posts http://ift.tt/2ayYEr0
via IFTTT

Available link for download

Read more »

Saturday, September 3, 2016

Google Updates Ad Settings

Google Updates Ad Settings


Google has recently updated ad settings pages, which have a new design and more information about your options. You can still disable ads based on your interests from both Google sites and third-party sites. When you do that, youll still see ads, but they "will not be based on data Google has associated with your Google Account, and so may be less relevant".

Until now, Googles ad settings page had 2 sections for interest-based ads on Google sites and non-Google sites. Google changed this: there are now separate pages for signed-in ads and signed-out ads. When you are signed in to a Google account, Google can use data associated with your account: Google search history, YouTube history, Google+ profile, manually added interests and more.



The section for signed-out ads has 2 separate settings for "ads based on your interests on websites beyond google.com" and "Google Search Ads based on your interests". Google uses your previous searches and browsing history to improve search ads, but you can disable this feature. AdSense ads also use your browsing history and anonymous demographic details to improve ads. Signed-out ads rely on cookies tied to anonymous data.


"You can control the ads that are delivered to you based on anonymous information by editing these settings. These ads will more likely be useful and relevant to you and your Google services, such as search," informs Google.



Googles help center has more information. "To opt out of all of Google’s interest-based ads on your browser, youll need to opt out in 3 places: once when youre signed in to Google products, once when youre signed out, and once for ads on the Display Network (websites beyond google.com). The reason for the different opt-outs is that Google uses different information to target ads, depending on how youre interacting with Google and whether youre signed in with your Google account."

{ Thanks, Herin Maru. }

Available link for download

Read more »