GRUPOS DE DISCUSSÃO PROFISSIONAL
WINDEV
,
WEBDEV
e
WINDEV Mobile
Inicio
|
Mensagens recentes
|
Conecte-se...
|
Disconnect
|
Português
Inicio
→
WINDEV Mobile 2024
→
New SMS received
New SMS received
Iniciado por Gautam, jun., 01 2017 8:41 AM - 2 respostas
Conecte-se…
Gautam
#1
Membro registado
67 mensagems
Publicado em junho, 01 2017 - 8:41 AM
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
Denunciar
0
0
Eric67
#2
Membro registado
637 mensagems
Popularité : +36 (36 votes)
Publicado em junho, 01 2017 - 11:06 AM
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
Denunciar
0
0
Gautam
#3
Membro registado
67 mensagems
Publicado em junho, 01 2017 - 12:10 PM
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
Denunciar
0
0
→ Voltar para WINDEV Mobile 2024
WINDEV 2024
WEBDEV 2024
WINDEV Mobile 2024
WINDEV (versões anteriores)
Français
English
Español
Portuguesa
Fermer cette fenêtre
Tipo de Pesquisa
Apenas tópicos
Todas as mensagens
Período de pesquisa
Qualquer momento
Última hora
Últimas 24 horas
Semana passada
Mês passado
Ano passado
Cancelar
Pré-visualização da sua mensagem
Adicionar imagem
Importar uma imagem de uma URL
Enviar uma imagem a partir do seu disco
Deixe um ficheiro ou clique em "Procurar ..."
ou
Cancelar
0%
WLanguage
SQL
XML, HTML
JAVA, Javascript
Texto