SlideShare a Scribd company logo
Mario Bodemann
Android and Java Evangelist
@mariobodemann
@contentful
Virtual Reality in Android
API driven CMS, emphasis on content creation and delivery.
Virtual Reality in Android
Using Cardboard
What is
Cardboard?
● Easy to produce
● Available from
different companies
and in different
shapes
● can have a
button/lever/hole for
interaction
● only needs a smart
phone (Android/ios)
and an App
How does it work?
● Use 3D data and
movement to draw
two images: left and
right eye
● Distort images for
lenses
● Combine image to
scene in brain
Programming Cardboard
How do I program Cardboard?
https://developers.google.com/cardboard/android/
● SDKs available for
● Java
○ OpenGL
○ Pure Android
● Unity Plugin
○ Unity Engine (C# /JS)
○ Platform independent
○ No reliable linux development available
● Demo app
○ Find a box and
press the button
○ On github
● Library
○ jar distributed
with demo
repository
○ no maven
repository
How To: Android
Demo
https://github.com/googlesamples/cardboard-java
Setup of the demo
Activity
Model
Repository
OpenGL
Interaction
● All code in one
Activity
○ OpenGL code
○ Model creation
● Hard to expand on
Expanding on the demo
● App using above
code as base
● Expanding it to new
use cases
● Having fun exploring
Contentful
Cardboard Idea
https://github.com/contentful-labs/contentful-cardboard
https://play.google.com/apps/testing/com.contentful.cardboard
MVPR
Presenter
Model
Repository
OpenGL
Interaction
Interactor
Activity
(View)
VR
Renderer
● Split Activity into
several parts
● Improve modularity
● Improve testability
● Improve readability
● Improve line number
count ;)
Interactor
● Repository
abstraction
● Uses registered
Listener to inform
Presenter
● Live time of the
Presenter
public interface Interactor {
interface Listener {
void onModelReceived(ProtoModel model);
void onError(Throwable throwable);
}
void setListener(Listener listener);
void requestModels();
}
Presenter
● Coordinates
Interactor and View
● Enriches data from
Interactor
● Tells View to update
its models
public class Presenter implements
Interactor.Listener {
// … setup
private int received = 0;
@Override public void onModelReceived
(ProtoModel model) {
model.position[0] += received * 4.0f;
received++;
view.addProtoModel(model);
}
View
● Connects Renderer
and Presenter
● Takes models and
enqueues them in
the renderer
● Startup point for
Android app
● Deals with
interaction
public class MainActivity
extends CardboardActivity
implements CardboardView.StereoRenderer,
View {
@Override
public void onCreate(…) {
renderer = new CardboardRenderer(
getApplicationContext());
presenter = new Presenter(
new ContentfulInteractor(this));
presenter.bind(this);
}
@Override
public void onCardboardTrigger() {
vibrator.vibrate(25);
userInteracted();
View (cont.)
● Listens to Cardboard
Library callbacks
● For setup of a frame
● And rendering every
eye, redirecting it to
the renderer
@Override
public void onSurfaceCreated(…) {
renderer.surfaceCreated();
}
@Override
public void onNewFrame(
HeadTransform headTransform) {
renderer.prepare();
}
@Override
public void onDrawEye(Eye eye) {
float[] perspective = eye.getPerspective
(Z_NEAR, Z_FAR);
float[] eyeView = eye.getEyeView();
renderer.render(perspective, eyeView);
}
Renderer public class CardboardRenderer implements
Renderer {
@Override public void surfaceCreated() {
addFloorAndCeiling();
}
@Override public void prepare() {
addPendingModels();
glEnable(GL_DEPTH_TEST);
glEnable(GL_BLEND);
// … More gl* calls
}
● Abstracts from
OpenGL rendering
● Generates OpenGL
GPU Models
● Listens to View
@Override
public void render(float[] perspective,
float[] eyeView) {
multiplyMM(view, 0, eyeView, 0, camera,
0);
for (final Model model :
backgroundModels) {
renderModel(perspective, model);
}
for (final Model model :
foregroundModels) {
renderModel(perspective, model);
}
}
Renderer (cont.)
● Render all models
added
● Starting with
background objects,
since foreground
objects contain
transparency
Advantage of new system
Sample Challenge: How to change a texture?
● Change file
● Rerun tooling
● Re releasing new version in store
● Convince user to update
● Need technical person
● Potentially through several iterations
Purposal:
Using A CMS
● Change a asset
online
● Restart app to resync
data (done at
startup?)
● User only needs
network
● Can be done by non
technical person
Using A CMS
● Everything except for
the grid comes from
CMS
● Changing it with drag
and drop
● Changing VR content
from outside
Future
● Unit tests?
● Provide different Renderer VR/classic/engine code?
● CMS for Shader?
● A/B testing of in assets?
● Your ideas?
Future
Recap
Recap
● Cardboard is relatively easy to program and use
● Expanding from Google Demo is the key to success
● Using a CMS for VR
Questions and Answers

More Related Content

PPTX
Unity’s Artist Workflow Level Up | Liz Mercuri
PPTX
Build It, Rethink It, Tweak It, Rebuild it SLCC 2010
PDF
GayeHiggs SCH003
PDF
GayeHiggs SCH002
PPT
Opengl (1)
PDF
DrTAD Blender Tutorial Animation Basics - Change Object Color
PDF
GayeHiggs -SCH 001
PDF
Xwt, a cross-desktop UI library
Unity’s Artist Workflow Level Up | Liz Mercuri
Build It, Rethink It, Tweak It, Rebuild it SLCC 2010
GayeHiggs SCH003
GayeHiggs SCH002
Opengl (1)
DrTAD Blender Tutorial Animation Basics - Change Object Color
GayeHiggs -SCH 001
Xwt, a cross-desktop UI library

Viewers also liked (20)

PPTX
Building the Matrix: Your First VR App (SVCC 2016)
PDF
Как развить компанию, развивая себя (RU)
PPT
อ้างอิง
PDF
COMP 4026 Lecture2: Design and Prototype
PPTX
Royal Institution CS Materclass - Mobile/VR development
PPTX
Google cardboard
PPTX
Virtual reality startup in practice
PPTX
VR hardware & development
PPTX
Relaciones funciones
PDF
The Top 10 Lessons We Learned Moving Our Mobile Game to VR | Guy Bendov
PPTX
VR開発しくじり先生。JVRH2016で初めてVR開発、UE4で挑戦 東ゲ部ver
PPTX
Build HTML5 VR Apps using Intel® XDK
PPTX
Developing Your First Mobile VR App by NJ Realubit
PDF
COMP 4010 Lecture5 VR Audio and Tracking
PDF
Designing Outstanding AR Experiences
PPTX
PDF
VR, AI & The Future of Mobile
PDF
VR: The Future Is Now?
PDF
AR-VR Workshop
PDF
Virtual Reality 2.0
Building the Matrix: Your First VR App (SVCC 2016)
Как развить компанию, развивая себя (RU)
อ้างอิง
COMP 4026 Lecture2: Design and Prototype
Royal Institution CS Materclass - Mobile/VR development
Google cardboard
Virtual reality startup in practice
VR hardware & development
Relaciones funciones
The Top 10 Lessons We Learned Moving Our Mobile Game to VR | Guy Bendov
VR開発しくじり先生。JVRH2016で初めてVR開発、UE4で挑戦 東ゲ部ver
Build HTML5 VR Apps using Intel® XDK
Developing Your First Mobile VR App by NJ Realubit
COMP 4010 Lecture5 VR Audio and Tracking
Designing Outstanding AR Experiences
VR, AI & The Future of Mobile
VR: The Future Is Now?
AR-VR Workshop
Virtual Reality 2.0
Ad

Similar to Virtual Reality in Android (20)

PPTX
Virtual Reality Application Development on Android using Google Cardboard
PPTX
Developing Virtual Reality Application using Google Cardboard
PDF
Getting Started With Material Design
PPTX
Lecture 6 introduction to open gl and glut
PDF
Android Made Simple
PPTX
Google Glass Development Kit - Developer Zone
PDF
Tools for developing Android Games
PDF
Getting started with Verold and Three.js
PDF
Ball Collecting game report
PPTX
Google I/O 2019 - what's new in Android Q and Jetpack
PPTX
Visage Android Hands-on Lab
PDF
State of the Art OpenGL and Qt
 
PPTX
Jak vyvinout úspěšnou aplikaci pro Google Glass (Martin Pelant, eMan)
PPTX
Philipp Nagele (Wikitude): What's Next with Wikitude
PDF
React Native custom components
PDF
Convert Your Legacy OpenGL Code to Modern OpenGL with Qt
 
PPTX
從零開始學 Android
PDF
iOS for Android Developers (with Swift)
DOCX
Lab Practices and Works Documentation / Report on Computer Graphics
PDF
"JavaME + Android in action" CCT-CEJUG Dezembro 2008
Virtual Reality Application Development on Android using Google Cardboard
Developing Virtual Reality Application using Google Cardboard
Getting Started With Material Design
Lecture 6 introduction to open gl and glut
Android Made Simple
Google Glass Development Kit - Developer Zone
Tools for developing Android Games
Getting started with Verold and Three.js
Ball Collecting game report
Google I/O 2019 - what's new in Android Q and Jetpack
Visage Android Hands-on Lab
State of the Art OpenGL and Qt
 
Jak vyvinout úspěšnou aplikaci pro Google Glass (Martin Pelant, eMan)
Philipp Nagele (Wikitude): What's Next with Wikitude
React Native custom components
Convert Your Legacy OpenGL Code to Modern OpenGL with Qt
 
從零開始學 Android
iOS for Android Developers (with Swift)
Lab Practices and Works Documentation / Report on Computer Graphics
"JavaME + Android in action" CCT-CEJUG Dezembro 2008
Ad

Recently uploaded (20)

PPTX
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
PDF
Softaken Excel to vCard Converter Software.pdf
PPT
Introduction Database Management System for Course Database
PDF
Design an Analysis of Algorithms II-SECS-1021-03
PDF
Navsoft: AI-Powered Business Solutions & Custom Software Development
PPTX
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PDF
PTS Company Brochure 2025 (1).pdf.......
PDF
Understanding Forklifts - TECH EHS Solution
PPTX
Odoo POS Development Services by CandidRoot Solutions
PDF
Design an Analysis of Algorithms I-SECS-1021-03
PDF
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
PDF
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
PDF
System and Network Administration Chapter 2
PPTX
Introduction to Artificial Intelligence
PPTX
CHAPTER 12 - CYBER SECURITY AND FUTURE SKILLS (1) (1).pptx
PPTX
Online Work Permit System for Fast Permit Processing
PPTX
ISO 45001 Occupational Health and Safety Management System
PDF
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
PPTX
L1 - Introduction to python Backend.pptx
PDF
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)
Agentic AI Use Case- Contract Lifecycle Management (CLM).pptx
Softaken Excel to vCard Converter Software.pdf
Introduction Database Management System for Course Database
Design an Analysis of Algorithms II-SECS-1021-03
Navsoft: AI-Powered Business Solutions & Custom Software Development
Oracle E-Business Suite: A Comprehensive Guide for Modern Enterprises
PTS Company Brochure 2025 (1).pdf.......
Understanding Forklifts - TECH EHS Solution
Odoo POS Development Services by CandidRoot Solutions
Design an Analysis of Algorithms I-SECS-1021-03
Addressing The Cult of Project Management Tools-Why Disconnected Work is Hold...
Internet Downloader Manager (IDM) Crack 6.42 Build 42 Updates Latest 2025
System and Network Administration Chapter 2
Introduction to Artificial Intelligence
CHAPTER 12 - CYBER SECURITY AND FUTURE SKILLS (1) (1).pptx
Online Work Permit System for Fast Permit Processing
ISO 45001 Occupational Health and Safety Management System
T3DD25 TYPO3 Content Blocks - Deep Dive by André Kraus
L1 - Introduction to python Backend.pptx
SAP S4 Hana Brochure 3 (PTS SYSTEMS AND SOLUTIONS)

Virtual Reality in Android

  • 1. Mario Bodemann Android and Java Evangelist @mariobodemann @contentful Virtual Reality in Android
  • 2. API driven CMS, emphasis on content creation and delivery.
  • 3. Virtual Reality in Android Using Cardboard
  • 4. What is Cardboard? ● Easy to produce ● Available from different companies and in different shapes ● can have a button/lever/hole for interaction ● only needs a smart phone (Android/ios) and an App
  • 5. How does it work? ● Use 3D data and movement to draw two images: left and right eye ● Distort images for lenses ● Combine image to scene in brain
  • 7. How do I program Cardboard? https://developers.google.com/cardboard/android/ ● SDKs available for ● Java ○ OpenGL ○ Pure Android ● Unity Plugin ○ Unity Engine (C# /JS) ○ Platform independent ○ No reliable linux development available
  • 8. ● Demo app ○ Find a box and press the button ○ On github ● Library ○ jar distributed with demo repository ○ no maven repository How To: Android Demo https://github.com/googlesamples/cardboard-java
  • 9. Setup of the demo Activity Model Repository OpenGL Interaction ● All code in one Activity ○ OpenGL code ○ Model creation ● Hard to expand on
  • 11. ● App using above code as base ● Expanding it to new use cases ● Having fun exploring Contentful Cardboard Idea https://github.com/contentful-labs/contentful-cardboard https://play.google.com/apps/testing/com.contentful.cardboard
  • 12. MVPR Presenter Model Repository OpenGL Interaction Interactor Activity (View) VR Renderer ● Split Activity into several parts ● Improve modularity ● Improve testability ● Improve readability ● Improve line number count ;)
  • 13. Interactor ● Repository abstraction ● Uses registered Listener to inform Presenter ● Live time of the Presenter public interface Interactor { interface Listener { void onModelReceived(ProtoModel model); void onError(Throwable throwable); } void setListener(Listener listener); void requestModels(); }
  • 14. Presenter ● Coordinates Interactor and View ● Enriches data from Interactor ● Tells View to update its models public class Presenter implements Interactor.Listener { // … setup private int received = 0; @Override public void onModelReceived (ProtoModel model) { model.position[0] += received * 4.0f; received++; view.addProtoModel(model); }
  • 15. View ● Connects Renderer and Presenter ● Takes models and enqueues them in the renderer ● Startup point for Android app ● Deals with interaction public class MainActivity extends CardboardActivity implements CardboardView.StereoRenderer, View { @Override public void onCreate(…) { renderer = new CardboardRenderer( getApplicationContext()); presenter = new Presenter( new ContentfulInteractor(this)); presenter.bind(this); } @Override public void onCardboardTrigger() { vibrator.vibrate(25); userInteracted();
  • 16. View (cont.) ● Listens to Cardboard Library callbacks ● For setup of a frame ● And rendering every eye, redirecting it to the renderer @Override public void onSurfaceCreated(…) { renderer.surfaceCreated(); } @Override public void onNewFrame( HeadTransform headTransform) { renderer.prepare(); } @Override public void onDrawEye(Eye eye) { float[] perspective = eye.getPerspective (Z_NEAR, Z_FAR); float[] eyeView = eye.getEyeView(); renderer.render(perspective, eyeView); }
  • 17. Renderer public class CardboardRenderer implements Renderer { @Override public void surfaceCreated() { addFloorAndCeiling(); } @Override public void prepare() { addPendingModels(); glEnable(GL_DEPTH_TEST); glEnable(GL_BLEND); // … More gl* calls } ● Abstracts from OpenGL rendering ● Generates OpenGL GPU Models ● Listens to View
  • 18. @Override public void render(float[] perspective, float[] eyeView) { multiplyMM(view, 0, eyeView, 0, camera, 0); for (final Model model : backgroundModels) { renderModel(perspective, model); } for (final Model model : foregroundModels) { renderModel(perspective, model); } } Renderer (cont.) ● Render all models added ● Starting with background objects, since foreground objects contain transparency
  • 20. Sample Challenge: How to change a texture? ● Change file ● Rerun tooling ● Re releasing new version in store ● Convince user to update ● Need technical person ● Potentially through several iterations
  • 21. Purposal: Using A CMS ● Change a asset online ● Restart app to resync data (done at startup?) ● User only needs network ● Can be done by non technical person
  • 22. Using A CMS ● Everything except for the grid comes from CMS ● Changing it with drag and drop ● Changing VR content from outside
  • 24. ● Unit tests? ● Provide different Renderer VR/classic/engine code? ● CMS for Shader? ● A/B testing of in assets? ● Your ideas? Future
  • 25. Recap
  • 26. Recap ● Cardboard is relatively easy to program and use ● Expanding from Google Demo is the key to success ● Using a CMS for VR