Add text dynamically to the SplashScreen...

Hello

I use the splash screen that opens during my xml application that loads all of the HTTP connection.

This start screen is controlled by a timer thread which, after some specific time, transfer to the landing screen.

I would like to add different text based on the time spent on the thread of Splash.

My current thread is 32 seconds. I want after 10 seconds, I'd write "Loading News... »
After 20 seconds, I should write "loading settings...". "after every 10 seconds etc. Then, total three changes will come during the time splashscreen transfers control to landingscreen.

How can I achieve this. Post my code, which will help you understand the requirment.

First file with UiApplication

public class NewsArena extends UiApplication
{
    public static void main(String[] args)
    {
        NewsArena hello = new NewsArena();
        hello.enterEventDispatcher();
    }
    public NewsArena()
    {
        pushScreen(new WelcomeScreen(this,new LandingScreen(Constants.NEWLYADDED)));
    }
}

Have the second class SplashScren

public class WelcomeScreen extends MainScreen
{
    private UiApplication application;
    private MainScreen next;
    private static final Bitmap _bitmap = Bitmap.getBitmapResource("wap_logo.gif");
    private Timer timer = new Timer();

    public WelcomeScreen(UiApplication application, MainScreen next)
    {
          this.application = application;
          this.next = next;
          this.add(new BitmapField(_bitmap,BitmapField.FIELD_HCENTER | BitmapField.FIELD_VCENTER));
          this.add(new LabelField("Loading application ....",LabelField.FIELD_HCENTER | LabelField.FIELD_VCENTER));
          timer.schedule(new CountDown(), 32000);
    }

    public void dismiss()
    {

        timer.cancel();
        application.popScreen(this);
        application.pushScreen(next);
    }
    private class CountDown extends TimerTask
    {
        public void run()
        {
            DismissThread dThread = new DismissThread();
            application.invokeLater(dThread);
        }
    }

    private class DismissThread implements Runnable
    {
        public void run()
        {
            dismiss();
        }
    }
}

Thus, instead of

"Loading application...". "I want to add other texts defined above, on the basis of time expired on SplashScreen.

Thank you

Kind regards

Amber

In your SplasScreen, use the following for Timer constructor:

hourly (task the TimerTask, delay, long)

Schedules the task specified for the repeated execution of fixed / period, starting after the specified delay.

Then task will be continuously called after the time (period) specified.

And in the TimerTask:

1. change the text of the label.

2. If the total time of the display is greater than your total time then make disappear the splash screen.

You can try with something like below:

public class WelcomeScreen extends MainScreen{    private UiApplication application;    private MainScreen next;    private static final Bitmap _bitmap = Bitmap.getBitmapResource                                           ("wap_logo.gif");    private Timer timer = new Timer();

    //display the messages in the following order (0,1,..., 4,0,..)    //toggle after 1 second    private String msg[] = {"Loading 1", "Loading 2","Loading                              3","Loading 4","Loading 5"};    int totalMessage = msg.length;    int currentMessageIndex = 0;    int timeBetweenToggleMessage = 1000;

    long startTime;    int totalTime = 32000;

    LabelField labelField = new LabelField(msg[0], DrawStyle.HCENTER |                                                           LabelField.USE_ALL_WIDTH );

    public WelcomeScreen(UiApplication application, MainScreen next)    {        startTime = System.currentTimeMillis();        this.application = application;        this.next = next;        this.add(new BitmapField(_bitmap,BitmapField.FIELD_HCENTER |                                          BitmapField.FIELD_VCENTER));        this.add(labelField);        timer.schedule(new CountDown(), 0, timeBetweenToggleMessage);    }

    public void dismiss()     {

        timer.cancel();        application.popScreen(this);        application.pushScreen(next);    }    private class CountDown extends TimerTask     {        public void run()         {            synchronized(Application.getEventLock())            {                if(currentMessageIndex >= totalMessage )                      currentMessageIndex = 0;                labelField.setText(msg[currentMessageIndex]);                currentMessageIndex++;                long currentTime = System.currentTimeMillis();                if ( currentTime - startTime >= totalTime)                {                    DismissThread dThread = new DismissThread();                    application.invokeLater(dThread);                }            }        }    }

