Commit 6fc1e1f4 authored by Martin Finkel's avatar Martin Finkel

add initial local network project

parent 7fc2ad68
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");
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{24CE3C36-16B9-426D-AA0C-5961ECF8D88C}</ProjectGuid>
<ProjectTypeGuids>{EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<TemplateGuid>{9AA2D3C6-3393-45F1-8E7C-5A9901728795}</TemplateGuid>
<OutputType>Library</OutputType>
<RootNamespace>LocalNetwork.Droid</RootNamespace>
<AssemblyName>LocalNetwork.Android</AssemblyName>
<AndroidApplication>True</AndroidApplication>
<AndroidResgenFile>Resources\Resource.designer.cs</AndroidResgenFile>
<AndroidResgenClass>Resource</AndroidResgenClass>
<AndroidManifest>Properties\AndroidManifest.xml</AndroidManifest>
<MonoAndroidResourcePrefix>Resources</MonoAndroidResourcePrefix>
<MonoAndroidAssetsPrefix>Assets</MonoAndroidAssetsPrefix>
<AndroidUseLatestPlatformSdk>false</AndroidUseLatestPlatformSdk>
<TargetFrameworkVersion>v8.1</TargetFrameworkVersion>
<AndroidHttpClientHandlerType>Xamarin.Android.Net.AndroidClientHandler</AndroidHttpClientHandlerType>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>portable</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug</OutputPath>
<DefineConstants>DEBUG;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AndroidLinkMode>None</AndroidLinkMode>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AndroidManagedSymbols>true</AndroidManagedSymbols>
<AndroidUseSharedRuntime>false</AndroidUseSharedRuntime>
</PropertyGroup>
<ItemGroup>
<Reference Include="Mono.Android" />
<Reference Include="System" />
<Reference Include="System.Core" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Xamarin.Forms" Version="3.4.0.1008975" />
<PackageReference Include="Xamarin.Android.Support.Design" Version="27.0.2.1" />
<PackageReference Include="Xamarin.Android.Support.v7.AppCompat" Version="27.0.2.1" />
<PackageReference Include="Xamarin.Android.Support.v4" Version="27.0.2.1" />
<PackageReference Include="Xamarin.Android.Support.v7.CardView" Version="27.0.2.1" />
<PackageReference Include="Xamarin.Android.Support.v7.MediaRouter" Version="27.0.2.1" />
</ItemGroup>
<ItemGroup>
<Compile Include="MainActivity.cs" />
<Compile Include="Resources\Resource.designer.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\AboutResources.txt" />
<None Include="Assets\AboutAssets.txt" />
<None Include="Properties\AndroidManifest.xml" />
</ItemGroup>
<ItemGroup>
<AndroidResource Include="Resources\layout\Tabbar.axml" />
<AndroidResource Include="Resources\layout\Toolbar.axml" />
<AndroidResource Include="Resources\values\styles.xml" />
<AndroidResource Include="Resources\values\colors.xml" />
<AndroidResource Include="Resources\mipmap-anydpi-v26\icon.xml" />
<AndroidResource Include="Resources\mipmap-anydpi-v26\icon_round.xml" />
<AndroidResource Include="Resources\mipmap-hdpi\icon.png" />
<AndroidResource Include="Resources\mipmap-hdpi\launcher_foreground.png" />
<AndroidResource Include="Resources\mipmap-mdpi\icon.png" />
<AndroidResource Include="Resources\mipmap-mdpi\launcher_foreground.png" />
<AndroidResource Include="Resources\mipmap-xhdpi\icon.png" />
<AndroidResource Include="Resources\mipmap-xhdpi\launcher_foreground.png" />
<AndroidResource Include="Resources\mipmap-xxhdpi\icon.png" />
<AndroidResource Include="Resources\mipmap-xxhdpi\launcher_foreground.png" />
<AndroidResource Include="Resources\mipmap-xxxhdpi\icon.png" />
<AndroidResource Include="Resources\mipmap-xxxhdpi\launcher_foreground.png" />
<AndroidResource Include="Resources\drawable\xamarin_logo.png" />
</ItemGroup>
<ItemGroup>
<Folder Include="Resources\drawable-hdpi\" />
<Folder Include="Resources\drawable-xhdpi\" />
<Folder Include="Resources\drawable-xxhdpi\" />
<Folder Include="Resources\drawable-xxxhdpi\" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\LocalNetwork\LocalNetwork.csproj">
<Project>{D25AAC32-AED0-4010-AD34-674E24C69543}</Project>
<Name>LocalNetwork</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" />
</Project>
\ No newline at end of file
using System;
using Android.App;
using Android.Content.PM;
using Android.Runtime;
using Android.Views;
using Android.Widget;
using Android.OS;
namespace LocalNetwork.Droid
{
[Activity(Label = "LocalNetwork", Icon = "@mipmap/icon", Theme = "@style/MainTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)]
public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity
{
protected override void OnCreate(Bundle savedInstanceState)
{
TabLayoutResource = Resource.Layout.Tabbar;
ToolbarResource = Resource.Layout.Toolbar;
base.OnCreate(savedInstanceState);
global::Xamarin.Forms.Forms.Init(this, savedInstanceState);
LoadApplication(new App());
}
}
}
\ No newline at end of file
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="com.companyname.LocalNetwork">
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="27" />
<application android:label="LocalNetwork.Android"></application>
</manifest>
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("LocalNetwork.Android")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("LocalNetwork.Android")]
[assembly: AssemblyCopyright("Copyright © 2014")]
[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")]
// Add some common permissions, these can be removed if not needed
[assembly: UsesPermission(Android.Manifest.Permission.Internet)]
[assembly: UsesPermission(Android.Manifest.Permission.WriteExternalStorage)]
Images, layout descriptions, binary blobs and string dictionaries can be included
in your application as resource files. Various Android APIs are designed to
operate on the resource IDs instead of dealing with images, strings or binary blobs
directly.
For example, a sample Android app that contains a user interface layout (main.xml),
an internationalization string table (strings.xml) and some icons (drawable-XXX/icon.png)
would keep its resources in the "Resources" directory of the application:
Resources/
drawable-hdpi/
icon.png
drawable-ldpi/
icon.png
drawable-mdpi/
icon.png
layout/
main.xml
values/
strings.xml
In order to get the build system to recognize Android resources, set the build action to
"AndroidResource". The native Android APIs do not operate directly with filenames, but
instead operate on resource IDs. When you compile an Android application that uses resources,
the build system will package the resources for distribution and generate a class called
"Resource" that contains the tokens for each one of the resources included. For example,
for the above Resources layout, this is what the Resource class would expose:
public class Resource {
public class drawable {
public const int icon = 0x123;
}
public class layout {
public const int main = 0x456;
}
public class strings {
public const int first_string = 0xabc;
public const int second_string = 0xbcd;
}
}
You would then use R.drawable.icon to reference the drawable/icon.png file, or Resource.layout.main
to reference the layout/main.xml file, or Resource.strings.first_string to reference the first
string in the dictionary file values/strings.xml.
#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("LocalNetwork.Droid.Resource", IsApplication=true)]
namespace LocalNetwork.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()
{
global::Xamarin.Forms.Platform.Android.Resource.Attribute.actionBarSize = global::LocalNetwork.Droid.Resource.Attribute.actionBarSize;
}
public partial class Animation
{
// aapt resource value: 0x7f050000
public const int abc_fade_in = 2131034112;
// aapt resource value: 0x7f050001
public const int abc_fade_out = 2131034113;
// aapt resource value: 0x7f050002
public const int abc_grow_fade_in_from_bottom = 2131034114;
// aapt resource value: 0x7f050003
public const int abc_popup_enter = 2131034115;
// aapt resource value: 0x7f050004
public const int abc_popup_exit = 2131034116;
// aapt resource value: 0x7f050005
public const int abc_shrink_fade_out_from_bottom = 2131034117;
// aapt resource value: 0x7f050006
public const int abc_slide_in_bottom = 2131034118;
// aapt resource value: 0x7f050007
public const int abc_slide_in_top = 2131034119;
// aapt resource value: 0x7f050008
public const int abc_slide_out_bottom = 2131034120;
// aapt resource value: 0x7f050009
public const int abc_slide_out_top = 2131034121;
// aapt resource value: 0x7f05000a
public const int design_bottom_sheet_slide_in = 2131034122;
// aapt resource value: 0x7f05000b
public const int design_bottom_sheet_slide_out = 2131034123;
// aapt resource value: 0x7f05000c
public const int design_snackbar_in = 2131034124;
// aapt resource value: 0x7f05000d
public const int design_snackbar_out = 2131034125;
// aapt resource value: 0x7f05000e
public const int tooltip_enter = 2131034126;
// aapt resource value: 0x7f05000f
public const int tooltip_exit = 2131034127;
static Animation()
{
global::Android.Runtime.ResourceIdManager.UpdateIdValues();
}
private Animation()
{
}
}
public partial class Animator
{
// aapt resource value: 0x7f060000
public const int design_appbar_state_list_animator = 2131099648;
static Animator()
{
global::Android.Runtime.ResourceIdManager.UpdateIdValues();
}
private Animator()
{
}
}
public partial class Attribute
{
// aapt resource value: 0x7f01006b
public const int actionBarDivider = 2130772075;
// aapt resource value: 0x7f01006c
public const int actionBarItemBackground = 2130772076;
// aapt resource value: 0x7f010065
public const int actionBarPopupTheme = 2130772069;
// aapt resource value: 0x7f01006a
public const int actionBarSize = 2130772074;
// aapt resource value: 0x7f010067
public const int actionBarSplitStyle = 2130772071;
// aapt resource value: 0x7f010066
public const int actionBarStyle = 2130772070;
// aapt resource value: 0x7f010061
public const int actionBarTabBarStyle = 2130772065;
// aapt resource value: 0x7f010060
public const int actionBarTabStyle = 2130772064;
// aapt resource value: 0x7f010062
public const int actionBarTabTextStyle = 2130772066;
// aapt resource value: 0x7f010068
public const int actionBarTheme = 2130772072;
// aapt resource value: 0x7f010069
public const int actionBarWidgetTheme = 2130772073;
// aapt resource value: 0x7f010086
public const int actionButtonStyle = 2130772102;
// aapt resource value: 0x7f010082
public const int actionDropDownStyle = 2130772098;
// aapt resource value: 0x7f0100dd
public const int actionLayout = 2130772189;
// aapt resource value: 0x7f01006d
public const int actionMenuTextAppearance = 2130772077;
// aapt resource value: 0x7f01006e
public const int actionMenuTextColor = 2130772078;
// aapt resource value: 0x7f010071
public const int actionModeBackground = 2130772081;
// aapt resource value: 0x7f010070
public const int actionModeCloseButtonStyle = 2130772080;
// aapt resource value: 0x7f010073
public const int actionModeCloseDrawable = 2130772083;
// aapt resource value: 0x7f010075
public const int actionModeCopyDrawable = 2130772085;
// aapt resource value: 0x7f010074
public const int actionModeCutDrawable = 2130772084;
// aapt resource value: 0x7f010079
public const int actionModeFindDrawable = 2130772089;
// aapt resource value: 0x7f010076
public const int actionModePasteDrawable = 2130772086;
// aapt resource value: 0x7f01007b
public const int actionModePopupWindowStyle = 2130772091;
// aapt resource value: 0x7f010077
public const int actionModeSelectAllDrawable = 2130772087;
// aapt resource value: 0x7f010078
public const int actionModeShareDrawable = 2130772088;
// aapt resource value: 0x7f010072
public const int actionModeSplitBackground = 2130772082;
// aapt resource value: 0x7f01006f
public const int actionModeStyle = 2130772079;
// aapt resource value: 0x7f01007a
public const int actionModeWebSearchDrawable = 2130772090;
// aapt resource value: 0x7f010063
public const int actionOverflowButtonStyle = 2130772067;
// aapt resource value: 0x7f010064
public const int actionOverflowMenuStyle = 2130772068;
// aapt resource value: 0x7f0100df
public const int actionProviderClass = 2130772191;
// aapt resource value: 0x7f0100de
public const int actionViewClass = 2130772190;
// aapt resource value: 0x7f01008e
public const int activityChooserViewStyle = 2130772110;
// aapt resource value: 0x7f0100b3
public const int alertDialogButtonGroupStyle = 2130772147;
// aapt resource value: 0x7f0100b4
public const int alertDialogCenterButtons = 2130772148;
// aapt resource value: 0x7f0100b2
public const int alertDialogStyle = 2130772146;
// aapt resource value: 0x7f0100b5
public const int alertDialogTheme = 2130772149;
// aapt resource value: 0x7f0100cb
public const int allowStacking = 2130772171;
// aapt resource value: 0x7f0100cc
public const int alpha = 2130772172;
// aapt resource value: 0x7f0100da
public const int alphabeticModifiers = 2130772186;
// aapt resource value: 0x7f0100d3
public const int arrowHeadLength = 2130772179;
// aapt resource value: 0x7f0100d4
public const int arrowShaftLength = 2130772180;
// aapt resource value: 0x7f0100ba
public const int autoCompleteTextViewStyle = 2130772154;
// aapt resource value: 0x7f010054
public const int autoSizeMaxTextSize = 2130772052;
// aapt resource value: 0x7f010053
public const int autoSizeMinTextSize = 2130772051;
// aapt resource value: 0x7f010052
public const int autoSizePresetSizes = 2130772050;
// aapt resource value: 0x7f010051
public const int autoSizeStepGranularity = 2130772049;
// aapt resource value: 0x7f010050
public const int autoSizeTextType = 2130772048;
// aapt resource value: 0x7f01002e
public const int background = 2130772014;
// aapt resource value: 0x7f010030
public const int backgroundSplit = 2130772016;
// aapt resource value: 0x7f01002f
public const int backgroundStacked = 2130772015;
// aapt resource value: 0x7f010116
public const int backgroundTint = 2130772246;
// aapt resource value: 0x7f010117
public const int backgroundTintMode = 2130772247;
// aapt resource value: 0x7f0100d5
public const int barLength = 2130772181;
// aapt resource value: 0x7f010141
public const int behavior_autoHide = 2130772289;
// aapt resource value: 0x7f01011e
public const int behavior_hideable = 2130772254;
// aapt resource value: 0x7f01014a
public const int behavior_overlapTop = 2130772298;
// aapt resource value: 0x7f01011d
public const int behavior_peekHeight = 2130772253;
// aapt resource value: 0x7f01011f
public const int behavior_skipCollapsed = 2130772255;
// aapt resource value: 0x7f01013f
public const int borderWidth = 2130772287;
// aapt resource value: 0x7f01008b
public const int borderlessButtonStyle = 2130772107;
// aapt resource value: 0x7f010139
public const int bottomSheetDialogTheme = 2130772281;
// aapt resource value: 0x7f01013a
public const int bottomSheetStyle = 2130772282;
// aapt resource value: 0x7f010088
public const int buttonBarButtonStyle = 2130772104;
// aapt resource value: 0x7f0100b8
public const int buttonBarNegativeButtonStyle = 2130772152;
// aapt resource value: 0x7f0100b9
public const int buttonBarNeutralButtonStyle = 2130772153;
// aapt resource value: 0x7f0100b7
public const int buttonBarPositiveButtonStyle = 2130772151;
// aapt resource value: 0x7f010087
public const int buttonBarStyle = 2130772103;
// aapt resource value: 0x7f01010b
public const int buttonGravity = 2130772235;
// aapt resource value: 0x7f010043
public const int buttonPanelSideLayout = 2130772035;
// aapt resource value: 0x7f0100bb