Git Product home page Git Product logo

holonextnativesdk's Introduction

HoloNext Native SDK


WIP

Gradle


Before you start, must add the HoloNextNativeSDK as dependency to your app build.gradle;

dependencies {
    ...
    implementation 'com.holonext:HoloNextNativeSDK:1.0.0'
}

Usage


You can use HoloNext Native SDK in your project in two different ways.

1 - You can add it to your layout as follows ;
<fragment
        android:id="@+id/hnarViewerFragment"
        android:name="com.holonext.holonextnativesdk.HoloNextArViewer"
        android:layout_width="match_parent"
        android:layout_height="match_parent"
        app:hnar_renderer="DEFAULT"
        app:hnar_toolset="BASIC"/>

Then access fragment from the activity and call the init function after you set the API key;

...

//Get the fragment by id
HoloNextArViewer holoNextArViewer = (HoloNextArViewer)getSupportFragmentManager().findFragmentById(R.id.ArViewFragment);

//Set HoloNext Api Key by test api key.
holoNextArViewer.getHoloNextArConfig().setHnarApiKey(HoloNextArConfig.TestAPIKey);

//Initialize HoloNextArViewer
try {
    holoNextArViewer.init(sceneRelationId);
} catch (HolonextSdkInitializeException e) {
    e.printStackTrace();
}

sceneRelationId is an unique identifier for each model. These/this id(s) must be provided by HoloNextApi.Go to the HoloNextApi website.

2 - You can create fragment programmatically by creating ArConfig data.

You must to add implementation 'com.google.ar.sceneform.ux:sceneform-ux:1.15.0' as dependency to App's build.gradle.Otherwise you will encounter an error.

/// Programmatically create HoloNextArViewer fragment

//Create HoloNextArConfig and set the options and API key.
HoloNextArConfig arConfig = new HoloNextArConfig();
arConfig.setHnarApiKey(HoloNextArConfig.TestAPIKey);
arConfig.setHnarRendererType(RendererType.CUSTOM);
arConfig.setHnarToolsetType(ToolsetType.BASIC);

//Pass HoloNextArConfig instance as argument to the HoloNextArViewer.
HoloNextArViewer holoNextArViewer = new HoloNextArViewer(arConfig);
getSupportFragmentManager().beginTransaction()
        .add(android.R.id.content,holoNextArViewer).commit();

//Now , initialize HoloNextArViewer by 'sceneRelationId' and open the camera.
try {
    holoNextArViewer.init(sceneRelationId);
} catch (HolonextSdkInitializeException e) {
    e.printStackTrace();
}
For more details , you can check sample applications in samples folder or inspect API reference.

Limitations


  • The library able to use only default renderer for now.
  • The library able to use only basic toolset for now.

Changelog


  • 1.0.0
    • Released first version of library.

License


WIP

holonextnativesdk's People

Watchers

Naim Buru avatar Fatih avatar

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.