Coder Social home page Coder Social logo

samsung / tizenfx Goto Github PK

View Code? Open in Web Editor NEW
175.0 66.0 239.0 1.21 GB

C# Device APIs for Tizen

License: Apache License 2.0

Shell 0.04% C# 99.91% Smalltalk 0.01% Component Pascal 0.01% Batchfile 0.01% Python 0.01% HTML 0.02%
tizen tizenfx dotnet c-sharp device-apis

tizenfx's Introduction

TizenFX

License Build

TizenFX API, which allows you to access platform-specific features not covered by the generic .NET and .NET MAUI features, such as system information and status, battery status, sensor date, and account and connectivity services.

Branches

Branch API Level Target Framework API Reference Platform myget.org nuget.org
master 12 net6.0-tizen9.0 Link Tizen vNext api12_myget
API11 11 net6.0-tizen8.0 Link Tizen 8.0 api11_myget api11_nuget
API10 10 tizen10.0 Link Tizen 7.0 api10_myget api10_nuget
API9 9 tizen90 Link Tizen 6.5 api9_myget api9_nuget
API8 8 tizen80 Link Tizen 6.0 api8_myget api8_nuget
API7 7 tizen70 Link Tizen 5.5 M3 api7_myget api7_nuget
API6 6 tizen60 Link Tizen 5.5 M2 api6_myget api6_nuget
API5 5 tizen50 Link Tizen 5.0 api5_myget api5_nuget
API4 4 tizen40 Link Tizen 4.0 api4_myget api4_nuget

master

The master branch is the main development branch for the Tizen .NET API Level 12.

The following NuGet packages will be published to Tizen MyGet Gallery and Github Packages Registry every day if there are any changes. (Nightly Build)

  • Tizen.NET 12.0.0.#####
  • Tizen.NET.API12 12.0.0.#####
  • Tizen.NET.Internals 12.0.0.#####

And, This branch is pushed to the tizen branch in the tizen gerrit and submitted for the next Tizen platform.

API4 ~ API11 branches

The API# branches are the release branch for Tizen .NET API Level #.

These release branches were FROZEN. No new public APIs can be added to these branches, only bug fixes and internal APIs can be added.

Using net6.0-tizen target framework for API11 or above

If you want to use the net6.0-tizen target framework, you need to install Tizen workload.

Using tizen target framework

If you want to use the tizen target framework, you need to use Tizen.NET.Sdk package as the project sdk.

<Project Sdk="Tizen.NET.Sdk/1.1.9">
  <PropertyGroup>
    <TargetFramework>tizen10.0</TargetFramework>
  </PropertyGroup>
</Project>

For more information, please see Using Tizen.NET.Sdk as SDK-style.

Minimum required versions of Tizen.NET.Sdk and Visual Studio

API Level Target Framework Tizen.NET.Sdk Visual Studio
API12 net6.0-tizen9.0 Tizen .NET Workloads 2022
API11 net6.0-tizen8.0 Tizen .NET Workloads 2022
API10 tizen10.0 1.1.9 2019
API9 tizen90 1.1.7 2019
API8 tizen80 1.1.6 2019
API7 tizen70 1.0.9 2019
API6 tizen60 1.0.9 2019
API5 tizen50 1.0.1 2017
API4 tizen40 1.0.1 2017

Quick Start

Prerequisites

Install .NET Core SDK : https://www.microsoft.com/net/download/

Getting the sources

git clone https://github.com/Samsung/TizenFX.git
cd TizenFX

How to build

./build.sh full
./build.sh pack

Tizen Project

TizenFX is a part of the Tizen project. You can download the latest binaries with TizenFX from the link below :

Tizen Version Link
Tizen 4.0 http://download.tizen.org/snapshots/TIZEN/Tizen-4.0/Tizen-4.0-Unified/latest/
Tizen 5.0 http://download.tizen.org/snapshots/TIZEN/Tizen-5.0/Tizen-5.0-Unified/latest/
Tizen 5.5 http://download.tizen.org/snapshots/TIZEN/Tizen-5.5/Tizen-5.5-Unified/latest/
Tizen 6.0 http://download.tizen.org/snapshots/TIZEN/Tizen-6.0/Tizen-6.0-Unified/latest/
Tizen 6.5 http://download.tizen.org/snapshots/TIZEN/Tizen-6.5/Tizen-6.5-Unified/latest/
Tizen 7.0 http://download.tizen.org/snapshots/TIZEN/Tizen-7.0/Tizen-7.0-Unified/latest/
Tizen 8.0 http://download.tizen.org/snapshots/TIZEN/Tizen-8.0/Tizen-8.0-Unified/latest/
Tizen 9.0 http://download.tizen.org/snapshots/TIZEN/Tizen/Tizen-Unified/latest

tizenfx's People

Stargazers

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

Watchers

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

tizenfx's Issues

[Tizen.​Applications] AppControl - Pick/Audio

In app there is a new app control defined with AppControlOperations set to Pick. Mime is set to "audio/*". Later there is SendLaunchRequest executed with proper callback event handler.

