I would like to know if there is a way to open files which are not located in an IsolatedStorage on a WP7 device ? Internals are not really well documented so...
As a developer using the official Windows Phone 7 developer framework, there is no way to access files that are stored outside of isolated storage. In the Mango framework there is an additional AppData location, but this is also sandboxed and is used for deploying SQL CE data to.
You can get images from either the media library or the camera using their respective Choosers: PhotoChooserTask (http://msdn.microsoft.com/en-us/library/microsoft.phone.tasks.photochoosertask(v=vs.92).aspx) and CameraCaptureTask (http://msdn.microsoft.com/en-us/library/microsoft.phone.tasks.cameracapturetask(v=VS.92).aspx).
These are the only files that are accessible that are not in your app's IsolatedStorage.
In Windows Phone 7.1 / Mango, system data (like Contacts) is shared using the PhoneDataSharingContext. However, there is no indication that third party developers will be able to expose there data using this class and certainly no documentation for it yet.
My guess that it is somehow registered in the application manifest. However, unless it's supported your application won't get approved, even if you do find out how to do it yourself.
with xna, you can access (read-only) the application folder using TitleStorage.OpenStream()
Related
I'm currently working on a UWP application and one of the things I need to do is write bytes to files using the System.IO class. This is because one of the libraries my application depends on uses the System.IO.File.WriteAllBytes() method.
Using the StorageFolder class isn't quite something that I'm looking to do since a couple of the projects I am making (some are not UWP, some are CLIs) depend on this library I have written and the StorageFolder is only available in UWP.
I've added broadFileSystemAccess as one of the capabilities of my UWP application. However, after reading the documentation carefully I found out that this capability only affects the StorageFolder class and not the System.IO class. In addition, I'm the only person who will be using this application, so I thought that enabling the file access rights in the System Settings (as shown in the image provided) would help. However that did not help at all
Here is the exception message that I am getting
"Access to the path 'C:\\proj\\proj_tig\\Project 112\\bin\\x64\\Debug\\AppX\\Dependencies.zip' is denied."
Is there any possible way to use the System.IO.File.WriteAllBytes() method at all in UWP?
Is there anyway that allows me to use System.IO in a UWP application
For checking the path, and it looks a apps installation folder, unfortunately, the installation folder is read-only, we can't write data into. we suggest you use app' local folder that with full permission, and you could use System.IO namespace to access. For more detail please refer this document.
I want to transfer a file to an Android device using a USB cable and file explorer, and then access it in my Xamarin.Forms app.
As far as I understand there are two ways to do this (and please correct me if I'm wrong):
Since it's an image file - Just put it anywhere and let some
background task find it and add it to what seems to be a virtual
folder of Images. And then access it there.
A more general solution - browse to that specific folder.
Both solutions rely on using FileInfos etc. but unfortunately the folder structure is much different than I see using windows explorer - instead of Alarms, Android, etc. which I see on windows explorer - is see cache, config, etc. using C#, and access to some like data is not allowed (I get an exception). I also tried finding information on how I would search for all images on the device, but either it's not as simple as I thought it would be, or I'm using the wrong keywords.
The file will be put there by a user, so it cannot be added to the project's resources.
Xamarin has a nice way to navigate the files in android, using Android.OS.Environment.ExternalStorageDirectory.Pathwhich you can concatenate with your directory/filename so you can save/access data.
If you want to open the android dialog box so the user can find a file in its device, you can take a look at: https://developer.xamarin.com/recipes/android/data/files/selecting_a_gallery_image/
Remembering that you need to add the READ_EXTERNAL_STORAGE permission to your android manifest file and check runtime permissions. Runtime permissions can be easily checked with https://github.com/jamesmontemagno/PermissionsPlugin
I want to know, if it is possible to have shared internal and external (SD-card) access in a mobile c# UWP App. I know, that one can decide, whether to install new Apps internally or on SD-card via Settings -> System -> Storage.
The problem: I have a SQLite database, that I would like to run on internal NAND storage at all costs (for obvious performance reasons) and then I have a lot of images, that don't necessarily need to be on the internal NAND, but can be "outsourced" to the SD-card (so they don't clutter up valuable space especially on budget phones).
The MS documentation here suggests, that one can use the external SD-card like a drive. That solution however is not suitable to me, because it can only open file-types specified in the app-declarations and also these files would be visible to everyone and are not in a hidden app-container, like apps are.
Is there a solution or workaround for my issue?
I wrote an app on my iPhone. It's a more portable and smaller version of my pc software. I activated the File Sharing feature on my app so now I can transfer files through iTunes. But I want my pc software to be able to read or write files to that shared folder on my iPhone without having to do it manually through iTunes.
I have big constraints:
I can't use a Jailbroken iPhone/iPod/iPad
The vast majority of my customers don't have Internet access (It's a farm management software so even cellular are not available in some area)... :(
I heard there is a way using Manzana and MobileDevice.dll (itunesmobiledevice.dll). I don't really know how to use these dll. I tried to use Manzana a little but I can't access my folder since it's not a jailbroken iPhone.. Can someone help me with a little bit of code example?
Or is there other ways to make my iPhone app communicate with my C# application using the USB cable without internet access or Wifi?
mobiledevice.codeplex.com. This project should let you send and retrieve files from the phone
I'd suggest seeing if you can use the iTunes scripting interface. Add the COM reference iTunes 1.1 Type Library to a project and you can control many parts of itunes automatically. I can't find the documentation for it, but you can play around with the library and see if there is something to access the file sharing section.
Here's a decent introduction to using it:
http://www.codeproject.com/Articles/7723/Controlling-iTunes-through-COM
Is there a way to get an associated icon in C# without using any DllImports?
When I use Icon.ExtractAssociatedIcon I don't seem to get the icon for drives, folders, SpecialFolder's in Environment or any files on network attached folders. So is there any other way to get an icon using .NET?
.Net have only one method for extracting associated icons, and you already mentioned about it. Every lib you can find uses pinvokes, because they get icons from windows. So if you need to fully portable icon extraction engine, you must write it by yourself, sadly, but this is the only way (and hide all system specific code inside).
Not an answer to your question but might be of use.
You can get most of ms windows icons from this file
$VisualStudiosInstallationDirectory\Common7\VS2008ImageLibrary\VS2008ImageLibrary.zip
Substitute 2008 for 2005 if you still use VS2005