DEV Community

Cover image for HowTo: Augmented Reality without ArCore -> kotlin + mobile sensors + Rx πŸ’₯ πŸš€
Mateusz for Netguru

Posted on

HowTo: Augmented Reality without ArCore -> kotlin + mobile sensors + Rx πŸ’₯ πŸš€

Augmented Reality

Do you ever wanted to play with AR a little but didn't want to dive deep into whole ARCore experience?
In our company as a part of R&D research we developed a little library that provides you with a view showing labels of the destinations provided by you. It's an open source project so you can contribute or write suggestions of new features at our repo

You can easily use it in your projects:

Using library

  1. Add repository in you projects build.gradle file

    repositories {
        maven {  url '' }
  2. Add library dependency

        dependencies {
                implementation 'com.netguru.arlocalizerview:arlocalizerview:0.1.0'
  3. Add view to your layout

  4. In in arLocalizerView onCreate method you need to provide

    interface ARLocalizerDependencyProvider {
        fun getSensorsContext(): Context
        fun getARViewLifecycleOwner(): LifecycleOwner
        fun getPermissionActivity(): Activity
    fun arLocalizerView.onCreate(arLocalizerDependencyProvider: ARLocalizerDependencyProvider)
  5. In order to process the permission request you need to provide permission results to the view.

        fun onRequestPermissionResult(
            requestCode: Int,
            permissions: Array<out String>,
            grantResults: IntArray
  6. Finally in order to display the destination labels on the camera preview use

    arLocalizerView.setDestinations(destinations: List<LocationData>)

Library in action!

Library in action
Library in action
Library in action

Top comments (0)