Skip to content
This repository has been archived by the owner on Oct 12, 2022. It is now read-only.

Commit

Permalink
Merge branch 'release/v1.0-alpha.2'
Browse files Browse the repository at this point in the history
  • Loading branch information
Christoph Wendt committed Jul 10, 2015
2 parents 1dec755 + 8b6653e commit 8ff80e0
Show file tree
Hide file tree
Showing 36 changed files with 581 additions and 292 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
<?xml version="1.0" encoding="utf-8"?>
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectTypeGuids>{786C830F-07A1-408B-BD7F-6EE04809D6DB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
<ProjectGuid>{5DAA7398-7822-44A5-993B-D595A6921D50}</ProjectGuid>
<OutputType>Library</OutputType>
<RootNamespace>AI.XamarinSDK.Abstractions</RootNamespace>
<AssemblyName>AI.XamarinSDK.Abstractions</AssemblyName>
<TargetFrameworkProfile>Profile49</TargetFrameworkProfile>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<OutputPath>bin\Debug</OutputPath>
<DefineConstants>DEBUG;</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<Optimize>true</Optimize>
<OutputPath>bin\Release</OutputPath>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<ConsolePause>false</ConsolePause>
</PropertyGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="ApplicationInsights.cs" />
<Compile Include="IApplicationInsights.cs" />
<Compile Include="ITelemetryManager.cs" />
<Compile Include="TelemetryManager.cs" />
</ItemGroup>
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" />
<Import Project="..\..\packages\Xamarin.Forms.1.4.3.6374\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.targets" Condition="Exists('..\..\packages\Xamarin.Forms.1.4.3.6374\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.targets')" />
<ItemGroup>
<Reference Include="Xamarin.Forms.Core">
<HintPath>..\..\packages\Xamarin.Forms.1.4.3.6374\lib\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.Core.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Xaml">
<HintPath>..\..\packages\Xamarin.Forms.1.4.3.6374\lib\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.Xaml.dll</HintPath>
</Reference>
<Reference Include="Xamarin.Forms.Platform">
<HintPath>..\..\packages\Xamarin.Forms.1.4.3.6374\lib\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.Platform.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<None Include="packages.config" />
</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -1,11 +1,6 @@
using System;

#if __ANDROID__
using Android.App;
using Android.Content;
#endif

namespace AI.XamarinSDK
namespace AI.XamarinSDK.Abstractions
{
/// <summary>
/// This class exposes methods to configure and start the SDK. This is required in order to enable auto collection, crash reporting, and sending of telemetry data.
Expand All @@ -17,7 +12,6 @@ public class ApplicationInsights

private ApplicationInsights() {}

#if __IOS__
/// <summary>
/// Setup the SDK with the instrumentation key of your app.
/// </summary>
Expand All @@ -27,19 +21,6 @@ public static void Setup (string instrumentationKey)
target.Setup (instrumentationKey);
}

#elif __ANDROID__
/// <summary>
/// Setup the SDK with the instrumentation key of your app.
/// </summary>
/// <param name="context">The application context needed to access app ressources.</param>
/// <param name="application">The application needed for auto collecting telemetry data.</param>
/// <param name="instrumentationKey">The instrumentation key of your app.</param>
public static void Setup (Context context, Application application, string instrumentationKey)
{
target.Setup (context, application, instrumentationKey);
}
#endif

/// <summary>
/// Starts the SDK. This should be called after setup().
/// </summary>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,20 +1,11 @@
using System;

#if __ANDROID__
using Android.App;
using Android.Content;
#endif

namespace AI.XamarinSDK
namespace AI.XamarinSDK.Abstractions
{
public interface IApplicationInsights
{
void Setup (string instrumentationKey);

#if __ANDROID__
void Setup (Context context, Application application, string instrumentationKey);
#endif

void Start ();

string GetServerUrl ();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
using System;
using System.Collections.Generic;

namespace AI.XamarinSDK
namespace AI.XamarinSDK.Abstractions
{
public interface ITelemetryManager
{
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
using System.Reflection;
using System.Runtime.CompilerServices;

// Information about this assembly is defined by the following attributes.
// Change them to the values specific to your project.

[assembly: AssemblyTitle ("AI.XamarinSDK.Abstractions")]
[assembly: AssemblyDescription ("")]
[assembly: AssemblyConfiguration ("")]
[assembly: AssemblyCompany ("")]
[assembly: AssemblyProduct ("")]
[assembly: AssemblyCopyright ("christophwendt")]
[assembly: AssemblyTrademark ("")]
[assembly: AssemblyCulture ("")]

// The assembly version has the format "{Major}.{Minor}.{Build}.{Revision}".
// The form "{Major}.{Minor}.*" will automatically update the build and revision,
// and "{Major}.{Minor}.{Build}.*" will update just the revision.

[assembly: AssemblyVersion ("1.0.*")]

// The following attributes are used to specify the signing key for the assembly,
// if desired. See the Mono documentation for more information about signing.

//[assembly: AssemblyDelaySign(false)]
//[assembly: AssemblyKeyFile("")]

Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
using Xamarin.Forms;
using System.Collections.Generic;

namespace AI.XamarinSDK
namespace AI.XamarinSDK.Abstractions
{
/// <summary>
/// This class exposes functions to track differnt types of telemetry data. Tracked data will be created, persisted, and sent to the server.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Xamarin.Forms" version="1.4.3.6374" targetFramework="portable-net45+wp80+MonoTouch10+MonoAndroid10+xamarinmac20+xamarinios10" />
</packages>
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,8 @@
<MonoAndroidResourcePrefix>Resources</MonoAndroidResourcePrefix>
<AndroidResgenClass>Resource</AndroidResgenClass>
<AndroidResgenFile>Resources\Resource.designer.cs</AndroidResgenFile>
<AndroidUseLatestPlatformSdk>True</AndroidUseLatestPlatformSdk>
<AndroidUseLatestPlatformSdk>False</AndroidUseLatestPlatformSdk>
<AssemblyName>AI.XamarinSDK.Android</AssemblyName>
<TargetFrameworkVersion>v5.0</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
Expand Down Expand Up @@ -46,29 +45,24 @@
</Reference>
<Reference Include="Xamarin.Forms.Platform.Android">
<HintPath>..\..\packages\Xamarin.Forms.1.4.3.6374\lib\MonoAndroid10\Xamarin.Forms.Platform.Android.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="FormsViewGroup">
<HintPath>..\..\packages\Xamarin.Forms.1.4.3.6374\lib\MonoAndroid10\FormsViewGroup.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Xamarin.Forms.Core">
<HintPath>..\..\packages\Xamarin.Forms.1.4.3.6374\lib\MonoAndroid10\Xamarin.Forms.Core.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Xamarin.Forms.Xaml">
<HintPath>..\..\packages\Xamarin.Forms.1.4.3.6374\lib\MonoAndroid10\Xamarin.Forms.Xaml.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Xamarin.Forms.Platform">
<HintPath>..\..\packages\Xamarin.Forms.1.4.3.6374\lib\MonoAndroid10\Xamarin.Forms.Platform.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Resources\Resource.designer.cs" />
<Compile Include="ApplicationInsightsAndroid.cs" />
<Compile Include="TelemetryManagerAndroid.cs" />
<Compile Include="ApplicationInsights.cs" />
<Compile Include="TelemetryManager.cs" />
</ItemGroup>
<ItemGroup>
<None Include="Resources\AboutResources.txt" />
Expand All @@ -77,11 +71,14 @@
<ItemGroup>
<AndroidResource Include="Resources\values\Strings.xml" />
</ItemGroup>
<Import Project="..\AI.XamarinSDK\Shared.projitems" Label="Shared" Condition="Exists('..\AI.XamarinSDK\Shared.projitems')" />
<Import Project="$(MSBuildExtensionsPath)\Novell\Novell.MonoDroid.CSharp.targets" />
<Import Project="..\packages\Xamarin.Forms.1.4.3.6374\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.targets" Condition="Exists('..\packages\Xamarin.Forms.1.4.3.6374\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.targets')" />
<Import Project="..\..\packages\Xamarin.Forms.1.4.3.6374\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.targets" Condition="Exists('..\..\packages\Xamarin.Forms.1.4.3.6374\build\portable-win+net45+wp80+win81+wpa81+MonoAndroid10+MonoTouch10+Xamarin.iOS10\Xamarin.Forms.targets')" />
<ItemGroup>
<ProjectReference Include="..\AI.XamarinSDK.Abstractions\AI.XamarinSDK.Abstractions.csproj">
<Project>{5DAA7398-7822-44A5-993B-D595A6921D50}</Project>
<Name>AI.XamarinSDK.Abstractions</Name>
</ProjectReference>
<ProjectReference Include="..\AI.XamarinSDK.AndroidBindings\AI.XamarinSDK.AndroidBindings.csproj">
<Project>{E1779521-C094-4CA0-ACFA-B26A1B2B80F3}</Project>
<Name>AI.XamarinSDK.AndroidBindings</Name>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,26 +1,24 @@
using System;
using Android;
using Android.Runtime;
using Android.App;
using Android.Content;
using Xamarin.Forms;
using AI.XamarinSDK.Abstractions;

[assembly: Xamarin.Forms.Dependency (typeof (AI.XamarinSDK.Android.ApplicationInsightsAndroid))]

[assembly: Xamarin.Forms.Dependency (typeof (AI.XamarinSDK.Android.ApplicationInsights))]
namespace AI.XamarinSDK.Android
{
public class ApplicationInsightsAndroid : Java.Lang.Object, IApplicationInsights
[Preserve(AllMembers=true)]
public class ApplicationInsights : Java.Lang.Object, IApplicationInsights
{
private static bool _crashManagerDisabled = false;

public ApplicationInsightsAndroid (){}
public ApplicationInsights (){}

public void Setup(string instrumentationKey)
{
Com.Microsoft.Applicationinsights.Library.ApplicationInsights.Setup (Application.Context, null, instrumentationKey);
}

public void Setup (Context context, Application application, string instrumentationKey)
{
Com.Microsoft.Applicationinsights.Library.ApplicationInsights.Setup (context, application, instrumentationKey);
Com.Microsoft.Applicationinsights.Library.ApplicationInsights.Setup (((Activity)Forms.Context).Application, ((Activity)Forms.Context).Application, instrumentationKey);
}

public void Start ()
Expand Down Expand Up @@ -70,7 +68,7 @@ public void SetAutoSessionManagementDisabled (bool autoSessionManagementDisabled

public void SetUserId (string userId)
{
ApplicationInsights.SetUserId (userId);
Com.Microsoft.Applicationinsights.Library.ApplicationInsights.SetUserId (userId);
}

public void StartNewSession (){
Expand Down Expand Up @@ -108,7 +106,7 @@ public void OnUnhandledExceptionRaiser(object sender, RaiseThrowableEventArgs e)
{
Exception managedException = (Exception)e.Exception;
if (managedException != null) {
TelemetryManager.TrackManagedException (managedException, false);
AI.XamarinSDK.Abstractions.TelemetryManager.TrackManagedException (managedException, false);
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,16 @@
using Android.Content;
using System.Collections.Generic;
using Com.Microsoft.Applicationinsights.Library;
using AI.XamarinSDK.Abstractions;

[assembly: Xamarin.Forms.Dependency (typeof (AI.XamarinSDK.Android.TelemetryManagerAndroid))]

[assembly: Xamarin.Forms.Dependency (typeof (AI.XamarinSDK.Android.TelemetryManager))]
namespace AI.XamarinSDK.Android
{
public class TelemetryManagerAndroid : Java.Lang.Object, ITelemetryManager
[Preserve(AllMembers=true)]
public class TelemetryManager : Java.Lang.Object, ITelemetryManager
{

public TelemetryManagerAndroid(){}
public TelemetryManager(){}

public void TrackEvent (string eventName)
{
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Xamarin.Android.Support.v4" version="22.2.0.0" targetFramework="MonoAndroid50" />
<package id="Xamarin.Forms" version="1.4.3.6374" targetFramework="MonoAndroid50" />
<package id="Xamarin.Android.Support.v4" version="22.2.0.0" targetFramework="MonoAndroid23" />
<package id="Xamarin.Forms" version="1.4.3.6374" targetFramework="MonoAndroid23" />
</packages>
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
<MonoAndroidAssetsPrefix>Assets</MonoAndroidAssetsPrefix>
<AndroidUseLatestPlatformSdk>False</AndroidUseLatestPlatformSdk>
<AssemblyName>AI.XamarinSDK.AndroidBindings</AssemblyName>
<TargetFrameworkVersion>v4.0.3</TargetFrameworkVersion>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<DebugSymbols>true</DebugSymbols>
Expand Down Expand Up @@ -42,26 +41,6 @@
<HintPath>..\..\packages\Xamarin.Android.Support.v4.22.2.0.0\lib\MonoAndroid403\Xamarin.Android.Support.v4.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Xamarin.Forms.Platform.Android">
<HintPath>..\..\packages\Xamarin.Forms.1.4.3.6374\lib\MonoAndroid10\Xamarin.Forms.Platform.Android.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="FormsViewGroup">
<HintPath>..\..\packages\Xamarin.Forms.1.4.3.6374\lib\MonoAndroid10\FormsViewGroup.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Xamarin.Forms.Core">
<HintPath>..\..\packages\Xamarin.Forms.1.4.3.6374\lib\MonoAndroid10\Xamarin.Forms.Core.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Xamarin.Forms.Xaml">
<HintPath>..\..\packages\Xamarin.Forms.1.4.3.6374\lib\MonoAndroid10\Xamarin.Forms.Xaml.dll</HintPath>
<Private>False</Private>
</Reference>
<Reference Include="Xamarin.Forms.Platform">
<HintPath>..\..\packages\Xamarin.Forms.1.4.3.6374\lib\MonoAndroid10\Xamarin.Forms.Platform.dll</HintPath>
<Private>False</Private>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Xamarin.Android.Support.v4" version="22.2.0.0" targetFramework="MonoAndroid403" />
<package id="Xamarin.Forms" version="1.4.3.6374" targetFramework="MonoAndroid403" />
<package id="Xamarin.Android.Support.v4" version="22.2.0.0" targetFramework="MonoAndroid23" />
<package id="Xamarin.Forms" version="1.4.3.6374" targetFramework="MonoAndroid23" />
</packages>
Loading

0 comments on commit 8ff80e0

Please sign in to comment.