Question

I know there are galleries like SphereShare.net to open and share panoramic photos in form of spheres. But, what should be the way to load the sphere in my app?

Was it helpful?

Solution

You must use PanoramaClient (which is part of Google Play Services) to open PhotoSphere photos.

An example of how to do this can be found on this Android developer blog post:

// This listener will be called with information about the given panorama.
OnPanoramaInfoLoadedListener infoLoadedListener =
  new OnPanoramaInfoLoadedListener() {
    @Override
    public void onPanoramaInfoLoaded(ConnectionResult result,
                                     Intent viewerIntent) {
        if (result.isSuccess()) {
            // If the intent is not null, the image can be shown as a
            // panorama.
            if (viewerIntent != null) {
                // Use the given intent to start the panorama viewer.
                startActivity(viewerIntent);
            }
        }

        // If viewerIntent is null, the image is not a viewable panorama.
    }
};

// Create client instance and connect to it.
PanoramaClient client = ...
...

// Once connected to the client, initiate the asynchronous check on whether
// the image is a viewable panorama.
client.loadPanoramaInfo(infoLoadedListener, panoramaUri);
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top