Skip to content

Commit 46af8dc

Browse files
authored
Create README.md
1 parent b4f2846 commit 46af8dc

1 file changed

Lines changed: 51 additions & 0 deletions

File tree

README.md

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# Send SMS Android SDK
2+
_Integrate android sdk to Send SMS from Mobtexting_
3+
## __Getting Started__
4+
### Gradle
5+
**Step 1.** Add the JitPack repository to your build file
6+
```
7+
allprojects {
8+
repositories {
9+
maven { url 'https://jitpack.io' }
10+
}
11+
}
12+
```
13+
**Step 2.** Add the dependency
14+
```
15+
dependencies {
16+
implementation 'com.github.mobtexting:mobtexting-android:v1.0'
17+
}
18+
```
19+
#### define _API KEY_ and _Sender_ ID in Manifest file inside Application tag
20+
```
21+
<meta-data android:name="mobtexting.api_key" android:value="@string/mobtextingapikey" />
22+
<meta-data android:name="mobtexting.sender_id" android:value="@string/mobtextingsenderid" />
23+
```
24+
#### Usage
25+
26+
```
27+
public class MainActivity extends AppCompatActivity implements MobtextingInterface{
28+
private Mobtexting mobtexting;
29+
@Override
30+
protected void onCreate(Bundle savedInstanceState) {
31+
super.onCreate(savedInstanceState);
32+
setContentView(R.layout.activity_main);
33+
34+
//create instance of Mobtexting class
35+
mobtexting=new Mobtexting(this);
36+
37+
//send the SMS
38+
mobtexting.sendSMS("This is a test","7488792140",this);
39+
}
40+
41+
@Override
42+
public void onResponse(ServerResponse serverResponse) {
43+
Log.d("response",serverResponse.getStatus()+" "+serverResponse.getDescription()+" "+serverResponse.getSmsId());
44+
}
45+
46+
@Override
47+
public void onError(ModelError modelError) {
48+
Log.d("response",modelError.getStatus()+" "+modelError.getDescription());
49+
}
50+
}
51+
```

0 commit comments

Comments
 (0)