King-of-Spades / AppCenter-Samples

Samples for getting started in Visual Studio App Center
https://appcenter.ms
20 stars 64 forks source link

DO NOT MERGE: An experiment in how to read Instrumentation from Xamarin app in Android #34

Closed owenniblock closed 5 years ago

owenniblock commented 5 years ago

Motivation

An attempt to answer the question "how can you tell if you're in App Center on Xamarin.Android".

Adds an example test for Android to show how we'd check for running in App Center in a Xamarin app.

Notes

I utilised existing code written for the AppCenter SDK (InstrumentationRegistryHelper) - could we suggest that users simply reuse this code?

Here it is working on a range of devices

DO NOT MERGE we'll have to fix iOS before merging this (if indeed we do want to merge it) we could just document what we've done here in the docs?

King-of-Spades commented 5 years ago

@owenniblock I tried to experiment with this locally, but using Com.Microsoft.Appcenter.Utils; appears to be a broken reference. Is it possible you referenced it in a way that only works locally or depends on a package or something that hasn't hasn't been referenced? Or something else I need to install?

(Intellisense did find a result for using Com.Xamarin which makes me think it might be related to installation requirements.)

owenniblock commented 5 years ago

We're hoping to address this by explicitly adding the functionality to the SDK - there's an active PR for this here which I hope to look at soon: https://github.com/microsoft/appcenter-sdk-android/pull/1171#discussion_r287551290