3

I'm making an app to text this string:

    ░░░░░░░░░░░░▄▐
    ░░░░░░▄▄▄░░▄██▄
    ░░░░░▐▀█▀▌░░░░▀█▄
    ░░░░░▐█▄█▌░░░░░░▀█▄
    ░░░░░░▀▄▀░░░▄▄▄▄▄▀▀
    ░░░░▄▄▄██▀▀▀▀
    ░░░█▀▄▄▄█░▀▀
    ░░░▌░▄▄▄▐▌▀▀▀
    ▄░▐░░░▄▄░█░▀▀
    ▀█▌░░░▄░▀█▀░▀
    ░░░░░░░▄▄▐▌▄▄
    ░░░░░░░▀███▀█░▄
    ░░░░░░▐▌▀▄▀▄▀▐▄
    ░░░░░░▐▀░░░░░░▐▌
    ░░░░░░█░░░░░░░░█
    ░░░░░▐▌░░░░░░░░░█
    ░░░░░█░░░░░░░░░░▐▌

This method sends the text:

protected void sendSMSMessage(String phoneNo, String msg){
    try {
        SmsManager smsManager = SmsManager.getDefault();
        smsManager.sendTextMessage(phoneNo,null,msg,null,null);
        Toast.makeText(
                getApplicationContext(),
                "SMS sent",
                Toast.LENGTH_LONG
        ).show();
        Log.v("sendSMSMessage",msg);
    } catch (Exception e) {
        Toast.makeText(
                getApplicationContext(),
                "Failed to send. Try again.",
                Toast.LENGTH_LONG
        ).show();
        e.printStackTrace();
    }
}

If msg is "test", and I run sendSMSMessage, I get the string "test" on my phone a few minutes later. If msg is the spooky skeleton, the method goes, but I don't get the text, and the console shows no errors -- the "SMS sent" toast pops up to show the code executed properly.

When I manually text myself the spooky skeleton, I get the text, but it has "(X/6)" sprinkled throughout (where "x" is a number, of course).

Is it impossible to send a skeleton SMS?

If so, should I make it into a picture and have the code send it as an MMS?

Greg Kopff
  • 15,945
  • 12
  • 55
  • 78
Novice coder
  • 163
  • 1
  • 8
  • 2
    I dont know much about SMS but a quick Google search reveals that the characters your using arent likely supported in the SMS character set (http://en.wikipedia.org/wiki/GSM_03.38). Unrelated - I know theres a skeleton but does it really need the `skeleton-code` tag? – ug_ Feb 19 '15 at 23:57
  • 5
    Check your manifest for the HALLOWEEN permission. In all seriousness SMS have a character limit so you might need to send it as MMS (multi page) – Dave S Feb 20 '15 at 00:09
  • 1
    I just copy pasted your skeleton and texted it to myself and it worked. I am still voting for a character set issue but it is possible to send (at least on android). – ug_ Feb 20 '15 at 00:12

1 Answers1

5

Perhaps the message is too long and it's failing silently somewhere, use divideMessage and sendMultipartTextMessage:

ArrayList<String> parts = smsManager.divideMessage(msg);
smsManager.sendMultipartTextMessage(phoneNo, null, parts, null, null);
Sam Dozor
  • 40,335
  • 6
  • 42
  • 42
  • That did it. It took a few minutes, but I got the skeleton. Only problem now is it has "(X/6)" in it. I wonder if there's a way to send the text without that... – Novice coder Feb 20 '15 at 00:16