Update Android sample app

This commit is contained in:
Morten Nielsen 2020-08-28 15:30:30 -07:00
parent 62c20a6bfd
commit 741163f28f
4 changed files with 66 additions and 47 deletions

View file

@ -1,8 +1,8 @@
using Android.App;
using Android.Widget;
using Android.OS;
using Android;
using Android.Support.V4.App;
using Android;
using Android.Support.V4.App;
using Android.Support.V4.Content;
using Android.Content.PM;
using System;
@ -12,7 +12,7 @@ using NmeaParser.Messages;
namespace SampleApp.Droid
{
[Activity(Label = "NMEA Parser SampleApp", MainLauncher = true)]
[Activity(Label = "NMEA Parser SampleApp", MainLauncher = true, Icon = "@drawable/icon")]
public class MainActivity : Activity
{
private Button startButton;
@ -33,9 +33,7 @@ namespace SampleApp.Droid
devices.Add("System GPS", null);
var devicePicker = FindViewById<Spinner>(Resource.Id.device_picker);
Java.Util.UUID SERIAL_UUID = Java.Util.UUID.FromString("00001101-0000-1000-8000-00805F9B34FB");
var adapter = Android.Bluetooth.BluetoothAdapter.DefaultAdapter;
foreach (var d in adapter.BondedDevices.Where(d => d.GetUuids().Where(t => t.Uuid.ToString().Equals("00001101-0000-1000-8000-00805F9B34FB", StringComparison.InvariantCultureIgnoreCase)).Any()))
foreach(var d in NmeaParser.BluetoothDevice.GetBluetoothSerialDevices())
{
devices[d.Name + " " + d.Address] = d.Address;
}

View file

@ -194,40 +194,43 @@ namespace SampleApp.Droid
{
// aapt resource value: 0x7F050000
public const int notification_action_background = 2131034112;
public const int icon = 2131034112;
// aapt resource value: 0x7F050001
public const int notification_bg = 2131034113;
public const int notification_action_background = 2131034113;
// aapt resource value: 0x7F050002
public const int notification_bg_low = 2131034114;
public const int notification_bg = 2131034114;
// aapt resource value: 0x7F050003
public const int notification_bg_low_normal = 2131034115;
public const int notification_bg_low = 2131034115;
// aapt resource value: 0x7F050004
public const int notification_bg_low_pressed = 2131034116;
public const int notification_bg_low_normal = 2131034116;
// aapt resource value: 0x7F050005
public const int notification_bg_normal = 2131034117;
public const int notification_bg_low_pressed = 2131034117;
// aapt resource value: 0x7F050006
public const int notification_bg_normal_pressed = 2131034118;
public const int notification_bg_normal = 2131034118;
// aapt resource value: 0x7F050007
public const int notification_icon_background = 2131034119;
public const int notification_bg_normal_pressed = 2131034119;
// aapt resource value: 0x7F050008
public const int notification_template_icon_bg = 2131034120;
public const int notification_icon_background = 2131034120;
// aapt resource value: 0x7F050009
public const int notification_template_icon_low_bg = 2131034121;
public const int notification_template_icon_bg = 2131034121;
// aapt resource value: 0x7F05000A
public const int notification_tile_bg = 2131034122;
public const int notification_template_icon_low_bg = 2131034122;
// aapt resource value: 0x7F05000B
public const int notify_panel_notification_icon_bg = 2131034123;
public const int notification_tile_bg = 2131034123;
// aapt resource value: 0x7F05000C
public const int notify_panel_notification_icon_bg = 2131034124;
static Drawable()
{
@ -446,14 +449,30 @@ namespace SampleApp.Droid
}
}
public partial class String
public partial class Mipmap
{
// aapt resource value: 0x7F090000
public const int app_name = 2131296256;
public const int icon = 2131296256;
// aapt resource value: 0x7F090001
public const int status_bar_notification_info_overflow = 2131296257;
static Mipmap()
{
global::Android.Runtime.ResourceIdManager.UpdateIdValues();
}
private Mipmap()
{
}
}
public partial class String
{
// aapt resource value: 0x7F0A0000
public const int app_name = 2131361792;
// aapt resource value: 0x7F0A0001
public const int status_bar_notification_info_overflow = 2131361793;
static String()
{
@ -468,41 +487,41 @@ namespace SampleApp.Droid
public partial class Style
{
// aapt resource value: 0x7F0A0000
public const int TextAppearance_Compat_Notification = 2131361792;
// aapt resource value: 0x7F0B0000
public const int TextAppearance_Compat_Notification = 2131427328;
// aapt resource value: 0x7F0A0001
public const int TextAppearance_Compat_Notification_Info = 2131361793;
// aapt resource value: 0x7F0B0001
public const int TextAppearance_Compat_Notification_Info = 2131427329;
// aapt resource value: 0x7F0A0002
public const int TextAppearance_Compat_Notification_Info_Media = 2131361794;
// aapt resource value: 0x7F0B0002
public const int TextAppearance_Compat_Notification_Info_Media = 2131427330;
// aapt resource value: 0x7F0A0003
public const int TextAppearance_Compat_Notification_Line2 = 2131361795;
// aapt resource value: 0x7F0B0003
public const int TextAppearance_Compat_Notification_Line2 = 2131427331;
// aapt resource value: 0x7F0A0004
public const int TextAppearance_Compat_Notification_Line2_Media = 2131361796;
// aapt resource value: 0x7F0B0004
public const int TextAppearance_Compat_Notification_Line2_Media = 2131427332;
// aapt resource value: 0x7F0A0005
public const int TextAppearance_Compat_Notification_Media = 2131361797;
// aapt resource value: 0x7F0B0005
public const int TextAppearance_Compat_Notification_Media = 2131427333;
// aapt resource value: 0x7F0A0006
public const int TextAppearance_Compat_Notification_Time = 2131361798;
// aapt resource value: 0x7F0B0006
public const int TextAppearance_Compat_Notification_Time = 2131427334;
// aapt resource value: 0x7F0A0007
public const int TextAppearance_Compat_Notification_Time_Media = 2131361799;
// aapt resource value: 0x7F0B0007
public const int TextAppearance_Compat_Notification_Time_Media = 2131427335;
// aapt resource value: 0x7F0A0008
public const int TextAppearance_Compat_Notification_Title = 2131361800;
// aapt resource value: 0x7F0B0008
public const int TextAppearance_Compat_Notification_Title = 2131427336;
// aapt resource value: 0x7F0A0009
public const int TextAppearance_Compat_Notification_Title_Media = 2131361801;
// aapt resource value: 0x7F0B0009
public const int TextAppearance_Compat_Notification_Title_Media = 2131427337;
// aapt resource value: 0x7F0A000A
public const int Widget_Compat_NotificationActionContainer = 2131361802;
// aapt resource value: 0x7F0B000A
public const int Widget_Compat_NotificationActionContainer = 2131427338;
// aapt resource value: 0x7F0A000B
public const int Widget_Compat_NotificationActionText = 2131361803;
// aapt resource value: 0x7F0B000B
public const int Widget_Compat_NotificationActionText = 2131427339;
static Style()
{

Binary file not shown.

After

Width:  |  Height:  |  Size: 12 KiB

View file

@ -73,7 +73,6 @@
</ItemGroup>
<ItemGroup>
<Folder Include="Assets\" />
<Folder Include="Resources\drawable\" />
<Folder Include="Resources\mipmap-hdpi\" />
<Folder Include="Resources\mipmap-mdpi\" />
<Folder Include="Resources\mipmap-xhdpi\" />
@ -91,6 +90,9 @@
<Name>NmeaParser</Name>
</ProjectReference>
</ItemGroup>
<ItemGroup>
<AndroidResource Include="Resources\drawable\icon.png" />
</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.