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

  • SEARCH
  • Home
  • 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 8518959
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T06:07:10+00:00 2026-06-11T06:07:10+00:00

I developed an Rss Application for Blackberry(java) and i successfully displayed Titles(List of Radio

  • 0

I developed an Rss Application for Blackberry(java) and i successfully displayed Titles(List of Radio Channels need to play online)from Rss File.i already developed code for playing those List of Radio channels,but my requirement is to play First channel(First List)when my List initially(List of Channels) displayed,can any one help me where can i write my logic(Playing first channel by default) to get execute after my channels displayed immediately?

Here my code for Rss:

public class RssScreen extends MainScreen implements ListFieldCallback,FieldChangeListener {
    Connection _connectionthread;     
    private static ListField _list;
    String image;
    String title;
    private static Vector listElements = new Vector();
    private static Vector listImage = new Vector();

    public long mycolor ;
    VerticalFieldManager mainManager;
    VerticalFieldManager subManager;
    int selectedList;
    Radio radio;

    public RssScreen(){
        final Bitmap backgroundBitmap = Bitmap.getBitmapResource("blackbackground.png");

         mainManager = new VerticalFieldManager(Manager.NO_VERTICAL_SCROLL | Manager.NO_VERTICAL_SCROLLBAR )
            {

             public void paint(Graphics graphics)
              {
                graphics.drawBitmap(0, 0, Display.getWidth(),Display.getHeight(),backgroundBitmap, 0, 0);

                super.paint(graphics);
              }

            };

            subManager = new VerticalFieldManager(Manager.VERTICAL_SCROLL | Manager.VERTICAL_SCROLLBAR )
            {
                protected void sublayout( int maxWidth, int maxHeight )
                {
                    int displayWidth = Display.getWidth();
                    int displayHeight = Display.getHeight();

                    super.sublayout( displayWidth, displayHeight);
                    setExtent( displayWidth, displayHeight);
                }
            };        


        add(mainManager);


        _list = new ListField()

        {
            protected boolean navigationClick(int status, int time)
            {
                            return true;
            }
        public void paint(Graphics graphics)

        {
            graphics.setColor((int) mycolor);
        super.paint(graphics);

        }

        };
        mycolor = 0x00FFFFFF;
            _list.invalidate();
            _list.setEmptyString("* Feeds Not Available *", DrawStyle.HCENTER);
        _list.setRowHeight(50);

        _list.setCallback(this);
        mainManager.add(subManager);    
       listElements.removeAllElements();
       _connectionthread = new Connection(); 
       _connectionthread.start();
     }

    private class Connection extends Thread
    { 
        public Connection()
        { 
           super(); 
        } 

        public void run() {  
            Document doc;  
            StreamConnection conn = null; 
            InputStream is = null;  
            try {           

                conn = (StreamConnection) Connector.open("http://toucheradio.com/toneradio/android/toriLite/toriplaylist.xml"+";deviceside=true");          

                DocumentBuilderFactory docBuilderFactory = DocumentBuilderFactory.newInstance();  
                docBuilderFactory.setIgnoringElementContentWhitespace(true);
                docBuilderFactory.setCoalescing(true);
                DocumentBuilder docBuilder = docBuilderFactory.newDocumentBuilder();    
                docBuilder.isValidating();      
                is = conn.openInputStream();    
                doc = docBuilder.parse(is);     
                doc.getDocumentElement().normalize();   
                NodeList listImg = doc.getElementsByTagName("title"); 
                for (int i = 0; i < listImg.getLength(); i++) {    
                Node textNode = listImg.item(i).getFirstChild();  
                listElements.addElement(textNode.getNodeValue());
                 image=textNode.getNodeValue();             
                }
                NodeList list = doc.getElementsByTagName("image"); 
                    for (int a = 0; a < list.getLength(); a++) {    
                    Node textNode1 = list.item(a).getFirstChild();  
                    listImage.addElement(textNode1.getNodeValue());
                                        }





            }
                     catch (Exception e) {   
                        System.out.println(e.toString());                     
                        } finally {   
                            if (is != null) {  
                            try { is.close(); 
                            } catch (IOException ignored) {}   
                            }        if (conn != null) {  
                                try { conn.close(); } 
                                catch (IOException ignored) {} 
                                }    } UiApplication.getUiApplication().invokeLater(new Runnable() { 
                                    public void run() {         
                                    _list.setSize(listElements.size()); 

                                    subManager.add(_list);

                                    invalidate();
                                    }   
                                    });
                                }

    }


    public void drawListRow(ListField list, Graphics g, int index, int y, int w) 
    {  
     String title=(String)listElements.elementAt(index);
     String image=(String)listImage.elementAt(index);
    // Bitmap image1= getBitmapFromUrl(image);


     System.out.println("Title"+title);
     System.out.println("Image"+image);
        int yPos = 0+y;
        g.drawLine(0, yPos, w, yPos);

        g.drawText(title, 0, y, 0, w);
       // g.drawBitmap(0,y,image1.getWidth(),image1.getHeight(),image1,0,0);

    }


    public Object get(ListField list, int index) 
    {
        return listElements.elementAt(index); 
    } 
    public int indexOfList(ListField list, String prefix, int string) 
    { 
        return listElements.indexOf(prefix, string); 
    } 
    public int getPreferredWidth(ListField list) 
    { 
     return Display.getWidth(); 
    } 
    public void insert(String toInsert, int index) {
        listElements.addElement(toInsert);
        }

    public void fieldChanged(Field field, int context) {




    }

    }
  • 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-06-11T06:07:11+00:00Added an answer on June 11, 2026 at 6:07 am

    Check following methods of the class Field:

    • protected void onDisplay()
    • protected void onExposed()

    Also similar methods from Screen can be used. Check the followings:

    • protected void onUiEngineAttached(boolean attached)
    • protected void onExposed()
    • protected void onDisplay()
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I already developed Rss feed reader application in j2me java using kxmlParser, for one
I developed a command-line utility which needs to be called from a Java GUI
I have developed an Andriod RSS reader app.I have used custom listview to list
i developed news site and am trying to read rss from another site i
I need to develop a desktop application that shows the contents of RSS feeds
Developed a Windows application that remotely accesses an SQL Server online. However, the client's
I developed an RSS feed following a tutorial and I think the .xml file
I developed an Android application and published it in the Market. Now I want
I developed a webapplication,Now i want to create Rss feeds for my website. In
I developed IOS 5 application using game center. Now I want my code to

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.