Implementation of network related tasks on after startup

Hi, I want to do related to the network of tasks such as downloading content from the web service every time that my application starts, until the user can use. The problem is the network isn't ready yet when the application starts (during the process of starting the BlackBerry device) autorun mode so I can't ask content from the web service.

I was wondering, is it possible to prevent the execution of the program, until the device network coverage is sufficient?

Thank you.

Join RadioStatusListener or CoverageStatusListener (or both) depending on what you are trying to accomplish. Enter the event loop in the application code so that the application does not close. Prepare the State of your application based on the reminders you receive on the listeners. Push your screen on the stack of the display when the application is ready (make sure to use invokeLater() to push the screen if you do this from a thread of non-event). That should do it.

Tags: BlackBerry Developers

Similar Questions

  • Guard application launch at the start of the appliance, also need advice for the implementation of network methods

    Hi all

    I'm new to the development of Blackberry and I'm writing a relatively simple application to run on 7.1.

    So far the development was interesting, I managed to create my user interface using resources online (mainly this forum), but today I tried to implement some of the network classes that I need and now I just met constant problems.

    I use Eclipse SDK 3.7.2 (the one that comes with the plugin RIM)

    First question:

    I'm not sure what I changed, but today I noticed that whenever I start the Simulator (by sim 9360) my application is started during the initial startup process. I don't think he did this before, but to be honest, I wasn't paying much attention. I think it starts at the start of the device is because I put a breakpoint in the constructor for my class from the main screen, which is hit before the Simulator happens even to the point where it is ready for user interaction. In addition, once it is ready, if I press the BB button, I see my registered application.

    I don't have it set to automatic start in .xml descriptior enforcement.

    I started this application on the HelloBlackBerry sample, here is my main method for the entry of the application:

    public static void main( String[] args ) {
            appSettings = AppSettings.fetch();
            // Create a new instance of the application and make the currently
            // running thread the application's event dispatch thread.
            HelloBlackBerry theApp = new HelloBlackBerry();
            theApp.enterEventDispatcher();
            //openConnection();
    
        }
    
    
    

    As far as I know, this is the only entry point for the application.

    More code

        public HelloBlackBerry() {
            // Push a screen onto the UI stack for rendering.
            mainScreen = new ScreenHelloBlackBerry();
            pushScreen( mainScreen );
        }
    

    Here is the method of. my class AppSettings fetch()

        // Retrieves a copy of the effective properties set from storage.
        public static AppSettings fetch()
        {
            AppSettings savedSettings = (AppSettings) _store.getContents();
            return new AppSettings(savedSettings);
        }
    

    Some of this code that I wrote myself, the persistence store cause the launch of my car?

    I tried to reset the Simulator to the factory settings, no change.

    All applications initialized during the startup of the device and then closed shortly after?

    Part 2: Need advice for the implementation of functions of network in the application

    I need to implement some methods that will retrieve data from a web service, and I also need to send data to this service. What I've read, the ConnectionFactory is the way to go. I want my application to make a request when the application is open and can check on a set interval. I didn't know exactly how to go about adding another thread for networking, I understand that network connections should not be created on the thread main event, so I tried to do this:

    The constructor of my class that implements screen (ScreenHelloBlackBerry), I use the following to create a modal dialog box to prompt the user for a username, I also try networking wire in the same segment of spawning:

            public ScreenHelloBlackBerry(){...initialize fields and managers, add it all together...then near the end
    
    //This will open the confirm dialog when the application is launched
            UiApplication.getUiApplication().invokeLater(new Runnable() {
                  public void run() {
                      openConfirmDialog();
                    //start connection - Possibly broken
                      ConnectionThread ct = new ConnectionThread();
                      ct.start();
                  }
            });
    

    I don't know if it's somehow OK to do, but it seems to work for what I need. I want a user who launches the application at the prompt, and if a user switch applications, when they come back they wondered again (unless they close the app and reopen it).

    Here is my ConnectionThread:

    public class ConnectionThread extends Thread
    {
    
        public void run()
        {
    
              ConnectionFactory connFact = new ConnectionFactory();
              ConnectionDescriptor connDesc;
              connDesc = connFact.getConnection("http://www.google.com");
              if (connDesc != null)
              {
                  HttpConnection httpConn;
                  httpConn = (HttpConnection)connDesc.getConnection();
                  try
                  {
                      final int iResponseCode = httpConn.getResponseCode();
                      UiApplication.getUiApplication().invokeLater(new Runnable()
                      {
                          public void run()
                          {
                              Dialog.alert("Response code: " +
                                            Integer.toString(iResponseCode));
    
                          }
                       });
                      httpConn.close();
    
                   }
                   catch (IOException e)
                   {
                     System.err.println("Caught IOException: "
                          + e.getMessage());
                   }
              }
        }
    }
    

    At the moment it has basically unmodified code from a sample that I found, I'll be retooling to meet my needs whenever I can make it work. I HAD this work to the point where, after the closed user confirm this dialog, a few moments later a an alert dialog appears with the 302 response code. I don't know what changed, but now it doesn't work at all, and if I try to scroll with the debugger, I can't past the httpCon.getResponseCode (). I've seen some mistakes earlier on "no record of service was set up", and I also had once a timeout exception.

    I'm sure I'm doing this wrong, but at the same time as I said WAS working, and now it is not. If someone has done this far, thank you very much for your time and advice are much appreciated.

    Also, should I try to start the thread of the network of the UIApplication class instead of the screen? There is currently very little happening in the class that extends UIApplication, do I spend most of my business logic out of the class of the screen and in the UIApplication class?

    Thanks in advance!

    Hi all

    Just to conclude this topic for those who are interested, I found an excellent guide to the implementation of networks in applications of BB, click here for a link.

    About my application being started at the start of the simulator of the device, I found that on a device real this behavior is not complied with, and in addition, the behaviour seems to have stopped after uninstallation and reinstallation of my Simulator.

    See you soon,.

  • My Disk Defragmenter Hangs After startup

    My Disk Defragmenter Hangs After startup.  I tried to use the microsoft fix it Center automatic troobleshooter for the maintenance of the system determine the cause and got an error code 0 x 80040154.  He only "worked" on windows update and the update to fix issue still exists.  I'm trying to find out what means error 0 x 80040154 and how to solve the problem.

    Hope that gives you enough information.

    Hello

    (1) operating system do you work?

    (2) which Fix - it applied?

    (3) what is the exact full error message?

    Try the following methods and check the status of the issue.

    Method 1:

    Run a scan of the file system checker and check if it helps.

    http://support.Microsoft.com/kb/929833

    Method 2:

    Check a drive for errors.

    http://Windows.Microsoft.com/en-us/Windows7/check-a-drive-for-errors

    NOTE: This task might cause loss of data on your computer. It is recommended that you back up all data and files before performing this.

  • General failure on Ping and TraceRT by WAN IP for 15 minutes after startup

    My Windows 7 64 of Profession will expose this problem.

    After startup, it cannot access anything whatsoever outside the local network.  I can ping, DRC and usually access anything whatsoever on the local network, including the router.  But trying to access what anyone outside the LAN does not work.

    Ping Returns the Timeout on the first response, and then general of failure for the other three.

    Tracert immediately returns a general failure

    I am ping IP address, no domain name, is not a DNS problem.

    After 15 minutes or, the problem resolves, and starting the machine works fine.

    Occasionally (once a day or more), it will return to the problem of General failure for 15 minutes, then return to normal.

    The problem does not occur in safe mode with network.

    The problem occurs whether the user is logged on the machine.

    I have disabled the Windows Firewall to try to resolve, without success.

    I also installed McAfee.

    Thanks for any help that anyone can provide.

    CP71

    I would start by removing McAfee and using MSE at least to test.  You can not just disable McAfee, it should be removed and he is known for this type of problem.

    McAffe often contributes to BSOD

    I remove and replace it with Microsoft Security Essentials

  • The Alienware 14 laptop fan after startup noise

    Hi I was wondering if anyone else has suffered from this problem.  Recently around 2/11 ~ 12/02/2015, I noticed that the fan in my Alienware 14 would become really strong about a minute or two after startup.  This would be accompanied to the Alienware keyboard and touchpad lighting.  It only lasts a few seconds and the fan and light back to normal for the rest of the time I use it, even if it is several hours or more.  I think the same happens shortly after waking from sleep, but I'm not sure.

    I cleaned the vents to the best of my ability to compressed air, update the BIOS to A09 (latest version) and update the graphics drivers Nvidia Geforce 750 M and Intel HD 4600 graphics card.  I also ran full scan of the system AVG 2015 and not confirmed any virus/malware.  Also checked the task at Startup Manager to see if any unusual process have been the cause and find nothing unusual.  I also used the restoration of the system to a point before that I noticed something (2/10), and the noise of the fan always popped up.

    Attempted to run Dell Diagnostics and support help, but they have not found any problems.  Interesting note - when executing the analysis of their system to see if my drivers are required to update, it says that I need to download the BIOS A09 exe even though I already A09.

    Use Tech Support Chat or by e-mail, but 14 Alienware is apparently not one of the products covered by them.

    Thanks a bunch!

    Hi Mick,

    You might be interested to read here

    http://en.community.Dell.com/Owners-Club/Alienware/f/3746/t/19617992?pi21932=1

    Annoying bloody!

    Hope this helps

  • macOS Sierra hangs after startup

    I have a macbook pro 15 inch mid 2014 retina

    After that I installed macos sierra my macbook freezes after startup for about 10 min before things become normal after shots completely from the OS, I tried the P + R command cmd startup items cleaning + option and I checked the ram which is normal usage, but none of the above has worked

    It seems that this problem also affects slightly the time of normal startup of windows on one present on my bootcamp

    Stop

    Disconnect all external devices

    Restart in safe mode

    Try safe mode if your Mac does not end commissioning - Apple Support

    then restart normally, yet disconnected devices.

    If the problem persists, you can view a report of etreceheck for later analysis

    www.etrecheck.com

  • Slow to open the first time after startup apps

    Slow to open the first time after startup apps

    How about, the second time, that is, close and reopen?

    Also download and run Etrecheck.  Copy and paste the results in your response. Etrecheck is a diagnostic tool that has been developed by one of the most respected users here (and recommended by Apple's Support personnel) of the CSA to provide a snapshot of the system and help identify the most obvious culprits that can adversely affect the performance of a Mac.

  • Easiest way to implement a network wide lock/semaphore

    I was trying to think of a way to implement a network wide lock a semaphore. The application is that there are two computers on a network running TestStand. There is a common resource that one can use both. What is the best way to keep "up-to-date on the other.

    I thought maybe a small TCP/IP custom routine negotiating this resource or a variable shared in LabVIEW. I also thought to use the remote execution of sequence in TestStand. Someone has he done something like this before?

    Example/code sequences are always appreciated.

    You can use a lock TestStand (or any other synchronization operation) on the network by prefixing the name of lock with \\MachineName\.

    Using MachineName even for two machines and they work as well on the same lock, who will live at MachineName.

    Also, see setting up to TestStand to access synchronization distance objects in Appendix B of the reference manual.

  • Unable to connect to a network in the House after the removal of malicious software.

    I had a malware, got rid of him by running anti-malware in safe mode and now I can't connect to the network in the House when windows is running normally.  I have access to the internet.  Workstation does not start and gives an error code 2250.  Identification of network button is dimmed in network settings.

    Back up my data.  Found my sofware cd programs and reinstalled windows and all my programs.  Lost my graphics card drivers, my sound card driver and the network card drivers.  After some time and using another PC with the internet, everything seems to work again.

  • My computer constantly freezes after startup

    Original title: System Hang

    My computer freezes after startup or during startup. Whenever I look at the problems and solutions in Control Panel, it says that my nvidia graphics driver has stopped working properly and should be updated but I checked and installed the latest version. What else could I try? I would appreciate the help as I have had this problem before and it stopped for a while and started again.

    Thanks-James

    Hello

    Yes, different drivers depending on the graphics card which is present in the system. I suggest to check the link below and download the drivers that are present in the link.

    Vista 32 bit

    http://www.nvidia.com/object/Win7-WinVista-32bit-266.58-WHQL-driver.html

    Vista 64-bit

    http://www.nvidia.com/object/Win7-WinVista-64bit-266.58-WHQL-driver.html

    After having tried the steps, let us know if the problem is solved or not.

    Thanks and regards.

    Thahaseena M
    Microsoft Answers Support Engineer.
    Visit ourMicrosoft answers feedback Forum and let us know what you think.

  • Player Windows 10 DC - before you can perform related tasks such as page layout printing or print a document, you must install a printer

    Hello

    We had a problem at my organization with our windows 10 machines where they print not Adobe Reader DC.  When you click on the 'Print' button, we get the message:

    Before you can perform related tasks like layout or print a document, you need to install a printer.  The printer itself doesn't have a printing problems to any other type of document. except .pdf (which is associated with Acrobat Reader DC.)

    I did a search on the forum and see that this is a common problem and I tried all of the suggested fixes (select a new printer by default, restart the spooler service, delete the files in the directories of the spooler, upgrade to the latest version of Acrobat Reader DC etc.).

    Have one or know a solution for this?  Versions provided below etc.:

    Windows version: 10.10586.0001

    Adobe Acrobat Reader DC: 15.007.20033

    Version of Adobe Acrobat Reader DC Update: 15.016.20045

    Print driver: HP Universal PCL 6 (v6.2.1) printing

    Thanks in advance!

    Forgive me, please follow the steps that are given below:

    Also try printing to the Adobe PDF format, to do > click Print > select Adobe PDF in the print dialog box.

  • BDP-S580 white screen after startup

    I've owned my player for several years and had zero problems with it.  However, it now turns off after startup.  I see the sony blu ray logo, then the next screen has the blue streak fell on it (I call it the loading screen) and then the screen goes white, and the signal is lost.  On the real player, however, everything looks normal.  The display shows the home page, it responds to the remote control to open and close the drive.  If I touched the game, I get the meter to display and advance but I get no sound and no video on my tv.  Indeed, after a few minutes my self to stop the countdown appears and turns off the TV because no signal detected.  My audio system (which is connected between the player and the TV) shows as it loses the signal dropping HDMI icon which is initially present when loading the blu - ray player and the logo screen is present.  Any help would be greatly appreciated.

    Oh dear, my apologies!

    I give this advice to so many people, I forgot that you actually wrote, sorry!

    I noice that you have your BD player that is connected to your audio system, can you give me the make and model number? Alternatively, you can try to reset this device if possible. Also please be sure to check that your HDMI connection wires are firmly held down, sometimes they come loose over time.

    Another suggestion, that you can try is to turn your BD drive and unplug the power supply for a few minutes before you reconnect the power and turn it back on again.

    If the issue is not fixed please visit this link below and perform these troubleshooting steps, please not, some are model specific and does not apply however it is recommended that you try to change the screen resolution by following these instructions.

    There is no picture of a Blu - ray disc player and the screen is completely black or flashes.

  • Photoshop crashes soon after startup. How can I obtain and present the crash log? When I go to 'Help-> Adobe product improvement Plan' nothing happens.

    Hello

    I'm having the problem that my Photoshop CS6 always crashes soon after startup. I use no plug-ins, and my PC is in good health. I would like to present a crash log if someone can tell me what the problem is, but when I go to 'Help-> Adobe product improvement Plan' that I read is where crash logs are produced nothing happens.

    I also have a question my Premiere Pro hangs at startup upward. I have these two programs were widely used in the past but have recently started having problems. I have already uninstalled and reinstalled CS6, but the problem persists.

    Any help would be massively appreciated.

    Chris

    Thank you. The crash log tells me that you have not updated Photoshop CS6. It should be 13.0.1.3 not 13.0.0.0

    Either run help > updates or download and install it. Adobe - Photoshop: for Windows

    ig75icd64.dll is a display driver.  Go here and to update: Intel® Driver Update Utility

  • Start another task process after the user complete

    I would like to have a process task trigger after the task of process 'User' successfully completed.

    For example, scenario

    A user currently has a disability resource. When I allow the user, the task of user process

    is called, and allows the user. After that, I would have my custom process triggered after that task.

    I tried to add my task of custom process in the task of the user as a dependent task, but it is never called.

    Also, I tried to add the custom task to generate task, but it does not work.

    What am I doing wrong or am I missing a step?

    Directions for use:

    Goal: When 1st job process is triggered, the task of 2nd process will be kickoff.

    1. Select the task in process 1

    2. in the task of the process task dependencies tab 1, add the 2nd task in process in the section of the task of the person in charge.

    3. in the task of the 1st task of process responses, select the SUCCESS response and add the task of 2nd process tasks in section generate.

    IMPORTANT: Every answer has its own task to generate. So make sure that you add to the answer that you want the task to process 2 to trigger by.

  • Wireless networks disappear minutes after startup

    I start my desktop PC (Windows 7) and everything works fine. I am connected to my wireless router and have access to the internet.

    Then a problem occurs, sometimes only 2 or 3 minutes later, sometimes around 5 or 6 minutes later.
    The computer loses internet access, but remains connected to the network. After a few seconds, the internet is back.
    After a few times, the computer finally loses the connection to the network, and then the network (as well as other networks that were in the range) is no longer there.
    I am currently link this on my laptop which is right next to my office. My laptop is connected to the router wireless (and internet) without any problem.
    I've been struggling with this for a while now and there are only a few hours, I deleted Norton anti-virus with the Norton Removal Tool. No change.
    Map of TP-Link in the problematic PC wireless network is only about 2 years old. I think my next step is to buy a new card netword, thoughts?
    EDIT - I forgot to mention. I uninstalled and reinstalled the NIC several times. No driver updates available.
    I just thought an idea. Before buying a new card, I'll see if I can install this on my brother's PC. So I'll see what happens.

    Hi Mike,.

    You are facing problems with an internet connection in Windows 7.

    Were there any changes made to the computer before the show?

    Please follow the steps from the link and check that it works very well.

    Wireless and wired network problems

    http://Windows.Microsoft.com/en-in/Windows/network-connection-problem-help#network-problems=Windows-7&V1H=win8tab1&V2H=win7tab1&V3H=winvistatab1&v4h=winxptab1

    For all windows questions do not hesitate to contact us and we will be happy to help you.

Maybe you are looking for