FORUMS PROFESSIONNELS
WINDEV
,
WEBDEV
et
WINDEV Mobile
Accueil
|
Messages récents
|
Connexion
|
Déconnexion
|
Français
Accueil
→
WINDEV Mobile 2024
→
New SMS received
New SMS received
Débuté par Gautam, 01 juin 2017 08:41 - 2 réponses
Connectez-vous…
Gautam
#1
Membre enregistré
67 messages
Posté le 01 juin 2017 - 08:41
Hi All
I am developing an app that needs to read incoming SMS messages (Android 6.01).
How do we retrieve a list of only the NEW SMS received since the last read?
My code is something like this:
ResRead is boolean = SMSFirst(smsSIM)
WHILE ResRead = True
TableAddLine(TABLE_SMSTable, SMS.Subscript, SMS.Message, SMS.Number, SMS.ReceiveDate)
// Read the other SMSs
ResRead = SMSNext(smsSIM)
END
However, using the above code SMSFirst always seems to retrieve the very first sms that has been previously read. I would like to only retrieve SMS that are NEW and have not been retrieved in the past.
Is there a way to mark an SMS as Read so that SMSFirst does not retrieve this anymore?
I could delete the SMS after reading and retrieving the content (SMSDelete) however this only seems to work for Android KitKat and earlier.
How have you done it?
Thanks and regards
Gautam
Signaler
0
0
Eric67
#2
Membre enregistré
637 messages
Popularité : +36 (36 votes)
Posté le 01 juin 2017 - 11:06
Hi,
After reading all SMS you can memorize le last indice (SMS.indice) read in a parameters file for instance.
SMS.indice is a unique number. Even if you delete all SMS from the mobile, the next new received SMS will have indice+1
Next time you read received SMS, you should always read all SMS but you can manage from the last indice you have memorized.
Unfortunately, it is not possible anymore to delete any SMS since recent android version.
Regards,
Eric.
--
Eric DELATTRE
http://www.yoosite.fr
Signaler
0
0
Gautam
#3
Membre enregistré
67 messages
Posté le 01 juin 2017 - 12:10
Wonderful! Thank you Eric for that suggestion. The help on SMS Structure (in English Version) has it as "Subscript - Integer corresponding to the subscript of the incoming SMS." I thought this was to identify a multi-part SMS where a long message is split into several parts and not a unique identifying value. If the subscript (indice) is a unique value then this will definitely work for me. I will try it out immediately.
Thanks once again! Much appreciated.
Gautam
Signaler
0
0
→ Revenir à WINDEV Mobile 2024
WINDEV 2024
WEBDEV 2024
WINDEV Mobile 2024
WINDEV (précédentes versions)
Français
English
Español
Portuguesa
Fermer cette fenêtre
Type de recherche
Uniquement les sujets
Tous les messages
Période de recherche
Date indifférente
Moins d'une heure
Moins de 24 heures
Moins d'une semaine
Moins d'un mois
Moins d'un an
Annuler
Aperçu de votre message
Ajouter une image
Importer une image depuis une URL
Envoyer une image depuis un fichier de votre disque
Déposez ici un fichier ou cliquez sur "Parcourir..."
ou
Annuler
0%
WLangage
SQL
XML, HTML
JAVA, Javascript
Texte