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
using System;
using Android.App;
using Android.Content;
using Android.Runtime;
using Android.Views;
using Android.Widget;
using Android.OS;
namespace NewCameraBroadcast
{
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;
@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"
@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:
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 / xamarinandroidbindings.md
Last active March 12, 2024 10:36
Xamarin Android Bindings Troubleshooting

Approaching a Xamarin.Android Bindings Case

1. Investigation

One of the best ways to investigate a problematic Xamarin.Android Binding is to first ensure you have the proper tooling available:

@JonDouglas
JonDouglas / xamarin-android-performance.md
Last active February 28, 2024 17:44
Xamarin Android Performance

Xamarin.Android Performance Issues

1. Investigation

One of the best ways to investigate a problematic Xamarin.Android Errors is to first ensure you have the proper tooling available:

  • Diagnostic MSBuild Output Enabled(Instructions)
  • Android SDK Installed
  • Android API Level Documentation