I would like to use nice UWP bluetooth classic APIs in my app. However my app has to be used as .exe, and it has to be portable (no installation in system). Is this possible?
The API used by UWP comes from the Windows Runtime Api, if you need to integrate Windows Runtime API in your desktop application, this is feasible.
Here is the document: Call Windows Runtime APIs in desktop apps.
But there are still some restrictions:
Due to the reference to the corresponding version of the SDK, your application can only run on the corresponding version (and above) of the Windows 10 system. May not work properly on lower version systems.
According to the description of this document, the Bluetooth API in Runtime is not yet fully supported in desktop applications.
In the description, you mentioned that you want to use portable application. Although many application functions can only be used in applications with a package identity, Windows.Device.Bluetooth is not listed here.
If the class under the Windows.Device.Bluetooth namespace has the Windows.Foundation.Metadata.DualApiPartition attribute, it means that the class can also be used directly in desktop applications, you can view related APIs in the Windows.Device.Bluetooth document.
Related
Is there a way to convert the project to UWP or should I use another approach? I need to deploy a Windows Forms Application written in C# with VS to Windows 10 IOT on a Raspberry Pi 3b. I've seen mention of a converter, but it seems it is used to publish the app to the Windows Store.
You will need to rewrite the app as a UWP app. The converter you mention (the desktop bridge) will allow packaging your Windows Forms app to store deploy to desktop systems but not for IoT.
Windows 10 IoT does not include the UI stack that a WinForms app depends on. This is documented in the Windows 10 IoT Core documentation (emphasis added for your scenario)
No legacy Win32 UI support: IoT Core does not contain APIs to create classic (HWND) Windows. Legacy methods such as CreateWindow() and CreateWindowEx() or any other methods that deal with Windows handles (HWNDs) are not available. Subsequently, frameworks that depend on such APIs including MFC, Windows Forms and WPF, are not supported on IoT Core
If your UI and underlying logic are separate then you may be able to keep all or most of the logic layer (UWP supports .Net Standard 2.0) and just rewrite the UI using UWP's Xaml stack.
I have made a .net core 2.2 app and it works great, I can browse to it through my browser and all of the stuff I made works. I am wondering if it is possible to make an app for my phone though instead of getting to my server through the browser. I mainly want to do this so that I have a better phone side layout. Is this possible and if so could you point me to a good starting point to figure out how to make something like this?
You could have a look at Xamarin perhaps?
Xamarin is a free open-source framework to build truely native cross-platform mobile apps using C# .NET for iOS, Android or Windows. It runs on Mono and .NET to build apps with native performance and native UI.
Xamarin allows you to develop native apps using C# language and platform specfic tools/SDKs and share the same code across multiple platforms - iOS, Android or Windows.
https://visualstudio.microsoft.com/xamarin/
I followed these two docs (Doc1, Doc2) to integrate Feedback hub in my app. I used NuGet to install the Microsoft Store Services SDK.
As recommended I am using StoreServicesFeedbackLauncher.IsSupported() to check if the Feedback hub is available or not. This works locally on my machine, but in production all customers hit System.Exception with message "Method 'StoreServicesFeedbackLauncher.IsSupported()' was not included in compilation, but was referenced in HomePage.<feedback_tapped>d__23.MoveNext(). There may have been a missing assembly."
I have read the docs again and don't seem to have missed any of mentioned the steps.
Edit
This app is a Desktop Bridge app. The solution has a UWP app which communicates with a win32 exe. I am trying to launch the app from UWP app. The solution has a Windows Application Packaging project to package the app.
I've found a few examples, as I in a Xamarin.Native use a Windows UWP. But that would mean that I a Xamarin.Nativ in a Windows UWP Convert.
I would like convert a finished Windows UWP application to the target Android or iOS. Is that generally supported or needs my UWP application rebuild again with Xamarin?
Links:
Adding a Universal Windows Platform (UWP) App
Getting Started with Xamarin.Forms 2.0’s Windows 10 Preview
Unfortunately asfar as I know there is no converter that allows to convert UWP app to Android app straight forward.
There are few ways to make the whole process a lot much more easier (so you can create your Android app faster).
If you wrote your UWP application and separated common code that can be used in the other applications you can also use it in Xamarin.Android app - the best way is to have PCL with the common code.
It is also important which type of Xamarin app you would like to create:
1) Xamarin Forms - common UI for each app: Windows, Android and iOS.
There is one shared code that can be used by them. Remember that Xamarin Forms apps are generally speaking the best for displaying the data and they are limited with reference to platform specific functionality.
Please see below to read more:
https://docs.xamarin.com/guides/cross-platform/application_fundamentals/building_cross_platform_applications/sharing_code_options/
2) Xamarin.Platfrom (so Xamarin.Android and Xamarin.iOS):
Here you can create native UI foreach of the project (Windows, Android and iOS) and access specific platform functionality.
With reference to the code - you can put common code in one PCL and have access to it from each project.
Please see this site - here you can find different Xamarin options to create cross-platfrom apps:
https://developer.xamarin.com/
Firstly, if you want a shared code, using Portable class library, you can use the same code for all the platforms including WPF, Android and iOS. First of all what you can do is convert the codes that is used again and again in the PCL (Portable Class Lirary). Once you get used to PCL, you can easily work on any platform you want.
As the Android, iOS are different from windows, a lot of .net framework functionality is not supported in PCL. Although, once you create the basics in PCL, you can integrate the class library in android as well as iOS.
It's not all together clear to me, so I am hoping someone here knows the answer. I am using the C# Json.Net and the C# HtmlAgilityPack both built from sources for "Any CPU". I've noticed that both of these include using directives that reference assemblies that don't seem to be available in Metro yet they both build fine.
If I reference them, does this mean my app will thunk to unmanaged code?
What exactly causes thunking to unmanged code?
Why are DLLs allowed to reference assemblies that are not available to WinRT and my app is not?
Will this fail the windows store approval process?
What are the general rules for DLLs I include with my app that I need to worry about?
Thanks in advance!
When developing apps that target WinRT, the app should only use the API's available in Windows 8 WinRT. The API's are defined in WinMD files. If the app used the desktop API's, then it will be rejected during the Windows store approval process.
Imagine this scenaio. You developed a WinRT app that uses .NET DLL's from desktop mode (client profile). The app is deployed in Windows store and user downloads it on ARM tablet. The application will crash as it does not have the desktop (client) .NET DLL's on the ARM devices.
so this brings us to the question on what .NET classes we can use while developing apps for WinRT. The article http://kishore1021.wordpress.com/2012/08/06/what-is-portable-class-library-project-in-visual-studio-2012-net-4-5/ lists the .NET classes available for WinRT application development.
Change all open source projects dependencies to target WinRT. See if some methods / classes in WinRT are missing so the code does not compile. Try to find the alternative methods/classes.
Such as List.FindAll(), change to Linq Where()