At this point we are in music explorer and there is 3 filters at the top (Tracks, Artists, Albums). Switching between these 3 doesn't cause any problems. Also picking up single track from Tracks works. Problem is when user selects album or artist (without picking any particular track) and then user wants to change to another category (any of them). Application crashes and goes back to application that launched request. Couple of times it did crash also the application that launched it.

Code snippet:

var pickAppcontrol = new AppControl
            {
                Operation = AppControlOperations.Pick
            };

pickAppcontrol.Mime = "audio/*";

AppControl.SendLaunchRequest(pickAppcontrol, MyFileSelectedCallback);

See also TNEXT-15229

Expose byte transmission on Tizen.Network.Bluetooth.IBluetoothClientSocket.SendData(string)

The Tizen.Network.Bluetooth.IBluetoothClientSocket.SendData(string) interface is limited to string transmissions, however a much more common scenario is to send byte arrays, and you probably encode the passed string to a byte array in the background anyway, so could you expose e.g. SendData(byte[] data) or provide any alternative getting byte arrays transmitted?

SmartEvent leak

Hello,

We develop the application based on Xamarin.Forms. Our application is hosted on github: https://github.com/SamsungDForum/JuvoPlayer

During memory profiling, we noticed that a number of ElmSharp.SmartEvent and ElmSharp.SmartEvent objects increases, every time we call a Xamarin.Forms.ImageSource.FromFile(string file) method.

elm-sharp-smart-event-leak 1

On Tizen platform, Xamarin.Forms.ImageSource is based on ElmSharp.Image class.

