Sharing Rich Content From Your Android Apps, to Google+ and Beyond

Many developers have been using Android’s share intent to help their users share content with others, directly from their apps. With the recently-launched ShareCompat library, you can now help your users share rich content with their friends (like images and videos) more easily, and the items they share include attribution to your app. All you need to do is add a few lines of code!

I’ll walk through a few examples that use Google+ as the application handler, but of course, these share intent improvements can work for any service. Popular apps like Foodspotting, Pulse News, and Shazam are already using ShareCompat to help users share rich content with their Google+ circles. You can check out this photo album to see how they are all taking advantage of the new library.

Creating the Share Intent

If you’d like users to be able to share text from your app, start by building the following intent:

Intent shareIntent = ShareCompat.IntentBuilder.from(ShareActivity.this)
   .setText("This site has lots of great information about Android!
      http://www.android.com")
   .setType("text/plain")
   .getIntent()
   .setPackage("com.google.android.apps.plus");

startActivity(shareIntent);

Here, I passed text and a URL to the setText method, and I used the setType method to identify the content as “text/plain.” The intent builder can then pass this information to the application that’s doing the sharing. Additionally, I used the setPackage method to specify the application that I want to handle it. In this case, the Google+ application is specified.

The Google+ share box with pre-populated text and link snippet.


Google Plugin for Eclipse 2.5

Since Google added SQL support to App Engine in the form of Google Cloud SQL, the Google Plugin for Eclipse (GPE) team has been working hard on improving the developer experience for developing App Engine apps that can use a Cloud SQL instance as the backing database.

They are pleased to announce the availability of Google Plugin for Eclipse 2.5. GPE 2.5 simplifies app development by eliminating the need for manual tasks like copying Cloud JDBC drivers, setting classpaths, typing in JDBC URLs or filling in JVM arguments for connecting to local/remote database instances.

GPE 2.5 provides support for:

  • Configuring Cloud SQL/MySQL instances
  • Auto-completion for JDBC URLs
  • Creating database connections in Eclipse database development perspective
  • OAuth 2.0 for authentication.

Configuring Cloud SQL/MySQL instances
App Engine provides a local development environment in which you can develop and test your application before deploying to App Engine. With GPE 2.5, you now have the ability to configure your local development server to use a local MySQL instance or a Cloud SQL instance for testing. When you choose to deploy your app, it will use the configured Cloud SQL instance for App Engine.

Auto-completion for JDBC URLs
GPE 2.5 supports auto-completion for JDBC URLs, and quick-fix suggestions for incorrect JDBC URLs.

Creating database connections in Eclipse database development perspective
The Eclipse database development perspective can be used to configure database connections, browse the schema and execute SQL statements on your database.

Using GPE 2.5, database connections are automatically configured in the Eclipse database development perspective for the Development SQL instance and the App Engine SQL instance.

You can also choose to manually create a new database connection for a Cloud SQL instance. In GPE 2.5, we have added a new connection profile for Cloud SQL.

GPE 2.5 now uses OAuth 2.0 (earlier versions were using OAuth 1.0)  to securely access Google services (including Cloud SQL) from GPE. OAuth 2.0 is the latest version of the OAuth protocol focussing on simplicity of client development.

Can’t wait to get started?
Download GPE here and write your first App Engine and Cloud SQL application using GPE by following the instructions here.

Google hope GPE 2.5 will make cloud application development using App Engine and Cloud SQL a breeze. We always love to hear your feedback and the GPE group is a great place to share your thoughts.

The Changes to OAuth 2.0 endpoint

 

In the coming weeks we will be making three changes to the experimental OAuth 2.0 endpoint. We expect the impact to be minimal, and we’re emailing developers who are most likely to be affected.

We will be releasing these changes on November 15, 2011. This post describes the changes, their impact, and how they can be mitigated.

Change #1: Error responses for client-side web applications

The first change relates to the way errors are returned in OAuth 2.0 client-side web applications. It does not impact server-side, native, or device flows.

The current behavior of the OAuth 2.0 endpoint in certain error conditions is to return the error to the application as a query string parameter, for example:

https://www.example.com/back?error=access_denied.

The OAuth 2.0 specification indicates that the error should be returned in the fragment of the response. We are updating our OAuth 2.0 implementation to support the most recent draft of the specification. As a result, we will be changing the way we return errors to applications in the client-side flow.

As an example, today an error returns to your application as

https://www.example.com/back?error=access_denied. After this change, it will be returned as

https://www.example.com/back#error=access_denied.

There is no mitigation for this change, so your application will have to handle these types of errors in client-side script.

Change #2: Offline access as a separate parameter

The second change impacts the OAuth 2.0 server-side flow only. It does not impact client-side, native, or device flows. For context, this flow consists of the following steps:

  1. Redirect the browser to the Google OAuth 2.0 endpoint.
  2. The user will be shown a consent page.
  3. If the user consents, parse the authorization code from the query string of the response.
  4. Exchange the authorization code for a short-lived access token and a long-lived refresh token.

Once your application has obtained a long-lived refresh token (step 4), it may access a Google API at any time. This means server-side applications do not require the end-user to be present when obtaining new access tokens. We’re calling this type of access offline.

The client-side flow, in contrast, requires the user to be present when obtaining an access token. This type of access is called online.

With this change, we will be exposing online and offline access as a separate parameter that’s available only in the server-side flow.

When your application requests offline access, the consent page shown to a user will reflect that your application requests offline access and your application will receive an access and a refresh token. Once your application has a refresh token, it may obtain a new access token at any time.

When your application requests online access, your application will only receive an access token. No refresh token will be returned. This means that a user must be present in order for your application to obtain a new access token.

If unspecified in the request, online is the default.

A mitigation for this change is described at the end of this post.

Change #3: Server-side auto-approval

This change also impacts the OAuth 2.0 server-side flow only.

In the current implementation of OAuth2, every time your application redirects a user to Google, that user must give explicit consent before an authorization code is given to your application. As a result, sending a user through the flow another time requires them to see the consent screen again. Most applications don’t do this, but rather use the existing server-side flow as it was intended: a one-time association (import contacts, calendar operations, etc.) where the result is a refresh token which may be used to obtain new access tokens.

The behavior is changing to the following:

  • Users will only see the consent screen on their first time through the sequence.
  • If the application requests offline access, only the first authorization code exchange results in a refresh token.

To put it another way, consent will be auto-approved for returning users unless the user has revoked access. Refresh tokens are not returned for responses that were auto-approved.

The next section describes how to mitigate this change.

Mitigation of offline access (#2) and auto-approval (#3) changes

If you want to keep the existing behavior in your server-side applications, include the approval_prompt=force and access_type=offline parameters in an authorization code request.

For example, if the following is a target URL for obtaining an authorization code today:

https://accounts.google.com/o/oauth2/auth?
client_id=21302922996.apps.googleusercontent.com&
redirect_uri=https://www.example.com/back&
scope=https://www.google.com/m8/feeds/&
response_type=code

You can maintain the current behavior by changing the target URL to:

https://accounts.google.com/o/oauth2/auth?
client_id=21302922996.apps.googleusercontent.com&
redirect_uri=https://www.example.com/back&
scope=https://www.google.com/m8/feeds/&
response_type=code&
access_type=offline&
approval_prompt=force

You may start including these parameters in authorization code requests today.

Google Maps Mashups 13

GIS Cloud

GIS Cloud is a powerful free cloud based GIS service, that allows users to create, edit, analyze and publish data from only one GIS service. When creating a map with GIS Cloud users can choose from a number of base tiles, including OpenStreetMap, Bing Maps and Google Maps. Users can then add GIS data to the map, either from data already hosted on GIS Cloud or from their own files. Because the application is web based GIS Cloud enables centralised access to projects. Teams can work together on a project, with each member having their own account. Any changes then made to a project are available immediately to every member of the team. GIS Cloud projects can be shared, either by sharing the GIS Cloud URL of the project or by embedding the map in your own website. GIS Cloud also comes with a REST API and a JavaScript API.

Street View Image API

Google has released a Street View Image API to quickly and easily add a static image to a web page. The API provides a simple method for adding a Street View image or thumbnail to any application without the need for JavaScript. The API simply constructs a URL for the required Street View, which you can add to a web page as you would any other image. The API returns the corresponding Street View panorama as an image in JPG format. A quick example is the Street View of the Eiffel Tower above, which I added to this post with the URL http://maps.googleapis.com/maps/api/streetview?size=523×200&location=48.852733, 2.303183&heading=315&fov=90&pitch=5&sensor=false The API should prove very useful in particular for real-estate, hotel and restaurant listing sites, providing a quick and easy method for providing images of houses, hotels and restaurants.

DVRPC Pedestrian and Bicycle Counts

The Delaware Valley Regional Planning Commission collects traffic volume counts at over 5,000 locations each year. The DVRPC Pedestrian and Bicycle Counts Google Map allows users to select and view pedestrian and bicycle counts taken within the Philadelphia region. The data for the map was collected by the DVRPC over a one week period with detailed hourly reports linked to each location. Using the map it is therefore possible to view bicycle and pedestrian traffic at different locations in the city for the year in which it was collected. If you select an individual map marker you can click through to read a detailed report of the pedestrian or bicycle count at that location, showing the data for every hour within a one week period.

savethepostoffice.com map

The U.S. Postal Service announced this week that it will be studying 251 mail processing facilities for consolidation. If all of these plants were to close, it would reduce the area mail processing network by over half, presumably at a huge cost to delivery times. The website Save the Post Offices has created a Google Map showing the location of the 251 mail processing facilities that may be closed down, Processing Facilities Under Study for Consolidation Map. Save the Post Offices has also created Google Maps to show the location of Post Offices Closed in 2011, 3,653 Post Offices Under Study for Closure under RAOI and 727 (non-RAOI) Post Offices Under Study for Discontinuance.

Obsidian Portal

Obsidian Portal is an online platform for running and organizing table top role-playing games. Using the platform gamers can can build campaigns and find other RPG gamers. The platform also includes an option to easily create a Google Map of your campaign world. Users can create campaign maps from any JPEG image. The map can include map markers to show the position of cities or other important locations in a campaign. The map markers can also include links to a users Wiki page for the mapped location.

Digital Typhoon – Track Forecast Map


Agora’s Digital Typhoon – Track Forecast Map tracks tropical cyclones in and around Japan. The map shows the historical tracks of current typhoons and also shows their predicted path.

The map is currently showing the paths of typhoon Roke and Sonca. When the map first loads an animation of the typhoons’ path is displayed on the map. Different coloured markers indicate the typhoon’s wind speed at different points along its path.

The numbered red map markers show the predicted path of a typhoon. Each marker includes a radial polyline showing the probability circle of the typhoon’s location. You can also click on the markers to view the predicted wind speed.

Submarine Cable Map


TeleGeography’s Submarine Cable Map is a real thing of beauty.

The map depicts 188 active and planned submarine cable systems and their landing stations around the world. Both the cables and their landing points on the map are interactive. Clicking a cable provides access to data about the cable, including the cable’s name, ready-for-service (RFS) date, length, owners, website, and landing points. Clicking a landing point reveals a list of all submarine cables landing at that station.

The map makes great use of Google Map styles and custom info windows to create a map that is both functional and great to look at.

Planefinder.net


Planefinder.net, the real-time plane tracking website, has made some very impressive updates to their Google Map.

Now as well as tracking thousands of planes in real-time around the world you can also play back a whole day’s worth of flights. The playback option allows you to select a date, the number of hours you wish to view and even the speed of the animation. You really should zoom out on the USA, set the time to 23 hours and the speed to 120x and watch a day’s worth of flights.

Another nice update in this new release of planefinder.net is the custom information windows. If you select an individual plane you can view a picture of the plane, the flight and flight details, download a KML of the flight path, zoom the map to fit the entire flight path and share the track on Twitter and Facebook.

Google Map of Speed Traps


Blitzer.de is a new Google Map, and Android & iPhone app which has a huge database of speed traps around the world.

Blitzer.de is the latest application from the ever impressive Ubilabs. The app allows you to view the location of speed traps in your region and around the world. More than 2,000 mobile speed traps are reported by the blitzer.de community per day.

The application allows users to search by location and filter results by fixed speed traps, mobile cameras and all speed traps. The speed trap markers include speed limits where available. Users of the map and the mobile apps can also add speed traps that are missing from the map.

via:googlemapsmania

Hack4Transparancy for everyone

A few weeks ago we told you about the Hack4Transparancy event, bringing techies together November 8th and 9th in the European Parliament for an all-expenses-paid good time eating, talking, and making important data accessible to everyone.
Well, now we’ve got more exciting news. We’ve broadened the scope of the event and extended the application deadline for those wishing to make data on Internet performance visible and meaningful.
What’s changed?
The application deadline for the Internet Quality track has been extended through noon, CET, Friday October 21st (that’s this coming Friday).
To diversify the skill-set of interested hackers, we’ve added a data visualization option to the Internet Quality track.
We’ve expanded the criteria — now, eligible hackers from anywhere in the world can apply.
And, we’ve increased the prize money. One winning team or individual on each track will now receive €5.000,00.