Air 2.5 sqlite db creation

Hi,
I am trying to create a sqlite database with Flex 4 / Air 2.5.
My code is the following:
private function init():void
                    var conn:SQLConnection = new SQLConnection();
                    conn.addEventListener(SQLEvent.OPEN, openHandler);
                    conn.addEventListener(SQLErrorEvent.ERROR, errorHandler);
                    var folder:File = File.applicationStorageDirectory;
                    var dbFile:File = folder.resolvePath("example.db");
                    conn.open(dbFile);
               private function openHandler(event:SQLEvent):void
                    trace("the database was created successfully");
               private function errorHandler(event:SQLErrorEvent):void
                    trace("Error message:", event.error.message);
                    trace("Details:", event.error.details);
Consolle says "the database was created successfully" but I can't find any example.db on my MAC.
Why?

I was using File.applicationStorageDirectory instead of File.documentsDirectory.
Here is:
http://help.adobe.com/en_US/as3/dev/WS5b3ccc516d4fbf351e63e3d118666ade46-7fe4.html#WS5b3cc c516d4fbf351e63e3d118666ade46-7d9e

Similar Messages

  • Adobe Air Synchronization with SQlite

    I want to develop a desktop application in Adobe Air with persisted local storage that will be catered by Adobe Air's SQLite. I want to implement row based synchronization and I've created the algorithm to do so (using timestamp field in the tables and comparing with lastsynced timestamp etc). I want this application to be accessible both offline and online. When Online, I want to sync the local db's newly edited row to online database (MySQL) but when application is being used in offline, i want to log all the edited rows and as soon as internet connection is restored, i want to sync all rows that were edited in offline mode to online DB. I am new to Adobe Air so can anyone guide that once we've stored the data in SQLite, how can we transmit/sync the desired rows to online DB? i've heard that via BLAZEDS and Adobe LiveCycle Data Services, i can achieve my goal but Adobe LCDS is too expensive. Can anyone suggest how this can be done in BlazeDS? can anyone suggest me the libraries or APIs for that? also if i am using SQlite at client end and MySQL at server end, is it going to pose any problem? Please guide. thanks.

    I want to develop a desktop application in Adobe Air with persisted local storage that will be catered by Adobe Air's SQLite. I want to implement row based synchronization and I've created the algorithm to do so (using timestamp field in the tables and comparing with lastsynced timestamp etc). I want this application to be accessible both offline and online. When Online, I want to sync the local db's newly edited row to online database (MySQL) but when application is being used in offline, i want to log all the edited rows and as soon as internet connection is restored, i want to sync all rows that were edited in offline mode to online DB. I am new to Adobe Air so can anyone guide that once we've stored the data in SQLite, how can we transmit/sync the desired rows to online DB? i've heard that via BLAZEDS and Adobe LiveCycle Data Services, i can achieve my goal but Adobe LCDS is too expensive. Can anyone suggest how this can be done in BlazeDS? can anyone suggest me the libraries or APIs for that? also if i am using SQlite at client end and MySQL at server end, is it going to pose any problem? Please guide. thanks.

  • Air for Android - Sqlite - Slow inserts

    Hello there,
    What is the best way to follow in order to make a lot of insert on a sqlite db?
    I ask because I noticed a great and unpredicatable slowdown on my Galaxy S when I make a lot of insert.
    I use an openAsync connection because I need to monitor what is happening.
    Everytime a row is created I increment a counter.
    It starts well, then after a 100 insert it slow down and nearly dies.
    Any suggestions?
    Thanks in advance

    I optimized the query:
    - I reuse the same statement and changing only the parameters
    - I use the transaction with begin and commit
    This speeded up the whole things in an incredible way, however I still notice a slow down that luckily, after the optimizations I made, never dies.
    Any other suggestion will be appreciated!

  • Dataservice local AIR cache - User SQLite Query Possible??

    Hi All
    Does anyone know if it is possible to query against offline cachid database (created by dataservices 2.6.1 and AIR 1.5.x)
    So, for example I need to do something like:
    SELECT * from STOCKTABLE WHERE STOCKTABE.NAME LIKE %myproductname%
    The main reason I need to do this is, because I need to use the sql 'LIKE' keyword, rather than program my own 'smart' search routines...
    Having loaded the dataservice cacheid db file, I can query against a table some tables but it seems obvious that the schema is not designed for users (like myself) to load and query against...but still worth asking:)
    Any help, much appreciated.
    Jasen

    Anil
    Thankyou for your reply, sorry it took sooo long for me to acknowledge it:)
    Unfornately, we do have access to DS3.1, we only have access to 2.61 ATM.
    To get around this issue, we are using AdvancedDataGrid and using field sort for three fields. This is on 5000 or so items of flat data and it takes some time to complete the update (Apparently AIR2 has faster routines, but not sure how much faster...)
    Look forward to having access to DS3.1 at some time in the future...but until then 2.61 is it.
    Just to relaborate, we need to build a hiearchical tree from flat data,for example:
                     groupingCollection    =    new GroupingCollection();
                     grouping    =    new Grouping();
                     fields        =     new Array();
                     fields.push(new GroupingField( "web_Category_Level_1", true ));
                     fields.push(new GroupingField( "web_Category_Level_2", true ));
                     fields.push(new GroupingField( "web_Category_Level_3", true ));//this field is not always present
                     grouping.fields    =    fields;
                     groupingCollection.grouping    =    grouping;
                     groupingCollection.refresh(true);
    However, some fields in the flat data only have two fields, thus only giving two levels in the tree, but I am not sure how to sort for two fields and/or three fields in the flat data returned from a dataService.fill().
    Had looked into compare groupingObjectFunction and groupingCompareFunction but did not have much luck...
    So, that is why I was hoping to be able to query the local dataservice cache directly and build the tree using lazy loading methods (just like using SQL queries on a remote server)
    Cheers
    jvm

  • How to save the date in Sqlite in Adobe Air application

    hi friends,
    i am doing a flex Adobe AIR Application with SQLITE Data base,in that i want to save Date in the following format DD/MM/YYYY, but in my TABLE i gave the data type is DATE,
    So it store the value like this Sun Dec 2 00:00:00 GMT+0530 2012.i want to store the value in DD/MM/YYYY.How to do that?
    looking for useful suggession.
    Cheers,
    B.venkatesan.

    Hi, maybe cannot help much on this since I have not much experiense on handling SQLITE in AIR.
    But I know there are a command/example for reading SQL:
    http://help.adobe.com/en_US/FlashPlatform/reference/actionscript/3/flash/data/SQLConnectio n.html
    http://help.adobe.com/en_US/as3/dev/WS5b3ccc516d4fbf351e63e3d118666ade46-7d49.html
    And in mxml you should have an id for each individual TextInput component, also have a button:
    <Button click="updateSQLHandler(event)"/>
    When the button is click the handler function is launched.
    The updateSQLHandler(event:MouseEvent) is a script that read the each individual TextInput component by getting (id of textinput component).text.
    Then, you create a String varible that is an SQL commands with the texts in the form, and update the SQL database following the below using the execute() command (refer to http://help.adobe.com/en_US/as3/dev/WS5b3ccc516d4fbf351e63e3d118666ade46-7d49.html ).
    Hope this help.

  • Adobe air and utf16 databases

    Can i create with adobe air a utf8 sqlite database?

    i have noticed that..
    I have an utf8 database created from mysql Dump and a utf16 database created from Air
    i want to attach the one with the other..
    As i can understand there is no way to create utf8 database throught Air
    Is there any tool or program to convert my utf8 database to utf16?

  • What is Adobe AIR 2.5.1 for TV?

    Adobe AIR for TV enables the creation and delivery of rich, expressive applications, video, and content for TV. With AIR for TV, developers enjoy greater value for their investment in the Adobe Flash Platform and are able to participate in true multiscreen development as well as more easily monetize applications. AIR for TV takes advantage of hardware acceleration that is specific to TV-style devices (including Blu-ray disc players and set-top boxes), as well as hardware-decoded H.264 for cinematic-quality video playback. As with all other AIR platforms, ActionScript 3 is supported.

    Mmh, ja, güte Fräge...! Ich würde mal vermuten, dass es die Sockets zerschossen hat, also die Art und Weise, wie AIR mit den notwendigen Flash Player Komponenten kommuniziert... Passiert auch manchmal auf "echten" Systemen, läßt sich aber in aller Regel eben durch die Neuinstallation von AIR und Flash Player reparieren. Könnte vielelicht sogar sein, dass die Virtualisierung selbst irgendwas damit zu tun hat. Auf jeden Fall würde ich mal den AIR Cache löschen (in deinem Windows User Verzeichnis unter dokumente und Einstellungen irgendwo). Vielleicht reicht das ja schon...
    Mylenium

  • How to Build a Flex App that works with both SQLite and MySQL?

    Let me explain a bit: I am developing an app that will
    be published as an AIR application using SQLite, as well as a FLEX application that will use MyDSQL via web services.
    I want to develop both applications in such a way that all the components can be reused, and I only have to do minimal redevelopment. I have started witht the AIR application. Once I have it completed, I want to publish the application (with minimal redevelopment) as a FLEX web app.
    My thinking is that I contain the database accesses in the Application, and passing the data via interfaces to the respective modules, as well as receiving data from the modules back to the Application to be written to the database. This was the only changes between the FLEX and the AIR application will be how the database access is handled in the Application file, and I can leave all modules as is and will be able to maximize reusability,
    I haven't done this before, and was wondering what the best approach for this is?
    Thanks!

    It seems very difficult to find best practices on how to structure your database layer in FLEX. None of the books I have go into detail about it, nor do any of the websites I have found so far, including the Adobe Flex tutorials. Sure, they explain how to interact with databases, but don't seem to care about best practices for structuring your application.
    Can anyone point me in the right direction for this?
    Thanks!

  • ORM framework for AIR

    Christophe Conraets desribes
    in
    his blog a nice solution to map objects to a relational
    database, say SQLite. In
    another
    article Christophe develops based on this concept a simple
    contact management solution.
    Christophe uses Flex' annotation drive the ORM process: Based
    on annotations in Flex source, the ORM transparently creates an
    adequate SQLite DB and all CRUD operations for this database.
    While his approach is nice, I'd prefer to use a complete a
    complete ORM framework, which provides more features.
    A quick Google search failed. Does anybody know of a Flexbase
    ORM?
    Please note, that I don't try to communicate with a server.
    In fact, I'd like to save networks of objects to a local store,
    e.g. SQLite or XML.

    Here are the ORMs that I have found so far. None seem to have a dedicated following, and all seem to lack documentation.
    http://flexorm.riaforge.org/
    http://code.google.com/p/airorm/
    http://code.google.com/p/air-activerecord/
    I would love to see an ORM solution that has a more active following and that is being actively maintained. Unfortunately I lack the experience and knowledge, not to mention time, to set one up myself and maintain it on an ongoing basis.
    There seems to be some hubbub around http://www.matsiya-technology.com/introducing-sofa-an-adobe-air-orm-for-sqlite/#comments, but not sure if this project died or not. There don't seem to be any links to anything implementable.
    What other ORMs do people use for AIR? I haven't been able to find much of anything else. (Using an ORM for FLEX is a bit redundant, as most of the times the data will come from mysql and will be handled by PHP first, then transferred as RemoteObjects, althought I would think it is possible to build FLEX apps that stand on their own.)
    ~Mike

  • Considering the switch to AIR Dev. Need some basic info please.

    Hi, I've been developing applications for stand alone, offline touch screen kiosks using Flash and Multidiminsional Media's "Zinc". For various reasons, I'd like to move away from Zinc and go "All Adobe".
    Here's mainly what I was using Zinc for.
    Reading and writing to a local, MDB (MS Access) database file
    launching local MPG2 and WMV video files
    scheduling automatic system shutdowns/restarts
    Printing to a local printer without a Windows diolog popping up
    Based on what I've learned so far, here on the quesitons I have based on the numbered list above:
    AIR can read/write to mySQL Lite. However, what about these senerios:
    The "Wilderness and Game Commission" from some state has an enormus database of all their state's flora an fauna. I ask them to export it in "mySQL Lite" format. Will I be able to use AIR to read this database? Are there other requirements for AIR's implementation of mySQL Lite?
    Suppose we have a "Registration" app on a kiosk that collects addresses and emails from users. Now we have this address/email database file written by my AIR app inside of the storage directory. What can I do with this file? With Zinc+MDB file, I needed only to hand this file over to someone with MS Acces skills to do whatever needs to be done with the data. MS Access won't open the file made by the AIR app. What are my options?
    AIR works great with MP4 (H.264) files. However, I could use very old/inexpensive hardware to run MPG2 files in Zinc (which uses directx to open an instance of Windows Media Player, sans WMP interface.) Per my testing, these same machines will not run a similar quality MP4 video. Am I overlooking another AIR option?
    Can AIR do this? Maybe with launching a BAT file?
    We often have a thermal printer in our kiosks. Zinc provided a way to print something without the pesky Windows print dialog. Does AIR provide a similar solution?
    Thanks for any information addressing any of these requirements.

    AIR can read/write to mySQL Lite. However, what about these senerios: The "Wilderness and Game Commission" from some state has an enormus database of all their state's flora an fauna. I ask them to export it in "mySQL Lite" format. Will I be able to use AIR to read this database? Are there other requirements for AIR's implementation of mySQL Lite?
    The database engine that's built into AIR is actually "SQLite" (http://sqlite.org/) not "mySQL Lite". It has nothing to do with MySQL, and I haven't found an easy way to export data in SQL between different databases.
    The best way I've found for batch exporting/importing data using AIR is to export the data in some text format such as CSV, tab-delimited, or XML, then writing code to import that data into the AIR app.
    Suppose we have a "Registration" app on a kiosk that collects addresses and emails from users. Now we have this address/email database file written by my AIR app inside of the storage directory. What can I do with this file? With Zinc+MDB file, I needed only to hand this file over to someone with MS Acces skills to do whatever needs to be done with the data. MS Access won't open the file made by the AIR app. What are my options?
    SQLite is a fairly popular database library/engine but in the majority of cases it is used as an embedded database -- in other words, it's used internally by an application rather than as a file that's shared among users. For instance, Firefox uses SQLite behind the scenes for bookmarks, history, etc.; Adobe Lightroom uses SQLite behind the scenes for it's image catalogs; and so forth. Not that you can't use a SQLite database as the "file format" for your application, and share those db files between users of your application. That's one of the intended use cases of the database for AIR, although in fact I don't know of any case where someone's actually done that.
    Some developers have written tools for administering SQLite databases and for viewing/editing data in them. For instance, my personal preferred tool for creating/managing AIR SQLite databases is "Lita":
    http://www.dehats.com/drupal/?q=node/58
    However, Lita is not nearly the same as Access, in that Access provides not only the database engine but also a scaled down app development platform, including forms, reports, VB code, etc. As far as I know nobody's created anything that complex for SQLite databases (AIR-specific or otherwise).
    So I guess it depends a lot on what "do whatever needs to be done with the data" means. If you want a tool that people can use to open a SQLite database file created in AIR, that has some sort of report-builder functionality ... as far as I know that doesn't exist. The exception would be if the person creating the reports knows SQL, in which case they could use Lita or another tool such as my own "Run!" AIR SQLite query runner tool:
    http://probertson.com/projects/run-air-sqlite-query-testing-tool/
    But of course there could be a SQLite-based Access-like application out there that I don't know about.
    AIR works great with MP4 (H.264) files. However, I could use very old/inexpensive hardware to run MPG2 files in Zinc (which uses directx to open an instance of Windows Media Player, sans WMP interface.) Per my testing, these same machines will not run a similar quality MP4 video. Am I overlooking another AIR option?
    AIR can use any of the video formats supported in Flash Player. In addition to H.264, it also supports FLV video, including On2 VP6 and Sorenson Spark encoded video.
    Can AIR do this? Maybe with launching a BAT file?
    It sounds like part of this question got cut off. However, I can say that an AIR app can't launch a BAT file (or any other executable), if that answers your question.
    We often have a thermal printer in our kiosks. Zinc provided a way to print something without the pesky Windows print dialog. Does AIR provide a similar solution?
    No.

  • ITunes Connect - Export Compliance - Encrypted Sqlite

    I am submitting my app to Apple App Store.  In the Export Compliance section, I have to declare whether or not my app uses encryption.   My app is using Air's builtin Sqlite with encryption.
    I believe I need to get an Encryption Registration Number.  Has anyone been through this process with Apple/Air/Sqlite combination?  I have gotten a lot of opinions, but I'd like to get a definitive answer from Adobe or Apple.
    Apple Export Compliance link
    Encryption Registration (self classification) link
    Adobe Air Sqlite link
    Thanks

    You should answer "no" to question one. Base64 is encoding, not encryption, anyone receiving the data can decode it without needing an encryption key. It doesn't involve encryption any more than XML or JSON would. Here's a short discussion on the topic:
    http://stackoverflow.com/questions/1513552/is-base64-considered-encryption-in-an-iphone-ap p

  • Noob needs help re offline desktop db app - is FB the right tool?

    Hi,
    Thanks in advance for reading, and being patient with my long-winded-noobiness!
    I am a self taught (read as: big gaps in my knowledge!) independent web designer/developer, with experience in developing PHP/mySQL database web-apps - both with DW, and by hand-coding.  I've been approached by a potential client asking if I could build a simple CRUD desktop application, and am trying to figure out if I can leverage my existing knowledge in doing so.  It's something I know I could develop in a snap for the web, but I'm left realizing I don't know the first thing - or even where to begin learning the first thing! - about desktop software development.  I'm hoping Flash Builder might be just the ticket for me (I'm not sure if the client will want to wait around while I learn JAVA!!), since I already own and am familiar with CS5.  I've been going over all the documentation, tutorials, etc. that I can get my hands on, but am finding my brain a little overwhelmed and frazzled, so I'm hoping one of you wonderful folk might be able to offer a simple answer!
    Can I use Flash Builder / Flex to develop a strictly offline, local desktop CRUD application, but one which connects to a (local) mySQL database (ideally with PHP, since that's what I already know) - without the end-user having to separately install a local server?
    If not, any suggestions?  As well as Flex, I've been looking into Java (but am finding the learning curve quite steep), and Filemaker Pro 11 Advanced (which allows you to create a runtime - but I'm finding it a bit restrictive, and would rather not have any Filemaker branding on the finished product),
    In case you're wondering why I don't just convince the client to create a web-app instead, the data stored would be of a sensitive nature, and the main target demographic is baby-boomers, many of whom are still very wary of the interwebs
    Thank you so much for any help you can offer!
    Cheers,
    David

    Actually, I would think that Flex would be ideal using AIR with a SQLite database (the database is built in to AIR apps). However, if you've not done programming with Flex before, I won't trivialize the learning curve you have ahead of you. If you haven't already done so, go through Flex in a Week or get the latest Training from the Source for Flex 4 and get comfortable with the Flex workspace and programming environment. You'll like come to love it but it's a bit different than PHP. It would be an easier transition, I think, if you had a heavy background in JavaScript or Java so that you felt comfortable using OOP programming techniques. If you already structure your PHP programs with OO principles, it'll be an issue of getting used to the language and, if I were guessing, that might take you a month or two. That's my 2 cents worth.

  • Custom installer and database migrations

    Has anybody blogged or have info on the process of creating custom installers for AIR? I mean complete custom installers not just a silent install of the runtime and then the AIR installer?
    I want to be able to install my AIR application's sqlite database on a fresh install, but leave the current database and update it through ActionScript if the install is replacing an earlier version of my app. My feeling is that, in addition to copying the basic files from the project directory, the customer installer just needs to remember to rename the MyApp-config.xml and place it in META-INF/AIR/application
    Any ideas about a pattern for approaching DB migrations would be most appreciated! I like how rails migrations work, and am thinking to try to create something similar internally within my app to manage the sequence of database changes that would be needed between the user's current version of our app and the new one they're installing.
    I think an upcoming incremental release of AIR will have some installer changes...is that right?
    Thanks for any help or ideas!
    - Daniel McQuillen
    McQuillen Interactive

    Joe,
    Thanks for your helpful response. I think you're right that the database management steps would happen on app startup after checking a version number stored in the DB.
    What I'm wondering, however, is if there's a best practice for managing these incremental changes to the DB. My current direction is to create a class MigrationsManager, that creates an array of class Migration ( with a single migrate() function ) to manage each necessary and incremental change. Meanwhile, a "migrations" table has one column "version" with a UTC timestamp as an integer and is updated on each migration.
    Rails does migrations with up() and down() functions on their base migration class, but the down() function isn't applicable since I can't imagine I would be rolling back earlier migrations on a user's DB.
    In the end, I guess I'm just fishing of the best way of managing the different scenarios encountered when 3 years down the road you have an audience with all kinds of different versions of your app/db because of differences in how assiduous they were in updating to the most recent version.
    - Daniel

  • Annotation based depedency injection for Flex

    Proof-of-concept implementation of simple IoC container with
    the ability od annotation based injection. I'd be happy to hear
    some opinions and hints fot further developemnet. I need some
    professional advice from developers. Do You think this is a good
    way or just a dead end ?
    Container
    description
    and
    Metadata
    injection
    Feel free to comment on blog. The source is not available yet
    - it's planned on November.

    Here are the ORMs that I have found so far. None seem to have a dedicated following, and all seem to lack documentation.
    http://flexorm.riaforge.org/
    http://code.google.com/p/airorm/
    http://code.google.com/p/air-activerecord/
    I would love to see an ORM solution that has a more active following and that is being actively maintained. Unfortunately I lack the experience and knowledge, not to mention time, to set one up myself and maintain it on an ongoing basis.
    There seems to be some hubbub around http://www.matsiya-technology.com/introducing-sofa-an-adobe-air-orm-for-sqlite/#comments, but not sure if this project died or not. There don't seem to be any links to anything implementable.
    What other ORMs do people use for AIR? I haven't been able to find much of anything else. (Using an ORM for FLEX is a bit redundant, as most of the times the data will come from mysql and will be handled by PHP first, then transferred as RemoteObjects, althought I would think it is possible to build FLEX apps that stand on their own.)
    ~Mike

  • How do I eliminate the use and creation of big files in the profile - places.sqlite, urlclassifier3.sqlite, places.sqlite-wal?

    I want to eliminate the use and creation of big files in the profile - places.sqlite (10MB), urlclassifier3.sqlite (5MB), places.sqlite-wal (1MB)?
    Ffor urlclassifier, I tried disabling safebrowsing options (in security menu or in about:config), but file remains. Also if deleted it is still re-created with 5 MB.

    Start at http://www.mozilla.com and download the latest
    version. '''At the completion of the download don't let the setup start Firefox for you, when the setup ends, start Firefox in your normal manner this way you will be less likely to create a new profile.'''
    The extra startup pages are temporary -- read them. The next time
    Firefox comes up you should be back to starting with your normal home page.
    '''Note: Firefox must be down once the install starts. '''
    Close Firefox with File>Exit. Then make sure Firefox is not running --
    On Windows: check the "Processes" tab in the Windows Task Manager.
    '''On Mac: Firefox > Quit then Command+option+Esc, if Firefox running use Force quit'''
    Permission errors on Mac:
    '''If you were getting permission errors on a Mac, download the latest
    Firefox version, then uninstall and reinstall Firefox. Do not remove
    your profile directories and files as they contain your settings,
    bookmarks, history, extensions, passwords, and cookies.'''
    in any case once you are on 4.0 you might want to take a look at "(fx4)"
    * Fx4: Firefox 4.0 Problems and Orientation (#fx4) <br>http://dmcritchie.mvps.org/firefox/firefox-problems#fx4

Maybe you are looking for