Skip to main content

tizen_interop 0.1.0 copy "tizen_interop: ^0.1.0" to clipboard
tizen_interop: ^0.1.0 copied to clipboard

outdated

Provides Dart bindings and utility functions for using Tizen native APIs.

tizen_interop #

This package provides Dart bindings and utility functions for using Tizen native APIs.

⚠️Caution: This package is currently under testing and not intended for production use. Some APIs may be missing or have errors.

Usage #

To use this package, add ffi and tizen_interop as dependencies in your pubspec.yaml file.

dependencies:
  ffi: ^1.1.2
  tizen_interop: ^0.1.0

Then, import package:ffi/ffi.dart and package:tizen_interop/[TIZEN_VERSION]/tizen.dart in your Dart code.

import 'package:ffi/ffi.dart';
import 'package:tizen_interop/4.0/tizen.dart';

Examples #

// Getting a string value from the Native API.
// Prefer using `arena` to allocate memory because it frees the memory
// automatically when the `using` block ends.
final appName = using((Arena arena) {
  Pointer<Pointer<Int8>> ppStr = arena();
  if (tizen.app_get_name(ppStr) == 0) {
    // The memory allocated by the Native API must be freed by the caller.
    arena.using(ppStr.value, calloc.free);
    return ppStr.value.toDartString();
  }
});

// Getting an integer value from the Native API.
final memSize = using((Arena arena) {
  Pointer<Int32> pMemSize = arena();
  if (tizen.runtime_info_get_physical_memory_size(pMemSize) == 0) {
    return pMemSize.value;
  }
});

// Getting a struct value from the Native API.
final memInfo = using((Arena arena) {
  Pointer<runtime_memory_info_s> pMemInfo = arena();
  if (tizen.runtime_info_get_system_memory_info(pMemInfo) == 0) {
    return pMemInfo.ref;
  }
});

// Passing a string value to the Native API.
final modelName = using((Arena arena) {
  Pointer<Pointer<Int8>> ppStr = arena();
  // The memory allocated by the `toNativeInt8` method must be freed by
  // the caller. The `arena` allocator will free it automatically.
  final key =
      'http://tizen.org/system/model_name'.toNativeInt8(allocator: arena);
  if (tizen.system_info_get_platform_string(key, ppStr) == 0) {
    arena.using(ppStr.value, calloc.free);
    return ppStr.value.toDartString();
  }
});

Building from source #

Install the following packages using Tizen Package Manager.

  • IOT-Headed-4.0-NativeAppDevelopment-CLI
  • IOT-Headed-5.0-NativeAppDevelopment-CLI
  • IOT-Headed-5.5-NativeAppDevelopment-CLI
  • IOT-Headed-6.0-NativeAppDevelopment-CLI
  • IOT-Headed-6.5-NativeAppDevelopment-CLI

Then, run script files as follows. Dart bindings (lib/src/.../generated_bindings.dart) will be regenerated by ffigen.

./scripts/copy_rootstraps.sh
./scripts/generate_bindings.sh

Supported APIs #

This package provides bindings of the following APIs of Tizen IoT-Headed profile:

Note: UI and WebView related APIs are not provided.

