Improving the basic app

Once we have the basic app ready, there are some things we can do to improve the overall working of the app:

  • Make the screen orientation fixed. If we leave it in auto-rotation mode, rotating the screen will cause the phone to lose the anchor and the model will disappear from the screen.
  • So far, we have seen that, for each screen tap, a new model appears. Since we are using the app for prototyping, the idea is that only one model is shown. 
  • We will also change the rotation and size of the model so that it's displayed better in the scene.

Let's change the code to add these features. For that, follow these steps:

  1.  Force the screen orientation so that it's in portrait mode by adding AndroidManifest.xml inside <application> ...

Get Enterprise Augmented Reality Projects now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.