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 / 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
@JonDouglas
JonDouglas / Mirror
Last active February 2, 2023 02:26
Mirror
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace Mirror
{
public class Program
{
public static void Main(string[] args)
@JonDouglas
JonDouglas / xamarin-android-nuget-m2repository-issues.md
Last active April 23, 2020 15:48
xamarin-android-nuget-m2repository-issues
using System;
using Android.App;
using Android.Content;
using Android.Runtime;
using Android.Views;
using Android.Widget;
using Android.OS;
using LoginScreen;
@JonDouglas
JonDouglas / snippets.md
Last active July 28, 2017 19:15
Xamarin.Android Troubleshooting Snippets

Diagnosing JIT / AOT Timings

  1. After installing the .apk, open up an Android Device Monitor to the Logcat tab, or use adb logcat
  2. Look for a log under ActivityManager that has the message Displayed Activity: <timing>

EX:

07-28 12:48:38.356: I/ActivityManager(769): Displayed com.myapplication.App1/md58adf3f2592a7497b73592b5e766304c2.MainActivity: +1s990ms
@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
@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

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}");
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