Coder Social home page Coder Social logo

flutter-tizen / tizen_interop Goto Github PK

View Code? Open in Web Editor NEW
6.0 6.0 5.0 8.2 MB

Dart bindings for Tizen C APIs

License: BSD 3-Clause "New" or "Revised" License

Shell 0.01% C 0.05% Dart 98.99% C# 0.01% C++ 0.82% Python 0.13%
dart-package flutter tizen

tizen_interop's Introduction

Flutter for Tizen

Test

An extension to the Flutter SDK for building Flutter applications for Tizen devices.

Flutter and the related logo are trademarks of Google LLC. This project is sponsored and maintained by Samsung Research.

Supported devices

Installation

Usage

flutter-tizen substitutes the original flutter CLI command. Only the command line interface is supported.

# Inspect the installed tooling and list all connected devices.
flutter-tizen doctor -v
flutter-tizen devices

# Set up a new app project, or add Tizen files if the project already exists.
flutter-tizen create myapp
cd myapp

# Build the project and run on a Tizen device (either in debug or release mode).
flutter-tizen run
flutter-tizen run --release
  • See Supported commands for all available commands and their basic usage. See [command] -h for more information on each command.
  • See Getting started to create your first app and try hot reload.
  • To update the flutter-tizen tool, run git pull in this directory.

Docs

Tizen basics

App development

Platform integration

Miscellaneous

Issues

