I'm attempting to write a music player for Windows Phone 8 because the current XBox Music app is very lacking. Basically I'd like to be able to sync files on the device based on whether they've been rated up or down.
Since the device itself won't let me delete or make changes to the music files on the app, I'm thinking of keeping a database of ratings in isolated storage where I can write data. Then I'll have a companion app on a PC read this database from the device, and then remove the files that have been rated downwards.
Unfortunately I am completely unable to access the device on my PC through code. I know it's possible since I can access the device through Windows Explorer, but when I load up some C# code to try to read the files, it simply cannot find the device at all. I've used the File Picker to see if I can modify files, but every time I select a file, Windows copies the file from the device into a temporary directory on C:\, so when I try deleting it, it just deletes the temporary file and the file remains on the device.
What in the heck is going on here? I cannot seem to find any information about accessing a WP8 in code over USB. Any ideas?
The Windows Phone Power Tools on Codeplex can write files to isolated storage from a PC connection - you might want to check out its source code: https://wptools.codeplex.com/
Related
I am developing an application in C# .Net 3.5 Compact framework for a Handheld Computer which runs on Microsoft Windows CE 6.0.
I am able to create the installer and run the application, the hurdle what I am facing right now is, say the battery dies/you perform a Cold Boot on the device (the device is Datalogic Memor X3 http://www.datalogic.com/eng/products/healthcare/mobile-computers/memor-x3-healthcare-pd-814.html#), the application gets deleted, the user will have to re-install the application. I would like to know how to get rid off this problem? Is there something I need to do while building the Setup/Installer? There are other applications in the device which do not get deleted when performed a Cold boot.
Please advise.
Usually, the root filesystem of a Windows CE devices is RAM-based, using the object store. Mass storage devices are mounted as subfolders. This means that any application that is not installed on a folder connected to a mass-storage device will disappear when RAM contents are erased. In your case this happens when the battery dies because the device never actually turns off, just suspends and resumes.
You should try to install your application on a permanent folder, they should show a different icon in file explorer.
Most if not all vendors of Windows CE based devices offer a persistent storage area and factory reset / autoinstall procedure.
If the device is clean/cold booted, the 'normal' storage area is reset to factory default. So all custom applications and changes are deleted. When the device boots up, there is a OEM specific autoinstall process. You need to integrate your setup with the autoinstall.
Please see the Datalogic Memor X3 support page and look at the user manual on how to persist your application with this Datalogic device (I would have done that for you, but they require a registration).
UPDATE: see https://www.manualslib.com/manual/850035/Datalogic-Memor-X3.html?page=64#manual and read about Save Session and Save Setup.
At least you can use a SD Card with a special folder (ie 2577 for devices with ARM processor) and a custom autorun.exe inside. This will be executed automatically on every boot.
I'm trying to find a way to access a local PCs file system with a microsoft hololens on the same network. For example. I want to be able to open a txt document on the hololens and save it to my PC. I can't seem to find any relatable documentation online. Basically all I want to do is use the Hololens as a monitor to my PC. Any and all help is appreciated.
I'm a relatively new Developer building my first app.
Right now I'm in the process of developing a UWP app and I am needing to get the Hard Drive Serial number from the PC from the Views (OnNavigatedTo), then after a few more fields are filled out, to then save all values to a SQL Server.
What I have discovered up to this point:
Grabbing some values like Hard Drive SN are not so easy with UWP.
I don't seem to have access to Registry HKLM via UWP
I can grab it very easily with PowerShell, and write it to a JSON or XML file. which I plan to do with a Service Account when PC is imaged.
I Don't know where to put the file where the App can see it.
Writing to Sql Server can only be done by creating a webservice and making HTTP / JSON calls via App. (I have this part setup but have not started accessing it via app yet)
So the part I really need help with I guess, is Where to Put JSON/XML file that App will be able to see and read from. Unless of course, someone knows of another way to get Hard Drive SN into a UWP app.
Thanks for Any Help
The recommended way to do this (if you want to go to the Windows Store) is to use a FileOpenPicker and have the user choose the file manually.
If this is for side-loading only (not going to the Windows Store) you can write the file to the user's Documents folder and then the UWP can read it using documentsLibrary capability without any user intervention. You could also use a fullTrust extension to run the PowerShell script and to put the file in the app's data folder. You can check out the Desktop Bridge docs for more info on fullTrust extensions.
I have a Windows 10 universal app that is running on a Windows 10 Mobile device. I noticed from the Windows 10 Mobile device, it does have a file explorer but it limits you to only see certain "Known Folders" such as music, documents, downloads, etc... and that is all.
Furthermore, when I plug the device into my development machine via USB, I can browse the device but again, only the Known Folders above.
In my app, I am writing to a log file and that log file is stored to LocalStorage, under a folder for my app name, for example:
var dataPath = ApplicationData.Current.LocalFolder.Path;
I simply need to browse MY LOG FILE, that MY APP CREATES, in MY APP FOLDER. I read about a ton of, in my opinion hacks, to get access to this file/folder. For example, there are some third party applications that still mainly claim to target Windows Phone 8/8.1 but will still technically work for 10 such as:
Windows Phone Power Tools
Isolated storage spy
etc....
Then I also read articles on how to use a file in Pictures (or voice recording) and go to file properties to then gain access to the root or to create a root shortcut on the development machine and copy it to the mobile device, however, these are typically a year or more old and no longer work on my device (I suspect MS patched these hacks).
So, all that said, I would like to see a good way to access the root drive for development, or at least my app folder in the LocalFolder so I can access my files (such as logs or the sqlite db file). Maybe there is a way already but my google searches haven't turned anything up just yet.
Thanks!
As you've known, we can use some third party tools like IsoStoreSpy or Windows Phone Power Tools to access Isolated Storage. Although they are designed for Windows Phone 8 & 8.1, but they can also be used for Windows 10 Mobile. With these two tools, we can access LocalFolder, TemporaryFolder and RoamingFolder. For more info, see similar question: Accessing storage of simulator/device while debugging.
Besides these third party tools, there is also build-in support in Windows 10. We can use App File Explorer to view and manipulate files stored by your sideloaded apps. This is a new, cross-platform version of the Isolated Storage Explorer from Windows Phone 8.1. This tool should be able to work no matter your application is deployed in Debug mode or Release mode. But please note that this is a new tool added to Windows Device Portal in the Anniversary Update.
To use this feature, we must enable Device discovery and Device Portal. Then we can access application storage in web browser like following:
For more info, please see Device Portal for Mobile and Using the App File Explorer to see your app data. Also the similar question: Windows 10 Mobile: how can I see inside on my app folder? might be helpful.
I had a similar problem to solve few months back. I ended up doing two things:
I've implemented a 'Send Logs' button in settings that would upload logs to a ftp server. Actually it was a bit more than that, all installations of this app were managed by a central server and there was 'Get logs' button on the server side that would send request via push channel to the device to get the logs.
Got my hands on a Interop-unlocked device that I would use if the app was in a state that would make first option not possible.
I need to connect and disconnect USB programmatically. That is, I have inserted the USB device. I need to transfer the file using C#, .NET application. The application will watch the particular folder and transfer the file from that folder to a USB drive. I need to disconnect the USB device after the file is transfered and connect the USB when needed - without unplug and replug.
What would be some code to do it or is there any DLL file available?
Main thing: NOTE, NOTE: Without unplugging and replugging the USB device.
If your goal is to make a certain disk volume unavailable while you're not using it, a more sensible approach might be to use the volume management APIs, e.g. by using the IOCTL_VOLUME_OFFLINE control code. (I'm assuming that you know which drive letter belongs to your USB disk.)
Alternatively, you can disable and enable the volume device programmatically with the CfgMgr / SetupAPI -- the same as right-clicking the volume in Device Manager and choosing Disable would do. (For information about using SetupAPI, please review the DevCon sample code provided with the Windows WDK, and see MSDN for functions such as SetupDiChangeState.)
The latter option might require a privileged user account.
I'm not exactly sure, but it can be done. In Linux, I've experienced certain situations where power is disconnected to a device programmatically. The kernel usually does this if the connected USB device is exhibiting too many errors. So, it should be possible to do this even in Windows. You may need to write your own external DLL to do it though.