Skip to content

Instantly share code, notes, and snippets.

View JonDouglas's full-sized avatar
:shipit:
shipping things

Jon Douglas JonDouglas

:shipit:
shipping things
View GitHub Profile
@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
using System;
using Android.App;
using Android.Content;
using Android.Runtime;
using Android.Views;
using Android.Widget;
using Android.OS;
using LoginScreen;
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
@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

@JonDouglas
JonDouglas / xamarin-android-nuget-m2repository-issues.md
Last active April 23, 2020 15:48
xamarin-android-nuget-m2repository-issues
@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 / xamarinandroidbindings.md
Last active September 8, 2024 20:45
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:

<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"/>
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;