Last active
February 1, 2016 19:36
-
-
Save ludovicfrin/bee1ebc597d77d043369 to your computer and use it in GitHub Desktop.
Envoi d'un SMS sous Android
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public class SendSmsActivity extends AppCompatActivity { | |
... | |
private void sendSms(String recipient, String message) { | |
try { | |
SmsManager smsManager = SmsManager.getDefault(); | |
smsManager.sendTextMessage(recipient, null, message, null, null); | |
} catch (Exceptione e) { | |
e.printStackTrace(); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
... | |
<uses-permission android:name="android.permission.SEND_SMS" /> | |
... |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment