Skip to content

Commit 74deb3c

Browse files
committed
Added Xamarin.Forms iOS sample
1 parent 2ecc886 commit 74deb3c

File tree

98 files changed

+9870
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

98 files changed

+9870
-0
lines changed
Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
2+
Microsoft Visual Studio Solution File, Format Version 12.00
3+
# Visual Studio 15
4+
VisualStudioVersion = 15.0.27130.2010
5+
MinimumVisualStudioVersion = 10.0.40219.1
6+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "DataChannelOrtc.iOS", "DataChannelOrtc\DataChannelOrtc.iOS\DataChannelOrtc.iOS.csproj", "{81C511DA-15C6-4D70-9DBA-4DC52A17C5BF}"
7+
EndProject
8+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "DataChannelOrtc", "DataChannelOrtc\DataChannelOrtc\DataChannelOrtc.csproj", "{BCD618BB-FDBF-472B-AF6D-4E44CE533EA2}"
9+
EndProject
10+
Global
11+
GlobalSection(SolutionConfigurationPlatforms) = preSolution
12+
Ad-Hoc|Any CPU = Ad-Hoc|Any CPU
13+
Ad-Hoc|ARM = Ad-Hoc|ARM
14+
Ad-Hoc|iPhone = Ad-Hoc|iPhone
15+
Ad-Hoc|iPhoneSimulator = Ad-Hoc|iPhoneSimulator
16+
Ad-Hoc|x64 = Ad-Hoc|x64
17+
Ad-Hoc|x86 = Ad-Hoc|x86
18+
AppStore|Any CPU = AppStore|Any CPU
19+
AppStore|ARM = AppStore|ARM
20+
AppStore|iPhone = AppStore|iPhone
21+
AppStore|iPhoneSimulator = AppStore|iPhoneSimulator
22+
AppStore|x64 = AppStore|x64
23+
AppStore|x86 = AppStore|x86
24+
Debug|Any CPU = Debug|Any CPU
25+
Debug|ARM = Debug|ARM
26+
Debug|iPhone = Debug|iPhone
27+
Debug|iPhoneSimulator = Debug|iPhoneSimulator
28+
Debug|x64 = Debug|x64
29+
Debug|x86 = Debug|x86
30+
Release|Any CPU = Release|Any CPU
31+
Release|ARM = Release|ARM
32+
Release|iPhone = Release|iPhone
33+
Release|iPhoneSimulator = Release|iPhoneSimulator
34+
Release|x64 = Release|x64
35+
Release|x86 = Release|x86
36+
EndGlobalSection
37+
GlobalSection(ProjectConfigurationPlatforms) = postSolution
38+
{81C511DA-15C6-4D70-9DBA-4DC52A17C5BF}.Ad-Hoc|Any CPU.ActiveCfg = Ad-Hoc|iPhone
39+
{81C511DA-15C6-4D70-9DBA-4DC52A17C5BF}.Ad-Hoc|ARM.ActiveCfg = Ad-Hoc|iPhone
40+
{81C511DA-15C6-4D70-9DBA-4DC52A17C5BF}.Ad-Hoc|iPhone.ActiveCfg = Ad-Hoc|iPhone
41+
{81C511DA-15C6-4D70-9DBA-4DC52A17C5BF}.Ad-Hoc|iPhone.Build.0 = Ad-Hoc|iPhone
42+
{81C511DA-15C6-4D70-9DBA-4DC52A17C5BF}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Ad-Hoc|iPhoneSimulator
43+
{81C511DA-15C6-4D70-9DBA-4DC52A17C5BF}.Ad-Hoc|iPhoneSimulator.Build.0 = Ad-Hoc|iPhoneSimulator
44+
{81C511DA-15C6-4D70-9DBA-4DC52A17C5BF}.Ad-Hoc|x64.ActiveCfg = Ad-Hoc|iPhone
45+
{81C511DA-15C6-4D70-9DBA-4DC52A17C5BF}.Ad-Hoc|x86.ActiveCfg = Ad-Hoc|iPhone
46+
{81C511DA-15C6-4D70-9DBA-4DC52A17C5BF}.AppStore|Any CPU.ActiveCfg = AppStore|iPhone
47+
{81C511DA-15C6-4D70-9DBA-4DC52A17C5BF}.AppStore|ARM.ActiveCfg = AppStore|iPhone
48+
{81C511DA-15C6-4D70-9DBA-4DC52A17C5BF}.AppStore|iPhone.ActiveCfg = AppStore|iPhone
49+
{81C511DA-15C6-4D70-9DBA-4DC52A17C5BF}.AppStore|iPhone.Build.0 = AppStore|iPhone
50+
{81C511DA-15C6-4D70-9DBA-4DC52A17C5BF}.AppStore|iPhoneSimulator.ActiveCfg = AppStore|iPhoneSimulator
51+
{81C511DA-15C6-4D70-9DBA-4DC52A17C5BF}.AppStore|iPhoneSimulator.Build.0 = AppStore|iPhoneSimulator
52+
{81C511DA-15C6-4D70-9DBA-4DC52A17C5BF}.AppStore|x64.ActiveCfg = AppStore|iPhone
53+
{81C511DA-15C6-4D70-9DBA-4DC52A17C5BF}.AppStore|x86.ActiveCfg = AppStore|iPhone
54+
{81C511DA-15C6-4D70-9DBA-4DC52A17C5BF}.Debug|Any CPU.ActiveCfg = Debug|iPhone
55+
{81C511DA-15C6-4D70-9DBA-4DC52A17C5BF}.Debug|ARM.ActiveCfg = Debug|iPhone
56+
{81C511DA-15C6-4D70-9DBA-4DC52A17C5BF}.Debug|iPhone.ActiveCfg = Debug|iPhone
57+
{81C511DA-15C6-4D70-9DBA-4DC52A17C5BF}.Debug|iPhone.Build.0 = Debug|iPhone
58+
{81C511DA-15C6-4D70-9DBA-4DC52A17C5BF}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator
59+
{81C511DA-15C6-4D70-9DBA-4DC52A17C5BF}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator
60+
{81C511DA-15C6-4D70-9DBA-4DC52A17C5BF}.Debug|x64.ActiveCfg = Debug|iPhone
61+
{81C511DA-15C6-4D70-9DBA-4DC52A17C5BF}.Debug|x86.ActiveCfg = Debug|iPhone
62+
{81C511DA-15C6-4D70-9DBA-4DC52A17C5BF}.Release|Any CPU.ActiveCfg = Release|iPhone
63+
{81C511DA-15C6-4D70-9DBA-4DC52A17C5BF}.Release|ARM.ActiveCfg = Release|iPhone
64+
{81C511DA-15C6-4D70-9DBA-4DC52A17C5BF}.Release|iPhone.ActiveCfg = Release|iPhone
65+
{81C511DA-15C6-4D70-9DBA-4DC52A17C5BF}.Release|iPhone.Build.0 = Release|iPhone
66+
{81C511DA-15C6-4D70-9DBA-4DC52A17C5BF}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator
67+
{81C511DA-15C6-4D70-9DBA-4DC52A17C5BF}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator
68+
{81C511DA-15C6-4D70-9DBA-4DC52A17C5BF}.Release|x64.ActiveCfg = Release|iPhone
69+
{81C511DA-15C6-4D70-9DBA-4DC52A17C5BF}.Release|x86.ActiveCfg = Release|iPhone
70+
{BCD618BB-FDBF-472B-AF6D-4E44CE533EA2}.Ad-Hoc|Any CPU.ActiveCfg = Debug|Any CPU
71+
{BCD618BB-FDBF-472B-AF6D-4E44CE533EA2}.Ad-Hoc|Any CPU.Build.0 = Debug|Any CPU
72+
{BCD618BB-FDBF-472B-AF6D-4E44CE533EA2}.Ad-Hoc|ARM.ActiveCfg = Debug|Any CPU
73+
{BCD618BB-FDBF-472B-AF6D-4E44CE533EA2}.Ad-Hoc|ARM.Build.0 = Debug|Any CPU
74+
{BCD618BB-FDBF-472B-AF6D-4E44CE533EA2}.Ad-Hoc|iPhone.ActiveCfg = Debug|Any CPU
75+
{BCD618BB-FDBF-472B-AF6D-4E44CE533EA2}.Ad-Hoc|iPhone.Build.0 = Debug|Any CPU
76+
{BCD618BB-FDBF-472B-AF6D-4E44CE533EA2}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Debug|Any CPU
77+
{BCD618BB-FDBF-472B-AF6D-4E44CE533EA2}.Ad-Hoc|iPhoneSimulator.Build.0 = Debug|Any CPU
78+
{BCD618BB-FDBF-472B-AF6D-4E44CE533EA2}.Ad-Hoc|x64.ActiveCfg = Debug|Any CPU
79+
{BCD618BB-FDBF-472B-AF6D-4E44CE533EA2}.Ad-Hoc|x64.Build.0 = Debug|Any CPU
80+
{BCD618BB-FDBF-472B-AF6D-4E44CE533EA2}.Ad-Hoc|x86.ActiveCfg = Debug|Any CPU
81+
{BCD618BB-FDBF-472B-AF6D-4E44CE533EA2}.Ad-Hoc|x86.Build.0 = Debug|Any CPU
82+
{BCD618BB-FDBF-472B-AF6D-4E44CE533EA2}.AppStore|Any CPU.ActiveCfg = Debug|Any CPU
83+
{BCD618BB-FDBF-472B-AF6D-4E44CE533EA2}.AppStore|Any CPU.Build.0 = Debug|Any CPU
84+
{BCD618BB-FDBF-472B-AF6D-4E44CE533EA2}.AppStore|ARM.ActiveCfg = Debug|Any CPU
85+
{BCD618BB-FDBF-472B-AF6D-4E44CE533EA2}.AppStore|ARM.Build.0 = Debug|Any CPU
86+
{BCD618BB-FDBF-472B-AF6D-4E44CE533EA2}.AppStore|iPhone.ActiveCfg = Debug|Any CPU
87+
{BCD618BB-FDBF-472B-AF6D-4E44CE533EA2}.AppStore|iPhone.Build.0 = Debug|Any CPU
88+
{BCD618BB-FDBF-472B-AF6D-4E44CE533EA2}.AppStore|iPhoneSimulator.ActiveCfg = Debug|Any CPU
89+
{BCD618BB-FDBF-472B-AF6D-4E44CE533EA2}.AppStore|iPhoneSimulator.Build.0 = Debug|Any CPU
90+
{BCD618BB-FDBF-472B-AF6D-4E44CE533EA2}.AppStore|x64.ActiveCfg = Debug|Any CPU
91+
{BCD618BB-FDBF-472B-AF6D-4E44CE533EA2}.AppStore|x64.Build.0 = Debug|Any CPU
92+
{BCD618BB-FDBF-472B-AF6D-4E44CE533EA2}.AppStore|x86.ActiveCfg = Debug|Any CPU
93+
{BCD618BB-FDBF-472B-AF6D-4E44CE533EA2}.AppStore|x86.Build.0 = Debug|Any CPU
94+
{BCD618BB-FDBF-472B-AF6D-4E44CE533EA2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
95+
{BCD618BB-FDBF-472B-AF6D-4E44CE533EA2}.Debug|Any CPU.Build.0 = Debug|Any CPU
96+
{BCD618BB-FDBF-472B-AF6D-4E44CE533EA2}.Debug|ARM.ActiveCfg = Debug|Any CPU
97+
{BCD618BB-FDBF-472B-AF6D-4E44CE533EA2}.Debug|ARM.Build.0 = Debug|Any CPU
98+
{BCD618BB-FDBF-472B-AF6D-4E44CE533EA2}.Debug|iPhone.ActiveCfg = Debug|Any CPU
99+
{BCD618BB-FDBF-472B-AF6D-4E44CE533EA2}.Debug|iPhone.Build.0 = Debug|Any CPU
100+
{BCD618BB-FDBF-472B-AF6D-4E44CE533EA2}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
101+
{BCD618BB-FDBF-472B-AF6D-4E44CE533EA2}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
102+
{BCD618BB-FDBF-472B-AF6D-4E44CE533EA2}.Debug|x64.ActiveCfg = Debug|Any CPU
103+
{BCD618BB-FDBF-472B-AF6D-4E44CE533EA2}.Debug|x64.Build.0 = Debug|Any CPU
104+
{BCD618BB-FDBF-472B-AF6D-4E44CE533EA2}.Debug|x86.ActiveCfg = Debug|Any CPU
105+
{BCD618BB-FDBF-472B-AF6D-4E44CE533EA2}.Debug|x86.Build.0 = Debug|Any CPU
106+
{BCD618BB-FDBF-472B-AF6D-4E44CE533EA2}.Release|Any CPU.ActiveCfg = Release|Any CPU
107+
{BCD618BB-FDBF-472B-AF6D-4E44CE533EA2}.Release|Any CPU.Build.0 = Release|Any CPU
108+
{BCD618BB-FDBF-472B-AF6D-4E44CE533EA2}.Release|ARM.ActiveCfg = Release|Any CPU
109+
{BCD618BB-FDBF-472B-AF6D-4E44CE533EA2}.Release|ARM.Build.0 = Release|Any CPU
110+
{BCD618BB-FDBF-472B-AF6D-4E44CE533EA2}.Release|iPhone.ActiveCfg = Release|Any CPU
111+
{BCD618BB-FDBF-472B-AF6D-4E44CE533EA2}.Release|iPhone.Build.0 = Release|Any CPU
112+
{BCD618BB-FDBF-472B-AF6D-4E44CE533EA2}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
113+
{BCD618BB-FDBF-472B-AF6D-4E44CE533EA2}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
114+
{BCD618BB-FDBF-472B-AF6D-4E44CE533EA2}.Release|x64.ActiveCfg = Release|Any CPU
115+
{BCD618BB-FDBF-472B-AF6D-4E44CE533EA2}.Release|x64.Build.0 = Release|Any CPU
116+
{BCD618BB-FDBF-472B-AF6D-4E44CE533EA2}.Release|x86.ActiveCfg = Release|Any CPU
117+
{BCD618BB-FDBF-472B-AF6D-4E44CE533EA2}.Release|x86.Build.0 = Release|Any CPU
118+
EndGlobalSection
119+
GlobalSection(SolutionProperties) = preSolution
120+
HideSolutionNode = FALSE
121+
EndGlobalSection
122+
GlobalSection(ExtensibilityGlobals) = postSolution
123+
SolutionGuid = {A699F3F4-A202-4AC1-BABC-B51F36172477}
124+
EndGlobalSection
125+
EndGlobal
Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
Any raw assets you want to be deployed with your application can be placed in
2+
this directory (and child directories) and given a Build Action of "AndroidAsset".
3+
4+
These files will be deployed with you package and will be accessible using Android's
5+
AssetManager, like this:
6+
7+
public class ReadAsset : Activity
8+
{
9+
protected override void OnCreate (Bundle bundle)
10+
{
11+
base.OnCreate (bundle);
12+
13+
InputStream input = Assets.Open ("my_asset.txt");
14+
}
15+
}
16+
17+
Additionally, some Android functions will automatically load asset files:
18+
19+
Typeface tf = Typeface.CreateFromAsset (Context.Assets, "fonts/samplefont.ttf");
Lines changed: 92 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,92 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
5+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
6+
<ProjectGuid>{EBA7C99B-70FA-428C-99FD-38E396E0BFA0}</ProjectGuid>
7+
<ProjectTypeGuids>{EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
8+
<OutputType>Library</OutputType>
9+
<RootNamespace>DataChannelOrtc.Droid</RootNamespace>
10+
<AssemblyName>DataChannelOrtc.Android</AssemblyName>
11+
<TargetFrameworkVersion>v8.0</TargetFrameworkVersion>
12+
<AndroidApplication>True</AndroidApplication>
13+
<AndroidResgenFile>Resources\Resource.designer.cs</AndroidResgenFile>
14+
<AndroidResgenClass>Resource</AndroidResgenClass>
15+
<AndroidManifest>Properties\AndroidManifest.xml</AndroidManifest>
16+
<MonoAndroidResourcePrefix>Resources</MonoAndroidResourcePrefix>
17+
<MonoAndroidAssetsPrefix>Assets</MonoAndroidAssetsPrefix>
18+
<AndroidUseLatestPlatformSdk>true</AndroidUseLatestPlatformSdk>
19+
<NuGetPackageImportStamp>
20+
</NuGetPackageImportStamp>
21+
</PropertyGroup>
22+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
23+
<DebugSymbols>true</DebugSymbols>
24+
<DebugType>full</DebugType>
25+
<Optimize>false</Optimize>
26+
<OutputPath>bin\Debug</OutputPath>
27+
<DefineConstants>DEBUG;</DefineConstants>
28+
<ErrorReport>prompt</ErrorReport>
29+
<WarningLevel>4</WarningLevel>
30+
<AndroidLinkMode>None</AndroidLinkMode>
31+
</PropertyGroup>
32+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
33+
<DebugSymbols>true</DebugSymbols>
34+
<DebugType>pdbonly</DebugType>
35+
<Optimize>true</Optimize>
36+
<OutputPath>bin\Release</OutputPath>
37+
<ErrorReport>prompt</ErrorReport>
38+
<WarningLevel>4</WarningLevel>
39+
<AndroidManagedSymbols>true</AndroidManagedSymbols>
40+
<AndroidUseSharedRuntime>false</AndroidUseSharedRuntime>
41+
</PropertyGroup>
42+
<ItemGroup>
43+
<Reference Include="Mono.Android" />
44+
<Reference Include="System" />
45+
<Reference Include="System.Core" />
46+
<Reference Include="System.Xml.Linq" />
47+
<Reference Include="System.Xml" />
48+
</ItemGroup>
49+
<ItemGroup>
50+
<PackageReference Include="ORTC.Xamarin">
51+
<Version>1.62.0.200-Alpha</Version>
52+
</PackageReference>
53+
<PackageReference Include="Xamarin.Forms" Version="2.5.0.121934" />
54+
<PackageReference Include="Xamarin.Android.Support.Design" Version="25.4.0.2" />
55+
<PackageReference Include="Xamarin.Android.Support.v7.AppCompat" Version="25.4.0.2" />
56+
<PackageReference Include="Xamarin.Android.Support.v4" Version="25.4.0.2" />
57+
<PackageReference Include="Xamarin.Android.Support.v7.CardView" Version="25.4.0.2" />
58+
<PackageReference Include="Xamarin.Android.Support.v7.MediaRouter" Version="25.4.0.2" />
59+
</ItemGroup>
60+
<ItemGroup>
61+
<Compile Include="MainActivity.cs" />
62+
<Compile Include="Resources\Resource.Designer.cs" />
63+
<Compile Include="Properties\AssemblyInfo.cs" />
64+
</ItemGroup>
65+
<ItemGroup>
66+
<None Include="Resources\AboutResources.txt" />
67+
<None Include="Assets\AboutAssets.txt" />
68+
</ItemGroup>
69+
<ItemGroup>
70+
<AndroidResource Include="Resources\drawable\icon.png" />
71+
<AndroidResource Include="Resources\drawable-hdpi\icon.png" />
72+
<AndroidResource Include="Resources\drawable-xhdpi\icon.png" />
73+
<AndroidResource Include="Resources\drawable-xxhdpi\icon.png" />
74+
</ItemGroup>
75+
<ItemGroup>
76+
<None Include="Properties\AndroidManifest.xml" />
77+
</ItemGroup>
78+
<ItemGroup>
79+
<AndroidResource Include="Resources\layout\Tabbar.axml" />
80+
<AndroidResource Include="Resources\layout\Toolbar.axml" />
81+
<AndroidResource Include="Resources\values\styles.xml">
82+
<SubType>Designer</SubType>
83+
</AndroidResource>
84+
</ItemGroup>
85+
<ItemGroup>
86+
<ProjectReference Include="..\DataChannelOrtc\DataChannelOrtc.csproj">
87+
<Project>{CAF20A0D-4394-4F52-9752-F60FEA58A827}</Project>
88+
<Name>DataChannelOrtc</Name>
89+
</ProjectReference>
90+
</ItemGroup>
91+
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" />
92+
</Project>
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
using System;
2+
3+
using Android.App;
4+
using Android.Content.PM;
5+
using Android.Runtime;
6+
using Android.Views;
7+
using Android.Widget;
8+
using Android.OS;
9+
10+
namespace DataChannelOrtc.Droid
11+
{
12+
[Activity(Label = "DataChannelOrtc", Icon = "@drawable/icon", Theme = "@style/MainTheme", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)]
13+
public class MainActivity : global::Xamarin.Forms.Platform.Android.FormsAppCompatActivity
14+
{
15+
protected override void OnCreate(Bundle bundle)
16+
{
17+
TabLayoutResource = Resource.Layout.Tabbar;
18+
ToolbarResource = Resource.Layout.Toolbar;
19+
20+
base.OnCreate(bundle);
21+
22+
global::Xamarin.Forms.Forms.Init(this, bundle);
23+
LoadApplication(new App());
24+
}
25+
}
26+
}
27+
Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<manifest xmlns:android="http://schemas.android.com/apk/res/android" android:versionCode="1" android:versionName="1.0" package="com.companyname.DataChannelOrtc">
3+
<uses-sdk android:minSdkVersion="15" />
4+
<application android:label="DataChannelOrtc.Android"></application>
5+
</manifest>
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
using System.Reflection;
2+
using System.Runtime.CompilerServices;
3+
using System.Runtime.InteropServices;
4+
using Android.App;
5+
6+
// General Information about an assembly is controlled through the following
7+
// set of attributes. Change these attribute values to modify the information
8+
// associated with an assembly.
9+
[assembly: AssemblyTitle("DataChannelOrtc.Android")]
10+
[assembly: AssemblyDescription("")]
11+
[assembly: AssemblyConfiguration("")]
12+
[assembly: AssemblyCompany("")]
13+
[assembly: AssemblyProduct("DataChannelOrtc.Android")]
14+
[assembly: AssemblyCopyright("Copyright © 2014")]
15+
[assembly: AssemblyTrademark("")]
16+
[assembly: AssemblyCulture("")]
17+
[assembly: ComVisible(false)]
18+
19+
// Version information for an assembly consists of the following four values:
20+
//
21+
// Major Version
22+
// Minor Version
23+
// Build Number
24+
// Revision
25+
//
26+
// You can specify all the values or you can default the Build and Revision Numbers
27+
// by using the '*' as shown below:
28+
// [assembly: AssemblyVersion("1.0.*")]
29+
[assembly: AssemblyVersion("1.0.0.0")]
30+
[assembly: AssemblyFileVersion("1.0.0.0")]
31+
32+
// Add some common permissions, these can be removed if not needed
33+
[assembly: UsesPermission(Android.Manifest.Permission.Internet)]
34+
[assembly: UsesPermission(Android.Manifest.Permission.WriteExternalStorage)]
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
Images, layout descriptions, binary blobs and string dictionaries can be included
2+
in your application as resource files. Various Android APIs are designed to
3+
operate on the resource IDs instead of dealing with images, strings or binary blobs
4+
directly.
5+
6+
For example, a sample Android app that contains a user interface layout (main.xml),
7+
an internationalization string table (strings.xml) and some icons (drawable-XXX/icon.png)
8+
would keep its resources in the "Resources" directory of the application:
9+
10+
Resources/
11+
drawable-hdpi/
12+
icon.png
13+
14+
drawable-ldpi/
15+
icon.png
16+
17+
drawable-mdpi/
18+
icon.png
19+
20+
layout/
21+
main.xml
22+
23+
values/
24+
strings.xml
25+
26+
In order to get the build system to recognize Android resources, set the build action to
27+
"AndroidResource". The native Android APIs do not operate directly with filenames, but
28+
instead operate on resource IDs. When you compile an Android application that uses resources,
29+
the build system will package the resources for distribution and generate a class called
30+
"Resource" that contains the tokens for each one of the resources included. For example,
31+
for the above Resources layout, this is what the Resource class would expose:
32+
33+
public class Resource {
34+
public class drawable {
35+
public const int icon = 0x123;
36+
}
37+
38+
public class layout {
39+
public const int main = 0x456;
40+
}
41+
42+
public class strings {
43+
public const int first_string = 0xabc;
44+
public const int second_string = 0xbcd;
45+
}
46+
}
47+
48+
You would then use R.drawable.icon to reference the drawable/icon.png file, or Resource.layout.main
49+
to reference the layout/main.xml file, or Resource.strings.first_string to reference the first
50+
string in the dictionary file values/strings.xml.

0 commit comments

Comments
 (0)