Commit 72868bef authored by O'Reilly Media, Inc.'s avatar O'Reilly Media, Inc.
Browse files

Initial commit

parents
Loading
Loading
Loading
Loading
+22 −0
Changes for Android App Creation With C Sharp - Working Files/Chapter 1/AndroidApplication1/AndroidApplication1.sln: 22 added lines, 0 removed lines.
Original line number Diff line number Diff line

Microsoft Visual Studio Solution File, Format Version 12.00
# Visual Studio 2012
Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "AndroidApplication1", "AndroidApplication1\AndroidApplication1.csproj", "{09DE9098-7711-4FD7-98D7-2FAF4CF1A06A}"
EndProject
Global
	GlobalSection(SolutionConfigurationPlatforms) = preSolution
		Debug|Any CPU = Debug|Any CPU
		Release|Any CPU = Release|Any CPU
	EndGlobalSection
	GlobalSection(ProjectConfigurationPlatforms) = postSolution
		{09DE9098-7711-4FD7-98D7-2FAF4CF1A06A}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
		{09DE9098-7711-4FD7-98D7-2FAF4CF1A06A}.Debug|Any CPU.Build.0 = Debug|Any CPU
		{09DE9098-7711-4FD7-98D7-2FAF4CF1A06A}.Debug|Any CPU.Deploy.0 = Debug|Any CPU
		{09DE9098-7711-4FD7-98D7-2FAF4CF1A06A}.Release|Any CPU.ActiveCfg = Release|Any CPU
		{09DE9098-7711-4FD7-98D7-2FAF4CF1A06A}.Release|Any CPU.Build.0 = Release|Any CPU
		{09DE9098-7711-4FD7-98D7-2FAF4CF1A06A}.Release|Any CPU.Deploy.0 = Release|Any CPU
	EndGlobalSection
	GlobalSection(SolutionProperties) = preSolution
		HideSolutionNode = FALSE
	EndGlobalSection
EndGlobal
+79 −0
Changes for Android App Creation With C Sharp - Working Files/Chapter 1/AndroidApplication1/AndroidApplication1/AndroidApplication1.csproj: 79 added lines, 0 removed lines.
Original line number Diff line number Diff line
<?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>
    <ProductVersion>8.0.30703</ProductVersion>
    <SchemaVersion>2.0</SchemaVersion>
    <ProjectGuid>{09DE9098-7711-4FD7-98D7-2FAF4CF1A06A}</ProjectGuid>
    <ProjectTypeGuids>{EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
    <OutputType>Library</OutputType>
    <AppDesignerFolder>Properties</AppDesignerFolder>
    <RootNamespace>AndroidApplication1</RootNamespace>
    <AssemblyName>AndroidApplication1</AssemblyName>
    <FileAlignment>512</FileAlignment>
    <AndroidApplication>true</AndroidApplication>
    <AndroidResgenFile>Resources\Resource.Designer.cs</AndroidResgenFile>
    <GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
    <AndroidManifest>Properties\AndroidManifest.xml</AndroidManifest>
  </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>
    <AndroidUseSharedRuntime>True</AndroidUseSharedRuntime>
    <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>
    <AndroidLinkMode>SdkOnly</AndroidLinkMode>
  </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" />
  </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" />
    <AndroidResource Include="Resources\Layout\Main.axml">
      <SubType>AndroidResource</SubType>
    </AndroidResource>
  </ItemGroup>
  <ItemGroup>
    <AndroidResource Include="Resources\Values\Strings.xml" />
  </ItemGroup>
  <ItemGroup>
    <AndroidResource Include="Resources\Drawable\Icon.png" />
  </ItemGroup>
  <ItemGroup>
    <Content Include="Properties\AndroidManifest.xml" />
  </ItemGroup>
  <ItemGroup />
  <Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.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>
 No newline at end of file
+19 −0
Changes for Android App Creation With C Sharp - Working Files/Chapter 1/AndroidApplication1/AndroidApplication1/Assets/AboutAssets.txt: 19 added lines, 0 removed lines.
Original line number Diff line number Diff line
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");
 No newline at end of file
+35 −0
Changes for Android App Creation With C Sharp - Working Files/Chapter 1/AndroidApplication1/AndroidApplication1/MainActivity.cs: 35 added lines, 0 removed lines.
Original line number Diff line number Diff line
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

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

namespace AndroidApplication1
{
    [Activity(Label = "My Activity", MainLauncher = true)]
    public class MainActivity : Activity
    {
        protected override void OnCreate(Bundle bundle)
        {
            base.OnCreate(bundle);

            // Create your application here
            SetContentView(Resource.Layout.Main);
            
            Button btnHello = FindViewById<Button>(Resource.Id.btnHello);
            btnHello.Click += btnHello_Click;

        }

        void btnHello_Click(object sender, EventArgs e)
        {
            Toast.MakeText(this, "Hello world!", ToastLength.Short).Show();
        }
    }
}
 No newline at end of file
+5 −0
Changes for Android App Creation With C Sharp - Working Files/Chapter 1/AndroidApplication1/AndroidApplication1/Properties/AndroidManifest.xml: 5 added lines, 0 removed lines.
Original line number Diff line number Diff line
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
	<uses-sdk android:minSdkVersion="8" android:targetSdkVersion="8" />
	<application></application>
</manifest>
 No newline at end of file
Loading