Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6172367
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T23:22:50+00:00 2026-05-23T23:22:50+00:00

Trying to send a text message more than 100 times, is there any way

  • 0

Trying to send a text message more than 100 times, is there any way to override the SMSDispatcher text limitation?

Here’s the error:

08-02 03:34:07.927: WARN/dalvikvm(1199): threadid=1: thread exiting with uncaught      exception (group=0x4001d800)
08-02 03:34:07.927: ERROR/AndroidRuntime(1199): FATAL EXCEPTION: main
08-02 03:34:07.927: ERROR/AndroidRuntime(1199): java.lang.NullPointerException
08-02 03:34:07.927: ERROR/AndroidRuntime(1199):     at com.android.internal.telephony.SMSDispatcher.handleReachSentLimit(SMSDispatcher.java:809)
08-02 03:34:07.927: ERROR/AndroidRuntime(1199):     at com.android.internal.telephony.SMSDispatcher.handleMessage(SMSDispatcher.java:339)
08-02 03:34:07.927: ERROR/AndroidRuntime(1199):     at android.os.Handler.dispatchMessage(Handler.java:99)
08-02 03:34:07.927: ERROR/AndroidRuntime(1199):     at android.os.Looper.loop(Looper.java:123)
08-02 03:34:07.927: ERROR/AndroidRuntime(1199):     at android.app.ActivityThread.main(ActivityThread.java:4627)
08-02 03:34:07.927: ERROR/AndroidRuntime(1199):     at java.lang.reflect.Method.invokeNative(Native Method)
08-02 03:34:07.927: ERROR/AndroidRuntime(1199):     at java.lang.reflect.Method.invoke(Method.java:521)
08-02 03:34:07.927: ERROR/AndroidRuntime(1199):     at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
08-02 03:34:07.927: ERROR/AndroidRuntime(1199):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
08-02 03:34:07.927: ERROR/AndroidRuntime(1199):     at dalvik.system.NativeStart.main(Native Method)

Here’s my code — updated:

import java.util.Random;
import android.app.Activity;
import android.content.Context;
import android.os.Bundle;
import android.telephony.SmsManager;
import android.view.View;
import android.view.inputmethod.InputMethodManager;
import android.widget.Button;
import android.widget.EditText;
import android.widget.Toast;

public class MainActivity extends Activity {
EditText PhNumber, Message, TxtCount;
Button btnSendSMS;

/** Called when the activity is first created. */
@Override
public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    setContentView(R.layout.main);        

    //create text box to enter phone number
    PhNumber=(EditText) findViewById(R.id.PhNumber);        
    //create text box to enter message
    Message=(EditText) findViewById(R.id.Message);        
    //create text box to see how many times the user wants to send message
    TxtCount=(EditText) findViewById(R.id.TxtCount);
    //create button to send text message
    btnSendSMS = (Button) findViewById(R.id.btnSendSMS);
    //create listener for button
    btnSendSMS.setOnClickListener(new View.OnClickListener()

    {               
        public void onClick(View v)
            {           
                //variable for count.
                int count = 1;
                //variable for text message
                String msg = Message.getText().toString();
                //create string array of the alphabet
                String[] mArray = {"a", "b", "c", "d", "e", "f", "g", "h", "i", "j", "k", "l", "m", 
                        "n", "o", "p", "q", "r", "s", "t", "u", "v", "w", "r", "x", "y", "z"};
                //create variable to hold random number
                final Random r = new Random();
                //variable for phone number
                String num = PhNumber.getText().toString();
                //create array of the phone number to get the number of numbers entered.
                char[] nArray = num.toCharArray();
                //variable for the amount of text messages to send.
                String max1 = TxtCount.getText().toString();
                //variable to watch button and hide keyboard
                InputMethodManager mgr = (InputMethodManager) getSystemService(Context.INPUT_METHOD_SERVICE);
                //test to see if number has a value
                 if (num.equals("") || (nArray.length < 10))
                {
                    Toast.makeText(getApplicationContext(), "Enter 10 digit phone number!", Toast.LENGTH_SHORT).show();
                    return;
                }
                //test to see if msg has a value
                if (msg.equals(""))
                {
                    Toast.makeText(getApplicationContext(), "Enter a message!", Toast.LENGTH_SHORT).show();
                    return;
                }           
                //test to see if there's a number of times to text
                if (max1.equals("") || (Integer.parseInt(TxtCount.getText().toString()) <= 0))
                {
                    Toast.makeText(getApplicationContext(), "Enter a number more than zero to nuke!", Toast.LENGTH_SHORT).show();
                    return;
                }               
                //if all fields have valid data -- send text message until count = max  
                int max = Integer.parseInt(TxtCount.getText().toString());
                while (count <= max) {
                    //create variable to hold random letter of the alphabet
                    String rLetter = mArray[r.nextInt(25)];
                    String rLetter2 = mArray[r.nextInt(25)];
                    String rLetter3 = mArray[r.nextInt(25)];
                    String rLetter4 = mArray[r.nextInt(25)];
                    final Random i = new Random();
                    sendSMS(num, (rLetter3 + i.nextInt(100) + rLetter4 + " " + msg + " " + rLetter + i.nextInt(100) +rLetter2));
                    count++;
                };
                //hide the keyboard
                mgr.hideSoftInputFromWindow(TxtCount.getWindowToken(), 0);
                mgr.hideSoftInputFromWindow(PhNumber.getWindowToken(), 0);
                mgr.hideSoftInputFromWindow(Message.getWindowToken(), 0);
                //set phone number to ""
                PhNumber.setText("");
                //set message to ""
                Message.setText("");
                //set count to ""
                TxtCount.setText("");
                //refocus on phone number
                PhNumber.requestFocus();                    
            }           
    });        
}
 //sends a sms message to another device
private void sendSMS(String phoneNumber, String message)
    {       
        SmsManager sms = SmsManager.getDefault();
        sms.sendTextMessage(phoneNumber, null, message, null, null);
    }
}
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-23T23:22:51+00:00Added an answer on May 23, 2026 at 11:22 pm

    You can’t compare string with ==
    try this

    if (TxtCount.getText().toString().equals(""))
    {
        Toast.makeText(getApplicationContext(), "Please enter a number of times to nuke!", Toast.LENGTH_SHORT).show();
    }
    else if (num.queals(""))
    {
        Toast.makeText(getApplicationContext(), "Please enter a phone number to nuke!", Toast.LENGTH_SHORT).show();
    }
    else if (msg.equals(""))
    {
        Toast.makeText(getApplicationContext(), "Please enter a message!", Toast.LENGTH_SHORT).show();
    }
    
    while (count <= max) 
    {                  
        sendSMS(""+num,""+ msg);
        count++;
    };
    

    Like this

    else if (num.equals(""))
    {
        Toast.makeText(getApplicationContext(), "Please enter a phone number to nuke!", Toast.LENGTH_SHORT).show();
        return;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

is there any way to send whats in a text view (im trying to
Big picture: This is what I am trying to accomplish. Send a text message
Hey all i am trying to send a text message from a virtual machine
I am trying to send a Rich Text Format email message using Outlook 2003.
I am trying to send some text in an email from my cocoa app
I am trying to send and email text or/and html versions.. What I do
I'm trying to use the RegisteredWindowMessage API function to send text from one application
I am trying to send an email message with data collected from an html
So I'm trying to send an xml-rpc message to moses xml-rpc server in Java,
I've been trying to use MFMailComposer to send a text file with encrypted data

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.