const formatMessage = (level: number) =>
`The battery level is ${level}%`;
// iOS
const value = UIDevice.currentDevice.batteryLevel * 100;
// Android
const value = bm.getIntProperty(
BatteryManager.BATTERY_PROPERTY_CAPACITY
);
alert(formatMessage(value));
Native development for everyone
NativeScript lets you build fully native apps without sacrificing user experience, using a shared set of components that map directly to each platform's native UI building blocks.
Featured
Blackout Lighting Console
A DMX lighting control platform used by professionals across TV, film, and live events, built for iPad with NativeScript and direct access to native iOS capabilities.
High Fidelity Platform APIs with v8 and NativeScript
22:52
Customizing Native Elements on the Fly!
1:41