SMS, blocking thread on BB SDK5 number

Hi all. Newbie here tearing the hair out trying to fix a problem with sending SMS and it being blocked by the thread of the event. I assume that below is not the way to get a thread because I still get the same error. Can someone help me pls as my widows high ridge running in a bald head because of hair tearing? Also in the code below how a) interrupts the thread and b) returns a return value to the calling program? Understand you create a Boolean variable that you return but I would change public void run() or vacuum in the method definition, or both? Thank you so much as always.

Import Java.util;
import java. IO;
import java.lang. *;
Javax.microedition.location import. *;
Net.rim.device.api.util import. *;
Javax.wireless.messaging import. *;
Net.rim.device.api.system import. *;
Javax.microedition.io import. *;
Import net.rim.device.api.ui.UiApplication;
Import javax.microedition.io.Connector;
Import javax.wireless.messaging.TextMessage;

public class {SendSMS
   
Thread sendThread;
     
public SendSMS() {}
   
sendThread = new Thread();
sendThread.start ();
    
}
    
public static void SendMessage (String phoneNumber, String messageText) {}
successor to boolean = true;
final string address = phoneNumber;
the final String message = messageText;

UiApplication.getUiApplication () .invokeLater (new Runnable() {}
           
public void run() {}
               
VR;
{
MessageConnection smsConnection = (MessageConnection) Connector.open ("sms: / /" + address);
TextMessage newSMS = (TextMessage) smsConnection.newMessage (MessageConnection.TEXT_MESSAGE);
newSMS.setPayloadText (message);
smsConnection.send (newSMS);
}
catch (IOException final e) {}
          
UiApplication.getUiApplication () .pushModalScreen (new CustomDialog ("error occurred:" + e.getMessage ()));
}
               
}
       
});  ends runnable
} //ends sendmessage method
    
} class //ends

Maybe I'm missing something, but I don't see where your Thread object never comes into the picture.

Your invokeLater simply queue the work to be done in the case of wire.

You create a thread in the constructor, but never give him any work to do. Follow these steps to extending the Thread class and implement your code in the run() method.

Tags: BlackBerry Developers

