I have included a StreetViewPanoramaFragment in my app, but I also want to show a preview of the streetview as seen in the google maps app.
How can I achieve this?
You can load the street view image by using the Google Street View Image API.
You can specify location and image size etc in the image request URL.
private static String imageURL = "https://maps.googleapis.com/maps/api/streetview?size=400x400&location=40.720032,-73.988354&fov=90&heading=235&pitch=10";
For requesting image, You can use Square's Picasso library:
Picasso.with(this).load(imageURL).into(imageView);
Or use Google's Volley library:
// Get the ImageLoader through your singleton class.
mImageLoader = MySingleton.getInstance(this).getImageLoader();
mImageLoader.get(imageURL, ImageLoader.getImageListener(mImageView,
R.drawable.def_image, R.drawable.err_image));
Or use bitmap with stream:
Bitmap bitmap = BitmapFactory.decodeStream((InputStream)new URL(imageUrl).getContent());
imageView.setImageBitmap(bitmap);
You can also check out this answer about how to get street view image with XML.