1
votes

in the Codename One Developers manual, in the section "Phone functions", it's written so:

Codename One supports sending SMS messages but not receiving them as this functionality isn’t portable. You can send an SMS using: Display.getInstance().setSMS("+999999999", "My SMS Message");

My question is if it's possible to receive sms on Android from a specific number. I suppose that it could be possible using native device functionality in Codename One: is it right?

Thank you very much for any help.

P.S.: I know that a workaround to receive text from an external app is intercepting URL's, but I'm thinking how to manage the case of a messaging app (that uses SMSes).

1

1 Answers

1
votes

You can probably do that and you probably don't need much to do that. In the case of Android handling incoming SMS would probably require a BroadcastReciver which you can just create as a standalone class in the native/android directory. The necessary manifest changes can be added via the build hints such as android.xapplication & android.xpermission.