forked from xamarin/xamarin-forms-samples
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
1,094 changed files
with
31,277 additions
and
1,338 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<packages> | ||
<package id="NuGet.CommandLine" version="2.8.2" /> | ||
</packages> |
19 changes: 19 additions & 0 deletions
19
GettingStarted/HelloXamarinFormsWorld/HelloXamarinFormsWorld.Android/Assets/AboutAssets.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"); |
100 changes: 100 additions & 0 deletions
100
...lloXamarinFormsWorld/HelloXamarinFormsWorld.Android/HelloXamarinFormsWorld.Android.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,100 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> | ||
<PropertyGroup> | ||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | ||
<ProjectGuid>{F411B29D-D23F-4024-8E78-381BCA54F411}</ProjectGuid> | ||
<ProjectTypeGuids>{EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids> | ||
<OutputType>Library</OutputType> | ||
<AppDesignerFolder>Properties</AppDesignerFolder> | ||
<RootNamespace>HelloXamarinFormsWorld.Droid</RootNamespace> | ||
<AssemblyName>HelloXamarinFormsWorld.Android</AssemblyName> | ||
<FileAlignment>512</FileAlignment> | ||
<AndroidApplication>true</AndroidApplication> | ||
<AndroidResgenFile>Resources\Resource.Designer.cs</AndroidResgenFile> | ||
<GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies> | ||
<AndroidManifest>Properties\AndroidManifest.xml</AndroidManifest> | ||
<TargetFrameworkVersion>v5.0</TargetFrameworkVersion> | ||
<AndroidSupportedAbis>armeabi,armeabi-v7a,x86</AndroidSupportedAbis> | ||
<AndroidStoreUncompressedFileExtensions /> | ||
<MandroidI18n /> | ||
<JavaMaximumHeapSize> | ||
</JavaMaximumHeapSize> | ||
<JavaOptions /> | ||
<NuGetPackageImportStamp>befcb92b</NuGetPackageImportStamp> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | ||
<DebugSymbols>true</DebugSymbols> | ||
<DebugType>full</DebugType> | ||
<Optimize>false</Optimize> | ||
<OutputPath>bin\Debug\</OutputPath> | ||
<DefineConstants>DEBUG;TRACE</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
<AndroidLinkMode>None</AndroidLinkMode> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> | ||
<DebugType>pdbonly</DebugType> | ||
<Optimize>true</Optimize> | ||
<OutputPath>bin\Release\</OutputPath> | ||
<DefineConstants>TRACE</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
<AndroidUseSharedRuntime>False</AndroidUseSharedRuntime> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Reference Include="Mono.Android" /> | ||
<Reference Include="mscorlib" /> | ||
<Reference Include="System" /> | ||
<Reference Include="System.Core" /> | ||
<Reference Include="System.Xml.Linq" /> | ||
<Reference Include="System.Xml" /> | ||
<Reference Include="Xamarin.Forms.Platform.Android"> | ||
<HintPath>..\packages\Xamarin.Forms.1.4.3.6374\lib\MonoAndroid10\Xamarin.Forms.Platform.Android.dll</HintPath> | ||
</Reference> | ||
<Reference Include="FormsViewGroup"> | ||
<HintPath>..\packages\Xamarin.Forms.1.4.3.6374\lib\MonoAndroid10\FormsViewGroup.dll</HintPath> | ||
</Reference> | ||
<Reference Include="Xamarin.Forms.Core"> | ||
<HintPath>..\packages\Xamarin.Forms.1.4.3.6374\lib\MonoAndroid10\Xamarin.Forms.Core.dll</HintPath> | ||
</Reference> | ||
<Reference Include="Xamarin.Forms.Xaml"> | ||
<HintPath>..\packages\Xamarin.Forms.1.4.3.6374\lib\MonoAndroid10\Xamarin.Forms.Xaml.dll</HintPath> | ||
</Reference> | ||
<Reference Include="Xamarin.Forms.Platform"> | ||
<HintPath>..\packages\Xamarin.Forms.1.4.3.6374\lib\MonoAndroid10\Xamarin.Forms.Platform.dll</HintPath> | ||
</Reference> | ||
<Reference Include="Xamarin.Android.Support.v4"> | ||
<HintPath>..\packages\Xamarin.Android.Support.v4.22.2.0.0\lib\MonoAndroid403\Xamarin.Android.Support.v4.dll</HintPath> | ||
</Reference> | ||
</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="packages.config" /> | ||
<None Include="Properties\AndroidManifest.xml" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<AndroidResource Include="Resources\Drawable\Icon.png" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ProjectReference Include="..\HelloXamarinFormsWorld\HelloXamarinFormsWorld.csproj"> | ||
<Name>HelloXamarinFormsWorld</Name> | ||
<Project>{8F4B43AC-9BB1-4723-8B7C-A8FE4BBDF32F}</Project> | ||
</ProjectReference> | ||
</ItemGroup> | ||
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" /> | ||
<Import Project="..\packages\Xamarin.Forms.1.4.3.6374\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.targets" Condition="Exists('..\packages\Xamarin.Forms.1.4.3.6374\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.targets')" /> | ||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it. | ||
Other similar extension points exist, see Microsoft.Common.targets. | ||
<Target Name="BeforeBuild"> | ||
</Target> | ||
<Target Name="AfterBuild"> | ||
</Target> | ||
--> | ||
</Project> |
21 changes: 21 additions & 0 deletions
21
GettingStarted/HelloXamarinFormsWorld/HelloXamarinFormsWorld.Android/MainActivity.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
using Android.App; | ||
using Android.OS; | ||
|
||
using Xamarin.Forms; | ||
using Xamarin.Forms.Platform.Android; | ||
|
||
namespace HelloXamarinFormsWorld.Droid | ||
{ | ||
[Activity(Label = "HelloXamarinFormsWorld", MainLauncher = true)] | ||
public class MainActivity : FormsApplicationActivity | ||
{ | ||
protected override void OnCreate(Bundle bundle) | ||
{ | ||
base.OnCreate(bundle); | ||
|
||
Forms.Init(this, bundle); | ||
|
||
LoadApplication (new App ()); | ||
} | ||
} | ||
} |
6 changes: 6 additions & 0 deletions
6
...rted/HelloXamarinFormsWorld/HelloXamarinFormsWorld.Android/Properties/AndroidManifest.xml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android"> | ||
<uses-sdk android:minSdkVersion="15" android:targetSdkVersion="21" /> | ||
<application android:icon="@drawable/icon"> | ||
</application> | ||
</manifest> |
34 changes: 34 additions & 0 deletions
34
...gStarted/HelloXamarinFormsWorld/HelloXamarinFormsWorld.Android/Properties/AssemblyInfo.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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("HelloXamarinFormsWorld.Android")] | ||
[assembly: AssemblyDescription("")] | ||
[assembly: AssemblyConfiguration("")] | ||
[assembly: AssemblyCompany("")] | ||
[assembly: AssemblyProduct("HelloXamarinFormsWorld.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
50
...tarted/HelloXamarinFormsWorld/HelloXamarinFormsWorld.Android/Resources/AboutResources.txt
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
Binary file added
BIN
+4.05 KB
...lloXamarinFormsWorld/HelloXamarinFormsWorld.Android/Resources/Drawable/Icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
5 changes: 5 additions & 0 deletions
5
GettingStarted/HelloXamarinFormsWorld/HelloXamarinFormsWorld.Android/packages.config
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<packages> | ||
<package id="Xamarin.Android.Support.v4" version="22.2.0.0" targetFramework="MonoAndroid44" /> | ||
<package id="Xamarin.Forms" version="1.4.3.6374" targetFramework="MonoAndroid44" /> | ||
</packages> |
20 changes: 20 additions & 0 deletions
20
GettingStarted/HelloXamarinFormsWorld/HelloXamarinFormsWorld.WinPhone/App.xaml
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
<Application | ||
x:Class="HelloXamarinFormsWorld.WinPhone.App" | ||
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | ||
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" | ||
xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone" | ||
xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"> | ||
|
||
<!--Application Resources--> | ||
<Application.Resources> | ||
<local:LocalizedStrings xmlns:local="clr-namespace:HelloXamarinFormsWorld.WinPhone" x:Key="LocalizedStrings"/> | ||
</Application.Resources> | ||
|
||
<Application.ApplicationLifetimeObjects> | ||
<!--Required object that handles lifetime events for the application--> | ||
<shell:PhoneApplicationService | ||
Launching="Application_Launching" Closing="Application_Closing" | ||
Activated="Application_Activated" Deactivated="Application_Deactivated"/> | ||
</Application.ApplicationLifetimeObjects> | ||
|
||
</Application> |
Oops, something went wrong.