Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to create alarm from wearable service application. #219

Open
andy-mishechkin opened this issue Mar 23, 2021 · 1 comment
Open

How to create alarm from wearable service application. #219

andy-mishechkin opened this issue Mar 23, 2021 · 1 comment

Comments

@andy-mishechkin
Copy link

Hello, All!
I need to send periodical vibration from wearable service application (like here: https://github.com/Samsung/Tizen-CSharp-Samples/blob/master/Wearable/ServiceApp/ServiceApp/ServiceApp_App.cs)
I try to use alarms for this: https://docs.tizen.org/application/dotnet/guides/alarm/alarms/#scenario_1
For example I've tried to set alarm to send notification:

protected override void OnCreate()
        {
            base.OnCreate();

            Notification notification = new Notification
            {
                IsVisible = true,
                Title = "TestNotification",
                Content = "This is a test notification",
                Count = 3
            };

            Notification.AccessorySet nAccessory = new Notification.AccessorySet
            {
                SoundOption = AccessoryOption.On,
                CanVibrate = true,
                LedOption = AccessoryOption.On
            };
            notification.Accessory = nAccessory;

            Alarm alarm = AlarmManager.CreateAlarm(1, 2, notification);
        }

But when I run this service application on Tizen Emulator I don't see any alarms. May you explain please how to create alarm from wearable service application, and, maybe there better solution for preiodical vibration realization then alarm ?

@kilig
Copy link

kilig commented Apr 6, 2021

Hello andy.
I don't know if you added privileges for alarm and notification.
First, you should check for exceptions when using some Tizen api.
And second parameter of 'CreateAlarm(Int32, Int32, Notification)' does not guarantee the accuracy.
If you want to see the notification right away, use 'CreateAlarm(Int32, Notification)' method

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants