Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions Sensus.Android.Shared/AndroidSensusServiceHelper.cs
Original file line number Diff line number Diff line change
Expand Up @@ -212,6 +212,8 @@ public AndroidSensusServiceHelper()
_userDeniedBluetoothEnable = false;
_wakeLock = (Application.Context.GetSystemService(global::Android.Content.Context.PowerService) as PowerManager).NewWakeLock(WakeLockFlags.Partial, "SENSUS");
_deviceId = Settings.Secure.GetString(Application.Context.ContentResolver, Settings.Secure.AndroidId);

Microsoft.AppCenter.AppCenter.SetUserId(_deviceId);
}

#region main activity
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ namespace Sensus.Android.Probes.Context
/// * If the other device is an iOS device with Sensus running in the foreground, detection is possible.
/// * If the other device is an iOS device with Sensus running in the background, detection is not possible.
///
/// NOTE: The value of <see cref="Protocol.Id"/> running on the other device must equal the value of
/// <see cref="Protocol.Id"/> running on the current device. When a Protocol is created from within the
/// NOTE: The value of <see cref="BluetoothDeviceProximityProbe.ServiceUUID"/> running on the other device must equal the value of
/// <see cref="BluetoothDeviceProximityProbe.ServiceUUID"/> running on the current device. When a Protocol is created from within the
/// Sensus app, it is assigned a unique identifier. This value is maintained or changed depending on what you
/// do:
///
Expand All @@ -60,13 +60,9 @@ namespace Sensus.Android.Probes.Context
/// your Protocols in one of the two following ways:
///
/// * Create your Protocol on one platform (either Android or iOS) and then share it with a device from the other
/// platform for customization. The <see cref="Protocol.Id"/> values of these Protocols will remain equal
/// platform for customization. The <see cref="BluetoothDeviceProximityProbe.ServiceUUID"/> values of these Protocols will remain equal
/// and this <see cref="AndroidBluetoothDeviceProximityProbe"/> will detect encounters across platforms.
///
/// * Create your Protocols separately on each platform and then set the <see cref="Protocol.Id"/> field on
/// one platform (using the "Set Study Identifier" button) to match the <see cref="Protocol.Id"/> value
/// of the other platform (obtained via "Copy Study Identifier").
///
/// See the iOS subclass of <see cref="BluetoothDeviceProximityProbe"/> for additional information.
/// </summary>
public class AndroidBluetoothDeviceProximityProbe : BluetoothDeviceProximityProbe
Expand Down Expand Up @@ -97,7 +93,7 @@ protected override async Task InitializeAsync()
_deviceIdCharacteristic = new BluetoothGattCharacteristic(UUID.FromString(DEVICE_ID_CHARACTERISTIC_UUID), GattProperty.Read, GattPermission.Read);
_deviceIdCharacteristic.SetValue(Encoding.UTF8.GetBytes(SensusServiceHelper.Get().DeviceId));

_deviceIdService = new BluetoothGattService(UUID.FromString(Protocol.Id), GattServiceType.Primary);
_deviceIdService = new BluetoothGattService(UUID.FromString(ServiceUUID), GattServiceType.Primary);
_deviceIdService.AddCharacteristic(_deviceIdCharacteristic);

