Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Example of how get battery status from device in Xamarin.Forms applications - http://julianocustodio.com/BatteryStatus
using Plugin.Battery;
using Xamarin.Forms;
namespace BatteryStatusDemo
{
public partial class MainPage : ContentPage
{
public MainPage()
{
InitializeComponent();
RemainingChargePercent.Text = "RemainingChargePercent: " + CrossBattery.Current.RemainingChargePercent + " %";
Status.Text = "Status: " + CrossBattery.Current.Status;
PowerSource.Text = "PowerSource: " + CrossBattery.Current.PowerSource;
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.