Created
April 22, 2025 07:02
-
-
Save enlacee/9bf3c8d24a9cb08be70a51790a69e309 to your computer and use it in GitHub Desktop.
Send SMS short and long (special characters)
This file contains hidden or 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
// codigo kotlin made by anibal site: https://blog.anibalcopitan.com/2025/04/sms-largos-en-android-problema-y.html | |
/** | |
* Antes: | |
* Mensaje de yape: | |
* Yape! Victor A. Copitan N. te envió un pago por S/ 2. | |
*/ | |
// Antes | |
val smsManager: SmsManager = SmsManager.getDefault() | |
smsManager.sendTextMessage(phoneNumber, null, message, null, null) | |
/** | |
* Ahora | |
* Mensaje de yape: | |
* Victor A. Copitan N. te envió un pago por S/ 222. El cód. de seguridad es: 541 | |
*/ | |
val smsManager: SmsManager = SmsManager.getDefault() | |
val parts: ArrayList<String> = smsManager.divideMessage(message) | |
smsManager.sendMultipartTextMessage(phoneNumber, null, parts, null, null) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment