Monotouch - playing video on network share - c#

We are building an application that will only be used within our infrastructure. We have videos on a windows file share which we want to play within the app. The videos are working when they are embeded in the app but as some of them are so big we want to move them out.
I am trying to reference the videos using an smb:// url but that doesn't seem to work.
I am also trying to reference them using a file:// url to no avail. I can see the folder from the dev mac.
Should this work or do I need to do more work to make it happen? Such as streaming?

iOS is not able to access any kind of shared directory (smb:// or file://), you will have to add code to your app to connect and transfer the files yourself if you want to use a shared directory like that.
But iOS can access web servers, so if you can set up a simple http server (Apache or IIS), and serve the files using a http protocol, it should work just fine.

Related

Can I create public/permanent files from Xamarin App?

I'm making an App where I need to create CSV files with data I need to load in a software in a Windows machine. I want to connect an Android Device via USB to a computer and get the file from there. Is there any way I can create a file that's visible for a computer?
From what I've found you can only create cache files and files only visible to the app (neither my PC or the File Manager on the phone can see them).
I thought about creating a service in the network and send the data to that and create the file in the server but that would add more failing points and of course is more work, besides sometimes the app could be running in parts where the Wifi doesn't get to it and would mean I would have to do a temporal file and somehow upload it when it connects back, so not practical at all.
Of course you can create files and folders on external storage of the android device, which is publicly accessible. Refer to this guide.
Note: You need to get permission WRITE_EXTERNAL_STORAGE to write and READ_EXTERNAL_STORAGE to read from device's external storage.

Unable to access images folder present in another machine from Android app through Wifi

I got stuck in my application with images part, when trying to access from Android app, where the images are located in remote machine and need to access through WiFi connection.
Here is the complete scenario of my application.
I have an windows application which will save images to the folder where application got installed. dotNet application saves and retrieves images without any issues.
But I have android application which consumes wcf service (both windows and wcf). Consuming service part is also working fine in android and windows application.
Problem arises with images. Actually in database I am saving image location rather than saving the image as a byte array. But android app unable to access the location of the images folder. Because the location where application is installed was unable to access through LAN or Wifi using the URL like "IP Address/AppInstalFolde/LocalImages/ABC.jpeg."
I tried to allow access to that machine by sharing that folder across LAN, but still I could not able to access the images from Android app
I have tried with all possible ways and now in the situation that I cannot make a whole application change by allowing to convert an image to byte array in the database.
I am looking for alternative way to solve this problem.
Any help highly appreciated.
You can host a website, contains all the images in the IIS (The same as hosting WCF services). And then the Android App will connect to the website to get the images.

Windows Application accesing files on Webserver

I'm trying to make a Game Launcher, that looks through all of the game files located on my Webserver on the internet, and updates the local files, depending if the "If modified since" value has changed.
Im using C# with Windows application, and my code does works to access some files, but not all. Files like .DLL and files without and extension (.FILE) doesn't get allowed access, which I don't understand.
I've tried to add this MIME type to my Web.config, which solves the access of some files, but not all of them.
<mimeMap fileExtension="*" mimeType="application/octet-stream"/>
Basicly, I need a way where I can access any file on my webserver, through HttpWebRequest/Response in a C# Windows Application.
If you are using IIS, probably you need to add the corresponding MIME-types in the IIS Manager as well.

Windows Phone 8 file sharing

I have created an app that makes use of file types that are not standard to Windows Phone and I have registered my app to these extensions and they can be opened in my app perfectly from example the email client.
My application can modify the file as well as generate completely different ones. I then have an internal file manager page where users can delete files and choose to open then.
My problem now is that I want the user to share these files via email, Bluetooth, tap+send(nfc), etc. with a menu pretty much like the you get in the gallery(photos) app on Windows Phone. Is this a standard function that I can somehow access, or is there another standard library or anything really that I can use to as quickly as possible implement file sharing?
There is a ShareMediaTask but it is intended for sharing media files on any kind of files, so you need to implement everything by yourself.

Thoughts about using Silverlight In Desktop Apps?

To summarize, as we all know,
a) Silverlight is expected to be hosted by a browser, and runs in an isolated sandbox so that there won’t be any security issues
Silverlight don’t have direct access
to the file system, other than the
isolated storage area
There is no
direct way to open common dialog
boxes like File Save in Silverlight (Though Opendialog box is supported).
b) Silverlight can’t access local resources like a printer
What are the ways to go beyond the sandbox, so that I can host a Silverlight application locally, to read files and save them back if required, to hand over data to a printer, and so on..
Update:
Is full WPF is not an option for me? No. I'm also interested in a cross platform solution - for instance, you could host Silverlight in Mono Web browser control, so that you can run it virtually anywhere.
The idea is to re-use the same application that I'm building for web in my desktop as well, by providing separation of concerns at some areas - like persistence, resource access etc.
Scenarios:
1- Some kind of gadget container, with access to local resources.
2 - A desktop Silver light based media application
Update:
I just did a POC to enable me to access printer and save files locally, of course through a shell where I'm hosting my Silverlight application. If you wan't you can have a look at the post here in my blog
Two ways I can think about is,
Create a "Shell"
Host the HTML Page with Silverlight, in a Winforms desktop application, using a web browser control, and communicate to and fro using HTML DOM. Then I can request the hosted shell to do things like printing. See details here
Mono also has a web browser control - based on FireFox XULRunner instead of IE - not yet succeeded in loading Silverlight inside that. Another option might be using Webkit.
Embed a web server
Embed a light weight web server with in the Host application, and handle requests to perform such operations. You can probably define a protocol on top of HTTP for things like saving to a local folder, sending data to print etc.
Is a full WPF application not an option for your situation?
As you probably know Silverlight uses a subset of WPF so you may be able to change your application relatively easy.
A wpf app would be easier than having a web server etc bundled within your application.
You wont in the foreseeable future be able to have access to resources such as printer and files (apart from isolated storage) through Silverlight as you know.
You could have a seperate part of your app to upload files to the webserver then read these in your silverlight app from a service.
Depending on your printing requirements (e.g. if you just want to send everything to an office printer) you could send the informaton you wanted printed to a service that will then print it for you. However I am guessing you want each client machine to be able to print in which case this wont work for you.
I am attempting to also reuse a codebase for both desktop and silverlight. There are two options that I know of in addition to the ones mentioned
If you directly reference (instead of a project reference) a silverlight dll from a normal project, it should work. This would let you reference a silverlight dll for both projects.
Have two project files (one wpf, one silverlight) that point to the same set of files. You might have to have to use a few compiler flags here and there, but this should let you use the same files for both.

Categories

Resources