mirror of
https://gitlab.com/fabinfra/fabaccess/borepin.git
synced 2025-06-11 02:53:23 +02:00
Added: New API Struktur
This commit is contained in:
@ -79,6 +79,7 @@
|
||||
<Compile Include="Services\APIBinder.cs" />
|
||||
<Compile Include="Services\APIBindedService.cs" />
|
||||
<Compile Include="Services\APIService.cs" />
|
||||
<Compile Include="Services\APIService_New.cs" />
|
||||
<Compile Include="Services\APIServiceConnection.cs" />
|
||||
<Compile Include="Services\PreferenceStorageService.cs" />
|
||||
<Compile Include="Services\SecretStorage.cs" />
|
||||
|
@ -1,6 +1,4 @@
|
||||
using Android.App;
|
||||
using Android.Content;
|
||||
using Borepin.Service;
|
||||
using Borepin.Service;
|
||||
using FabAccessAPI;
|
||||
|
||||
namespace Borepin.Droid.Services
|
||||
@ -8,21 +6,18 @@ namespace Borepin.Droid.Services
|
||||
public class APIService : IAPIService
|
||||
{
|
||||
#region Private Members
|
||||
private readonly APIServiceConnection _APIServiceConnection;
|
||||
private readonly IAPI _API;
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
public APIService()
|
||||
{
|
||||
Context context = Application.Context;
|
||||
Intent service = new Intent(context, typeof(APIBindedService));
|
||||
context.BindService(service, _APIServiceConnection, Bind.AutoCreate);
|
||||
_API = new API();
|
||||
}
|
||||
#endregion
|
||||
|
||||
public IAPI GetAPI()
|
||||
{
|
||||
return _APIServiceConnection?.Binder?.Service?.GetAPI();
|
||||
return _API;
|
||||
}
|
||||
}
|
||||
}
|
28
Borepin/Borepin.Android/Services/APIService_New.cs
Normal file
28
Borepin/Borepin.Android/Services/APIService_New.cs
Normal file
@ -0,0 +1,28 @@
|
||||
using Android.App;
|
||||
using Android.Content;
|
||||
using Borepin.Service;
|
||||
using FabAccessAPI;
|
||||
|
||||
namespace Borepin.Droid.Services
|
||||
{
|
||||
public class APIService_New : IAPIService
|
||||
{
|
||||
#region Private Members
|
||||
private readonly APIServiceConnection _APIServiceConnection;
|
||||
#endregion
|
||||
|
||||
#region Constructors
|
||||
public APIService_New()
|
||||
{
|
||||
Context context = Application.Context;
|
||||
Intent service = new Intent(context, typeof(APIBindedService));
|
||||
context.BindService(service, _APIServiceConnection, Bind.AutoCreate);
|
||||
}
|
||||
#endregion
|
||||
|
||||
public IAPI GetAPI()
|
||||
{
|
||||
return _APIServiceConnection?.Binder?.Service?.GetAPI();
|
||||
}
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user