File Picker in Windows Phone 8.1 SilverLight - silverlight

I want to choose all files from the My internal as well as External Sd Card in Windows Phone 8.1 Silverlight App.
I have tried this bolow code
FileOpenPicker openPicker = new FileOpenPicker();
openPicker.FileTypeFilter.Add(".Mp3");
openPicker.FileTypeFilter.Add(".wav");
openPicker.FileTypeFilter.Add(".mp4");
openPicker.FileTypeFilter.Add(".wmv");
openPicker.FileTypeFilter.Add(".xap");
openPicker.FileTypeFilter.Add(".apk");
for this I have to specify file type. and yes I found a problem in these file type
if I have added code for .mp4 ,.png , .jpg it will open Picture Lib. of Phone but I have added code for other than these than It will redirect me on Option of Phone and One Drive.
So is there any solution which allow me to choose all file type from the sdcard
Thanks.

I found answer #thisLink according to it I just need to declare
fileOpenPicker.FileTypeFilter.Add("*");

Do you have Removable Storage capability in the app manifest file? https://msdn.microsoft.com/en-us/library/windows/apps/br230259.aspx

Unfortunately, it is impossible to access ANY file type from Removable Storage, because, as you know, you should declare all the file types you are using.
As Maulik Shah said, one can set filePickerFilter to all file types at once using wildcard (*):
fileOpenPicker.FileTypeFilter.Add("*");
As you can see you can access SD card storage from phone option.
P.S.You don't need to declare Removable Storage capability if you access files via file picker.

Related

Titanium Mobile Select File

I need to get a dialog box to open, to select a file.
To save a file, I need the user to choose a filename to save to
To load a file, I need the user to select an existing file
I can not find any file dialog in the API. Is there a method to popup a file select dialog?
First: This would only work on android since iOS doesn't allow this. (Of course you can do this but on iOS this doesn't make sense since files cannot be accessed by other apps and there is no SD card).
Unfortunately there is no File Dialog available in Titanium. You can check Appcelerators's market place for existing plugins or you try it on your own.
On Android you should be able to read the contents of SD card and display them in a tableview. All you need is Ti.Filesystem API. It allows reading and writing of files to SD card. But be careful: there were some changes in Android 4.1+ so that it seems not possible to share files with other apps since you can't make them globally readable. (It's not possible to share this File URL with an intent, i tried this. You need a ContentProvider for that, which is not easily to implement with Titanium since it requires native extensions.) But it may be possible that they are readable with another File Explorer.

Use Chrome portable to open a index.html file on the same USB stick for a homepage

IS it at all possible to set the Google homepage to a file located on my USB pen drive?
I can link it though the file path, problem being the drive letter would change depending on the system it is plugged into so a hard coded homepage link wont work.
Im unsure of the syntax to use to make it upen the file -
%USBDRIVE%/Webfiles/index.html
The page is used to help new users navigate the USB pen and get the info/files they require as its aimed as users with next to no IT skills or disabilities
Thanks Guys
You've probably found a solution already, but just come across your question and I recently had the same scenario. I'm assuming you mean on PC.
I solved it as follows:
In the PortableGoogleChrome folder (after portable chrome is setup on the usb drive), there is a default file called parameter.txt. I added the following in order to set the homepage to my local file. It is in a sub folder called 'resources' located on the usb drive root:
--homepage="\resources\index.html"
That's all for the parameter.txt file. That takes care of the homepage setting.
Now to launch portable chrome, I created a windows batch file called launcher.bat also at the root of the usb drive (call it whatever you like obviously!). I added the following code:
#echo off
cd PortableGoogleChrome
"ChromeLoader.exe"
The launcher file changes the directory to PortableGoogleChrome and then loads Chrome via ChromeLoader.exe which takes in your homepage or other parameters in Parameters.txt.
FINALLY, in order to create an application to replace the Launcher.bat file (as I figured a windows application with icon would be more intuitive to run than the batch file), I found a windows utility called bat_to_exe_converter which enabled me to convert the bat to an exe and supply an icon also (having tried to do so in C++, C# but errors because of needing supporting DLL's, this was much more straightforward).
Hope that's of use!

How can we create ringtones in WP7 Mango using mp3 and wma already on the device?

How can I create a ringtone using existing mp3 and wma files already on the device in WP7 Mango?
Can I use MediaLibrary to get the music files on the device, and then use the ringtone task to create a new ringtone?
What are my options?
You can't do that because you don't have access to media streams for the content that is already stored on the phone outside your application. You either must have the files bundled with the application or download them individually from a web server.
Something to consider is written on my blog.
You can not do this using files on the phone. What you can do (with Mango), however, is edit files on your computer, ensuring that they are mp3 or WMA format, less than 29 seconds in length, and less than 1 MB in file size, change the Genre to Ringtone, and sync it to your phone through Zune Desktop. You can then use the file as a ringtone.

What is XAP file on Windows Phone 7?

I really want to know what the XAP file on Windows Phone 7 is; how important it is; and how I can create it. Could you help me?
XAP is the application package - it is the distributable unit that allows you to install the application on a device (or emulator). Basically, it is a ZIP file with a different extension. If you change XAP to ZIP, you'll be able to read its contents fairly easy.
The XAP file format was inherited from standard Silverlight, and since WP7 is built around the same fundamental core, the file format remained unchanged.
Here is a pretty good description of what it does (remember, that even though it talks about Silverlight, the same main idea applies to WP7):
http://beyondrelational.com/blogs/dinesh/archive/2010/08/18/what-is-xap-file.aspx
In addition to Dennis' excellent post, one other thing about a XAP file - it's a ZIP file - so if you want to look inside one, then just rename it to .zip and then open it using a normal ZIP browser (e.g Windows explorer)

Icons from remote files

I have started coding an FTP client application (for fun). I’m trying to represent remotely hosted files with icons. For example, let’s say I’m browsing the root folder of an FTP server (/) and want to display the Backup.zip file with the icon association from that client operating system. On some systems, this may be the windows compression icon and other operating systems this may be WinZip or WinRAR icons.
I have the client browsing local files with the SHGetFileInfo() function. This works great with files that are local, however, this function requires the physical file in order to retrieve the associated icon. So, this will not work with remotely hosted files. I have found some samples of loading icons given a file extension, and this is really where the question comes in... What would be the best strategy to get icons associated to remote files?
Go to the registry every time and look up extension to icon associations
Create 1 byte files with each extension and use the SHGetFileInfo() function for remote files (using local 1 byte files as association for remote files)
Other strategies???
What would a professional software company creating an FTP client do?
Thank you for your time.
-Jessy Houle
I suggest that you don't go to the registry every time: go if you need to, but if you've already been for a given filetype then remember/cache that result (within your program) and reuse it.
Use the procedure here from a previous Stack Overflow question on the same idea and uses the registry instead of an actual file.
How can I get the filetype icon that Windows Explorer shows?

Resources