Java Blackberry ListField

I developed an Rss Application for Blackberry (java) and I've posted titles successfully (list of Radio stations must play online) from code Rss File.i already developed to play these list of Radio channels, but my requirement is to play the first channel (the first list) when my list initially displayed (list of strings) , can someone help me where I can write my logic (the first string of default playback) to run after my displayed immediately channels?

Here my code for Rss:

SerializableAttribute public class RssScreen extends ListFieldCallback implements screen, FieldChangeListener {}
Connection _connectionthread;
private static ListField _list;
Image of the chain;
String title;
private static Vector listElements is new Vector();.
private static Vector listImage is new Vector();.

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

public RssScreen() {}
final Bitmap Imagearriereplan = 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 (), Imagearriereplan, 0, 0);

Super.Paint (Graphics);
}

};

subManager = new VerticalFieldManager(Manager.VERTICAL_SCROLL |) Manager.VERTICAL_SCROLLBAR)
{
protected void sublayout (int maxWidth, maxHeight int)
{
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)
{
Returns true;
}
public void paint (Graphics graphics)

{
graphics.setColor ((int) mycolor);
Super.Paint (Graphics);

}

};
myColor = 0x00FFFFFF;
_list. Invalidate();
_list.setEmptyString ("* only supplies not available *", DrawStyle.HCENTER "");
_list.setRowHeight (50);

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

private class login extends thread
{
Public connection()
{
Super();
}

public void run() {}
Doc document;
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 node = listImg.item (i) .getFirstChild ();
listElements.addElement (textNode.getNodeValue ());
image = textNode.getNodeValue ();
}
List of NodeList = doc.getElementsByTagName ("image");
for (int a = 0;< list.getlength();="" a++)="">
Node textNode1 = list.item (a) .getFirstChild ();
listImage.addElement (textNode1.getNodeValue ());
}

}
catch (Exception e) {}
System.out.println (try ());
} {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 (list ListField, Graphics g, int index, int y, int w)
{
String title = (String) listElements.elementAt (index);
Image = (String) listImage.elementAt (index) string.
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, image1.getWidth (), image1.getHeight (), image1, 0, 0);

}

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

' Public Sub fieldChanged (field field, int context) {}

}

}

you view the list for help
subManager.add (_list);
After this line, you can call play (listElements.elementAt (0)).

Tags: BlackBerry Developers

