[Lazarus] using Android SmsManager APIs from Lazarus

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

[Lazarus] using Android SmsManager APIs from Lazarus

Free Pascal - Lazarus mailing list
I could compile my first Lazarus "hello world" application for Android.

When I click a button on screen, the message "hello world" is displayed.

So far so good.

Now I'd like to make things harder.

When I click the same button on screen, I want text "hello world" be
sent to a predefined mobile number using Android APIs.

I found this example... It seems easy...but it is no pascal!
>>>>>
public void sendSMS(String phoneNo, String msg) {
    try {
        SmsManager smsManager = SmsManager.getDefault();
        smsManager.sendTextMessage(phoneNo, null, msg, null, null);
        Toast.makeText(getApplicationContext(), "Message Sent",
              Toast.LENGTH_LONG).show();
    } catch (Exception ex) {
        Toast.makeText(getApplicationContext(),ex.getMessage().toString(),
              Toast.LENGTH_LONG).show();
        ex.printStackTrace();
    }
}

<<<<<<

Is there a way to use Android APIs from Lazarus ?

Thank you

Peppe Polpo
--
_______________________________________________
Lazarus mailing list
[hidden email]
http://lists.lazarus-ide.org/listinfo/lazarus