We found 2 problems:

  1. Please take a look at:
    public Task<bool> LoadAsync(string file, CancellationToken cancellationToken = default(CancellationToken))
    {
    if (file == null)
    throw new ArgumentNullException("file");
    Interop.Elementary.elm_image_async_open_set(RealHandle, true);
    Interop.Elementary.elm_image_preload_disabled_set(RealHandle, false);
    var tcs = new TaskCompletionSource<bool>();
    cancellationToken.Register(() =>
    {
    if (tcs != null && !tcs.Task.IsCompleted)
    {
    tcs.SetCanceled();
    }
    });
    SmartEvent loadReady = new SmartEvent(this, RealHandle, "load,ready");
    loadReady.On += (s, e) =>
    {
    loadReady.Dispose();
    LoadingCompleted?.Invoke(this, EventArgs.Empty);
    if (tcs != null && !tcs.Task.IsCompleted)
    {
    tcs.SetResult(true);
    }
    };
    SmartEvent loadError = new SmartEvent(this, RealHandle, "load,error");
    loadError.On += (s, e) =>
    {
    loadError.Dispose();
    LoadingFailed?.Invoke(this, EventArgs.Empty);
    if (tcs != null && !tcs.Task.IsCompleted)
    {
    tcs.SetResult(false);
    }
    };

Two SmartEvent objects are created in LoadAsync() method, however only one of them is disposed:

  • loadReady event is disposed when loading completes successfully
  • loadError event is disposed when loading fails

A simple fix for this issue is to dispose both events when one of them completes, for example:

public Task<bool> LoadAsync(string file, CancellationToken cancellationToken = default(CancellationToken))
{
    if (file == null)
        throw new ArgumentNullException("file");

    Interop.Elementary.elm_image_async_open_set(RealHandle, true);
    Interop.Elementary.elm_image_preload_disabled_set(RealHandle, false);

    var tcs = new TaskCompletionSource<bool>();
    var loadReady = new SmartEvent(this, RealHandle, "load,ready");
    var loadError = new SmartEvent(this, RealHandle, "load,error");

    cancellationToken.Register(() =>
    {
        loadReady.Dispose();
        loadError.Dispose();

        if (tcs != null && !tcs.Task.IsCompleted)
        {
            tcs.SetCanceled();
        }
    });

    loadReady.On += (s, e) =>
    {
        loadReady.Dispose();
        loadError.Dispose();

        LoadingCompleted?.Invoke(this, EventArgs.Empty);
        if (tcs != null && !tcs.Task.IsCompleted)
        {
            tcs.SetResult(true);
        }
    };

    loadError.On += (s, e) =>
    {
        loadError.Dispose();
        loadReady.Dispose();

        LoadingFailed?.Invoke(this, EventArgs.Empty);
        if (tcs != null && !tcs.Task.IsCompleted)
        {
            tcs.SetResult(false);
        }
    };

The method LoadAsync(Stream, CancellationToken) has the same problem.

  1. Please take a look at:
    public SmartEvent(EvasObject sender, IntPtr handle, string eventName, SmartEventInfoParser parser)
    {
    _sender = sender;
    _eventName = eventName;
    _handle = handle;
    _parser = parser;
    sender.AddToEventLifeTracker(this);
    }

When SmartEvent is being created, it registers itself in "EventLifeTracker". However, it's not deregistered in Dispose method. We are able to workaround this problem by adding RemoveFromEventLifeTracker method to ElmSharp.EvasObject class and then call it in SmartEvent.Dispose, but this solution also requires modifications in ElmSharp.EvasObject.DisposeEvent and ElmSharp.EvasObject.MakeInvalidateEvent to avoid reentrancy issues.

// In: ElmSharp.EvasObject
internal void RemoveFromEventLifeTracker(IInvalidatable item)
{
    _eventStore.Remove(item);
}

// In: ElmSharp.SmartEvent
protected virtual void Dispose(bool disposing)
{
    if (disposing)
    {
        _sender.RemoveFromEventLifeTracker(this);
    }
    if (_handle != IntPtr.Zero)
    {
        foreach (var cb in _nativeCallbacks)
        {
            Interop.Evas.evas_object_smart_callback_del(_handle, _eventName, cb.callback);
        }
    }
    _nativeCallbacks.Clear();
}

[RemoteView] Cannot create an object using EflSharp

Currently to create RemoteView object we have to use ElmSharp.EvasObject:
RemoteViewFactory.Create(ElmSharp.EvasObject, String, ...).
There is no version of RemoteViewFactory.Create(...) method, that takes EflSharp object as a parameter. Hence, we are forced to use ElmSharp in EflSharp project.

We need a new version of RemoteViewFactory.Create(...) method, one that takes EflSharp object as a parameter

[Security.TEEC] Memory leak

It use Marshal.AllocHGlobal on constructor

context_imp = Marshal.AllocHGlobal(Marshal.SizeOf<Interop.TEEC_Context>());

But, anywhere not freed with Marshal.FreeHGlobal

~Context()
{
Dispose();
}
/// <summary>
/// This function implements the IDisposable interface.
/// </summary>
/// <since_tizen> 3 </since_tizen>
/// <privilege>http://tizen.org/privilege/tee.client</privilege>
/// <privlevel>partner</privlevel>
/// <feature>http://tizen.org/feature/security.tee</feature>
public void Dispose() {
try {
Interop.Libteec.FinalizeContext(context_imp);
}
catch (global::System.DllNotFoundException) { }
}

Build fails on master.

When building TizenFX using the build instructions the build fails with the below error (it happens muliple times, but with the same error):

/p/misc/tizen/nui/dali-core/dali/public-api/signals/callback.h:235:31: error: cast between incompatible function types from ‘Dali::CallbackBase::Dispatcher’ {aka ‘void (*)(Dali::CallbackBase&)’} to ‘Dispatcher’ {aka ‘bool (*)(Dali::CallbackBase&, Dali::Actor, const Dali::WheelEvent&)’} [-Werror=cast-function-type]
/p/misc/tizen/nui/dali-core/dali/public-api/signals/callback.h: In instantiation of ‘static void Dali::CallbackBase::Execute(Dali::CallbackBase&, P1, P2, P3) [with P1 = Dali::Actor; P2 = bool; P3 = Dali::DevelActor::VisibilityChange::Type]’:
/p/misc/tizen/nui/dali-core/dali/public-api/signals/base-signal.h:384:46:   required from ‘void Dali::BaseSignal::Emit(Arg0, Arg1, Arg2) [with Arg0 = Dali::Actor; Arg1 = bool; Arg2 = Dali::DevelActor::VisibilityChange::Type]’
/p/misc/tizen/nui/dali-core/dali/public-api/signals/dali-signal.h:1302:5:   required from ‘void Dali::Signal<void(Arg0, Arg1, Arg2)>::Emit(Arg0, Arg1, Arg2) [with Arg0 = Dali::Actor; Arg1 = bool; Arg2 = Dali::DevelActor::VisibilityChange::Type]’
/p/misc/tizen/nui/dali-core/dali/internal/event/actors/actor-impl.cpp:1858:58:   required from here

[Xamarin.Forms.Platform.Tizen] Stepper - feature request

We needed Stepper in application that is vertical not horizontal. There was a renderer class made
because Stepper class does not have any attributes responsible for it.

At first it was working good, but later one of testers created an issue that this stepper should
also be editable (user can change input from mobile keyboard), so this was also changed in
VerticalStepper class. Almost everything was good except one thing :)

When the value is clicked it works properly, value highlights and keyboard pops up.
image

But when the value is clicked and the click is hold, value's color is set to white so on white background it dissapear.
image

Even though we found a way to omit the problem I'm writing about this to be considered to join
these features to Stepper class:

-vertical stepper
-editable stepper (that does not cause problem described above)

Both seems to be very common and used :)

See also - TNEXT-15244

Problems with Tizen.Pims.Calendar

https://developer.tizen.org/development/guides/.net-application/personal-data/calendar
Above guide is full of mistakes and code that is unusable, for example:

  1. "var manager = new CalendarManager(); var record = manager.Get(CalendarViews.Event.Uri, eventId);" There is not such function as Get in Calendar Manager
  2. "var record;
    while (record = list.GetCurrentRecord())
    {
    string summary = record.Get(CalendarViews.Event.Summary);
    list.MoveNext();
    }"
    This for sure haven't beet tested, how on earth is that first line there. Also GetCurrentRecord doesn't return bool

"record.Set(CalendarViews.Event.Bymonthday, "3,4,5");"
you specify int to be set, then use string instead

How am I supposed to use all the enums specified (like CalendarTypes.Recurrence) when it's impossible to use them ("record.set<CalendarTypes.Recurrence>();" won't work)
Please update the guide or/and fix api, because there is no information available on how to properly use it.

