Store in Ipad data

Dear friends,

IAM creating an IOS app with air for IOS. I want to store the data in a txt file and then pull it out. IAM using the following code:

flash.filesystem import. *;
import flash.events.MouseEvent;
var cacheDir: file = null;
tempDir var: file = null;

Initialize objects with appropriate paths.
var str: String = File.applicationDirectory.nativePath;
cacheDir = new file ("//Library/Caches" + str);
tempDir = new file ("//tmp" + str);
var fr: FileStream = new FileStream();
Fr. Open (cacheDir.resolvePath ("myCache.txt"), FileMode.WRITE);
fr.writeUTFBytes ("works");
Fr. Close();

btn.addEventListener (MouseEvent.CLICK, btn_click)

function btn_click(event: MouseEvent) {}
var fw: FileStream = new FileStream();
FW. Open (cacheDir.resolvePath ("myCache.txt"), FileMode.READ);
txt. Text = fw.readUTFBytes (4);
FW. Close();
}

It works very well in my office. When I compile and intall in the ipad, is not workign pls help me what should I do to make it work. I want to store data in the Ipad...

Thanks in advance,

Syed Abdul Rahim

Just to clarify the difference between your original code and the sample above that works, you try to save a file using the File.applicationDirectory. This is a directory read-only on iOS (and normally to other platforms as well, such as mentioned in the docs for file: QAnywhere® to Adobe ActionScript 3 (AS3) - file )

You never try to write to File.applicationDirectory, you should at least use File.applicationStorageDirectory and if you need to cache content consider using File.cacheDirectory. All these static file helper. [*] Properties of the directory do all the work for you to choose the right folder any platform.

If you're curious where these directories resolve on various platforms there is a good summary here:

Adobe Flash Platform * work with object files in the AIR

Tags: Adobe AIR

