-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathsms.java
82 lines (67 loc) · 1.35 KB
/
sms.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
public class sms {
private String email;
private String passwd;
private Voice voice;
public sms() {
email = "";
passwd = "";
voice = null;
}
public sms(String email, String passwd) {
this.email = email;
this.passwd = passwd;
this.voice = Login();
}
/* propabaly not needed
public void SetEmail(String email) {
this.email = email;
}
public void SetPasswd(String passwd) {
this.passwd = passwd;
}
*/
private Voice Login() {
try {
Voice voice = new Voice(this.email, this.passwd);
}
catch (Exception e) {
System.out.println(e);
return null;
}
return voice;
}
public void Login(String email, String passwd) {
this.email = email;
this.passwd = passwd;
this.voice = Login();
}
public void Login(String email, String passwd) {
try {
Voice v = new Voice(email, passwd);
}
catch (Exception e) {
System.out.println(e);
return;
}
this.voice = v;
}
public void Send(String phone_num, String msg) {
try {
this.voice.sendSMS(phone_num, msg);
}
catch (Exception e) {
System.out.println(e);
}
}
public String Get() {
String msg = "";
try {
msg = this.voice.getSMS();
}
catch (Exception e) {
System.out.println(e);
return;
}
return msg;
}
}