IME doesn't hide on Tizen TV

Hello,

We noticed that IME doesn't hide on Tizen TV. Basically, selecting 'Done' or 'Cancel' buttons does not work.

Environment: TIZEN-ONEMAIN-MuseM-RELEASE_20191104.4 (however, similar issues may be reproducible on older Tizen versions, see: https://github.com/Samsung/react-native-tizen-dotnet/pull/27#issuecomment-546654666)
TizenFX commit id: e546a65)

Steps to reproduce:

  • build, install and run TizenFX/test/ElmSharp.Test
  • select 'EntryTest3'
  • focus on 'Hello, Tizen' text field. IME should appear.
  • select 'Done' or 'Cancel'

Result:
IME doesn't not hide

Expected result:
IME shall hide. Text shall be updated.

[Widget] Wrong instance id was passed

/// <summary>
/// ID for this widget instance.
/// It will be created after OnCreate method is invoked.
/// </summary>
/// <since_tizen> 6 </since_tizen>
public string Id { get; private set; }

Id of WidgetBase should be return a widget instance id
but actually returing a widget id instead of instance id


it passed with widget id instead of instance id

my callback function cann't be excuted

when I want to get data from GPS modules,my device has been set on,but the callback function always can't be excuted.So I can't get data from GPS modules.the code as below: wait for answer,tks sincerely.
e.g.
if(location_manager_set_service_state_changed_cb(location_manager, location_state_cb, NULL) == LOCATIONS_ERROR_NONE)
{
my_debug_print("wkqtest Location service callback added.");
}
// Starting service
if(location_manager_start(location_manager) == LOCATIONS_ERROR_NONE)
{
my_debug_print("wkqtest Location service started.");
}
}

		// On shutdown of your service:
		if (location_manager_unset_service_state_changed_cb(location_manager) == LOCATIONS_ERROR_NONE)
		{
			my_debug_print("wkqtest Location service callback removed.");
		}
		// It is not necessary to call location_manager_stop() just before calling
		// location_manager_destroy because the service is stopped automatically
		// before destruction.
		if (location_manager_destroy(location_manager) == LOCATIONS_ERROR_NONE)
		{
			my_debug_print("wkqtest Location manager destroyed.");
		    location_manager = NULL;
		}

///////////////////////////////
void location_state_cb(location_service_state_e state, void *user_data)
{
if (state == LOCATIONS_SERVICE_ENABLED)
{
my_debug_print("wkqtest Location service enabled.");
double altitude, latitude, longitude, climb, direction, speed;
double horizontal, vertical;
location_accuracy_level_e level;
time_t timestamp;
int err = location_manager_get_location(location_manager, &altitude, &latitude, &longitude,
&climb, &direction, &speed, &level,
&horizontal, &vertical, &timestamp);
if (err == LOCATIONS_ERROR_NONE)
{
my_debug_print("wkqtest Location: %f,%f,%f,%f,%f,%f,%f,%f", altitude, latitude, longitude, climb, direction, speed, level, horizontal, vertical);
}
else
{
my_debug_print("wkqtest Location error!");
//handle error here
}
}
if (state == LOCATIONS_SERVICE_DISABLED)
{
my_debug_print("wkqtest Location is disabled!");
}
}

English review of doxygen tags

Announcement

SRI-B Document part start to review doxygen tags of API Level 5 from this week.

@Samsung/TizenFX_admin and all developers
When they send you PRs, please confirm and approve them.

[ElmSharp] Deleted of EvasObject event is not raised

Description

EvasObject.Deleted event is not raised when I called Unrealized method.

Steps to Reproduce

  1. Run this test code
  2. Click "Button 2"
using System;
using ElmSharp;

namespace ElmSharp.Test
{
    class DeletedEventTest : TestCaseBase
    {
        public override string TestName => "DeletedEventTest";
        public override string TestDescription => "To test Deleted event of EvasObject";

        Button button2;

        public override void Run(Window window)
        {
            Conformant conformant = new Conformant(window);
            conformant.Show();
            var box = new Box(window);
            conformant.SetContent(box);
            box.Show();

            Button button1 = new Button(window)
            {
                Text = "Button 1",
                AlignmentX = -1,
                AlignmentY = -1,
                WeightX = 1,
                WeightY = 1
            };
            button2 = new Button(window)
            {
                Text = "Button 2",
                AlignmentX = -1,
                AlignmentY = -1,
                WeightX = 1,
                WeightY = 1,
            };

            box.PackEnd(button1);
            box.PackEnd(button2);

            button1.Show();
            button2.Show();

            button2.Deleted += Button_Deleted;
            button2.Clicked += Button_Clicked;
        }

        private void Button_Clicked(object sender, EventArgs e)
        {
            Log.Debug("button2 clicked");
            button2.Unrealize();
        }

        private void Button_Deleted(object sender, EventArgs e)
        {
            Log.Debug("button2 deleted");
        }
    }
}

