Added Android Sample app + added custom Android device that uses the NMEA stream from the system location provider

This commit is contained in:
Morten Nielsen 2018-03-29 14:14:27 -07:00
parent b9d94a2f8c
commit 3263f841e3
10 changed files with 751 additions and 173 deletions

View file

@ -1,171 +1,201 @@

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27130.2003
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "NmeaParser", "NmeaParser", "{1701F3BA-A09C-4706-A612-24FD9340FC18}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{CF767486-305D-40EE-8845-58EF76C16D85}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SampleApp.WinDesktop", "SampleApp.WinDesktop\SampleApp.WinDesktop.csproj", "{5DB6C7C7-A19C-4BE3-AFE6-26E3061DA01F}"
ProjectSection(ProjectDependencies) = postProject
{1ADC3666-1DDB-48C4-9811-1E58B6D09A7C} = {1ADC3666-1DDB-48C4-9811-1E58B6D09A7C}
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Desktop", "Desktop", "{7ABA337E-6748-484E-A0F4-E1715E1C95F1}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "UnitTests", "UnitTests", "{28B8E327-C504-4E08-B2CE-09D1CBB8B904}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SampleApps", "SampleApps", "{A4B9D59A-C8C6-4199-A7F3-F3AF0C748281}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{0EBBFC7B-43E8-4478-9951-50C842991A9C}"
ProjectSection(SolutionItems) = preProject
CustomDictionary.xml = CustomDictionary.xml
GlobalSuppressions.cs = GlobalSuppressions.cs
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "UWP", "UWP", "{01FEC943-B537-4BCF-945A-6C914B06E448}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SampleApp.UWP", "SampleApp.UWP\SampleApp.UWP.csproj", "{7B252F1E-2E9D-4362-9C14-3376AAB8B5A0}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NmeaParser", "NmeaParser\NmeaParser.csproj", "{1ADC3666-1DDB-48C4-9811-1E58B6D09A7C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NmeaParser.Tests.UWP", "UnitTests\NmeaParser.Tests.UWP\NmeaParser.Tests.UWP.csproj", "{92CAD93B-6C3B-45A0-A723-BE046DE50FEC}"
EndProject
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "NmeaParser.Tests", "UnitTests\NmeaParser.Tests\NmeaParser.Tests.shproj", "{979AE182-EB59-4181-9D45-3FD6E4817F11}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NmeaParser.Tests.NET45", "UnitTests\NmeaParser.Tests.NET45\NmeaParser.Tests.NET45.csproj", "{170EE734-37F0-425F-822B-B865348ECEC6}"
ProjectSection(ProjectDependencies) = postProject
{1ADC3666-1DDB-48C4-9811-1E58B6D09A7C} = {1ADC3666-1DDB-48C4-9811-1E58B6D09A7C}
EndProjectSection
EndProject
Global
GlobalSection(SharedMSBuildProjectFiles) = preSolution
UnitTests\NmeaParser.Tests\NmeaParser.Tests.projitems*{170ee734-37f0-425f-822b-b865348ecec6}*SharedItemsImports = 4
UnitTests\NmeaParser.Tests\NmeaParser.Tests.projitems*{92cad93b-6c3b-45a0-a723-be046de50fec}*SharedItemsImports = 4
UnitTests\NmeaParser.Tests\NmeaParser.Tests.projitems*{979ae182-eb59-4181-9d45-3fd6e4817f11}*SharedItemsImports = 13
EndGlobalSection
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|ARM = Debug|ARM
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|ARM = Release|ARM
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{5DB6C7C7-A19C-4BE3-AFE6-26E3061DA01F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5DB6C7C7-A19C-4BE3-AFE6-26E3061DA01F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5DB6C7C7-A19C-4BE3-AFE6-26E3061DA01F}.Debug|ARM.ActiveCfg = Debug|Any CPU
{5DB6C7C7-A19C-4BE3-AFE6-26E3061DA01F}.Debug|ARM.Build.0 = Debug|Any CPU
{5DB6C7C7-A19C-4BE3-AFE6-26E3061DA01F}.Debug|x64.ActiveCfg = Debug|Any CPU
{5DB6C7C7-A19C-4BE3-AFE6-26E3061DA01F}.Debug|x64.Build.0 = Debug|Any CPU
{5DB6C7C7-A19C-4BE3-AFE6-26E3061DA01F}.Debug|x86.ActiveCfg = Debug|Any CPU
{5DB6C7C7-A19C-4BE3-AFE6-26E3061DA01F}.Debug|x86.Build.0 = Debug|Any CPU
{5DB6C7C7-A19C-4BE3-AFE6-26E3061DA01F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5DB6C7C7-A19C-4BE3-AFE6-26E3061DA01F}.Release|Any CPU.Build.0 = Release|Any CPU
{5DB6C7C7-A19C-4BE3-AFE6-26E3061DA01F}.Release|ARM.ActiveCfg = Release|Any CPU
{5DB6C7C7-A19C-4BE3-AFE6-26E3061DA01F}.Release|ARM.Build.0 = Release|Any CPU
{5DB6C7C7-A19C-4BE3-AFE6-26E3061DA01F}.Release|x64.ActiveCfg = Release|Any CPU
{5DB6C7C7-A19C-4BE3-AFE6-26E3061DA01F}.Release|x64.Build.0 = Release|Any CPU
{5DB6C7C7-A19C-4BE3-AFE6-26E3061DA01F}.Release|x86.ActiveCfg = Release|Any CPU
{5DB6C7C7-A19C-4BE3-AFE6-26E3061DA01F}.Release|x86.Build.0 = Release|Any CPU
{7B252F1E-2E9D-4362-9C14-3376AAB8B5A0}.Debug|Any CPU.ActiveCfg = Debug|x86
{7B252F1E-2E9D-4362-9C14-3376AAB8B5A0}.Debug|Any CPU.Build.0 = Debug|x86
{7B252F1E-2E9D-4362-9C14-3376AAB8B5A0}.Debug|Any CPU.Deploy.0 = Debug|x86
{7B252F1E-2E9D-4362-9C14-3376AAB8B5A0}.Debug|ARM.ActiveCfg = Debug|ARM
{7B252F1E-2E9D-4362-9C14-3376AAB8B5A0}.Debug|ARM.Build.0 = Debug|ARM
{7B252F1E-2E9D-4362-9C14-3376AAB8B5A0}.Debug|ARM.Deploy.0 = Debug|ARM
{7B252F1E-2E9D-4362-9C14-3376AAB8B5A0}.Debug|x64.ActiveCfg = Debug|x64
{7B252F1E-2E9D-4362-9C14-3376AAB8B5A0}.Debug|x64.Build.0 = Debug|x64
{7B252F1E-2E9D-4362-9C14-3376AAB8B5A0}.Debug|x64.Deploy.0 = Debug|x64
{7B252F1E-2E9D-4362-9C14-3376AAB8B5A0}.Debug|x86.ActiveCfg = Debug|x86
{7B252F1E-2E9D-4362-9C14-3376AAB8B5A0}.Debug|x86.Build.0 = Debug|x86
{7B252F1E-2E9D-4362-9C14-3376AAB8B5A0}.Debug|x86.Deploy.0 = Debug|x86
{7B252F1E-2E9D-4362-9C14-3376AAB8B5A0}.Release|Any CPU.ActiveCfg = Release|x86
{7B252F1E-2E9D-4362-9C14-3376AAB8B5A0}.Release|Any CPU.Build.0 = Release|x86
{7B252F1E-2E9D-4362-9C14-3376AAB8B5A0}.Release|Any CPU.Deploy.0 = Release|x86
{7B252F1E-2E9D-4362-9C14-3376AAB8B5A0}.Release|ARM.ActiveCfg = Release|ARM
{7B252F1E-2E9D-4362-9C14-3376AAB8B5A0}.Release|ARM.Build.0 = Release|ARM
{7B252F1E-2E9D-4362-9C14-3376AAB8B5A0}.Release|ARM.Deploy.0 = Release|ARM
{7B252F1E-2E9D-4362-9C14-3376AAB8B5A0}.Release|x64.ActiveCfg = Release|x64
{7B252F1E-2E9D-4362-9C14-3376AAB8B5A0}.Release|x64.Build.0 = Release|x64
{7B252F1E-2E9D-4362-9C14-3376AAB8B5A0}.Release|x64.Deploy.0 = Release|x64
{7B252F1E-2E9D-4362-9C14-3376AAB8B5A0}.Release|x86.ActiveCfg = Release|x86
{7B252F1E-2E9D-4362-9C14-3376AAB8B5A0}.Release|x86.Build.0 = Release|x86
{7B252F1E-2E9D-4362-9C14-3376AAB8B5A0}.Release|x86.Deploy.0 = Release|x86
{1ADC3666-1DDB-48C4-9811-1E58B6D09A7C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1ADC3666-1DDB-48C4-9811-1E58B6D09A7C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1ADC3666-1DDB-48C4-9811-1E58B6D09A7C}.Debug|ARM.ActiveCfg = Debug|Any CPU
{1ADC3666-1DDB-48C4-9811-1E58B6D09A7C}.Debug|ARM.Build.0 = Debug|Any CPU
{1ADC3666-1DDB-48C4-9811-1E58B6D09A7C}.Debug|x64.ActiveCfg = Debug|Any CPU
{1ADC3666-1DDB-48C4-9811-1E58B6D09A7C}.Debug|x64.Build.0 = Debug|Any CPU
{1ADC3666-1DDB-48C4-9811-1E58B6D09A7C}.Debug|x86.ActiveCfg = Debug|Any CPU
{1ADC3666-1DDB-48C4-9811-1E58B6D09A7C}.Debug|x86.Build.0 = Debug|Any CPU
{1ADC3666-1DDB-48C4-9811-1E58B6D09A7C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1ADC3666-1DDB-48C4-9811-1E58B6D09A7C}.Release|Any CPU.Build.0 = Release|Any CPU
{1ADC3666-1DDB-48C4-9811-1E58B6D09A7C}.Release|ARM.ActiveCfg = Release|Any CPU
{1ADC3666-1DDB-48C4-9811-1E58B6D09A7C}.Release|ARM.Build.0 = Release|Any CPU
{1ADC3666-1DDB-48C4-9811-1E58B6D09A7C}.Release|x64.ActiveCfg = Release|Any CPU
{1ADC3666-1DDB-48C4-9811-1E58B6D09A7C}.Release|x64.Build.0 = Release|Any CPU
{1ADC3666-1DDB-48C4-9811-1E58B6D09A7C}.Release|x86.ActiveCfg = Release|Any CPU
{1ADC3666-1DDB-48C4-9811-1E58B6D09A7C}.Release|x86.Build.0 = Release|Any CPU
{92CAD93B-6C3B-45A0-A723-BE046DE50FEC}.Debug|Any CPU.ActiveCfg = Debug|x86
{92CAD93B-6C3B-45A0-A723-BE046DE50FEC}.Debug|Any CPU.Build.0 = Debug|x86
{92CAD93B-6C3B-45A0-A723-BE046DE50FEC}.Debug|Any CPU.Deploy.0 = Debug|x86
{92CAD93B-6C3B-45A0-A723-BE046DE50FEC}.Debug|ARM.ActiveCfg = Debug|ARM
{92CAD93B-6C3B-45A0-A723-BE046DE50FEC}.Debug|ARM.Build.0 = Debug|ARM
{92CAD93B-6C3B-45A0-A723-BE046DE50FEC}.Debug|ARM.Deploy.0 = Debug|ARM
{92CAD93B-6C3B-45A0-A723-BE046DE50FEC}.Debug|x64.ActiveCfg = Debug|x64
{92CAD93B-6C3B-45A0-A723-BE046DE50FEC}.Debug|x64.Build.0 = Debug|x64
{92CAD93B-6C3B-45A0-A723-BE046DE50FEC}.Debug|x64.Deploy.0 = Debug|x64
{92CAD93B-6C3B-45A0-A723-BE046DE50FEC}.Debug|x86.ActiveCfg = Debug|x86
{92CAD93B-6C3B-45A0-A723-BE046DE50FEC}.Debug|x86.Build.0 = Debug|x86
{92CAD93B-6C3B-45A0-A723-BE046DE50FEC}.Debug|x86.Deploy.0 = Debug|x86
{92CAD93B-6C3B-45A0-A723-BE046DE50FEC}.Release|Any CPU.ActiveCfg = Release|x86
{92CAD93B-6C3B-45A0-A723-BE046DE50FEC}.Release|ARM.ActiveCfg = Release|ARM
{92CAD93B-6C3B-45A0-A723-BE046DE50FEC}.Release|ARM.Build.0 = Release|ARM
{92CAD93B-6C3B-45A0-A723-BE046DE50FEC}.Release|ARM.Deploy.0 = Release|ARM
{92CAD93B-6C3B-45A0-A723-BE046DE50FEC}.Release|x64.ActiveCfg = Release|x64
{92CAD93B-6C3B-45A0-A723-BE046DE50FEC}.Release|x64.Build.0 = Release|x64
{92CAD93B-6C3B-45A0-A723-BE046DE50FEC}.Release|x64.Deploy.0 = Release|x64
{92CAD93B-6C3B-45A0-A723-BE046DE50FEC}.Release|x86.ActiveCfg = Release|x86
{92CAD93B-6C3B-45A0-A723-BE046DE50FEC}.Release|x86.Build.0 = Release|x86
{92CAD93B-6C3B-45A0-A723-BE046DE50FEC}.Release|x86.Deploy.0 = Release|x86
{170EE734-37F0-425F-822B-B865348ECEC6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{170EE734-37F0-425F-822B-B865348ECEC6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{170EE734-37F0-425F-822B-B865348ECEC6}.Debug|ARM.ActiveCfg = Debug|Any CPU
{170EE734-37F0-425F-822B-B865348ECEC6}.Debug|ARM.Build.0 = Debug|Any CPU
{170EE734-37F0-425F-822B-B865348ECEC6}.Debug|x64.ActiveCfg = Debug|Any CPU
{170EE734-37F0-425F-822B-B865348ECEC6}.Debug|x64.Build.0 = Debug|Any CPU
{170EE734-37F0-425F-822B-B865348ECEC6}.Debug|x86.ActiveCfg = Debug|Any CPU
{170EE734-37F0-425F-822B-B865348ECEC6}.Debug|x86.Build.0 = Debug|Any CPU
{170EE734-37F0-425F-822B-B865348ECEC6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{170EE734-37F0-425F-822B-B865348ECEC6}.Release|Any CPU.Build.0 = Release|Any CPU
{170EE734-37F0-425F-822B-B865348ECEC6}.Release|ARM.ActiveCfg = Release|Any CPU
{170EE734-37F0-425F-822B-B865348ECEC6}.Release|ARM.Build.0 = Release|Any CPU
{170EE734-37F0-425F-822B-B865348ECEC6}.Release|x64.ActiveCfg = Release|Any CPU
{170EE734-37F0-425F-822B-B865348ECEC6}.Release|x64.Build.0 = Release|Any CPU
{170EE734-37F0-425F-822B-B865348ECEC6}.Release|x86.ActiveCfg = Release|Any CPU
{170EE734-37F0-425F-822B-B865348ECEC6}.Release|x86.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{5DB6C7C7-A19C-4BE3-AFE6-26E3061DA01F} = {7ABA337E-6748-484E-A0F4-E1715E1C95F1}
{7ABA337E-6748-484E-A0F4-E1715E1C95F1} = {A4B9D59A-C8C6-4199-A7F3-F3AF0C748281}
{28B8E327-C504-4E08-B2CE-09D1CBB8B904} = {CF767486-305D-40EE-8845-58EF76C16D85}
{01FEC943-B537-4BCF-945A-6C914B06E448} = {A4B9D59A-C8C6-4199-A7F3-F3AF0C748281}
{7B252F1E-2E9D-4362-9C14-3376AAB8B5A0} = {01FEC943-B537-4BCF-945A-6C914B06E448}
{1ADC3666-1DDB-48C4-9811-1E58B6D09A7C} = {1701F3BA-A09C-4706-A612-24FD9340FC18}
{92CAD93B-6C3B-45A0-A723-BE046DE50FEC} = {28B8E327-C504-4E08-B2CE-09D1CBB8B904}
{979AE182-EB59-4181-9D45-3FD6E4817F11} = {28B8E327-C504-4E08-B2CE-09D1CBB8B904}
{170EE734-37F0-425F-822B-B865348ECEC6} = {28B8E327-C504-4E08-B2CE-09D1CBB8B904}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {03788B53-C0BF-485B-AA19-A9EAB0E9AF7B}
EndGlobalSection
EndGlobal

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 15
VisualStudioVersion = 15.0.27130.2003
MinimumVisualStudioVersion = 10.0.40219.1
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "NmeaParser", "NmeaParser", "{1701F3BA-A09C-4706-A612-24FD9340FC18}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Tests", "Tests", "{CF767486-305D-40EE-8845-58EF76C16D85}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SampleApp.WinDesktop", "SampleApp.WinDesktop\SampleApp.WinDesktop.csproj", "{5DB6C7C7-A19C-4BE3-AFE6-26E3061DA01F}"
ProjectSection(ProjectDependencies) = postProject
{1ADC3666-1DDB-48C4-9811-1E58B6D09A7C} = {1ADC3666-1DDB-48C4-9811-1E58B6D09A7C}
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Desktop", "Desktop", "{7ABA337E-6748-484E-A0F4-E1715E1C95F1}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "UnitTests", "UnitTests", "{28B8E327-C504-4E08-B2CE-09D1CBB8B904}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "SampleApps", "SampleApps", "{A4B9D59A-C8C6-4199-A7F3-F3AF0C748281}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{0EBBFC7B-43E8-4478-9951-50C842991A9C}"
ProjectSection(SolutionItems) = preProject
CustomDictionary.xml = CustomDictionary.xml
GlobalSuppressions.cs = GlobalSuppressions.cs
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "UWP", "UWP", "{01FEC943-B537-4BCF-945A-6C914B06E448}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SampleApp.UWP", "SampleApp.UWP\SampleApp.UWP.csproj", "{7B252F1E-2E9D-4362-9C14-3376AAB8B5A0}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "NmeaParser", "NmeaParser\NmeaParser.csproj", "{1ADC3666-1DDB-48C4-9811-1E58B6D09A7C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NmeaParser.Tests.UWP", "UnitTests\NmeaParser.Tests.UWP\NmeaParser.Tests.UWP.csproj", "{92CAD93B-6C3B-45A0-A723-BE046DE50FEC}"
EndProject
Project("{D954291E-2A0B-460D-934E-DC6B0785DB48}") = "NmeaParser.Tests", "UnitTests\NmeaParser.Tests\NmeaParser.Tests.shproj", "{979AE182-EB59-4181-9D45-3FD6E4817F11}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "NmeaParser.Tests.NET45", "UnitTests\NmeaParser.Tests.NET45\NmeaParser.Tests.NET45.csproj", "{170EE734-37F0-425F-822B-B865348ECEC6}"
ProjectSection(ProjectDependencies) = postProject
{1ADC3666-1DDB-48C4-9811-1E58B6D09A7C} = {1ADC3666-1DDB-48C4-9811-1E58B6D09A7C}
EndProjectSection
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Android", "Android", "{456E7573-3324-43CB-8BA0-8D9C300EEB50}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "SampleApp.Droid", "SampleApp.Droid\SampleApp.Droid.csproj", "{48540D33-4349-42D2-9D49-144A7049565A}"
EndProject
Global
GlobalSection(SharedMSBuildProjectFiles) = preSolution
UnitTests\NmeaParser.Tests\NmeaParser.Tests.projitems*{170ee734-37f0-425f-822b-b865348ecec6}*SharedItemsImports = 4
UnitTests\NmeaParser.Tests\NmeaParser.Tests.projitems*{92cad93b-6c3b-45a0-a723-be046de50fec}*SharedItemsImports = 4
UnitTests\NmeaParser.Tests\NmeaParser.Tests.projitems*{979ae182-eb59-4181-9d45-3fd6e4817f11}*SharedItemsImports = 13
EndGlobalSection
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Debug|ARM = Debug|ARM
Debug|x64 = Debug|x64
Debug|x86 = Debug|x86
Release|Any CPU = Release|Any CPU
Release|ARM = Release|ARM
Release|x64 = Release|x64
Release|x86 = Release|x86
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{5DB6C7C7-A19C-4BE3-AFE6-26E3061DA01F}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{5DB6C7C7-A19C-4BE3-AFE6-26E3061DA01F}.Debug|Any CPU.Build.0 = Debug|Any CPU
{5DB6C7C7-A19C-4BE3-AFE6-26E3061DA01F}.Debug|ARM.ActiveCfg = Debug|Any CPU
{5DB6C7C7-A19C-4BE3-AFE6-26E3061DA01F}.Debug|ARM.Build.0 = Debug|Any CPU
{5DB6C7C7-A19C-4BE3-AFE6-26E3061DA01F}.Debug|x64.ActiveCfg = Debug|Any CPU
{5DB6C7C7-A19C-4BE3-AFE6-26E3061DA01F}.Debug|x64.Build.0 = Debug|Any CPU
{5DB6C7C7-A19C-4BE3-AFE6-26E3061DA01F}.Debug|x86.ActiveCfg = Debug|Any CPU
{5DB6C7C7-A19C-4BE3-AFE6-26E3061DA01F}.Debug|x86.Build.0 = Debug|Any CPU
{5DB6C7C7-A19C-4BE3-AFE6-26E3061DA01F}.Release|Any CPU.ActiveCfg = Release|Any CPU
{5DB6C7C7-A19C-4BE3-AFE6-26E3061DA01F}.Release|Any CPU.Build.0 = Release|Any CPU
{5DB6C7C7-A19C-4BE3-AFE6-26E3061DA01F}.Release|ARM.ActiveCfg = Release|Any CPU
{5DB6C7C7-A19C-4BE3-AFE6-26E3061DA01F}.Release|ARM.Build.0 = Release|Any CPU
{5DB6C7C7-A19C-4BE3-AFE6-26E3061DA01F}.Release|x64.ActiveCfg = Release|Any CPU
{5DB6C7C7-A19C-4BE3-AFE6-26E3061DA01F}.Release|x64.Build.0 = Release|Any CPU
{5DB6C7C7-A19C-4BE3-AFE6-26E3061DA01F}.Release|x86.ActiveCfg = Release|Any CPU
{5DB6C7C7-A19C-4BE3-AFE6-26E3061DA01F}.Release|x86.Build.0 = Release|Any CPU
{7B252F1E-2E9D-4362-9C14-3376AAB8B5A0}.Debug|Any CPU.ActiveCfg = Debug|x86
{7B252F1E-2E9D-4362-9C14-3376AAB8B5A0}.Debug|Any CPU.Build.0 = Debug|x86
{7B252F1E-2E9D-4362-9C14-3376AAB8B5A0}.Debug|Any CPU.Deploy.0 = Debug|x86
{7B252F1E-2E9D-4362-9C14-3376AAB8B5A0}.Debug|ARM.ActiveCfg = Debug|ARM
{7B252F1E-2E9D-4362-9C14-3376AAB8B5A0}.Debug|ARM.Build.0 = Debug|ARM
{7B252F1E-2E9D-4362-9C14-3376AAB8B5A0}.Debug|ARM.Deploy.0 = Debug|ARM
{7B252F1E-2E9D-4362-9C14-3376AAB8B5A0}.Debug|x64.ActiveCfg = Debug|x64
{7B252F1E-2E9D-4362-9C14-3376AAB8B5A0}.Debug|x64.Build.0 = Debug|x64
{7B252F1E-2E9D-4362-9C14-3376AAB8B5A0}.Debug|x64.Deploy.0 = Debug|x64
{7B252F1E-2E9D-4362-9C14-3376AAB8B5A0}.Debug|x86.ActiveCfg = Debug|x86
{7B252F1E-2E9D-4362-9C14-3376AAB8B5A0}.Debug|x86.Build.0 = Debug|x86
{7B252F1E-2E9D-4362-9C14-3376AAB8B5A0}.Debug|x86.Deploy.0 = Debug|x86
{7B252F1E-2E9D-4362-9C14-3376AAB8B5A0}.Release|Any CPU.ActiveCfg = Release|x86
{7B252F1E-2E9D-4362-9C14-3376AAB8B5A0}.Release|Any CPU.Build.0 = Release|x86
{7B252F1E-2E9D-4362-9C14-3376AAB8B5A0}.Release|Any CPU.Deploy.0 = Release|x86
{7B252F1E-2E9D-4362-9C14-3376AAB8B5A0}.Release|ARM.ActiveCfg = Release|ARM
{7B252F1E-2E9D-4362-9C14-3376AAB8B5A0}.Release|ARM.Build.0 = Release|ARM
{7B252F1E-2E9D-4362-9C14-3376AAB8B5A0}.Release|ARM.Deploy.0 = Release|ARM
{7B252F1E-2E9D-4362-9C14-3376AAB8B5A0}.Release|x64.ActiveCfg = Release|x64
{7B252F1E-2E9D-4362-9C14-3376AAB8B5A0}.Release|x64.Build.0 = Release|x64
{7B252F1E-2E9D-4362-9C14-3376AAB8B5A0}.Release|x64.Deploy.0 = Release|x64
{7B252F1E-2E9D-4362-9C14-3376AAB8B5A0}.Release|x86.ActiveCfg = Release|x86
{7B252F1E-2E9D-4362-9C14-3376AAB8B5A0}.Release|x86.Build.0 = Release|x86
{7B252F1E-2E9D-4362-9C14-3376AAB8B5A0}.Release|x86.Deploy.0 = Release|x86
{1ADC3666-1DDB-48C4-9811-1E58B6D09A7C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1ADC3666-1DDB-48C4-9811-1E58B6D09A7C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1ADC3666-1DDB-48C4-9811-1E58B6D09A7C}.Debug|ARM.ActiveCfg = Debug|Any CPU
{1ADC3666-1DDB-48C4-9811-1E58B6D09A7C}.Debug|ARM.Build.0 = Debug|Any CPU
{1ADC3666-1DDB-48C4-9811-1E58B6D09A7C}.Debug|x64.ActiveCfg = Debug|Any CPU
{1ADC3666-1DDB-48C4-9811-1E58B6D09A7C}.Debug|x64.Build.0 = Debug|Any CPU
{1ADC3666-1DDB-48C4-9811-1E58B6D09A7C}.Debug|x86.ActiveCfg = Debug|Any CPU
{1ADC3666-1DDB-48C4-9811-1E58B6D09A7C}.Debug|x86.Build.0 = Debug|Any CPU
{1ADC3666-1DDB-48C4-9811-1E58B6D09A7C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1ADC3666-1DDB-48C4-9811-1E58B6D09A7C}.Release|Any CPU.Build.0 = Release|Any CPU
{1ADC3666-1DDB-48C4-9811-1E58B6D09A7C}.Release|ARM.ActiveCfg = Release|Any CPU
{1ADC3666-1DDB-48C4-9811-1E58B6D09A7C}.Release|ARM.Build.0 = Release|Any CPU
{1ADC3666-1DDB-48C4-9811-1E58B6D09A7C}.Release|x64.ActiveCfg = Release|Any CPU
{1ADC3666-1DDB-48C4-9811-1E58B6D09A7C}.Release|x64.Build.0 = Release|Any CPU
{1ADC3666-1DDB-48C4-9811-1E58B6D09A7C}.Release|x86.ActiveCfg = Release|Any CPU
{1ADC3666-1DDB-48C4-9811-1E58B6D09A7C}.Release|x86.Build.0 = Release|Any CPU
{92CAD93B-6C3B-45A0-A723-BE046DE50FEC}.Debug|Any CPU.ActiveCfg = Debug|x86
{92CAD93B-6C3B-45A0-A723-BE046DE50FEC}.Debug|Any CPU.Build.0 = Debug|x86
{92CAD93B-6C3B-45A0-A723-BE046DE50FEC}.Debug|Any CPU.Deploy.0 = Debug|x86
{92CAD93B-6C3B-45A0-A723-BE046DE50FEC}.Debug|ARM.ActiveCfg = Debug|ARM
{92CAD93B-6C3B-45A0-A723-BE046DE50FEC}.Debug|ARM.Build.0 = Debug|ARM
{92CAD93B-6C3B-45A0-A723-BE046DE50FEC}.Debug|ARM.Deploy.0 = Debug|ARM
{92CAD93B-6C3B-45A0-A723-BE046DE50FEC}.Debug|x64.ActiveCfg = Debug|x64
{92CAD93B-6C3B-45A0-A723-BE046DE50FEC}.Debug|x64.Build.0 = Debug|x64
{92CAD93B-6C3B-45A0-A723-BE046DE50FEC}.Debug|x64.Deploy.0 = Debug|x64
{92CAD93B-6C3B-45A0-A723-BE046DE50FEC}.Debug|x86.ActiveCfg = Debug|x86
{92CAD93B-6C3B-45A0-A723-BE046DE50FEC}.Debug|x86.Build.0 = Debug|x86
{92CAD93B-6C3B-45A0-A723-BE046DE50FEC}.Debug|x86.Deploy.0 = Debug|x86
{92CAD93B-6C3B-45A0-A723-BE046DE50FEC}.Release|Any CPU.ActiveCfg = Release|x86
{92CAD93B-6C3B-45A0-A723-BE046DE50FEC}.Release|ARM.ActiveCfg = Release|ARM
{92CAD93B-6C3B-45A0-A723-BE046DE50FEC}.Release|ARM.Build.0 = Release|ARM
{92CAD93B-6C3B-45A0-A723-BE046DE50FEC}.Release|ARM.Deploy.0 = Release|ARM
{92CAD93B-6C3B-45A0-A723-BE046DE50FEC}.Release|x64.ActiveCfg = Release|x64
{92CAD93B-6C3B-45A0-A723-BE046DE50FEC}.Release|x64.Build.0 = Release|x64
{92CAD93B-6C3B-45A0-A723-BE046DE50FEC}.Release|x64.Deploy.0 = Release|x64
{92CAD93B-6C3B-45A0-A723-BE046DE50FEC}.Release|x86.ActiveCfg = Release|x86
{92CAD93B-6C3B-45A0-A723-BE046DE50FEC}.Release|x86.Build.0 = Release|x86
{92CAD93B-6C3B-45A0-A723-BE046DE50FEC}.Release|x86.Deploy.0 = Release|x86
{170EE734-37F0-425F-822B-B865348ECEC6}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{170EE734-37F0-425F-822B-B865348ECEC6}.Debug|Any CPU.Build.0 = Debug|Any CPU
{170EE734-37F0-425F-822B-B865348ECEC6}.Debug|ARM.ActiveCfg = Debug|Any CPU
{170EE734-37F0-425F-822B-B865348ECEC6}.Debug|ARM.Build.0 = Debug|Any CPU
{170EE734-37F0-425F-822B-B865348ECEC6}.Debug|x64.ActiveCfg = Debug|Any CPU
{170EE734-37F0-425F-822B-B865348ECEC6}.Debug|x64.Build.0 = Debug|Any CPU
{170EE734-37F0-425F-822B-B865348ECEC6}.Debug|x86.ActiveCfg = Debug|Any CPU
{170EE734-37F0-425F-822B-B865348ECEC6}.Debug|x86.Build.0 = Debug|Any CPU
{170EE734-37F0-425F-822B-B865348ECEC6}.Release|Any CPU.ActiveCfg = Release|Any CPU
{170EE734-37F0-425F-822B-B865348ECEC6}.Release|Any CPU.Build.0 = Release|Any CPU
{170EE734-37F0-425F-822B-B865348ECEC6}.Release|ARM.ActiveCfg = Release|Any CPU
{170EE734-37F0-425F-822B-B865348ECEC6}.Release|ARM.Build.0 = Release|Any CPU
{170EE734-37F0-425F-822B-B865348ECEC6}.Release|x64.ActiveCfg = Release|Any CPU
{170EE734-37F0-425F-822B-B865348ECEC6}.Release|x64.Build.0 = Release|Any CPU
{170EE734-37F0-425F-822B-B865348ECEC6}.Release|x86.ActiveCfg = Release|Any CPU
{170EE734-37F0-425F-822B-B865348ECEC6}.Release|x86.Build.0 = Release|Any CPU
{48540D33-4349-42D2-9D49-144A7049565A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{48540D33-4349-42D2-9D49-144A7049565A}.Debug|Any CPU.Build.0 = Debug|Any CPU
{48540D33-4349-42D2-9D49-144A7049565A}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
{48540D33-4349-42D2-9D49-144A7049565A}.Debug|ARM.ActiveCfg = Debug|Any CPU
{48540D33-4349-42D2-9D49-144A7049565A}.Debug|ARM.Build.0 = Debug|Any CPU
{48540D33-4349-42D2-9D49-144A7049565A}.Debug|ARM.Deploy.0 = Debug|Any CPU
{48540D33-4349-42D2-9D49-144A7049565A}.Debug|x64.ActiveCfg = Debug|Any CPU
{48540D33-4349-42D2-9D49-144A7049565A}.Debug|x64.Build.0 = Debug|Any CPU
{48540D33-4349-42D2-9D49-144A7049565A}.Debug|x64.Deploy.0 = Debug|Any CPU
{48540D33-4349-42D2-9D49-144A7049565A}.Debug|x86.ActiveCfg = Debug|Any CPU
{48540D33-4349-42D2-9D49-144A7049565A}.Debug|x86.Build.0 = Debug|Any CPU
{48540D33-4349-42D2-9D49-144A7049565A}.Debug|x86.Deploy.0 = Debug|Any CPU
{48540D33-4349-42D2-9D49-144A7049565A}.Release|Any CPU.ActiveCfg = Release|Any CPU
{48540D33-4349-42D2-9D49-144A7049565A}.Release|Any CPU.Build.0 = Release|Any CPU
{48540D33-4349-42D2-9D49-144A7049565A}.Release|Any CPU.Deploy.0 = Release|Any CPU
{48540D33-4349-42D2-9D49-144A7049565A}.Release|ARM.ActiveCfg = Release|Any CPU
{48540D33-4349-42D2-9D49-144A7049565A}.Release|ARM.Build.0 = Release|Any CPU
{48540D33-4349-42D2-9D49-144A7049565A}.Release|ARM.Deploy.0 = Release|Any CPU
{48540D33-4349-42D2-9D49-144A7049565A}.Release|x64.ActiveCfg = Release|Any CPU
{48540D33-4349-42D2-9D49-144A7049565A}.Release|x64.Build.0 = Release|Any CPU
{48540D33-4349-42D2-9D49-144A7049565A}.Release|x64.Deploy.0 = Release|Any CPU
{48540D33-4349-42D2-9D49-144A7049565A}.Release|x86.ActiveCfg = Release|Any CPU
{48540D33-4349-42D2-9D49-144A7049565A}.Release|x86.Build.0 = Release|Any CPU
{48540D33-4349-42D2-9D49-144A7049565A}.Release|x86.Deploy.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(NestedProjects) = preSolution
{5DB6C7C7-A19C-4BE3-AFE6-26E3061DA01F} = {7ABA337E-6748-484E-A0F4-E1715E1C95F1}
{7ABA337E-6748-484E-A0F4-E1715E1C95F1} = {A4B9D59A-C8C6-4199-A7F3-F3AF0C748281}
{28B8E327-C504-4E08-B2CE-09D1CBB8B904} = {CF767486-305D-40EE-8845-58EF76C16D85}
{01FEC943-B537-4BCF-945A-6C914B06E448} = {A4B9D59A-C8C6-4199-A7F3-F3AF0C748281}
{7B252F1E-2E9D-4362-9C14-3376AAB8B5A0} = {01FEC943-B537-4BCF-945A-6C914B06E448}
{1ADC3666-1DDB-48C4-9811-1E58B6D09A7C} = {1701F3BA-A09C-4706-A612-24FD9340FC18}
{92CAD93B-6C3B-45A0-A723-BE046DE50FEC} = {28B8E327-C504-4E08-B2CE-09D1CBB8B904}
{979AE182-EB59-4181-9D45-3FD6E4817F11} = {28B8E327-C504-4E08-B2CE-09D1CBB8B904}
{170EE734-37F0-425F-822B-B865348ECEC6} = {28B8E327-C504-4E08-B2CE-09D1CBB8B904}
{456E7573-3324-43CB-8BA0-8D9C300EEB50} = {A4B9D59A-C8C6-4199-A7F3-F3AF0C748281}
{48540D33-4349-42D2-9D49-144A7049565A} = {456E7573-3324-43CB-8BA0-8D9C300EEB50}
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {03788B53-C0BF-485B-AA19-A9EAB0E9AF7B}
EndGlobalSection
EndGlobal

View file

@ -1,7 +1,7 @@
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<TargetFrameworks>netstandard1.4;net451;monoandroid50;xamarinios10;uap10.0</TargetFrameworks>
<TargetFrameworks>netstandard1.4;net451;monoandroid50;monoandroid70;xamarinios10;uap10.0</TargetFrameworks>
<GeneratePackageOnBuild>true</GeneratePackageOnBuild>
<GenerateDocumentationFile>true</GenerateDocumentationFile>
<Configurations>Debug;Release</Configurations>
@ -35,7 +35,11 @@
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'monoandroid50'">
<DefineConstants>$(DefineConstants);XAMARIN</DefineConstants>
<DefineConstants>$(DefineConstants);XAMARIN;API_LEVEL_21</DefineConstants>
<Product>NMEA Parser - Android</Product>
</PropertyGroup>
<PropertyGroup Condition="'$(TargetFramework)' == 'monoandroid70'">
<DefineConstants>$(DefineConstants);XAMARIN;API_LEVEL_24</DefineConstants>
<Product>NMEA Parser - Android</Product>
</PropertyGroup>

View file

@ -0,0 +1,196 @@
#if __ANDROID__
using System;
using System.Collections.Generic;
using System.IO;
using System.Text;
using System.Threading.Tasks;
using Android.Content;
using Android.Locations;
using Android.App;
using Android.OS;
using System.Globalization;
namespace NmeaParser
{
/// <summary>
/// This class provides access to the Android system location service's raw NMEA stream
/// The <c>ACCESS_FINE_LOCATION</c> permission is required.
/// </summary>
public class SystemNmeaDevice : NmeaDevice
{
private StringStream stream;
private Listener listener;
private LocationManager manager;
/// <summary>
/// Initializes a new instance of the <see cref="SystemNmeaListener"/> class.
/// </summary>
public SystemNmeaDevice()
{
manager = Application.Context.GetSystemService(Context.LocationService) as LocationManager;
}
/// <inheritdoc />
[Android.Runtime.RequiresPermission("android.permission.ACCESS_FINE_LOCATION")]
protected override Task<Stream> OpenStreamAsync()
{
if(!manager.IsProviderEnabled(LocationManager.GpsProvider))
{
throw new InvalidOperationException("The GPS Location Provider is not enabled");
}
stream = new StringStream();
listener = new Listener();
listener.NmeaMessage += (s, e) => stream?.Append(e);
bool success = manager.AddNmeaListener(listener);
manager.RequestLocationUpdates(LocationManager.GpsProvider, 100, .1f, listener );
return Task.FromResult<Stream>(stream);
}
/// <inheritdoc />
protected override Task CloseStreamAsync(Stream stream)
{
manager.RemoveNmeaListener(listener);
listener.Dispose();
listener = null;
stream.Dispose();
return Task.FromResult<object>(null);
}
private class Listener : Java.Lang.Object,
#if API_LEVEL_24
IOnNmeaMessageListener,
#else
GpsStatus.INmeaListener,
#endif
ILocationListener
{
private bool _isNmeaSupported = false;
#if API_LEVEL_24
void IOnNmeaMessageListener.OnNmeaMessage(string message, long timestamp)
#else
void GpsStatus.INmeaListener.OnNmeaReceived(long timestamp, string message)
#endif
{
_isNmeaSupported = true;
NmeaMessage?.Invoke(this, message);
}
public event EventHandler<string> NmeaMessage;
void ILocationListener.OnLocationChanged(Location location)
{
if (_isNmeaSupported) return;
if (location.Provider != LocationManager.GpsProvider) return;
// Not all Android devices support reporting NMEA, so we'll fallback to just generating
// simple RMC and GGA message so the provider continues to work across multiple devices
// $GPRMC:
List<string> values = new List<string>(12);
values.Add("$GPRMC");
DateTimeOffset d = DateTimeOffset.FromUnixTimeMilliseconds(location.Time);
values.Add(d.ToString("hhmmss"));
values.Add("A");
var lat = Math.Floor(Math.Abs(location.Latitude));
var latfrac = (Math.Abs(location.Latitude) - lat) * 60;
values.Add($"{lat.ToString("00")}{latfrac.ToString(CultureInfo.InvariantCulture)}");
values.Add(location.Latitude < 0 ? "S" : "N");
var lon = Math.Floor(Math.Abs(location.Longitude));
var lonfrac = (Math.Abs(location.Longitude) - lon) * 60;
values.Add($"{lon.ToString("000")}{lonfrac.ToString(CultureInfo.InvariantCulture)}");
values.Add(location.Longitude < 0 ? "W" : "E");
values.Add(location.HasSpeed ? location.Speed.ToString(CultureInfo.InvariantCulture) : "");
values.Add(location.HasBearing ? location.Bearing.ToString(CultureInfo.InvariantCulture) : "");
values.Add(d.ToString("ddMMyy"));
values.Add(""); //Variation
values.Add(""); //East/West
NmeaMessage?.Invoke(this, string.Join(",", values) + "\n");
// $GPGGA:
int satellites = 0;
if(location.Extras != null && location.Extras.ContainsKey("satellites"))
{
satellites = Convert.ToInt32(location.Extras.Get("satellites"));
}
values = new List<string>(13);
values.Add("$GPGGA");
values.Add(d.ToString("hhmmss"));
values.Add($"{lat.ToString("00")}{latfrac.ToString(CultureInfo.InvariantCulture)}");
values.Add(location.Latitude < 0 ? "S" : "N");
values.Add($"{lon.ToString("000")}{lonfrac.ToString(CultureInfo.InvariantCulture)}");
values.Add(location.Longitude < 0 ? "W" : "E");
values.Add("1"); //Fix Quality:
values.Add(satellites.ToString()); //Number of Satellites
values.Add(""); //HDOP
values.Add(location.HasAltitude ? location.Altitude.ToString(CultureInfo.InvariantCulture) : "");
values.Add("M"); //Altitude units
values.Add(""); //Height of geoid above WGS84 ellipsoid
values.Add(""); //Geoid height units
values.Add(""); //Time since last DGPS update
values.Add(""); //DGPS reference station id
NmeaMessage?.Invoke(this, string.Join(",", values) + "\n");
}
void ILocationListener.OnProviderDisabled(string provider) { }
void ILocationListener.OnProviderEnabled(string provider) { }
void ILocationListener.OnStatusChanged(string provider, Availability status, Bundle extras) { }
}
/// <summary>
/// Class for converting streaming strings into a stream
/// </summary>
private class StringStream : Stream
{
object lockObject = new object();
Queue<byte> stream = new Queue<byte>();
long position = 0;
public StringStream() { }
public override bool CanRead => true;
public override bool CanSeek => false;
public override bool CanWrite => false;
public override long Length => throw new NotImplementedException();
public override long Position { get => position; set => throw new NotSupportedException(); }
public void Append(string data)
{
lock (lockObject)
{
foreach (byte b in Encoding.UTF8.GetBytes(data))
{
stream.Enqueue(b);
}
}
}
public override void Flush() { }
public override int Read(byte[] buffer, int offset, int count)
{
lock (lockObject)
{
for (int i = 0; i < count; i++)
{
if (stream.Count == 0)
return i;
buffer[offset + i] = stream.Dequeue();
}
}
return count;
}
public override long Seek(long offset, SeekOrigin origin) => throw new NotSupportedException();
public override void SetLength(long value) => throw new NotSupportedException();
public override void Write(byte[] buffer, int offset, int count) => throw new NotSupportedException();
}
}
}
#endif

View file

@ -0,0 +1,81 @@
using Android.App;
using Android.Widget;
using Android.OS;
using Android;
using Android.Support.V4.App;
using Android.Support.V4.Content;
using Android.Content.PM;
using System;
using System.Collections.Generic;
using System.Linq;
using NmeaParser.Nmea.Gps;
using NmeaParser.Nmea;
namespace SampleApp.Droid
{
[Activity(Label = "SampleApp.Droid", MainLauncher = true)]
public class MainActivity : Activity
{
protected override void OnCreate(Bundle savedInstanceState)
{
base.OnCreate(savedInstanceState);
// Set our view from the "main" layout resource
SetContentView(Resource.Layout.Main);
Start();
}
private NmeaParser.SystemNmeaDevice listener;
private TextView status;
private bool launched;
private async void Start()
{
if (ContextCompat.CheckSelfPermission(this, Manifest.Permission.AccessFineLocation) != Permission.Granted)
{
ActivityCompat.RequestPermissions(this, new[] { Manifest.Permission.AccessFineLocation }, 1000);
return;
}
if (launched)
return;
launched = true;
listener = new NmeaParser.SystemNmeaDevice();
listener.MessageReceived += Listener_MessageReceived;
status = FindViewById<TextView>(Resource.Id.output);
status.Text = "Opening device...";
await listener.OpenAsync();
}
protected override void OnResume()
{
base.OnResume();
// if it was resumed by the GPS permissions dialog
Start();
}
Queue<NmeaParser.Nmea.NmeaMessage> messages = new Queue<NmeaParser.Nmea.NmeaMessage>(100);
private void Listener_MessageReceived(object sender, NmeaParser.NmeaMessageReceivedEventArgs e)
{
var message = e.Message;
RunOnUiThread(() =>
{
if (messages.Count == 100) messages.Dequeue();
messages.Enqueue(message);
status.Text = string.Join("\n", messages.Reverse().Select(n=>n.ToString()));
if(message is Rmc rmc)
{
FindViewById<TextView>(Resource.Id.latitude).Text = "Latitude = " + rmc.Latitude.ToString();
FindViewById<TextView>(Resource.Id.longitude).Text = "Longitude = " + rmc.Longitude.ToString();
}
else if (message is Gga gga)
{
FindViewById<TextView>(Resource.Id.altitude).Text = "Altitude = " + gga.Altitude.ToString() + " " + gga.AltitudeUnits.ToString();
}
});
}
}
}

View file

@ -0,0 +1,7 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="SampleApp.Droid.SampleApp.Droid" android:versionCode="1" android:versionName="1.0" android:installLocation="auto">
<uses-sdk android:minSdkVersion="21" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<application android:allowBackup="true" android:label="@string/app_name"></application>
</manifest>

View file

@ -0,0 +1,30 @@
using System.Reflection;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;
using Android.App;
// General Information about an assembly is controlled through the following
// set of attributes. Change these attribute values to modify the information
// associated with an assembly.
[assembly: AssemblyTitle("SampleApp.Droid")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("SampleApp.Droid")]
[assembly: AssemblyCopyright("Copyright © 2018")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
[assembly: ComVisible(false)]
// Version information for an assembly consists of the following four values:
//
// Major Version
// Minor Version
// Build Number
// Revision
//
// You can specify all the values or you can default the Build and Revision Numbers
// by using the '*' as shown below:
// [assembly: AssemblyVersion("1.0.*")]
[assembly: AssemblyVersion("1.0.0.0")]
[assembly: AssemblyFileVersion("1.0.0.0")]

View file

@ -0,0 +1,102 @@
#pragma warning disable 1591
//------------------------------------------------------------------------------
// <auto-generated>
// This code was generated by a tool.
// Runtime Version:4.0.30319.42000
//
// Changes to this file may cause incorrect behavior and will be lost if
// the code is regenerated.
// </auto-generated>
//------------------------------------------------------------------------------
[assembly: global::Android.Runtime.ResourceDesignerAttribute("SampleApp.Droid.Resource", IsApplication=true)]
namespace SampleApp.Droid
{
[System.CodeDom.Compiler.GeneratedCodeAttribute("Xamarin.Android.Build.Tasks", "1.0.0.0")]
public partial class Resource
{
static Resource()
{
global::Android.Runtime.ResourceIdManager.UpdateIdValues();
}
public static void UpdateIdValues()
{
}
public partial class Attribute
{
static Attribute()
{
global::Android.Runtime.ResourceIdManager.UpdateIdValues();
}
private Attribute()
{
}
}
public partial class Id
{
// aapt resource value: 0x7f040002
public const int altitude = 2130968578;
// aapt resource value: 0x7f040001
public const int latitude = 2130968577;
// aapt resource value: 0x7f040000
public const int longitude = 2130968576;
// aapt resource value: 0x7f040003
public const int output = 2130968579;
static Id()
{
global::Android.Runtime.ResourceIdManager.UpdateIdValues();
}
private Id()
{
}
}
public partial class Layout
{
// aapt resource value: 0x7f020000
public const int Main = 2130837504;
static Layout()
{
global::Android.Runtime.ResourceIdManager.UpdateIdValues();
}
private Layout()
{
}
}
public partial class String
{
// aapt resource value: 0x7f030000
public const int app_name = 2130903040;
static String()
{
global::Android.Runtime.ResourceIdManager.UpdateIdValues();
}
private String()
{
}
}
}
}
#pragma warning restore 1591

View file

@ -0,0 +1,21 @@
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical"
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView android:id="@+id/longitude"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView android:id="@+id/latitude"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView android:id="@+id/altitude"
android:layout_width="match_parent"
android:layout_height="wrap_content" />
<TextView
android:id="@+id/output"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbars="vertical"
/>
</LinearLayout>

View file

@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name">NMEA Parser SampleApp</string>
</resources>

View file

@ -0,0 +1,103 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{48540D33-4349-42D2-9D49-144A7049565A}</ProjectGuid>
<ProjectTypeGuids>{EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>SampleApp.Droid</RootNamespace>
<AssemblyName>SampleApp.Droid</AssemblyName>
<FileAlignment>512</FileAlignment>
<AndroidApplication>True</AndroidApplication>
<AndroidResgenFile>Resources\Resource.Designer.cs</AndroidResgenFile>
<AndroidResgenClass>Resource</AndroidResgenClass>
<GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
<AndroidUseLatestPlatformSdk>True</AndroidUseLatestPlatformSdk>
<TargetFrameworkVersion>v8.1</TargetFrameworkVersion>
<AndroidManifest>Properties\AndroidManifest.xml</AndroidManifest>
<MonoAndroidResourcePrefix>Resources</MonoAndroidResourcePrefix>
<MonoAndroidAssetsPrefix>Assets</MonoAndroidAssetsPrefix>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup>
<RestoreProjectStyle>PackageReference</RestoreProjectStyle>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>True</DebugSymbols>
<DebugType>Full</DebugType>
<Optimize>False</Optimize>
<OutputPath>bin\Debug\</OutputPath>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AndroidUseSharedRuntime>True</AndroidUseSharedRuntime>
<AndroidLinkMode>None</AndroidLinkMode>
<EmbedAssembliesIntoApk>False</EmbedAssembliesIntoApk>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugSymbols>True</DebugSymbols>
<DebugType>PdbOnly</DebugType>
<Optimize>True</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AndroidManagedSymbols>true</AndroidManagedSymbols>
<AndroidUseSharedRuntime>False</AndroidUseSharedRuntime>
<AndroidLinkMode>SdkOnly</AndroidLinkMode>
<EmbedAssembliesIntoApk>True</EmbedAssembliesIntoApk>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Xml" />
<Reference Include="System.Core" />
<Reference Include="Mono.Android" />
</ItemGroup>
<ItemGroup>
<Compile Include="MainActivity.cs" />
<Compile Include="Resources\Resource.Designer.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="Properties\AndroidManifest.xml" />
</ItemGroup>
<ItemGroup>
<AndroidResource Include="Resources\layout\Main.axml">
<SubType>Designer</SubType>
</AndroidResource>
<AndroidResource Include="Resources\values\Strings.xml" />
</ItemGroup>
<ItemGroup>
<Folder Include="Assets\" />
<Folder Include="Resources\drawable\" />
<Folder Include="Resources\mipmap-hdpi\" />
<Folder Include="Resources\mipmap-mdpi\" />
<Folder Include="Resources\mipmap-xhdpi\" />
<Folder Include="Resources\mipmap-xxhdpi\" />
<Folder Include="Resources\mipmap-xxxhdpi\" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Xamarin.Android.Support.v4">
<Version>27.0.2</Version>
</PackageReference>
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\NmeaParser\NmeaParser.csproj">
<Project>{1adc3666-1ddb-48c4-9811-1e58b6d09a7c}</Project>
<Name>NmeaParser</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" />
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
Other similar extension points exist, see Microsoft.Common.targets.
<Target Name="BeforeBuild">
</Target>
<Target Name="AfterBuild">
</Target>
-->
</Project>