If you run into any problem, post an issue in this repository to get help. If your issue is clearly not Tizen-specific (i.e. it's reproducible with the regular flutter command), you may file an issue in https://github.com/flutter/flutter/issues.

Contribution

This project is community-driven and we welcome all your contributions and feedback. Consider filing an issue or pull request to make this project better.

tizen_interop's People

Contributors

jsuya avatar swift-kim avatar wiertel avatar wonyoungchoi avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

tizen_interop's Issues

Static analysis fails on pub.dev

https://pub.dev/packages/tizen_interop/score

image

Unhandled exception:
DocumentationTooBigException: Reached 2462056448 bytes in the output directory.
#0      PubResourceProvider._aboutToWriteBytes (package:pub_dartdoc/src/pub_hook[...]
#1      _File.writeAsBytesSync (package:pub_dartdoc/src/pub_hooks.dart:149:15)
#2      DartdocFileWriter.write (package:dartdoc/src/dartdoc.dart:100:10)
#3      GeneratorBackendBase.write (package:dartdoc/src/generator/generator_back[...]
#4      GeneratorBackendBase.generateTopLevelProperty (package:dartdoc/src/gener[...]
#5      GeneratorBackendBase.generateTopLevelConstant (package:dartdoc/src/gener[...]
#6      GeneratorFrontEnd._generateDocs (package:dartdoc/src/generator/generator[...]
#7      GeneratorFrontEnd.generate (package:dartdoc/src/generator/generator_fron[...]
#8      Dartdoc.generateDocsBase (package:dartdoc/src/dartdoc.dart:211:21)

Maybe this package has too many lines to be analyzed by pub.dev.

  • No dartdoc is generated.
  • Cannot pass static analysis. This affects the pub score.
  • The package cannot be marked "Dart 3 ready".

I opened an issue here: dart-lang/pana#1205

[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: Invalid argument(s): Failed to lookup symbol 'TizenInteropCallbacksRegisterSendPort': undefined symbol: TizenInteropCallbacksRegisterSendPort

I am using the
tizen_interop: ^0.2.6
tizen_interop_callbacks: ^0.1.0

E/flutter ( 4668): [ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: Invalid argument(s): Failed to lookup symbol 'TizenInteropCallbacksRegisterSendPort': undefined symbol: TizenInteropCallbacksRegisterSendPort
E/flutter ( 4668): #0 DynamicLibrary.lookup (dart:ffi-patch/ffi_dynamic_library_patch.dart:33:70)
E/flutter ( 4668): #1 new TizenInteropCallbacks._internal (package:tizen_interop_callbacks/tizen_interop_callbacks.dart:105:10)
E/flutter ( 4668): #2 new TizenInteropCallbacks (package:tizen_interop_callbacks/tizen_interop_callbacks.dart:96:41)

static void appconnBwResultCallback(int deviceId, Pointer<Int8> sid, Pointer<AppconnBwResult> result) {

}

static void appconnIperfTest({required TizenInteropCallbacks callbacks, required int deviceId, required String sid, required int targetPort, required int testDurationSec, required int maxBwTest, required int blocking}) {
Pointer _sid = sid.toNativeUtf8().cast();
final callback = callbacks.register('appconnBwResultCallback', Pointer.fromFunction(appconnBwResultCallback));
_appconnIperfTest(deviceId, _sid, targetPort, testDurationSec, maxBwTest, blocking, callback.interopCallback);
}

Upgrade Dart version

one of external package is required Dart 2.17.1 but current flutter-tizen dart version is Dart version 2.17.0,

Because flextizen depends on youtube_data_api >=1.0.0+1 which requires SDK version >=2.17.1 <3.0.0, version solving failed.

please let me know how to upgrade Dart SDK..

How to interact with a TV

I have read the readme and looked at the example but I am not sure how to control a Samsung smart TV running TizenOS

Provides examples

  • Re-implement existing plugins with tizen_interop to verify the functionality and usability.
  • Add an example app.

Can't use async callback

Due to the thread problem, asynchronous callbacks are currently unavailable.

example of a problem situation

  Pointer<NativeFunction<device_changed_cb>> _batteryChangedCallback =
      Pointer.fromFunction<device_changed_cb>(_batteryChanged);

   int ret = tizen.device_add_callback(
        device_callback_e.DEVICE_CALLBACK_BATTERY_CHARGING,
        _batteryChangedCallback,
        Pointer.fromAddress(0));
    if (ret != device_error_e.DEVICE_ERROR_NONE) {
      throw Exception('Failed to register battery callback');
    }
  }

  static void _batteryChanged(
      int type, Pointer<Void> value, Pointer<Void> userData) {
    print('batteryChanged');
  }

If the charging status is changed, following error will be raised.
error: Cannot invoke native callback outside an isolate.

sample code

https://github.com/WonyoungChoi/tizen_interop_async_test

repro with sample code

  1. git clone https://github.com/WonyoungChoi/tizen_interop_async_test
  2. cd tizen_interop_async_test/example
  3. flutter_tizen run (on emulator)
  4. open "Control Panel" of the emulator and choose "Batter".
  5. Change "Charger" state to "on "or "off".
  6. Application will be terminated with following error:
[E] ../../third_party/dart/runtime/vm/runtime_entry.cc: 3621: error: Cannot invoke native callback outside an isolate.
version=2.16.1 (stable) (Tue Feb 8 12:02:33 2022 +0100) on "linux_ia32"
pid=29992, thread=29992, isolate_group=(nil)((nil)), isolate=(nil)((nil))
isolate_instructions=0, vm_instructions=a65d5620
  pc 0xa672441e fp 0xbfbe4c38 /proc/self/fd/24/lib/libflutter_engine.so+0x9c641e
[E]   pc 0xa6a15cd1 fp 0xbfbe4c58 /proc/self/fd/24/lib/libflutter_engine.so+0xcb7cd1
  pc 0xa65d57d6 fp 0xbfbe4c88 /proc/self/fd/24/lib/libflutter_engine.so+0x8777d6
  pc 0xa67730be fp 0xbfbe4cc8 /proc/self/fd/24/lib/libflutter_engine.so+0xa150be
  pc 0xa67730f0 fp 0xbfbe4ce8 /proc/self/fd/24/lib/libflutter_engine.so+0xa150f0

reason

The above code is executed on the Flutter UI thread, but most of the tizen native callbacks come from the main-loop of the main thread. Dart does not support calls between isolates.
See more: dart-lang/sdk#37022

solution?

Missing parcel apis

Parcel API has been supported since Tizen 6.5.
However, it is not supported in tizen_interop even in version 7.0.
Would it be possible to add the parcel.h APIs? They are included in the platform/core/base/bundle repository.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.