[PrivacyPrivilegeManager] ResponseFetched Event was not fired

 static ResponseContext context = null;
 PrivacyPrivilegeManager.GetResponseContext("some privilege").TryGetTarget(out context);
 context.ResponseFetched += some_handler;
 context.ResponseFetched -= some_handler; // context was removed from s_responseMap
 context.ResponseFetched += some_handler;  // It will not fired when Response was fetched

[AccountManager] Wrong implement of SafeHandle.ReleaseHandle

protected override bool ReleaseHandle()
{
this.SetHandle(IntPtr.Zero);
return true;
}

You need call native handle release function

https://msdn.microsoft.com/ko-kr/library/system.runtime.interopservices.safehandle(v=vs.110).aspx

Nobody call native release function

[DllImport(Libraries.AccountSvc, EntryPoint = "account_destroy", CallingConvention = CallingConvention.Cdecl)]
internal static extern int Destroy(IntPtr handle);

[Tizen.Sensor] Stress monitor not found in SensorTypes

(See this original question in stackoverflow for details.)

There's no equivalent of the native SENSOR_HUMAN_STRESS_MONITOR in Tizen.Sensor APIs and it looks like it's simply unsupported according to this guide.

Aren't the Tizen.Sensor types supposed to be in sync with the natively supported types (and vice versa)? If it's not available is there any alternative way to use?

[AudioManager] Wrong Event remove handler

lock (_audioDeviceStateLock)
{
if (_audioDeviceStateChanged == value)
{
UnregisterDeviceStateChangedEvent();
}
_audioDeviceStateChanged -= value;
}

  1. _audioDeviceStateChanged never same with value

  2. null of _audioDeviceStateChanged is checked after removing value

_audioDeviceStateChanged -= value;
if (_audioDeviceStateChanged == null) {
    UnregisterDeviceStateChangedEvent();
}

[AccountManger] Wrong Implement of Dispose pattern

protected virtual void Dispose(bool disposing)
{
if (!disposing)
{
_handle.Dispose();
}
}

When disposing was true,

  • Unmanaged and managed resource should be released.

When disposing was false,

  • Only Unmanaged resource should be released.

And SafeHandle is managed resource

https://docs.microsoft.com/en-us/dotnet/standard/design-guidelines/dispose-pattern

[STT] Fail to add/remove RecognitionResult EventHandler

You always set native event handler by SttSetRecognitionResultCB
and always unset natvie event handler by SttUnsetRecognitionResultCB

But, Event can be added more than 1.
So, it is fail to below sequence

 var client = SttClient();
 client.RecognitionResult += EventHandler1;
 client.RecognitionResult += EventHandler2;
 // now EventHandler1 and EventHandler2 was working

 ....
 client.RecognitionResult -= EventHandler1;
 // now any event handler was not working

public event EventHandler<RecognitionResultEventArgs> RecognitionResult
{
add
{
lock (thisLock)
{
_resultDelegate = (IntPtr handle, ResultEvent e, IntPtr data, int dataCount, IntPtr msg, IntPtr userData) =>
{
Log.Info(LogTag, "Recognition Result Event Triggered");
if (data != null && msg != null)
{
RecognitionResultEventArgs args = new RecognitionResultEventArgs(e, data, dataCount, Marshal.PtrToStringAnsi(msg));
_recognitionResult?.Invoke(this, args);
}
else
{
Log.Info(LogTag, "Recognition Result Event null received");
}
};
SttError error = SttSetRecognitionResultCB(_handle, _resultDelegate, IntPtr.Zero);
if (error != SttError.None)
{
Log.Error(LogTag, "Add RecognitionResult Failed with error " + error);
}
else
{
_recognitionResult += value;
}
}
}
remove
{
lock (thisLock)
{
SttError error = SttUnsetRecognitionResultCB(_handle);
if (error != SttError.None)
{
Log.Error(LogTag, "Remove RecognitionResult Failed with error " + error);
}
_recognitionResult -= value;
}
}
}

[Multimedia] Player Sourece was reset when unprepared

The source of set to player by SetSource was reset when player was unprepared.
But i can't found any information about this behavior in documents

Is it normal operation?
Do you have any reason to this?

        /// <summary>
        /// Sets a media source for the player.
        /// </summary>
        /// <param name="source">A <see cref="MediaSource"/> that specifies the source for playback.</param>
        /// <remarks>The player must be in the <see cref="PlayerState.Idle"/> state.</remarks>
        /// <exception cref="ObjectDisposedException">The player has already been disposed of.</exception>
        /// <exception cref="InvalidOperationException">
        ///     The player is not in the valid state.<br/>
        ///     -or-<br/>
        ///     It is not able to assign the source to the player.
        ///     </exception>
        /// <seealso cref="PrepareAsync"/>
        /// <since_tizen> 3 </since_tizen>
        public void SetSource(MediaSource source)

[Multimedia.Player] PlayerDisplaySettings.SetRoi didn't accept negative position

Tizen.Multimedia.PlayerDisplaySettings.SetRoi didn't accept negative position.
But Application frequently use negative position when view was placed on scroller.

It seem to native layer issue

