mirror of
https://gitlab.com/fabinfra/fabaccess/borepin.git
synced 2025-03-12 23:01:52 +01:00
50 lines
1.0 KiB
C#
50 lines
1.0 KiB
C#
using Android.App;
|
|
using Android.Content;
|
|
using Android.OS;
|
|
using FabAccessAPI;
|
|
|
|
namespace Borepin.Droid.Services
|
|
{
|
|
[Service(Name= "org.fab_infra.fabaccess.APIService")]
|
|
public class APIBindedService : Android.App.Service
|
|
{
|
|
#region Private Members
|
|
private IAPI _API;
|
|
#endregion
|
|
|
|
#region Members
|
|
public IBinder Binder { get; private set; }
|
|
#endregion
|
|
|
|
#region Methods
|
|
public IAPI GetAPI()
|
|
{
|
|
return _API;
|
|
}
|
|
|
|
public override void OnCreate()
|
|
{
|
|
base.OnCreate();
|
|
_API = new API();
|
|
}
|
|
|
|
public override IBinder OnBind(Intent intent)
|
|
{
|
|
Binder = new APIBinder(this);
|
|
return Binder;
|
|
}
|
|
|
|
public override bool OnUnbind(Intent intent)
|
|
{
|
|
return base.OnUnbind(intent);
|
|
}
|
|
|
|
public override void OnDestroy()
|
|
{
|
|
Binder = null;
|
|
_API = null;
|
|
base.OnDestroy();
|
|
}
|
|
#endregion
|
|
}
|
|
} |