_bluetoothAdvertiserCallback = new AndroidBluetoothServerAdvertisingCallback(_deviceIdService, _deviceIdCharacteristic);
Expand Down
794 changes: 389 additions & 405 deletions Sensus.Android.Tests/Sensus.Android.Tests.csproj

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions Sensus.Android.Tests/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,9 @@
<package id="Estimote.Android.Indoor" version="2.5.4.2" targetFramework="monoandroid90" />
<package id="Estimote.Android.Proximity" version="1.0.3" targetFramework="monoandroid90" />
<package id="FastAndroidCamera" version="2.0.0" targetFramework="monoandroid90" />
<package id="Microsoft.AppCenter" version="1.11.0" targetFramework="monoandroid90" />
<package id="Microsoft.AppCenter.Analytics" version="1.11.0" targetFramework="monoandroid90" />
<package id="Microsoft.AppCenter.Crashes" version="1.11.0" targetFramework="monoandroid90" />
<package id="Microsoft.AppCenter" version="1.14.0" targetFramework="monoandroid90" />
<package id="Microsoft.AppCenter.Analytics" version="1.14.0" targetFramework="monoandroid90" />
<package id="Microsoft.AppCenter.Crashes" version="1.14.0" targetFramework="monoandroid90" />
<package id="Newtonsoft.Json" version="12.0.1" targetFramework="monoandroid90" />
<package id="PCLCrypto" version="2.0.147" targetFramework="monoandroid81" />
<package id="PCLStorage" version="1.0.2" targetFramework="monoandroid90" />
Expand Down
41 changes: 22 additions & 19 deletions Sensus.Android/Sensus.Android.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,24 @@ Store. It is possible to run and debug this project on physical and virtual Andr
<JavaMaximumHeapSize>2G</JavaMaximumHeapSize>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.AppCenter, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AppCenter.1.14.0\lib\MonoAndroid403\Microsoft.AppCenter.dll</HintPath>
</Reference>
<Reference Include="Microsoft.AppCenter.Analytics, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AppCenter.Analytics.1.14.0\lib\MonoAndroid403\Microsoft.AppCenter.Analytics.dll</HintPath>
</Reference>
<Reference Include="Microsoft.AppCenter.Analytics.Android.Bindings, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AppCenter.Analytics.1.14.0\lib\MonoAndroid403\Microsoft.AppCenter.Analytics.Android.Bindings.dll</HintPath>
</Reference>
<Reference Include="Microsoft.AppCenter.Android.Bindings, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AppCenter.1.14.0\lib\MonoAndroid403\Microsoft.AppCenter.Android.Bindings.dll</HintPath>
</Reference>
<Reference Include="Microsoft.AppCenter.Crashes, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AppCenter.Crashes.1.14.0\lib\MonoAndroid403\Microsoft.AppCenter.Crashes.dll</HintPath>
</Reference>
<Reference Include="Microsoft.AppCenter.Crashes.Android.Bindings, Version=0.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Microsoft.AppCenter.Crashes.1.14.0\lib\MonoAndroid403\Microsoft.AppCenter.Crashes.Android.Bindings.dll</HintPath>
</Reference>
<Reference Include="Mono.Android" />
<Reference Include="Plugin.ContactService, Version=1.0.0.0, Culture=neutral, processorArchitecture=MSIL">
<HintPath>..\packages\Xamarin.Forms.Contacts.1.0.5\lib\MonoAndroid10\Plugin.ContactService.dll</HintPath>
Expand Down Expand Up @@ -280,24 +298,6 @@ Store. It is possible to run and debug this project on physical and virtual Andr
<Reference Include="Xamarin.Azure.NotificationHubs.Android">
<HintPath>..\packages\Xamarin.Azure.NotificationHubs.Android.0.5.0\lib\MonoAndroid403\Xamarin.Azure.NotificationHubs.Android.dll</HintPath>
</Reference>
<Reference Include="Microsoft.AppCenter.Android.Bindings">
<HintPath>..\packages\Microsoft.AppCenter.1.11.0\lib\MonoAndroid403\Microsoft.AppCenter.Android.Bindings.dll</HintPath>
</Reference>
<Reference Include="Microsoft.AppCenter">
<HintPath>..\packages\Microsoft.AppCenter.1.11.0\lib\MonoAndroid403\Microsoft.AppCenter.dll</HintPath>
</Reference>
<Reference Include="Microsoft.AppCenter.Analytics.Android.Bindings">
<HintPath>..\packages\Microsoft.AppCenter.Analytics.1.11.0\lib\MonoAndroid403\Microsoft.AppCenter.Analytics.Android.Bindings.dll</HintPath>
</Reference>
<Reference Include="Microsoft.AppCenter.Analytics">
<HintPath>..\packages\Microsoft.AppCenter.Analytics.1.11.0\lib\MonoAndroid403\Microsoft.AppCenter.Analytics.dll</HintPath>
</Reference>
<Reference Include="Microsoft.AppCenter.Crashes.Android.Bindings">
<HintPath>..\packages\Microsoft.AppCenter.Crashes.1.11.0\lib\MonoAndroid403\Microsoft.AppCenter.Crashes.Android.Bindings.dll</HintPath>
</Reference>
<Reference Include="Microsoft.AppCenter.Crashes">
<HintPath>..\packages\Microsoft.AppCenter.Crashes.1.11.0\lib\MonoAndroid403\Microsoft.AppCenter.Crashes.dll</HintPath>
</Reference>
<Reference Include="Newtonsoft.Json">
<HintPath>..\packages\Newtonsoft.Json.12.0.1\lib\netstandard2.0\Newtonsoft.Json.dll</HintPath>
</Reference>
Expand Down Expand Up @@ -372,7 +372,10 @@ Store. It is possible to run and debug this project on physical and virtual Andr
<ItemGroup>
<AndroidAsset Include="Assets\README.txt" />
</ItemGroup>
<ItemGroup />
<ItemGroup>
<Folder Include="Resources\values-v21\" />
<Folder Include="Resources\layout\" />
</ItemGroup>
<ItemGroup>
<GoogleServicesJson Include="google-services.json" />
</ItemGroup>
Expand Down
6 changes: 3 additions & 3 deletions Sensus.Android/packages.config
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,9 @@
<package id="Estimote.Android.Proximity" version="1.0.3" targetFramework="monoandroid90" />
<package id="ExifLib.PCL" version="1.0.2-pre01" targetFramework="MonoAndroid60" />
<package id="FastAndroidCamera" version="2.0.0" targetFramework="monoandroid71" />
<package id="Microsoft.AppCenter" version="1.11.0" targetFramework="monoandroid90" />
<package id="Microsoft.AppCenter.Analytics" version="1.11.0" targetFramework="monoandroid90" />
<package id="Microsoft.AppCenter.Crashes" version="1.11.0" targetFramework="monoandroid90" />
<package id="Microsoft.AppCenter" version="1.14.0" targetFramework="monoandroid90" />
<package id="Microsoft.AppCenter.Analytics" version="1.14.0" targetFramework="monoandroid90" />
<package id="Microsoft.AppCenter.Crashes" version="1.14.0" targetFramework="monoandroid90" />
<package id="Microsoft.Bcl" version="1.1.10" targetFramework="MonoAndroid50" />
<package id="Microsoft.Bcl.Build" version="1.0.21" targetFramework="MonoAndroid44" />
<package id="Microsoft.CSharp" version="4.5.0" targetFramework="monoandroid81" />
Expand Down
Loading