I was wondering how to get device-specific information programmatically using C# in the new Universal Windows app platform. This is to get a simplistic PC Toolbox I have from existing C# code for an old Windows Form project onto the UAP in Windows 10.
I'm looking to get total RAM installed (or available), CPU Architecture and ID/Name (such as 64-bit Intel Core i5-XXXX), Device manufacturer and model number (Dell XPS XXXX), and serial number/service tag.
It's a given that these apps will be using Windows 10 and this app will initially be geared for traditional PCs, but I'd like to expand to Windows Phone/Mobile with limited capabilities (not sure how/if some parts will work on ARM). How would I detect which edition of Windows 10, such as "Home", "Pro", "Enterprise", "Mobile", or "Mobile Enterprise", as well as 32/64 bit, and Language?
I have existing C# code that used a library that doesn't seem to work with Windows Store apps.
I'm pretty rusty with C#, but any help to any classes or references would be greatly appreciated. I realize that getting all the code to store all of these specifications may be a little much (if even possible ATM), but a pointer in the right direction would be very helpful.
You can tap into AnalyticsInfo and AnalyticsVersionInfo to get the information, as noted on the documentation page (https://msdn.microsoft.com/en-us/library/windows/apps/windows.system.profile.analyticsinfo.aspx)
If you want to get the HardwareIdentification information however you will need to look somewhere else as it is not part of the Universal Device Family, it's part of the Desktop and Mobile family (device family specific).
To get this type of device-speficic info available, you have to add the references to the device specific extensions.
Anyways, The APIs that were used to gather these data have changed from 8.x to UWP. I have found one blog post <https://www.suchan.cz/2015/08/uwp-quick-tip-getting-device-os-and-app-info/> for someone who has created a helper class that retrieves the following properties for example from a Windows 10 UWP app
current OS family - phone/desktop/...
current OS build number - 10.0.10240.16413
current OS architecture - x86/x64/ARM
current App Display Name
current App Version - 3.0.2.0
current Device manufacturer - Nokia
current Device model - Lumia 1520
In his post he shows how to get basic data about current device, operating system and application. hope it helps!
Take a look here:
https://msdn.microsoft.com/en-us/library/windows/apps/windows.system.profile.aspx
https://msdn.microsoft.com/en-us/library/windows/apps/windows.system.profile.systemmanufacturers.aspx
These will at least give you the SM Bios Serial Number and possible information about the hardware.
Related
I have a Windows phone 8.1 Silverlight application.
Now I need to make it run also on windows 10 phones and tablets. I checked and the app is available on windows 10 phones, even if deployed for windows 8.1 but it seems like I can't install it on windows 10 tablets.
My question is pretty simple:
Is there a "fast way" for converting the 8.1 project to UWP?
Can I deploy my app for tablets without re-writing all the code?
Thanks all
This question is oddly similar to one that I answered just yesterday. It's not really a duplicate so I will restate the answer here along with a link to the other question (1)
Unfortunately there is no easy and fully automated way to port your Silverlight app to UWP mostly because the API footprint has changed and updated between the 2 platforms. There are a lot of similarities but also a lot of breaking changes that require some manual changes.
here is Microsoft's guidance for this particular upgrade path.
From the article above:
Note This guide is designed to help you port your Windows Phone Silverlight app to Windows 10 manually. In addition to using the information in this guide to port your app, you can try the developer preview of Mobilize.NET's Silverlight Bridge to help automate the porting process. This tool analyzes your app's source code and converts references to Windows Phone Silverlight controls and APIs to their UWP counterparts. Because this tool is still in developer preview, it does not yet handle all conversion scenarios. However, most developers should be able to save some time and effort by starting with this tool. To try the developer preview, visit Mobilize.NET's website.
[1] Can a Silverlight out-of-browser app be converted to Universal Windows Platform (UWP) app?
First of all, yes, i have read all other similar questions.
Secondly, i am developing app (WP 8.1 WinRT), which must use Beacons. I read a lot about it, and i know, that generally connection with BLE device is not possible without pairing it first. But hope dies last, so i want to ask about any possibilities I have. It is possible to pair devices in code (according to articles I have read - its not, but maybe someone know the way)? Or just obtain nearby Beacons Id or Name, or ANY information about them? All posts i have found are outdated (from last year, maybe MS or somebody released some update/api?) I search for any kind of solution, api or just idea how to avoid pairing problem. Pairing it manually won't work - 1. not sure if it is possible to pair beacons, 2. its too many of them (beacons I need)
I look for anyway to communicate or even obtain beacons.
I would be grateful for any option or idea
While I have not tried it yet, there a developer has built an HCI layer to talk directly to bluetooth dongles on pre-Windows 10 machines. It is available here: WinBeacon
This will only work on desktop machines, and not with mobile phones. If you are interested in mobile phones with Windows 8.x, I do not believe there is any solution. I have spoken with Microsoft engineers who have confirmed this to me.
The fundamental problem with Windows 8.x on mobile devices is that any Bluetooth LE scan operation (which is what must be done to search for beacons) must be initiated by the operating system. There is no public API and no known private API that can be used to initiate a Bluetooth LE scan. Pairing with the device will not help -- it is the scan that is important and iBeacon and similar BLE beacon types do not use pairing at all for their primary proximity detection purpose.
Microsoft engineers have told me there are no plans to add this feature to 8.x, as they want to push folks to Windows 10.
While I know this does not help for Windows 8.x, I will note for the record that for the upcoming Windows 10 release, we are working on a port of the Android Beacon Library to Windows here.
I have a Windows Phone 7 app which relies on ANID to store user data on remote server. Now I'm preparing Windows Phone 8 version of it. When user will download this update previous WP7 app version will be replaced by this new WP8 version.
But there is a huge problem: in WP8 there is ANID2 instead of ANID. I know how to translate ANID to ANID2 (Windows Phone ANID to ANID2 conversion on C#?). But I need the whole ANID for this.
In WP7 ANID looks like: "A=2E23ACF364795673CD7EBB58FFFFFFFF&E=f48&W=3". I extract 32-character value (2E23ACF364795673CD7EBB58FFFFFFFF) and use it as UID (I heard that remaining portion may be changed, but 32 id will always be the same).
So I might convert ANID from WP7 version to ANID2 on-the-fly on remote server, but I don't have all 44 letters - only 32 of them.
I might update WP7 version with another WP7 version which sends the whole ANID to server, but I can't rely on the fact that all people will update their apps, save their data to server and then again update their apps when wp8 version will be available.
So my questions are:
is there any way to get WP7-style ANID value in WP8 app (maybe via reflection or c++)?
it is possible convert ANID to ANID2 having only its 32-character uid portion?
is there any way to find out whether particular ANID2 corresponds to existing 32-character ANID portion?
how can I reverse convert ANID2 to ANID if we know developer GUID?
can user select the version to install (if WP7 and WP8 versions available)?
Update
So far my workaround is to give users of wp8 version wp7 utility tool which generates ANID2 from ANID and stores this pair to remote database. Then user who gets wp8 version update can continue using his wp7 app profile.
Though I'm still looking for the better solution.
Btw, I've just realized: while we're trying to follow MSFT "One Screen" ideology and trying to provide our users access to their data on all MSFT devices at once, it's really stupid that MSFT makes us hold and somehow synchronize three (!!!) different ids for one user who log into his wp7, wp8 and windows 8 devices with the same live id! MSFT don't want us to see this live id so much that gives us its three different anonimized representations. Ridiculous, folks!
The only way is descrtibed in the question: publishing hidden utility with a link to it in wp8 version of main app. Utility itself is a wp7 binary which can access ANID and using dev GUID can generate ANID2. It sends both values to the server, and whn user comes with ANID2 server check dictionary and found corresponding ANID. Not that simple but quite easy. Hope it helps someone.
I would use a GUID i create the first time you startup the application, store that in isolated storage and use that. It won't cover the uninstall/reinstall scenario but that's a real small percentage anyway.
btw, the user will only get the latest version from the store so he/she cannot choose an older version (WP7 phones will only get the wp7 version ofcourse but wp8 users will always get the latest version from the store)
This might sound a bit naive and probably you would have already thought about it, and yes this is only an answer to your core issue, Is it possible for the windows phone 8 apps alone to point to the ANID2 implementation, maybe another remote end point, for some time till MS themselves kill the earlier(WP7) platform :)
Couldn't find a direct answer for this...would like to get into windows device programming for some workplace solutions. I jumped onto google and typed in "Windows SDK" and I got found there are separate SDK's for Windows Phone 8, Surface RT, and Windows 8.
I thought to myself "this can not be true" so I hit the forums...haven't found anything relevant.
Does ANYONE know if there is an all-in-one solution for windows 8 programming that encompasses all devices? If I have to develop the same app 3 times to accommodate all three devices I am going to have to advise upper management against this decision.
I think this is exactly what you need.
Windows Phone 7/8 and Windows 8 Co-development.
You should separate you code, move platform independent logic to PCL.
You'll have to develop different UIs for WP and WinRT anyway.
I am currently trying to extract WiFi information such as signal strength and MAC address from my windows phone 7.5 for an accurate location app I am working on. The OpenNETCF.Net framework has all the functionality I require (and is even described my MSDN: http://msdn.microsoft.com/en-us/library/aa446491.aspx) however I cannot seem to be able to import the namespace into my project using visual studio. It complains that the framework was not designed for windows phone projects. Is there any way around this? Or does there exist and equivalent framework which would work on WP7?
Thank you
Windows Phone 7 is only distantly related to Windows Mobile & Windows CE (for which that library is for).
There are a few how-tos for dealing with network information on MSDN, although I don't believe that WiFi signal strength is made available to apps at this point in time.
It is worth noting that there is a specific how-to for accessing location information, where the operating system can use Wi-Fi signal information to help triangulate location, where GPS is not working.
I'm afraid that it is impossible on Windows Phone current version