How to add a 360 degree panorama view to an android app?

Viewed 764

Well, I have been searching a way to add a 360 degree panoramic image for now, but for some reason, I was not able to find something useful from the internet. The only thing I found was this tutorial was this Tutorialhttps://youtu.be/gnDa-fvEyUk, which, unfortunately, is in Kotlin. So hope you guys would help me sort this.

Well, by the way I found this documentaion; however, I was not able to comprehend much from this, especially the java part. It seems the layout part is easy(all about adding VRPanorama viewGoogle VR documentation Thanks in advance. PS: I am gonna do it in a fragment, so if possible, please show me the way of fragments.

EDIT: In general, what I want to add is 360-degree to one of my fragments that is similar to the video I shared. I have already added the dependencies and wrote the code for the layout file(the same as the tutorial), and also, I am more interested in URL way. After some searching, again I found something which might be helpful(Still Kotlin though). Tutorial

1 Answers

To retrieve image from the URL, all you should do is add a invisible i.e gone imageview in the xml and using glide load the image in that view and from the view retrieve that image as drawable and convert it to Bitmap and then load that view in the VR's SDK method and load it.

That's it, and for the fragment part all you have to do is define the VR and Image views in the fragment and then write the required code in the fragments class.

Related