diff --git a/.vs/SkimmerScammer/v15/.suo b/.vs/SkimmerScammer/v15/.suo new file mode 100644 index 0000000..981467d Binary files /dev/null and b/.vs/SkimmerScammer/v15/.suo differ diff --git a/.vs/SkimmerScammer/v15/sqlite3/storage.ide b/.vs/SkimmerScammer/v15/sqlite3/storage.ide new file mode 100644 index 0000000..1e43725 Binary files /dev/null and b/.vs/SkimmerScammer/v15/sqlite3/storage.ide differ diff --git a/App4/About.cs b/App4/About.cs new file mode 100644 index 0000000..09f6493 --- /dev/null +++ b/App4/About.cs @@ -0,0 +1,35 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +using Android.App; +using Android.Content; +using Android.OS; +using Android.Runtime; +using Android.Views; +using Android.Widget; + +namespace SkimmerScanner +{ + [Activity(Label = "About")] + public class About : Activity + { + protected override void OnCreate(Bundle savedInstanceState) + { + base.OnCreate(savedInstanceState); + + SetContentView(Resource.Layout.About); + + var link = FindViewById(Resource.Id.textView3); + link.Click += (sender, e) => + { + var uri = Android.Net.Uri.Parse("https://learn.sparkfun.com/tutorials/gas-pump-skimmers"); + var intent = new Intent(Intent.ActionView, uri); + StartActivity(intent); + }; + + + } + } +} \ No newline at end of file diff --git a/App4/Alert.cs b/App4/Alert.cs new file mode 100644 index 0000000..7467a6c --- /dev/null +++ b/App4/Alert.cs @@ -0,0 +1,26 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Text; + +using Android.App; +using Android.Content; +using Android.OS; +using Android.Runtime; +using Android.Views; +using Android.Widget; + +namespace SkimmerScanner +{ + [Activity(Label = "Alert")] + public class Alert : Activity + { + protected override void OnCreate(Bundle savedInstanceState) + { + base.OnCreate(savedInstanceState); + + SetContentView(Resource.Layout.Red); + + } + } +} \ No newline at end of file diff --git a/App4/App4.csproj.bak b/App4/App4.csproj.bak new file mode 100644 index 0000000..468dd1b --- /dev/null +++ b/App4/App4.csproj.bak @@ -0,0 +1,89 @@ + + + + Debug + AnyCPU + 8.0.30703 + 2.0 + {4B19E3A9-B0DA-4B66-B515-6AD7B796CEA3} + {EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC} + Library + Properties + App4 + App4 + 512 + True + Resources\Resource.Designer.cs + Resource + Off + True + v6.0 + Properties\AndroidManifest.xml + Resources + Assets + + + True + Full + False + bin\Debug\ + DEBUG;TRACE + prompt + 4 + True + None + False + + + True + PdbOnly + True + bin\Release\ + TRACE + prompt + 4 + true + False + SdkOnly + True + + + + + + + + + + + + + + + + + + + + + Designer + + + + + + + + + + + + + + \ No newline at end of file diff --git a/App4/Assets/AboutAssets.txt b/App4/Assets/AboutAssets.txt new file mode 100644 index 0000000..ee39886 --- /dev/null +++ b/App4/Assets/AboutAssets.txt @@ -0,0 +1,19 @@ +Any raw assets you want to be deployed with your application can be placed in +this directory (and child directories) and given a Build Action of "AndroidAsset". + +These files will be deployed with you package and will be accessible using Android's +AssetManager, like this: + +public class ReadAsset : Activity +{ + protected override void OnCreate (Bundle bundle) + { + base.OnCreate (bundle); + + InputStream input = Assets.Open ("my_asset.txt"); + } +} + +Additionally, some Android functions will automatically load asset files: + +Typeface tf = Typeface.CreateFromAsset (Context.Assets, "fonts/samplefont.ttf"); \ No newline at end of file diff --git a/App4/GettingStarted.Xamarin b/App4/GettingStarted.Xamarin new file mode 100644 index 0000000..e9d4f6a --- /dev/null +++ b/App4/GettingStarted.Xamarin @@ -0,0 +1,4 @@ + + GS\Android\CS\AndroidApp\GettingStarted.html + false + \ No newline at end of file diff --git a/App4/MainActivity.cs b/App4/MainActivity.cs new file mode 100644 index 0000000..4593ef2 --- /dev/null +++ b/App4/MainActivity.cs @@ -0,0 +1,297 @@ +using Android.App; +using Android.Widget; +using Android.OS; +using Android.Bluetooth; +using Android.Content; +using System; +using System.IO; + +namespace SkimmerScanner +{ + [Activity(Label = "Skimmer Scanner", MainLauncher = true)] + public class MainActivity : Activity + { + private BluetoothAdapter btAdapter; + private Receiver receiver; + + protected override void OnCreate(Bundle savedInstanceState) + { + base.OnCreate(savedInstanceState); + + // Set our view from the "main" layout resource + SetContentView(Resource.Layout.Main); + + BluetoothAdapter mBluetoothAdapter = BluetoothAdapter.DefaultAdapter; + if (mBluetoothAdapter == null) + { + // Device does not support Bluetooth + } + + if (!mBluetoothAdapter.IsEnabled) + { + Intent enableBtIntent = new Intent(BluetoothAdapter.ActionRequestEnable); + int REQUEST_ENABLE_BT = 0; + StartActivityForResult(enableBtIntent, REQUEST_ENABLE_BT); + } + + // Register for broadcasts when a device is discovered + receiver = new Receiver(this); + var filter = new IntentFilter(BluetoothDevice.ActionFound); + RegisterReceiver(receiver, filter); + + // Register for broadcasts when discovery has finished + filter = new IntentFilter(BluetoothAdapter.ActionDiscoveryFinished); + RegisterReceiver(receiver, filter); + + // Register for broadcasts when a device tries to pair + filter = new IntentFilter(BluetoothDevice.ActionPairingRequest); + RegisterReceiver(receiver, filter); + + + // Get the local Bluetooth adapter + btAdapter = BluetoothAdapter.DefaultAdapter; + + var scanButton = FindViewById