Statistiques
| Branche: | Révision:

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

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

1
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
using TeoTestBluetooth.Services;
9
using TestBLE.Droid.Connection;
10
using TestTeoBluetooth.Connection;
11

    
12
namespace TeoTestBluetooth.Droid
13
{
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
            Forms.Init(this, savedInstanceState);
23
            DependencyService.Register<IConnectionService, BluetoothConnection>();
24
            DependencyService.Register<IConnectionService, InternConnection>();
25
            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
}