problem using the FileConnection API (JSR 75) in an application for Blackberry "BOLD" MIDLET

Hello

I developed a MIDLET which is to read files and store the contents of files in arrays. I could make using the FileConnection API in J2ME (Java ME) and it works very well in mobile emulators provided by Sun, Sun Kit tool 2.5.1 wireless and Sprint Wireless tool 3.3.2 Kit. I have been using netbeans IDE 6.8 for this.

Now, here's the deal. Playback of the files does not work when in one of the Blackberry mobile emulators. I tried to install all versions of Blackberry JDE 4.2.1 to 5.0 and test the same thing, but none of them worked.  After reading that the Blackberry plugin for Eclipse is good, I used it to find that I am always faced with the problem.

I desperately need help. Can someone help me do the reading work file in a Blackberry emulator? I insert the code that makes the file reading. It reads a file containing a single column of 60 entries, and stores it in an array of double type.

Vector time = new Vector();

try{

 FileConnection filecon = (FileConnection) Connector.open("file:///" +"SDCard/BlackBerry/documents/"+"timescale.dat");

 if(!filecon.exists()) {    Dialog.show("Note ! ", "File doesn't exists !", "okay","cancel"); }

     StringBuffer sb = new StringBuffer();      try      {       InputStream in = filecon.openInputStream();       int chars;

       while ((chars = in.read()) != -1)// read until EOF is reached       {          if(chars == '\n') // read all characters until the end of line is reached          {              time.addElement(sb.toString().trim()); // stores all the characters as a vector element when the end of line is reached

              sb.delete(0,sb.length());// clear the stringbuffer for storing the next line of the file

          }

          else          {              sb.append((char)chars); // appends each character read          }

      }// end of while

    }    catch(IOException e)    {               }

    filecon.close();

}// end of outer try

   int i =0;   Enumeration etime = time.elements();

   while(etime.hasMoreElements() && i < 60) // timescale.dat has 60 entries in one column   {       time_1d[i]=Double.parseDouble(etime.nextElement().toString());// convert to double       i++;   }

Can you elaborate on what does not work?  Is an error or exception thrown?  If Yes, what is it and what line of code triggers it?

You have configured the BlackBerry smartphone Simulator to simulate a micro SD card?

Use a computer filesystem in the form of microSD card

http://supportforums.BlackBerry.com/T5/testing-and-deployment/use-a-computer-file-system-as-a-microS...

Tags: BlackBerry Developers

