Skip to content

Commit

Permalink
config update
Browse files Browse the repository at this point in the history
  • Loading branch information
monovo committed Apr 27, 2016
1 parent 17faa60 commit cc1afd6
Show file tree
Hide file tree
Showing 11 changed files with 3,309 additions and 3,174 deletions.
Binary file modified XamarinForms_Config_Options.pptx
Binary file not shown.
40 changes: 32 additions & 8 deletions src/Host/PCLAppDemo.App.Droid/PCLAppDemo.App.Droid.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,14 @@
<ProjectTypeGuids>{EFBA0AD7-5A72-4C68-AF49-83D382785DCF};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>PCLAppConfig.App.Droid</RootNamespace>
<AssemblyName>PCLAppConfig.App.Droid</AssemblyName>
<RootNamespace>PCLAppDemo.App.Droid</RootNamespace>
<AssemblyName>PCLAppDemo.App.Droid</AssemblyName>
<FileAlignment>512</FileAlignment>
<AndroidApplication>true</AndroidApplication>
<AndroidResgenFile>Resources\Resource.Designer.cs</AndroidResgenFile>
<GenerateSerializationAssemblies>Off</GenerateSerializationAssemblies>
<AndroidManifest>Properties\AndroidManifest.xml</AndroidManifest>
<AndroidUseLatestPlatformSdk>true</AndroidUseLatestPlatformSdk>
<AndroidUseLatestPlatformSdk>True</AndroidUseLatestPlatformSdk>
<TargetFrameworkVersion>v6.0</TargetFrameworkVersion>
<AndroidSupportedAbis>armeabi,armeabi-v7a,x86</AndroidSupportedAbis>
<AndroidStoreUncompressedFileExtensions />
Expand All @@ -27,7 +27,7 @@
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugSymbols>False</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug\</OutputPath>
Expand All @@ -36,16 +36,40 @@
<WarningLevel>4</WarningLevel>
<AndroidUseSharedRuntime>True</AndroidUseSharedRuntime>
<AndroidLinkMode>None</AndroidLinkMode>
<AndroidLinkSkip />
<EmbedAssembliesIntoApk>True</EmbedAssembliesIntoApk>
<BundleAssemblies>False</BundleAssemblies>
<AndroidCreatePackagePerAbi>False</AndroidCreatePackagePerAbi>
<AndroidSupportedAbis>
</AndroidSupportedAbis>
<AndroidStoreUncompressedFileExtensions />
<MandroidI18n />
<Debugger>Xamarin</Debugger>
<AndroidEnableMultiDex>False</AndroidEnableMultiDex>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<DefineConstants>
</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<AndroidUseSharedRuntime>False</AndroidUseSharedRuntime>
<AndroidLinkMode>SdkOnly</AndroidLinkMode>
<AndroidLinkMode>None</AndroidLinkMode>
<AndroidLinkSkip />
<EmbedAssembliesIntoApk>True</EmbedAssembliesIntoApk>
<BundleAssemblies>False</BundleAssemblies>
<AndroidCreatePackagePerAbi>False</AndroidCreatePackagePerAbi>
<AndroidSupportedAbis />
<AndroidStoreUncompressedFileExtensions />
<MandroidI18n />
<Debugger>Xamarin</Debugger>
<AotAssemblies>False</AotAssemblies>
<EnableLLVM>False</EnableLLVM>
<AndroidEnableMultiDex>False</AndroidEnableMultiDex>
<EnableProguard>False</EnableProguard>
<DebugSymbols>False</DebugSymbols>
</PropertyGroup>
<ItemGroup>
<Reference Include="ExifLib, Version=1.0.1.0, Culture=neutral, processorArchitecture=MSIL">
Expand Down Expand Up @@ -181,8 +205,8 @@
<Name>PCLResolver</Name>
</ProjectReference>
<ProjectReference Include="..\PCLAppDemo.App\PCLAppDemo.App.csproj">
<Name>PCLAppConfig.App</Name>
<Project>{629DD240-4CD3-4116-A2BE-D8DA783DDD2C}</Project>
<Project>{629dd240-4cd3-4116-a2be-d8da783ddd2c}</Project>
<Name>PCLAppDemo.App</Name>
</ProjectReference>
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath)\Xamarin\Android\Xamarin.Android.CSharp.targets" />
Expand Down
4 changes: 2 additions & 2 deletions src/Host/PCLAppDemo.App.Droid/Properties/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.pclapp.demo" android:installLocation="auto" android:versionCode="1" android:versionName="bobo">
<uses-sdk android:minSdkVersion="15" />
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="com.monovo.PCLAppDemo" android:installLocation="auto" android:versionCode="1">
<uses-sdk android:minSdkVersion="21" />
<application android:label="PclAppDemo"></application>
</manifest>
6,314 changes: 3,157 additions & 3,157 deletions src/Host/PCLAppDemo.App.Droid/Resources/Resource.Designer.cs

Large diffs are not rendered by default.

4 changes: 2 additions & 2 deletions src/Host/PCLAppDemo.App.iOS/Info.plist
Original file line number Diff line number Diff line change
Expand Up @@ -23,9 +23,9 @@
<key>MinimumOSVersion</key>
<string>6.0</string>
<key>CFBundleDisplayName</key>
<string>PCLAppConfig</string>
<string>PCLAppDemo</string>
<key>CFBundleIdentifier</key>
<string>com.monovo.PCLAppConfig</string>
<string>com.monovo.PCLAppDemo</string>
<key>CFBundleVersion</key>
<string>1.0</string>
<key>CFBundleIconFiles</key>
Expand Down
81 changes: 81 additions & 0 deletions src/Host/PCLAppDemo.App.iOS/Infrastructure/iOSSettingsManager.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,81 @@
using System;
using System.Collections.Generic;
using System.Text;
using Foundation;

