I am new to Windows Phone 8 development. Would like to know if there is a way to store a file received to a particular location on device. It could be using an API, through ActiveSync or MDM.
Thanks in advance.
Windows Phone 8 doesn't allow for free-for-all direct access to the user's hard-drive to read or write files. You'll have to use usecase specific APIs depending on the type of media you're trying to store. I've answered a similar question in the past regarding WP8's read-write access for known file types # Windows Phone 8: Media file access
A few highlights:
Your app can use IsoStore to read & write files only accessable to your app. See IsolatedStorageFile API or ApplicationData.Current.LocalFolder API for that.
You can store pictures using MediaLibrary.SavePicture or MediaLibrary.SavePictureToCameraRoll methods.
You can store songs using MediaLibraty.SaveSong method.
Other then those APIs I'm not familiar with any other file write APIs to the OS from the top of my head. You can probably use a remote server, but that's pretty much it.
Related
I am making a mobile app using Cordova and I need to save some sensitive and not so sensitive data inside the phone. I am a bit lost on what is the best way to do it.
I need to save:
A JSON web-token (for authentication).
A response from server (I save this to populate my page in case the GET request fails).
Coordinates information when user is logging data to the app (for later upload to a server from with in the app). These will be many separate logs, and can be large in size for local storage ~5-10 MB.
Till now i have been successfully saving everything I need to the local storage but I don't think that is the correct way to do it. So that is why I need some help in deciding what is the best course to take from security point of view.
Saving server response is just for better UI experience and static in size so I guess local storage is a good option to use.
But web-tokens and GPS logs is sensitive information and I dont want to keep it in the local storage as it is accessible from outside the app.
What other options do I have?
Cordova still doesn't have encrypted storage.
Is saving to files a good approach? This here says that data contained inside cordova.file.applicationStorageDirectory is private to the app.So can I use it to save the logs and the token?
The plugin also lists the file systems for Android and iOS and lists which of those are private.
I am currently working with android phones but want to extend the app to iOS later. I have never worked with file systems and caches before so I am a bit lost.
In OS X (tested in 10.8 and higher), it is possible to add a file attachment (like an email or a PDF file) in an already created or in-creation event by drag-and-dropping it into the event (EDIT: or event by selecting Add attachment/file).
A similar question was asked in 2013. According to the Mac Developer Libary, there is no place to store a file in EKCalendarItem or EKEvent. Still, Apple does it.
Does the Calendar app use the notes property in some way to store such file? Or does it upload the file to iCloud and link the file in the event to it?
There is no single answer to your question. It depends on the server (Fruux, iCloud, Exchange, Yahoo, ...), client version etc.
There is a simple answer to this: Can I attach files using the EventKit API? No, you can't. EventKit functionality is very limited. The 'notes' property maps to the (first or last? ...) iCalendar description property.
For iCloud and OSX server the OSX/iOS client should do CalDAV managed attachments. For servers not supporting this, the client might inline the attachments in iCalendar attachments. But if I remember right there are also cases in which the client keeps the attachment just local and refers to it via a file: URL in the ATTACH property.
Summary: If you want to attach files to iCloud (or other CalDAV servers), you need to implement a CalDAV client.
Is it possible to get a handle on a file which is opened by any external app via my application?
Using Cloud-Storage Apps as an example, I would like to track changes to a file opened via the Storage-Provider App, so the manipulated file can be uploaded again afterwards.
There are two possible answers here, depending on what kind of app you're implementing.
For general tracking purposes, you can try using the ContentsChanged event of the StoreFolderQueryResult/StorageFileQueryResult classes within Windows.Storage.Search. That is, you create a file or folder query for what you want to watch, and then register an event handler. Generally speaking, this works well for stuff on the local file system; it's not guaranteed if you're trying to run a query on files/folders whose backing store is elsewhere.
The subject is too detailed to be described here, but you can refer the "File and Folder Queries" in Chapter 11 of my free ebook Programming Windows Store Apps with HTML, CSS, and JavaScript, Second Edition, page 607. Even though I focus on JS as a language, the discussions of WinRT APIs like this are useful when working in any language...plus the ebook is free so there's nothing to lose.
The other mechanism would be useful if you're implementing an app that provides the interface to a cloud storage backend, like the OneDrive app that's part of Windows. In this case you'd want to use the CachedFileUpdater contract. See Appendix D, page 1288, of my aforementioned book.
As I understand the share contract for Windows 8, when I provide some information in a share contract, I should see any installed apps that are capable of consuming that information. I have the following code:
request.Data.SetText(myString);
However, when I select Share, I'm presented with only the mail app. What I'm after is a way to launch a work processor (e.g. MS Word) from my app. Is there something else that I need to do to mark the data I'm sharing as "compatible" with Word? Or is this just not possible because Word is a desktop app?
You cannot use the share contract to move data from a Windows Store app to a desktop app. If you look at Sharing and Exchanging Data - http://msdn.microsoft.com/en-us/library/windows/apps/hh464923.aspx - it states, "One advantage the clipboard has over sharing is that it's the only way to move data from Windows Store apps to the desktop, and vice versa."
It's true that you can't share data to desktop apps, also the target app needs to register itself as a share target for sharing to work.
You mentioned though that you wanted to launch Word. This is possible using the Launcher class if you have a Word file that you need to open:
var file = await ApplicationData.Current.LocalFolder.GetFileAsync("Test.doc");
await Launcher.LaunchFileAsync(file);
I am hoping to create an iPad app to do the following:
Download data from a user's machine/local server
Encrypt this data and store it securely on the iPad
Provide an API so that others can write specially signed apps that query this API to access the secure data.
Its is the last requirement I am starting to think is "impossible". Does anybody know whether it is possible or not and if not of any solutions?
Thanks
If you want to share data between applications, a good solution is to create a custom clipoard type, and have both applications access it.
You can also write your data in a file, and ask iOS to open that file in another application. This other application will then open and decrypt the contents of this file.