Skip to content

Instantly share code, notes, and snippets.

John Wilson wislon

Block or report user

Report or block wislon

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
wislon / SdkBeforeCleanFix.txt
Last active Aug 28, 2018
Fix '_SdkBeforeClean' build error when building xamarin xplat app
View SdkBeforeCleanFix.txt
It seems to only be a problem on xplat solutions, as they set up a chain of 'clean'-task dependencies,
which apparently other solutions don't.
This is caused by a missing `;` in one of the msbuild `.targets` files as described here
(and is a bug in dotnet core 2.1.3 sdk, and VS 2017 15.8.x):
which led to
wislon / BluetoothHelper.cs
Created Nov 22, 2017
Android Bluetooth Helper (power up/down adapter, build config based on SDK level etc.)
View BluetoothHelper.cs
public static class BluetoothHelper
private static readonly BluetoothManager _manager;
private static readonly BluetoothAdapter _adapter;
static BluetoothHelper()
var context = Application.Context;
_manager = (BluetoothManager)context.GetSystemService("bluetooth");
_adapter = _manager.Adapter;
wislon / boxstarter01.ps1
Last active Sep 15, 2017
BoxStarter scripts For initial windoze setup
View boxstarter01.ps1
# Blatantly swiped from
# - Nick Craver's gist at
# - Jess Frazelle's at
# To run this locally, do
# Install-BoxstarterPackage -PackageName <this.RAW.gist.url> -DisableReboots
# i.e. Install-BoxstarterPackage -PackageName -DisableReboots
# If you allow reboots, you will likely be prompted for your password so it can reboot/relog in as necessary.
wislon / Android Privacy Policy Template
Created Mar 12, 2017 — forked from alphamu/Android Privacy Policy Template
A template for creating your own privacy policy for Android apps. Look for "[" and "<!--" to see where you need to edit this app in order to create your own privacy olicy.
View Android Privacy Policy Template
<h2>Privacy Policy</h2>
<p>[Individual or Company Name] built the [App Name] app as a [open source | free | freemium | ad-supported | commercial] app. This SERVICE is provided by [Individual or company name] [at no cost] and is intended
for use as is.</p>
<p>This page is used to inform website visitors regarding [my|our] policies with the collection, use, and
disclosure of Personal Information if anyone decided to use [my|our] Service.</p>
<p>If you choose to use [my|our] Service, then you agree to the collection and use of information in
relation with this policy. The Personal Information that [I|we] collect are used for providing and
improving the Service. [I|We] will not use or share your information with anyone except as described
wislon / 1_IPlatformCookieStore.cs
Last active Aug 6, 2018
Xamarin Forms xplat WebView Cookie Demo
View 1_IPlatformCookieStore.cs
using System.Collections.Generic;
using System.Net;
public interface IPlatformCookieStore
/// <summary>
/// List of cookies pulled from the cookie storage manager
/// on the device/platform you're on. Can be quite an expensive call,
/// so use it sparingly.
/// </summary>
wislon /
Last active Sep 25, 2015
Xamarin Forms XAML Dynamic ListView ItemTemplate Selection

Sample Grid XAML DataTemplate with a Grid layout

Has a basic 5-column, 6-row layout, with padding/spacing columns/rows delineated with coloured boxviews (since gridview cells don't have borders, we can't see where one cell stops and another begins)

Note, to get the design-time intellisense for the DataContext binding, you'll need to add the following namespaces to the top of your XAML file (can go beneath the usual xamarin forms namespaces, order isn't really important):

wislon /
Last active Sep 23, 2015
Xam.Forms XAML conditional compilation& design-time bindings intellisense in VS

Xam.Forms XAML conditional compilation& design-time bindings intellisense

Original article:

add (to each xaml file, near the top with the other xmlns definitions)

wislon / getcookiesgist.cs
Created Sep 10, 2015
Get Cookies from HTTPClient instance (using CookieContainer, or raw headers)
View getcookiesgist.cs
/// <summary>
/// Will return null if the cookie you were looking for isn't in the container.
/// </summary>
/// <param name="cookieName"></param>
/// <param name="cookieContainer"></param>
/// <returns></returns>
protected async Task<Cookie> ExtractCookieWithName(string cookieName, CookieContainer cookieContainer)
var cookies = cookieContainer.GetCookies(new Uri(SharedConstants.WebsiteBaseUrl));
var cookie = cookies[cookieName];
wislon / fragment.xml
Last active Apr 26, 2019
Transparent WebView Load Animated Gif (Xamarin Android)
View fragment.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android=""
wislon / ViewExtensions.cs
Last active Aug 29, 2015
Animation code samples
View ViewExtensions.cs
using Android.Content;
using Android.Views;
using Android.Views.Animations;
namespace Mobile.Droid.Extensions
// invoke with anyView.BringViewInWithAnimation/TakeViewOutWithAnimation
// where animation param is predefined animations from xml, code, etc.
// e.g. inAnimation = AnimationUtils.LoadAnimation(Activity, Resource.Animation.bottom_slide_in);
You can’t perform that action at this time.