I'm making an app in Swift that will have a Realm database with some preset data in it when the user downloads it from the app store. I know how to make database entries when it's based on user interaction, but I can't figure out the best way to just have the data already there as soon as it's downloaded.
Any advice on this issue will be greatly appreciated,
Thanks in advance!
You can bundle a pre-built Realm file with you application that you copy over to the default realm path if there's no file already at that path.
Related
I have published one application on shiny server which basically takes input from users and save into SQLite database in back-end.
My concern is after publishing to shiny server when user is opening the form and saving their input i can't see any record saving in database.However it is working perfectly fine when i try to launch from R-studio without publishing.
I have put database file into shiny folder before publishing,i believe issue might due to the path of the database so is their any specific folder or path on which we suppose to put our database file?
Any help would be appreciated!
Are you sure that shinyapps.io supports write access for sqlite? There is a community post (see https://community.rstudio.com/t/shinyapps-io-and-sqlite-as-persistent-local-data-storage/19361). From this it is clear that shinyapps.io did not support local data storage at that time and there were no concrete plans to implement it. That was one and a half years ago, true, but it may simply be that it is still not be available at this point. That would mean that you can most likely read but not write sqlite.
Hopefully, you find an alternative to store data here: https://shiny.rstudio.com/articles/share-data.html
I’m new to ionic and in my Ionic Application, I need to store a pdf and image file in SQLite i.e in the app storage and should open within app. I will get the file from another database like MongoDB in the URL format. Could anyone of you help me out of this and suggest any references to complete the app storage using SQLite.
Thanks in advance.
I have researched on different aspects but could not find any.
i use phonegap for my application. i create sqlite database and copied it on memory card.
Is it possible to read data from the database on a memory card
thank you and sorry for my poor english.
No. You can't read the database from a custom path. The PhoneGap/Cordova expects the database to be in particular location. If not present, it will create a new database.
But you can move the content to the expected location and start working on it.
Some links to help are:
http://www.raymondcamden.com/2012/7/27/Guest-Blog-Post-Shipping-a-populated-SQLite-DB-with-PhoneGap
http://gauravstomar.blogspot.in/2011/08/prepopulate-sqlite-in-phonegap.html
I'm in need of some help in developing a desktop application with a pre-populated database. I have tried numerous ways to get this working including those mentioned on both Tidesdk's API here http://tidesdk.multipart.net/docs/user-dev/generated/#!/api/Ti.Database.DB and at Titanium Desktops old API here http://developer.appcelerator.com/apidoc/desktop/latest/Titanium.Database-module.
While the later (using Titanium not Ti) works in creating a database in the apps directory it does not install my pre-populated sqlite database which is located in the resources file of my app.
A couple of my attempts located below
var db = Titanium.Database.openFile('test_db.sqlite', 'test_db');
var db = Titanium.Database.openFile(Ti.Filesystem.getFile(
Ti.Filesystem.getApplicationDataDirectory(), 'test_db.sqlite'));
var db = Ti.Database.open('test_db');
As stated most of these manage to create a database with the name given but when trying to run something as simple as a db.execute(SELECT) of something I know would exist in my pre-populated db I receive an error stating
Exception executing: SELECT name, id FROM people ORDER BY name COLLATE NOCASE, Error was: SQL Statement invalid or database missing
I have searched high and low for something to answer this but everyone continues to refer to the aforementioned API's or to the Mobile API's Ti.database.install() which does not work either.
Is it possible with titanium desktop to use a pre-populated sqlite database or do I have to populate it after I create it? If so any direction would be helpful (where to place the .sqlite file in the app and what functions to call).
I am currently using Titanium Studio with a titanium desktop osx SDK of 1.2.0.RC4 as requested by tidesdk.org until they have released there open source sdk.
Thanks in advance
This is possible, I just used this feature in a recent desktop app, deployed it successfully to Windows and Mac.
In my experience, sometimes your database file can be corrupted, for example if you use the Titanium.Database.install command, and it cant find the file to preload from (maybe the first time you specified the path wrong for instance), it will create the file itself, any subsequent install commands will not work because it already thinks this database has been installed.
Have you tried clearing out the application data? This is where titanium installs the database. For Mac this is in your /User/Library/Application Support/APPNAME directory. Their is a directory for databases, delete this and try again.
Also, this answer on Titanium Q&A may help, it talks about the process with the Mobile SDK but the Database stuff is the same.
Hope this helps!
I am developing a playbook app, where I am creating multiple databases. Can I get the location of the file/db created. I need to delete that Database, but I couldn't find a way to drop it, so I am planning to delete the file that it is stored in.
You can't drop SQLite databases, as you have found (hence my suggestion to simply drop all the tables).
However, if you really must delete the physical db file, I think your best bet is to mount the PlayBook's file system, and then track the file down. This link may help in explaining the file system layout on the PlayBook:
http://supportforums.blackberry.com/t5/Tablet-OS-SDK-for-Adobe-AIR/BlackBerry-PlayBook-File-System-Layout/ta-p/773327
It depends on the OS and browser you are using, I have no experience with Playbook and its browser, but for example under Windows XP and using Firefox it's stored on:
C:\Documents and Settings\USERNAME\Application Data\Mozilla\Firefox\Profiles\YOURPROFILE
and in Chrome there are two possible places:
C:\Documents and Settings\USERNAME\Local Settings\Application Data\Google\Chrome\User Data\Default\
There you have LocalStorage and Databases folders.
Hope it helps