This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using Android.App; | |
using Android.Content; | |
using Android.Runtime; | |
using Android.Views; | |
using Android.Widget; | |
using Android.OS; | |
using Android.Support.V4.View; | |
namespace XamarinCast |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Android.App; | |
using Android.OS; | |
namespace Notepad | |
{ | |
[Activity (Label = "Notepad", MainLauncher = true, Theme="@android:style/Theme.Holo.Light")] | |
public class MainActivity : MvxActivity | |
{ | |
int count = 1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?xml version="1.0" encoding="utf-8"?> | |
<configuration> | |
<runtime> | |
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"> | |
<dependentAssembly> | |
<assemblyIdentity name="System.Net.Http" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> | |
<bindingRedirect oldVersion="0.0.0.0-4.0.0.0" newVersion="2.0.5.0" /> | |
</dependentAssembly> | |
</assemblyBinding> | |
</runtime> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class HttpClientHelper : IHttpClientHelper | |
{ | |
private HttpMessageHandler handler; | |
public HttpMessageHandler MessageHandler | |
{ | |
get { return handler ?? (handler = new OkHttpNetworkHandler()); } | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private IHttpClientHelper httpClientHelper; | |
public MyService() | |
{ | |
this.httpClientHelper = ServiceContainer.Resolve<IHttpClientHelper>(); //does not exist on WP | |
} | |
private HttpClient CreateClient() | |
{ | |
if(httpClientHelper == null) | |
return new HttpClient(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
private int stepCounter = 0; | |
private int counterSteps = 0; | |
private int stepDetector = 0; | |
public void OnSensorChanged (SensorEvent e) | |
{ | |
switch (e.Sensor.Type) { | |
case SensorType.StepDetector: | |
stepDetector++; | |
break; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public override void OnStart (Intent intent, int startId) | |
{ | |
base.OnStart (intent, startId); | |
if (isRunning || !Utils.IsKitKatWithStepCounter(PackageManager)) | |
return; | |
RegisterListeners (SensorType.StepCounter); | |
} | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<uses-feature android:name="android.hardware.sensor.stepcounter" /> | |
<uses-feature android:name="android.hardware.sensor.stepdetector" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using Android.OS; | |
namespace StepCounter.Services | |
{ | |
public class StepServiceBinder : Binder | |
{ | |
StepService stepService; | |
public StepServiceBinder (StepService service) | |
{ | |
this.stepService = service; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
using System; | |
using Android.App; | |
using Android.Hardware; | |
using Android.Content; | |
using System.ComponentModel; | |
using StepCounter.Helpers; | |
using StepCounter.Database; | |
using StepCounter.Activities; | |
namespace StepCounter.Services |
OlderNewer