I/TIZEN_N_PLAYER( 2645): legacy_player.c: legacy_player_set_display_mode(1332) > [legacy_player_set_display_mode] mode:5
D/MM_PLAYER( 2645): mm_player_attrs.c: __mmplayer_apply_attribute(195) >  param_name: display_method
D/MM_PLAYER( 2645): mm_player_priv.c: _mmplayer_update_video_param(2611) > param_name : display_method
D/MM_PLAYER( 2645): mm_player_priv.c: _mmplayer_update_video_param(2615) > check display surface type attribute: 0
D/MM_PLAYER( 2645): mm_player_priv.c: __mmplayer_update_wayland_videosink_video_param(2573) > param_name : display_method
D/MM_PLAYER( 2645): mm_player_priv.c: __mmplayer_video_param_set_display_method(2463) > set video param : method 5
E/MM_COMMON( 2645): mm_attrs_private.c: mmf_attribute_validate_int(351) > [mmf_attribute:display_win_roi_x] out of range[min 0, max 2
147483647, set -188]

[FileSystem] Create file

Hi everyone!

How can I create a file in Tizen.Net?

If I use standard API, such as File.Create(..), I get Segmentation fault.

Cannot control flight mode and do not disturb mode.

Currently there is no way to set flight mode nor do not disturb mode in TizenFX.
Also in case of do not disturb mode there seems to be no way to check whether it's enabled.

We need ability to set flight mode and do not disturb mode.

[ElmSharp] Question about EcoreSynchronizationContext.Post()

Hello,

I have a question regarding the EcoreSynchronizationContext.Post() method. According to the documentation, this method should dispatch an asynchronous message to a main loop, see:

    /// <summary>
    /// Dispatches an asynchronous message to a Ecore main loop.
    /// </summary>
    /// <param name="d"><see cref="T:System.Threading.SendOrPostCallback" />The SendOrPostCallback delegate to call.</param>
    /// <param name="state"><see cref="T:System.Object" />The object passed to the delegate.</param>
    /// <remarks>The Post method starts an asynchronous request to post a message.</remarks>
    /// <since_tizen> preview </since_tizen>
    public override void Post(SendOrPostCallback d, object state);

I would expect that my message will be added to the end of a main loop queue and called when all pending messages are processed. This would be consistent with other SynchronizationContext implementations, like: TizenSynchronizationContext or Nito.AsyncEx.AsyncContext.AsyncContextSynchronizationContext. However, EcoreSynchronizationContext behaves differently - a message is called synchronously if it is dispatched on a main loop thread, see:

