I have completely rewritten one of my Windows phone 8 app. I use IsolatedStorageSettings to store user specified settings in both "old" and "new" versions of my app. In my new app version I just convert the old settings structure to new one.
Now I want to test the app update case. So far I have tried the following.
Build "old" and "new" xap files using VS (same app id and publisher id).
Install the old xap using WP Power Tools
Save some settings in app, check using WP Power Tools that the settings are saved to __ApplicationSettings
Update the app xap file using WP Power Tools
Check that the __ApplicationSettings is still there with "old" data
Launch the new app, __ApplicationSettings is now empty and all old data has gone.
What im doing wrong? Ho should I test the app update case, and how to keep the old __ApplicationSettings in place?
Is there some id's (?) which are now different in my old and new app and the platform thinks that the old __ApplicationSettings does not belong to new version and deletes it? Im using completely new namespace in my new app.
UPDATE
Im still struggling with this issue, how how to keep old isolated storage settings (__ApplicationSettings). In the file itself there is references to my app namespace. For example I have saved collection of MyCollectionItem's, in the __ApplicationSettings I find line:
System.Collections.Generic.List`1[[MyOldApp.MyModels.MyCollectionItem,
MyOldApp, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]],
mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=xxxxxxxxx
Now as my new app uses completely new namespace, this is not working?
Also I noticed that when I first time save something to IsolatedStorageSettings with my new app, the old settings (__ApplicationSettings) are erased.
Any idea how to migrage the IsolatedStorageSettings from old app to new one, as basically my new app is completely new app.
Theres two part to this question,
Using persistent storage like IsolatedStorage to share data between two versions.
testing the versions upgrade keeping data.
This might help you with 2nd part,
submit a Beta version of your older app.
install it and add data > will be stored in isolated Storage
submit a beta for new version, while submitting choose Add New, DO NOT replace.
you will get notification on mobile that the new version is available, choose to upgrade.
after installation, you should see your data.
lengthy process, but worked for me. hope it helps
Related
I updated to El Capitan and Xcode 7. I tried to change the default starting location by going to Product> Scheme> Edit Scheme, but the location doesn't change for simulator builds. It stays the same even if I change the location at runtime by using Debug> Simulate Location.
It only detects a location changes on an app first installs or after the second startUpdatingLocation Core Location Manager call for run time changes.
I have resorted to using the device to test location changes.
Is any one else having similar issues? I have tested several versions of my app and have concluded that something is wrong with the newest version of Xcode. I am not seeing any similar posts online.
I am writing my Windows Phone 8.1 Silverlight App (NOT RunTIME framework).
I have to questions:
Which is the App manifest file for Windows Phone 8.1 Silverlight? WMAppManifest or Package.appxmanifest? as my project contains both
I created a method in Mainpage of application which detects that is it the first time this application is running or not. If it is first time execution of this app, registry of 120 keys (IsolatedStorageSettings.ApplicationSettings) is created and app moves to WelcomePage.If the execution is not the firsttime, means user has opened this app before, it skips the registrycreation method and directly goes to homepage.
When I upload this version 1 of app to store and users install and use it. What when I add more keys to registrycreate method in version 2 and upload version 2 to store. How will be those new keys get created? Even, when user updates the app, the registrycreation method will never run.
The "Silverlight" app manifest is WMAppManifest.xml, but you still need to include the "RT" manifest Package.appxmanifest and, if you ever use any of the RT namespaces that require certain capabilities, you should check those capabilities in the Package.appxmanifest too. Eg "Internet (Client & Server)" if you are using things like Windows.Networking.BackgroundTransfer.
You'd need to add some code to check if the information or information structure has changed every time the app is run (or resumed), so that in the event of an update (and change in the keys), they get added, even if your "first run" code doesn't fire. Make sense?
If you know the keys numbers will always get bigger then watching the key count will work. You could also include a key with the version so you can tell which version the data was created with.
You can use Windows.Storage.ApplicationData instead of IsolatedStorageSettings in Windows Phone Silverlight 8.1. ApplicationData supports versioning with the ApplicationData.SetVersionAsync method so you can change the data format safely when you update the app.
Either way, when the app runs check if the data's version is the latest that the app knows about. If not then run your setup and migration code to add the new keys and replace the out-of-date ones.
The data version doesn't have to match the app version (you may update the app's version without changing the data). You can compile a data version constant into the app's data handling code and bump it whenever you change the data format.
I have already published an app with the Version 1.1.0.0.
When I'm trying to update the app with a new .appx file after creating the AppPackage I'm getting this kind of an error.
It's a Universal app where i've published the first versions of the Windows Store & Windows Phone. Now i'm trying to update the Win Phone app where i'm facing the issue. I can't even see the replace button near the Delete option.
Whenever i try to upload the new appx or the bundle file, it's not letting me to submit.
Any help would be appreciated.
Looks like a Firefox problem - use IE and this seems to work (at least has for mine!)
Try IE, Firefox doesn't show 'replace' option. Add new option is not for update. If you use replace then you will be able to update.
I am running an Air App I did for the desktop, from the actual installed executable already deployed in the machine (Not from Flash Pro / Flex dev. environment). For some reason the app will not read a text file stored in the same application folder unless I run my app as administrator from the OS.
When I run the app as admin, or within the development environment it works fine. Maybe this is related to some security issue? I read the adobe air documentation, and this should work...
I am using openAsync/readUTFBytes on user as shown here:
var continueGamesConnection:FileStream();
var continueFile:File = new File(File.applicationDirectory.resolvePath("continueGames.txt").nativePath.toString());
continueGamesConnection.addEventListener(Event.COMPLETE, openSavedGames);
continueGamesConnection.openAsync(continueFile, FileMode.UPDATE);
function openSavedGames(event:Event):void
{
continueGamesConnection.removeEventListener(Event.COMPLETE, openSavedGames);
var content:URLVariables = new URLVariables();
var loadedContent:String = new String();
loadedContent = continueGamesConnection.readUTFBytes(continueGamesConnection.bytesAvailable);
content.decode(loadedContent);
variableX = content. variableX
//etc, etc.
continueGamesConnection.close();
}
By the way, I have also, tried using FileMode.READ, and others, and it still gives me the same problem. Only works if ran on admin mode or from the dev. environment.
It's very frustrating, I tried reading other posts without any luck... What solutions do people use for this kind of problem?
I have seen that you can set the app to run as admin somehow, and I guess that could work. However, this should work just fine, since it doesn't seem to violate any of the security APIs of Air. Seems like an overkill. But even so, how do I do that?
You help is greatly appreciated!
Typically for security reasons, applications do not have write permissions to the File.applicationDirectory.
It is recommended you use File.applicationStorageDirectory instead as that is the most appropriate place to save user data (such as a save game file).
Alternatively, you could also let the user browse to a directory with the FileReference class which may or not have permission.
Assuming that you are using a Windows SO, the problem that you have is about user access restrictions to folders C:\Program Files and C:\Program Files (x86) and there is nothing you can do from Flash or AIR to solve it. You could modify you security settings by right click on the folder or you should simply avoid using the app folder to store anything
I'm upgrading windows phone 8 application. I created Universal app (Windows.Phone 8.1).
The settings in old WP8.0 application are saved in following way:
IsolatedStorageSettings.ApplicationSettings.Add("MY_SETTINGS", value);
Question:
How can i get this settings when app is upgraded to WP8.1 (Universal app).
I try the following:
var localSettings = Windows.Storage.ApplicationData.Current.LocalSettings;
var isContains1 = localSettings.Values.ContainsKey("MY_SETTINGS");
var roamingSettings = Windows.Storage.ApplicationData.Current.RoamingSettings;
var isContains2 = roamingSettings.Values.ContainsKey("MY_SETTINGS");
But no "MY_SETTINGS" are found. (isContains1, isContains2 == false):\
Many Thanks for help
LocalSettings in WP8.1 works differently than those in WP8.0 - where settings were saved in a file (after serialization). The file is __ApplicationSettings - take a look at it (via IS explorer tool) and you will see its structure - part of it is a serialized dictionary. I've made some research once, which showed that all the old files are preserved during the update - which means that the settings are still there.
Once you update your WP8.0 app to WP8.1 and you want to read your old settings, you can retrive the values from the file.
This blog post has your exact answer, including the code needed to deserialize the migrated settings file!
You can use ApplicationData.LocalSettings It would Get you the application settings container in the local app data store. here is a Dev center link in which its Described how to use it.