Category Sub Category Tizen 4.0 Tizen 5.0 Tizen 5.5 Tizen 6.0 Tizen 6.5
Account Account Manager ✔ ✔ ✔ ✔
FIDO Client ✔ ✔ ✔ ✔
Account Manager ✔ ✔ ✔ ✔
OAuth 2.0 ✔ ✔ ✔ ✔
Sync Manager ✔ ✔ ✔ ✔
Application Framework Application ✔ ✔ ✔ ✔ ✔
Alarm ✔ ✔ ✔ ✔ ✔
App Common ✔ ✔ ✔ ✔ ✔
App Control ✔ ✔ ✔ ✔ ✔
App Control URI ✔
Event ✔ ✔ ✔ ✔ ✔
Internationalization ✔ ✔ ✔ ✔ ✔
Job scheduler ✔ ✔ ✔ ✔
Preference ✔ ✔ ✔ ✔ ✔
Resource Manager ✔ ✔ ✔ ✔ ✔
Application Manager ✔ ✔ ✔ ✔ ✔
Badge ✔ ✔ ✔ ✔ ✔
Bundle ✔ ✔ ✔ ✔ ✔
Cion ✔
Data Control ✔ ✔ ✔ ✔ ✔
Message Port ✔ ✔ ✔ ✔ ✔
Notification ✔ ✔ ✔ ✔ ✔
Notification EX ✔ ✔ ✔
Package Manager ✔ ✔ ✔ ✔ ✔
RPC Port ✔ ✔ ✔ ✔
Service Application ✔ ✔ ✔ ✔ ✔
Shortcut ✔ ✔ ✔ ✔ ✔
Base Common Error ✔ ✔ ✔ ✔ ✔
Content Download ✔ ✔ ✔ ✔ ✔
MIME Type ✔ ✔ ✔ ✔ ✔
Media Content ✔ ✔ ✔ ✔ ✔
Activity Recognition ✔ ✔ ✔
Contextual History ✔ ✔ ✔ ✔
Contextual Trigger ✔ ✔ ✔ ✔
Gesture Recognition ✔ ✔ ✔
Location Geofence Manager ✔ ✔ ✔ ✔
Location Manager ✔ ✔ ✔ ✔
Machine Learning Pipeline ✔
Single ✔
Trainer ✔
Messaging Email ✔ ✔ ✔ ✔ ✔
Messages ✔ ✔
Push ✔ ✔ ✔ ✔
Multimedia Audio I/O ✔ ✔ ✔ ✔ ✔
Camera ✔ ✔ ✔ ✔ ✔
Image Util ✔ ✔ ✔ ✔
Media Codec ✔ ✔ ✔ ✔ ✔
Media Controller ✔ ✔ ✔ ✔ ✔
Media Demuxer ✔ ✔ ✔ ✔ ✔
Media Muxer ✔ ✔ ✔ ✔ ✔
Media Streamer ✔ ✔ ✔ ✔ ✔
Media Tool ✔ ✔ ✔ ✔ ✔
Media Vision ✔ ✔ ✔ ✔
Metadata Editor ✔ ✔ ✔ ✔ ✔
Metadata Extractor ✔ ✔ ✔ ✔ ✔
Player ✔ ✔ ✔ ✔ ✔
Radio ✔ ✔ ✔ ✔
Recorder ✔ ✔ ✔ ✔ ✔
Screen Mirroring ✔ ✔ ✔ ✔
Sound Manager ✔ ✔ ✔ ✔ ✔
Sound Pool ✔ ✔ ✔ ✔ ✔
StreamRecorder ✔ ✔ ✔ ✔ ✔
Thumbnail Util ✔ ✔ ✔ ✔ ✔
Tone Player ✔ ✔ ✔ ✔ ✔
Video Util ✔
WAV Player ✔ ✔ ✔ ✔ ✔
WebRTC ✔
Network Application Service Platform ✔ ✔ ✔ ✔
Bluetooth ✔ ✔ ✔ ✔ ✔
Connection ✔ ✔ ✔ ✔ ✔
DNSSD ✔ ✔ ✔ ✔ ✔
HTTP ✔ ✔ ✔ ✔
IoTCon ✔ ✔ ✔ ✔ ✔
MTP ✔ ✔ ✔ ✔ ✔
SSDP ✔ ✔ ✔ ✔ ✔
Smart Traffic Control ✔ ✔ ✔ ✔
Smartcard ✔ ✔
SoftAP ✔ ✔ ✔ ✔
VPN Service ✔ ✔ ✔ ✔
Wi-Fi Manager ✔ ✔ ✔ ✔ ✔
Wi-Fi Direct ✔ ✔ ✔ ✔
Security CSR ✔ ✔ ✔ ✔ ✔
Device Certificate Manager ✔ ✔ ✔ ✔
Device Policy Manager ✔ ✔ ✔ ✔ ✔
Key Manager ✔ ✔ ✔ ✔ ✔
Privacy Privilege Manager ✔ ✔ ✔ ✔ ✔
Privilege Info ✔ ✔ ✔ ✔ ✔
YACA ✔ ✔ ✔ ✔ ✔
Social Calendar ✔ ✔ ✔ ✔ ✔
Contacts ✔ ✔ ✔ ✔ ✔
Phonenumber utils ✔ ✔ ✔ ✔ ✔
System Device ✔ ✔ ✔ ✔ ✔
Diagnostics ✔ ✔
Dlog ✔ ✔ ✔ ✔ ✔
Feedback ✔ ✔ ✔ ✔ ✔
Media key ✔ ✔ ✔ ✔ ✔
Peripheral IO ✔ ✔ ✔ ✔ ✔
Runtime information ✔ ✔ ✔ ✔ ✔
Sensor ✔ ✔ ✔ ✔ ✔
Storage ✔ ✔ ✔ ✔ ✔
System Information ✔ ✔ ✔ ✔ ✔
System Settings ✔ ✔ ✔ ✔ ✔
T-trace ✔ ✔ ✔ ✔ ✔
USB Host ✔ ✔ ✔ ✔ ✔
Telephony Telephony Information ✔
UI Clipboard History Manager ✔ ✔ ✔ ✔ ✔
External Output Manager ✔ ✔ ✔ ✔ ✔
TBM Surface ✔ ✔ ✔ ✔ ✔
UIX Autofill ✔ ✔ ✔
Input Method ✔ ✔ ✔ ✔ ✔
Input Method Manager ✔ ✔ ✔ ✔ ✔
Multi assistant ✔ ✔ ✔ ✔
STT ✔ ✔ ✔ ✔ ✔
STT Engine ✔ ✔ ✔ ✔ ✔
TTS ✔ ✔ ✔ ✔ ✔
TTS Engine ✔ ✔ ✔ ✔ ✔
Voice control ✔ ✔ ✔ ✔ ✔
Voice control engine ✔ ✔ ✔ ✔
Voice control manager ✔ ✔ ✔
4
likes
0
points
15.1k
downloads

Publisher

verified publishertizen.org

Weekly Downloads

Provides Dart bindings and utility functions for using Tizen native APIs.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

ffi, path, yaml

More

Packages that depend on tizen_interop