EAPI void
ecore_main_loop_thread_safe_call_async(Ecore_Cb callback,
                                       void    *data)
{
   Ecore_Safe_Call *order;

   if (!callback) return;

   if (eina_main_loop_is())
     {
        callback(data);
        return;
     }

Such behavior may cause reentrancy issues and it seems to be inconsistent with the documentation. Is it intentional?

[ElmSharp.Wearable][MoreOption] Dot indicator is moving when option is set and menu is opened again

Dot indicating the item focus is moving on it own (when you select one option, click back button and and later open menu again).
Steps to reproduce:

Image version:
Model=Tizen5/Unified;
Build=tizen-unified_20181024.1;

Note that when using the same tpk file on image:
Model=Tizen4/Unified;
Build=tizen-4.0-unified_20190306.1;
after second cue button click, the dot indicates first item immediately (it does not move to it in a visible way)

App segfaults in the emulator

This is related to #1056 but perhaps related to tooling and not the right place to raise.
I've created a blank Tizen Wearable 4 app and added a few lines to Main:

var exists = File.Exists("/usr/lib/libc.so.6");
Console.WriteLine(exists);
foreach (var item in Directory.GetFiles("/usr/lib/"))
{
    Console.WriteLine(item);
}

VS output panel says:

Loaded '[vdso]'. Cannot find or open the symbol file.
Loaded 'linux-gate.so.1'. Cannot find or open the symbol file.
Loaded 'JIT(0x809bd3f0)'. Cannot find or open the symbol file.
Loaded 'JIT(0x80be3d50)'. Cannot find or open the symbol file.
Loaded 'JIT(0x80b82090)'. Cannot find or open the symbol file.
Segmentation fault

The thread 0x1 has exited with code 0 (0x0).
The program 'sdb.exe' has exited with code 42 (0x2a).

Stepping through the code doesn't match the lines of code, as if it was debugging an old version of the app.

I've restarted the IDE and emulators, rebuilt the project (got rid of all previous builds) but still get the segfault.

image

I've tried removing the I/O lines I've added to get it back to the blank app template project and it stills segfaults.
I've tried running without a debugger and still segfaults.

Could I please get some guidance? Thanks.

Visual Studio 2017 15.9.16

.NET Core SDKs installed:
  1.0.4 [C:\Program Files\dotnet\sdk]
  1.1.8 [C:\Program Files\dotnet\sdk]
  2.1.202 [C:\Program Files\dotnet\sdk]
  2.1.400 [C:\Program Files\dotnet\sdk]
  2.1.403 [C:\Program Files\dotnet\sdk]
  2.1.509 [C:\Program Files\dotnet\sdk]
  2.2.107 [C:\Program Files\dotnet\sdk]
  2.2.300 [C:\Program Files\dotnet\sdk]
  3.0.100 [C:\Program Files\dotnet\sdk]

Tizen Studio 3.3

Emulator:
Hardware CPU VT/GPU both ON
wearable-4.0-circle-x86

Emulator Manager:
Version: 2.5.91
Build: 20181001-2317

[WatchManager] No API for watch manager

Hello,
Native API provides watch manager functionality. It allows to manage watch faces, display and control them. TizenFX does not provide any analogues. More information about watch manager can be found in the file watch_control.h.

TizenFX should provide a WatchManager API that allows a developer to work with watch faces without the need to reference native functions.

Please give this issue a higher priority because it blocks a very important project.

[Tizen.Applications] The Badge API does not work correctly for a text message.

Hello,
I am a Samsung developer, I found the following bug: The Badge API has a problem when we use Control Panel to simulate a new message - the BadgeControl.Changed event is not raised. Therefore, it is not possible to implement correct handling of new message notifications in the application.

CORRECT BEHAVIOR:

Initial state:
1_initial_state

New call incoming:
2_incoming_call

The number of notifications about missed calls has increased:
3_notif_increased

WRONG BEHAVIOR:

New message notification arrives:
4_incoming_message

Text message badge has not changed:
5_not_changed

Can you fix this issue?

Access native library - P/Invoke

I'm attempting to load a native library without success.
Just trying to access a system library, say: File.OpenRead("/system/lib/libc.so") segfaults. I can't enumerate files on /or/lib` so I'm assuming the app is sandboxed but Is there a way (even if permission is required) to load a system image?

[AccountManager] Wrong ownership handing

Interop.Account.AccountCallback accountCallback = (IntPtr data, IntPtr userdata) =>
{
Account account = new Account(new SafeAccountHandle(data, true));
values.Add(account.AccountId);
account.Dispose();
return true;
};

A handle in foreach callback of native, will released when callback was completed,
So, You didn't got a handle ownership. It will be released by native.
If you release the handle, it is a double free

[MediaContent] Wrong Implement of Dispose pattern

protected virtual void Dispose(bool disposing)
{
if (!disposedValue)
{
if (disposing)
{
_handle.Free();
}
disposedValue = true;
}
}

_handle should be always freed.

https://msdn.microsoft.com/ko-kr/library/system.runtime.interopservices.gchandle(v=vs.110).aspx
When the handle goes out of scope you must explicitly release it by calling the M:System.Runtime.InteropServices.GCHandle.Free method; otherwise, memory leaks may occur. When you free a pinned handle, the associated object will be unpinned and will become eligible for garbage collection, if there are no other references to it.

[Media​Controller] Lack of support for the custom commands

Current Tizen.Multimedia.Remoting API does not support Media Controller method to send custom command to a server. This option is availiable in Native API and for unknown reason has not been implemented in .NET version. This significantly limits the possibilities of using the Media Control API in applications. Is there any reason why the custom commands are not implemented? Is there any replacement for them?

Await at widget problem

Performing UI operations at widget and mixing asynchronous tasks with them is unsafe. Awaiting on task that makes asynchronous calls doesn’t guarantee that execution resumes on the same thread (UI thread in this case). In contrast, full screen UI application works correctly.
Demonstrator shows this behavior logging thread Id before and after Delay. For widget it logs other id. Furthermore, I noticed widget has no implementation of synchronization context.

WidgetAwait.zip

Nuget Packages:
Tizen.NET 5.0.0.14562
Tizen.NET.Sdk 1.0.1
Affected Devices:
FamilyHub
Tizen4/Unified 4.0.0 (arm)
VERSION = 4.0.0
CODENAME = Next
BUILD_ID=tizen-4.0-da-fhub4_20181219.1_FHUB4R-KM-US-RF9500-AD-RELEASE

[Tizen.Sensor] Gravity sensor

There is some correlation with values x and y in gravity sensor. Keeping one of this values on stable level and simultaneously changing the other value causes jumps on first value in a moment of crossing zero.

It can be visible on smart watch in attached application.
org.tizen.example.Level-1.0.0.tpk.zip
tizen-release:
Tizen4/Unified 4.0.0 (arm)
VERSION = 4.0.0
CODENAME = Next
BUILD_ID=PLATFORM_PrdR500XX_20190315.002

Here is sample output. Value Y varies from 2 to 8 when X is close to 0.
logs.txt

Discuss on key/value type of Dictionary on Widget and ComponentBasedApplication constructor

Constructor of ComponentBasedApplicationBase and WidgetApplication has parameter with Dictionary<Type,string>

        /// <summary>
        /// Initializes the ComponentBasedApplicationBase class.
        /// </summary>
        /// <param name="typeInfo">The component type information.
        /// The key should be a class type of FrameComponent or SubComponent subclass.
        /// The value should be a component id which is declared in tizen-manifest.xml.
        /// </param>
        /// <since_tizen> 6 </since_tizen>
        public ComponentBasedApplication(IDictionary<Type, string> typeInfo)
        /// <summary>
        /// Initializes the WidgetApplication class with the type and application ID.
        /// </summary>
        /// <param name="typeInfo">Map structure for the derived class type and widget ID.</param>
        /// <since_tizen> 3 </since_tizen>
        public WidgetApplication(IDictionary<Type, string> typeInfo)

As I opinion, I think id string should be a key and Type should be a value on a dictionary.

First, Dictionary's key role is identifier, and ID(component/widget) working as Identifier on tzen-minifest.
ID(component/widget) should not be duplicated on dictionary.
but currently, ID(component/widget) is value so, could be duplicated

new WidgetApplication(new Dictionary<Type, string>(){
    [typeof(Widget1)] = "widget1",
    // app developer miss type "widget1" instead of "widget2" but does not report error
    [typeof(Widget2)] = "widget1"
});

Second, Type could NOT be duplicated on different ID(component/widget)
but it should be, because Application developer want to handle with same code (type) for various widget/components.

new WidgetApplication(new Dictionary<Type, string>(){
    [typeof(MultiFunctionWidget)] = "widget1",
    // app developer want to handle mutiple widget with single class but can't
    [typeof(MultiFunctionWidget)] = "widget2"
});

How about thinks this issue?

[NFC] Privileges level mismatch

Hello,

I am Samsung Project Leader and developer.

I faced an issue with NFC activation in C# API:
NfcManager.SetActivationAsync(true);

I have received following error while installing app on Galaxy Watch:
key[error] val[-14] error message: :Check tizen-manifest.xml| - Current api-version = 4, | certificate signature level = partner||[MISMATCHED_PRIVILEGE_LEVEL]| - http://tizen.org/privilege/nfc.admin| >> Use at least platform signatured certificate.||:<-7>

The documentation points out that I need to use PARTNER certificate level, but above error message tells that I need to use PLATFORM cert level.
https://developer.tizen.org/development/guides/.net-application/connectivity-and-wireless/nfc#manager_activating_nfc_device

Can you please tell me what is the correct level and if the documentation is ok or invalid?

What is more Native and Web APIs
have PUBLIC level for the http://tizen.org/privilege/nfc.admin
https://developer.tizen.org/development/training/native-application/understanding-tizen-programming/security-and-api-privileges#wearable_native

Thanks in advance for help.

rc

[ElmSharp.Wearable][MoreOption] Item focus moves only between first and last item when using bezel

It is not possible to select the option in menu using the bezel. Even if the bezel is rotated slightly, focus moves only between last and first option.

Steps to reproduce:

Image version:
Model=Tizen5/Unified;
Build=tizen-unified_20181024.1;

Note that this functionality (the same tpk file) works fine on image:
Model=Tizen4/Unified;
Build=tizen-4.0-unified_20190306.1;

Package Dependency is FULLY Broken.

Issue:

  • Installing TizenFX's RPM packages does NOT guarantee the behavior of TizenFX.

  • A Tizen image with TizenFX may FAIL with TCT tests unless image maintainers MANUALLY check and install all related packages. This is PROHIBITED behavior since Tizen 4.0. Which means TizenFX is not complying with Tizen.

Reason:

  • Most of package installation dependency is omitted in .spec file of TizenFX.

Suggestion:

  • Add all Tizen package dependencies (Requires: ...) of the dll files in .spec file.
    • We may create a script reading .so files (P/Invoke) from .NET sources and requests dependency declarations accordingly. (or add Requires: statements in .spec file)

Note that this is a CRITICAL problem for Tizen integration and build systems.

[ElmSharp] TrackObject returns wrong value after disappearing ItemObject on the screen

Description

TrackObject is destoyed when ItemObject disappears on the screen.
But ItemObject doesn't recreate TrackObject when it reappears on the screen.

Steps to Reproduce

  1. Run this test code.
  2. Select an item, show the log (ElmSharp.Test)
  3. Scroll up the list until the item disappears
  4. Scroll down the list to show the item.
  5. Select the item again. Geometry value will be 0.
using System;
using ElmSharp;

namespace ElmSharp.Test
{
    class TrackObjectTest : TestCaseBase
    {
        public override string TestName => "TrackObjectTest";
        public override string TestDescription => "To test TackObject";

        public override void Run(Window window)
        {
            Conformant conformant = new Conformant(window);
            conformant.Show();
            GenList list = new GenList(window)
            {
                Homogeneous = true,
                AlignmentX = -1,
                AlignmentY = -1,
                WeightX = 1,
                WeightY = 1
            };

            GenItemClass defaultClass = new GenItemClass("default")
            {
                GetTextHandler = (obj, part) =>
                {
                    return string.Format("{0} - {1}", (string)obj, part);
                }
            };

            for (int i = 0; i < 100; i++)
            {
                list.Append(defaultClass, string.Format("{0} Item", i));
            }
            list.SelectionMode = GenItemSelectionMode.Always;
            list.Show();
            list.ItemSelected += List_ItemSelected; ;
            conformant.SetContent(list);
        }

        private void List_ItemSelected(object sender, GenListItemEventArgs e)
        {
            Log.Debug((string)(e.Item.Data) + "item selected");
            Log.Debug("Item Geometry: " + e.Item.TrackObject.Geometry.ToString());
        }
    }
}

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.