Similar Questions

  • I want to change the blackberry listfield deafault accent color

    Hello

    I want to change the accent color of blackberry deafault (blue) of listfield, here is the code sample, code works fine, I want just to customize the color of the focus of the list... Please suggest me...

    package Meidcare;

    to import java.util.Enumeration;
    import java.util.Vector;

    Import net.rim.device.api.collection.util.SortedReadableList;
    Import net.rim.device.api.system.Bitmap;
    Import net.rim.device.api.system.Display;
    Import net.rim.device.api.ui.Color;
    Import net.rim.device.api.ui.DrawStyle;
    Import net.rim.device.api.ui.Graphics;
    Import net.rim.device.api.ui.component.KeywordFilterField;
    Import net.rim.device.api.ui.component.KeywordProvider;
    Import net.rim.device.api.ui.component.ListField;
    Import net.rim.device.api.ui.component.ListFieldCallback;
    Import net.rim.device.api.ui.container.MainScreen;
    Import net.rim.device.api.ui.decor.BackgroundFactory;
    Import net.rim.device.api.util.Comparator;
    Import net.rim.device.api.util.StringUtilities;

    class SearchFieldDemoScreen extends screen
    {
    Vector drugs_list = new Vector();
    Image bitmap buttonleft, buttonright;
    CountryList _countryList;
    KeywordFilterField _keywordFilterField;
    int mHColor = - 1;

    public SearchFieldDemoScreen (vector drugs_list) {}
    This.drugs_list = drugs_list;
    this.getMainManager () .setBackground (BackgroundFactory.createSolidBackground (0xC2C2C2));

    buttonLeft = bitmap.getBitmapResource ("medical_pills.png");
    buttonRight = bitmap.getBitmapResource ("white_aero.png");

    _countryList = new CountryList();
    _keywordFilterField = new KeywordFilterField();

    Enumeration XmlDiffOperation = drugs_list.elements ();
    While (enumumeration.hasMoreElements ()) {}
    _countryList.addElement (new Country (enumumeration.nextElement (m:System.NET.SocketAddress.ToString (())));

    }

    try {}
    setTitle (_keywordFilterField.getKeywordField ());

    _keywordFilterField.setLabel("Find:");
    _keywordFilterField.setSourceList (_countryList, new Country.MyProvider ());
    _keywordFilterField.setCallback (new MyListFieldCallback());

    _keywordFilterField.SetFocus ();

    Add (_keywordFilterField);

    }
    catch (Exception e) {}
    System.out.println ("Exception in keyword filter field =" + e);
    }
    }

    class MyListFieldCallback implements {ListFieldCallback}

    {public drawListRow Sub (ListField listField, Graphics g, int index, int y, int width)}
    Object obj = ((KeywordFilterField) listField) .getElementAt (index);
    g.setColor (Color.BLACK);

    If (obj! = null & obj instanceof country) {}
    Point country = (country) obj;
    g.drawText (item.toString (), 20, y, DrawStyle.ELLIPSIS |) DrawStyle.HCENTER);
    g.drawLine (0, y-9, width, y-9);
    g.setColor (Color.WHITE);
    g.fillRect (0, y-9, width, 3); for 3-pixel thick seprater "line".
    g.setColor (Color.BLACK);

    } else if(index == 0) {}
    g.drawText ("* void *", 0, y);
    }

    }

    protected void drawFocus (Graphics graphics, boolean on) {}
    graphics.setColor (Color.RED);
    Paint (Graphics);
    }

    public Object get (ListField list, int index) {}
    Return drugs_list.elementAt (index);
    }

    public int getPreferredWidth (ListField list) {}
    Return Display.getWidth ();
    }

    public int indexOfList (String prefix, int start, ListField list) {}
    return 0;
    }
    }

    class CountryList extends SortedReadableList
    {
    Vector drugs_list = new Vector();

    public CountryList()
    {
    Super (new Country.CountryListComparator ());
    }

    Sub addElement (Object item)
    {
    try {}
    System.out.println ("Ankur");
    SearchFieldDemoScreen.ls2 = new ListStyleButtonSet();
    ((Field)) SearchFieldDemoScreen.ls2.add element;
    doAdd (element);
    }
    catch (Exception e) {}
    System.out.println ("Exception in Add item =" + e);
    }
    }

    }
    }

    class country
    {
    private String _countryName;

    public country (String countryName)
    {
    _countryName = countryName;
    }

    public String ToString)
    {
    Return _countryName;
    }

    public static class MyProvider implements {KeywordProvider}
    public String [] getKeywords (Object obj) {}
    Point country = (country) obj;
    return new String [] {item._countryName};
    System.out.println ("called MyProvider");
    Return StringUtilities.stringToWords (obj.toString ());
    }
    }

    public static class CountryListComparator implements comparator
    {
    public int compare (Object o1, object o2)
    {
    System.out.println ("CountryListComparator called in method compares");
    If (o1 == null | o2 == null)
    throw new IllegalArgumentException ("can't compare countries null");
    Return o1.toString () .compareTo (o2.toString ());
    }
    }
    }

    Thanks in advance...

    Oky I solved the problem...

    using the...

    {if (g.isDrawingStyleSet (Graphics.DRAWSTYLE_FOCUS))}

    change the accent color
    g.setBackgroundColor (0xDCDCDC);
    g.Clear ();
    draw text
    g.setFont (Resize.getSecondFont ());
    g.setColor (Color.BLACK);
    g.drawText (item.toString (), 20, y, DrawStyle.ELLIPSIS |) DrawStyle.HCENTER);
    }

    inside the drawListRow...

    Thank you all...

    ----------------------------------------------

    Press on as if you like it...

  • How to wear my java blackberry application to BB10

    Can someone please tell me how I can do?

    I have builf this from windows eclipse BB pluginh

    All the tools used? and no matter what other coding more?

    Thank you

    Java applications not supported for Blackberry 10, you must start with qt c ++ and Qml. see this link for abt blackberry 10 of info and tools:
    https://developer.BlackBerry.com/Cascades/documentation/Getting_started/setting_up.html
    https://developer.BlackBerry.com/native/documentation/BB10/Getting_started.html

  • Java blackBerry Slider Bar

    HII, I created a scroll bar by referring to the example:https://github.com/blackberry/Samples-for-Java/blob/master/Advanced%20UI/src/com/samples/toolkit/ui/...,.

    hereby I am slider properly displayed on my screen, but my problem is next to the slider bar, I want to show a play/pause button, so i used the code below:

    SerializableAttribute public class UIExampleSliderScreen extends UIExampleScreen {}
    private ButtonField _startPlayingButton;
    Private ButtonField stop;

    private ButtonField facebookButton;

    public UIExampleSliderScreen() {}
    Super (0);
    _startPlayingButton = new ButtonField ("Play");
    stop = new ButtonField ("Stop");

    facebookButton = new ButtonField ("Facebook");
    facebookButton.setMargin (5, 5, 5, 5);
    HorizontalFieldManager Manager = new HorizontalFieldManager();

    setTitle ("cursor screen");
    final SliderField cursor;
    cursor = new SliderField)
    Bitmap.getBitmapResource ("slider2_thumb_normal.png"),
    Bitmap.getBitmapResource ("slider2_progress_normal.png"),
    Bitmap.getBitmapResource ("slider2_base_normal.png"),
    Bitmap.getBitmapResource ("slider2_thumb_focused.png"),
    Bitmap.getBitmapResource ("slider2_progress_focused.png"),
    Bitmap.getBitmapResource ("slider2_base_focused.png"), 20,
    0, 16, 16, FOCUSABLE).
    slider.setPadding (20, 20, 20, 20);

    slider.setBackground (BackgroundFactory
    .createSolidBackground (0xD3D3D3));

    Manager.Add (Slider);

    Manager.Add (facebookButton);

    Manager.Add (_startPlayingButton);
    Manager.Add (Stop);
    Add (Manager);

    }

    }
    }

    (1) I am able to show only the slide bar, my custom buttons are not displayed?

    (2) the sliding bar is displayed on screen, fully, how can I reduce the length of my slide Bar?

    the field of cursor seems to be designed to occupy the entire width:
    public int getPreferredWidth()
    {
    Return Integer.MAX_VALUE;
    }

    you have to change this, or replace available to the Manager.
    See
    http://supportforums.BlackBerry.com/T5/Java-development/how-to-extend-Manager/Ta-p/446749

  • tutorial open gl for developer java blackberry

    I want a java opengl for blackberry developer tutorial... Please help me...

    I want to create a game then I want the bigenner high-level tutorial...

  • We can apply in-app with app purchase java blackberry

    Hello

    I want a suggestion that we can apply in-app with blackberry java application purchase. iPhone allows in-app purchase.

    Currently, there no API built to handle this.  However, it is something that is to come this year.

    See this press release for more information on the upcoming BlackBerry payment Service.

    http://press.rim.com/release.jsp?id=2710

  • Need help breaking into Java/BlackBerry development / this sample project

    I have a ton of experience OO, but I am new to Java and I am trying to enter development for BlackBerry, and my first problem is being stuck with this defective sample app that comes w/Eclipse or JDE or something (they call it "CityInfo"). When I run the Simulator, I see the drop-down list box, but by selecting its members does nothing, and I don't know enough about the environment/language to understand why.

    I installed all the packages that are free. They are Eclipse (I can't find a version number), JDE, the Java plugin for Eclipse and the BlackBerry JDE 4.3 to 4.7 components Packages.

    And when this has been resolved, perhaps someone can show me a good set of sample applications with tutorials. I'm trying to follow http://supportforums.blackberry.com/rim/attachments/rim/java_dev@tkb/9/1/Writing_Your_First_Applicat... but it's not compatible w / the environment that I run.

    Here is the code for the project CityInfo:

    package com.mycompany;

    Net.rim.device.api.ui import. *;
    Net.rim.device.api.ui.component import. *;
    Net.rim.device.api.ui.container import. *;
    Net.rim.device.api.system import. *;
    Net.rim.device.api.i18n import. *;

    Import net.rim.device.api.ui.UiApplication;

    SerializableAttribute public class CityInfo extends UiApplication {}

    public CityInfo() {}
    pushScreen (new CityInfoScreen());
    }

    /**
    @param args
    */
    Public Shared Sub main (String [] args) {}
    CityInfo PAP = new CityInfo();
    theApp.enterEventDispatcher ();
    }

    }

    final CityInfoScreen class extends form {}
    Private InfoScreen _infoScreen;
    Private ObjectChoiceField choiceField;
    private int select;

    public CityInfoScreen() {}
    Super();
    LabelField title = new LabelField ("town Information Kiosk", LabelField.ELLIPSIS)
    | LabelField.USE_ALL_WIDTH);
    setTitle (title);

    Add (new RichTextField ("cities"));

    Choice of String() = {"Montreal", "Waterloo", "Ottawa"};
    choiceField = new ObjectChoiceField ("select a city", choice).
    Add (choiceField);
    }

    public boolean onClose() {}
    Dialog.Alert ("Goodbye!");
    System.Exit (0);
    Returns true;
    }

    _viewItem private MenuItem = new MenuItem ("other info", 110, 10) {}
    public void run() {}

    Store the index for the city that selects a BlackBerry device user

    Select = choiceField.getSelectedIndex ();

    Create an instance of the screen that displays information about the city that
    the BlackBerry device user selects

    _infoScreen = new InfoScreen();
    UiApplication.getUiApplication () .pushScreen (_infoScreen);
    }

    };
    private MenuItem _closeItem = new MenuItem {("close", 200000, 10)
    public void run() {}
    onClose();
    }
    };

    protected void makeMenu (menu Menu, for example int) {}
    menu. Add (_viewItem);
    menu. Add (_closeItem);
    }

    private class InfoScreen extends form {}
    public InfoScreen() {}
    Super();
    LabelField lf = new LabelField();
    BasicEditField popField = new BasicEditField ("Population:", null, 20, Field.READONLY);
    BasicEditField stateField = new BasicEditField ("Province:", null, 20, Field.READONLY);
    BasicEditField sightsField = new BasicEditField ("sites:", null, 50, Field.READONLY);

    Add (LF);
    Add (new SeparatorField());
    Add (popField);
    Add (stateField);
    Add (sightsField);

    If (select == 0) {}
    lf.setText ("Ottawa");
    popField.setText ("3,694,820");
    stateField.setText ("Ontario");
    sightsField.setText ("Parliament");

    } ElseIf (select == 1) {}
    lf.setText ("Waterloo");
    popField.setText ("2,896,016");
    stateField.setText ("Ontario");
    sightsField.setText ("University of Waterloo");
    } ElseIf (select == 2) {}
    lf.setText ("Montreal");
    popField.setText ("8,008,278");
    stateField.setText ("Quebec");
    sightsField.setText ("Saint - Joseph Oratory");
    }
    }
    }
    };

    Hi and welcome to our forum!

    1. When you select item in your ObjectChoiceField nothing happens in terms of user interface. You must press menu and select "Details". Try it!
    2. Check out this http://docs.blackberry.com/en/developers/?userType=21
  • java Blackberry multimedia is distorted when download resumes

    Hello, I'm developing a blackberry app and I'M having a problem while recovery of a download. The code works well if the download is not interrupted, but if it is interrupted and the download is restarted, the media file is distorted.

    To allow the resumption of the download, I request the file into segments from the server and persist the last piece of downloaded/written correctly. So if I have to restart the download, I check the last song downloaded and written, increment and to determine the scale at the request of the server.
    My code is listed below... :

        public final class Downloader extends Thread {
    
          private String remoteName;
          private String localName;
          private String parentDir;
          private String dirName;
          public String fileName;
    
          private int chunkSize = 512000;
          public boolean completed = false;
          public boolean failed = false;
    
          public CacheObject cacheObject = null
    
          public Downloader(String remoteName, String localName, String musicTitle, String parentDir, String dirName) {
    
              this.remoteName = remoteName;
              this.parentDir = parentDir;
              this.dirName = dirName;
              this.localName = localName;
              this.secureDownload = false;
              this.musicTitle = musicTitle;
    
              this.cacheObject = CachedObject.getInstance().findCachedObject(musicTitle);
    
              if (this.cacheObject == null) // create new object
                  this.cacheObject = new CachedObject(musicTitle, remoteName);
    
              this.thisObj = this;
            }
    
            public void run() {
                downloadFile(localName);
            }
    
            public void downloadFile(String fileName) {
                try {
                    int chunkIndex = 0; int totalSize = 0;
    
                    String tempFileName = "file:///" + FileConnect.getInstance().FILE_ROOT+parentDir+ FileConnect.getInstance().FILE_SEPARATOR;
    
                    if (!FileConnect.getInstance().fileExists(tempFileName))
                        FileConnect.getInstance().createDirectory(parentDir);
    
                    if (dirName != null) {
                        tempFileName = "file:///" + FileConnect.getInstance().FILE_ROOT+ parentDir + "/" + dirName + FileConnect.getInstance().FILE_SEPARATOR;
    
                        if (!FileConnect.getInstance().fileExists(tempFileName))
                           FileConnect.getInstance().createDirectory(parentDir + "/" + dirName);
                    }
    
                    fileName = tempFileName + fileName;
                    this.fileName = fileName;
    
                    file = (FileConnection) Connector.open(fileName, Connector.READ_WRITE);
    
                    if (!file.exists()) {
                       file.create();
                    }
    
                    if(cacheObject.file_path.length() < 1)
                        cacheObject.file_path = fileName;
    
                    file.setWritable(true);
    
                    // Trying to check the file size.
                    long fSize = (int)file.fileSize();
    
                    // If it is greater than 1 byte, then we open an output stream at the end of the file
                    if(fSize > 1){
                        out = file.openOutputStream((fSize+1));
                    }
                    else{
                      out = file.openOutputStream();
                    }
    
                    int rangeStart = 0; int rangeEnd = 0;
    
                   // Want to know the total fileSize on server (used for updating the UI..
                    HttpConnection conn2;
                    conn2 = (HttpConnection) Util.getHttpConnection(remoteName);
                    String totalFileSize = "" + conn2.getLength();
                    conn2.close();
    
                   //Number of chunks
                   int numChunks = (int) Math.ceil( Integer.parseInt(totalFileSize) / chunkSize);
                   cacheObject.chunk_size = numChunks;
    
                   // Set the total file size..
                   content_length = Integer.parseInt(totalFileSize);
                   fileSize = 0;
                   String url = remoteName + HttpRequestDispatcher.getConnectionString();
    
                   if(cacheObject.last_successfully_downloaded_chunk > -1){
                      //This is a resume..
                      if( (cacheObject.last_successfully_downloaded_chunk + 1) < numChunks ){
                          chunkIndex = cacheObject.last_successfully_downloaded_chunk + 1;
    
                          fileSize = cacheObject.curr_download_size;
                      }
                   }    
    
                  while (file != null) {
                      try{
                          conn = (HttpConnection)Connector.open(url);
    
                          if(chunkIndex < (numChunks-2)){
                              rangeStart = chunkIndex * chunkSize; rangeEnd = rangeStart + chunkSize - 1;
                          }
                          else{
                              rangeStart = chunkIndex * chunkSize;
                              int remainingBytes = Integer.parseInt(totalFileSize) - rangeStart; rangeEnd = rangeStart + (remainingBytes - 1);
                          }
    
                          conn.setRequestProperty("User-Agent", "Profile/MIDP-2.0 Configuration/CLDC-1.0");
                          conn.setRequestProperty("Connection", "keep-alive");
    
                          conn.setRequestProperty("Range", "bytes=" + rangeStart + "-" + rangeEnd);
                          responseCode = conn.getResponseCode();                
    
                          if (responseCode != 200 && responseCode != 206) {
                             out.flush(); out.close(); file.close(); in.close(); conn.close();
                             in = null; conn = null; file = null; out = null;
                             Thread.yield(); break;
                          }
                          else{
    
                             in = conn.openInputStream(); int length = -1;
                             byte[] readBlock = new byte[256];
    
                             while ((length = in.read(readBlock)) != -1) {
                                 out.write(readBlock, 0, length);
                                 fileSize += length;
                                 cacheObject.curr_download_size = fileSize;
                             }
    
                             totalSize += fileSize;
    
                             in.close(); conn.close(); in = null; conn = null;
    
                              // Update after the byte read..
                              cacheMusicbox.last_successfully_downloaded_chunk = chunkIndex;
                              CachedObject.getInstance().saveCachedObject( cacheObject);
    
                              System.out.println("Last successful chunk downloaded: " + cacheObject.last_successfully_downloaded_chunk);
    
                              chunkIndex++;
                              if(chunkIndex == numChunks){
                                  out.flush(); out.close();  file.close(); break;
                              }
    
                              Thread.yield();
                          }
                      }
                      // Network error related
                      catch(Exception e){
                         System.out.println("Download failed. Some kind of error - " + e.getMessage());
                         System.out.println("fileSize b4 closed: ." + file.fileSize());
                         System.out.println("Last successful chunk downloaded: " + cacheMusicbox.last_successfully_downloaded_chunk);
    
                          if (out != null) {
                              out.flush(); out.close();
                              System.out.println("We just closed the outputStream");
                              System.out.println("fileSize when closed: ." + file.fileSize());
                          }
                          if (file != null && file.exists()) {
                              if (file.isOpen()) {
                                  file.close();
                              }
                          }
    
                          in = null; conn = null; file = null; out = null;
                          failed = true;
                          System.out.println("Ensuring this block is called " + cacheObject.last_successfully_downloaded_chunk);
    
                          break;
                      }
                  }
    
                  System.out.println("Full file downloaded: " + totalSize + " Bytes");
                  System.out.println("Wrote file to local storage");
                  Thread.sleep(3000);
    
                  if(!failed)
                      completed = true;
    
               }
               // any other error...
               catch (Exception e) {
                  System.out.println(e.getMessage());
    
                  try{
                      out.flush(); out.close(); file.close();
                      in = null; conn = null;   file = null; out = null;
                  }
                  catch(Exception ee){
                      System.out.println("While closing catch that belongs to the top guy: " + ee.getMessage());
                  }
                  failed = true;
                }
            }
    
        }
    

    I don't know where I am doing wrong. Help, please

    Finally this sorted out. What had happened was if the link turns off and I close the output stream, the calculation is distorted.

    So the next time I want to continue with the download, I'll open a stream of output at the end of the file and start asking the file to the server from the file size, for example, if the file size is 500 kb (already downloaded b4 network connection went wrong) then I'll start asking to between 500 - (500 + chunkSize) until the end of the file

  • E-mail Info curve8310 using Java BlackBerry GPS

    Here is the code for blackberry GPS information sent to an e-mail address. The code uses sleep to send information at intervals.

    My problem is that when once that the GPS goes out of scope the application stops sending emails and no exception is thrown.

    If (lp! = null)

    {code}

    Sleep (65000);

    But it did not work for me.

    ////////

    public void run() {}
    While (! _stop) {}
    Address one;
    Store is Session.getDefaultInstance () .getStore ();.
    Records file [] = store.list (Folder.SENT);
    Folder sentfolder = files [0];
    Message m = new Message (sentfolder);
    SimpleDateFormat sdf;
                  
    try {}
    LP LocationProvider = LocationProvider.getInstance (null);
    If (lp! = null) {}
    Location = lp.getLocation (60);
    Coordinates of c = l.getQualifiedCoordinates (); get the GPS coordinates
                           
    If (c! = null) {}
    Lat string = Double.toString (c.getLatitude ()); Latitude
    LNG chain = Double.toString (c.getLongitude ()); Longitude
    String alt = Float.toString (c.getAltitude ()); altitude
    Tim string = Long.toString (l.getTimestamp ()); timestamp
    String spd = Float.toString (l.getSpeed ()); Speed
                               
    String orgstr = "0449953853", + tim + ',' + lat + ',' lng + ',' + ', ' + alt;
    String googmap =http://maps.google.com/maps?q= "+ lat + ',' + LNG;
    String finalstr = orgstr + "\n" + googmap;
    a = new address ("[email protected]", "Aditya Tuli";)
    Address address [] = {a};
    m.addRecipients (Message.RecipientType.TO, addresses);
    m.setContent (finalstr);
    m.setSubject ("GPS Position";)
    Transport.Send (m);
    }
    } sleep (65000); moved to re - run the thread
    } catch (Exception e) {}
    System.Err.println ("an error occurred" + try ());
    System.Exit (0);
    }
    }
    }

    ///////

    Please suggest.

    Thanks in advance.

    Concerning

    I think we have agreed that the problem is that it is there no LocationProvider or the getLocation is not a place, so to determine which of them seems to be the best place to start.  As you test on the device, you must debug on the device, you can connect by USB, starting the JDE, using the Debug/Attach To / Pocket PC, then select USB connected device.

    From there, you should be able to use the JDE debug, but according to levels, this sometimes does not work so well for me.  So I would like to add three statements of System.out.println (...), one at the beginning of the loop and the others inside each of the ' if.  This load on the device, then, once debugging started, simply wait for the missing output for each loop!

    Who help me?

  • How to develop the Rss reader for Blackberry java?

    HII,

    This is my first post in this forum, I'm new mobile app, can everyone, how to develop the Rss aggregator for java Blackberry?

    I've attached a zip file which would be useful for you, check it out it's a RSS reader coll, I used some of the techniques for my application, please mark as solution, thank you.

  • Reverse Engineering - BlackBerry extract cod files java files

    I want to know if we can extract the files .java Blackberry since the .cod files? Is this possible?

    In the affirmative. How and what are the steps?

    And if not? Why? Because that would mean the violation of the security of the device blackberry app?

    I can't give a definitive answer to this.
    It is / was a decompiler of cod, but I don't know anyone who used it successfully to decompile a complex program.
    I gave a few hours test and never managed.

    even if you would be able to decompile a program, you would be a good step away from stealing stuff, but if you are concerned you can use of darkening additional layers or whatever.

    personally, I doubt that everyone would gain something by using the approach of decompilation and my experience shows that some decompiler exists does not work properly.

  • where to get the guide in PDF for Blackberry Java Development

    Hi all

    I want to get any good guide PDf for blackberry Java development which five will be me good knowledge on the development of java blackberry.

    Thank you all

    http://docs.BlackBerry.com/en/developers/?usertype=21

    and

    http://docs.BlackBerry.com/en/developers/subcategories/?usertype=21&category=Java+development+guides...

  • QNX will replace the Blackberry OS?

    I have read a few forums, they said, QNX will replace Blackberry OS is this true?, then what the developer Java Blackberry supports, if new QNS will support legacy java blackberry applications

    Welcome to the support forums

    you will not be able to get an official statement from a RIM employee, I guess, they all NDAs.

    in regard to news on independent Web sites and rims clean news tell us it's going to be like this (my opinion):

    QNX will replace Blackberry OS

    BlackBerry Apps (j2me + bb-extensions) will continue to operate under the QNX in a clean VM

    Basically, this means that get us, as developers, the same thing that we now have a phone where our applications run and much more: Android support, native support, html5 etc pp.

    If the BB API will feature all, offer the best integration etc? We'll see, but my guess is that it is the most advanced in terms of integration (and the main objective of rims for things that cannot be solved with HTML5/Air)

  • XML application and blackberry

    Hello;

    IAM develop an application that manipulate an XML from java blackberry applications, I have a few textField and I want to add the container of these fields in a file xml as a new tags, and I want to change the doc added to likely he fields is added in the same texyField I'll Likely and save changes to the xml file I made somes codes but it's not working if there is no tutorial or the method that works in BB request can we just send it to me, I'm stuck at this step.

    Thank you very much for help

    Hello. This forum exists to disturb us, so don't be sorry!

    Skimming just your code, I think that the line:

    CFile = (FileConnection) Connector.open ("dat.xml", Connector.READ_WRITE, true);

    may be causing the exception. Connector.open method requires the first argument a string in the format:

    {schema of}: [{target}] [{parms}]

    where {} is the name of a Protocol and is required. Your argument, 'dat.xml', is not a plan. Since you are built on a FileConnection, the Protocol should be 'leader '. Also, the target must be an absolute path name. A typical target for a file that is stored in the memory of the unit would be:

    'file:///store/home/user/dat.xml '.

    To the SD card, a typical target would be:

    'file:///SDCard/BlackBerry/dat.xml '.

    You can determine the roots of system file using FileSystemRegistry.listRoots ().

  • Java sdk support

    Hello

    can someone tell me up to which version of the java sdk, we can use in blackberry.

    Java BlackBerry os is based on j2me, which is in turn based on java 1.4 (or 1.3?)
    in any case, you cannot use the api collections unless you implement it yourself.
    basically: use vector and hashtable.

Maybe you are looking for

  • Disable the iCloud sync iBooks books and PDF option

    I activated the iBooks to iCloud download so it would sync my books and PDF documents. Now, I can't find a way to turn it off!

  • Satellite 4090 on board the issue of RAM

    Hello.I have a S4090CDS/4.3 (PAS409EYV-EN9X, It would seem that the RAM is faulty (boots ok, as soon as you get 1/2 way through all the facilities you start getting memory errors type.).My question is, is the RAM on the main Board or on the processor

  • The F9 and F10 keys no longer work

    Today, I realized that the F9 and F10 keys did not work unless you press FN at the same time. If it's not a huge deal, it is a nuisance minor and if there is a simple difficulty then please tell me!

  • where to read how things work?

    I have a new HP G71 Notebook with Windows 7 Home Premium.  I can't find a source to give me simple answers about how things work. Example: I read the User Guide on how to remove a USB connection and he asks to go to the Notification area and click "s

  • SX80 - three entries PC

    Is it possible to have three entries on the SX80 PC without needing a controller of Crestron/emissions? If not, is there a video mixer, you can control the SX80 and the touch 10 Cisco? My goal is to have three video inputs without the need to add a C