Windows Phone 8.1 How to permanently remove Roaming Settings? - c#

I've stored some data in the ApplicationData.Current.RoamingSettings following the Example here http://msdn.microsoft.com/en-us/library/windows/apps/xaml/hh700362.aspx .
The problem is that after storing the data in the RoamingSettings and then removing the same data using ApplicationData.Current.RoamingSettings.Values.Remove(key) (I've checked and actually the data are no more there), if I Uninstall and re-install the App on my Phone the Data I've deleted are back in RoamingSettings...
I've tried also ApplicationData.Current.ClearAsync() that clean all but after uninstalling and re-installing the app same thing.. the data are back.
Any suggestions?

RoamingSettings are designed to work like that. They can be used to store settings between devices. After you uninstall the App from all devices, the settings would persist in the cloud for some time in case the User installs the App again. If you want to use only local data - take a look at LocalSettings.
You will find more information about Guidlines for Roaming Data here at MSDN.
And here at the blog you will find similar answer:
Q. What happens to roaming app data when an app is uninstalled?
A. As noted in the previous question, an app’s app data folders are removed from a device when the app is uninstalled. Roaming app data, however, persists in the cloud so long as the user has the same app installed on other devices. When the user uninstalls the app from all of his or her devices, roaming app data continues to persist in the cloud for a reasonable time (a matter of a few weeks) so that it’s still available if the user decides to reinstall the app within that time. Note that when you make a change to an app project in Microsoft Visual Studio and that change (such as changing the manifest) forces a full reinstall, app data is removed as part of the process. References: Guidelines for roaming app data(overview docs).
So your to remove permanently your RoamingSettings you will have to wait.
EDIT - thanks to Pablo we have more detailed information here at MSDN:
Roaming data for an app is available in the cloud as long as it is accessed by the user from some device within the required time interval. If the user does not run an app for longer than this time interval, its roaming data is removed from the cloud. If a user uninstalls an app, its roaming data isn't automatically removed from the cloud, it's preserved. If the user reinstalls the app within the time interval, the roaming data is synchronized from the cloud. The current policy specifies that this time interval is 30 days.

Related

Compact framework application gets deleted when the battery dies

I am developing an application in C# .Net 3.5 Compact framework for a Handheld Computer which runs on Microsoft Windows CE 6.0.
I am able to create the installer and run the application, the hurdle what I am facing right now is, say the battery dies/you perform a Cold Boot on the device (the device is Datalogic Memor X3 http://www.datalogic.com/eng/products/healthcare/mobile-computers/memor-x3-healthcare-pd-814.html#), the application gets deleted, the user will have to re-install the application. I would like to know how to get rid off this problem? Is there something I need to do while building the Setup/Installer? There are other applications in the device which do not get deleted when performed a Cold boot.
Please advise.
Usually, the root filesystem of a Windows CE devices is RAM-based, using the object store. Mass storage devices are mounted as subfolders. This means that any application that is not installed on a folder connected to a mass-storage device will disappear when RAM contents are erased. In your case this happens when the battery dies because the device never actually turns off, just suspends and resumes.
You should try to install your application on a permanent folder, they should show a different icon in file explorer.
Most if not all vendors of Windows CE based devices offer a persistent storage area and factory reset / autoinstall procedure.
If the device is clean/cold booted, the 'normal' storage area is reset to factory default. So all custom applications and changes are deleted. When the device boots up, there is a OEM specific autoinstall process. You need to integrate your setup with the autoinstall.
Please see the Datalogic Memor X3 support page and look at the user manual on how to persist your application with this Datalogic device (I would have done that for you, but they require a registration).
UPDATE: see https://www.manualslib.com/manual/850035/Datalogic-Memor-X3.html?page=64#manual and read about Save Session and Save Setup.
At least you can use a SD Card with a special folder (ie 2577 for devices with ARM processor) and a custom autorun.exe inside. This will be executed automatically on every boot.

access windows 10 mobile root files and folders

I have a Windows 10 universal app that is running on a Windows 10 Mobile device. I noticed from the Windows 10 Mobile device, it does have a file explorer but it limits you to only see certain "Known Folders" such as music, documents, downloads, etc... and that is all.
Furthermore, when I plug the device into my development machine via USB, I can browse the device but again, only the Known Folders above.
In my app, I am writing to a log file and that log file is stored to LocalStorage, under a folder for my app name, for example:
var dataPath = ApplicationData.Current.LocalFolder.Path;
I simply need to browse MY LOG FILE, that MY APP CREATES, in MY APP FOLDER. I read about a ton of, in my opinion hacks, to get access to this file/folder. For example, there are some third party applications that still mainly claim to target Windows Phone 8/8.1 but will still technically work for 10 such as:
Windows Phone Power Tools
Isolated storage spy
etc....
Then I also read articles on how to use a file in Pictures (or voice recording) and go to file properties to then gain access to the root or to create a root shortcut on the development machine and copy it to the mobile device, however, these are typically a year or more old and no longer work on my device (I suspect MS patched these hacks).
So, all that said, I would like to see a good way to access the root drive for development, or at least my app folder in the LocalFolder so I can access my files (such as logs or the sqlite db file). Maybe there is a way already but my google searches haven't turned anything up just yet.
Thanks!
As you've known, we can use some third party tools like IsoStoreSpy or Windows Phone Power Tools to access Isolated Storage. Although they are designed for Windows Phone 8 & 8.1, but they can also be used for Windows 10 Mobile. With these two tools, we can access LocalFolder, TemporaryFolder and RoamingFolder. For more info, see similar question: Accessing storage of simulator/device while debugging.
Besides these third party tools, there is also build-in support in Windows 10. We can use App File Explorer to view and manipulate files stored by your sideloaded apps. This is a new, cross-platform version of the Isolated Storage Explorer from Windows Phone 8.1. This tool should be able to work no matter your application is deployed in Debug mode or Release mode. But please note that this is a new tool added to Windows Device Portal in the Anniversary Update.
To use this feature, we must enable Device discovery and Device Portal. Then we can access application storage in web browser like following:
For more info, please see Device Portal for Mobile and Using the App File Explorer to see your app data. Also the similar question: Windows 10 Mobile: how can I see inside on my app folder? might be helpful.
I had a similar problem to solve few months back. I ended up doing two things:
I've implemented a 'Send Logs' button in settings that would upload logs to a ftp server. Actually it was a bit more than that, all installations of this app were managed by a central server and there was 'Get logs' button on the server side that would send request via push channel to the device to get the logs.
Got my hands on a Interop-unlocked device that I would use if the app was in a state that would make first option not possible.

WinRT - Roaming App Settings - Are they persisted across versions?

I was reading the MSDN article about "Accessing App Data with WinRT":
http://msdn.microsoft.com/en-us/library/windows/apps/hh464917.aspx
In the section Roaming App Data it says:
If the app data on a device is updated to a new version because the
user installed a newer version of the app, its app data is copied to
the cloud. The system does not update app data to other devices on
which the user has the app installed until the app is updated on those
devices as well.
It also says that the Roaming App Data is deleted if the app is not used for 30 days.
I think that "Roaming App Data" refers to ApplicationData.Current.RoamingFolder.
I don't understand if the same thing applies to Roaming Settings (ApplicationData.Current.RoamingSettings.Values). Are they also not shared across versions? Are they also deleted after not using app for 30 days?
RoamingSettings use the same engine as the roaming application folder. So, the same restrictions apply. Data may be expired after 30 days if not accessed.
I'd suggest you consider the roaming settings as a convenience, and if the 30 days will be an issue, keep important settings locally and consider the roaming as a convenient way to synchronize settings when the application is used more frequently. You could also potentially use something like OneDrive to store settings if needed.
There are group policy settings that can disable roaming and OneDrive though.

local vs roaming vs temporary windows app data

I am trying to use the correct class for storing data in my windows app. I used IsolatedStorageSettings on the Windows Phone app, but I need to use the Windows.Storage class in my Windows store App begin written with VS Express 2013
I need the data to remain secure on the device when the app is not in use and don't want it to be saved in the cloud or removed unless the use logs out of the app. SO it just need to stay secure while the user remains logged in regardless if they are using the app or its in the background or Windows shut it down for memory reasons.
I suspect roaming is not the way to go but which should I use: local or temporary?
OK, after some more research I found this.
http://msdn.microsoft.com/en-us/library/windows/apps/hh464917.aspx
Looks like local app data is the correct method as temporary data can be removed by the device at any time. Roaming as it says is for data that you want to use across devices that is stored on OneDrive(old Skydrive).
And if someone needs the example code then here is the link for a simple example.
local
Data that exists on the current device and is backed up in the cloud.
roaming
Data that exists on all devices on which the user has installed the app.
temporary
Data that could be removed by the system at any time.
localcache
Persistent data that exists only on the current device.

Are there any issues with Isolated Storage and Windows Vista?

My problem is similar but not the same as that exhibited in:
"Could not find file" when using Isolated Storage
I've written an application that saves user settings in a file in isolated storage, I'm using the user store for assembly storage.
The application checks for a file in Isolated Storage on startup, and if it's not there assumes that it's the first time the application has been run and asks the user to configure it, this process then saves to Isolated Storage.
In Windows XP this works fine, I've not seen any issues whatsoever. However, I was running a demonstration to the client on their Windows Vista laptop and when I ran the client for the 2nd time to show that the settings were saved the application couldn't find the file.
Are there any known issues that might cause this to happen in Windows Vista and not Windows XP?
Both references to retrieve Isolated Storage are in the same .cs file, so it's definitely the same assembly that is making the call, and I didn't log in as another user, so I know it's the same user.
Isolated storage location will change as soon as you change the application version.
The proper place to store application configuration is in \ProgramData for all users and \Users\\AppData for user settings.

Categories