Windows Phone 8: Export app data - windows-phone-8

I have a Windows Phone 8 app where users register some simple data in an SQLite database.
As any good data collection app I want the users to be able to export his data to do whatever with. Most notably export to the Android version (where this functionality already exists).
How do I achieve this?
Solutions I have found/considered so far:
Write to a commonly available area, such as Documents. Is not implemented on WP.
Attach it to an email. Does not exist on WP.
Save in the public photos folder. You got to be joking me if this is the only way..
Transfer through a webservice. Would be nice but a serious step up from saving a file.

Related

How to deploy resource files for a windows store app

I am working on a windows store app, one of the workflows within the app would allow the user to export a report in html format. The html report relies on a css file so I would like to ensure that the install process could deploy the file in a local folder. If not I would need to read out the file from the assets folder (within the install bundle) and manually write it out but that seems pretty kludgy
https://learn.microsoft.com/en-us/uwp/api/Windows.Storage.KnownFolders?view=winrt-22000
mentions that "The Documents library is not intended for general use." so would require use through file picker but I would prefer to be able to export the document without user intervention without additional store approval headaches (apparently adding Documents library capability to manifest requires additional Microsoft store approval).
Questions
When I create files within the store app it seems the location options are limited and I can only write to Localfolder (which is actually hidden and users cannot easily get to it) - There must be a way to create a file within the MyDocuments directory that is easily accessible by users but looks like that is off limits to a windows store app? So what is the best approach to write reports to storage that can be easily accessed by users
How can one deploy files to a specific directory during install time? Assuming there are some installer commands/manifest directives that would allow this capability?
Or maybe there is a entirely different mechanism to allow for this functionality within the store app and I am just looking in all the wrong places...

Ionic 5: How to write to local JSON files?

I'm developing an Ionic-Angular mobile application that involves tracking user progress. While I'm familiar with how to read from locally defined JSON files (and render that data), I've been unable to find any solutions online to write/append to local JSON files.
Until I'm able to utilize something like Google Firebase, I'd like to be able to just store this data by writing to local JSON.
Is there any way I can do this or is a database the only solution?
I'm assuming this is a web application. There is no way you can access the file system of the user to persist the data.
Other options
Index DB (save the information locally to the user at the browser level). User can go to the mobile device settings and clear it if required.
Use a mock api if this is only during the local development purpose (Use json-server and watch the database json file. You can update the database json file and it will reflect)
If you are building a hybrid application using ionic, then use one of the cordova plugins available here.
Use an actual backend service which persists it in the database.

Windows store app access file system

I'm developing a Windows store app and need to display files in user computer like in file explorer. Everywhere it says windows store apps only access "library" files and not other locations on the hard drives of PC. And I don't mean something like FileOpenPicker, I want to show file on may application like explorer.
What is the library I should use? System.IO class missing those methods on store apps. I know it is possible. Cos I have seen many applications in store has done that. Few examples are
https://www.microsoft.com/en-us/store/apps/file-browser/9wzdncrfj29m
https://www.microsoft.com/en-us/store/apps/my-explorer/9wzdncrfj0lm
Thanks in advance
Apps like the ones you mention typically use a FolderPicker to let the user pick the root of the file system and then remember that permission in a FutureAccessList for later use.
Your research was correct: apps cannot get general access to the file system. APps can declare access to the libraries, and app have automatic access to their local data, but anywhere else requires user permission via a picker or equivalent. See File access permissions on MSDN.

Is there a way to persist cookies or HTML5 localStorage across WebBrowser instances on Windows Phone?

Short version: I have a WebBrowser control hosted in a Windows Phone 8 app. How can I store values from javascript so that they persist across the user closing and reopening my app?
Long version:
I'm developing a Windows Phone 8 application that has a single WebBrowser control hosted in a single MainPage.xaml page that lives for the entire life of my app. I created the app with the "Windows Phone HTML5 App" project type when creating the project in Visual Studio 2012. 99% of my application is hosted in web pages (on the internet, not stored on the phone) that I direct the WebBrowser to go to when the app starts up. In my application's web pages I'm trying to persist data across pages and across sessions. For example, once the user logs in once then I want to store that on the phone so the next time they start the app they don't have to log in again.
Cookies and HTML5 Local Storage (via window.localStorage.setItem and getItem) both work fine for sharing data across pages in the app while the app is running and even if you switch out of the app (via the Windows phone "hard button") and go back in. But if the user exits the app by pressing the hard "back" button then the next time the app is started all localStorage and cookies seem to be gone.
Is this the expected behavior? I guess I'm not sure where WebBrowser would store the data (Isolated Storage? Or maybe in the same place it's stored if going to the web site with Internet Explorer?). In any case, if there's no "fix" for this, can anyone the best way for me to provide my own storage mechanism so that I can let my javascript code persist values across instances of my app running? I'm happy to use the app's Isolated Storage if only I knew of a way to get and retrieve values from it using javascript. Thank you.
I'm not sure if this is expected behaviour or not.
To get at the Isolated Storage you will need to use JS/.NET interop.
if you want to trigger the persistent storage from JS:
Use window.external.notify in JS, generating a JSON string (for instance) to pass along to the .NET side. That could be written to IsolatedStorage without the .NET having to parse the data. You could use IsolatedStorage.AppSettings or a full file depending on the size of the data.
Alternately you could trigger the process from .NET:
Call WebBrowser.InvokeScript to call a JS function which returns the same JSON string representing your data.
The .NET side could detect and restore this data on startup and use WebBrowser.InvokeScript to pass the JSON string back into the WebBrowser via a JS function.
You'd of course have to deal with error cases (attempting to restore bad/corrupt JSON).
Also, if you trigger this from .NET in response to the App.Closing event you need to watch out that you don't take too long writing data.
The faster you run the better, but this definitely needs to be done within 10 seconds or the OS will kill your app.
See MSDN docs for WebBrowser.InvokeScript() and ScriptNotify registration to window.external.notify.

App Dev ::Windows 8::how to provide news updates

I am trying to build a Sports App for Windows Store .I am not able to understand how am I suppose to change the data day on day. The App initially will have some static content and the data has to be updated daily. Kindly guide me how to do this , since this is my first App for windows store.
I assume you have the data on a server somewhere. So use the HttpClient control to access the data, use Linq/XML to parse it, and then load it in your UI however you've designed it to do so.
You can show updates in a live tile with this sample: http://code.msdn.microsoft.com/Simple-Live-Tiles-575b1d66
Also look at Windows Azure Mobile Services: http://www.windowsazure.com/en-us/develop/mobile/