Skip to content

Commit

Permalink
session steps 1-2-3 (#30)
Browse files Browse the repository at this point in the history
* session steps 1-2-3

* tweak text

* add duo-notes

* duo-notes screenshot
  • Loading branch information
conceptdev authored May 18, 2020
1 parent d0774fe commit 25ed08a
Show file tree
Hide file tree
Showing 266 changed files with 5,574 additions and 0 deletions.
110 changes: 110 additions & 0 deletions GetStarted/Notes/MultiPage-Duo/Notes-Duo.sln
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio Version 16
VisualStudioVersion = 16.0.29920.165
MinimumVisualStudioVersion = 10.0.40219.1
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Notes.Android", "Notes.Android\Notes.Android.csproj", "{BACFD4C2-92A7-4CBA-A964-E8F799CC647C}"
EndProject
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Notes.iOS", "Notes.iOS\Notes.iOS.csproj", "{4DB808E9-7B5E-49FB-998C-8AF5E4569857}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Notes-Duo", "Notes\Notes-Duo.csproj", "{FE3FFEEA-FFF9-44AB-A4B3-D2D84B2B712D}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Ad-Hoc|Any CPU = Ad-Hoc|Any CPU
Ad-Hoc|iPhone = Ad-Hoc|iPhone
Ad-Hoc|iPhoneSimulator = Ad-Hoc|iPhoneSimulator
AppStore|Any CPU = AppStore|Any CPU
AppStore|iPhone = AppStore|iPhone
AppStore|iPhoneSimulator = AppStore|iPhoneSimulator
Debug|Any CPU = Debug|Any CPU
Debug|iPhone = Debug|iPhone
Debug|iPhoneSimulator = Debug|iPhoneSimulator
Release|Any CPU = Release|Any CPU
Release|iPhone = Release|iPhone
Release|iPhoneSimulator = Release|iPhoneSimulator
EndGlobalSection
GlobalSection(ProjectConfigurationPlatforms) = postSolution
{BACFD4C2-92A7-4CBA-A964-E8F799CC647C}.Ad-Hoc|Any CPU.ActiveCfg = Release|Any CPU
{BACFD4C2-92A7-4CBA-A964-E8F799CC647C}.Ad-Hoc|Any CPU.Build.0 = Release|Any CPU
{BACFD4C2-92A7-4CBA-A964-E8F799CC647C}.Ad-Hoc|Any CPU.Deploy.0 = Release|Any CPU
{BACFD4C2-92A7-4CBA-A964-E8F799CC647C}.Ad-Hoc|iPhone.ActiveCfg = Debug|Any CPU
{BACFD4C2-92A7-4CBA-A964-E8F799CC647C}.Ad-Hoc|iPhone.Build.0 = Debug|Any CPU
{BACFD4C2-92A7-4CBA-A964-E8F799CC647C}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Release|Any CPU
{BACFD4C2-92A7-4CBA-A964-E8F799CC647C}.Ad-Hoc|iPhoneSimulator.Build.0 = Release|Any CPU
{BACFD4C2-92A7-4CBA-A964-E8F799CC647C}.Ad-Hoc|iPhoneSimulator.Deploy.0 = Release|Any CPU
{BACFD4C2-92A7-4CBA-A964-E8F799CC647C}.AppStore|Any CPU.ActiveCfg = Release|Any CPU
{BACFD4C2-92A7-4CBA-A964-E8F799CC647C}.AppStore|Any CPU.Build.0 = Release|Any CPU
{BACFD4C2-92A7-4CBA-A964-E8F799CC647C}.AppStore|Any CPU.Deploy.0 = Release|Any CPU
{BACFD4C2-92A7-4CBA-A964-E8F799CC647C}.AppStore|iPhone.ActiveCfg = Debug|Any CPU
{BACFD4C2-92A7-4CBA-A964-E8F799CC647C}.AppStore|iPhone.Build.0 = Debug|Any CPU
{BACFD4C2-92A7-4CBA-A964-E8F799CC647C}.AppStore|iPhoneSimulator.ActiveCfg = Release|Any CPU
{BACFD4C2-92A7-4CBA-A964-E8F799CC647C}.AppStore|iPhoneSimulator.Build.0 = Release|Any CPU
{BACFD4C2-92A7-4CBA-A964-E8F799CC647C}.AppStore|iPhoneSimulator.Deploy.0 = Release|Any CPU
{BACFD4C2-92A7-4CBA-A964-E8F799CC647C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{BACFD4C2-92A7-4CBA-A964-E8F799CC647C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{BACFD4C2-92A7-4CBA-A964-E8F799CC647C}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
{BACFD4C2-92A7-4CBA-A964-E8F799CC647C}.Debug|iPhone.ActiveCfg = Debug|Any CPU
{BACFD4C2-92A7-4CBA-A964-E8F799CC647C}.Debug|iPhone.Build.0 = Debug|Any CPU
{BACFD4C2-92A7-4CBA-A964-E8F799CC647C}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{BACFD4C2-92A7-4CBA-A964-E8F799CC647C}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
{BACFD4C2-92A7-4CBA-A964-E8F799CC647C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{BACFD4C2-92A7-4CBA-A964-E8F799CC647C}.Release|Any CPU.Build.0 = Release|Any CPU
{BACFD4C2-92A7-4CBA-A964-E8F799CC647C}.Release|Any CPU.Deploy.0 = Release|Any CPU
{BACFD4C2-92A7-4CBA-A964-E8F799CC647C}.Release|iPhone.ActiveCfg = Release|Any CPU
{BACFD4C2-92A7-4CBA-A964-E8F799CC647C}.Release|iPhone.Build.0 = Release|Any CPU
{BACFD4C2-92A7-4CBA-A964-E8F799CC647C}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
{BACFD4C2-92A7-4CBA-A964-E8F799CC647C}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
{4DB808E9-7B5E-49FB-998C-8AF5E4569857}.Ad-Hoc|Any CPU.ActiveCfg = Ad-Hoc|iPhoneSimulator
{4DB808E9-7B5E-49FB-998C-8AF5E4569857}.Ad-Hoc|iPhone.ActiveCfg = Ad-Hoc|iPhone
{4DB808E9-7B5E-49FB-998C-8AF5E4569857}.Ad-Hoc|iPhone.Build.0 = Ad-Hoc|iPhone
{4DB808E9-7B5E-49FB-998C-8AF5E4569857}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Ad-Hoc|iPhoneSimulator
{4DB808E9-7B5E-49FB-998C-8AF5E4569857}.Ad-Hoc|iPhoneSimulator.Build.0 = Ad-Hoc|iPhoneSimulator
{4DB808E9-7B5E-49FB-998C-8AF5E4569857}.AppStore|Any CPU.ActiveCfg = AppStore|iPhoneSimulator
{4DB808E9-7B5E-49FB-998C-8AF5E4569857}.AppStore|iPhone.ActiveCfg = AppStore|iPhone
{4DB808E9-7B5E-49FB-998C-8AF5E4569857}.AppStore|iPhone.Build.0 = AppStore|iPhone
{4DB808E9-7B5E-49FB-998C-8AF5E4569857}.AppStore|iPhoneSimulator.ActiveCfg = AppStore|iPhoneSimulator
{4DB808E9-7B5E-49FB-998C-8AF5E4569857}.AppStore|iPhoneSimulator.Build.0 = AppStore|iPhoneSimulator
{4DB808E9-7B5E-49FB-998C-8AF5E4569857}.Debug|Any CPU.ActiveCfg = Debug|iPhoneSimulator
{4DB808E9-7B5E-49FB-998C-8AF5E4569857}.Debug|Any CPU.Build.0 = Debug|iPhoneSimulator
{4DB808E9-7B5E-49FB-998C-8AF5E4569857}.Debug|iPhone.ActiveCfg = Debug|iPhone
{4DB808E9-7B5E-49FB-998C-8AF5E4569857}.Debug|iPhone.Build.0 = Debug|iPhone
{4DB808E9-7B5E-49FB-998C-8AF5E4569857}.Debug|iPhoneSimulator.ActiveCfg = Debug|iPhoneSimulator
{4DB808E9-7B5E-49FB-998C-8AF5E4569857}.Debug|iPhoneSimulator.Build.0 = Debug|iPhoneSimulator
{4DB808E9-7B5E-49FB-998C-8AF5E4569857}.Release|Any CPU.ActiveCfg = Release|iPhoneSimulator
{4DB808E9-7B5E-49FB-998C-8AF5E4569857}.Release|Any CPU.Build.0 = Release|iPhoneSimulator
{4DB808E9-7B5E-49FB-998C-8AF5E4569857}.Release|iPhone.ActiveCfg = Release|iPhone
{4DB808E9-7B5E-49FB-998C-8AF5E4569857}.Release|iPhone.Build.0 = Release|iPhone
{4DB808E9-7B5E-49FB-998C-8AF5E4569857}.Release|iPhoneSimulator.ActiveCfg = Release|iPhoneSimulator
{4DB808E9-7B5E-49FB-998C-8AF5E4569857}.Release|iPhoneSimulator.Build.0 = Release|iPhoneSimulator
{FE3FFEEA-FFF9-44AB-A4B3-D2D84B2B712D}.Ad-Hoc|Any CPU.ActiveCfg = Release|Any CPU
{FE3FFEEA-FFF9-44AB-A4B3-D2D84B2B712D}.Ad-Hoc|Any CPU.Build.0 = Release|Any CPU
{FE3FFEEA-FFF9-44AB-A4B3-D2D84B2B712D}.Ad-Hoc|iPhone.ActiveCfg = Debug|Any CPU
{FE3FFEEA-FFF9-44AB-A4B3-D2D84B2B712D}.Ad-Hoc|iPhone.Build.0 = Debug|Any CPU
{FE3FFEEA-FFF9-44AB-A4B3-D2D84B2B712D}.Ad-Hoc|iPhoneSimulator.ActiveCfg = Release|Any CPU
{FE3FFEEA-FFF9-44AB-A4B3-D2D84B2B712D}.Ad-Hoc|iPhoneSimulator.Build.0 = Release|Any CPU
{FE3FFEEA-FFF9-44AB-A4B3-D2D84B2B712D}.AppStore|Any CPU.ActiveCfg = Release|Any CPU
{FE3FFEEA-FFF9-44AB-A4B3-D2D84B2B712D}.AppStore|Any CPU.Build.0 = Release|Any CPU
{FE3FFEEA-FFF9-44AB-A4B3-D2D84B2B712D}.AppStore|iPhone.ActiveCfg = Debug|Any CPU
{FE3FFEEA-FFF9-44AB-A4B3-D2D84B2B712D}.AppStore|iPhone.Build.0 = Debug|Any CPU
{FE3FFEEA-FFF9-44AB-A4B3-D2D84B2B712D}.AppStore|iPhoneSimulator.ActiveCfg = Release|Any CPU
{FE3FFEEA-FFF9-44AB-A4B3-D2D84B2B712D}.AppStore|iPhoneSimulator.Build.0 = Release|Any CPU
{FE3FFEEA-FFF9-44AB-A4B3-D2D84B2B712D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{FE3FFEEA-FFF9-44AB-A4B3-D2D84B2B712D}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FE3FFEEA-FFF9-44AB-A4B3-D2D84B2B712D}.Debug|iPhone.ActiveCfg = Debug|Any CPU
{FE3FFEEA-FFF9-44AB-A4B3-D2D84B2B712D}.Debug|iPhone.Build.0 = Debug|Any CPU
{FE3FFEEA-FFF9-44AB-A4B3-D2D84B2B712D}.Debug|iPhoneSimulator.ActiveCfg = Debug|Any CPU
{FE3FFEEA-FFF9-44AB-A4B3-D2D84B2B712D}.Debug|iPhoneSimulator.Build.0 = Debug|Any CPU
{FE3FFEEA-FFF9-44AB-A4B3-D2D84B2B712D}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FE3FFEEA-FFF9-44AB-A4B3-D2D84B2B712D}.Release|Any CPU.Build.0 = Release|Any CPU
{FE3FFEEA-FFF9-44AB-A4B3-D2D84B2B712D}.Release|iPhone.ActiveCfg = Release|Any CPU
{FE3FFEEA-FFF9-44AB-A4B3-D2D84B2B712D}.Release|iPhone.Build.0 = Release|Any CPU
{FE3FFEEA-FFF9-44AB-A4B3-D2D84B2B712D}.Release|iPhoneSimulator.ActiveCfg = Release|Any CPU
{FE3FFEEA-FFF9-44AB-A4B3-D2D84B2B712D}.Release|iPhoneSimulator.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
EndGlobalSection
GlobalSection(ExtensibilityGlobals) = postSolution
SolutionGuid = {A49CFB87-A26B-4213-827D-376264EDAA3E}
EndGlobalSection
EndGlobal
39 changes: 39 additions & 0 deletions build-2020/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# Surface Duo + Xamarin at Microsoft Build 2020

These code samples were used in the Microsoft Build 2020 session [_How to bring your Android apps to Surface Duo with Xamarin_](http://aka.ms/M365sk123).

## [Step 1](step-1/)

The session begins with the code for this [quickstart documentation](https://docs.microsoft.com/xamarin/get-started/quickstarts/multi-page). It's been copied from the [Xamarin samples GitHub](https://github.com/xamarin/xamarin-forms-samples/tree/master/GetStarted/Notes/MultiPage) to this folder for reference.

In the session, this sample is used to test how the app works on the [Surface Duo emulator](https://docs.microsoft.com/dual-screen/android/get-duo-sdk).

## [Step 2](step-2/)

In this step the sample is modified to support Android drag-and-drop. Three files are added/changed:

- **Notes/ItemDragAndDropEffect.cs** - Xamarin.Forms effect in common code
- **Notes.Android/ItemDragAndDropEffect.cs** - Effect implementation for Android
- **NotesPage.xaml** - Effect added to XAML

The [DragAndDrop sample](https://github.com/microsoft/surface-duo-sdk-xamarin-samples/tree/master/DragAndDrop) can be used as the 'drag target' to test.

## [Step 3](step-3/)

In this step the sample is modified to support dual-screen display using the `TwoPaneView`. These files are added/changed:

- Notes.Android/MainActivity.cs - `DualScreenService.Init(this);`
- Notes/App.xaml.cs - use new `MainPage`
- Notes/NoteEntryPage.xaml+cs - convert to ContentView, move nav/lifecycle methods
- Notes/NotesPage.xaml+cs - convert to ContentView, move nav/lifecycle methods
- Notes/MainPage.xaml+cs - hosts `TwoPaneView` and nav/lifecycle methods

Learn more about the [`TwoPaneView`](https://docs.microsoft.com/dual-screen/xamarin/twopaneview) in the docs.

## Next steps

Other samples:

- [Duo Notes](https://github.com/conceptdev/xamarin-forms-samples/tree/master/duo-notes) - further enhanced version of this Notes demo.
- [XamarinTV](https://github.com/xamarin/app-xamarintv)
- [Food delivery](https://github.com/jsuarezruiz/FoodDeliveryAppDuo)
19 changes: 19 additions & 0 deletions build-2020/step-1/Notes.Android/Assets/AboutAssets.txt
Original file line number Diff line number Diff line change
@@ -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");
25 changes: 25 additions & 0 deletions build-2020/step-1/Notes.Android/MainActivity.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
using System;

using Android.App;
using Android.Content.PM;
using Android.Runtime;
using Android.Views;
using Android.Widget;
using Android.OS;

namespace Notes.Droid
{
[Activity(Label = "Notes", 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());
}
}
}
96 changes: 96 additions & 0 deletions build-2020/step-1/Notes.Android/Notes.Android.csproj
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
<?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>{BACFD4C2-92A7-4CBA-A964-E8F799CC647C}</ProjectGuid>
<ProjectTypeGuids>{EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<TemplateGuid>{c9e5eea5-ca05-42a1-839b-61506e0a37df}</TemplateGuid>
<OutputType>Library</OutputType>
<RootNamespace>Notes.Droid</RootNamespace>
<AssemblyName>Notes.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>
<TargetFrameworkVersion>v9.0</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>portable</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>4.6.0.726</Version>
</PackageReference>
</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" />
</ItemGroup>
<ItemGroup>
<Folder Include="Resources\drawable\" />
<Folder Include="Resources\drawable-hdpi\" />
<Folder Include="Resources\drawable-xhdpi\" />
<Folder Include="Resources\drawable-xxhdpi\" />
<Folder Include="Resources\drawable-xxxhdpi\" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\Notes\Notes.csproj">
<Project>{FE3FFEEA-FFF9-44AB-A4B3-D2D84B2B712D}</Project>
<Name>Notes</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" />
</Project>
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
<?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.Notes">
<uses-sdk android:minSdkVersion="21" android:targetSdkVersion="28" />
<application android:label="Notes.Android"></application>
</manifest>
34 changes: 34 additions & 0 deletions build-2020/step-1/Notes.Android/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
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("Notes.Android")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("Notes.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)]
50 changes: 50 additions & 0 deletions build-2020/step-1/Notes.Android/Resources/AboutResources.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
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.
Loading

0 comments on commit 25ed08a

Please sign in to comment.