Giter VIP home page Giter VIP logo

meganekko's Introduction

Meganekko

Caution: This project is no longer being actively developed. Recommended alternative solution is GearVR Framework.

Gear VR Application Framework.

The aim of the project is to create an easy to use, lightweight, application framework for Gear VR. The library enables to write an app entirely in Java.

Features

Documentation

Usage

Add a dependency in your module's build.gradle.

dependencies {
    implementation 'org.meganekkovr:meganekko:3.2.1'
    implementation 'com.android.support:support-v4:27.0.1'
    implementation 'org.joml:joml:1.9.2'
    
    // Optional for org.meganekkovr.audio_engine.AudioEngine
    implementation 'com.google.vr:sdk-audio:1.101.0'
}

Click "Sync Now".

Note: Meganekko uses multi-view rendering. This feature is not working on prior Android M devices. See also https://developer3.oculus.com/documentation/mobilesdk/latest/concepts/release/

Hello World

Meganekko app is started from subclass of MeganekkoApp.

import org.meganekkovr.MeganekkoApp;

public class MyApp extends MeganekkoApp {

    @Override
    public void init() {
        super.init();
        // Init application here
    }
}

Create VR scene with XML. XML file can be localed from xml resource. For example: res/xml/scene.xml.

<scene>
    <view src="@layout/hello_world" position="0 0 -5" />
</scene>

@layout/hello_world is normal layout file put in res/layout/hello_world.xml.

<?xml version="1.0" encoding="utf-8"?>
<FrameLayout xmlns:android="http://schemas.android.com/apk/res/android"
    android:layout_width="match_parent"
    android:layout_height="match_parent">

    <TextView
        android:layout_width="wrap_content"
        android:layout_height="wrap_content"
        android:text="Hello World!"
        android:textColor="#fff" />
</FrameLayout>

Call setSceneFromXML in MyApp.

public class MyApp extends MeganekkoApp {

    @Override
    public void init() {
        super.init();
        setSceneFromXml(R.xml.scene); // Set scene
    }
}

You have to modify AndroidManifest. Add recommended attributes and elements. See Oculus developer document.

<application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:theme="@android:style/Theme.Black.NoTitleBar.Fullscreen">

    <!-- You have to declare to require Gear VR -->
    <meta-data
        android:name="com.samsung.android.vr.application.mode"
        android:value="vr_only" />

    <!-- Declare your App class extends MeganekkoApp -->
    <meta-data
        android:name="org.meganekkovr.App"
        android:value="org.meganekkovr.sample.MyApp"/>

    <activity
        android:name="org.meganekkovr.GearVRActivity"
        android:configChanges="orientation|screenSize|keyboard|keyboardHidden"
        android:excludeFromRecents="true"
        android:label="@string/app_name"
        android:launchMode="singleTask"
        android:screenOrientation="landscape">

        <!-- Only in debugging. Remove this when upload to Oculus Store. -->
        <intent-filter>
            <action android:name="android.intent.action.MAIN" />

            <category android:name="android.intent.category.LAUNCHER" />
        </intent-filter>

    </activity>
</application>

osig file is required to launch Meganekko app in Gear VR. See Oculus developer document for more information.

Put your osig file in app/src/main/assets.

That's all! Build, Connect Galaxy device to PC, install APK, and launch app. You will see white text "Hello World!".

Build from source

Open Android Studio with this repository. Select samplev3 from module list and click Run button.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.