Similar Questions

  • Store (arduino) analog data in a 2D matrix

    Hello

    I need to store analog data in a 2D array. I can't use 2 for loops, because I get complete data at the end of two loops. So I need to use 1 loop for and store my analog data in an 8 x 8 matrix in this loop. (A for loop so I can store data at run time and I don't have to wait until the end of the loop for).

    If you an idea how I can get it please let me know.

    OR

    Initialize a 2D array

    integer divide the 'i' of your loop by 8.

    Serve the rest as the quotient of the row index and column index and replace data at this level of R/C with the new data.

  • 0xC004E002-software licensing service reported that the license store contains inconsistent data.

    I got this code when I started upward. How to fix it. It says the software licensing service reported that the license store contains inconsistent data.

    Hello

    You can follow below link that can help you to solve your problem:

    Error 0xC004E002 during activation of Windows Vista, Windows Server 2008, Windows 7 or Windows Server 2008 R2
    http://support.Microsoft.com/kb/978305
     
  • Store the actual data of GG

    Hi experts,

    We configure an exception GG next to the target table to capture the details of the error with the reperror parameter in this table, we have kept Details of the db error message and details of error in memory as,.

    for example, if no error, the sql below found data is stored in the dberrmsg column,

    < REMOVE FROM 'TGT '. "" GGS_PROD "WHERE"n"= : b0>

    but we need store the exact value of the : b0 in another column in the table? could you please guide how to get the value of the exact source of the column 'NOT ' which was not not found error information?  is it possible to get the failing accurate data who are tempted to replicate to the target database using @GETENV or other means?

    Thanks in advance

    AT

    Hi thanks for your response,

    I realized that with the help of Reperror with the exception on the target and keycols parameter setting in the source, I can store the actual data in the exception in exception table that passes,

    Thank you

  • Virtual machine in the store of stock data... do not know why?

    Weird, seemingly simple question that I'm hoping someone can help me with. I'm migrating to warehouses of new data here that I will retire from our old data warehouses. I went in my opinion warehousing data and Clusters data store and selected data store. I went to the tab computers virtual and put highlight the entire virtual machine, chose to migrate and chose to migrate to the data store. When he finished two VM have been left. I looked at the settings and both were still in the inventory of data store, because they had the ISO mounted on their CD player that was on this data store. I put the drive of the client machine under devices and click OK. This removed a VM, but not the last one. I went to every setting that I can find to see why this virtual machine is always on the data store. I want to remove the data store, so I can finally get rid of it. If I browse the data store, the folder for this virtual machine is no longer there. If I'm going to change the settings for the virtual path of the VMDK computer is set to the new data store. For the life of me I can't figure out where the connection is for this virtual computer in this data store. We have our NetApp SAN and I checked that I have remove the task backup and all backups so these objects via the plugin vCenter we have and they are no longer on this data store either. Besides the VMDK and the CD drive, if not, how can a VM be bound to a data store?

    This last VM has a preview on this subject?

  • How to store the captured data in the csv file

    Here's the sceanario

    I was able to capture data from the oracle forms and store it in variables.
    now, I want to store the same data in the csv file and save this csv file.
    quick reply is appreciated.

    Ok. This is what my, admittedly simple, code performs above: var_orderid col1 and col2 in var_quantity.

    See you soon,.
    Jamie

  • Unable to access iBooks Store for iPad after upgrade to iOS 9.3.3.

    We do not seem to access my iPad iBooks store 2 Air or my wife Mini 4 iPad after upgrading iOS 9.3.3 machines. When you click on any of the icons store across the lower part of the application, we get a blank white page. We can access all our books purchased on the iCloud, but cannot look for first timers. The iBooks app seems to work normally on my iPhone 6 after the iOS upgrade. Anyone else has a similar problem?

    Yes. Double-click the home button on the iPad and the iBooks app sliding upwards and out of the screen to close.

    Click on the home button to return to the home screen, then hold home and power/sleep buttons for 10-15 seconds or until the Apple logo appears.

    Reset draw iPads. Let them restart and try opening the iBooks App again.

    No data should be lost by the present.

  • The apple store can transfer data to me?

    I intend to share my 5S for a 7 and get the discount immediately. But this means that I have to give them my 5s. They can transfer all the information from my 5s to my 7 in the store? So, I did not add all the books and set up here where I left in one of my apps to read for example... Is this possible to transfer just the same 'soul' in another 'body' with all the same exact preferences? (you know what I mean)

    The store can make the transfer, but they will use iCloud for making a backup of your old phone and then restore to the new. This could take a while depending on the amount of data transferred.

    You have backups of your old appliance before head you to the store. Use iCloud or iTunes on your PC.  You can then restore yourself.

  • store Apps iPad files in iTunes on the iMac

    Hello

    How can I store files on iMac.

    I see in iTunes I can sync the music types... fotos but not files I generate it with different applications.

    Jochen

    How to copy files to and from your iPad and your Mac will depend on what the application files are in support for example file sharing via the bottom of the applications tab in iTunes (on the sharing of files on iPhone, iPad and iPod touch - Apple Support), via your wifi network, email, Dropbox

  • Send iPhone iPad data using iCloud

    The activity that I do on my iphone backup on my ipad when I connect to the wifi. Everything is like my imessages, history of the site, photos, etc., visible by the webmasters of the wifi Server? This applies to the public or private wifi, I was just curious to know if anyone is able to display what is sent via icloud of each device.

    The link between your devices (iPhone, iPad) to iCloud is a secured link. It is encrypted. No one can intercept the data transfer and steal private information in the data stream between your devices and iCloud.

  • Mysterious error stuck in iTunes App Store on iPad Pro download

    On my iPad Pro there is a mistake with two video downloads in the app Store in iTunes. Cannot remove the two download errors so it shows just two attempts to download content in the download window. No way to restart or remove the downloads. How can he be re-defined? Edit function and pressing the errors on this side here dies nothing.

    Do a forced reboot - after all open applications using the app Chooser - invoked by fast double pressing the home button and drag upwards on each app until it disappears from the screen.

    Meet the sleep/wake and home buttons down until you see the logo  - then release and allow normal start upward

  • How to set static IP on Verizon iPad data Plan?

    Hello

    We strive to set up a static IP address on several iPads so they can access a secure on a Verizon data plan Web site. I watched all the videos and went through all the directions I can google and I'm still without a solution. For each solution, in my opinion, it is said to go into the settings > cellular/cell data > cellular data network and click the APN tab to add the information. There is no option cellular data on any of our Verizon data devices.

    I called Verizon and Apple support to see how to get this option appears and it was transferred blame game back two hours. In the end, I was told that we need to create a profile of AFN via Apple Configurator 2 or AirWatch. I tried to create the two and to my knowledge, neither work. Or I do not know where the APN tab appears with the profile of the AFN. The only information provided to AFN by Verizon is "MW01. VZWSTATIC ". The ipads are on iOS 9.2.1.

    So here's what I have for our profile Apple Configurator 2 APN.

    If anyone has had this problem before and knows a solution you'd make my year!

    Thank you!

    * There is no cellular data network option

  • Everyone has understood how to store the iPad pro pencil in the iPad keyboard Smart pro?

    It would be good to keep my iPad Pro, pencil and Smart keyboard all together in the case of the keyboard, but if there is a way to store the pen that I still have to find out.  Somebody has a better chance?

    There is no way of storage designed into it. You'd have to invent and fixing something yourself. Band Velcro comes to mind.

  • How to use the graph of the intensity in the iPad data dashboard.

    Hello

    I use a graph of intensity in my vi main under a project of myRIO.

    I created a shared variable of the 2D array. When I selected the variable in the ipad it does not show that he presents in the pc...

    I want to mention that I have selected the multiplier as (= 30/255) 0.117647 in labview in pc

    I use the version of labview 2015 myRIO.

    and I am using iOS 10 in my iPad

    can someone help me please

    Hi adil,.

    The graph of the intensity is not supported in the dashboard of data.

    Kind regards

    Denny

    AE Singapore

  • How to use the command to move the machine to a data store in another data store in WTT(Windows Test Technology) Atlas (2.7)?

    I searched doc help WTT Atlas, just found this: "the MoveMachine command allows users to move client computers between the basins of the machine. This command assumes that the user has permissions of correction to carry out operations and generates an error if this is not the case. "

    Note: this command just explain machine displacement between the watersheds of the machine instead of the data store.

    This issue is beyond the scope of this site (for consumers) and to be sure, you get the best (and fastest) reply, we have to ask either on Technet (for IT Pro) or MSDN (for developers)
    *

Maybe you are looking for