The overall structure of a cardboard Android app is as follows:
The Cardboard SDK is part of Google's official development, and cardboard activities is part of the developer's development, and many of the work needs to depend on the Open GL Graphics library.
The two main classes that developers need to use in the Cardboard SDK are cardboardactivity and Cardboardview:
So the main structure of an application can be expressed as:
The mainactivity is part of what developers want to design and implement.
There are several main ways to look at interactions like:
After the system is up, the Cardboardview will first act on the mainactivity, call the Onsurfacecreate method, generally in this method, the data initialization of the three-dimensional scene;
After each frame, Cardboardview will call Mainactivity's Onnewframe method and Ondraweye method, and pass the attitude data of the head, and usually do some data processing in the Onnewframe, In Ondraweye, the change of image is realized by the call of OpenGL.
"CVR Notes" Cardboard Android App Demo System Analysis Note one