Mobile Computing Manual (Windows)
Mobile Computing Manual (Windows)
Semester II
Mobile Computing
Index
Sr no
1
2
3
4
5
6
Name
Simple Addition,Multiplication,etc operations in
Windows Mobile.
Calculate Factorial,Revers,IsPalindrome of a given
Number in Windows Mobile.
Design Currency Converter in Windows Mobile.
a) Design Unit Converter in Windows Mobile.
b)Design Temperature Converter in Windows Mobile.
7
8
9
10
lbl_temp.Text = txt_no.Text;
txt_no.Text = "";
}
ans = a - b;
lbl_temp.Text = Convert.ToString(ans);
txt_no.Text = lbl_temp.Text;
lbl_temp.Text = null;
}
else if (lbl_sign.Text == "/")
{
a = Convert.ToDouble(lbl_temp.Text);
b = Convert.ToDouble(txt_no.Text);
ans = a / b;
lbl_temp.Text = Convert.ToString(ans);
txt_no.Text = lbl_temp.Text;
lbl_temp.Text = null;
}
else if (lbl_sign.Text == "*")
{
a = Convert.ToDouble(lbl_temp.Text);
b = Convert.ToDouble(txt_no.Text);
ans = a * b;
lbl_temp.Text = Convert.ToString(ans);
txt_no.Text = lbl_temp.Text;
lbl_temp.Text = null;
}
else { }
}
Click = button
Code for
Button 1 : Convert
EndIf
If (ComboBox1.Text = "Pound") Then
c = Convert.ToInt32(TextBox1.Text)
d = c * 101
TextBox2.Text = d.ToString()
EndIf
If (ComboBox1.Text = "Yen") Then
c = Convert.ToInt32(TextBox1.Text)
d = c * 0.6
TextBox2.Text = d.ToString()
EndIf
EndSub
Button 2 : Reset
PrivateSub Button2_Click(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles Button2.Click
TextBox1.Text = ""
TextBox2.Text = ""
ComboBox1.Text = "Select"
EndSub
event of combobox)
label1.Text = "Inch";
b = a * 25.4;
label2.Text = "Milimeter";
textBox2.Text = b.ToString();
}
elseif (comboBox1.Text == "inch"&& comboBox2.Text
{
label1.Text = "Inch";
b = a * 2.54;
label2.Text = "Centimeter";
textBox2.Text = b.ToString();
}
elseif (comboBox1.Text == "inch"&& comboBox2.Text
{
label1.Text = "Inch";
b = a * 0.0254;
label2.Text = "Meter";
textBox2.Text = b.ToString();
}
elseif (comboBox1.Text == "inch"&& comboBox2.Text
{
label1.Text = "Inch";
b = a;
label2.Text = "Inch";
textBox2.Text = b.ToString();
}
elseif (comboBox1.Text == "inch"&& comboBox2.Text
{
label1.Text = "Inch";
b = a * 0.0833333;
label2.Text = "Foot";
textBox2.Text = b.ToString();
}
elseif (comboBox1.Text == "foot"&& comboBox2.Text
{
label1.Text = "Foot";
b = a * 304.8;
label2.Text = "Milimeter";
textBox2.Text = b.ToString();
}
elseif (comboBox1.Text == "foot"&& comboBox2.Text
{
label1.Text = "Foot";
b = a * 30.48;
label2.Text = "Centimeter";
textBox2.Text = b.ToString();
}
elseif (comboBox1.Text == "Foot"&& comboBox2.Text
{
label1.Text = "Foot";
b = a * 0.3048;
label2.Text = "Meter";
textBox2.Text = b.ToString();
}
elseif (comboBox1.Text == "foot"&& comboBox2.Text
{
== "cm")
== "m")
== "inch")
== "foot")
== "mm")
== "cm")
== "m")
== "inch")
label1.Text = "Foot";
b = a * 12;
label2.Text = "Inch";
textBox2.Text = b.ToString();
}
elseif (comboBox1.Text == "foot"&& comboBox2.Text == "foot")
{
label1.Text = "Foot";
b = a;
label2.Text = "Foot";
textBox2.Text = b.ToString();
}
elseif (comboBox1.Text == "Km"&& comboBox2.Text == "mm")
{
label1.Text = "Kilometer";
b = a * 1000000;
label2.Text = "Milimeter";
textBox2.Text = b.ToString();
}
elseif (comboBox1.Text == "Km"&& comboBox2.Text == "cm")
{
label1.Text = "Kilometer";
b = a * 100000;
label2.Text = "Centimeter";
textBox2.Text = b.ToString();
}
elseif (comboBox1.Text == "Km"&& comboBox2.Text == "m")
{
label1.Text = "Kilometer";
b = a * 1000;
label2.Text = "Meter";
textBox2.Text = b.ToString();
}
elseif (comboBox1.Text == "Km"&& comboBox2.Text == "inch")
{
label1.Text = "Kilometer";
b = a * 39370.1;
label2.Text = "Inch";
textBox2.Text = b.ToString();
}
elseif (comboBox1.Text == "Km"&& comboBox2.Text == "foot")
{
label1.Text = "Kilometer";
b = a * 3280.84;
label2.Text = "Foot";
textBox2.Text = b.ToString();
}
elseif (comboBox1.Text == "mm"&& comboBox2.Text == "Km")
{
label1.Text = "Milimeter";
b = a * 0.000001;
label2.Text = "Kilometer";
textBox2.Text = b.ToString();
}
elseif (comboBox1.Text == "cm"&& comboBox2.Text == "Km")
{
label1.Text = "Centimeter";
b = a * 0.00001;
label2.Text = "Kilometer";
textBox2.Text = b.ToString();
}
elseif (comboBox1.Text == "m"&& comboBox2.Text == "Km")
{
label1.Text = "Meter";
b = a * 0.001;
label2.Text = "Kilometer";
textBox2.Text = b.ToString();
}
elseif (comboBox1.Text == "inch"&& comboBox2.Text == "Km")
{
label1.Text = "Inch";
b = a * 0.00254;
label2.Text = "Kilometer";
textBox2.Text = b.ToString();
}
elseif (comboBox1.Text == "foot"&& comboBox2.Text == "Km")
{
label1.Text = "Foot";
b = a * 0.0003048;
label2.Text = "Km";
textBox2.Text = b.ToString();
}
}
combobox 2)
}
elseif (comboBox1.Text == "mm"&& comboBox2.Text == "inch")
{
label1.Text = "Milimeter";
b = a * 0.0393701;
label2.Text = "Inch";
textBox2.Text = b.ToString();
}
elseif (comboBox1.Text == "mm"&& comboBox2.Text == "Foot")
{
label1.Text = "Milimeter";
b = a * 0.00328084;
label2.Text = "Foot";
textBox2.Text = b.ToString();
}
elseif (comboBox1.Text == "cm"&& comboBox2.Text == "mm")
{
label1.Text = "Centimeter";
b = a * 10;
label2.Text = "Milimeter";
textBox2.Text = b.ToString();
}
elseif (comboBox1.Text == "cm"&& comboBox2.Text == "cm")
{
label1.Text = "Centimeter";
b = a;
label2.Text = "Centimeter";
textBox2.Text = b.ToString();
}
elseif (comboBox1.Text == "cm"&& comboBox2.Text == "m")
{
label1.Text = "Centimeter";
b = a * 0.01;
label2.Text = "Meter";
textBox2.Text = b.ToString();
}
elseif (comboBox1.Text == "cm"&& comboBox2.Text == "inch")
{
label1.Text = "Centimeter";
b = a * 0.393701;
label2.Text = "Inch";
textBox2.Text = b.ToString();
}
elseif (comboBox1.Text == "cm"&& comboBox2.Text == "foot")
{
label1.Text = "Centimeter";
b = a * 0.0328084;
label2.Text = "Foot";
textBox2.Text = b.ToString();
}
elseif (comboBox1.Text == "m"&& comboBox2.Text == "mm")
{
label1.Text = "Meter";
b = a * 1000;
label2.Text = "Milimeter";
textBox2.Text = b.ToString();
}
"cm")
"m")
"inch")
"foot")
== "mm")
== "cm")
== "m")
== "inch")
== "foot")
label1.Text = "Inch";
b = a * 0.0833333;
label2.Text = "Foot";
textBox2.Text = b.ToString();
}
elseif (comboBox1.Text == "foot"&& comboBox2.Text == "mm")
{
label1.Text = "Foot";
b = a * 304.8;
label2.Text = "Milimeter";
textBox2.Text = b.ToString();
}
elseif (comboBox1.Text == "foot"&& comboBox2.Text == "cm")
{
label1.Text = "Foot";
b = a * 30.48;
label2.Text = "Centimeter";
textBox2.Text = b.ToString();
}
elseif (comboBox1.Text == "Foot"&& comboBox2.Text == "m")
{
label1.Text = "Foot";
b = a * 0.3048;
label2.Text = "Meter";
textBox2.Text = b.ToString();
}
elseif (comboBox1.Text == "foot"&& comboBox2.Text == "inch")
{
label1.Text = "Foot";
b = a * 12;
label2.Text = "Inch";
textBox2.Text = b.ToString();
}
elseif (comboBox1.Text == "foot"&& comboBox2.Text == "foot")
{
label1.Text = "Foot";
b = a;
label2.Text = "Foot";
textBox2.Text = b.ToString();
}
elseif (comboBox1.Text == "Km"&& comboBox2.Text == "mm")
{
label1.Text = "Kilometer";
b = a * 1000000;
label2.Text = "Milimeter";
textBox2.Text = b.ToString();
}
elseif (comboBox1.Text == "Km"&& comboBox2.Text == "cm")
{
label1.Text = "Kilometer";
b = a * 100000;
label2.Text = "Centimeter";
textBox2.Text = b.ToString();
}
elseif (comboBox1.Text == "Km"&& comboBox2.Text == "m")
{
label1.Text = "Kilometer";
b = a * 1000;
label2.Text = "Meter";
textBox2.Text = b.ToString();
}
elseif (comboBox1.Text == "Km"&& comboBox2.Text == "inch")
{
label1.Text = "Kilometer";
b = a * 39370.1;
label2.Text = "Inch";
textBox2.Text = b.ToString();
}
elseif (comboBox1.Text == "Km"&& comboBox2.Text == "foot")
{
label1.Text = "Kilometer";
b = a * 3280.84;
label2.Text = "Foot";
textBox2.Text = b.ToString();
}
elseif (comboBox1.Text == "mm"&& comboBox2.Text == "Km")
{
label1.Text = "Milimeter";
b = a * 0.000001;
label2.Text = "Kilometer";
textBox2.Text = b.ToString();
}
elseif (comboBox1.Text == "cm"&& comboBox2.Text == "Km")
{
label1.Text = "Centimeter";
b = a * 0.00001;
label2.Text = "Kilometer";
textBox2.Text = b.ToString();
}
elseif (comboBox1.Text == "m"&& comboBox2.Text == "Km")
{
label1.Text = "Meter";
b = a * 0.001;
label2.Text = "Kilometer";
textBox2.Text = b.ToString();
}
elseif (comboBox1.Text == "inch"&& comboBox2.Text == "Km")
{
label1.Text = "Inch";
b = a * 0.00254;
label2.Text = "Kilometer";
textBox2.Text = b.ToString();
}
elseif (comboBox1.Text == "foot"&& comboBox2.Text == "Km")
{
label1.Text = "Foot";
b = a * 0.0003048;
label2.Text = "Km";
textBox2.Text = b.ToString();
}}
Temperature converter
Note-Add
three text boxes and name it as txt_fn(For first number),txt_sn(For second number) and txt_opr(For
operator).Keep txt_fn and txt_opr text boxes disabled(or Enbled = False) so user cant edit it.
}
catch (Exception er)
{
//cler all text boxes if error occured
txt_fn.Text = null;
txt_sn.Text = null;
txt_opr.Text = null;
}
}
}
catch (Exception er)
{
//cler all text boxes if error occured
txt_fn.Text = null;
txt_sn.Text = null;
txt_opr.Text = null;
}
}
7)Start Debugging:
8)Deploy Project:
9)Perform operations
Addition
6)
Insert one tab control and add tabs from tabPages Property from property window
Change the text property of tab pages and add button in that tabpage also change the name and text
property of button to the desired names
For eg in tab 1 the text of the tabpage is changed to TEXT and name of the button is changed to
btn_text
For tabpage 2
tabgraphics1.DrawEllipse(p, rectangle);
tabgraphics1.DrawRectangle(p, rectangle);
{
tabPage1.Text = wb.Url.Host.ToString();
}
catch (Exception er)
{
tabPage1.Text = "Error";
System.Uri adr1 = newUri(@"file://\Windows\default.htm");
wb.Navigate(adr1);
}
elseif (tabControl1.SelectedIndex == 1)
{
tabPage2.Controls.Add(wb);
wb.Dock = DockStyle.Fill;
System.Uri adr = newUri("http://" + txt_adr.Text+"/");
wb.Navigate(adr);
try
{
tabPage2.Text = wb.Url.Host.ToString();
}
catch (Exception er)
{
tabPage2.Text = "Error";
System.Uri adr1 = newUri(@"file://\Windows\default.htm");
wb.Navigate(adr1);
}
}
else
{
}
}
tabPage1.Text = wb.Url.Host.ToString();
tabPage1.Text = "Error";
System.Uri adr1 =
newUri(@"file://\Windows\default.htm");
wb.Navigate(adr1);
}
}
elseif (tabControl1.SelectedIndex == 1)
{
tabPage2.Controls.Add(wb);
wb.Dock = DockStyle.Fill;
System.Uri adr = newUri("http://" + txt_adr.Text + "/");
wb.Navigate(adr);
try
{
}
tabPage2.Text = wb.Url.Host.ToString();
tabPage2.Text = "Error";
System.Uri adr1 =
newUri(@"file://\Windows\default.htm");
wb.Navigate(adr1);
}
}
else
{
}
}
}
8)Output Window
Note-Here since we dont have internet connectivity ,it will navigate to default page.
8.)
}
{
}
8)Output Window
To Calculate EMI :
Design the form as following
To calculate emi :double click on button1 and add the following code
privatevoid button1_Click(object sender, EventArgs e)
{
double p, r, sI,n;
if(comboBox1.Text=="6 months")
{
n = 6;
p = double.Parse(textBox1.Text);
r = 9.25;
sI = p * n * r / 100;
textBox2.Text = sI.ToString();
}
elseif (comboBox1.Text == "1 year")
{
n = 12;
p = double.Parse(textBox1.Text);
r = 9.25;
sI = p * n * r / 100;
textBox2.Text = sI.ToString();
}
elseif (comboBox1.Text == "2 year")
{
n = 24;
p = double.Parse(textBox1.Text);
r = 9.25;
sI = p * n * r / 100;
textBox2.Text = sI.ToString();
}
elseif (comboBox1.Text == "3 year")
{
n = 36;
p = double.Parse(textBox1.Text);
r = 9.25;
sI = p * n * r / 100;
textBox2.Text = sI.ToString();
}
4) Insert one combobox , panel and one web browser tool in panel as shown below