    private class DismissThread implements Runnable     {        public void run()         {                        dismiss();        }    }}

Concerning

Bika

Tags: BlackBerry Developers

Similar Questions

  • I want to add text box to the form

    Hello

    Please help me to add text box to the form

    If the user can enter text

    I added the button with success

    cann't just add textbox

    Thanks gerard

    It works

  • Add text to change the field

    Hello

    I display a text field on a screen. Is it possible to add the user to add text to the editfield, even if the focus is on a button. So, no matter where the cursor is on the screen if the user types the text it is automatically sent to the editfield. Is this possible?

    Thank you

    I think it's possible.  You can issue a setText at any time update the field.  The trick is to get and then the interpretation of characters.

    To give you an easy solution. say that you override keyChar to your screen.  This will get the control regardless of the field is in fact in short.  So, you could do something like this (untested, no compiled code, as only learning tool):

    {} protected Boolean keyChar (char c, int status, int time)
    String current = myEditField.getText ();

    String = new current + c;

    myEditField.setText (new);

    Returns true;

    }

    There are problems with this, for example, how do you get back?

    Another option is to replace keyDown and if the focus is not on the EditField, set it to the EditField.  Then the EditField will receive all methods keyChar itself and treat them properly.

  • Add text pointing to the PivotTable

    All,

    Is it possible to add text to a column header hover in a PivotTable? Specifically, I would like to add the value of columns other than the hover text in the column header. Is this possible?

    Thank you.

    Hover text is possible with static text, but your condition is not possible to display the value except if coded its hard

  • How can can add text fields in the form automatically pdf document?

    I use Adobe Acrobat X (10.1.3) installed on Windows 7 to create pdf forms. My document is very similar to a "lined paper A4 notebook.

    I want to add the text field for each row of lined notebook, so people will be able to write what they want line by line.

    As my document has 20 lines in each page, and a total of 64 pages, I won't add these fields one by one. (drawing of rectangles with precision and aligning each other, assigning separate 'field name' to ensure solid mounting.)

    Property 'Set the Multiple field' within the right - click cause misalignment during 5-6 lines statement on the other.

    You have any suggestions or work around I can receive?

    See Doc.addField. If there is a model for the positions lines on each page, then you can generate the positions in JavaScript and use Doc.addField to set the text fields.

  • PDF fillable where the customer can add text AND change the fonts?

    Hello

    I would like to be able to provide my clients with editable poster templates. I created in InDesign posters, with a large white space in the middle where they can add their own texts, and when they're done, they can send them to the printer. The problem is, I just want to give them - in PDF print quality, so they don't mess up my share of the design (in addition, they are not sufficiently advanced to use indesign or illustrator or something like that).

    I tried implementing a PDF file using a text field, but it won't work. When the customer type in the text field, they will not be able to change the size of font, color, weight, etc.

    Is there some sort of 3rd party plugin that will allow me to create PDF files to fill live where the customer can indeed choose their fonts & things when they fill in their info?

    Thank you!

    Bernd: rich text only allows to apply bold, italic, exposing. It does not allow the user to make the text larger or to change the font.

    When I type ctrl-e in the area I can change the font and the font size.

  • Cannot add text to all the

    Hello... I use Photoshop Elements 8 and use items from version 2. For about the last 6 months, I couldn't type any text at all. When I try to type any text, images, newly created, scanned in or otherwise - no text appears. When I click on the image to start typing, I get the little box that always pointed, but no text appears when I type. I am quite familiar with the elements and have no idea of what brought this. I don't remember all the settings changes and I checked all the settings I can think. All other functions seem to work.

    No matter what the police, or the font size is selected, the color of the text changes make no difference, I checked the horizontal, vertical and hide the text settings, opacity has been verified... I'm fresh out of ideas. I even uninstalled and reinstalled the software - nothing - no text at all.

    I use Windows 7. I would like suggestions.

    Kevin

    Try to reset the text tool by clicking on the small facing down

    arrow and selection tool reset (in bold below).

    If it does not try to reset preferences pse8 taking into

    on the Shift + Ctrl + Alt keys pressed at the same time, you start the pse8

    Editor and choose Yes in the dialog box that follows.

    Preferences are not reset during a uninstall/reinstall.

    There is also a forum for photoshop elements:

    http://forums.Adobe.com/community/photoshop_elements

    MTSTUNER

  • Dynamic text: gradually change the size of font that you type

    Always present in my project. I need help with that.

    I have a dynamic txt connected to a keyboard on the screen, and I need the police to shrink in size according to the number of characters that you enter.

    Looks like it could be a simple algorithm, but I have no idea where to start.

    any help?

    If you use a keyboard on the screen, I'm not sure that a listener CHANGES will work if it involves adding text to the textfield with code... but kGlad know better on this subject.  If she does not have a code, code adds text can have the task of checking the length right after each character is added.

    To check the number of characters in the textfield by its length property, essentially use something similar...

    numCharacters = yourTextfield.length;

  • Replace the Image and add text - new edition of content of the javascript tools commands

    With the new content tools Adobe XI of edition, can someone please advise if there is javascript for the following commands:

    • Replace the Image
    • Add text

    Replace the Image

    I have a pdf document with an image that is manually replaced by content (it is a logo) of the editing tools.

    Add text

    The same pdf document has text added manually by the content of modification of the tools as well (it's the same text each time).

    Can someone advise please basic commands javascript I can use to help me get started, because the process described above is very tedious when done by hand and repeated several times a day?

    Script to add text via content editing tool method is the goal, I try to avoid adding a text field, the pdf will be flattened at the end of the process in this way.

    Advice and assistance will be most appreciated.

    Thank you.


    You can use a button to display an image and import an image as an icon of the button file programmatically. You will use the field.buttonImportIcon for this JavaScript method.

  • How to add text on the video and still images?

    CS 5.5. I want to add text credits at the end of a clip on top a fixed image, but I don't know how to do it. I don't want to do some exploring, text just above the .jpg image. I tried to use the title of"to do, but for some reason any title using part of the video for do not return, it comes with a yellow instead of red like the rest of the video in the timeline. I searched the FAQ and google for help and all that shows is how to make a title using text.

    Thank you

    For some info on the red, yellow and green bars go look here http://blogs.adobe.com/premiereprotraining/2011/02/red-yellow-and-green-render-bars.html

  • Add link to URL in the text added to the catalyst

    Hello

    My question is, is it possible to be part of a text added in flash catalyst a link to the URL, as in normal site?

    Thanks in advance!

    Hello

    I'm sorry, I'm not very clear about your question. So, I'll give you two solutions. Please use that is appropriate for you

    Solution 1: This is to convert any instance of text unique all in Flash Catalyst to a clickable link

    You can convert any occurrence of text in a button & then add a "Go To URL" interaction to achieve this.

    Step 1. Add text by using the text command.

    Step 2. Select the text and convert it into a "button" with Heads Up Display.

    Step 3. Click on the button 'Add the Interaction' in the Panel "Interactions".

    Step 4. Select "Go To URL" from the second drop-down list and enter the URL in the text box below the

    Solution 2: This is to convert part of the occurrence of text to a clickable link.

    This feature is available only by the "RichEditableText" component that is not supported by Flash Catalyst.

    Once you have the text placed inside your application using catalyst, you must edit in Flash Builder.

    Step 1. Save the project in Flash Catalyst under FXP

    Step 2. Import the FXP in Flash Builder file, by using the menu "File-> Import Flash Builder Project"

    Step 3. Open the file "Main.mxml" & look for the component "RichText".

    Step 4. Replace "RichText" with "RichEditableText.

    Step 5. Set the 'editable' component "RichEditableText" property to "false".

    Step 6. Add the tag "" around the part of the text you want to be clickable. See example below

    Step 7. Save & publish the project using the menu "project-> Export Release version.

    Subject to changes text

    Text after changes


                                     Hello http://www.adobe.com "> Adobe>"
                            

    Let us know if this solves your problem.

    Concerning

    Srinivas Annam

  • PLEASE, I BEG YOU! How can I have a label dynamically see the current user loggedin FirstName and LastName in my database?

    I have a HBox that becomes visible when a user is valid. The HBox contains a logout button, and a label. How can I get the label dynamically see the current user loggedin FirstName and LastName in my database? Below, I have included my element HBox and ColdFusion. ANY helpwould be appreciated!



    < < < < < < MY component LoginHBox.mxml starts HERE > > > > > > >
    < mx:HBox
    ' xmlns:MX =' http://www.adobe.com/2006/mxml '
    Width = '100% '.
    height = "28".
    horizontalAlign = "right."
    verticalAlign = "middle".
    paddingRight = "10" >

    "" < mx:Script source = "... / actionScript/logout.as" / >

    <!-App connects to ColdFusion using Flash Remoting STARTS->
    < mx:RemoteObject
    ID = "cfService_LoginCFC".
    destination = "ColdFusion".
    source="WebsiteApplication.CFC.LoginCFC"/ >
    <!-App connects to ColdFusion using Flash Remoting END->

    < mx:Label id = "welcomeLabel".
    Text = "Welcome"... "/ > < < < < HOW can I get the text dynamically see the users registered in FirstName and LastName?

    <! - logoutResultHandler() of the points of function in the file logout.as - >
    < mx:Button id = "logoutButton.
    label = "Log" Out
    Click = "logoutResultHandler ()" / >

    < / mx:HBox >
    < < < < < < MY component LoginHBox.mxml ends HERE > > > > > > >



    < < < < < < MY component LoginCFC.cfc starts HERE > > > > > > >
    < cfproperty >

    <!-function loginUser STARTS->
    < name cffunction = "loginUser" access = "remote" returntype = "WebsiteApplication.cfc.UserCFC" >
    < cfargument = 'user name' name type = "string" required = "true" >
    < name cfargument = "password" type = "string" required = "true" >

    <!-the default user is not logged in->
    < cfset var user = createObject ("component", "UserCFC") >

    < cfquery name = "loginQuery" dataSource = "TheChurchOnFire" >
    SELECT the name of user, password, AccessLevelID, FirstName, LastName
    FROM dbo. MembershipInfo
    WHERE
    Username = "#username #
    AND password = ' #password #
    < / cfquery >
    <!-the cfif instructionsuivante is absolutely fundamental in the achievement of the
    fully functional authentication-> process
    < cfif EQ loginQuery.Username ' #username # ' loginQuery.Password AND EQ ' #password # ' >
    < cfset user .loggedin = true >
    < cfset user .username = "#username #" >
    < cfset user .roles = "#loginQuery.AccessLevelID #" >
    < cfreturn user >
    < cfelseif > #username # EQ 'username' AND #password # EQ 'password '.
    < cfset user .loggedin = true >
    < cfset user .username = "#username #" >
    < cfset user .roles = "6" >
    < cfreturn user >
    < cfelse >
    < cfreturn user >
    < / cfif >

    < / cffunction >
    <! - function loginUser ENDS - >

    < / cfproperty >
    < < < < < < MY component LoginCFC.cfc ends HERE > > > > > > >

    Thank you

    John

    I finally thought to it! PRAISE BE TO GOD!

    I had to add...

    welcomeLabel.text ='Welcome, you are currently logged in as + currentUser.fullname + '!';

    .. .for my loginResultHandler.

    function loginResultHandler
    private void loginResultHandler(event:ResultEvent):void
    {
    currentUser = event.result as a user;
    If (currentUser.loggedIn)
    {
    If successful login
    If (currentUser.roles == '5')
    {
    this.currentState = 'Youth';
    welcomeLabel.text ='Welcome, you are currently logged in as + currentUser.fullname + '!';
    }
    Else if (currentUser.roles == '4')
    {
    this.currentState = 'Member';
    welcomeLabel.text ='Welcome, you are currently logged in as + currentUser.fullname + '!';
    }
    Else if (currentUser.roles == '3')
    {
    this.currentState = 'PowerMember';
    welcomeLabel.text ='Welcome, you are currently logged in as + currentUser.fullname + '!';
    }
    Else if (currentUser.roles == '2')
    {
    this.currentState = 'AssistantAdministrator';
    welcomeLabel.text ='Welcome, you are currently logged in as + currentUser.fullname + '!';
    }
    Else if (currentUser.roles == '1')
    {
    this.currentState = 'SeniorAdministrator';
    welcomeLabel.text ='Welcome, you are currently logged in as + currentUser.fullname + '!';
    }
    on the other
    {
    currentUser.roles == "6";
    this.currentState = 'Visitor';
    welcomeLabel.text = 'Welcome, you are currently logged in as visitor!';
    }
    }
    on the other
    {
    If unsuccessful login
    Alert.Show ("unsuccessful Login", "Server authentication");
    }
    }

    Michael_ramirez44 thanks for your help!

    John

  • How to change name (label) text dynamically in oracle forms

    My requirement is, I want to change the name of text dynamically in the form of oracle. How can do us?  (Not the label of the button (or) box... Looking for a title of text element...)

    Dear Sir

    You cannot change the properties of TEXT elements. Instead, you can use the TEXT_ITEM guests to display the legend.

    Manu.

  • Add text in Photoshop Elements 14

    I add a text layer and can not add text to an image. The file may be a photoshop, JPEG or PNG file? When I try to add text, I see the point in the cursor and there is no text if displayed, after that I typed in.

    bobs79082437 wrote:

    I add a text layer and can not add text to an image. The file may be a photoshop, JPEG or PNG file? When I try to add text, I see the point in the cursor and there is no text if displayed, after that I typed in.

    Pt font size may be too small for the resolution of the image file.

    You are not limited to the default size in the drop-down list in the text tool options bar.

    Highlight the value on the display and then type in a lot - try 110 or 140 - and see if it shows up. The text should be on a separate layer.

  • Is there an easy way to add text to a chain control / indicator and keep the colors

    Hello

    Bassically I want to add text to a chain control / indicator without losing the formatting of the previous text.

    For a part of a program that I create, data will be transmitted to and from a serial device. I want to display this data in a chain control / indicator and change the color of the text of certain strings depending on data type (sent, received). Basically as a nice log window.

    At the moment, I update the chain control / indicator by reading the text and concatenated with the new string. However, this method removes the colors of previous text :-(

    Is it possible to add data to the control of the chain / indicator without losing the text previous formatting?

    I started to create a sub vi who reads a text both character and adds a new element in an array (offset color and text), if the color is distinguished by the previous character. Only problem is it seems to be quite time CPU.

    Thanks in advance,

    Matt

    MattB-5906 wrote:

    Is it possible to add data to the control of the chain / indicator without losing the text previous formatting?

    Actually, no. This means that you will have to use workarounds. Your workaround solution seems a bit involved. Basically, all you need to do is just to keep track of the pairs of end start/selection selection that must be colored in a table. Then just you loop in this table to color the text marked by the power positions.

    An alternative is to use a different indicator. Rather than an indicator of the string, you can use a table with a column. You can then set the foreground color on a cell by cell basis, and add a new line (row) will not affect the coloration of the previous lines.

Maybe you are looking for

  • No DVD drive after upgrade the hard drive on Satellite Pro A100

    Shortly after upgrading my hard drive, optical drive has stopped working, now is no longer appear in 'My computer' or Linux. Device Manager says:"Windows cannot load the driver for this hardware device. The driver may be corrupted or missing. (Code 3

  • How to hide the window "current calls.

    Whenever I reduce Skype, I have this next window and cannot be removed. How can I remove it? [Sorry guys. No screeenshot. I cannot download to my computer, can't paste a link of Dropbox, or cloud - he still directs to a web page that is broken, even

  • EliteBook 6930p: Elitebook 6930p - after Win10 32-bit update, no Audiodevice = &gt; No Audio data

    Hi all After a nice update Windows 10 without precheck errors, I received a message that the driver SoundMax have reinstalled. Now, I've discovered that SoundMax appears to be out of business and there is no drivers Win10... Next problem, I can't fin

  • Connection to server lost El Capitan from one day to the next, every night

    This has only started happening since I upgraded to El Capitan. Every morning when I come into work the server has disconnected from my iMac. As soon as I click on one of the folders in my sidebar but it will connect to the server again. I was wonder

  • size of 2010SP1 TEN

    Hello NO,. I downloaded the SP1 for the CVI 2010 runtime (135 MB... for the RTE only!) and was appalled by the size of the files: rebuild my latest project has increased the size of the redistributable files from 14.7 MB to 27.8 MB, i.e. it nearly do