Skip to content

Commit c31aae9

Browse files
committed
Okay, big update
Added unit tests to be sure I'm doing everything right. Covering sync operations for now, will add async coverage too. Added new exceptions for better understanding Added new properties and methods to IFile and IFolder Renamed Desktop to NetFX, Mac to macOS
1 parent 3768497 commit c31aae9

File tree

49 files changed

+3057
-479
lines changed

Some content is hidden

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

49 files changed

+3057
-479
lines changed

PCLExt.FileStorage.sln

Lines changed: 41 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,73 +1,85 @@
11

22
Microsoft Visual Studio Solution File, Format Version 12.00
3-
# Visual Studio 2012
4-
VisualStudioVersion = 14.0.25123.0
3+
# Visual Studio 15
4+
VisualStudioVersion = 15.0.26730.16
55
MinimumVisualStudioVersion = 10.0.40219.1
66
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PCLExt.FileStorage.Portable", "src\PCLExt.FileStorage.Portable\PCLExt.FileStorage.Portable.csproj", "{A7C97A2B-F996-4CAF-87D8-F3A60B2B4D44}"
77
EndProject
88
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PCLExt.FileStorage.Portable.Abstractions", "src\PCLExt.FileStorage.Portable.Abstractions\PCLExt.FileStorage.Portable.Abstractions.csproj", "{3F8D0494-6EE2-47FE-B263-F09A5EA3D0B3}"
99
EndProject
10-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PCLExt.FileStorage.Desktop", "src\PCLExt.FileStorage.Desktop\PCLExt.FileStorage.Desktop.csproj", "{54DBACEB-B898-494B-AD88-2A407CB55A5A}"
11-
EndProject
1210
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PCLExt.FileStorage.Android", "src\PCLExt.FileStorage.Android\PCLExt.FileStorage.Android.csproj", "{8EFC0559-3C9C-4D0C-A5A5-579E58FFE621}"
1311
EndProject
1412
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PCLExt.FileStorage.iOS", "src\PCLExt.FileStorage.iOS\PCLExt.FileStorage.iOS.csproj", "{03DA3968-61A3-44D1-9F99-F55D31E07813}"
1513
EndProject
16-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PCLExt.FileStorage.Mac", "src\PCLExt.FileStorage.Mac\PCLExt.FileStorage.Mac.csproj", "{0B02DE9A-C3C5-4DB9-B87F-6B05C3566946}"
14+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PCLExt.FileStorage.Core", "src\PCLExt.FileStorage.Core\PCLExt.FileStorage.Core.csproj", "{94E4FE17-7F2B-4623-8FFA-12F4056CCB2A}"
15+
EndProject
16+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PCLExt.FileStorage.Android.Test", "src\PCLExt.FileStorage.Android.Test\PCLExt.FileStorage.Android.Test.csproj", "{CB89F319-1C9D-4574-8874-25F592EC76CD}"
17+
EndProject
18+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PCLExt.FileStorage.iOS.Test", "src\PCLExt.FileStorage.iOS.Test\PCLExt.FileStorage.iOS.Test.csproj", "{12AB9E53-8A6F-4B3A-8E2F-202799854F91}"
19+
EndProject
20+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PCLExt.FileStorage.NetFX", "src\PCLExt.FileStorage.NetFX\PCLExt.FileStorage.NetFX.csproj", "{54DBACEB-B898-494B-AD88-2A407CB55A5A}"
21+
EndProject
22+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PCLExt.FileStorage.macOS", "src\PCLExt.FileStorage.macOS\PCLExt.FileStorage.macOS.csproj", "{0B02DE9A-C3C5-4DB9-B87F-6B05C3566946}"
23+
EndProject
24+
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "PCLExt.FileStorage.Core.Test", "src\PCLExt.FileStorage.Core.Test\PCLExt.FileStorage.Core.Test.csproj", "{316FFBA8-57A8-4B4A-8352-F1E3361D8710}"
1725
EndProject
18-
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PCLExt.FileStorage.Core", "src\PCLExt.FileStorage.Core\PCLExt.FileStorage.Core.csproj", "{94E4FE17-7F2B-4623-8FFA-12F4056CCB2A}"
26+
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "PCLExt.FileStorage.NetFX.Test", "src\PCLExt.FileStorage.NetFX.Test\PCLExt.FileStorage.NetFX.Test.csproj", "{119368DE-E6BD-4746-BCD8-BBFE458579CC}"
1927
EndProject
2028
Global
2129
GlobalSection(SolutionConfigurationPlatforms) = preSolution
22-
AppStore|Any CPU = AppStore|Any CPU
2330
Debug|Any CPU = Debug|Any CPU
2431
Release|Any CPU = Release|Any CPU
2532
EndGlobalSection
2633
GlobalSection(ProjectConfigurationPlatforms) = postSolution
27-
{A7C97A2B-F996-4CAF-87D8-F3A60B2B4D44}.AppStore|Any CPU.ActiveCfg = Release|Any CPU
28-
{A7C97A2B-F996-4CAF-87D8-F3A60B2B4D44}.AppStore|Any CPU.Build.0 = Release|Any CPU
2934
{A7C97A2B-F996-4CAF-87D8-F3A60B2B4D44}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
3035
{A7C97A2B-F996-4CAF-87D8-F3A60B2B4D44}.Debug|Any CPU.Build.0 = Debug|Any CPU
3136
{A7C97A2B-F996-4CAF-87D8-F3A60B2B4D44}.Release|Any CPU.ActiveCfg = Release|Any CPU
3237
{A7C97A2B-F996-4CAF-87D8-F3A60B2B4D44}.Release|Any CPU.Build.0 = Release|Any CPU
33-
{3F8D0494-6EE2-47FE-B263-F09A5EA3D0B3}.AppStore|Any CPU.ActiveCfg = Release|Any CPU
34-
{3F8D0494-6EE2-47FE-B263-F09A5EA3D0B3}.AppStore|Any CPU.Build.0 = Release|Any CPU
3538
{3F8D0494-6EE2-47FE-B263-F09A5EA3D0B3}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
3639
{3F8D0494-6EE2-47FE-B263-F09A5EA3D0B3}.Debug|Any CPU.Build.0 = Debug|Any CPU
3740
{3F8D0494-6EE2-47FE-B263-F09A5EA3D0B3}.Release|Any CPU.ActiveCfg = Release|Any CPU
3841
{3F8D0494-6EE2-47FE-B263-F09A5EA3D0B3}.Release|Any CPU.Build.0 = Release|Any CPU
39-
{54DBACEB-B898-494B-AD88-2A407CB55A5A}.AppStore|Any CPU.ActiveCfg = Release|Any CPU
40-
{54DBACEB-B898-494B-AD88-2A407CB55A5A}.AppStore|Any CPU.Build.0 = Release|Any CPU
41-
{54DBACEB-B898-494B-AD88-2A407CB55A5A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
42-
{54DBACEB-B898-494B-AD88-2A407CB55A5A}.Debug|Any CPU.Build.0 = Debug|Any CPU
43-
{54DBACEB-B898-494B-AD88-2A407CB55A5A}.Release|Any CPU.ActiveCfg = Release|Any CPU
44-
{54DBACEB-B898-494B-AD88-2A407CB55A5A}.Release|Any CPU.Build.0 = Release|Any CPU
45-
{8EFC0559-3C9C-4D0C-A5A5-579E58FFE621}.AppStore|Any CPU.ActiveCfg = Release|Any CPU
46-
{8EFC0559-3C9C-4D0C-A5A5-579E58FFE621}.AppStore|Any CPU.Build.0 = Release|Any CPU
4742
{8EFC0559-3C9C-4D0C-A5A5-579E58FFE621}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
4843
{8EFC0559-3C9C-4D0C-A5A5-579E58FFE621}.Debug|Any CPU.Build.0 = Debug|Any CPU
4944
{8EFC0559-3C9C-4D0C-A5A5-579E58FFE621}.Release|Any CPU.ActiveCfg = Release|Any CPU
5045
{8EFC0559-3C9C-4D0C-A5A5-579E58FFE621}.Release|Any CPU.Build.0 = Release|Any CPU
51-
{03DA3968-61A3-44D1-9F99-F55D31E07813}.AppStore|Any CPU.ActiveCfg = AppStore|Any CPU
52-
{03DA3968-61A3-44D1-9F99-F55D31E07813}.AppStore|Any CPU.Build.0 = AppStore|Any CPU
5346
{03DA3968-61A3-44D1-9F99-F55D31E07813}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
5447
{03DA3968-61A3-44D1-9F99-F55D31E07813}.Debug|Any CPU.Build.0 = Debug|Any CPU
5548
{03DA3968-61A3-44D1-9F99-F55D31E07813}.Release|Any CPU.ActiveCfg = Release|Any CPU
5649
{03DA3968-61A3-44D1-9F99-F55D31E07813}.Release|Any CPU.Build.0 = Release|Any CPU
57-
{0B02DE9A-C3C5-4DB9-B87F-6B05C3566946}.AppStore|Any CPU.ActiveCfg = Release|Any CPU
58-
{0B02DE9A-C3C5-4DB9-B87F-6B05C3566946}.AppStore|Any CPU.Build.0 = Release|Any CPU
59-
{0B02DE9A-C3C5-4DB9-B87F-6B05C3566946}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
60-
{0B02DE9A-C3C5-4DB9-B87F-6B05C3566946}.Debug|Any CPU.Build.0 = Debug|Any CPU
61-
{0B02DE9A-C3C5-4DB9-B87F-6B05C3566946}.Release|Any CPU.ActiveCfg = Release|Any CPU
62-
{0B02DE9A-C3C5-4DB9-B87F-6B05C3566946}.Release|Any CPU.Build.0 = Release|Any CPU
63-
{94E4FE17-7F2B-4623-8FFA-12F4056CCB2A}.AppStore|Any CPU.ActiveCfg = Debug|Any CPU
64-
{94E4FE17-7F2B-4623-8FFA-12F4056CCB2A}.AppStore|Any CPU.Build.0 = Debug|Any CPU
6550
{94E4FE17-7F2B-4623-8FFA-12F4056CCB2A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
6651
{94E4FE17-7F2B-4623-8FFA-12F4056CCB2A}.Debug|Any CPU.Build.0 = Debug|Any CPU
6752
{94E4FE17-7F2B-4623-8FFA-12F4056CCB2A}.Release|Any CPU.ActiveCfg = Release|Any CPU
6853
{94E4FE17-7F2B-4623-8FFA-12F4056CCB2A}.Release|Any CPU.Build.0 = Release|Any CPU
54+
{CB89F319-1C9D-4574-8874-25F592EC76CD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
55+
{CB89F319-1C9D-4574-8874-25F592EC76CD}.Debug|Any CPU.Build.0 = Debug|Any CPU
56+
{CB89F319-1C9D-4574-8874-25F592EC76CD}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
57+
{CB89F319-1C9D-4574-8874-25F592EC76CD}.Release|Any CPU.ActiveCfg = Release|Any CPU
58+
{CB89F319-1C9D-4574-8874-25F592EC76CD}.Release|Any CPU.Build.0 = Release|Any CPU
59+
{CB89F319-1C9D-4574-8874-25F592EC76CD}.Release|Any CPU.Deploy.0 = Release|Any CPU
60+
{12AB9E53-8A6F-4B3A-8E2F-202799854F91}.Debug|Any CPU.ActiveCfg = Debug|iPhone
61+
{12AB9E53-8A6F-4B3A-8E2F-202799854F91}.Release|Any CPU.ActiveCfg = Release|iPhone
62+
{54DBACEB-B898-494B-AD88-2A407CB55A5A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
63+
{54DBACEB-B898-494B-AD88-2A407CB55A5A}.Debug|Any CPU.Build.0 = Debug|Any CPU
64+
{54DBACEB-B898-494B-AD88-2A407CB55A5A}.Release|Any CPU.ActiveCfg = Release|Any CPU
65+
{54DBACEB-B898-494B-AD88-2A407CB55A5A}.Release|Any CPU.Build.0 = Release|Any CPU
66+
{0B02DE9A-C3C5-4DB9-B87F-6B05C3566946}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
67+
{0B02DE9A-C3C5-4DB9-B87F-6B05C3566946}.Debug|Any CPU.Build.0 = Debug|Any CPU
68+
{0B02DE9A-C3C5-4DB9-B87F-6B05C3566946}.Release|Any CPU.ActiveCfg = Release|Any CPU
69+
{0B02DE9A-C3C5-4DB9-B87F-6B05C3566946}.Release|Any CPU.Build.0 = Release|Any CPU
70+
{316FFBA8-57A8-4B4A-8352-F1E3361D8710}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
71+
{316FFBA8-57A8-4B4A-8352-F1E3361D8710}.Debug|Any CPU.Build.0 = Debug|Any CPU
72+
{316FFBA8-57A8-4B4A-8352-F1E3361D8710}.Release|Any CPU.ActiveCfg = Release|Any CPU
73+
{316FFBA8-57A8-4B4A-8352-F1E3361D8710}.Release|Any CPU.Build.0 = Release|Any CPU
74+
{119368DE-E6BD-4746-BCD8-BBFE458579CC}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
75+
{119368DE-E6BD-4746-BCD8-BBFE458579CC}.Debug|Any CPU.Build.0 = Debug|Any CPU
76+
{119368DE-E6BD-4746-BCD8-BBFE458579CC}.Release|Any CPU.ActiveCfg = Release|Any CPU
77+
{119368DE-E6BD-4746-BCD8-BBFE458579CC}.Release|Any CPU.Build.0 = Release|Any CPU
6978
EndGlobalSection
7079
GlobalSection(SolutionProperties) = preSolution
7180
HideSolutionNode = FALSE
7281
EndGlobalSection
82+
GlobalSection(ExtensibilityGlobals) = postSolution
83+
SolutionGuid = {46C04569-986C-4FAF-8DA3-868AB9B06B09}
84+
EndGlobalSection
7385
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: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
using System.Reflection;
2+
3+
using Android.App;
4+
using Android.OS;
5+
6+
using Xamarin.Android.NUnitLite;
7+
8+
namespace PCLExt.FileStorage.Android.Test
9+
{
10+
[Activity(Label = "PCLExt.FileStorage.Android.Test", MainLauncher = true, Icon = "@drawable/icon")]
11+
public class MainActivity : TestSuiteActivity
12+
{
13+
protected override void OnCreate(Bundle bundle)
14+
{
15+
// tests can be inside the main assembly
16+
AddTest(Assembly.GetExecutingAssembly());
17+
// or in any reference assemblies
18+
// AddTest (typeof (Your.Library.TestClass).Assembly);
19+
20+
// Once you called base.OnCreate(), you cannot add more assemblies.
21+
base.OnCreate(bundle);
22+
}
23+
}
24+
}
25+
Lines changed: 105 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,105 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
5+
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
6+
<ProductVersion>8.0.30703</ProductVersion>
7+
<SchemaVersion>2.0</SchemaVersion>
8+
<ProjectGuid>{CB89F319-1C9D-4574-8874-25F592EC76CD}</ProjectGuid>
9+
<ProjectTypeGuids>{EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
10+
<OutputType>Library</OutputType>
11+
<AppDesignerFolder>Properties</AppDesignerFolder>
12+
<RootNamespace>PCLExt.FileStorage.Android.Test</RootNamespace>
13+
<AssemblyName>PCLExt.FileStorage.Android.Test</AssemblyName>
14+
<FileAlignment>512</FileAlignment>
15+
<AndroidApplication>True</AndroidApplication>
16+
<AndroidResgenFile>Resources\Resource.Designer.cs</AndroidResgenFile>
17+
<GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
18+
<AndroidUseLatestPlatformSdk>True</AndroidUseLatestPlatformSdk>
19+
<TargetFrameworkVersion>v6.0</TargetFrameworkVersion>
20+
<AndroidManifest>Properties\AndroidManifest.xml</AndroidManifest>
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>TRACE;DEBUG;NUNIT</DefineConstants>
28+
<ErrorReport>prompt</ErrorReport>
29+
<WarningLevel>4</WarningLevel>
30+
<AndroidUseSharedRuntime>True</AndroidUseSharedRuntime>
31+
<AndroidLinkMode>None</AndroidLinkMode>
32+
<EmbedAssembliesIntoApk>False</EmbedAssembliesIntoApk>
33+
</PropertyGroup>
34+
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
35+
<DebugType>PdbOnly</DebugType>
36+
<DebugSymbols>True</DebugSymbols>
37+
<Optimize>True</Optimize>
38+
<OutputPath>bin\Release\</OutputPath>
39+
<DefineConstants>TRACE</DefineConstants>
40+
<ErrorReport>prompt</ErrorReport>
41+
<WarningLevel>4</WarningLevel>
42+
<AndroidUseSharedRuntime>False</AndroidUseSharedRuntime>
43+
<AndroidLinkMode>SdkOnly</AndroidLinkMode>
44+
<EmbedAssembliesIntoApk>True</EmbedAssembliesIntoApk>
45+
</PropertyGroup>
46+
<ItemGroup>
47+
<Reference Include="Mono.Android" />
48+
<Reference Include="mscorlib" />
49+
<Reference Include="System" />
50+
<Reference Include="System.Core" />
51+
<Reference Include="System.Xml" />
52+
<Reference Include="Xamarin.Android.NUnitLite" />
53+
</ItemGroup>
54+
<ItemGroup>
55+
<Compile Include="..\..\common\CommonAssemblyInfo.cs">
56+
<Link>Properties\CommonAssemblyInfo.cs</Link>
57+
</Compile>
58+
<Compile Include="..\PCLExt.FileStorage.NetFX.Test\FilesTest.cs">
59+
<Link>FilesTest.cs</Link>
60+
</Compile>
61+
<Compile Include="..\PCLExt.FileStorage.NetFX.Test\StandardFoldersTest.cs">
62+
<Link>StandardFoldersTest.cs</Link>
63+
</Compile>
64+
<Compile Include="..\PCLExt.FileStorage.NetFX.Test\TestFolder.cs">
65+
<Link>TestFolder.cs</Link>
66+
</Compile>
67+
<Compile Include="..\PCLExt.FileStorage.NetFX.Test\FoldersTest.cs">
68+
<Link>FoldersTest.cs</Link>
69+
</Compile>
70+
<Compile Include="MainActivity.cs" />
71+
<Compile Include="Resources\Resource.Designer.cs" />
72+
<Compile Include="Properties\AssemblyInfo.cs" />
73+
</ItemGroup>
74+
<ItemGroup>
75+
<None Include="Resources\AboutResources.txt" />
76+
<None Include="Assets\AboutAssets.txt" />
77+
</ItemGroup>
78+
<ItemGroup>
79+
<AndroidResource Include="Resources\drawable\Icon.png" />
80+
</ItemGroup>
81+
<ItemGroup>
82+
<AndroidResource Include="Resources\values\Strings.xml" />
83+
</ItemGroup>
84+
<ItemGroup>
85+
<None Include="Properties\AndroidManifest.xml" />
86+
</ItemGroup>
87+
<ItemGroup>
88+
<ProjectReference Include="..\PCLExt.FileStorage.Android\PCLExt.FileStorage.Android.csproj">
89+
<Project>{8efc0559-3c9c-4d0c-a5a5-579e58ffe621}</Project>
90+
<Name>PCLExt.FileStorage.Android</Name>
91+
</ProjectReference>
92+
<ProjectReference Include="..\PCLExt.FileStorage.Portable.Abstractions\PCLExt.FileStorage.Portable.Abstractions.csproj">
93+
<Project>{3f8d0494-6ee2-47fe-b263-f09a5ea3d0b3}</Project>
94+
<Name>PCLExt.FileStorage.Portable.Abstractions</Name>
95+
</ProjectReference>
96+
</ItemGroup>
97+
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" />
98+
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
99+
Other similar extension points exist, see Microsoft.Common.targets.
100+
<Target Name="BeforeBuild">
101+
</Target>
102+
<Target Name="AfterBuild">
103+
</Target>
104+
-->
105+
</Project>
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" package="PCLExt.FileStorage.Android.Test.PCLExt.FileStorage.Android.Test" android:versionCode="1" android:versionName="1.0">
3+
<uses-sdk android:minSdkVersion="16" />
4+
<application android:label="PCLExt.FileStorage.Android.Test"></application>
5+
</manifest>
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
using System.Reflection;
2+
using System.Runtime.InteropServices;
3+
4+
[assembly: AssemblyTitle("PCLExt.FileStorage.Android.Test")]
5+
[assembly: AssemblyDescription("")]
6+
[assembly: ComVisible(false)]
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
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.axml),
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/
12+
icon.png
13+
14+
layout/
15+
main.axml
16+
17+
values/
18+
strings.xml
19+
20+
In order to get the build system to recognize Android resources, set the build action to
21+
"AndroidResource". The native Android APIs do not operate directly with filenames, but
22+
instead operate on resource IDs. When you compile an Android application that uses resources,
23+
the build system will package the resources for distribution and generate a class called "R"
24+
(this is an Android convention) that contains the tokens for each one of the resources
25+
included. For example, for the above Resources layout, this is what the R class would expose:
26+
27+
public class R {
28+
public class drawable {
29+
public const int icon = 0x123;
30+
}
31+
32+
public class layout {
33+
public const int main = 0x456;
34+
}
35+
36+
public class strings {
37+
public const int first_string = 0xabc;
38+
public const int second_string = 0xbcd;
39+
}
40+
}
41+
42+
You would then use R.drawable.icon to reference the drawable/icon.png file, or R.layout.main
43+
to reference the layout/main.axml file, or R.strings.first_string to reference the first
44+
string in the dictionary file values/strings.xml.

0 commit comments

Comments
 (0)