to set B4A made app as SMS default app
you need to define intent filters as described in the threads you linked.
your app must be seen when the deviceuser try to change the default sms app. I can´t really answer this as i did not tried this.
to delete SMS messages after B4A app is set as default one
As written above i would use ContentResolver for this. You can find the principle on how it works in my Calendar tutorial thread.
The principle to work with SMS-Database is the same. I´ve added Constants for SMS in my Library (see Tutorial. Version must be V0.12)
the base object which shows all constants to use with the SMS-Database is SMSConstants
dim smsconst as SMSConstants
"CONTENT_URI" is the Uri you need to use with ContentResolver to query, update, delete anything from the Database.
Create a projection to READ SMSses. If you included the field ID in your projection you can get the ID of each SMS in the Queryresult. This ID you need to use when deleting using the ContentResolver.
Try to understand how it works with my Calendar-Examples. You need to build the same for the SMS-Database.
If you have any question/problem/error. Please create a new thread for any question.
The constants for the SMS-Database are
SMSConstants
- Fields:
- ADDRESS As String
- BODY As String
- CONTENT_URI As android.net.Uri
- COUNT As String
- CREATOR As String
- DATE As String
- DATE_SENT As String
- DEFAULT_SORT_ORDER As String
- ERROR_CODE As String
- ID As String
- LOCKED As String
- MESSAGE_TYPE_ALL As Int
- MESSAGE_TYPE_DRAFT As Int
- MESSAGE_TYPE_FAILED As Int
- MESSAGE_TYPE_INBOX As Int
- MESSAGE_TYPE_OUTBOX As Int
- MESSAGE_TYPE_QUEUED As Int
- MESSAGE_TYPE_SENT As Int
- PERSON As String
- PROTOCOL As String
- READ As String
- REPLY_PATH_PRESENT As String
- SEEN As String
- SERVICE_CENTER As String
- STATUS As String
- STATUS_COMPLETE As Int
- STATUS_FAILED As Int
- STATUS_NONE As Int
- STATUS_PENDING As Int
- SUBJECT As String
- SUBSCRIPTION_ID As String