6 namespace XamarinForTizen.Tizen
8 public class NetworkPage : ContentPage
10 private static Network _network = null;
13 var cellBtn = new Button
16 VerticalOptions = LayoutOptions.Start,
17 HorizontalOptions = LayoutOptions.FillAndExpand
19 cellBtn.Clicked += cellBtn_Clicked;
21 var lacBtn = new Button
24 VerticalOptions = LayoutOptions.Start,
25 HorizontalOptions = LayoutOptions.FillAndExpand
27 lacBtn.Clicked += lacBtn_Clicked;
29 var mccBtn = new Button
32 VerticalOptions = LayoutOptions.Start,
33 HorizontalOptions = LayoutOptions.FillAndExpand
35 mccBtn.Clicked += mccBtn_Clicked;
37 var mncBtn = new Button
40 VerticalOptions = LayoutOptions.Start,
41 HorizontalOptions = LayoutOptions.FillAndExpand
43 mncBtn.Clicked += mncBtn_Clicked;
45 Content = new StackLayout
47 VerticalOptions = LayoutOptions.Center,
49 cellBtn, lacBtn, mccBtn, mncBtn
55 if (Globals.slotHandle == null)
57 Log.Debug(Globals.LogTag, "Telephony is not initialized/there are no sim slot handles");
61 _network = new Network(Globals.slotHandle);
66 Log.Debug(Globals.LogTag, "Exception in network constructor: " + ex.ToString());
70 private void mncBtn_Clicked(object sender, EventArgs e)
74 Log.Debug(Globals.LogTag, "Telephony is not initialized/there are no sim slot handles");
78 Log.Debug(Globals.LogTag, "Mnc: " + _network.Mnc);
81 private void mccBtn_Clicked(object sender, EventArgs e)
85 Log.Debug(Globals.LogTag, "Telephony is not initialized/there are no sim slot handles");
89 Log.Debug(Globals.LogTag, "Mcc: " + _network.Mcc);
92 private void lacBtn_Clicked(object sender, EventArgs e)
96 Log.Debug(Globals.LogTag, "Telephony is not initialized/there are no sim slot handles");
100 Log.Debug(Globals.LogTag, "Lac: " + _network.Lac);
103 private void cellBtn_Clicked(object sender, EventArgs e)
105 if (_network == null)
107 Log.Debug(Globals.LogTag, "Telephony is not initialized/there are no sim slot handles");
111 Log.Debug(Globals.LogTag, "Cell ID: " + _network.CellId);