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?
Asked
Active
Viewed 2,102 times
1 Answers
3
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);

ianhanniballake
- 191,609
- 30
- 470
- 443
-
Hi, thanks for your input. Now I'm trying to follow [this](http://my.fit.edu/~vkepuska/ece5570/adt-bundle-windows-x86_64/sdk/extras/google/google_play_services/samples/panorama/src/com/google/android/gms/samples/panorama/PanoramaSampleActivity.java) example, and I changed the line that says: Uri uri = Uri.parse("android.resource://" + getPackageName() + "/" + R.raw.pano1); for the line: Uri uri = Uri.parse("https://dl.dropboxusercontent.com/u/24891617/The%20Slip/pano1.jpeg".toString()); The problem is that it is not loading anything. What are your thoughts? – Luis Lavieri May 06 '13 at 18:01
-
The link is broken, did you mean this link ? https://stuff.mit.edu/afs/sipb/project/android/OldFiles/sdk/android-sdk-linux/extras/google/google_play_services/docs/reference/com/google/android/gms/panorama/PanoramaClient.html – Bart Burg Nov 06 '15 at 15:45
-
1@BartBurg - it has since been replaced with [PanoramaApi](https://developers.google.com/android/reference/com/google/android/gms/panorama/PanoramaApi) – ianhanniballake Nov 06 '15 at 16:14