Can I open Byte array of Docx/Pdf file to WebView in Windows phone - windows-phone-8

I get byte array data from specified API, and I want to show it on web view in my application.
Is there any option to open word file in Windows Phone with web view ?

You can't show those files in a WebView inside your application. The regular way to show those files by storing them in a file and invoking LaunchFileAsync() to hand displaying off to the system. If only one App supports the file type it will launch directly - otherwise the user will be prompted which App he wants to use to see them.
See MSDN for more information

Related

How to open .docx files with Web View in Windows Phone App 8/8.1 without default MS-OFFICE

Is there any option to open word file in Windows Phone with web view ?
I get byte array data from specified API, and I want to show it on web view in my application.
No
You are out of luck
There are two way you can handle the DOCX files. You create a file and use Launcher.LaunchFileAsync to let the system open it in the default app (MS Office installed on Windows Phone). Or you can try to find a third party library that can display DOCX files.

Abobe Air/Flex 4.6 Remote File Viewer

I have a Air/Flex desktop application and I'm trying to create a component within the app that can view files on the web server is is already connected to. It just needs to access one particular folder that will contain PDFs, Images & Word documents. I also want the ability to click on the files and having them open in their default desktop applications.
Is this possible and how would I go about doing this?
It's possible but not with your Flex/AIR app alone. It cannot view files/directories on server by itself but it can communicate with your server via webservices, AMF, or any other back end based service. Typically the back end reads the folder and send this information to your app. Your app can open those files in corresponding app but only if those files are available on disk so your app will have to download them prior to opening them.
Every Application has different needs but I myself usually save anything to a desktop or you can use the App storage container as well. As I use only the desktop I download what is needed OR been asked for, and the visitor has the choice of keeping it or if not needed it gets automatically deleted! this way you can use whatever PDFs, Word, Images etc. use read and write (re-write) as well as creating PDFs on the fly with Images, text etc, and that way a visitor also can print directly at his or her own leisure. regards aktell

Get access to pdf and other format file on local disk (like mediaGallery)

I'm developing a Chrome application where I want to do basic stuff with currently downloaded files(mostly I want to move them to a new location using an application or extension whichever is possible).
I'm able to get access to the image, audio, video file using the mediaGallery API of Chrome apps. Is there a possible way I can get access to and being able to move other format file from their current location to some other location using Chromium apps?
You certainly read the contents of any directory that the user has given you access to. And, once the user has done this, you can retain the entry so on subsequent executions you don't have to keep asking the user to select the directory. Then, once you have a file, you can use the file API to manipulate it.
This is in principle all the media API does, except that it comes with knowledge of some built-in media directories.

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.

Passing fields to a silverlight app from the command line

Silverlight is made so that you can run it in a browser. That is cool. So, if I want to pass variables from the command line so that it can be used to populate fields in the silverlight app, how is that done?
You know, like you can with javascript (I think) or php (I am pretty sure).
Silverlight has Init parameters which is a key/value map that you can fill in your Html page and get the values in Application_Startup event. However this does not apply to Silverlight apps running in OOTB (out of the browser) mode.
This MSDN page shows a trick if you run your app both in and out of browser, so that you can save the InitParams values when running in the browser and save it back to Isolated Storage for when you run the application in OOTB mode.