Skip to content

Instantly share code, notes, and snippets.

Brendan Zagaeski brendanzagaeski

Block or report user

Report or block brendanzagaeski

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
@brendanzagaeski
brendanzagaeski / Metadata.xml
Created Dec 22, 2015
Some Metadata.xml fixes for binding ADTECH Mobile (http://www.adtech.com/) in Xamarin.Android
View Metadata.xml
<!-- This is an example of http://developer.xamarin.com/guides/android/advanced_topics/java_integration_overview/binding-a-java-library/troubleshooting-bindings/#Problem_Duplicate_custom_EventArgs_types
In this particular case, the conflicting definition is in
`Com.Adtech.Mobilesdk.Publisher.Vast.Player.ILinearAdPlayer`.
That interface also defines an "onError" method.
Error CS0102: The type
`Com.Adtech.Mobilesdk.Publisher.Vast.Player.ErrorEventArgs'
already contains a definition for `p0' -->
<attr path="/api/package[@name='com.adtech.mobilesdk.publisher.vast.player']/interface[@name='VideoPlayerListener']/method[@name='onError' and count(parameter)=1 and parameter[1][@type='java.lang.Exception']]" name="argsType">VideoPlayerListenerOnErrorArgs</attr>
View RestoreSymlinkBug34083.md

The following steps are commands to run in a Terminal.app command prompt. The first step assumes that you have already changed directory with the cd command into the directory that contains the .ipa file (UnifiedSingleViewIphone1.ipa in this example.)

  1. Expand the .ipa archive:

    ditto -xk UnifiedSingleViewIphone1.ipa ./original

  2. Add back the symbolic link, overwriting the incorrect non-linked version of the file:

    ln -fs ../.monotouch-64/UnifiedSingleViewIphone1.exe original/Payload/UnifiedSingleViewIphone1.app/.monotouch-32/UnifiedSingleViewIphone1.exe

@brendanzagaeski
brendanzagaeski / XamarinSubmitXcode.md
Created Jul 7, 2015
Steps to submit a Xamarin.iOS app using the Xcode Organizer
View XamarinSubmitXcode.md

Note: these steps are for the special case where a user wishes to submit a Xamarin.iOS app to the App Store using the Xcode Organizer. In most cases the simpler option is instead to use Application Loader. See the first post on https://forums.xamarin.com/discussion/40388/disallowed-paths-itunesmetadata-plist-found-at-when-submitting-to-app-store/p1 for the simpler steps and additional information.

Steps to submit a Xamarin.iOS app using the Xcode Organizer

For this example assume that the name of the Xamarin.iOS project is "iPhoneApp1".

(Modified from the helpful post here.)

  1. Use the "Build -> Archive for Publishing" workflow in Xamarin Studio to create the .xcarchive (see also the "Building the Distributable" section on the publishing guide).
@brendanzagaeski
brendanzagaeski / bundle-gtk-printing.sh
Created Mar 30, 2015
Bundle and modify all the necessary files to allow printing via Gtk.PrintOperation in Xamarin.Mac
View bundle-gtk-printing.sh
echo 'etc/fonts/fonts.conf etc/pango/pango.modules lib/gtk-2.0/2.10.0/engines/libclearlooks.so lib/gtk-2.0/2.10.0/engines/libmurrine.so lib/gtk-2.0/2.10.0/engines/libquartz.so lib/gtk-2.0/2.10.0/engines/libsvg.so lib/gtk-2.0/2.10.0/engines/libxamarin.so lib/gtk-2.0/2.10.0/printbackends/libprintbackend-cups.so lib/gtk-2.0/2.10.0/printbackends/libprintbackend-file.so lib/gtk-2.0/2.10.0/printbackends/libprintbackend-lpr.so lib/gtk-2.0/modules/libferret.so lib/gtk-2.0/modules/libgail.so lib/pango/1.8.0/modules/pango-arabic-lang.so lib/pango/1.8.0/modules/pango-arabic-lang.so.dSYM/Contents/Info.plist lib/pango/1.8.0/modules/pango-arabic-lang.so.dSYM/Contents/Resources/DWARF/pango-arabic-lang.so lib/pango/1.8.0/modules/pango-basic-coretext.so lib/pango/1.8.0/modules/pango-basic-coretext.so.dSYM/Contents/Info.plist lib/pango/1.8.0/modules/pango-basic-coretext.so.dSYM/Contents/Resources/DWARF/pango-basic-coretext.so lib/pango/1.8.0/modules/pango-indic-lang.so lib/pango/1.8.0/modules/pango-indic-lang.so.dSYM/Contents/
@brendanzagaeski
brendanzagaeski / installpathfix.sh
Last active Aug 29, 2015
Install path fixups for GTK# with Xamarin.Mac mmp
View installpathfix.sh
#!/bin/sh
cp /Library/Frameworks/Mono.framework/Versions/Current/lib/libgdk_pixbuf-2.0.0.dylib "$1/Contents/MonoBundle/"
cp /Library/Frameworks/Mono.framework/Versions/Current/lib/libgio-2.0.0.dylib "$1/Contents/MonoBundle/"
cp /Library/Frameworks/Mono.framework/Versions/Current/lib/libgmodule-2.0.0.dylib "$1/Contents/MonoBundle/"
cp /Library/Frameworks/Mono.framework/Versions/Current/lib/libffi.6.dylib "$1/Contents/MonoBundle/"
cp /Library/Frameworks/Mono.framework/Versions/Current/lib/libxml2.2.dylib "$1/Contents/MonoBundle/"
find $1 -name "*.config" | while read FILE; do
sed -i "" 's:/Library/Frameworks/Mono.framework/Versions/3.12.1/lib/:@executable_path/../MonoBundle/:' "$FILE";
@brendanzagaeski
brendanzagaeski / Metadata.xml
Created Jul 7, 2014
Some Metadata.xml fixes for binding the "Brother Print SDK for Android" (http://www.brother.com/product/dev/mobile/android/) in Xamarin.Android
View Metadata.xml
<metadata>
<!-- Some Metadata.xml fixes for binding the "Brother Print SDK for
Android" (http://www.brother.com/product/dev/mobile/android/) in
Xamarin.Android. -->
<!-- Warning BG8401: Skipping Com.Brother.Ptouch.Sdk.LabelInfo.LabelColor, due to a duplicate field, method or nested type name
This one is a bit tricky. Let's first just try removing the whole
LabelColor nested class:
@brendanzagaeski
brendanzagaeski / Metadata.xml
Last active Sep 22, 2019
Some Metadata.xml fixes for binding NeoReaderSDK (http://www.neom.com/solutions/neoreader/SDK) in Xamarin.Android
View Metadata.xml
<metadata>
<!-- Error CS0234: The type or namespace name `QuadCorners' does not exist in the namespace `DE.Neom.Neoreadersdk'. Are you missing an assembly reference?
This problem is caused by the default unspecified visibility of
the QuadCorners Java class.
Note in particular the very end of the following line from
`obj/Debug/api.xml`:
<class abstract="false" deprecated="not deprecated" extends="java.lang.Object" extends-generic-aware="java.lang.Object" final="false" name="QuadCorners" static="false" visibility="">
@brendanzagaeski
brendanzagaeski / FooFileActivity.cs
Last active Aug 15, 2018
Tell Android to open a particular file type in your Xamarin.Android app
View FooFileActivity.cs
using Android.App;
using Android.Content;
// Tell Android to open a particular file type in your Xamarin.Android app
// Different apps will produce different intents for the same file, so
// you will need multiple intent filters to handle all the cases.
// You can look in the `adb logcat` logs to see which intent appears
// after you have tapped on a file in an app.
@brendanzagaeski
brendanzagaeski / Metadata.xml
Created May 20, 2014
Some Metadata.xml fixes for binding "Java WebSockets" (https://github.com/TooTallNate/Java-WebSocket/) in Xamarin.Android
View Metadata.xml
<metadata>
<!-- Some Metadata.xml fixes for binding "Java WebSockets" (https://github.com/TooTallNate/Java-WebSocket/) in Xamarin.Android -->
<!-- This is a case of http://docs.xamarin.com/guides/android/advanced_topics/java_integration_overview/binding_a_java_library_(.jar)/#Problem_Duplicate_custom_EventArgs_types
Error CS0102: The type `Org.Java_websocket.WebsocketMessageEventArgs'
already contains a definition for `p0' -->
<attr path="/api/package[@name='org.java_websocket']/interface[@name='WebSocketListener']/method[@name='onWebsocketMessage' and count(parameter)=2 and parameter[1][@type='org.java_websocket.WebSocket'] and parameter[2][@type='java.nio.ByteBuffer']]" name="argsType">WebsocketMessageByteBufferEventArgs</attr>
You can’t perform that action at this time.