FOROS PROFESIONALES
WINDEV
,
WEBDEV
y
WINDEV Mobile
Inicio
|
Mensajes recientes
|
Conéctese...
|
Desconectar
|
Español
Inicio
→
WINDEV Mobile 2024
→
New SMS received
New SMS received
Iniciado por Gautam, 01,jun. 2017 08:41 - 2 respuestas
Conéctese…
Gautam
#1
Miembro registrado
67 mensajes
Publicado el 01,junio 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
Informar
0
0
Eric67
#2
Miembro registrado
637 mensajes
Popularité : +36 (36 votes)
Publicado el 01,junio 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
Informar
0
0
Gautam
#3
Miembro registrado
67 mensajes
Publicado el 01,junio 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
Informar
0
0
→ Volver a WINDEV Mobile 2024
WINDEV 2024
WEBDEV 2024
WINDEV Mobile 2024
WINDEV (versiones precedentes)
Français
English
Español
Portuguesa
Fermer cette fenêtre
Búsqueda Tipo
Sólo temas
Todos los mensajes
Periodo Buscar
Cualquier fecha
Última hora
Última 24 horas
Última semana
Último mes
Último año
Cancelar
Vista previa del mensaje
Añadiendo una imagen
Importar una imagen desde una URL
Enviar una imagen desde un archivo de su disco
Arrastrar un archivo o click en "Examinar..."
o
Cancelar
0%
WLanguage
SQL
XML, HTML
JAVA, Javascript
Texto