Skip to content

Instantly share code, notes, and snippets.

View brendanzagaeski's full-sized avatar

Brendan Zagaeski brendanzagaeski

  • Microsoft
  • Boston, MA, United States
View GitHub Profile
@brendanzagaeski
brendanzagaeski / AviarySDKApiDefinition.cs
Created May 15, 2014 06:06
Objective Sharpie output for iOS Aviary SDK version 4.0.1
using System.Drawing;
using System;
using MonoTouch.Foundation;
namespace AviarySDK {
public enum AFPhotoEditorPremiumAddOn : [unmapped: unexposed: Elaborated] {
None = 0,
HiRes = 1 << 0,
@brendanzagaeski
brendanzagaeski / DropboxSync.cs
Last active August 29, 2015 14:00
ObjectiveSharpie 0.4.40 binding output for OS X Dropbox Sync SDK
// ObjectiveSharpie 0.4.40 binding output for OS X Dropbox Sync SDK
// https://www.dropbox.com/developers/sync/sdks/osx
//
// IMPORTANT: The Dropbox Sync SDK for OS X is _only_ distributed as a 64-bit
// binary. Xamarin.Mac is currently 32-bit only, so it _cannot_ consume the
// Dropbox library. Xamarin.Mac 64-bit support is in progress [1], so this
// limitation will be solved in the not-to-distant future. But for now, the
// Dropbox Sync SDK is not compatible with Xamarin.Mac.
// [1] http://docs.xamarin.com/releases/Mac/Roadmap/
//
@brendanzagaeski
brendanzagaeski / prefix.pch
Created April 23, 2014 20:55
Default prefix.pch file for Mac projects in Xcode
//
// Prefix header
//
// The contents of this file are implicitly included at the beginning of every source file.
//
#ifdef __OBJC__
#import <Cocoa/Cocoa.h>
#endif
@brendanzagaeski
brendanzagaeski / AndroidNativeLibrariesMoveApp.txt
Created April 11, 2014 23:43
Using the app "Move" feature on some Android phones leads to broken permissions on `lib/` directory
# Using the app "Move" feature on some Android phones leads to broken permissions on `lib/` directory
Starting around Android 15 (Ice Cream Sandwich), or possibly earlier, the "Move to SD" feature on Android underwent some changes. Many modern phones do not support the feature at all. Others support it, but inconsistently (see also [1]).
[1] http://beranger.org/2013/06/14/android-storage-what-nobody-bothered-to-tell-you/
On an HTC One X running Android 4.1.1, moving an app to USB Storage and then back to internal storage changes the permissions of the app's `/data/data/package_name/lib` directory, breaking the app if it depends on native libraries. This problem affects Xamarin.Android apps and Java NDK apps alike.
@brendanzagaeski
brendanzagaeski / TestAppViewController.cs
Last active September 19, 2016 16:38
Obtaining the subnet mask of network interfaces on Xamarin.iOS and Xamarin.Mac
// Obtaining the subnet mask of network interfaces on Xamarin.iOS and Xamarin.Mac
//
// On Xamarin.iOS and Xamarin.Mac, `NetworkInterface.OperationalStatus` always
// returns: `OperationalStatus.Unknown`
// https://github.com/mono/mono/blob/f48ceb9860676c342f4c91fbc2e34ea600d839c6/mcs/class/System/System.Net.NetworkInformation/NetworkInterface.cs#L552-L556
//
// Additionally, on all "Linux-like" platforms, including iOS and Mac,
// `UnicastIPAddressInformation.IPv4Mask` is not implemented
// https://github.com/mono/mono/blob/f48ceb9860676c342f4c91fbc2e34ea600d839c6/mcs/class/System/System.Net.NetworkInformation/UnicastIPAddressInformation.cs#L165-L167
//
@brendanzagaeski
brendanzagaeski / gist:9923465
Created April 1, 2014 21:21
Xamarin Pixate component, potential bug on Xcode 5.1
Under certain circumstances the Pixate library can cause an assertion error:
> *** Assertion failure in -[UITableView _configureCellForDisplay:forIndexPath:], /SourceCache/UIKit_Sim/UIKit-2903.23/UITableView.m:6246
OR
> *** Assertion failure in -[UITableView _configureCellForDisplay:forIndexPath:], /SourceCache/UIKit/UIKit-2935.137/UITableView.m:6509
Continuing through the assertion produces an unhandled exception, and stack traces. It turns out the most interesting part of the stack traces is the involvement of `[PXUITableView layoutSubviews]`.
@brendanzagaeski
brendanzagaeski / Metadata.xml
Created March 28, 2014 14:22
Metadata transforms to remove warnings in Xamarin.Android Flurry SDK binding
<metadata>
<!-- warning BG8401: Skipping Com.Flurry.Sdk.Cf.D, due to a duplicate field, method or nested type name-->
<!-- warning BG8401: Skipping Com.Flurry.Sdk.Cf.F, due to a duplicate field, method or nested type name-->
<!-- warning BG8401: Skipping Com.Flurry.Sdk.Cf.G, due to a duplicate field, method or nested type name-->
<remove-node path="/api/package[@name='com.flurry.sdk']/class[@name='cf']" />
<!-- warning BG8401: Skipping Com.Flurry.Sdk.Eh.A, due to a duplicate field, method or nested type name-->
<remove-node path="/api/package[@name='com.flurry.sdk']/class[@name='eh']" />
<!-- Warning BG8C00: For type Com.Flurry.Sdk.Bx, base interface com.flurry.sdk.cl.a does not exist. -->
@brendanzagaeski
brendanzagaeski / gist:9679610
Created March 21, 2014 04:37
Xamarin.iOS does not support the System.Dynamic namespace
# Xamarin.iOS does not support the System.Dynamic namespace [1]
[1] http://docs.xamarin.com/guides/ios/advanced_topics/limitations/#No_Dynamic_Code_Generation
This also means that Xamarin.iOS app projects cannot use PCLs that depend on System.Dynamic.
## Error messages when trying to use a PCL that depends on System.Dynamic
### Visual Studio, without the Xamarin.iOS `System.Dynamic.Runtime` facade assembly (see also [2])
@brendanzagaeski
brendanzagaeski / TwitterAuthWebView.cs
Created March 18, 2014 18:26
Work around for Xamarin.Android binding of methods in the Socialize SDK's `ITwitterAuthWebView` that are inherited as properties from `WebView`
using System;
using Android.Views;
using Android.Webkit;
namespace Com.Socialize.Auth.Twitter
{
/// <summary>
/// Use "wrapper" methods to work around these two binding errors:
/// Error message: Error CS0535: `Com.Socialize.Auth.Twitter.TwitterAuthWebView' does not implement interface member `Com.Socialize.Auth.Twitter.ITwitterAuthWebView.SetLayoutParams(Android.Views.ViewGroup.LayoutParams)' (CS0535)
/// Error message: Error CS0535: `Com.Socialize.Auth.Twitter.TwitterAuthWebView' does not implement interface member `Com.Socialize.Auth.Twitter.ITwitterAuthWebView.SetVisibility(int)' (CS0535)
@brendanzagaeski
brendanzagaeski / Socialize.cs
Created March 17, 2014 23:16
Hand-adjusted binding for `Socialize.SocializeActivityLifecycleListener` property in the Socialize Android SDK. Works around https://bugzilla.xamarin.com/show_bug.cgi?id=17788 ("Error CS1061: Type ... does not contain a definition for `Handler' and no extension method `Handler'..." and "Error CS1729: The type ... does not contain a constructor t…
using System;
using Android.Runtime;
namespace Com.Socialize
{
public partial class Socialize
{
static IntPtr id_getSocializeActivityLifecycleListener;
static IntPtr id_setSocializeActivityLifecycleListener_Lcom_socialize_ui_SocializeActivityLifecycleListener_;