Skip to content

Instantly share code, notes, and snippets.

View JonDouglas's full-sized avatar
📦
Busy working on NuGet. I'll try my best to get around to you.

Jon Douglas JonDouglas

📦
Busy working on NuGet. I'll try my best to get around to you.
View GitHub Profile
@JonDouglas
JonDouglas / gist:d1bf08dce57c814914cb
Created September 25, 2014 16:27
AndroidManifest.xml
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android" package="NewCameraBroadcast.NewCameraBroadcast" android:versionCode="1" android:versionName="1.0" android:installLocation="auto">
<uses-sdk android:minSdkVersion="19" android:targetSdkVersion="19" />
<application android:label="NewCameraBroadcast" android:icon="@drawable/Icon"></application>
<uses-feature android:name="android.hardware.camera"></uses-feature>
<uses-permission android:name="android.permission.CAMERA" />
</manifest>
<application ... >
...
<!-- The main/home activity (it has no parent activity) -->
<activity
android:name="com.example.myfirstapp.MainActivity" ...>
...
</activity>
<!-- A child of the main activity -->
<activity
android:name="com.example.myfirstapp.DisplayMessageActivity"
C:\Users\Jon\Documents\Visual Studio 2013\Projects\App11>msbuild App11.sln /t:Bu
ild /p:Configuration=Ad-Hoc;Platform=iPhone
Microsoft (R) Build Engine version 4.0.30319.33440
[Microsoft .NET Framework, version 4.0.30319.34014]
Copyright (C) Microsoft Corporation. All rights reserved.
Building the projects in this solution one at a time. To enable parallel build,
please add the "/m" switch.
Build started 12/2/2014 9:58:45 AM.
Project "C:\Users\Jon\Documents\Visual Studio 2013\Projects\App11\App11.sln" on
using System;
using System.Collections.Generic;
using System.IO;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using UpgradeTest.Renderers;
using UpgradeTest.WinPhone.Renderers;
<Application
x:Class="UpgradeTest.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:UpgradeTest.WinPhone" x:Key="LocalizedStrings"/>
@JonDouglas
JonDouglas / gist:b9fa806f40365acf3cbb
Created September 29, 2014 20:18
Xamarin Forms Renderers
Platform Specific renderers can be found in the following namespaces:
iOS: Xamarin.Forms.Platform.iOS
Android: Xamarin.Forms.Platform.Android
Windows Phone: Xamarin.Forms.Platform.WinPhone
Base Renderer
To start with, all renders usually derive from a platform specific base renderer class that in turn inherit from a platform specific control. If you want to create platform specific renderers from scratch you are probably going to be deriving them from the correct platform's base renderer class. These have been substantially standardized in version 6201 with all controls inheriting from a generic version of ViewRenderer. There is also a non-generic version that appears to be used sometimes by navigation controls. The methods on these classes are also more in line with each other than they had been but still not the same. For example the iOS version has a method called ViewOnUnfocusRequested while the Android's version of the same method is called OnUnfocusRequested.
iOS:
Code Name Version API Level Release Date
None 1.0 1 2008-09-23
None 1.1 2 2009-02-09
Cupcake 1.5 3 2009-04-27
Donut 1.6 4 2009-09-15
Eclair 2.0-2.1 5-7 2009-10-26
Froyo 2.2-2.2.3 8 2010-05-20
Gingerbread 2.3-2.3.7 9-10 2010-12-06
Honeycomb 3.0-3.2.6 11-13 2011-02-22
Thread uiThread;
uiThread = Thread.CurrentThread; //Ensure this is called during a Main/UI thread call
void WhatThreadAmI([CallerMemberName] string method = "", [CallerLineNumber] int line = 0)
{
Console.WriteLine("=========================");
Console.WriteLine("=========================");
Console.WriteLine("=========================");
Console.WriteLine($"{method} - {line}" {IsMainThread}");
@JonDouglas
JonDouglas / systemapp.md
Created March 10, 2016 16:14
Xamarin.Android Install as System Application

Xamarin.Android Installing APK as System Application

Ideally if you took a Release .apk, anything in the lib/ABI should go into the respective /system/lib folder.

For example with a File->New Android Project

If I created a Release Aligned .apk, I should be able to extract it and view the following:

lib\armeabi-v7a

@JonDouglas
JonDouglas / iOSBackground
Created February 11, 2014 21:33
iOS Background Task
using System;
using MonoTouch.UIKit;
using System.Threading.Tasks;
using System.Threading;
using System.Text;
using MonoTouch.Foundation;
namespace Demo2LongRunningTasks
{
partial class LongRunningTaskViewController : UIViewController