How to store data in JavaFX 1.2 Mobile with Storage and Resource API

I'm need to store some numbers and strings in an application that will be deployed in a HTC HD2 device with JavaFX 1.2 When run on desktop, everything works perfectly. But after being installed in the device, the application won't store data in files. I thought JavaFX was able to do that, according to its documentation (http://download.oracle.com/docs/cd/E17802_01/javafx/javafx/1.2/docs/api/javafx.io/javafx.io.Storage.html)
I do it like this (just the part that stores integers)
public var availableGifts : Integer[] = [0,0,0];
var highscoresFile = Storage {
source: "AvailableGifts.txt"
public function writeConfiguration() {
try {
var resource : Resource = configurationFile.resource;
var outputStream : DataOutputStream = new DataOutputStream(resource.openOutputStream(true));
outputStream.writeInt(availableGifts[0]);
outputStream.writeInt(availableGifts[1]);
outputStream.writeInt(availableGifts[2]);
outputStream.flush();
outputStream.close();
println("Data stored!");
} catch(ex : IOException) {
ex.printStackTrace();
The application is self-signed, just in case. But it won't store data in the mobile device... I need some help with this!

Agh, the problem is not in how data is stored, because it IS being stored. The problem is that inputstream.available() seems to always return 0 in the mobile device, so the file seems to be empty.
But that's a different problem.

Similar Messages

  • How to store data (in tdm files)

    I'm looking for advice on how to store data in tdm/tdx files.
    The main challenge is like this: At regular time intervals there is new data available (say every 10 minutes there are 10 minutes of new data available). All data is time based. So every ten minutes I may create a new tdm/tdx file containing this data segment. However, when i want to analyze the data i dont necessarily want to view 10 minutes of data from all channels, but maybe 20 hours of data from one particular channel.
    The way I've achieved this so far is to manually load each 10 minute segment of this particular channel and then add these parts together. This is both time consuming and cumbersome. Is there a better way to do this that I've simply not discovered yet? Is there a better way to store data to simplify this process?
    One solution is of course to save data from several 10-minute frames in one file, but seeing as there is a never ending supply of data i cant simply save all data in one giant file, it has to be split up at some point, and the problem will still remain.
    One factor to have in mind here is that this is rather large amounts of data (maybe 10GB each day), so the option to simply load all the data into memory goes out the window rather quickly.
    Feel free to ask if I've not made myself very clear

    Hi salte,
    If your test ever ended, and if you had LabVIEW 8.20 or higher, I would recommend using a TDMS file, which handles data appeands flawlessly.  DIAdem 10.1 now also does data reduction and index windowing during file loading for TDM / TDMS / DataPlugin files, so that you could easily load out only the part of the file you wanted to look at.  But since you describe your data acquisition as never stopping and amassing 10 GB per day, I agree that it would be impractical to use only 1 data file.  So we are stuck with some number of files which each contain a part of your measurement.  This approach can have advantages, since you can save operational properties for each "buffer" such as average value, dominant frequency, ambient room temperature, etc., and later on you can use the DataFinder to query out only the data buffers which meet specific conditions based on these properties.  The problem remains to load and assemble data based on multiple files.  This is an old problem in DIAdem, and one for which I have an efficient and I hope satisfactory workaround application.  It does what you describe already doing in the minimum amount of time and with the minimum amount of user interaction, and it can be highly parametrized to suit your particular situation.  The ideal way to start the application would be as part of a ResultsList custom menu.  This would enable you to query out the buffers you wanted, highlight those rows in the ResultsList, right-click and choose your custom menu, and WHAM! the selected buffers for your queried channel(s) are automatically appended together in the DataPortal.  Launching from a ResultsList custom menu would mean that you could skip the file dialog and just read out the data sources directly from the ResultsList selection.
    Let me know what you think,
    Brad Turpin
    DIAdem Product Support Engineer
    National Instruments
    Attachments:
    Importing Data from Multiple DataPlugin Files.zip ‏198 KB

  • What is a cube? how we store data in that? how we fetch data from cube?

    Hi,
    What is a cube? how we store data in that? how we fetch data from cube?
    Regards.
    venkat

    >
    venkey B wrote:
    > Hi,
    >
    >
    > What is a cube? how we store data in that? how we fetch data from cube?
    >
    >
    > Regards.
    >
    > venkat
    Hi Venkat,
    I guess you mean an infocube from the SAP BI product. I propose to look at the forum for Business Intelligence to find your answers.
    E.g. SAP POS DM writes the sales data in infocubes.....

  • How to store data from textfile to vector and delete a selected row.

    Can someone teach me how to store data from textfile to vector and delete a selected row. And after deleting, i want to write the changes in my textfile.
    Do someone has an idea? :)

    nemesisjava wrote:
    Can someone teach me how to store data from textfile to vector and delete a selected row. And after deleting, i want to write the changes in my textfile.
    Do someone has an idea? :)What's the problem? What have you done so far? What failed?
    What you described should be pretty easy to do.

  • How to store data in ipad from computer

    please explain me how to store data (music video & pictures) in  ipad from any personal computer...kindly explain me in simple steps...

    The iPad can only sync with one computer.  To do this you need to have iTunes installed on the computer and have it associated with your Apple ID.  you can then use iTunes to transfer music, movies and pictures from that computer, and that computer only.
    iOS: Syncing your data with iTunes
    http://support.apple.com/kb/ht1386
    If you need to get files from other computers, you would need a 3rd party App that can handle the formats you wish to transfer, and possibly transfer them either through iTunes file sharing or Wifi transfer depending on what the App supports.
    iOS: About File Sharing
    http://support.apple.com/kb/ht4094

  • How LDAP stores data?

    What is the diff bet. LDAP & Data base?
    How LDAP stores data?

    LDAP uses a hierarchical tree structure. This is why LDAP queries are formed like ldap://mydomain.com/...

  • How to avoid data repetation when using select statements with innerjoin

    how to avoid data repetation when using select statements with innerjoin.
    thanks in advance,
    satheesh

    you can use a query like this...
      SELECT DISTINCT
             frg~prc_group1                  "Product Group 1
             frg~prc_group2                  "Product Group 2
             frg~prc_group3                  "Product Group 3
             frg~prc_group4                  "Product Group 4
             frg~prc_group5                  "Product Group 5
             prc~product_id                  "Product ID
             txt~short_text                  "Product Description
    UP TO 10 ROWS
    INTO TABLE l_i_data
    FROM
    Joining CRMM_PR_SALESG and
    COMM_PR_FRG_ROD
    crmm_pr_salesg AS frg
    INNER JOIN comm_pr_frg_rod AS prd
    ON frgfrg_guid = prdfragment_guid
    Joining COMM_PRODUCT and
    COMM_PR_FRG_ROD
    INNER JOIN comm_product AS prc
    ON prdproduct_guid = prcproduct_guid
    Joining COMM_PRSHTEXT and
    COMM_PR_FRG_ROD
    INNER JOIN comm_prshtext AS txt
    ON prdproduct_guid = txtproduct_guid
    WHERE frg~prc_group1 IN r_zprc_group1
       AND frg~prc_group2 IN r_zprc_group2
       AND frg~prc_group3 IN r_zprc_group3
       AND frg~prc_group4 IN r_zprc_group4
       AND frg~prc_group5 IN r_zprc_group5.
    reward it it helps
    Edited by: Apan Kumar Motilal on Jun 24, 2008 1:57 PM

  • What Are The Minimum Permissions In Order An User To Be Able To Access User Profile Data With JavaScript And REST API

    The question says it all:
    What Are The Minimum Permissions In Order An User To Be Able To Access User Profile Data With JavaScript And REST API.?
    In the User Profile -> Permissions there is only the option for "Full Control".

    Hi Nikolay,
    Thanks for posting your issue, you need to set permissions on User Profiles = Read. Kindly find the below mentioned URLs to get the code and more details on this.
    http://www.vrdmn.com/2013/02/sharepoint-2013-working-with-user.html
    http://www.vrdmn.com/2013/07/sharepoint-2013-get-userprofile.html
    http://sharepoint.stackexchange.com/questions/61714/sharepoint-2013-call-the-rest-api-from-sharepoint-hosted-app
    http://www.dotnetmafia.com/blogs/dotnettipoftheday/archive/2013/04/09/how-to-query-sharepoint-2013-using-rest-and-javascript.aspx
    I hope this is helpful to you, mark it as Helpful.
    If this works, Please mark it as Answered.
    Regards,
    Dharmendra Singh (MCPD-EA | MCTS)
    Blog : http://sharepoint-community.net/profile/DharmendraSingh

  • Export data to excel with EPPlus and Web Api - HELP!

    I am trying to do a simple excel file export with EPPlus and Web Api. In the html client I have a button that calls the web api and opens a new window. No error is thrown, but the result is always "file could not be downloaded".  I get the
    save file dialog but the file name is Order/ instead of the expected Orders.xls or Orders.xlsx.  Can anyone help? I'm surprised this is so difficult.
    using System.Linq;
    using System.Net.Http;
    using System.Web.Http;
    using OfficeOpenXml;
    using System.Collections.Generic;
    using System.IO;
    using System.Net.Http.Headers;
    using System.Net;
    using System.ComponentModel.DataAnnotations;
    namespace LightSwitchApplication
    public class OrdersController : ApiController
    // GET: api/Orders
    [HttpGet]
    public HttpResponseMessage Get()
    HttpResponseMessage response;
    response = Request.CreateResponse(HttpStatusCode.OK);
    MediaTypeHeaderValue mediaType = new MediaTypeHeaderValue("application/octet-stream");
    response.Content = new StreamContent(GetExcelSheet());
    response.Content.Headers.ContentType = mediaType;
    response.Content.Headers.ContentDisposition = new ContentDispositionHeaderValue("attachment");
    response.Content.Headers.ContentDisposition.FileName = "Orders.xls";
    return response;
    public List<Order> GetOrders()
    List<Order> colOrders = new List<Order>();
    using (ServerApplicationContext ctx = ServerApplicationContext.Current ??
    ServerApplicationContext.CreateContext())
    colOrders = ctx.DataWorkspace.Data.Orders.GetQuery().Execute().ToList();
    return colOrders;
    public MemoryStream GetExcelSheet()
    using (var package = new ExcelPackage())
    var worksheet = package.Workbook.Worksheets.Add("Orders");
    worksheet.Cells["A1"].LoadFromCollection(GetOrders(), false);
    package.Save();
    var stream = new MemoryStream(package.GetAsByteArray());
    return stream;
    This has been driving me crazy for two days!

    Making some progress.  I got the spreadsheet into a byte[] and used code from Paul Van
    Bladel's blog to make the HttpResponseMessage.  If I comment out the LightSwitch data access code, this works to export a spreadsheet from a static list to the browser from Web Api.
    using System;
    using System.Collections.Generic;
    using System.IO;
    using System.Linq;
    using System.Net;
    using System.Net.Http;
    using System.Net.Http.Headers;
    using System.Web.Http;
    using Microsoft.LightSwitch;
    using Microsoft.LightSwitch.Details;
    using OfficeOpenXml;
    using System.ComponentModel.DataAnnotations;
    namespace LightSwitchApplication
    public class Order
    [Key]
    public int Id { get; set; }
    public string OrderNumber { get; set; }
    public class OrdersController : ApiController
    // GET: api/Orders
    [HttpGet]
    public HttpResponseMessage Download()
    MediaTypeHeaderValue mediaType =
    MediaTypeHeaderValue.Parse("application/octet-stream");
    byte[] excelFile = ExcelSheet();
    string fileName = "Orders.xlsx";
    MemoryStream memoryStream = new MemoryStream(excelFile);
    HttpResponseMessage response =
    response = Request.CreateResponse(HttpStatusCode.OK);
    response.Content = new StreamContent(memoryStream);
    response.Content.Headers.ContentType = mediaType;
    response.Content.Headers.ContentDisposition =
    new ContentDispositionHeaderValue("fileName") { FileName = fileName };
    return response;
    public List<Order> Orders()
    List<Order> orders = new List<Order>();
    orders.Add(new Order { Id = 1, OrderNumber = "123456789" });
    orders.Add(new Order { Id = 2, OrderNumber = "987654321" });
    return orders;
    // this doesn't work
    //public List<Order> Orders()
    // List<Order> colOrders = new List<Order>();
    // using (ServerApplicationContext ctx = ServerApplicationContext.Current ??
    // ServerApplicationContext.CreateContext())
    // colOrders = ctx.DataWorkspace.Data.Orders.GetQuery().Execute().ToList();
    // return colOrders;
    public byte[] ExcelSheet()
    using (var package = new ExcelPackage())
    var worksheet = package.Workbook.Worksheets.Add("Orders");
    worksheet.Cells["A1"].LoadFromCollection(Orders(), false);
    byte[] bytes = package.GetAsByteArray();
    return bytes;
    The problem is that the LightSwitch query (commented out in the code above) is trying to load navigation properties for the orders.  Error: "It is not valid to access this object on the current thread."  How do I solve this? 

  • Hi there. I have 3GS and tried to up-date it today (19 Feb 2013) with iTunes and now I can't activate it! it shows the "Your iPhone could not be activated. tha activation server is unavailable...". The iPhone has never been jailbroken!!!

    Hi there. I have 3GS and tried to up-date it today (19 Feb 2013) with iTunes and now I can't activate it! it shows the "Your iPhone could not be activated. tha activation server is unavailable...". The iPhone has never been jailbroken!!!
    - have tried restor
    - have tried recovery mode
    - have tried on 2 PCs
    ... can someone tell me what to do! I'm tryin for 5hours now!

    no! i havent change my carrier still the same

  • How long will power last on the iphone 5s with 4g and 3g and 2g?

    How long will power last on the iphone 5s with 4g and 3g and 2g?

    I don't think anybody would know the answer to your question.
    Nobody here knows how you use your phone.
    to answer your question test it out yourself.

  • How to create an online fillable form for mobile devices, tablets and smartphones.

    How can I create "online fillable forms" for Mobile devices, tablets and smarphones?
    I already created an "online fillable form" with Adobe Acrobat XI Pro for PCs and MACs but this form can not be filled using mobile devices, it can only be downloaded.
    Thanks.

    Hi George,
    I gather from your reply that I won't be able to create "online fillable forms" for Mobile devices with Adobe Acrobat XI Pro. Correct? 
    If Adobe does not have another software similar to Adobe Acrobat XI Pro, would you please suggest me any other means of creating "online fillable forms" for Mobile devices? 
    Would you think that an HTML developed form would be a fair substitute for the PDF fillable forms that I use for PCs and MACs?
    Thanks,
    Alvaro

  • How to I sync my 10.6.8 ical with icloud  and then to my ipad

    How to I sync my 10.6.8 ical with icloud  and then to my ipad

    I find that I can sync fine with Entourage and I cal under Leopard. I can also subscribe to the Leopard I-calendar on another computer (running Tiger). However, the calendar will not go onto a web page as it used to; this is very frustrating for my colleagues! We need a fix here I think.

  • How to store data in hashmap so that it can be used by different methods.

    Hello,
    I have an ADF/JSF application and the database is DRM. The program gets data from DRM into this hashmap. Program needs this data frequently. Getting this HashMap is very resource intensive due to a lot of data it has.
    I want to get the data in HashMap once ( I can do this - no problem).  But where/how do I keep it so that different methods can just use this and not make individual trips to DRM? It may be a very basic java question but I seem to be stuck :)
    I am not very concerned about the HashMap part, it can be any collection - the question is of storing it so that it can be used over and over.
    Thanks,

    User,
    If I understand you correctly, you have a JSF application that needs to store data in a HashMap such that it can be accessed over and over? You could put the hashmap into an appropriately-scoped managed bean and access it from there. I'm not sure what a "DRM" is (a digital rights management database, perhaps, in which case it's a "database"), so there is something special about a "DRM" that we need to know, please share.
    John

  • How to store data in chinese from oracle and show it to jsp?

    hi, please help.
    i have design a jsp page for registeration of a website in chinese,
    but after the user have enter the chinses data throught the jsp~
    the jsp have shown some monster code~
    it can't show the valid date in chinese!!! how can i fix it????
    when i select data from SQL PLUS, monster code is showed. how to show the chinese data in the oracle.
    i am using tomcat 5.0 ~servlet 2.2 and oracle 9i for database~~
    thx thx thx~~~~~pls help me!!

    The how to at following url shows how to store, retrieve and display characters of different languages from Oracle database onto a JSP page.
    http://otn.oracle.com/sample_code/tech/java/codesnippet/jdbc/nls/Globalization.html
    HTH
    Chandar

Maybe you are looking for

  • Sale Order Item Level Text Field which table and field

    Hi, Thanks for your prompt reply and best solution. Can you please tell me one more thing, in sale order at item level the TEXT Field maintaining by user at transaction level now they want that field in one of the report, so can you please tell what

  • Manager is not able to Approve the leave

    Dear Freinds, Please help me in solving this below issues. EE has applied for leave thro ESS. Manager have recd a confirmation from Work flow system . But the same is not reflecting in Manager MSS . Therefore he is not able to approve the same .  How

  • System Settings/Ram

    Under the System Settings, what are the best settings for; Memory Usage Application Still Cache Thumbnail Cache Disk Ram............? 1.5 gigs is all my computer supports. One last thing. Would it be best to run FCP under a new user name. Since I can

  • Tables: Fit Content to Frame

    (InDesign CS2) Since "fit frame to content" is available when you select a frame that contains a table, but "fit content to frame" is not...I'm assuming it's not possible to do that. I understand that a table can lie well within or outside of its fra

  • Certification in ABAP..

    Hi Great Abapers. I want to do certification in ABAP. Can any one refer me good book names or some great links. Which one is most help full to do certification. Thanks.