I know that MS Windows Phone has not nice policy of forbiddings simple saving files on the phone. I want to have one file consisting data which looks like that:
//string double
A 444,0
B 332,240
...
This is database of tone corresponding to the frequency in Hz. How to built it into the app so I can read it later. I do not want to create during the run of the app but want it to be created already as a source of data for the app so I can read it.
Add the file to your project, and in the properties window for the file, set the build action to Resource.
In your code, you can retrieve a StreamResourceInfo instance by calling the Application.GetResourceStream method and then reading from it’s stream using a StreamReader.
The path to the file will be “/AssemblyName;component/Folder/File.ext”. Where “AssemblyName” is the name of your assembly, and “/Folder/File.ext” is the path to the file relative to your project root. For example. The following code reads the “/Data/tones.txt” file:
You can download a sample project based on your question here: http://sdrv.ms/RnVbQ3