6 namespace XamarinForTizen.Tizen
8 public class ModemPage : ContentPage
10 private static Modem _modem = null;
13 var imeiBtn = new Button
16 VerticalOptions = LayoutOptions.Start,
17 HorizontalOptions = LayoutOptions.FillAndExpand
19 imeiBtn.Clicked += imeiBtn_Clicked;
21 var powerBtn = new Button
23 Text = "Get power status",
24 VerticalOptions = LayoutOptions.Start,
25 HorizontalOptions = LayoutOptions.FillAndExpand
27 powerBtn.Clicked += powerBtn_Clicked;
29 var meidBtn = new Button
32 VerticalOptions = LayoutOptions.Start,
33 HorizontalOptions = LayoutOptions.FillAndExpand
35 meidBtn.Clicked += meidBtn_Clicked;
37 Content = new StackLayout
39 VerticalOptions = LayoutOptions.Center,
41 imeiBtn, powerBtn, meidBtn
47 if (Globals.slotHandle == null)
49 Log.Debug(Globals.LogTag, "Telephony is not initialized/there are no sim slot handles");
53 _modem = new Modem(Globals.slotHandle);
58 Log.Debug(Globals.LogTag, "Exception in modem constructor: " + ex.ToString());
62 private void meidBtn_Clicked(object sender, EventArgs e)
66 Log.Debug(Globals.LogTag, "Telephony is not initialized/there are no sim slot handles");
70 Log.Debug(Globals.LogTag, "MEID: " + _modem.Meid);
73 private void powerBtn_Clicked(object sender, EventArgs e)
77 Log.Debug(Globals.LogTag, "Telephony is not initialized/there are no sim slot handles");
81 Log.Debug(Globals.LogTag, "Power Status: " + _modem.CurrentPowerStatus);
84 private void imeiBtn_Clicked(object sender, EventArgs e)
88 Log.Debug(Globals.LogTag, "Telephony is not initialized/there are no sim slot handles");
92 Log.Debug(Globals.LogTag, "IMEI: " + _modem.Imei);