Similar Questions

  • Problem using the REST API by wavemaker

    Hello

    I have a problem using other api with wavemaker. When I do a query GET with the RESTClientin FireFox, everything is fine for example:

    get https://XXX.XXX.XXX.XXX:8281 / vco/api/result:

    1. Status Code: 200 OK
    2. Cache-Control: private
    3. Content-Type: application/xhtml+xml;charset=UTF-8
    4. Date: Sun, 06 Apr 2014 16:50:04 GMT
    5. Expires: Thu, 01 Jan 1970 00:00:00 UTC
    6. Server: Apache-Coyote/1.1
    7. Transfer-Encoding: chunked

    But when I try to connect to the same url using wavemaker I recive: the answer is not in a valid XML Format.

    I use Orchestrator 5.5 and far as I could see the token is no longer required in the header. Anyone know why I get this error message?

    Thank you!

    Well half a day looking, then finally I thought to it:

    The header should be: accept: application/xml

  • Installation problems using the .img download Microsoft Action Pack on DVD for Windows 2012 Server Standard x 64

    I tried to install Windows Server Standard edition 2012 x 64 who got burned on the delivery of download Microsoft Action Pack DVD.  Download of the ISO image is a file .img, site Web de Microsoft Action Pack.  I have downloaded several times and burned each image on a DVD.

    When I try to install Windows Server 2012, after that select install, I get a pop-up message indicating, "a media computer driver needs is missing."  It could be a driver DVD, USB or HDD.  If you have a CD, DVD or USB flash drive with the driver on this subject, please insert it now. »

    However, I don't know which driver it needs.  During my tests I initially wanted to install Windows Server 2012 on our VMware ESXi v5.1 environment, but got this error.  I then tried to install it on a physical server that I am able to install Windows Server 2008 x 64 and Windows 8 Pro on without no additional driver needed.  The system's hard drive is a standard IDE 120 GB drive and the DVD drive is an IDE drive as well.

    I called Microsoft Action Pack support and they wanted me to pay for support to get this resolved, which I do not think that I would have to evaluate the software at this point.  They guarantee me that the download available for Action Pack Subscription holders is the necessary "correct".img file.

    I also downloaded the eval FREE for Windows Server 2012 version, but not what I need for my tests.  This download version is a .iso file real vs file .img but won't install Windows Server 2012 Standard Evaluation (Server Core Installation), (with a GUI server) or data center evaluation edition.  This version will install, but isn't what I need and is very limited in functionality.

    Someone else has had problems like this with the Microsoft Action Pack Windows Server 2012 Standard multimedia software installation process and found a solution to this?

    THX.

    Hello

    The question you posted would be better suited in the TechNet Forums. I would recommend posting your query in the TechNet Forums:

    http://social.technet.Microsoft.com/forums/en-us/category/WindowsServer

  • How to use the 'sensors' api?

    Hi guys! I am a web-game developer but a beginner in developing blackberry applications.

    I intended to create a star atlas application and I've already finished most but failed to use the 'sensors' api.

    I referred to the example provided in the documentation of webworks 2.1 as below:

    function compassCallback(data) {
    document.write("Current azimuth:"+data.azimuth);
    }
    blackberry.sensors.setOptions("devicecompass", { delay: 1000 });
    document.addEventListener("devicecompass", compassCallback);
    

    and I added an element in the config.xml file:

    also, I added the plugin com.blackberry.sensors for the project.

    But I still can't azimuth compass...

    I really appreciate if someone could help me with this!

    I solved this problem by myself.

    The listener of the api should be placed in a "deviceready" event

  • Get the 500 error trying to create a table using the REST API

    Hello

    I tried to create a table using the REST API for Business Intelligence Cloud, but I got 500 Internal Server Error for a while now.

    Here are the details that I use to create a table.

    Capture.JPG

    and the json to create the schema that I use is

    [{'Nullable': [false], 'defaultValue': 'dataType' [null],: ['VARCHAR'], 'precision': [0], 'length': [18], 'columnName': ["ROWID"]}]

    , {'Nullable': [true], 'defaultValue': 'dataType' [null],: ['VARCHAR'], 'precision': [0], 'length': [18], 'columnName': ['RELATIONID']},

    {'Nullable': [true], 'defaultValue': 'dataType' [null],: ['VARCHAR'], 'precision': [0], 'length': [18], 'columnName': ['ID']}

    , {'Nullable': [true], 'defaultValue': 'dataType' [null],: ['TIMESTAMP'], 'precision': [0], 'length': [0], 'columnName': ['RESPONDEDDATE']},

    {'Nullable': [true], 'defaultValue': 'dataType' [null],: ['VARCHAR'], 'precision': [0], 'length': [255], 'columnName': ['RESPONSE']},

    {'Nullable': [false], 'defaultValue': 'dataType' [null],: ['TIMESTAMP'], 'precision': [0], 'length': [0], 'columnName': ['SYS_CREATEDDATE']},

    {'Nullable': [false], 'defaultValue': 'dataType' [null],: ['VARCHAR'], 'precision': [0], 'length': [18], 'columnName': ['SYS_CREATEDBYID']},

    {'Nullable': [false], 'defaultValue': 'dataType' [null],: ['TIMESTAMP'], 'precision': [0], 'length': [0], 'columnName': ['SYS_LASTMODIFIEDDATE']},

    {'Nullable': [false], 'defaultValue': 'dataType' [null],: ['VARCHAR'], 'precision': [0], 'length': [18], 'columnName': ['SYS_LASTMODIFIEDBYID']},

    {'Nullable': [false], 'defaultValue': 'dataType' [null],: ['TIMESTAMP'], 'precision': [0], 'length': [0], 'columnName': ['SYS_SYSTEMMODSTAMP']},

    {'Nullable': [false], 'defaultValue': 'dataType' [null],: ['VARCHAR'], 'precision': [0], 'length': [10], 'columnName': ['SYS_ISDELETED']},

    [{'Nullable': [true], 'defaultValue': 'dataType' [null],: ['VARCHAR'], 'precision': [0], 'length': [50], 'columnName': ['TYPE']}]

    I tried this using postman and code, but I always get the following response error:

    Error 500 - Internal server error

    Of RFC 2068 Hypertext Transfer Protocol - HTTP/1.1:

    10.5.1 500 internal Server Error

    The server encountered an unexpected condition which prevented him from meeting the demand.

    I am able to 'get' existing table schemas, delete the tables, but I'm not able to make put them and post operations. Can someone help me to identify the problem, if there is no fault in my approach.

    Thank you

    Romaric

    I managed to create a table successfully using the API - the only thing I see in your JSON which is different from mine is that you have square brackets around your values JSON where I have not. Here is my CURL request and extract my JSON file (named createtable.txt in the same directory as my CURL executable):

    curl u [email protected]: password UPDATED h x ' X-ID-TENANT-NAME: tenantname ' h ' Content-Type: application/json '-binary data @createtable.txt https://businessintell-tenantname.analytics.us2.oraclecloud.com/dataload/v1/tables/TABLE_TO_CREATE k

    [

    {

    'columnName': 'ID',

    'dataType': 'DECIMAL ',.

    'Length': 20,.

    "accuracy": 0.

    'Nullable': false

    },

    {

    'columnName': 'NAME',

    'dataType': 'VARCHAR ',.

    'Length': 20,.

    "accuracy": 0.

    'Nullable': true

    },

    {

    "columnName': 'STATUS."

    'dataType': 'VARCHAR ',.

    'Length': 20,.

    "accuracy": 0.

    'Nullable': true

    },

    {

    "columnName': 'CREATED_DATE."

    'dataType': 'TIMESTAMP '.

    'Length': 20,.

    "accuracy": 0.

    'Nullable': true

    },

    {

    'columnName': 'UPDATED_DATE ',.

    'dataType': 'TIMESTAMP '.

    'Length': 20,.

    "accuracy": 0.

    'Nullable': true

    }

    ]

  • Can I get the total number of records that meet the conditions of a query using the Table API?

    Hello

    A < row > TableIterator is returned when I ask operations using the index of tables. If I want to get the total number of records, I count one by one using the returned TableIterator < row >.


    Can I get the total number of records directly meets the conditions of the query?

    I can get the total number of records directly the request of the meeting of the conditions of CLI using the command Global table - name tableName - count - index index-name-field fieldName - start startValue-end endValue.

    Can I get the same results using the Table API?

    I used MongoDB and NoSQL Oracle for about a year. According to the experience of the use of these dbs, I think mongoDB querying interface is powerful. In the contras, the query interface is relatively simple, which results is a lot of work that is usually a long time in the client side.

    Hello

    Counting records in a database is a tricky thing.  Any system that gives you an accurate count of the records will have a hotspot of concurrency on updates, namely the place where the counting is maintained.  Such a count is a problem of performance in addition to competitive access problem.   The problem is even more difficult in a system widely distributed such a NoSQL database.

    The CLI has overall command that counts, but does so by brutal force - iterate keys that correspond to the parameters of the operation.  This is how you must do this within the API.  There is not a lot of code, but you have to write.  You certainly want to use TableIterator TableAPI.tableKeysIterator (), because a key iteration is significantly faster than the iteration of lines.  Just one iteration and count.

    If you use TableAPI.multiGet () and a key with a touch of brightness full then, in fact, count the results as they are returned in a single piece (a list).

    Kind regards

    George

  • Run the workflow using the SOAP API with PHP

    Hello

    I'm trying to integrate workflow from code PHP using the SOAP API to Orchestrator.

    <? PHP

    Try

    {

    $parameters = array (username = > "username", password = > "passwd");

    $client = new SoapClient ('https://vcoserver:8281 / vco/vmware-vmo-webcontrol/webservice?) WSDL "); "

    $result = $client-> getAllWorkflows ($parameters);

    foreach ($result as $item)

    {

    foreach ($item as $work)

    {

    echo $work-> name;

    echo "< br >".

    echo "id";

    echo $work-> id;

    echo "< br / > ';

    }

    }

    }

    catch (Exception $e)

    {

    echo $e;

    }

    ? >

    I do not see errors/exceptions, but don't see any output as well.

    Am I missing something?

    Could you use

    print curl_error($curl);
    

    After curl_exec to check if there are errors?

    If there is an error in SSL certificate, as ' SSL certificate problem: unable to get local issuer certificate ", you can either install certificates roots (Google it for more information how to do), or disable checking of certificates by peers in CURL with something like:"

    curl_setopt($curl, CURLOPT_SSL_VERIFYPEER, 0);
    
  • Cannot add firewall rules using the REST API vShield App

    Hi all

    I get the following error

    "< errors > < error > < code > 100039 < / code > < description > Unmatched rules found in the configuration." "< / description > < / error > < / errors >.

    When you use the App API vSheild:

    POST https:// /API/2.0/app/firewall/dvportgroup-55/config < vsm-ip >

    Paylod XML:

    <? XML version = "1.0" encoding = "UTF-8" standalone = "yes"? >
    < VshieldAppConfiguration >
    < firewallConfiguration = "dvportgroup-55" the contextId >
    < layer3FirewallRule disabled = "false" priority = "none" id = "1021" >
    < action > allow < / action >
    < connected > false < / connected >
    < source >
    < address >
    < ipAddress > 172.30.68.212 < / ipAddress >
    < / address >
    < > 222 portInfo < / portInfo >
    < / source >
    < destination >
    < address >
    < ipAddress > 172.30.68.166 < / ipAddress >
    < / address >
    < application >
    < > 333 portInfo < / portInfo >
    < Protocol > 6 < / Protocol >
    < / application >
    < / destination >
    < / layer3FirewallRule >
    < / firewallConfiguration >
    < / VshieldAppConfiguration >

    Is anyone has seen this before or any idea why this might be happening?

    In addition, create a wall of fire to provide the variable "id"... How do I know which id to use to create a new firewall rule. I'm using id = "1021" I see one last created after quesrying API... but when you call it through automation, what will the process to define an id invalid?

    Thank you

    xar

    ID must be present, for the new rule Id must be '0' while that for others it should kept as what. The reason for this error which I believe is the same. Replacement of 1021 with 0 should solve this problem. http://blogs.VMware.com/security/2011/11/using-the-VShield-API.html should also be useful to start with vShield firewall App REST API.

    -Kone

  • Question so that the migration of the VM using the vSphere API

    Hello

    I am having some problems during the migration of a virtual machine using vSphere SDK.

    I have install the vSphere environment as there are two hosts esxi installed on different physical machines with multiple virtual machines above them.

    Now I want to migrate one say the virtual macines VM1 fron host1 to host2. I did it via vCenter uses the vSphere client and it worked fine. Now, I have to perform the same task using the vSphere API. For this I use the template of "VMotion" located in the com/vmware/vm directory. I run the command as follows:

    targethost $ run.bat url username password, shows targetpool

    I'm not sure of the targetpool argument and I need advice on what I need to specify a name of pool of resources here. Acorrding to:

    http://www.VMware.com/support/developer/VC-SDK/visdk400pubs/ReferenceGuide/Vim.virtualmachine.html#migrate

    If the pool parameter remains disabled, current pool of the virtual machine is used as target the pool. I tried specifying the pool of resources such as:

    [- targetpool]

    but it gives the error:

    Error: List of resources target not found.

    Looking forward to all the advice. Thank you.

    Even if you do not have resource pools, it is actually a 'root' list of resources"which will be still exists. Try to specify 'Resources' as the name of the targetpool and allow you to migrate your VM.

  • Conditional binding fails with fracture from scratch using the fluent API

    I have two properties that I want to connect to a progress bar. Properties represent essentially a max value of County (the denominator) and current value of the Shire (numerator). I want to set up a connection using the fluent API that works roughly as follows:
    IntegerProperty numerator = new SimpleIntegerProperty(0);
    IntegerProperty denominator = new SimpleIntegerProperty(0);
    
    progressBar.progressProperty().bind(
        Bindings.when(denominator.isEqualTo(0))
            .then(0)
            .otherwise(numerator.divide(denominator)));
    The numerator and denominator properties represent two properties in my object that changes according to certain criteria in the application, and I want the progress bar to be bound by these changes. The problem is sometimes, and by default, the value of the denominator is 0. My logic tells me that the clause otherwise() does not run, because the when() condition must be true and so run the then() clause. When I run the above code, I get an ArithmeticException (/ by zero).

    Question - is this the correct behavior of the code underlying link? I don't understand why the otherwise() clause is being evaluated in this case.
    Can I suggest an improvement to short-circuit the logic to avoid such a situation?

    My solution is to create a custom as follows DoubleBinding:
    IntegerProperty numerator = new SimpleIntegerProperty(0);
    IntegerProperty denominator = new SimpleIntegerProperty(0);
    
    DoubleBinding db = new DoubleBinding() {
        { super.bind(numerator, denominator); }
     
        @Override
        protected double computeValue() {
            if(denominator.getValue() == 0) {
                return 0.0;
            }
            return numerator.doubleValue() / denominator.doubleValue();
        }
    };
            
    progressBar.progressProperty().bind(db);
    I would much rather the fluent API (much less code to write and much more elegant), but I'm glad that the custom binding is not too difficult to write and understand.

    Thanks for all comments or impressions.

    I have not tested, but for a workaround, you can try

    progressBar.progressProperty().bind(
        Bindings.when(denominator.isEqualTo(0))
            .then(0)
            .otherwise(numerator.divide(denominator.doubleValue())));
    

    This will force (should) the division must be calculated using double rather than the integers (ints); x / 0,0 will assess double. NaN in java, without throwing an exception. Note that this calculation will give slightly different results in other cases, such as the division of integers you used before will still result in an int (by truncation); considering that it will give a double precision division. In most cases, the latter will actually be what you want.

  • LAN address MAC using the windows API?

    I would like to read the MAC address of the LAN to my WIFI on my PC card.

    Apparently, this can be done using the Windows API

    Anyone tried something like this again?

    Thank you

    Hi morngoose,

    You can use the function "exec system" with "cmd/c" ipconfig/all "" "connected." Parse the string and you'll get your MAC address.

    Mike

  • Can I use the public APIs of BlackBerry for automation of the tests on the Simulator?

    Hello

    I'm developing a framework of automation with BlackBerry API public.

    Is it possible to test it against the custom application and 'Core BlackBerry Applications,' for example, mail, calendar...?

    With the help of API net.rim.device.api.ui.Keypad. * can manipulate the keyboard on a simulator, is that correct?

    Thank you!

    You can use the EventInjector API for input (keyboard, trackpad and touchscreen) events Simulator to interact with built-in applications.  It will work in the Simulator and the real device.

    If you are looking just to automate something in the Simulator, you can use the BlackBerry Simulator controller.  It is a command-line tool that enables script steps in the Simulator.  For more information look in the help on the BlackBerry smartphone Simulator menu.

  • How to send e-mails using the RIM api.

    Hi all

    My requriement, it's that I need to develop an application to send e-mail using only the RIM api. Please help me by sending an email using the RIM api. I use version 4.7.0.41 JDE

    Through this Developer's Guide, Section, 'Integrate Messages'.

    http://NA.BlackBerry.com/eng/deliverables/608/BlackBerry_Application_Developer_Guide_Volume_2.PDF

  • problems using the snap have amd, playback of Jpeg files

    Original title: I'm having problems using the component feature snap-in.

    Sometimes a single document disappears. When this happens while the document program is managed by then will not work. The document seems to be flying around the office. The last time this happened I had a doc JPEG upward and now I can't see what is JPEG. I don't know why the document wants to fly around, and I don't know how to get my use of the JPEG back.

    Hey Graham,.

    To view all jpeg images in the Viewer Windows photo or any other photo software visualization, you must configure this software as a default value in the default programs.

    Check out the link that allows you to configure the program as default.

    http://Windows.Microsoft.com/en-in/Windows7/change-which-programs-Windows-uses-by-default

    You can try to run the Aero Troubleshooter and see if that makes a difference.

    http://Windows.Microsoft.com/en-in/Windows7/open-the-Aero-Troubleshooter

    If the problem persists, provide us newspapers observer of events, as well as the error message if you receive a message.

    http://Windows.Microsoft.com/en-in/Windows7/open-Event-Viewer

  • Is there a way to get the data for submission of form of eloqua using the REST API?

    I was wondering if there is a way to get the data for submission of form of eloqua using the REST API?

    Thank you

    On the page that egan related, there is a 'RawData' field for FormSubmit activities. In this area, the raw sending the form query string is returned.

    Whatever it is, you can get this info from the activities of the API block, or the endpoints data Rest API.

Maybe you are looking for

  • Toast 10 with El Capitan?

    I got lucky with Toast 10 throughout Yosemite.  Does anyone know if still OK with El Capitan?

  • Problem with the HP 15-r033tx drivers.

    I can't find a driver for my hp15-r033tx for win8.1 (64-bit). Please provide the drivers, it would be really grateful.

  • Help with plug

    I need help, trying to find the specs on your motherboard. http://www.Amazon.com/Lenovo-ThinkCentre-M55-43C7178-motherboard/DP/B008KFDE5K/ref=sr_1_415?s=PC&IE=...

  • Windows XP SP3 wants to do 15 updates, but do not settle?

    The canceled brand status page A security update for Windows XP Media Center Edition 2005 Update Rollup 2 X 86 Edition (KB2619340) Update of security for Microsoft Office PowerPoint 2007 (KB2596843) Update of security for Microsoft .NET Framework 4 o

  • Printer HP photosmart 8150 in Vista driver no longer works.

    My HP photosmart 8150 printer no longer works with Vista, on two different PC I own. I put it on XP and it works very well. How to get Microsoft to solve the problem of one of their updates or patches. It allows to work very well with SP2. the only a