I set a folder as SDCard on simulator. When I try to reach it, throwing FileIOException.
Folder which I set as SDCard: D:\SDCard
DB which I try to reach: file:///SDCard/Databases/MyDatabase.db
There is also a "Databases" folder under D:\SDCard.
Please try the root folder as SDCard/BlackBerry/. So move your database directory into blackberry directory.
Then your path becomes file:///SDCard/BlackBerry/Databases/MyDatabase.db
Related
Basically my app works like a iCloud-based note app (for example, logseq). Users first select a folder in Files app, then my app starts downloading/updating the contents of the folder.
So I implemented folder selection via UIDocumentPickerViewController, after I got the folder path in Files app. I tried downloading a hardcoded file like (<the folder path user just selected>/fileList.json) via FileManager.startDownloadingUbiquitousItem, got 257 permission error (the file does exist in my icloud drive). Then I followed the answer from this answer to call startAccessingSecurityScopedResource. It always returns false and the same 257 error returned.
Perhaps, I cannot access a random file from a selected folder? but how can those note apps work by simply letting users selecting a root folder?
Answering my own question after some debugging. Call startAccessingSecurityScopedResource on the folder path you grabbed from picker, not its subfiles. After that, you can start downloading its subfiles via startDownloadingUbiquitousItem
I am working on an app that saves files to the documents directory, and then saves an absolute path for each of those files in an entity using core data. The issue is that each time I rebuild and run my app on my device, the app is saved in a different generated directory, and those file paths are now incorrect. However, my documents directory is still preserved.
I have three questions about this:
If an app is updated on the store, does it then go in a different generated directory, thus invalidating any absolute paths that could be saved in the documents directory?
This is extremely unlikely but is there any way to specify in Xcode to build the app to the same directory the previous build was in?
Is there a way to specify in Xcode that you would like all documents and data wiped with each new build you load on the device?
Thanks everyone!
You said:
"I am working on an app that saves files to the documents directory, and then saves an absolute path for each of those files in an entity using core data."
Don't do that. Ever. The path to your documents directory will be different on different devices, and different if you delete your app and reinstall it. Absolute paths are pretty much guaranteed to fail.
Use paths relative to the sandbox directory in question (documents directory, temp directory, etc)
I am having a problem with my MVC application after I set a different output folder instead of the default Bin folder . I also deleted the bin folder .
This resulted in Global.asax file exception "Cannot load the type Global.Mvc application" during application runtime.
I am trying to get rid of all the bin folders to have just one output folder for my application . I would like to know if it is possible at all to get rid of the bin folder completely . Am I missing some setting here or is it a must to have bin folder ?
I find a way to change bin folder.
Just like you say, When we change the default output folder:"bin\", then it will display some exception, Maybe that's a bug from visual studio.
Actually a lot people want to change the default bin folder to some RAM disk position, then it will save HDD life(don't let the HDD always write again and again), also very fast for read and write.
We can't change the default address, but we can change it use this way(delete bin folder before):
Open CMD.exe(administrator mode), put this code and execute:
mklink /d "Your project folder\bin" "new address(like RAM disk address)\bin"
mlink can redirect the original folder position to new position. Then, all fine such like you need.
I am building my first iPhone app with CSS, HTML, Javascript and PhoneGap. I want to use SQLite as the database, so i am using the following tutorial as inspiration:
http://coenraets.org/blog/2011/10/sample-app-using-the-phonegap-database-api/
The following code determines weather to use data from the database, or to populate the database with data first:
function onDeviceReady() {
db = window.openDatabase("EmployeeDirectoryDB", "1.0", "PhoneGap Demo", 200000);
if (dbCreated)
db.transaction(getEmployees, transaction_error);
else
db.transaction(populateDB, transaction_error, populateDB_success);
}
After debugging, i found out that every time i run the app, it populates the database, so
if (dbCreated)
never executes.
I want to have a look at the SQLlite file, so i am using SQLite Database Browser to locate it, without luck. From the following question:
How to view the data in sqlite file running in iphone application?
I can see that the file should be located somewhere in this folder:
user/Library/Application Support/iPhone Simulator/
But the iPhone Simulator folder does not exist.
How do i make the simulator save the database to a local file?
Each time you run your application on simulator, it creates a folder inside iphone simulator folder .Make sure your Library folder is visible and you are using the correct path.
To make library folder visible you can run the following command on terminal:
chflags nohidden ~/Library
Here`s the path for my iphone simulator folder to use as a reference:
/Users/alexandreoliveira/Library/Application Support/iPhone Simulator
Another thing to notice, usually the sqlite database get saved inside documents folders:
Users/alexandreoliveira/Library/Application Support/iPhone
Simulator/5.1/Applications/some-weird-numbers/Documents/
I'm using FoneMonkey to test my app.
When I save a script, I can see it's directory in the log, but it is wrong: There is no such path as .../Users/Name/Library/Application Support/iPhone Simulator/4.3.2/Applications/5B286FB6-D58E-4D43-947D-3B63591289BB/Documents
I can't even find iPhone Simulator folder on my Mac... How is that? Where can I find my scripts?
the Library folder in user directory is hidden. unhide it or user the terminal to get there.