I am new to the windows phone 7 development world. I am developing an application in window phone 7. In window mobile application (smart device application) we can browse the content of the mobile device by selecting the tools -> Device Emulator Manager -> slecting the emulator & then after clicking the cradle we can browse the content of the mobile device. I want to know how to do this in windows phone 7 application ? I also want to know how to programatically access the content of the Window Phone 7 ? (for e.g I want to open the screen which we will be opened after clicking the upload button in asp.net. In that screen we can navigate between the folder structure of the computer. In such way I want to open the screen for window phone 7) Because I am developing an application in which I want the images from the existing mobile device. So I want to browse the content of the mobile device so that I can select the particular image from the existing content of the mobile device & after that I will dynamically add these images to the images folder of my application. Can you please provide me any code or link through which I can resolve the above issue? If anyone know anything that will also help me a lot. Please share anything whatever anyone knows.
Due to the security model of Windows Phone 7 and fact that applications are sandboxed means that it is not possible to create a file system browser on the device. You can only see files / the directory structure within IsolatedStorage and you must create these files yourself.
You can, however, use MediaLibrary.Pictures or the PhotoChooserTask to access the images stored on the device. These are the images youu'll see in the Pictures hub and, therefore are outside of the files you specifically put in IsolatedStorage.
You can only access the files/directories that are located in the Isolated Storage that is assigned to your application, and you can get a list of those via GetDirectoryNames (for folders) and GetFileNames (for files). You will have to implement a custom listing mechanism since there is no default storage browser component.
Related
During my app's runtime, I'm saving some data in txt file to location: Windows.Storage.ApplicationData.Current.LocalFolder
On Windows 10 PC, I can easile read this file in C:\Users\marcin\AppData\Local\Packages[app id]\LocalState\
How can I access this file, when I run the app on a phone? When I connect my device to a PC, I don't see an option to access AppData folder.
To Access App Data, You need Device Portal first. Below are the instructions from MSDN.
Head to the Settings App > Updates and Security > For Developers, and
enable Developer Mode and Device Portal.
Type the IP address displayed below the Device Portal options into your favorite web
browser.
Make sure you’re on the same network, otherwise your browser
won’t be able to find your phone.
You’ll also need to authenticate
yourself with the device.
Make sure you’ve got an app sideloaded (or
sideload one now using the “Apps” page).
Click on “File Explorer” to
see the tool above.
See This Link for Full info as to how to access App Data
Assuming you've side-loaded the app you can access it via the Device Portal.
To access the device from a PC enable the Device Portal in the "For Developers" section in Settings. Connect the device to the PC via USB and navigate to the device portal in the browser at http://127.0.0.1:10080
See Device Portal for Mobile and Windows Device Portal overview on MSDN for more details.
If you've deployed through the store then there is no external way to access the app's data. The easiest would be to save it in the RoamingFolder instead of the LocalFolder and then read the data from the PC side. Another option would be to provide a sharing feature in the app to share the log file via email, etc.
I have a xamarin.forms app, I would like to allow users of app (android/ iOS/ windows) to be able to select a folder location at the start of the app and all the app related documents should be saved in that particular folder.
For now when I try to build a simple app which reads a xml file from the folder I create and display data on a list-view. I browsed through the file manager in android to see where the file is located physically on android device, but could not find any folder with app name.
In simple words I want a folder on the device to be created, which will be selected by the user. And accessible from file manager.
The reason behind this requirement is, the app is going to record a mp3 file and save a recording to a selected folder. So whenever the user wants to change his mobile he can always copy the recording to the new mobile and not loose any of the recordings.
To be able to use any of the possibilities below you will have to write platform-specific code in Xamarin.Forms and then expose some interface that you can use back in your PCL project.
Android:-
There is a post Choose File Dialog on how to create a file dialog selector (with directory changer), although not in Xamarin.
You will want to point the starting location to a shared folder of some kind.
There is a Xamarin tutorial here that walks you through how to create a simple file browser.
iOS:-
For iOS you may be interested in the iOS Document Picker View Controller, here.
There is an extensive tutorial of how to complete this using Xamarin here.
(pictures are from Xamarin website)
I am trying to Print receipt from windows store apps without Charms, but I am unable to do that.
Can you please suggest me how to print by single button click from App (without using charms)?
One possibility is to dump out a file (PDF?) outside the app's sandboxed environment (file picker). Then have a custom app/process "pick up" the file and send to printer. Which would be outside the app store.
In my OB1 Kenobi voice - "Use the Charms amanjaneyulu".
Recently, i want to create an application to sync photos between iphone and desktop by using C# language. I use Manzana library to copy image from PC to iphone.
As my understanding, the image file should be put under to /private/var/mobile/Media/PhotoData/Sync folder. But this does not work, i cannot see imported file when browse iphone photos although the file is copy to the location correctly.
Then i try to update the database file /private/var/mobile/Media/PhotoData/Photos.sqlite. To add a new entry to represent the imported photo file. Then i can see photo in iphone, but without thumbnails. And i have to restart the album application (close the application and start it again) so that to see the new imported photo.
But i found other tools can sync photo to iphone and can see the change immediately without restart the album application.
I want to know how this function is implemented?
Manzana is a C# wrapper of iTunesMobileDevice.dll. the main functionality is deal with iphone file system. and this is quite a old library which is not updated for a long time. I am not sure if there are any APIs to allow user to select an folder or photo file and sync it to iphone just like we do it in itunes, so that we don't need to process the db and thumbnails.
Does anyone have such experience before?
Im using desktop Dropbox as a buffer between mobile app and desktop.
Before this, you need a DropBox registered account and install the application.
After that, simple create a new folder from desktop Dropbox, drag-and-drop all
your photos into the new folder
Then, return to your iphone and retrieve them from DropBox mobile app.
I want to supply a bunch of files with my Windows Phone 8.1 app which are necessary for running the application. I searched on the net and found that this page. But I don't know which place in particular is the ApplicationData.Current folder. What I want is the following:-
Can I create a folder called Resources or use the existing Assets folder in my Project tree and save the files in there.
If yes, then how can I access that folder from within my App i.e. how can I open and close files in that Directory(relative or absolute addressing format to be used)? If you can provide a one or two line code for this, it would be great.
Do I have to use the ReadTextAsync method to read the entire text of the file into a string or are there any other methods.(The System.IO.File.ReadAllText() method is not accessible when creating Windows 8.1 Phone app).
Thanks in advance.
Your App is installed on SD or Phone, depending on user Settings on the Phone. You can't normally access those files eg. by browsing files while Phone is connected to computer - the apps are Isolated.
Depending on your App:
if it's 8.1 Silverlight then you will find all the information here at MSDN.
if it's 8.1 RunTime then take a look here.
Although you can't access files inside your App from outside the App, from WP8.1 you have access (read/write) to SD Card and other KnownFolders.
EDIT - you can also access your files by using Uri schemes.