I want to save a text file on the wp7 file system that doesn’t get deleted on uninstall of the app.
I want to save the version of the app and language preference selected by the user so that it doesnt get deleted when the user upgrades the app. I dont want to use IsolatedStorage instead i want to use the device’s file system.. Is this possible? If yes how??? As of now am doing this:-
public void SaveLanguageAndVersion()
{
IsolatedStorageFile appInfoFile = IsolatedStorageFile.GetUserStoreForApplication();
//create new file
using (StreamWriter writetoAppInfo = new StreamWriter(new IsolatedStorageFileStream("appInfo.txt", FileMode.Create, FileAccess.Write, appInfoFile)))
{
string appVer = new StringBuilder().Append(Utils.getRelVersion()).Append(":").Append(Utils.getFWversion()).ToString();
writetoAppInfo.WriteLine(appVer);
string appLanguage = CacheManager.getInstance().getApplicationSettings(Utils.APP_LANG);
writetoAppInfo.WriteLine(appLanguage);
writetoAppInfo.Close();
}
}
but the appinfo.txt file gets deleted on uninstalling of the app. I wanna overcome this.
If i use LINQ SQL can i overcome this problem and achieve what i want? i.e., Save the app level info like the version and the language of user’s choice?
This is not possible. If you want to have device / user specific data, consider using ANID or Device ID and store it in the Cloud
have a look at this post. Gives you info on how to get ANID and DeviceID
http://www.nickharris.net/2010/09/windows-phone-7-how-to-find-the-device-unique-id-windows-live-anonymous-id-and-manufacturer/