Skip to content

Commit 7ddfb14

Browse files
authored
Merge pull request #87 from ShimmerEngineering/ASM-2057
ASM-2057
2 parents f1be370 + 57403ca commit 7ddfb14

File tree

122 files changed

+24479
-12
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

122 files changed

+24479
-12
lines changed

ShimmerBLE/ConnectionTestApp/ConnectionTest.UWP/ConnectionTest.UWP.csproj

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -162,10 +162,6 @@
162162
<Project>{2b423ed5-9db8-40fe-8c0c-dcdafe0e6229}</Project>
163163
<Name>ShimmerBLEAPI</Name>
164164
</ProjectReference>
165-
<ProjectReference Include="..\..\MultiVerisenseExample\MultiVerisenseExample\MultiVerisenseExample.csproj">
166-
<Project>{dd54040d-e677-4533-b953-2aedf0b3a55e}</Project>
167-
<Name>MultiVerisenseExample</Name>
168-
</ProjectReference>
169165
<ProjectReference Include="..\ConnectionTest\ConnectionTest.csproj">
170166
<Project>{74f63cdd-7c87-4227-b517-8b7226a2b4e9}</Project>
171167
<Name>ConnectionTest</Name>

ShimmerBLE/ConnectionTestApp/ConnectionTest/ConnectionTest.csproj

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
<ItemGroup>
1414
<PackageReference Include="MvvmCross" Version="7.1.2" />
1515
<PackageReference Include="MvvmCross.Forms" Version="7.1.2" />
16-
<PackageReference Include="OxyPlot.Xamarin.Forms" Version="1.1.0-unstable0011" />
1716
<PackageReference Include="Xamarin.Forms" Version="4.8.0.1451" />
1817
<PackageReference Include="Xamarin.Essentials" Version="1.5.3.2" />
1918
</ItemGroup>
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Any raw assets you want to be deployed with your application can be placed in
2+
this directory (and child directories) and given a Build Action of "AndroidAsset".
3+
4+
These files will be deployed with your package and will be accessible using Android's
5+
AssetManager, like this:
6+
7+
public class ReadAsset : Activity
8+
{
9+
protected override void OnCreate (Bundle bundle)
10+
{
11+
base.OnCreate (bundle);
12+
13+
InputStream input = Assets.Open ("my_asset.txt");
14+
}
15+
}
16+
17+
Additionally, some Android functions will automatically load asset files:
18+
19+
Typeface tf = Typeface.CreateFromAsset (Context.Assets, "fonts/samplefont.ttf");
Lines changed: 121 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,121 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
5+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
6+
<ProjectGuid>{86518DFA-4319-4F60-918A-DB08AA77BC46}</ProjectGuid>
7+
<ProjectTypeGuids>{EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
8+
<TemplateGuid>{c9e5eea5-ca05-42a1-839b-61506e0a37df}</TemplateGuid>
9+
<OutputType>Library</OutputType>
10+
<RootNamespace>ConnectionTest.Droid</RootNamespace>
11+
<AssemblyName>ConnectionTest.Android</AssemblyName>
12+
<Deterministic>True</Deterministic>
13+
<AndroidApplication>True</AndroidApplication>
14+
<AndroidResgenFile>Resources\Resource.designer.cs</AndroidResgenFile>
15+
<AndroidResgenClass>Resource</AndroidResgenClass>
16+
<AndroidManifest>Properties\AndroidManifest.xml</AndroidManifest>
17+
<MonoAndroidResourcePrefix>Resources</MonoAndroidResourcePrefix>
18+
<MonoAndroidAssetsPrefix>Assets</MonoAndroidAssetsPrefix>
19+
<AndroidUseLatestPlatformSdk>false</AndroidUseLatestPlatformSdk>
20+
<TargetFrameworkVersion>v9.0</TargetFrameworkVersion>
21+
<AndroidEnableSGenConcurrent>true</AndroidEnableSGenConcurrent>
22+
<AndroidUseAapt2>true</AndroidUseAapt2>
23+
<AndroidHttpClientHandlerType>Xamarin.Android.Net.AndroidClientHandler</AndroidHttpClientHandlerType>
24+
<NuGetPackageImportStamp>
25+
</NuGetPackageImportStamp>
26+
</PropertyGroup>
27+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
28+
<DebugSymbols>true</DebugSymbols>
29+
<DebugType>portable</DebugType>
30+
<Optimize>false</Optimize>
31+
<OutputPath>bin\Debug</OutputPath>
32+
<DefineConstants>DEBUG;</DefineConstants>
33+
<ErrorReport>prompt</ErrorReport>
34+
<WarningLevel>4</WarningLevel>
35+
<AndroidLinkMode>None</AndroidLinkMode>
36+
<AotAssemblies>false</AotAssemblies>
37+
<EnableLLVM>false</EnableLLVM>
38+
<AndroidEnableProfiledAot>false</AndroidEnableProfiledAot>
39+
<BundleAssemblies>false</BundleAssemblies>
40+
</PropertyGroup>
41+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
42+
<DebugSymbols>true</DebugSymbols>
43+
<DebugType>portable</DebugType>
44+
<Optimize>true</Optimize>
45+
<OutputPath>bin\Release</OutputPath>
46+
<ErrorReport>prompt</ErrorReport>
47+
<WarningLevel>4</WarningLevel>
48+
<AndroidManagedSymbols>true</AndroidManagedSymbols>
49+
<AndroidUseSharedRuntime>false</AndroidUseSharedRuntime>
50+
</PropertyGroup>
51+
<ItemGroup>
52+
<Reference Include="Mono.Android" />
53+
<Reference Include="Plugin.BLE">
54+
<HintPath>Libs\Plugin.BLE.dll</HintPath>
55+
</Reference>
56+
<Reference Include="Plugin.BLE.Abstractions">
57+
<HintPath>Libs\Plugin.BLE.Abstractions.dll</HintPath>
58+
</Reference>
59+
<Reference Include="System" />
60+
<Reference Include="System.Core" />
61+
<Reference Include="System.Xml.Linq" />
62+
<Reference Include="System.Xml" />
63+
<Reference Include="System.Numerics" />
64+
<Reference Include="System.Numerics.Vectors" />
65+
</ItemGroup>
66+
<ItemGroup>
67+
<PackageReference Include="Xamarin.Forms" Version="4.8.0.1451" />
68+
<PackageReference Include="Xamarin.Essentials" Version="1.5.3.2" />
69+
</ItemGroup>
70+
<ItemGroup>
71+
<Compile Include="MainActivity.cs" />
72+
<Compile Include="Resources\Resource.designer.cs" />
73+
<Compile Include="Properties\AssemblyInfo.cs" />
74+
</ItemGroup>
75+
<ItemGroup>
76+
<None Include="Resources\AboutResources.txt" />
77+
<None Include="Assets\AboutAssets.txt" />
78+
<None Include="Properties\AndroidManifest.xml" />
79+
</ItemGroup>
80+
<ItemGroup>
81+
<AndroidResource Include="Resources\layout\Tabbar.xml" />
82+
<AndroidResource Include="Resources\layout\Toolbar.xml" />
83+
<AndroidResource Include="Resources\values\styles.xml" />
84+
<AndroidResource Include="Resources\values\colors.xml" />
85+
<AndroidResource Include="Resources\mipmap-anydpi-v26\icon.xml" />
86+
<AndroidResource Include="Resources\mipmap-anydpi-v26\icon_round.xml" />
87+
<AndroidResource Include="Resources\mipmap-hdpi\icon.png" />
88+
<AndroidResource Include="Resources\mipmap-hdpi\launcher_foreground.png" />
89+
<AndroidResource Include="Resources\mipmap-mdpi\icon.png" />
90+
<AndroidResource Include="Resources\mipmap-mdpi\launcher_foreground.png" />
91+
<AndroidResource Include="Resources\mipmap-xhdpi\icon.png" />
92+
<AndroidResource Include="Resources\mipmap-xhdpi\launcher_foreground.png" />
93+
<AndroidResource Include="Resources\mipmap-xxhdpi\icon.png" />
94+
<AndroidResource Include="Resources\mipmap-xxhdpi\launcher_foreground.png" />
95+
<AndroidResource Include="Resources\mipmap-xxxhdpi\icon.png" />
96+
<AndroidResource Include="Resources\mipmap-xxxhdpi\launcher_foreground.png" />
97+
</ItemGroup>
98+
<ItemGroup>
99+
<Folder Include="Resources\drawable\" />
100+
</ItemGroup>
101+
<ItemGroup>
102+
<Content Include="Libs\Plugin.BLE.Abstractions.dll" />
103+
<Content Include="Libs\Plugin.BLE.dll" />
104+
</ItemGroup>
105+
<ItemGroup>
106+
<ProjectReference Include="..\..\ShimmerBLEAPI.Android\ShimmerBLEAPI.Android.csproj">
107+
<Project>{381507d7-64e0-464d-a100-1f981c6a5235}</Project>
108+
<Name>ShimmerBLEAPI.Android</Name>
109+
</ProjectReference>
110+
<ProjectReference Include="..\DisconnectTest\DisconnectTest.csproj">
111+
<Project>{9196f4b3-23e2-47c6-a997-3dda2c43aa8a}</Project>
112+
<Name>DisconnectTest</Name>
113+
</ProjectReference>
114+
</ItemGroup>
115+
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" />
116+
<ProjectExtensions>
117+
<VisualStudio>
118+
<UserProperties TriggeredFromHotReload="False" />
119+
</VisualStudio>
120+
</ProjectExtensions>
121+
</Project>
Binary file not shown.
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
{
2+
"runtimeTarget": {
3+
"name": ".NETStandard,Version=v2.0/",
4+
"signature": ""
5+
},
6+
"compilationOptions": {},
7+
"targets": {
8+
".NETStandard,Version=v2.0": {},
9+
".NETStandard,Version=v2.0/": {
10+
"MvvmCross.Plugins.BLE/1.0.0": {
11+
"dependencies": {
12+
"MvvmCross": "6.3.1",
13+
"NETStandard.Library": "2.0.3",
14+
"Plugin.BLE.Abstractions": "1.0.0"
15+
},
16+
"runtime": {
17+
"MvvmCross.Plugins.BLE.dll": {}
18+
}
19+
},
20+
"Microsoft.NETCore.Platforms/1.1.0": {},
21+
"MvvmCross/6.3.1": {
22+
"runtime": {
23+
"lib/netstandard2.0/MvvmCross.dll": {
24+
"assemblyVersion": "6.3.1.0",
25+
"fileVersion": "6.3.1.0"
26+
}
27+
}
28+
},
29+
"NETStandard.Library/2.0.3": {
30+
"dependencies": {
31+
"Microsoft.NETCore.Platforms": "1.1.0"
32+
}
33+
},
34+
"Plugin.BLE.Abstractions/1.0.0": {
35+
"runtime": {
36+
"Plugin.BLE.Abstractions.dll": {}
37+
}
38+
}
39+
}
40+
},
41+
"libraries": {
42+
"MvvmCross.Plugins.BLE/1.0.0": {
43+
"type": "project",
44+
"serviceable": false,
45+
"sha512": ""
46+
},
47+
"Microsoft.NETCore.Platforms/1.1.0": {
48+
"type": "package",
49+
"serviceable": true,
50+
"sha512": "sha512-kz0PEW2lhqygehI/d6XsPCQzD7ff7gUJaVGPVETX611eadGsA3A877GdSlU0LRVMCTH/+P3o2iDTak+S08V2+A==",
51+
"path": "microsoft.netcore.platforms/1.1.0",
52+
"hashPath": "microsoft.netcore.platforms.1.1.0.nupkg.sha512"
53+
},
54+
"MvvmCross/6.3.1": {
55+
"type": "package",
56+
"serviceable": true,
57+
"sha512": "sha512-EERq0xR0gtjWfY9ljVQED8fBExTruPT2B1qxg/drJ9CImwdMXv/y4Ovf6qlusMMRj+ypCow4Slj78liTT4WZeg==",
58+
"path": "mvvmcross/6.3.1",
59+
"hashPath": "mvvmcross.6.3.1.nupkg.sha512"
60+
},
61+
"NETStandard.Library/2.0.3": {
62+
"type": "package",
63+
"serviceable": true,
64+
"sha512": "sha512-st47PosZSHrjECdjeIzZQbzivYBJFv6P2nv4cj2ypdI204DO+vZ7l5raGMiX4eXMJ53RfOIg+/s4DHVZ54Nu2A==",
65+
"path": "netstandard.library/2.0.3",
66+
"hashPath": "netstandard.library.2.0.3.nupkg.sha512"
67+
},
68+
"Plugin.BLE.Abstractions/1.0.0": {
69+
"type": "project",
70+
"serviceable": false,
71+
"sha512": ""
72+
}
73+
}
74+
}
Binary file not shown.
Binary file not shown.
Binary file not shown.
Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
using System;
2+
3+
using Android;
4+
using Android.App;
5+
using Android.Content.PM;
6+
using Android.Runtime;
7+
using Android.Views;
8+
using Android.Widget;
9+
using Android.OS;
10+
11+
namespace DisconnectTest.Droid
12+
{
13+
[Activity(Label = "DisconnectTest", Icon = "@mipmap/icon", Theme = "@style/MainTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation | ConfigChanges.UiMode | ConfigChanges.ScreenLayout | ConfigChanges.SmallestScreenSize )]
14+
public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity
15+
{
16+
private readonly string[] Permissions =
17+
{
18+
Manifest.Permission.AccessCoarseLocation,
19+
Manifest.Permission.AccessFineLocation,
20+
};
21+
protected override void OnCreate(Bundle savedInstanceState)
22+
{
23+
24+
base.OnCreate(savedInstanceState);
25+
26+
CheckPermissions();
27+
28+
Xamarin.Essentials.Platform.Init(this, savedInstanceState);
29+
global::Xamarin.Forms.Forms.Init(this, savedInstanceState);
30+
OxyPlot.Xamarin.Forms.Platform.Android.PlotViewRenderer.Init();
31+
LoadApplication(new App());
32+
}
33+
34+
private void CheckPermissions()
35+
{
36+
bool minimumPermissionsGranted = true;
37+
38+
foreach (string permission in Permissions)
39+
{
40+
if (CheckSelfPermission(permission) != Permission.Granted)
41+
{
42+
minimumPermissionsGranted = false;
43+
}
44+
}
45+
46+
if (!minimumPermissionsGranted)
47+
{
48+
RequestPermissions(Permissions, 0);
49+
}
50+
}
51+
52+
public override void OnRequestPermissionsResult(int requestCode, string[] permissions, [GeneratedEnum] Android.Content.PM.Permission[] grantResults)
53+
{
54+
Xamarin.Essentials.Platform.OnRequestPermissionsResult(requestCode, permissions, grantResults);
55+
56+
base.OnRequestPermissionsResult(requestCode, permissions, grantResults);
57+
}
58+
}
59+
}

0 commit comments

Comments
 (0)