namespace PCLAppConfig.App.iOS.Infrastructure
{
public class iOSSettingsManagerpublic
{
public static string ApiPath { get; private set; }

const string API_PATH_KEY = "serverAddress"; //this needs to be the Identifier of the field in the Root.plist

public static void SetUpByPreferences()
{
var testVal = NSUserDefaults.StandardUserDefaults.StringForKey(API_PATH_KEY);

if (testVal == null)
LoadDefaultValues();
else
LoadEditedValues();

SavePreferences();
}

static void LoadDefaultValues()
{
var settingsDict = new NSDictionary(NSBundle.MainBundle.PathForResource("Settings.bundle/Root.plist", null));

if (settingsDict != null)
{
var prefSpecifierArray = settingsDict[(NSString) "PreferenceSpecifiers"] as NSArray;

if (prefSpecifierArray != null)
{
foreach (var prefItem in NSArray.FromArray<NSDictionary>(prefSpecifierArray))
{
var key = prefItem[(NSString) "Key"] as NSString;

if (key == null)
continue;

var value = prefItem[(NSString) "DefaultValue"];

if (value == null)
continue;

switch (key.ToString())
{
case API_PATH_KEY:
ApiPath = value.ToString();
break;
default:
break;
}
}
}
}
}

static void LoadEditedValues()
{
ApiPath = NSUserDefaults.StandardUserDefaults.StringForKey(API_PATH_KEY);
}

//Save new preferences to Settings
static void SavePreferences()
{
var appDefaults = NSDictionary.FromObjectsAndKeys(new object[]
{
new NSString(ApiPath)
}, new object[]
{
API_PATH_KEY
});

NSUserDefaults.StandardUserDefaults.RegisterDefaults(appDefaults);
NSUserDefaults.StandardUserDefaults.Synchronize();
}
}
}
2 changes: 2 additions & 0 deletions src/Host/PCLAppDemo.App.iOS/PCLAppDemo.App.iOS.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@
</PropertyGroup>
<ItemGroup>
<Compile Include="AppDelegate.cs" />
<Compile Include="Infrastructure\iOSSettingsManager.cs" />
<Compile Include="Main.cs" />
<None Include="..\PCLAppDemo.App\app.config">
<Link>app.config</Link>
Expand All @@ -100,6 +101,7 @@
<ITunesArtwork Include="iTunesArtwork" />
<ITunesArtwork Include="iTunesArtwork@2x" />
<None Include="packages.config" />
<BundleResource Include="Settings.bundle\Root.plist" />
</ItemGroup>
<ItemGroup>
<ProjectReference Include="..\..\Lib\PCLCoreApp\PCLCoreApp.iOS\PCLCoreApp.iOS.csproj">
Expand Down
27 changes: 27 additions & 0 deletions src/Host/PCLAppDemo.App.iOS/Settings.bundle/Root.plist
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>PreferenceSpecifiers</key>
<array>
<dict>
<key>Title</key>
<string>Name</string>
<key>Type</key>
<string>PSGroupSpecifier</string>
</dict>
<dict>
<key>DefaultValue</key>
<string>Ben</string>
<key>Key</key>
<string>firstNameKey</string>
<key>Title</key>
<string>First</string>
<key>Type</key>
<string>PSTextFieldSpecifier</string>
</dict>
</array>
<key>StringsTable</key>
<string>Root</string>
</dict>
</plist>
4 changes: 2 additions & 2 deletions src/Host/PCLAppDemo.App/PCLAppDemo.App.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,8 @@
<ProjectGuid>{629DD240-4CD3-4116-A2BE-D8DA783DDD2C}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>PCLAppConfig.App</RootNamespace>
<AssemblyName>PCLAppConfig.App</AssemblyName>
<RootNamespace>PCLAppDemo.App</RootNamespace>
<AssemblyName>PCLAppDemo.App</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetFrameworkProfile>Profile111</TargetFrameworkProfile>
<FileAlignment>512</FileAlignment>
Expand Down
4 changes: 2 additions & 2 deletions src/Host/PCLAppDemo.App/Properties/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,11 @@
// 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("PCLAppConfig.App")]
[assembly: AssemblyTitle("PCLAppDemo.App")]
[assembly: AssemblyDescription("")]
[assembly: AssemblyConfiguration("")]
[assembly: AssemblyCompany("")]
[assembly: AssemblyProduct("PCLAppConfig.App")]
[assembly: AssemblyProduct("PCLAppDemo.App")]
[assembly: AssemblyCopyright("Copyright © 2016")]
[assembly: AssemblyTrademark("")]
[assembly: AssemblyCulture("")]
Expand Down
3 changes: 2 additions & 1 deletion src/Lib/PCLCoreApp/PCLCoreApp.Droid/PCLCoreApp.Droid.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,8 @@
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<OutputPath>bin\Release\</OutputPath>
<DefineConstants>TRACE</DefineConstants>
<DefineConstants>
</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
Expand Down

0 comments on commit cc1afd6

Please sign in to comment.