2 using System.Threading.Tasks;
3 using System.Collections.Generic;
9 namespace XamarinForTizen.Tizen
11 public class SimPage : ContentPage
13 private static Sim _sim = null;
16 var changedBtn = new Button
18 Text = "Is sim changed",
19 VerticalOptions = LayoutOptions.Start,
20 HorizontalOptions = LayoutOptions.FillAndExpand
22 changedBtn.Clicked += changedBtn_Clicked;
24 var operatorBtn = new Button
26 Text = "Get operator",
27 VerticalOptions = LayoutOptions.Start,
28 HorizontalOptions = LayoutOptions.FillAndExpand
30 operatorBtn.Clicked += operatorBtn_Clicked;
32 var iccIdBtn = new Button
35 VerticalOptions = LayoutOptions.Start,
36 HorizontalOptions = LayoutOptions.FillAndExpand
38 iccIdBtn.Clicked += iccIdBtn_Clicked;
40 var msinBtn = new Button
43 VerticalOptions = LayoutOptions.Start,
44 HorizontalOptions = LayoutOptions.FillAndExpand
46 msinBtn.Clicked += msinBtn_Clicked;
48 Content = new StackLayout
50 VerticalOptions = LayoutOptions.Center,
52 changedBtn, operatorBtn, iccIdBtn, msinBtn
58 if (Globals.slotHandle == null)
60 Log.Debug(Globals.LogTag, "Telephony is not initialized/there are no sim slot handles");
64 _sim = new Sim(Globals.slotHandle);
69 Log.Debug(Globals.LogTag, "Exception in Sim constructor: " + ex.ToString());
73 private void msinBtn_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, "Msin: " + _sim.Msin);
84 private void iccIdBtn_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, "Icc id: " + _sim.IccId);
95 private void operatorBtn_Clicked(object sender, EventArgs e)
99 Log.Debug(Globals.LogTag, "Telephony is not initialized/there are no sim slot handles");
103 Log.Debug(Globals.LogTag, "Operator: " + _sim.Operator);
106 private void changedBtn_Clicked(object sender, EventArgs e)
110 Log.Debug(Globals.LogTag, "Telephony is not initialized/there are no sim slot handles");
114 Log.Debug(Globals.LogTag, "Is sim changed: " + _sim.IsChanged);