Statistiques
| Branche: | Révision:

teotestbluetooth / TestTeoBluetooth / TestTeoBluetooth.Android / MainActivity.cs @ 0875d625

Historique | Voir | Annoter | Télécharger (1,437 ko)

1 3c62e059 Martin Toutant
using System;
2
3
using Android.App;
4
using Android.Content.PM;
5
using Android.Runtime;
6
using Android.OS;
7
using Xamarin.Forms;
8 4ca686e8 Martin Toutant
using TeoTestBluetooth.Services;
9 0875d625 Martin Toutant
using TestBLE.Droid.Connection;
10
using TestTeoBluetooth.Connection;
11 3c62e059 Martin Toutant
12 4ca686e8 Martin Toutant
namespace TeoTestBluetooth.Droid
13 3c62e059 Martin Toutant
{
14
    [Activity(Label = "TestBLE", Icon = "@mipmap/icon", Theme = "@style/MainTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.UiMode | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize )]
15
    public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity
16
    {
17
        protected override void OnCreate(Bundle savedInstanceState)
18
        {
19
            base.OnCreate(savedInstanceState);
20
21
            Xamarin.Essentials.Platform.Init(this, savedInstanceState);
22 0875d625 Martin Toutant
            Forms.Init(this, savedInstanceState);
23
            DependencyService.Register<IConnectionService, BluetoothConnection>();
24
            DependencyService.Register<IConnectionService, InternConnection>();
25 3c62e059 Martin Toutant
            LoadApplication(new App());
26
        }
27
        public override void OnRequestPermissionsResult(int requestCode, string[] permissions, [GeneratedEnum] Android.Content.PM.Permission[] grantResults)
28
        {
29
            Xamarin.Essentials.Platform.OnRequestPermissionsResult(requestCode, permissions, grantResults);
30
31
            base.OnRequestPermissionsResult(requestCode, permissions, grantResults);
32
        }
33
    }
34
}