# Native Development

**URL:** https://forum.magicleap.cloud/c/native-development/140.md

[Latest](https://forum.magicleap.cloud/latest.md) · [Categories](https://forum.magicleap.cloud/categories.md) · [Tags](https://forum.magicleap.cloud/tags.md)

---

## [About the Native Development category](https://forum.magicleap.cloud/t/about-the-native-development-category/499)

<div class="topic-metadata">

**Author:** [@sengelman](https://forum.magicleap.cloud/u/sengelman)\
**Replies:** 0\
**Last updated:** [August 5, 2022, 7:25pm UTC](https://forum.magicleap.cloud/t/about-the-native-development-category/499 "2022-08-05T19:25:32Z")

</div>

Questions regarding developing with the Native SDK (C++) and Magic Leap 2. See our template Topic for information on an effective inquiry.

---

## [\[CMake\] Module path contamination when including Magic Leap SDK](https://forum.magicleap.cloud/t/cmake-module-path-contamination-when-including-magic-leap-sdk/6988)

<div class="topic-metadata">

**Author:** [@emaschino](https://forum.magicleap.cloud/u/emaschino)\
**Replies:** 0\
**Last updated:** [March 5, 2026, 9:20am UTC](https://forum.magicleap.cloud/t/cmake-module-path-contamination-when-including-magic-leap-sdk/6988 "2026-03-05T09:20:42Z")

</div>

Hi, I was having difficulties locating some third-party libraries with CMake. It took me some time to find that the problem arose since I’ve included Magic Leap SDK in my project. Long story short: Magic Leap SDK’s roo…

---

## [Capturing Cropped Image Based on Eye Gaze and Slider (Magic Leap SDK C API)](https://forum.magicleap.cloud/t/capturing-cropped-image-based-on-eye-gaze-and-slider-magic-leap-sdk-c-api/6194)

<div class="topic-metadata">

**Author:** [@dawar.khan977](https://forum.magicleap.cloud/u/dawar.khan977)\
**Replies:** 1\
**Last updated:** [August 20, 2025, 6:57pm UTC](https://forum.magicleap.cloud/t/capturing-cropped-image-based-on-eye-gaze-and-slider-magic-leap-sdk-c-api/6194 "2025-08-20T18:57:49Z")

</div>

Give us as much detail as possible regarding the issue you’re experiencing. ML2 OS version: MLSDK version: v1.12.0 Host OS: (Windows/MacOS) Hi Magic Leap Developers, I’m working on a project using the Magic Leap SDK…

---

## [Application lifecycle management](https://forum.magicleap.cloud/t/application-lifecycle-management/5343)

<div class="topic-metadata">

**Author:** [@emaschino](https://forum.magicleap.cloud/u/emaschino)\
**Replies:** 6\
**Last updated:** [March 14, 2025, 4:37pm UTC](https://forum.magicleap.cloud/t/application-lifecycle-management/5343 "2025-03-14T16:37:14Z")

</div>

Hi, When inside my app, pressing the Home button on the ML2 controller makes the app go through the Android APP\_CMD\_PAUSE, APP\_CMD\_TERM\_WINDOW and APP\_CMD\_STOP status, as expected. Back on the Home Menu, my app is still…

---

## [Export textured mesh or point cloud of the scanned sapce from MagicLeap2](https://forum.magicleap.cloud/t/export-textured-mesh-or-point-cloud-of-the-scanned-sapce-from-magicleap2/2516)

<div class="topic-metadata">

**Author:** [@shayan](https://forum.magicleap.cloud/u/shayan)\
**Replies:** 6\
**Last updated:** [January 15, 2025, 9:21pm UTC](https://forum.magicleap.cloud/t/export-textured-mesh-or-point-cloud-of-the-scanned-sapce-from-magicleap2/2516 "2025-01-15T21:21:58Z")

</div>

A MagicLeap beginner user here. I want to export the scanned space from the local spaces. I could export the spatial map using ADB shell: adb shell mlmapping -export\_space “map name” but it only exports a \*.map file. …

---

## [MLWorldCameraFrame.camera\_pose to Unity mapping](https://forum.magicleap.cloud/t/mlworldcameraframe-camera-pose-to-unity-mapping/4830)

<div class="topic-metadata">

**Author:** [@LeapFrog](https://forum.magicleap.cloud/u/LeapFrog)\
**Replies:** 9\
**Last updated:** [January 9, 2025, 4:53pm UTC](https://forum.magicleap.cloud/t/mlworldcameraframe-camera-pose-to-unity-mapping/4830 "2025-01-09T16:53:20Z")

</div>

Hola, ML2 OS version: 1.10.0 MLSDK version: 1.10.0 Host OS: Win We use the World Camera images to reconstruct poses of our custom marker in the world camera frame. The mapping from the camera frame to the world frame…

---

## [How to Add Audio Play to my app in Android Studio](https://forum.magicleap.cloud/t/how-to-add-audio-play-to-my-app-in-android-studio/4843)

<div class="topic-metadata">

**Author:** [@Xinyu](https://forum.magicleap.cloud/u/Xinyu)\
**Replies:** 1\
**Last updated:** [December 19, 2024, 9:00pm UTC](https://forum.magicleap.cloud/t/how-to-add-audio-play-to-my-app-in-android-studio/4843 "2024-12-19T21:00:52Z")

</div>

I am developing an app using native development in Android Studio, and I would like to add functionality for streaming WAV files. Specifically, WAV files are generated in real-time and need to be played sequentially on t…

---

## [MLCameraIntrinsicCalibrationParameters high reprojection error](https://forum.magicleap.cloud/t/mlcameraintrinsiccalibrationparameters-high-reprojection-error/4689)

<div class="topic-metadata">

**Author:** [@LeapFrog](https://forum.magicleap.cloud/u/LeapFrog)\
**Replies:** 6\
**Last updated:** [December 18, 2024, 3:13pm UTC](https://forum.magicleap.cloud/t/mlcameraintrinsiccalibrationparameters-high-reprojection-error/4689 "2024-12-18T15:13:24Z")

</div>

Hooyah, ML2 OS version: 1.10.0 MLSDK version: 1.10.0 Host OS: Win The PNP reprojection error seems too high, especially at the image borders when using the intrinsics provided by MLCameraResultExtras/MLCameraIntrinsi…

---

## [Magic Leap Assist app source code](https://forum.magicleap.cloud/t/magic-leap-assist-app-source-code/4688)

<div class="topic-metadata">

**Author:** [@s.ewak](https://forum.magicleap.cloud/u/s.ewak)\
**Replies:** 2\
**Last updated:** [December 2, 2024, 11:00pm UTC](https://forum.magicleap.cloud/t/magic-leap-assist-app-source-code/4688 "2024-12-02T23:00:12Z")

</div>

Hello, We're working on a Magic Leap 2 project requiring remote assist capabilities. The Magic Leap Assist app is great feature-wise, however, we did encounter some issues. Since "Magic Leap Assist is designed as a pi…

---

## [Run Android app with java code in ML Application Simulator from ML Hub](https://forum.magicleap.cloud/t/run-android-app-with-java-code-in-ml-application-simulator-from-ml-hub/4619)

<div class="topic-metadata">

**Author:** [@ashak](https://forum.magicleap.cloud/u/ashak)\
**Replies:** 3\
**Last updated:** [November 14, 2024, 4:32pm UTC](https://forum.magicleap.cloud/t/run-android-app-with-java-code-in-ml-application-simulator-from-ml-hub/4619 "2024-11-14T16:32:53Z")

</div>

Give us as much detail as possible regarding the issue you're experiencing. ML2 OS version: - Run in ML App Simulator Zi run time MLSDK version: - 1.10.0 Host OS: (Windows/MacOS) - Windows 10 Android Studio: Electric…

---

## [Sporadic stacktrace with native meshing API](https://forum.magicleap.cloud/t/sporadic-stacktrace-with-native-meshing-api/4603)

<div class="topic-metadata">

**Author:** [@simon.zeni](https://forum.magicleap.cloud/u/simon.zeni)\
**Replies:** 0\
**Last updated:** [November 10, 2024, 9:27pm UTC](https://forum.magicleap.cloud/t/sporadic-stacktrace-with-native-meshing-api/4603 "2024-11-10T21:27:53Z")

</div>

This comes in pair with the other issue 1 I opened about the OpenXR counterpart I finally managed to get some geometry rendered using the native meshing API, but I often see sporadic stacktracer in the android log. This…

---

## [Lab Streaming Layer Build for Magic Leap](https://forum.magicleap.cloud/t/lab-streaming-layer-build-for-magic-leap/4279)

<div class="topic-metadata">

**Author:** [@x11](https://forum.magicleap.cloud/u/x11)\
**Replies:** 2\
**Last updated:** [September 25, 2024, 2:06pm UTC](https://forum.magicleap.cloud/t/lab-streaming-layer-build-for-magic-leap/4279 "2024-09-25T14:06:03Z")

</div>

Hi there, I want to use the Lab Streaming Layer (LSL) but can't seem to find a way to build it for the x64\_x86 arch of the Magic Leap 2. Did anyone happen to do this for themselves at any point/would anyone with the tech…

---

## [How to save Meshes from ML2 Meshing sample OR the Spaces app?](https://forum.magicleap.cloud/t/how-to-save-meshes-from-ml2-meshing-sample-or-the-spaces-app/4040)

<div class="topic-metadata">

**Author:** [@dawar.khan977](https://forum.magicleap.cloud/u/dawar.khan977)\
**Replies:** 4\
**Last updated:** [September 4, 2024, 7:51am UTC](https://forum.magicleap.cloud/t/how-to-save-meshes-from-ml2-meshing-sample-or-the-spaces-app/4040 "2024-09-04T07:51:35Z")

</div>

Hi everyone, I am currently working on a project where I need to save the meshing results as an OBJ file after scanning a space or object using the Magic Leap 2 SDK. The meshing sample and/or the spaces app are the good…

---

## [Camera stream access](https://forum.magicleap.cloud/t/camera-stream-access/3923)

<div class="topic-metadata">

**Author:** [@liza](https://forum.magicleap.cloud/u/liza)\
**Replies:** 8\
**Last updated:** [August 15, 2024, 4:05pm UTC](https://forum.magicleap.cloud/t/camera-stream-access/3923 "2024-08-15T16:05:06Z")

</div>

We're developing a new kind of infrastructure SW for AR glasses (not an app). To do that we need the following: the ability to access the camera stream the ratio between the camera and the screen (=a number) the abilit…

---

## [About developing an App on Android Studio that can interact with a LLM locally](https://forum.magicleap.cloud/t/about-developing-an-app-on-android-studio-that-can-interact-with-a-llm-locally/3821)

<div class="topic-metadata">

**Author:** [@Xinyu](https://forum.magicleap.cloud/u/Xinyu)\
**Replies:** 8\
**Last updated:** [July 23, 2024, 4:20pm UTC](https://forum.magicleap.cloud/t/about-developing-an-app-on-android-studio-that-can-interact-with-a-llm-locally/3821 "2024-07-23T16:20:30Z")

</div>

Give us as much detail as possible regarding the issue you're experiencing. ML2 OS version: MLSDK version: Host OS: Windows I tried using a tool “llama.cop” from GitHub to employ LLM like Llama2 in Magic Leap 2, but …

---

## [How to use LibTorch to run a LLM on Magic Leap](https://forum.magicleap.cloud/t/how-to-use-libtorch-to-run-a-llm-on-magic-leap/3820)

<div class="topic-metadata">

**Author:** [@Xinyu](https://forum.magicleap.cloud/u/Xinyu)\
**Replies:** 1\
**Last updated:** [July 22, 2024, 5:05pm UTC](https://forum.magicleap.cloud/t/how-to-use-libtorch-to-run-a-llm-on-magic-leap/3820 "2024-07-22T17:05:49Z")

</div>

Give us as much detail as possible regarding the issue you're experiencing. ML2 OS version: MLSDK version: Host OS: Windows After cloning LibTorch on my Windows computer, I don't know how to link it to my project on …

---

## [Capture Image of world camera](https://forum.magicleap.cloud/t/capture-image-of-world-camera/3566)

<div class="topic-metadata">

**Author:** [@showyoumyfee](https://forum.magicleap.cloud/u/showyoumyfee)\
**Replies:** 4\
**Last updated:** [May 28, 2024, 2:22pm UTC](https://forum.magicleap.cloud/t/capture-image-of-world-camera/3566 "2024-05-28T14:22:36Z")

</div>

Give us as much detail as possible regarding the issue you're experiencing. ML2 OS version: 1.7.0 MLSDK version:1.7.0 Host OS: Windows Error messages from logs (syntax-highlighting is supported via Markdown): I‘m ne…

---

## [\[CMake\] Project contamination when including Magic Leap SDK](https://forum.magicleap.cloud/t/cmake-project-contamination-when-including-magic-leap-sdk/3366)

<div class="topic-metadata">

**Author:** [@emaschino](https://forum.magicleap.cloud/u/emaschino)\
**Replies:** 6\
**Last updated:** [May 22, 2024, 1:26pm UTC](https://forum.magicleap.cloud/t/cmake-project-contamination-when-including-magic-leap-sdk/3366 "2024-05-22T13:26:15Z")

</div>

Hi, I was fightning with strange errors in my code. Until I've noticed that the project-related variables I'm relying upon for various tasks in my own CMakeLists.txt were all referring to Magic Leap SDK-related things. …

---

## [Strange blue lines appearing in processed RGB camera feed](https://forum.magicleap.cloud/t/strange-blue-lines-appearing-in-processed-rgb-camera-feed/3440)

<div class="topic-metadata">

**Author:** [@coop](https://forum.magicleap.cloud/u/coop)\
**Replies:** 4\
**Last updated:** [May 10, 2024, 5:37am UTC](https://forum.magicleap.cloud/t/strange-blue-lines-appearing-in-processed-rgb-camera-feed/3440 "2024-05-10T05:37:11Z")

</div>

Give us as much detail as possible regarding the issue you're experiencing. ML2 OS version: 1.4 MLSDK version: 1.6.0 Host OS: (Windows/MacOS) Windows 10 Error messages from logs (syntax-highlighting is supported via …

---

## [How to connect a USB CDC device](https://forum.magicleap.cloud/t/how-to-connect-a-usb-cdc-device/3486)

<div class="topic-metadata">

**Author:** [@dhedin](https://forum.magicleap.cloud/u/dhedin)\
**Replies:** 1\
**Last updated:** [May 1, 2024, 4:39pm UTC](https://forum.magicleap.cloud/t/how-to-connect-a-usb-cdc-device/3486 "2024-05-01T16:39:40Z")

</div>

Give us as much detail as possible regarding the issue you're experiencing. ML2 OS version: 1.5 MLSDK version: 1.5 Host OS: Windows I need to connect a USB CDC device that streams data to the Magic Leap 2. I know thi…

---

## [How to save data to the ML2 Filesystem](https://forum.magicleap.cloud/t/how-to-save-data-to-the-ml2-filesystem/3260)

<div class="topic-metadata">

**Author:** [@jvivernois2](https://forum.magicleap.cloud/u/jvivernois2)\
**Replies:** 5\
**Last updated:** [March 26, 2024, 1:57am UTC](https://forum.magicleap.cloud/t/how-to-save-data-to-the-ml2-filesystem/3260 "2024-03-26T01:57:29Z")

</div>

ML2 OS version: 1.4.1 MLSDK version: 1.5.0 Host OS: MacOS Hello, I am currently developing my first App for the ML2 and struggle at some points. Currently I try saving the Frames from the Depth Camera and the Data fr…

---

## [Help Needed with Gaze and Head Tracking for 2D Android Application on ML2](https://forum.magicleap.cloud/t/help-needed-with-gaze-and-head-tracking-for-2d-android-application-on-ml2/2858)

<div class="topic-metadata">

**Author:** [@usman.bashir](https://forum.magicleap.cloud/u/usman.bashir)\
**Replies:** 9\
**Last updated:** [March 25, 2024, 6:24pm UTC](https://forum.magicleap.cloud/t/help-needed-with-gaze-and-head-tracking-for-2d-android-application-on-ml2/2858 "2024-03-25T18:24:42Z")

</div>

Hello Community, I'm working on a native 2D Android application for Magic Leap 2 and I am interested in integrating gaze and head tracking to control the UI. The goal is to enable users to interact with the application—…

---

## [Camera Data Formatting and Pixel Modification](https://forum.magicleap.cloud/t/camera-data-formatting-and-pixel-modification/3292)

<div class="topic-metadata">

**Author:** [@ben1](https://forum.magicleap.cloud/u/ben1)\
**Replies:** 1\
**Last updated:** [March 25, 2024, 5:01pm UTC](https://forum.magicleap.cloud/t/camera-data-formatting-and-pixel-modification/3292 "2024-03-25T17:01:20Z")

</div>

ML2 OS version: 1.4.1 MLSDK version: v1.5.0 Host OS: Windows 11 Error messages from logs (syntax-highlighting is supported via Markdown): NA Hi there, I have been working through c-api samples trying to acquire raw …

---

## [How to connect a device through USB-C port?](https://forum.magicleap.cloud/t/how-to-connect-a-device-through-usb-c-port/3017)

<div class="topic-metadata">

**Author:** [@coop](https://forum.magicleap.cloud/u/coop)\
**Replies:** 12\
**Last updated:** [March 11, 2024, 7:15pm UTC](https://forum.magicleap.cloud/t/how-to-connect-a-device-through-usb-c-port/3017 "2024-03-11T19:15:57Z")

</div>

ML2 OS version: 1.4 MLSDK version: 1.4.0 Host OS: Windows I want to connect a camera through the USB-C port on the Magic Leap and be able to access the data from the camera in a native app. I tried testing this by con…

---

## [Can you apply segmented dimming to parts of a frame using the C-API?](https://forum.magicleap.cloud/t/can-you-apply-segmented-dimming-to-parts-of-a-frame-using-the-c-api/3230)

<div class="topic-metadata">

**Author:** [@irene.hougard](https://forum.magicleap.cloud/u/irene.hougard)\
**Replies:** 1\
**Last updated:** [February 26, 2024, 5:39pm UTC](https://forum.magicleap.cloud/t/can-you-apply-segmented-dimming-to-parts-of-a-frame-using-the-c-api/3230 "2024-02-26T17:39:55Z")

</div>

Hello! Is there a way to apply segmented dimming to only some of the elements in a frame using the C-API? It seems like this is possible in Unity (Unity Segmented Dimming Documentation), but the C-API documentation impl…

---

## [How do I create a new project?](https://forum.magicleap.cloud/t/how-do-i-create-a-new-project/3154)

<div class="topic-metadata">

**Author:** [@ash](https://forum.magicleap.cloud/u/ash)\
**Replies:** 2\
**Last updated:** [February 9, 2024, 6:26am UTC](https://forum.magicleap.cloud/t/how-do-i-create-a-new-project/3154 "2024-02-09T06:26:04Z")

</div>

I've successfully, launched the "hello\_xr" project, but now I want to start from complete zero with minimum compilable project structure. How do I create empty native / OpenXR (?) project for Magic Leap 2.

---

## [Eye Tracking Without Calibration](https://forum.magicleap.cloud/t/eye-tracking-without-calibration/3125)

<div class="topic-metadata">

**Author:** [@jimmy.haviland](https://forum.magicleap.cloud/u/jimmy.haviland)\
**Replies:** 1\
**Last updated:** [February 5, 2024, 10:23pm UTC](https://forum.magicleap.cloud/t/eye-tracking-without-calibration/3125 "2024-02-05T22:23:29Z")

</div>

Hi there! For various reasons, we are unable to use the MagicLeap Eye Calibration process in our workflow. There is currently no handsfree option which is a requirement for our application, and even if there were, it's n…

---

## [MSAA antialiasing in native C++](https://forum.magicleap.cloud/t/msaa-antialiasing-in-native-c/3065)

<div class="topic-metadata">

**Author:** [@falken](https://forum.magicleap.cloud/u/falken)\
**Replies:** 4\
**Last updated:** [January 30, 2024, 7:57pm UTC](https://forum.magicleap.cloud/t/msaa-antialiasing-in-native-c/3065 "2024-01-30T19:57:55Z")

</div>

Hello, We're creating an app for the ML2, which a portion of our rendering draws a grid of evenly spaced lines placed on the ground plane. Currently we do the grid rendering using a mesh of triangles, with a simple ml:…

---

## [Using OpenXR API, the QR code contents occasionally are being read incorrectly and distinct atoms are returned for the same qr code](https://forum.magicleap.cloud/t/using-openxr-api-the-qr-code-contents-occasionally-are-being-read-incorrectly-and-distinct-atoms-are-returned-for-the-same-qr-code/2977)

<div class="topic-metadata">

**Author:** [@a.nourinia](https://forum.magicleap.cloud/u/a.nourinia)\
**Replies:** 4\
**Last updated:** [December 19, 2023, 5:59pm UTC](https://forum.magicleap.cloud/t/using-openxr-api-the-qr-code-contents-occasionally-are-being-read-incorrectly-and-distinct-atoms-are-returned-for-the-same-qr-code/2977 "2023-12-19T17:59:32Z")

</div>

I wanted to check if there is a bug in the implementation of the OpenXR based QR code tracking or if I am not using it correctly. The problem that I am experiencing is two folds: Using the OpenXR Api for Marker Track…

---

## [Workaround to develop on a Linux machine](https://forum.magicleap.cloud/t/workaround-to-develop-on-a-linux-machine/2885)

<div class="topic-metadata">

**Author:** [@leesingchun](https://forum.magicleap.cloud/u/leesingchun)\
**Replies:** 7\
**Last updated:** [December 5, 2023, 10:00pm UTC](https://forum.magicleap.cloud/t/workaround-to-develop-on-a-linux-machine/2885 "2023-12-05T22:00:34Z")

</div>

Does anyone know if there is a workaround to develop on a Linux machine? I just want to confirm if buying another $2k Win/Mac machine is the only option after buying the $3.5k device. Thanks a lot!

[Next page](https://forum.magicleap.cloud/c/native-development/140.md?page=1)
