PROFESSIONAL NEWSGROUPS
WINDEV
,
WEBDEV
and
WINDEV Mobile
Home
|
Recent messages
|
Connect
|
Sign out
|
English
Home
→
WINDEV Mobile 2024
→
Incoming SMS
Incoming SMS
Started by Nicu, Jan., 13 2017 8:07 AM - No answer
Connect yourself…
Nicu
#1
Posted on January, 13 2017 - 8:07 AM
Hello, i hope i can find some answers here.
I use Windev Mobile 18, i try to catch all incoming SMS.
How can i do this on this Windev Version ?
I tried :
Posté le 18 août 2015 - 12:37
Salut à tous
Je suis nouveau et j'aimerai savoir comment recevoir un sms sous Android
Voici mon bout de code sms java. Mais lorsque je fais une copie sur windev mobile version 18 j'ai toujours
un problème sur l’interprétation d'une ligne dans le code java
Voici le code de la procédure globale java : SMSReceiver est un entier
import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.telephony.SmsMessage;
import android.widget.Toast;
public class SMSReceiver extends BroadcastReceiver
{
private final String ACTION_RECEIVE_SMS = "android.provider.Telephony.SMS_RECEIVED";
@Override
public void onReceive(Context context, Intent intent)
{
if (intent.getAction().equals(ACTION_RECEIVE_SMS))
{
Bundle bundle = intent.getExtras();
if (bundle != null)
{
Object[] pdus = (Object[]) bundle.get("pdus");
final SmsMessage[] messages = new SmsMessage[pdus.length];
for (int i = 0; i < pdus.length; i++) { messages[i] = SmsMessage.createFromPdu((byte[]) pdus[i]); } if (messages.length > -1)
{
final String messageBody = messages[0].getMessageBody();
final String phoneNumber = messages[0].getDisplayOriginatingAddress();
Toast.makeText(context, "Expediteur : " + phoneNumber, Toast.LENGTH_LONG).show();
Toast.makeText(context, "Message : " + messageBody, Toast.LENGTH_LONG).show();
}
}
}
}
}
But i receive all kinds of error.
Can someone point me to a good direction or give me an example .
Thank you very much
Report
0
0
→ Go back to WINDEV Mobile 2024
WINDEV 2024
WEBDEV 2024
WINDEV Mobile 2024
WINDEV (earlier versions)
Français
English
Español
Portuguesa
Close this window
Search type
Only topics
All the messages
Search period
Any time
Past hour
Past 24 hours
Past week
Past month
Past year
Cancel
Preview of your message
Adding an image
Import an image from a URL
Send an image from a file of your disk
Drop a file or click "Browse..."
or
Cancel
0%
WLanguage
SQL
XML, HTML
JAVA, Javascript
Text