ONLINE HELP
 WINDEVWEBDEV AND WINDEV MOBILE

Help / WLanguage / WLanguage functions / Communication / SMS functions
  • Differences between GO mode and runtime
  • Required permissions
WINDEV
WindowsLinuxUniversal Windows 10 AppJavaReports and QueriesUser code (UMC)
WEBDEV
WindowsLinuxPHPWEBDEV - Browser code
WINDEV Mobile
AndroidAndroid Widget iPhone/iPadIOS WidgetApple WatchMac CatalystUniversal Windows 10 App
Others
Stored procedures
Reads the first SMS message stored on the Android phone. The characteristics of this SMS are contained in the SMS structure.
Remark: Only SMS messages found in the phone memory can be handled by the SMS functions.
Example
// Number of SMS messages stored on the phone's memory
STC_NbSMS = "You have " + SMSNbMessage(smsMemory) + " messages."
 
// Read the 1st SMS message stored on the phone's memory
ResRead is boolean = SMSFirst(smsMemory)
 
WHILE ResRead = True
// Display the characteristics of this SMS in a Table control:
// the SMS variable is automatically updated
TableAddLine(TABLE_SMSTable, SMS.Index, SMS.Message, SMS.Number, SMS.ReceiveDate)
// Read the other SMSs
ResRead = SMSNext(smsMemory)
END
Syntax
<Result> = SMSFirst(<Location>)
<Result>: Boolean
  • True if the SMS was read. SMS.ReceiveDate, SMS.Index, SMS.Message, SMS.Number and SMS.NumberType are automatically filled. For more details, see SMS structure.
  • False otherwise. To get more details on the error, use ErrorInfo with the errMessage constant.
<Location>: Integer constant
Location of SMS to read:
smsMemorySMS stored in the device memory.
Remarks

Differences between GO mode and runtime

A WLanguage error is raised when SMSFirst is called in test mode (GO) (simulation on the development computer).
The SMS functions can be used during a GO on the Android emulator. To simulate the sending of SMS messages to the emulator, see the documentation of the Android SDK: https://developer.android.com/studio/run/emulator#console

Required permissions

The call to this function modifies the permissions required by the application.
Required permission: READ_SMS
Component: wd290android.aar
Minimum version required
  • Version 10
Comments
Click [Add] to post a comment

Last update: 03/21/2023

Send a report | Local help