~phroa/phone-app

4700268fcf282e67e547c125a15537aea5929082 — Jack Stratton a month ago a6987c9 main
Add files
2 files changed, 31 insertions(+), 0 deletions(-)

A phms/Database.cs
A phms/Notes.cs
A phms/Database.cs => phms/Database.cs +13 -0
@@ 0,0 1,13 @@
// SPDX-License-Identifier: AGPL-3.0-or-later

using Npgsql;

namespace phms
{
    public class Database
    {
        public static string DatabaseUri { get; set; }

        public static NpgsqlConnection Connection => new NpgsqlConnection(DatabaseUri);
    }
}
\ No newline at end of file

A phms/Notes.cs => phms/Notes.cs +18 -0
@@ 0,0 1,18 @@
// SPDX-License-Identifier: AGPL-3.0-or-later

using Android.App;
using Android.Content;

namespace phms
{
    public static class Notes
    {
        public static void Send(string message)
        {
            var intent = new Intent(Application.Context, typeof(BackgroundService));
            intent.SetAction(BackgroundService.UpdateNotificationAction);
            intent.PutExtra("message", message);
            Application.Context.StartService(intent);
        }
    }
}
\ No newline at end of file