Languages

Menu
Sites
Language
[Resolved] Unable to create instance of Tizen.NUI.Timer class (Tizen 4.0)

Hello!

I've been trying to play around with some homemade apps for my new Samsung Galaxy Watch, but I've run into some run-time problems.
- I am unable to instantiate a Timer from Tizen.NUI.

 

Whenever I try to call the Timer-constructor an exception is thrown (segmentation fault). I cannot get any futher information from the debugger, and cannot point to any particular code throwing the exception, other than my instantiation:

using Tizen.NUI;

public class MyClass 
{
    Timer myTimer;
    
    public MyClass 
    {
        myTimer = new Timer(1000); // <--- Exception is thrown here. 
    }
}

 

Note that this problem is not present when I try to do the project in Tizen 5.0. Here the Timer-instance works perfectly, but as my own watch doesn't run this version of Tizen, it is not of much help to me.

 

Has anyone else tried playing around with the Tizen.NUI.Timer instance in Tizen 4.0? Have you managed to instantiate an object of that particular class? Please let me know if you have, or if you are able to test this one thing for me.

 

Regards
-Malte

Edited by: Malte Andreasen on 14 Aug, 2019
View Selected Answer

Responses

2 Replies
Mark as answer
Tizen .NET

Hi Malte Andreasen,

Can I ask which app template you used? Was it Xamarin.Forms?

If you used Xamarin.Forms template, it doesn't guarantee the behavior of Tizen.NUI APIs.

That is because Xamarin.form template uses Xamarin.Forms.Application which is different from Tizen.NUI.NUIApplication.

If you want to use Tizen.NUI.Timer(), make sure you create project with NUI template.

Or, Xamarin.Forms also provide a timer. You can check this out.

https://docs.microsoft.com/ko-kr/dotnet/api/xamarin.forms.device.starttimer?view=xamarin-forms

Here is the sample code.

Device.StartTimer(TimeSpan.FromSeconds(1), () =>
{
    Console.WriteLine("$ timer from xamarin.forms");
    return true;
});

Thanks.

Malte Andreasen

I was using the 'Tizen Wearable Xaml App" template, which sounds like would cause the same problems. Thanks for letting me know :-)

 

I'll more into the Device-class you've pointed me at. It looks like it'll solve my problems, albeit a bit more cumbersome.

 

Again, thank you for pointing me in a productive direction, and have a nice day! :-)

 

Best regards,

- Malte