Similar Questions

  • Running the background (sms listening thread) connected to the GUI (another point of entry) application thread

    Hi, I'm new to the development of Blackberry, I read everything on the application running at startup and have a different point of entry for this application. I still need help with my application

    I use BB JDE 4.7

    Simulator: BB 9530 4.7.0

    I'm developing an application of SMS. (extends UiApplication)

    1) there is a thread that listens for incoming messages

    2) there is a wire which is a SMS sender

    3) there is a main screen and two full screens. for example, when the user clicks a button in one of the screens full... I send you a message

    (4) when a message is received, based on the content of the message I push either a full screen

    (5) I have, all the wires and screens as the class internal to the main class that extends from the UiApplication.

    I got the basic features. I need help making that demand the application of autostartup

    (1) I need to start listening to the sms thread when the BB phone starts

    (2) I need to have the application icon in the applications screen as another entry point for the application (only for the GUI), and the listening thread must remain active in the background.

    (3) when an incoming message is detected, the application GUI should be brought to the foreground (if it isn't already forground) after posting a popup (instead of bring the application to the foreground, is it better to display a flashing icon in the status bar of the home screen blackberry and perhaps global popup)

    (4) when the GUI of the application part is closed, I need to stop the sms sending thread, and when the system shuts down, I need to stop the listening thread.

    Please help me guys... I have read many articles and discussions regarding the automatic start-up of applications, another point of entry, the # of background threads...

    but I couldn't find how to implement my needs.

    (1) should I need to create two different projects (applications [GUI thread, a sender] and one for the listening thread)? or I can achieve in single application?

    (2) should I have to sign in the background thread to the GUI app? If so, how?

    (3) it is necessary to use the RunTimeStore object? If so, I don't know how I can bring to the foreground the application GUI of the background thread.

    (4) if I have to stop the thread of listening by overiding onExit() method, the important question I have is, if the onExit() method is only for applications that extends from the Application class and not for the UiApplication class?

    (5) if I should have two projects (one main and the other as a spare point entry), which project should I do as "autorun at startup" and a "system module".

    As I need to have the background still running thread when the GUI application is active. I don't know how I do.

    Hello world...

    I reached my needs thanks to a single application. I used an other entry point.

    To refer to chk my other post

    http://supportforums.BlackBerry.com/T5/Java-development/how-to-avoid-creating-two-instances-of-the-a...

  • Send SMS to the short 3-digit number blocked by contacts

    iPhone 4 s, ios 9.3.2.   I want to send an SMS to a short number '203', but the contacts are suggested which include 203 in their phone numbers.     Therefore, I can never get to the text window to write the text.     Apart from the seizure of a contact for each short number how can I send these texts.   Thanks Nigel

    Hi Nigel

    After typing your 3 digit short code, ignore the suggested contacts and rather press return on the keyboard.

  • Can block incoming calls from a number?

    We used the blocking calls in the Manager of administration to block some outgoing calls - 900 numbers, 976, etc.. I guess it works. The question I have is if it this or something else can be used to block INBOUND calls. For example, we received, shall we say, a vulgar call. We do want to hear from the appellant in the future. I tried to add my number to test, but I can go very well.
    Based on the documentation, it is not clear to me that it does not block incoming calls.
    Enter a phone number or a model block. For example, to block all calls to the
    858-410-1600 number, enter the number as indicated. It blocks only calls
    place to the specific number is entered.
    Thus, this part specifically calls 'to' this number will be blocked. No mention of calls from this number.
    But then, you can check the box "Outgoing call" to block outgoing calls...
    Check this box to prevent the agents or the Call Center On Demand
    system of automatic reminder to place calls to numbers corresponding to the model
    you have specified. Clear this check box to allow outgoing calls to the numbers corresponding to the
    the model.
    So, why bother with the call-out if adding box it blocks calls to a number (or model) in the first place?
    But, to my immediate problem - then - I block incoming calls?

    To block an incoming call, follow these steps:

    1. create a routing pattern prefix is the number you want to block. One of them will be created for each number block unless you use the AFN or NXX and a wildcard.
    2. create a prefix in the routing group that includes the Microsoft Routing prefix model you just created.
    3. create a new project (or campaign) Menu.
    a. place the default link to disconnect. (You can play an audio first if you wish).
    4. create a new project.
    a. allow a phone project, but do not assign a DNIS.
    b. route all calls to this project from the project Menu has created...
    5 blocking occurs at the level of the project. If the number to be blocked for more than 1 DNIS, make the following change to each of the projects.
    a. open the project in question, and then click the phone tab.
    b. click the routing of Prefix tab and activate the prefix routing.
    c. Select the prefix for the created routing group and that it points to the new project.

    Alternatively, you can make the call blocking since in a campaign, but this requires that each time a new number must be blocked or unblocked, we need to make the change. By using the above steps, the client can add/remove numbers.

    Dave Shuger

  • Mail blocked mail? -10 message number could not be found - error number: 0x800420CD

    Hi, I keep grtting this error message any ideas how to fix it please

    Number 10 of the message could not be found. Account: 'pop3.btconnect.com', server: 'pop3.btconnect.com', Protocol: POP3, server response: 'More, show this email to your advisor for = A320 discount on your order.', Port: 110, secure (SSL): no, Server error: 0x800CCC90, error number: 0x800420CD

    Hi Don, thanks for you advice. However, because of another reason and my impatience with the pc, I did a complete resort and fingers crossed its all works fine now. Thanks again for your help

  • Blocked threads executing confidence Recon

    We have a REST base custom connector and run reconciliation trust with it. We get the stuck thread question. Only 500 users are have closer per hour. No idea how to diagnose this problem? A Profiler can help in this case?

    Use jvisualvm jdk/bin and connect to oim_server, and the list of all the discussions.

    Click on "Thread Dump" to get the State of all discussions and find problematic place.

  • BlackBerry 10 blocking of an incoming SMS

    Good day for about 3 months now, I received a SMS that I don't know who it was from or if it is a Bug or what. Ihavejustbeendeletingit.

    The Message is

    {DELETED} telephone number

    message: Please keep this message from Matthew IMEI: {DELETED}.

    I have a way that you could help me. I don't understand. I don't know where to turn.

    Thanks, Denise

    MOD Edit: Remove information staff to comply with the Community guidelines and the terms and Conditions of use.

    Sorry!

    You cannot block one person or the number to send SMS... Please chsek the link below...

    http://helpblog.BlackBerry.com/2011/11/BlackBerry-message-block/

    Thank you

  • Essbase number difference blocks

    Hello

    I have EMP 11.1.2.2 and I am exporting and importing cube BSO dev to uat environment. After importation and performing calculations, I see little difference there in the 'Number of blocks' and "Existing cutters uper level" in any environment.

    Others like "existing level 0 blocks", "Block size" and 'The potential number of blocks' are the same.

    Can you please let me know what could be the reason for the difference, even if it's the same data, and the pattern is the same.

    You asked a very similar question earlier (I have not this good a souvenir, but I searched this thread designate in this one!): https://forums.oracle.com/message/10877200#10877200

    My first guess would be "all the #Missing ' top level in one or the other cube blocks.  You did not say that we have more, by the way.   But if they reconcile, and a restructuring forced in both environments brings counties into alignment I doubt you have a problem.

  • Blocking SMS

    Is there a way to block messages text from ONE number?  A single.  Please tell me yes I can't find it anywhere, but this does not mean that there is not a way.  Thank you.

    The only way I know is that you need to connect to your Verizon account and set a phone number block on this individual phone number...  It is only valid to block for 3 months I think... so you need to reset in a few months on the verizon site.

  • BB10 WebWorks: how to call SMS app with content filled beforehand and without a phone number?

    Say that I want to share content via SMS, App can prepare the content, launch the SMS application and users enter the number of the recipient.

    Is this possible? BB10 WebWorks call APIs seems to require pre-filling the destination number.

    https://developer.BlackBerry.com/HTML5/documentation/text_messages.html

    Thank you

    I found another way, instead of directly calling the SMS app, I can call target selector API actions and from there I select SMS or Email or BBM or Facebook or Twitter, LinkedIn, line break work well, a single API call solves all registered social work services.

    https://developer.BlackBerry.com/HTML5/APIs/BlackBerry.Invoke.card.html#.invokeTargetPicker

    try {}
    application of var = {}
    Action: "bb.action.SHARE."
    data : 'Line 1' + '\n ' +.
    'Line 2' + '\n ' +.
    'Line 3' + '\n ';
    MIME: "text/plain",
    target_type: ['MAP']
    };

    () blackberry.invoke.card.invokeTargetPicker
    asks,
    "Share."
    function (successEvt) {},
    {function (errorEvt)}
    );
    }
    {} catch (e)
    }

  • How to find the number who sent the sms blackBerry smartphones?

    Hello

    you know when you have several mobile numbers assigned to the same person, and this person sends you an SMS, how do I know what number he used to send the SMS?

    Thank you.

    Boutros

    The SMS message open, click Menu > until the email and in the email you will see FROM: phone number.

  • BlackBerry Smartphones Save a number between SMS and contacts?

    Guys, I'm new to BlackBerry - got my first today in the form of a storm.

    Already, I can't understand something:

    If someone sends me an SMS, so how to save this number directly as a new contact in the address book?

    Congratulations in advance.

    in the message, click on its number (should say mobile besideit) and click on the bb button and that there should be an option to add to contacts

  • Problem with the text block, put in place when it is used on the page number marker

    Hello!

    I would use the text block on the marker page number on the master page in Indesign. The text block should change width when increases the page number. It does not work. What happens is that when the number of page moves a two-digit figure, the numbers tightened itself (compressed on top of each other) and the block of text changes size unless I drag on it (which means I have to manually unlock the master page first).

    I'm doing something wrong, or is this a bug?

    Thank you!

    Altogether! So, you can use a rule of Pará to simply do it!

  • Blocking text Leap blackBerry?

    Is it possible to block text messages from a specific number?

    There are a number of app store Google play in which to do this.

    SMS blocker. Clean Inbox - Android applications on Google game

    The appeals of Mr. Number-Block & spam

  • What is the BlackBerry API to delete the SMS Message?

    I read a lot of articles and the forum here and elsewhere on the web, but could not found any method of BlackBerry API to remove the coming application SMS message. Please help me solve this problem. I use following code for incoming SMS reading:

    Code to listen to any incoming SMS:

    Import javax.microedition.io.Connector;
    Import javax.wireless.messaging.Message;
    Import javax.wireless.messaging.MessageConnection;
    Import javax.wireless.messaging.TextMessage;

    public class SMSListener {}
    public void startSMSListener() {}
    New Thread (new Runnable() {}
    public void run() {}
    try {}
    _Mc MessageConnection = (MessageConnection)Connector.open("sms://:0");
    for(; {
    Message m = _mc.receive ();
    Address of string = m.getAddress ();
    Number of strings = address.substring (6).
    If (m instanceof TextMessage) {}
    TextMessage tm = m (text);
    String msg = tm.getPayloadText ();
    long = tm.getTimestamp () .getTime ();
    System.out.println("SMS\n"+address+"\n"+time+"\n"+number+"\n"+msg);

    QUESTION: HOW DO I SUPPRESS THIS INCOMING MESSAGE?
    }
    }
    } catch (Exception e) {}
    }
    ({. start()});
    }
    }

    You can not.  But you can craft an SMS so that it does not appear in the Inbox.  This article explains how.

    Use SMS to alert an application

Maybe you are looking for