in order to test my WP7 application with the emulator, I have to read a text file with a large input.
I have some problem to read it and to use the isolate storage.
More in details, the application is not able to read the file from my local disk.
How can i put the txt file into isolate storage?
Many thanks
Justin Angel has a blog post showing how to automate the emulator (for testing purposes) and it also includes details of how to copy files directly to the isolated storage for an app:
http://justinangel.net/WindowsPhone7EmulatorAutomation
See this question:
Open a project file in phone7
I give an example of how to access a file (resource) from your project and also how to copy that resource to isolated storage and access it as needed.
A simple way to test this would be to package the file in the XAP. If you don't need to modify the file while your app is running you can leave it there and just read it. Alternatively you can load it down to isolated storage at a convenient time while your app is running.
Related
I want to download folders from Azure Cloud Bash Shell.
For this I went to the storage account of the azure cloud shell and located a 5 GB .img file.
The full location to access the file is as follows.
https://csg10032000b5360942.file.core.windows.net/cs-rajat-agrawal-kpitd365-onmicrosoft-com-10032000b5360942/.cloudconsole/acc_rajat.img
(The URL needs my access token to be downloaded.)
I downloaded the file in Windows 10 but upon right click and mount it gives the error "The disc image file is corrupted".
Also I am unable to open the file using WinRar, 7-Zip.
Regards
Rajat Agrawal
To download the files from the Azure Cloud Shell, it's not a good way to download the image directly. You can change a more appropriate place to store the files or create the folders and then you can download them directly. This place is in the path /home/user/clouddrive. When you create the files or folder in this place, it shows like this in the file storage of the Azure Cloud Shell:
Well, in this situation, you can download them as you want from the file storage, not the image.
After some struggling, I managed to open and check contents.
Just add it VDI extension and open it with 7-Zip
I created a Documentation folder in my project, and added the user guide, a pdf file, to my project (as content, copy if newer)
Using a click-once deploy, the file is copied - but casual users will not be able to navigate to its location using explorer. How can I configure the deployment to make it easy for the user to find this file when they want to read it?
I do not think there is a ClickOnce solution to this, you need to create the folder after first run (for example ProgramFiles/Appl) and copy the help file to the folder manually.
Another way to handle this is to copy the file to MyDocuments/yourappname/appdata/ when your application starts up or when the user asks for hte file, and then direct the user to it there.
I am working on an music application and after long testing I have came to the conclusion that for the firs run I have to Load in the XAP File the Levels Data instead of downloading it from a web service because it is faster and not so time consuming.
My question is if someone knows a method to read the file listing inside an application folder.
I have written a method that copies the data from one folder to the LocalStorage of the application (IsolatedStorage) and all I need is a way to read the content of the folder.
I have to mention that this is my first app for windows phone.
If the file is in the application folder - which means it is packaged up in the xap - you should be able to get the file using the Application.GetRourceStream like I've seen with apps that have local databases they package, but want to copy over to Isolated Storage after install.
Here's an example (from this page http://msdn.microsoft.com/en-us/library/hh202860(v=vs.92).aspx):
Stream str = Application.GetResourceStream(new Uri("appdata:/MyReferenceDB.sdf", UriKind.Relative)).Stream;
appdata: is what tells it to look in the application directory. Only other option is isostore:
So you have already copied the file from your xap resources to Isolated Storage, and you want to read the file back out of Isolated Storage? (Is there a reason you can't just load the data out of the xap, without copying it to Isolated Storage?)
Try this tutorial on files and Isolated Storage: http://www.windowsphonegeek.com/tips/all-about-wp7-isolated-storage-read-and-save-text-files (I recommend reading the whole thing, but I linked specifically to a page on creating and reading text files).
This question contains code for listing the files in your isolated storage, if you can't just hardcode your filename:
windows phone 7 File Listing IsolatedStorage
we are making an Application for OS X, however, when the .app is copied on another MAC, we have problems with reading and writing files
on one MAC, everything works great from the start...
the other one will not write certain files and another 2mac will not write certain different files
if i go to show application contents and wants to edit the file by myself, i get a writing permission denied
how to distribute an MAC application so there are no such issues? so all files can be read and write by the current user
does there have to be some authorization or code sign, or smth. different in this form, in addition to normal code?
thank you
It sounds like your application tries to write files within its own application bundle. The correct solution here is: DON'T DO THAT! The only time your application bundle should be written to is when it's installed or updated.
Files that the application needs to write to should be stored in the user's home folder, generally under ~/Library. See this note in Apple's dev docs.
Preference and settings files in ~/Library/Preferences/<appbundleid>.plist; use NSUserDefaults.
Data the app manages for the user in ~/Library/Application Support/<appname> (the docs say to use the bundleid, but everyone -- Apple included -- uses the app name instead).
Cache files in ~/Library/Caches/<appbundleid>.
Temp files, use NSTemporaryDirectory
If you need to share settings & files between users, that should generally go in /Library/Application Support/<appname>, except that you really shouldn't be doing that at all.
In the past I've always used PackageMaker to create installers. An installation package can authenticate with root privileges so you can set permissions after the install. I don't have it in front of me right now but if you look around you should be able to see a Post-Installer script line. Write a shell script that manually sets the permissions of each file you have in question and then have the package execute that script after the install is finished.
You can find PackageMaker at /Developer/Applications/Utilities/PackageMaker
Hi everyone
I would like to know if it's possible to deploy my app assets directly to Isolated Storage once the app get deployed.
I'm currently extracting them from code but this make the app's first launch too slow and it will be declined once it's submitted to the marketplace.
I'm wondering if there is a nice trick to make the process faster
Thanks
There's no way to automatically deploy to IsolatedStorage on app installation.
There are a few things you can do to try and avoid a delay on first start up though:
Refer to files directly in the XAP where possible.
Split the assets into multiple dlls so that only those needed are loaded into memory.
Load content to IS in the background and prioritize this so that the resources are loaded as needed.
You should not need to load image or video files into IS just to view them.
You should only need to copy the XML files if they're going to be updated. If you just want to read some data this doesn't need to be done. Also, if the XML files just hold initial data/state this could be loaded from the assembly directed and only saved to IS when first persisted.