From 85ddadde5f75f75780282266a89c12da3b695b00 Mon Sep 17 00:00:00 2001 From: Allen Wolf <63997543+aaw3@users.noreply.github.com> Date: Wed, 10 Jan 2024 21:25:08 -0600 Subject: [PATCH] Add project --- src/Assets/AboutAssets.txt | 19 + src/Connection.cs | 43 + src/FunctionsPage.cs | 442 + src/MainActivity.cs | 403 + src/Properties/AndroidManifest.xml | 7 + src/Properties/AssemblyInfo.cs | 30 + src/Resources/AboutResources.txt | 44 + src/Resources/Resource.designer.cs | 8781 +++++++++++++++++ src/Resources/layout/PicturePage.cs | 447 + src/Resources/layout/activity_main.xml | 90 + src/Resources/layout/functions_page.xml | 99 + src/Resources/layout/picture_page.xml | 17 + .../mipmap-anydpi-v26/ic_launcher.xml | 5 + .../mipmap-anydpi-v26/ic_launcher_round.xml | 5 + src/Resources/mipmap-hdpi/ic_launcher.png | Bin 0 -> 1634 bytes .../mipmap-hdpi/ic_launcher_foreground.png | Bin 0 -> 1441 bytes .../mipmap-hdpi/ic_launcher_round.png | Bin 0 -> 3552 bytes src/Resources/mipmap-mdpi/ic_launcher.png | Bin 0 -> 1362 bytes .../mipmap-mdpi/ic_launcher_foreground.png | Bin 0 -> 958 bytes .../mipmap-mdpi/ic_launcher_round.png | Bin 0 -> 2413 bytes src/Resources/mipmap-xhdpi/ic_launcher.png | Bin 0 -> 2307 bytes .../mipmap-xhdpi/ic_launcher_foreground.png | Bin 0 -> 2056 bytes .../mipmap-xhdpi/ic_launcher_round.png | Bin 0 -> 4858 bytes src/Resources/mipmap-xxhdpi/ic_launcher.png | Bin 0 -> 3871 bytes .../mipmap-xxhdpi/ic_launcher_foreground.png | Bin 0 -> 3403 bytes .../mipmap-xxhdpi/ic_launcher_round.png | Bin 0 -> 8001 bytes src/Resources/mipmap-xxxhdpi/ic_launcher.png | Bin 0 -> 5016 bytes .../mipmap-xxxhdpi/ic_launcher_foreground.png | Bin 0 -> 4889 bytes .../mipmap-xxxhdpi/ic_launcher_round.png | Bin 0 -> 10893 bytes src/Resources/values/colors.xml | 6 + .../values/ic_launcher_background.xml | 4 + src/Resources/values/strings.xml | 4 + src/Resources/values/styles.xml | 11 + src/TCPCommanderAndroid.csproj | 132 + src/TCPCommanderAndroid.sln | 27 + 35 files changed, 10616 insertions(+) create mode 100755 src/Assets/AboutAssets.txt create mode 100755 src/Connection.cs create mode 100755 src/FunctionsPage.cs create mode 100755 src/MainActivity.cs create mode 100755 src/Properties/AndroidManifest.xml create mode 100755 src/Properties/AssemblyInfo.cs create mode 100755 src/Resources/AboutResources.txt create mode 100755 src/Resources/Resource.designer.cs create mode 100755 src/Resources/layout/PicturePage.cs create mode 100755 src/Resources/layout/activity_main.xml create mode 100755 src/Resources/layout/functions_page.xml create mode 100755 src/Resources/layout/picture_page.xml create mode 100755 src/Resources/mipmap-anydpi-v26/ic_launcher.xml create mode 100755 src/Resources/mipmap-anydpi-v26/ic_launcher_round.xml create mode 100755 src/Resources/mipmap-hdpi/ic_launcher.png create mode 100755 src/Resources/mipmap-hdpi/ic_launcher_foreground.png create mode 100755 src/Resources/mipmap-hdpi/ic_launcher_round.png create mode 100755 src/Resources/mipmap-mdpi/ic_launcher.png create mode 100755 src/Resources/mipmap-mdpi/ic_launcher_foreground.png create mode 100755 src/Resources/mipmap-mdpi/ic_launcher_round.png create mode 100755 src/Resources/mipmap-xhdpi/ic_launcher.png create mode 100755 src/Resources/mipmap-xhdpi/ic_launcher_foreground.png create mode 100755 src/Resources/mipmap-xhdpi/ic_launcher_round.png create mode 100755 src/Resources/mipmap-xxhdpi/ic_launcher.png create mode 100755 src/Resources/mipmap-xxhdpi/ic_launcher_foreground.png create mode 100755 src/Resources/mipmap-xxhdpi/ic_launcher_round.png create mode 100755 src/Resources/mipmap-xxxhdpi/ic_launcher.png create mode 100755 src/Resources/mipmap-xxxhdpi/ic_launcher_foreground.png create mode 100755 src/Resources/mipmap-xxxhdpi/ic_launcher_round.png create mode 100755 src/Resources/values/colors.xml create mode 100755 src/Resources/values/ic_launcher_background.xml create mode 100755 src/Resources/values/strings.xml create mode 100755 src/Resources/values/styles.xml create mode 100755 src/TCPCommanderAndroid.csproj create mode 100755 src/TCPCommanderAndroid.sln diff --git a/src/Assets/AboutAssets.txt b/src/Assets/AboutAssets.txt new file mode 100755 index 0000000..2f59e2c --- /dev/null +++ b/src/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 your 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/src/Connection.cs b/src/Connection.cs new file mode 100755 index 0000000..e796a20 --- /dev/null +++ b/src/Connection.cs @@ -0,0 +1,43 @@ +using System; +using System.Collections.Generic; +using System.Linq; +using System.Net.Sockets; +using System.Text; + +//using Android.App; +//using Android.Content; +//using Android.OS; +//using Android.Runtime; +//using Android.Views; +//using Android.Widget; + +namespace TCPCommanderAndroid +{ + public class TCP_Connection + { + private static TCP_Connection _TCP_instance; + public static TCP_Connection TCP_Instance + { + get + { + if (_TCP_instance == null) _TCP_instance = new TCP_Connection(); + return _TCP_instance; + } + } + public TcpClient client { get; set; } + } + + public class UDP_Connection + { + private static UDP_Connection _UDP_instance; + public static UDP_Connection UDP_Instance + { + get + { + if (_UDP_instance == null) _UDP_instance = new UDP_Connection(); + return _UDP_instance; + } + } + public UdpClient client { get; set; } + } +} \ No newline at end of file diff --git a/src/FunctionsPage.cs b/src/FunctionsPage.cs new file mode 100755 index 0000000..8fa412a --- /dev/null +++ b/src/FunctionsPage.cs @@ -0,0 +1,442 @@ +using System; +using System.Collections.Generic; +using System.Diagnostics; +using System.IO; +using System.Linq; +using System.Net.NetworkInformation; +using System.Net.Sockets; +using System.Text; + +using Android.App; +using Android.Content; +using Android.OS; +using Android.Runtime; +using Android.Views; +using Android.Widget; + +namespace TCPCommanderAndroid +{ + [Activity(Label = "FunctionsPage", ScreenOrientation = Android.Content.PM.ScreenOrientation.Portrait)] + public class FunctionsPage : Activity + { + public static string storedprivIP; + Show_Dialog dialog; + Button testButton; + Button pingButton; + Button shutdownButton; + Button monitorONButton; + Button monitorOFFButton; + Button screenshotButton; + Button PCLockButton; + //ImageView screenshotView; + Vibrator vibrator; + byte[] buffer = new byte[1]; + System.Timers.Timer connectionTimer; + protected override void OnCreate(Bundle savedInstanceState) + { + base.OnCreate(savedInstanceState); + SetContentView(Resource.Layout.functions_page); + + dialog = new Show_Dialog(this); + + testButton = FindViewById