GithubHelp home page GithubHelp logo

naseemakhtar994 / advancedsmsmanager Goto Github PK

View Code? Open in Web Editor NEW

This project forked from mahdit83/advancedsmsmanager

0.0 1.0 0.0 261 KB

Advanced SmsManager is library for sending sms for single and two sim-card phones. it is very handy and usefull

License: Apache License 2.0

Java 100.00%
sms manger

advancedsmsmanager's Introduction

Advanced Sms Manager

AdvancedSmsManager is library for sending sms for single and two sim-card phones. it is very handy and usefull. It's two-sim mode works on Android.SDK > 21. For lower SDKs it send sms from default sim. For using in android studio add this to your dependency:

compile 'ir.mtajik.android:advancedsmsmanager:1.0.4'                    

Before using SmsHandler you had to permit user with Manifest.permission.SEND_SMS and Manifest.permission.READ_PHONE_STATE .

after that simply call sendSms that have a Interface for all callbacks. smsId is a random unique auto generated Id that generated for every single sms that created by your app. You can also set a Carrier Filter to make sure sms will sends from Specific carrier and it is optional.

SmsHandler smsHandler = new SmsHandler(this, "+0121212", dialogLayoutId);
        
// you can add optional carrier filter
smsHandler.setCarrierNameFilter("MCI");
        
smsHandler.sendSms("dialog message", "sms body", new MySmsManager.SMSManagerCallBack() {
    @Override
    public void afterSuccessfulSMS(int smsId) {        
    }

    @Override
    public void afterDelivered(int smsId) {
    }

    @Override
    public void afterUnSuccessfulSMS(int smsId, String message) {
    }

    @Override
    public void onCarrierNameNotMatch(int smsId, String message) {
    }
});

If you pass a dialog layout to SmsHandler it will show your custom dialog to confirm Send sms to user, if you don't want just pass 0 as dialogLayoutId. Your custom dialog should have two Android Button or custom button extends android.widget.Button with these id in you layout:

<Button
	android:id="@+id/send_button"
	...
/>
            
<Button
	android:id="@+id/cancel_button"
	...
/>

It created with MVP architecture and Uses Dagger2 as DI container with these dependencies:

compile 'com.google.dagger:dagger:2.7'
annotationProcessor 'com.google.dagger:dagger-compiler:2.7'

So if you use dagger2 make sure that use compatible dependencies. I hope this library would be useful and wait for your comments.

this my weblog: http://www.mahditajik.ir

advancedsmsmanager's People

Contributors

mahdit83 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.