access windows 10 mobile root files and folders - c#

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.

Related

Trying to get Hard Drive Serial Number into a SQL Server via UWP app

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.

How to install Windows Phone 8.1 app in other phones in the simplest way?

I have developed a Windows phone 8.1 app. Now I want to distribute it to others.
I have done Create App Packages in Visual Studio, and it passed all the certification tests. So I have the .appx file, but I am not able to install it in other Windows phones.
Its showing this error:
Can't install this company app: There is a problem with this company app. Contact your company's support person for help.
I have googled and found out that there is two ways of distributing the app:
1) Mobile Device Management Tool,
2) Side-Loading
and without having an enterprise-signing certificate from Symantec it is not possible to distribute the app.
Another option is to upload the app to the store, but I don't want to do it at this moment.
So is there any way to install the app in other windows phone?
In a simple way? I don't want any certificates. I just simply want to install the app in my friends phone. Like we can create and install .exe files easily.
There are a few ways to achieve this without getting the certificate required for sideloading.
Beta
First of all - you ask for the simplest way to distribute an app.
I assume that there might be updates in the future (and if only to fix this annoying little bug that might find or whatever). Then submitting it to the store as Beta app is really something you should consider; it won't be visible - it won't be accessible to anyone whom you haven't authorised to use the app. The certification process in Beta is quite fast, as it is merely a sanity check.
Regarding the cost of the dev account: it is quite cheap (https://msdn.microsoft.com/en-us/library/windows/apps/jj863494.aspx) and can even be free, for students and startups through the respective programs (DreamSpark, BizSpark). Also: no recurring fees, even if you're not a student anymore.
But the true benefit is that all you need to do is give the authorised testers the link to your app once it is published and then all the updates are handled through the store. No messy package distribution to the individual people, no notifications - testers will get the updates like for every other app. Long term, that would save you a lot of time and the testers a lot of hassle in preparing their device for being able to play your app, they do not need to developer unlock their phones.
Without Beta submission
If you want to just send them the app package,
they must (also) have a Microsoft account. If I recall correctly, they can have one developer unlocked device even without the dev registration (http://dev.windows.com/en-us/join)
they need the Windows Phone SDK, which comes as part of Visual Studio, which installs the required tools
connect their phone to the computer
to developer unlock their device, they have to run a tool called "Windows Phone Developer Registration" and sign in with their Microsoft account
to deploy the app, use the tool called "Application Deployment".
Everytime an update is distributed, they simply need to use the "Application Deployment" tool.
or use the command line :D
Unless your friend's phone is developer unlocked, you have to submit it to the app store.

Is it possible to have a windows desktop app with metro interface (or a metro app with no intention of going to the windows store)?

Apologies for the noobish question, and I did try to search but couldn't find the right answer (or didn't search properly).
Currently have an app developed in a windows desktop environment because it gives us access to deeper features of the PC such as serial port comms etc. that the normal metro environment wouldn't allow. We're currently developing the UI based on metroUI so we can run it on an 8.1 touchscreen (metroUI looks good, gives us a touch-screen experience with PC features) but we have no intention of putting it on the marketplace.
Just wanted to confirm if this is in fact doable, and we can have this desktop application with a metro UI? Or is my noobishness meaning I'm overlooking some technical feasibility that makes it impossible?
This is doable with the Windows 8.1 Update (from April 2014). It's not supported before that since Windows Store apps were blocked from communicating with desktop processes.
The Windows 8.1 Update adds a feature "Brokered Windows Runtime Components" designed to allow side-loaded Windows Store apps to communicate with a desktop back-end. This will allow your Windows Store app UI to call the desktop component to access API that aren't available in the limited app package environment.
See Brokered Windows Runtime Components for side-loaded Windows Store apps for details.
See Try It Out: Sideload Windows Store Apps on TechNet for how to enable side-loading on your systems. See Windows 8.1 Update: Sideloading Enhancements for updates on how to enable a system for sideloading (no license required when on a domain, and significantly easier to get a sideloading license for non-domain joined systems).
The developer license system is designed for development and test purposes only. You really don't want to use it for production. Use the proper enterprise side-loading system instead.
From my understanding, the whole point here is to make it look like a Windows Store app. If you're app is a WPF one, you can already use Mahapps.metro.
You can create a Windows Store app without going to the store by Sideloading it. You create an app package first. The user has to right click the .ps1 file in that package to see the option Run with PowerShell and install it in a very old fashioned DOS like manor. It will only run when the user has a Microsoft Developer License and renew it every month. However, it is not allowed to keep using a Developer License of the end user to run a Store app. In the end, the system has to be domain bound to be allowed to run these apps, or you have to buy a Enterprise Sideloading key. These come in packages of 100 for $ 3000,- or you can unlock all PC's for 1 client for $ 100-.
It would be nicer if the specific pros of a Store program were available in a desktop environment but with W10 coming up I do expect a bit more integration and less restrictions.
Hope this answers your question.

Read/Write files on Windows Phone 8 via PC USB connection

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/

Downloading a file from server to Windows phone

I have some xmls which I want to put on server and in my windows phone, I will be downloading the these files and then program will do its calculations.But I don't want to put the files on server, instead of that I want to use Dropbox/Skydrive or any other to download these files. Is it good to go, or it will have too many overheads?
Or please suggest where I should store the files so later I can download the files to use under my windows phone application.
Dropbox officially haven't release SDK for windows phone yet, you can still use it using SharpBox project, click here.
Skydrive is better option, specially for windows phone application as both runs on same platform and provide better features. Response time of Skydrive on windows phone should be faster than Dropbox.

Categories