Native Device Info
Overview
This module helps in getting the device information, application information, Battery and power, Connectivity and Features, Display and Brightness, Storage Information, System Information and User and Usage Information.
Features:
Device Information:
• GetAndriodID
• GetAPILevel
• GetBaseOS
• GetBootloader
• GetBrand
• GetBuildNumber
• GetDevice
• GetDeviceID
• GetDeviceName
• GetDeviceToken
• GetDeviceType
• GetFingerprint
• GetHardware
• GetManufacturer
• GetProduct
• GetSystemName
• GetSystemVersion
• GetTotalMemory
Application Information:
• GetApplicationName
• GetBundleId
• GetFirstInstallTime
Battery and Power:
• GetBatteryLevel
• isBatteryCharging
Display and Brightness:
• GetBrightness
• GetDisplay
• isDisplayZoomed
Storage Information:
• GetFreeDiskStorage
• GetFreeDiskStorageOld
• GetTotalDiskCapacity
• GetTotalDiskCapacityOld
Connectivity and Features:
• GetCarrier
• GetCodename
• hasDynamicIsland
• hasGms
• hasHms
• hasNotch
• hasSystemFeature
• isAirplaneMode
• isCameraPresent
• isEmulator
• isHeadphonesConnected
• isLandscape
• isLocationEnabled
• isLowRamDevice
• isPinOrFingerprintSet
• getSystemAvailableFeatures
System Information:
• GetHost
• GetMaxMemory
• GetSecurityPatch
• PlatformOS
• supported32BitAbis
• supported64BitAbis
• supportedAbis
User and Usage Information:
• GetUserAgent
Documentation
Typical usage scenario
Native Device Info exposes 54 ready-made JavaScript actions
that read device, OS, hardware, storage, battery and connectivity details
inside a Mendix native mobile app. Each one drops straight into a nanoflow — no
native code, no bridging module, no Java or Objective-C.
Use it when your app needs to know something about the
device it is running on:
• Adapt the UI to the hardware. Check for a notch or a
Dynamic Island before positioning a fixed header; detect landscape orientation
or a zoomed display before choosing a layout.
• Gate features on capability. Confirm a camera is present
before showing a scan button, or check whether Google Mobile Services or Huawei
Mobile Services are available before calling a dependent service.
• Warn users before something fails. Read free disk space
before a large download, check whether airplane mode or location services are
off before a sync, or detect a low-RAM device before opening a heavy page.
• Support and diagnostics. Attach manufacturer, model, OS
version, build number, app version and API level to a support ticket or crash
report, so your helpdesk stops asking "what phone are you on?"
• Security and compliance posture. Detect an emulator,
confirm a PIN or fingerprint is set, or record the Android security patch level
for an audit trail.
• Battery-aware behaviour. Read the battery level and
charging state, then defer background sync when the device is low and
unplugged.
The problem it solves is reach: this information sits behind
React Native APIs that a low-code app cannot normally touch. Native Device Info
makes it available as ordinary nanoflow actions.
Features and limitations
54 JavaScript actions, grouped by what they tell you
• Device and hardware — Device Name, Device ID, Device Type,
Brand, Manufacturer, Model, Product, Hardware, Bootloader, Display,
Fingerprint, Host, Codename, Is Camera Present, Is Emulator, Is Low RAM Device
• Operating system — Platform OS, System Name, System
Version, Base OS, API Level, Security Patch, Supported ABIs, Supported 32-bit
ABIs, Supported 64-bit ABIs, Has System Feature, Get System Available Features
• Application — Application Name, Bundle ID, Build Number,
First Install Time, User Agent
• Storage and memory — Free Disk Storage, Total Disk
Capacity, Total Memory, Max Memory
• Battery — Battery Level, Is Battery Charging
• Screen and layout — Has Notch, Has Dynamic Island, Is
Landscape, Is Display Zoomed, Brightness
• Connectivity and services — Carrier, Is Airplane Mode, Is
Location Enabled, Is Headphones Connected, Has GMS, Has HMS
• Security — Is PIN or Fingerprint Set, Device Token
Platform coverage
Not every reading exists on both platforms — the underlying
OS decides. Of the 54 actions:
• 28 work on both iOS and Android — battery, storage,
memory, device name and type, brand, manufacturer, system name and version,
carrier, notch and Dynamic Island detection, orientation, emulator detection,
PIN/fingerprint check, and more.
• 22 are Android only — API level, Android ID, base OS,
bootloader, codename, display, fingerprint, hardware, host, max memory,
product, security patch, camera presence, GMS/HMS availability, system
features, airplane mode, low-RAM detection, and the 32-/64-bit ABI lists.
• 3 are iOS only — Brightness, Is Display Zoomed, and Device
Token (iOS 11.0+, physical devices only).
• Platform OS works everywhere and is the action to branch
on.
Every action documents its own platform support in Studio
Pro, so you can see the constraint at the point of use.
Limitations
• Native mobile only. These actions call React Native APIs.
They will not run in a web or responsive profile — only in a native mobile page
or nanoflow.
• Requires a custom native template. The module does not
ship a native dependency declaration, so react-native-device-info must be
present in your app's native template. See Installation — this is the single
most common cause of a failed first run.
• Calling an action on the wrong platform throws.
Unsupported actions reject rather than returning an empty value, so branch on
Platform OS first or wrap the call in error handling. This is deliberate — it
surfaces the mistake instead of hiding it behind a blank field.
• Device Token rejects on simulators. It needs iOS 11.0+ on
a physical device.
• Numeric values return as Decimal. Battery level arrives as
a fraction between 0 and 1, not a percentage — multiply by 100 for display.
• Two legacy variants are retained. Get Free Disk Storage
Old and Get Total Disk Capacity Old are kept for apps that depend on the
earlier calculation. New work should use the current versions.
Dependencies
• Mendix Studio Pro 10.24.17 or higher.
• A native mobile app — the actions have no effect in web or
responsive profiles.
Installation
1. In Studio Pro 10.24.17 or higher, open App Explorer >
Import module package and select NativeDeviceInfo.mpk.
2. Add the native dependency. Ensure
react-native-device-info is installed in the native template your app builds
against — through your custom developer app, your Native Builder configuration,
or your own fork of the Mendix Native Template. Without this step the actions
import successfully and compile, then fail at runtime on the device.
3. Rebuild your custom developer app or native binary so the
new dependency is bundled. The Make It Native app does not include
react-native-device-info, so testing there will fail regardless of
configuration.
4. In a native nanoflow, add a JavaScript action activity
and pick the action you need from NativeDeviceInfo.
If an action returns an error on device, check step 2 before
anything else — a missing native dependency accounts for most first-run
failures.
Configuration
There is nothing to configure. The actions take no
parameters, except:
• Has System Feature — pass the Android feature string to
test, for example android.hardware.camera.
Everything else is call-and-read.
Recommended pattern. Because roughly half the actions are
platform-specific, branch before you call:
1. Call Platform OS and store the result.
2. Split on the value — ios, android.
3. Call the platform-appropriate action on each branch.
Reading the values. Most actions return a String; battery
level, memory, storage and API level return a Decimal; the "is…" and
"has…" actions return a Boolean. Battery level is a fraction between
0 and 1.
Error handling. Set the JavaScript action activity's error
handling to Custom without rollback if you would rather show a friendly message
than let an unsupported-platform rejection interrupt the nanoflow.
Known bugs
• GetAndriodID is misspelled. The Android ID action is named
GetAndriodID rather than GetAndroidID. It works correctly; only the name is
wrong. It has been left as-is because renaming it would break existing
nanoflows.
Frequently Asked Questions
Does this work in a responsive web app?
No. These actions call React Native APIs and only run in native mobile pages and nanoflows.
Why does an action fail on the device when it compiles fine?
Almost always a missing native dependency.react-native-device-info has to be in the native template your app builds against — importing the module alone is not enough. See Installation, step 2.
Can I test this in Make It Native?
No. The Make It Native app does not bundle react-native-device-info. You need a custom developer app or a native build that includes it.
Why does an action throw instead of returning blank?
By design. Calling an Android-only action on iOS rejects with a clear message rather than silently returning an empty string, so the mistake surfaces during development instead of in production.
How do I know which actions run on which platform?
Each action documents its own platform support in Studio Pro. As a summary: 28 work on both, 22 are Android only, 3 are iOS only.
Battery level comes back as 0.87 — is that a bug?
No. It is a fraction between 0 and 1, matching the underlying API. Multiply by 100 to display a percentage.
What is the difference between Get Free Disk Storage and Get Free Disk Storage Old?
The "Old" variants preserve an earlier calculation and are kept for apps that already depend on it. Use the current versions fornew work.
Can I use this to uniquely identify a device?
Get Device ID and Get Android ID return device identifiers,but treat them as advisory — both platforms reset or scope these values under conditions outside your control, and storing them may carry privacy obligations in your jurisdiction.
Do I need any other Marketplace module first?
No. Native Device Info has no module dependencies.
Which Studio Pro versions are supported?
10.24.17 and higher. This release was rebuilt from 10.4.1 for the 10.24.17 LTS line.
I am on an earlier version — should I upgrade?
Yes. Versions before 2.0.1 shipped six actions — Get Application Name, Get Base OS, Get Battery Level, Get Bootloader, Get Brand and Get Build Number — that threw ReferenceError: Platform is not defined on every call. That is fixed in 2.0.1, and all 54 actions have been audited.
Issues, suggestions and feature requests:
Releases
**Native Device Info** — now supported on Mendix Studio Pro **10.24.17**
Rebuilt from Studio Pro 10.4.1 to **10.24.17** (LTS). No functional changes — this release only updates Studio Pro compatibility.
Import `NativeDeviceInfo.mpk` via *App Explorer > Import module package* in Studio Pro 10.24.17 or higher.
---
**Native Device Info**
This module helps in getting the device information, application information, Battery and power, Connectivity and Features, Display and Brightness, Storage Information, System Information and User and Usage Information.
**Features:**
**Device Information:**
• GetAndriodID - Gets the Android ID
• GetAPILevel - Gets the API level.
• GetBaseOS - The base OS build the product is based on.
• GetBootloader - The system bootloader version number.
• GetBrand - Gets the device brand.
• GetBuildNumber - Gets the application build number.
• GetDevice - The name of the industrial design.
• GetDeviceID - Gets the device ID.
• GetDeviceName - Gets the device name.
• GetDeviceToken - Gets the device token.
• GetDeviceType - Returns the device's type as a string, which will be one of:
o Handset o Tablet o Tv o Desktop o GamingConsole o unknown
• GetFingerprint - A string that uniquely identifies this build.
• GetHardware - The name of the hardware (from the kernel command line or /proc).
• GetManufacturer - Gets the device manufacturer.
• GetProduct - The name of the overall product.
• GetSystemName - Gets the device OS name.
• GetSystemVersion - Gets the device OS version.
• GetTotalMemory - Gets the device total memory, in bytes.
**Application Information:**
• GetApplicationName - Gets the application name.
• GetBundleId - Gets the application bundle identifier.
• GetFirstInstallTime - Gets the time at which the app was first installed, in milliseconds.
**Battery and Power:**
• GetBatteryLevel - Gets the battery level of the device as a float comprised between 0 and 1.
• isBatteryCharging - Tells if the battery is currently charging.
**Display and Brightness:**
• GetBrightness - Gets the current brightness level of the device's main screen. Currently iOS only. Returns a number between 0.0 and 1.0, inclusive.
• GetDisplay - A build ID string meant for displaying to the user.
• isDisplayZoomed - Tells if the user changed Display Zoom to Zoomed
**Storage Information:**
• GetFreeDiskStorage - Method that gets available storage size, in bytes, taking into account both root and data file systems calculation.
• GetFreeDiskStorageOld - Old implementation of method that gets available storage size, in bytes.
• GetTotalDiskCapacity - Method that gets full disk storage size, in bytes, taking into account both root and data file systems calculation.
• GetTotalDiskCapacityOld - Old implementation of method that gets full disk storage size, in bytes.
**Connectivity and Features:**
• GetCarrier - Gets the carrier name (network operator).
• GetCodename - The current development codename, or the string "REL" if this is a release build.
• hasDynamicIsland - Tells if the device has a dynamic island.
• hasGms - Tells if the device supports Google Mobile Services.
• hasHms - Tells if the device supports Huawei Mobile Services.
• hasNotch - Tells if the device has a notch.
• hasSystemFeature - Tells if the device has a specific system feature.
• isAirplaneMode - Tells if the device is in Airplane Mode.
• isCameraPresent - Tells if the device has any camera now.
• isEmulator - Tells if the application is running in an emulator.
• isHeadphonesConnected - Tells if the device is connected to wired headset or bluetooth headphones
• isLandscape - Tells if the device is currently in landscape mode.
• isLocationEnabled - Tells if the device has location services turned off at the device-level (NOT related to app-specific permissions)
• isLowRamDevice - Tells if the device has low RAM.
• isPinOrFingerprintSet - Tells if a PIN number or a fingerprint was set for the device.
• getSystemAvailableFeatures - Returns a list of available system features on Android in a comma separated string.
**System Information:**
• GetHost - Hostname
• GetMaxMemory - Returns the maximum amount of memory that the VM will attempt to use, in bytes.
• GetSecurityPatch - The user-visible security patch level.
• PlatformOS - Gets the platform OS.
• supported32BitAbis - An ordered list of 32 bit ABIs supported by this device in a comma separated string.
• supported64BitAbis - An ordered list of 64 bit ABIs supported by this device in a comma separated string.
• supportedAbis - Returns a list of supported processor architecture version in a comma separated string.
**User and Usage Information:**
• GetUserAgent - Gets the device User Agent.
**Issues, suggestions and feature requests**
[https://github.com/bharathidas/NativeDeviceInfo/issues](https://github.com/bharathidas/NativeDeviceInfo/issues)
**Screenshots:**



