File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 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+ ```
You can’t perform that action at this time.
0 commit comments