forked from RohitSurwase/AndroidDesignPatterns
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
55 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
* Steps: | ||
* 1. Add Permissions to manifest | ||
* * <uses-permission android:name="android.permission.READ_SMS" /> | ||
* * <uses-permission android:name="android.permission.RECEIVE_SMS" /> | ||
* <p> | ||
* 2. Register our broadcast listener in manifest | ||
* * <receiver | ||
* * android:name=".SmsReceiver" | ||
* * android:permission="android.permission.BROADCAST_SMS"> | ||
* * <intent-filter> | ||
* * <action android:name="android.provider.Telephony.SMS_RECEIVED" /> | ||
* * </intent-filter> | ||
* * </receiver> | ||
* <p> | ||
* 3. Add two classes to your project. | ||
* * SmsListener.class | ||
* * SmsReceiver.class | ||
** <p> | ||
* | ||
* 4. In your MainActivity.class or activity where you want to receive sms/otp, add the existing code | ||
* * (You can find the code in MainActivity.class file i.e. same file) | ||
* * | ||
* | ||
* Note: In SmsReceiver.class there is a constant which is used to distinguish all sms senders from our sender | ||
* Change this constant according to your project | ||
* * private static final String SMS_SENDER_NAME = "12345"; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
3 changes: 2 additions & 1 deletion
3
AutoReadSmsOtp/app/src/main/java/com/rohitss/autoreadsmsotp/SmsListener.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters