I try to develop anti-smishing solution, which listen in background and analyze new SMS.
If I'm not default SMS app, I can only read the SMS.
I found information about some exceptions in use of SMS permission group for Anti-Phishing, where I have access not only to read, but also to write.
How does it work? For now I'm not able to write or edit any SMS in Android Studio. When Google accepts my request/form I will have some extra code for exception or something like it?
https://support.google.com/googleplay/android-developer/answer/10208820?hl=en&ref_topic=2364761#zippy=%2Cwyj%C4%85tki
Related
My questions specific only for Android 6 (starting from v23 of SDK). I need to get all SMS, even draft for future processing. Nothing special here, used the following peace of code:
context.getContentResolver().query(Uri.parse("content://sms/"),
new String[] {...}, null, null, null)
And this work perfect for Android 5, meaning that I get all SMS messages including draft. But at all devices with Android 6, I get only sent and received messages and NO DRAFT. Try to make my app default SMS before trying to query SMS – but no luck, at Android 6 i still cannot get draft messages. What the problem?
I've already found some related posts
SMS missing from content provider results on Android Marshmallow
But this do not solve my issue at all.
For Marshmallow you need to add run time permissions to read messages .
Check permission like this
int permissionCheck = ContextCompat.checkSelfPermission(getApplicationContext(), Manifest.permission.READ_SMS);
If permission denied tha ask at run time like that
ActivityCompat.requestPermissions(this, new String[]{{Manifest.permission.READ_SMS}, PERMISSIONS_REQUEST_READMESSAGE);
to access draft this is URI for content provider.
Content provider for draft is
content://sms/draft
Note: dont forget to add permissions
<uses-permission android:name="android.permission.READ_SMS"></uses-permission>
I believe what your looking for is found in this answer. It provides a list of URI's for accessing the different SMS boxes. The one specifically for the draft SMS messages is
content://sms/draft
Query on URI content://sms/draft will return only the draft messages that are stored in SMS provider.
Default android messaging application implementation stores the draft messages within the application and will not add the drafts to SMS provider.
Only the draft messages that are part of SMS provider (can added using SMSManager's hidden API addTextMessageDraft) will be returned as results when query on URI content://sms/draft is performed.
Hi guys I need help from you all in Android mobile number verification process. I have a android phone I just need to verify the otp but in this case they using the auto verification method is it possible to verify my otp through fwd the msg or by using prank message app Pls anyone help me to solve my problem and thx in advance...
Assuming that you are asking for "how to implement OTP verification". There are number of ways to tackle this. Please look at the below link for two ways of achieving this using Google authenticator or using a SMS gateway.
Android one time password (OTP)
here is the tutorial to read the incoming messages using Broadcast receiver if you are going to use the second method.
"Reading incoming messages using broadcast receiver."
I believe you are trying to implement a way you can implement your own TTS (Text-To-Speech) Verification system that prompts the user to enter in the code.
If so, you can use Nexmo's Text To Speech Prompt.
All you have to do is make an HTTP call (For example: https://api.nexmo.com/tts-prompt/json)
From here you can use the parameters you want such as,
text - Body of the text message to be read to the end user
machine_detection - How to react when an answering machine is detected
lg - To determine what language the text is read in
bye_text - Body of the text message played after digits are entered successfully
failed_text - Body of the text message played after 3 failed attempts
There are many other parameters you can work with and customize your TTS prompt to capture/confirm data.
Full disclosure, I work at Nexmo
You can see more information how to implement this here
I have developed one android application. Now we are testing this application in production environment.
I have to track the below information with out depending on tester to share the log file,
Send Log file. May be Logcat data. Foe Example If any web service fails we need to write that into log file then same needs to be sent to the server or to given mail id.
If there is any crash in our app then we can get the stach track by using getDefaultUncaughtExceptionHandler then we need to send the stack trace info via mail or send it to web server.
Or else I can use any solution provider like Google Analytics, Crashlytics or else I can write the log data to text file. And then same to be sent via mail on a daily or weekly basis.
Help me on this.
It's about time you move to crashlytics https://try.crashlytics.com/ or critisism http://www.crittercism.com/ check it out, infact there is ton of other options out there
With a service like http://www.apteligent.com (Crittercism renamed to Apteligent), when looking at a crash, you'll be able to automatically see a log of: web service calls, network connectivity changes, changes to screen views, and app foreground/background events that led up to the crash without manually adding any additional logging to your app:
https://www.apteligent.com/2016/03/working-automatic-breadcrumbs/
I'm working on an SMS Application for Android, which undoubtedly needs to send SMSes (go figure! ;)
Now, i know there are a plenty of sources on the net that describe using the SmsManager to send SMSes...But, apparently, when using that method, the SMSes aren't stored in the "SENT" Folder...which is kind of a basic requirement for an SMS application.
How do i add an entry (of a message) into the "Outbox", so that it gets sent (and stored in the SENT Folder Automatically)....
What would be the Values of the fields "_id,threadid,read,status,type,service_center" (Attributes of the message table)??
Any other alternatives are also welcome. :)
Thanks in Advance...
I had been looking for a work around this issue. Add the following lines of code after sending the sms... this will make an entry in the outbox of native sms application
ContentValues values = new ContentValues();
values.put("address", number);
values.put("body", desc);
getApplicationContext().getContentResolver().insert(Uri.parse("content://sms/sent"), values);
i would like to get help from ppl who could tell how to use this content provider to make entry for multiple receivers... Thanks..
But, apparently, when using that
method, the SMSes aren't stored in the
"SENT" Folder...which is kind of a
basic requirement for an SMS
application.
The concept of a "SENT" folder is a feature of an application, not the operating system. If you wish to create your own SMS client application, create your own "SENT" folder as a feature of that application. You know what messages you are sending, so you can store them wherever you like (e.g., SQLite database).
If you want to send SMS messages and have them appear in the "SENT" folder of the user's chosen SMS client, don't use SmsManager. Instead, use ACTION_SENDTO and have the message be sent by the user's chosen SMS client, as is demonstrated by this sample project.
At least on 6.0 and 7.0 the system app com.android.phone is responsible for storing the messages sent by other apps. Unfortunately, this functionality is broken by some manufacturers and this is why we don't see sent messages.
It does work on AVD though. See the method persistSentMessageIfRequired() in com.android.internal.telephony.SMSDispatcher.
Only this app or the selected default SMS app has a write permission to the SMS content provider. When you send it using the SMS app, it calls insert() directly. When you use SmsManager in your app, the system app com.android.phone somehow gets notified, performs the sending and then stores the sent message. Here's the callstack (I didn't dig further):
at android.os.Handler.obtainMessage(Handler.java:293)
at com.android.internal.telephony.gsm.GsmSMSDispatcher.sendSmsByPstn(GsmSMSDispatcher.java:291)
at com.android.internal.telephony.gsm.GsmSMSDispatcher.sendSms(GsmSMSDispatcher.java:274)
at com.android.internal.telephony.SMSDispatcher.sendRawPdu(SMSDispatcher.java:999)
at com.android.internal.telephony.gsm.GsmSMSDispatcher.sendText(GsmSMSDispatcher.java:198)
at com.android.internal.telephony.ImsSMSDispatcher.sendText(ImsSMSDispatcher.java:206)
at com.android.internal.telephony.IccSmsInterfaceManager.sendTextInternal(IccSmsInterfaceManager.java:452)
at com.android.internal.telephony.IccSmsInterfaceManager.sendText(IccSmsInterfaceManager.java:393)
at com.android.internal.telephony.UiccSmsController.sendTextForSubscriber(UiccSmsController.java:136)
at com.android.internal.telephony.ISms$Stub.onTransact(ISms.java:201)
at android.os.Binder.execTransact(Binder.java:565)
After the SMS is sent, the app posts a Handler message to itself:
at android.database.sqlite.SQLiteDatabase.insert(SQLiteDatabase.java:1343)
at com.android.providers.telephony.SmsProvider.insertInner(SmsProvider.java:618)
at com.android.providers.telephony.SmsProvider.insert(SmsProvider.java:442)
at android.content.ContentProvider$Transport.insert(ContentProvider.java:264)
at android.content.ContentResolver.insert(ContentResolver.java:1274)
at com.android.internal.telephony.SMSDispatcher$SmsTracker.persistSentMessageIfRequired(SMSDispatcher.java:1445)
at com.android.internal.telephony.SMSDispatcher$SmsTracker.persistOrUpdateMessage(SMSDispatcher.java:1476)
at com.android.internal.telephony.SMSDispatcher$SmsTracker.onSent(SMSDispatcher.java:1537)
at com.android.internal.telephony.SMSDispatcher.handleSendComplete(SMSDispatcher.java:638)
at com.android.internal.telephony.SMSDispatcher.handleMessage(SMSDispatcher.java:274)
at com.android.internal.telephony.gsm.GsmSMSDispatcher.handleMessage(GsmSMSDispatcher.java:108)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6077)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:866)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:756)
i intend to develop an app which would speak to the user the message he desires in the inbox. I have successfully created an app where there is a text box and when the user finishes typing in it and presses a speak button, he can hear what he has written, now how do i extend this to the desired app? please could someone please guide me on this?
I have a Gmail-to-SMS app that read the email from the content provider of the Gmail app.
I think it's useful to you.
The cursor helper can get the conversation and message:
http://github.com/qrtt1/android-gmail-to-sms/blob/new-input-format/src/googlecode/email/to/sms/CursorHelper.java
You can see the client how to use it:
http://github.com/qrtt1/android-gmail-to-sms/blob/new-input-format/src/googlecode/email/to/sms/Email2SMSActivity.java
Finally, don't forget the uses-permission
<uses-permission
android:name="com.google.android.providers.gmail.permission.READ_GMAIL" />
If you want to see the details in android's source, there is Gmail.java in this path:
./frameworks/base/core/java/android/provider/Gmail.java