PanoramaClient is part of the recent(ish) new Google Play Services API.
It enables you to view a 360 degree panorama using the device's built in Google Play Services panorama viewer.
Anyone that's used the new Photo Sphere feature of Android 4.2 will recognise what this library is capable of viewing.
There's an informative article that's worth a read here: New Google Maps Android API now part of Google Play services | Android Developers Blog.
And the official documentation for the PanoramaClient can be found here: PanoramaClient | Android Developers.
Here's the documentation for my b4a library:
PanoramaClient
Version: 1.00
PanoramaClient is not a View, think of it as simply a way to get an Intent which can be started to display a panorama.
On my Galaxy S3 my panoramas are displaying full screen - i see no way to embed a panorama into an activity.
And here's a sample b4a project:
I have a photo sphere panorama on the root of my SD card, the code runs and gets an Intent from the PanoramaClient.
Starting this Intent displays my panorama in the built in panorama viewer.
I can't include a sample panorama image with the sample b4a project, even my lowest quality panorama is over 700KBs so far too big to attach to this post.
All is not lost though!
In order to use the PanoramaClient you need to download the latest version of the Google Play Services SDK and copy the google-play-services.jar library to your b4a additional libraries folder.
(You'll have already done this if you've used the b4a Google Maps library).
So download the Google Play Services SDK if you haven't already done so and locate where it's been downloaded to, on my computer it's located at:
There is a java android sample PanoramaClient application and that sample contains an image you can use with my b4a PanoramaClient library.
This is the panaorama image location on my computer:
You'll need to copy the image to your device or add it to the demo project and then modify the path to the panorama:
If you add the image to the demo using the File tab i think there is no way to create a path to the image in assets.
You'll have to copy the image from assets to the device's external memory.
Panorama fans might be interested in seeing photo spheres that others have submitted to Google: Contribute – Street View – Google Maps
Martin.
PanoramaClient is no longer working, the API it used in Google Play Services has been removed.
See post #7 in this thread for the newer PanoramaAPI library.
It enables you to view a 360 degree panorama using the device's built in Google Play Services panorama viewer.
Anyone that's used the new Photo Sphere feature of Android 4.2 will recognise what this library is capable of viewing.
There's an informative article that's worth a read here: New Google Maps Android API now part of Google Play services | Android Developers Blog.
And the official documentation for the PanoramaClient can be found here: PanoramaClient | Android Developers.
Here's the documentation for my b4a library:
PanoramaClient
Version: 1.00
- PanoramaClient
Events:- Connected
- ConnectionFailed
- Disconnected
- PanoramaInfoLoaded (StatusCode As Int, ViewerIntent As Intent)
- DEVELOPER_ERROR As Int
The application is misconfigured. - INTERNAL_ERROR As Int
An internal error occurred. - INVALID_ACCOUNT As Int
The client attempted to connect to the service with an invalid account name specified. - LICENSE_CHECK_FAILED As Int
The application is not licensed to the user. - NETWORK_ERROR As Int
A network error occurred. - RESOLUTION_REQUIRED As Int
Completing the connection requires some form of resolution. - SERVICE_DISABLED As Int
The installed version of Google Play services has been disabled on this device. - SERVICE_INVALID As Int
The version of the Google Play services installed on this device is not authentic. - SERVICE_MISSING As Int
Google Play services is missing on this device. - SERVICE_VERSION_UPDATE_REQUIRED As Int
The installed version of Google Play services is out of date. - SIGN_IN_REQUIRED As Int
The client attempted to connect to the service but the user is not signed in. - SUCCESS As Int
The connection was successful.
- Connect
Connects the client to Google Play services. - Disconnect
Closes the connection to Google Play services. - Initialize (EventName As String)
- IsConnected As Boolean
Checks if the client is currently connected to the service, so that requests to other methods will succeed. - IsConnecting As Boolean
Checks if the client is attempting to connect to the service. - LoadPanoramaInfo (Filepath As String)
Loads information about a panorama.
On completion raises the PanoramaInfoLoaded(StatusCode As Int, ViewerIntent As Intent) event.
PanoramaClient is not a View, think of it as simply a way to get an Intent which can be started to display a panorama.
On my Galaxy S3 my panoramas are displaying full screen - i see no way to embed a panorama into an activity.
And here's a sample b4a project:
B4X:
Sub Process_Globals
End Sub
Sub Globals
Dim PanoramaClient1 As PanoramaClient
End Sub
Sub Activity_Create(FirstTime As Boolean)
PanoramaClient1.Initialize("PanoramaClient1")
PanoramaClient1.Connect
End Sub
Sub Activity_Resume
End Sub
Sub Activity_Pause (UserClosed As Boolean)
If UserClosed Then
PanoramaClient1.Disconnect
End If
End Sub
Sub PanoramaClient1_Connected
Log("PanoramaClient1_Connected")
PanoramaClient1.LoadPanoramaInfo("mnt/extSdCard/cross_bank_road_panorama.jpg")
End Sub
Sub PanoramaClient1_ConnectionFailed
Log("PanoramaClient1_ConnectionFailed")
End Sub
Sub PanoramaClient1_Disconnected
Log("PanoramaClient1_Disconnected")
End Sub
Sub PanoramaClient1_PanoramaInfoLoaded(StatusCode As Int, ViewerIntent As Intent)
Log("PanoramaClient1_PanoramaInfoLoaded")
If ViewerIntent.IsInitialized Then
StartActivity(ViewerIntent)
Else
Log("ViewerIntent not initialized")
Select StatusCode
Case PanoramaClient1.DEVELOPER_ERROR
Log("DEVELOPER_ERROR")
Case PanoramaClient1.INTERNAL_ERROR
Log("INTERNAL_ERROR")
Case PanoramaClient1.INVALID_ACCOUNT
Log("INVALID_ACCOUNT")
Case PanoramaClient1.LICENSE_CHECK_FAILED
Log("LICENSE_CHECK_FAILED")
Case PanoramaClient1.NETWORK_ERROR
Log("NETWORK_ERROR")
Case PanoramaClient1.RESOLUTION_REQUIRED
Log("RESOLUTION_REQUIRED")
' this may be a recoverable error
' need to check on the forum for recent posts regarding
' the ConnectionResult startResolutionForResult(Activity activity, int requestCode) method
Case PanoramaClient1.SERVICE_DISABLED
Log("SERVICE_DISABLED")
Case PanoramaClient1.SERVICE_INVALID
Log("SERVICE_INVALID")
Case PanoramaClient1.SERVICE_MISSING
Log("SERVICE_MISSING")
Case PanoramaClient1.SERVICE_VERSION_UPDATE_REQUIRED
Log("SERVICE_VERSION_UPDATE_REQUIRED")
Case PanoramaClient1.SIGN_IN_REQUIRED
Log("SIGN_IN_REQUIRED")
Case PanoramaClient1.SUCCESS
Log("SUCCESS")
' i think if ViewerIntent is not initialized and the status code is SUCCESS then the panorama image is not a viewable panorama
End Select
End If
End Sub
I have a photo sphere panorama on the root of my SD card, the code runs and gets an Intent from the PanoramaClient.
Starting this Intent displays my panorama in the built in panorama viewer.
I can't include a sample panorama image with the sample b4a project, even my lowest quality panorama is over 700KBs so far too big to attach to this post.
All is not lost though!
In order to use the PanoramaClient you need to download the latest version of the Google Play Services SDK and copy the google-play-services.jar library to your b4a additional libraries folder.
(You'll have already done this if you've used the b4a Google Maps library).
So download the Google Play Services SDK if you haven't already done so and locate where it's been downloaded to, on my computer it's located at:
Copy this .jar library to your b4a additional libraries folder, now return to your SDK folder.C:\Users\martin\Programming\adt-bundle-windows\sdk\extras\google\google_play_services\libproject\google-play-services_lib\libs\google-play-services.jar
There is a java android sample PanoramaClient application and that sample contains an image you can use with my b4a PanoramaClient library.
This is the panaorama image location on my computer:
C:\Users\martin\Programming\adt-bundle-windows\sdk\extras\google\google_play_services\samples\panorama\res\raw\pano1.jpg
You'll need to copy the image to your device or add it to the demo project and then modify the path to the panorama:
B4X:
PanoramaClient1.LoadPanoramaInfo("path to pano1.jpg")
You'll have to copy the image from assets to the device's external memory.
Panorama fans might be interested in seeing photo spheres that others have submitted to Google: Contribute – Street View – Google Maps
Martin.
PanoramaClient is no longer working, the API it used in Google Play Services has been removed.
See post #7 in this thread for the newer PanoramaAPI library.
Last edited: