Unity3D Android file browser - c#

does anyone know how would I create a file browser in Unity for an android OS? I don't actually know where to even start, even after I did a lot of search on it.
What I want, is for the user to be able to go through his folders on the phone or the SD card and he should be able to choose a text file, I would then save the text from the file into a string in my app and continue from there.
Thank you!

The file navigation is as simple as using the .net 2.0 file browsing functions.
http://msdn.microsoft.com/en-us/library/system.io%28v=vs.80%29.aspx
However you will have a lot of headaches trying to get Unity to play ball with Android's Intent broadcasters/receivers and will require a lot of fiddling with Java to launch the other Activity.
http://developer.android.com/training/basics/firstapp/starting-activity.html

You might want to look into this: http://wiki.unity3d.com/index.php/ImprovedFileBrowser and its relevant forum post. You might need to modify the script to work on Android, but it should be a good start.

Related

Sharing for Facebook in Unity Example

I was checking for some tutorials how to implement Share button for Unity games. I want to share my game with custom picture, text and link together with my description over the share automatically.
I found this link: https://developers.facebook.com/docs/games/services/sharing
but I am not sure if this thing even works anymore. I found somewhere that I have to create custom HTML file with all og metadata inside in order to work this through. I tried that too, but when I press share button, Facebook automatically scrapes data from my website and not custom HTML file. In Unity I have initialized everything correctly, so there should not be problem in initialization, I guess something is either wrong in my code or in Facebook side.
Can someone share simle example how can I make HTML file connected to my unity game in order to correctly share custom data (Title, description, image....) like on link: https://developers.facebook.com/docs/games/services/sharing
Kindly appreciate it.
Best regards

SMS from Android device to C# application on computer

I want to make a fullscreen application that can display the latest messages received on the Android device (an SMS wall).
I've tried pulling the MMSSMS.db file from the device with ADB, but the file can't be read on my computer. It seems like it's encrypted or something, because on the phone itself you can open and view it.
Is there any library or other solution available that can accomplish that? I've searched a lot and didn't find anything on the web...
Edit: i've tried using the sqlite.dll both with SQLite Browser and in C# itself. Both showed an empty database while it was readable (and not empty) in the built-in Database Viewer of Root Explorer.
I am not specifically asking for third-party libraries or tools, only if someone has had any experience with this and/or can help me further...
Edit 2: I came here only when I didn't find a solution after searching a lot on the web.
Thanks!
I imagine that its a database file, most likely sqlite. You need to install a library to address such a file. http://system.data.sqlite.org/index.html/doc/trunk/www/downloads.wiki

SilverLight: How to record a video from a web camera

I have searched how to use SILVERLIGHT to record video for days but got no luck.
Most articles related to SL only talk about how to record audio or snap a picture rather than recording a video file and save it somewhere.
And I found there is no resources about it on Internet(I am surprised!!!)!
So could you provide me an example code with proper explanation?
I am waiting for it.
PS: I do not want to use Flesh as none iPhone nor iPAD supports it.
Thanks
Fortunately, Mike Taulty's source code can easily be updated to work with Silverlight 5. You can download the fixed source code and try it out (Disclaimer: all code courtesy to Mike Taulty, I merely fixed SL5 compatability and ran a cleanup). Use your favorite diff tool to see the changes I made.
I have tested it, and it generates video files that can be viewed in VLC media player (after selecting build index to fix the corrupted index). As the file format is not 100% correct, the files can not be opened in Windows Media Player etc... but I'm sure that can be fixed.
You should, however, be aware of the fact that Silverlight is not supported on iPhone, iPad, Android, and Windows Phone (Windows Phone apps are made on a special version of Silverlight, but can not run Silverlight applications in the browser).
Unfortunately, after undergoing hundreds of hours researching on the possible solution, I finally found the answer in a book called: Pro Silverlight 4 in C# (Matthew MacDonale, APress).
According what is said on the page 436, although you can do it with Silverlight 4 (you have to write your own file header helper, store the row data as byte arrays and later on you have to convert them into a raw video data and what is worse is the audio and video are separated.), it is just not practical and worthy to do it. Because it requires reams of complex, handwritten code to convert it, and the conversion process is computationally expensive, which makes it extremely difficult to do in real time.
So I guess this would be the conclusion of my question. Now what seems still make sense for me is to find out why Microsoft doesn't support it and what is the new technology which is going to be used/ has been used to replace the SL.
Is it HTML5? But as far as I know, there is only a video tag in HTML which can only be used as a video player, but no tag to support to get the access of a web camera and save the captured video+audio at the same time as one file onto somewhere which could be a local hard drive or a network storage.
I hope all dear you could come up with some thoughtful advice.
I am going to leave this question un-answered for a few days to see whether there could be someone who can come up with some fantastic solution.
Thanks again.

How to get files to WP7?

Let's say I'm writing a eBook reader for Windows Phone 7. Now the first thing that the user will need to do is add some books to his device, and since I don't offer a online book store or similar service, the only option is file transfer from his PC to the phone. Is he able to do this, how? Then how do I access this file. Can this file be placed in Isolated Storage of my app? I was searching around and didn't find any solution, in fact I believe that similar scenario is currently impossible but I just wanted to hear your toughs on the problem and probably some workaround ideas.
I haven't seen any way to add files from the desktop the phone is connected to. However, you can build your own software for the desktop that uses a WCF service and allows connections from the phone. The phone can download files from the desktop WCF service. See a similar concept here, you can implement the concept discussed in the post the other way round.
HTH, indyfromoz
Would you not be able to download the ebooks using some kind of webservice/http?
(Obviously you'll need a website, somewhere for this)

Streaming audio file to another computer

This is what I am trying to do. We are 5 people in a room. Everybody has a PC. Each PC has mp3 files but only one of the PCs has speakers (ex. called Speakers-PC). So, instead of asking the person on Speakers-PC to play you a song you want, I was thinking of an application that can take an audio file from a No-Speakers-PC and send it to the Speakers-PC. The Speakers-PC can then play the audio file. Of course, if multiple files are sent, the application on Speakers-PC will have a queue.
So, is it worth digging or it will be just better if we buy wireless speakers and rotate the transmitter (instead we are now rotating the speakers) :)
Any ideas on how to implement something like this? I am familiar mostly with .NET technologies.
Any broad or specific help would be greatly appreciated.
Best Regards,
Kiril
Many media players come with web interfaces already. One of the winamp ones, for example, is http://www.winamp.com/plugins/details/92511
VLC is the swiss army knife of media streaming, take a peek at the extensive feature set :)
I quick thought.
I assume the "speakers-PC" use winamp. If so then create some playlist file and load it with winamp. Also everyone of you should share your folders containing mp3 files so that "speakers-PC" could have access to them. From this point you have two options:
1. Everyone who wants to add his own song to a playlist opens it in any text editor and adds a new line at the bottom of the file.
2. You could create a simple web app to manage this same playlist file. You know .NET, rignt?
I haven't checked if winamp locks playlist file it currently plays. If it does then this idea is not worth a penny.
Here is basic structure of playlis file discussed.
http://forums.winamp.com/showthread.php?threadid=65772
I'm sure you can find in google
Good luck

Categories