In a project, i have a .NET wrapper that use a .so build as a AndroidNativeLibrary.
Since the .so add a lot of weight to the APK(several MB), and that the features found in the .so library will not be used in all installations of the application, i was wondering if it is possible to dynamically load the .so from the sdcard for example?
What would be my other options, beside maintaining two versions of my application?
Thanks in advance!
The short answer is No.
Starting with Android N Google is changing the way shared library are accessed due to security (and app versioning). Consult the NDK link below for full details.
Your app references a library that is not included in its APK. For example, this could happen if you tried to use your own copy of OpenSSL but forgot to bundle it with your app's APK
Ref https://developer.android.com/preview/behavior-changes.html#ndk
Ref: https://releases.xamarin.com/beta-release-cycle-7-service-release-1/
When I open a sample Blinky application in Visual Studio, compile and run it, it gets automatically deployed to the target configured WindowsIoT device. After that, on Windows 10 machine where I compile it, the application binaries are located in the bin sub-folder of the project folder as one would expect.
I would like to automate the deployment, so that I could run deployment code
without Visual Studio, specify target device and the binaries location and it would deploy it. I cannot find any API that allows
to deploy apps to Windows IoT, how do I do that?
This shiny Windows IoT stuff is a new area, and there is not a lot of info available apart from the samples and the getting started page. Any pointers are appreciated.
Update: As noted in comments, once one start thinking of mass production, they will probably need to conciser ICD. This, is not, however the problem I'm trying to solve currently. I would like to figure out how I can provide Over-the-Air updates to my UWP application running on Raspberry Pi and Windows IoT. I also would you like to know how I can automate build / deployment in general, but that may be automatically solved if I have a proper OTA solution.
There is a set of instructions on how to do it, which can be found in the same github repo you are linking in your question, but in a different folder. Note, that you need an appx for these instructions to work, and it's not created by the solution build by default.
This page provide (non IoT specific) instructions on using VS to build the appx. And this blog post talks about the command line tool that can be used for making appx.
Note, that the last two links are also talking about publishing an application to app store, so you'll need to make some mental adjustments around that.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
We don’t allow questions seeking recommendations for books, tools, software libraries, and more. You can edit the question so it can be answered with facts and citations.
Closed 4 years ago.
Improve this question
I'm looking to create a virtual printer that passes data to my .NET application. I want to then create an installer that installs both the printer and the .NET application. It would we really nice to be able to write it all in C#, but I have a feeling that this will require a printer driver to be written is unmanaged code. Does anyone know of a fairly clean tutorial or example of how to do this?
Did exactly what you are asking using the Github project: Microsoft/Windows-driver-samples/print/XPSDrvSmpl
https://github.com/Microsoft/Windows-driver-samples/tree/master/print/XPSDrvSmpl
Installer: http://wixtoolset.org/
Application: Listen to internal port
Flow: Install printer and application from a single installer. User prints something with your driver while the application listens to the internal port. When data is sent the application picks it up. This is for XPS, can be converted to PDF, but the flow is similar no matter what you are printing. If you need anything else check out Microsoft/Windows-driver-samples/print/ on GitHub or other sources specific to your needs.
Update:
A lot of questions about how to get the driver working so here is a quick example:
Start by downloading Windows Driver Kit (WDK) if you do not have it installed already. When installing choose to add the extension for Visual Studio as well in the final step. In your Visual Studio 2017 Install you need to have Desktop development with C++ to have the right SDKs. If you don't have it see the anser below on how to add it.
How do I add features to Visual Studio 2017?
https://developer.microsoft.com/en-us/windows/hardware/windows-driver-kit
Then download the .zip file for Windows-driver-samples master:
https://github.com/Microsoft/Windows-driver-samples/archive/master.zip
Navigate to the folder <UnzipFolder>\print\XPSDrvSmpl and open XPSDrvSmpl.sln in Visual Studio.
Then follow Microsofts own guide on GitHub. As you can see it is for Visual Studio 2015 but I think it is the same for 2017 (not tested yet):
To build a driver solution using Windows Driver Kit (WDK) 10 and Visual Studio 2015, perform the following steps.
Open the solution file in Visual Studio 2015.
Add all non-binary files (usually located in the \install directory
of the sample) to the Package project: a. In the Solution Explorer,
right click Driver Files b. Select Add, then click Existing Item c.
Navigate to the location to which you downloaded the sample, and
select all the files in the install directory, or the equivalent set
of non-binary files such as INFs, INIs, GPD, PPD files, etc. d.
Click Add
Configure these files to be added into the driver package: a. In the
Solution Explorer, right click on the solution and choose Add > New
Project. Choose Driver Install Package under Visual C++/Windows
Driver/Package. b. In the Solution Explorer, right click the Package
project and select Properties. c. In the left pane, click
Configuration Properties > Driver Install > Package Files. d. In the
right pane, use the ellipsis button (...) to browse to the set of
files that needs to be added to the driver package. All the data
files that you added in Step 2-c, except the INF file, should be
added. This configuration is per-architecture, so this configuration
must be repeated for each architecture that will be built. e. Click
OK.
Open the INF file and edit it to match the built output. a. Open the
INF file. b. In the Version section, add a reference to a catalog
file like this: CatalogFile=XpsDrvSmpl.cat. c. In the
SourceDisksFiles section, change the location of the DLL files you
are building, to =1. This indicates that there is no architecture
specific directory in this driver. If you ship multiple
architectures simultaneously, you will need to collate the driver
INF manually.
At this point, Visual Studio 2015 will be able to build a driver package and output the files to disk. In order to configure driver signing and deployment, see Developing, Testing, and Deploying Drivers.
https://github.com/Microsoft/Windows-driver-samples/tree/master/print/XPSDrvSmpl#build-the-sample
I think you will have to do a lot of WinAPI wrapping. Start researching
on Windows Driver Development Kit to find the things you have to do.
I also found this commercial Printer Driver Resource Toolkit for .NET...
You could simply have your app expose itself like an LPD type printer or monitor port 9100. You could then install any print driver you like, and point it a your app.
Was looking for an answer for similar question, and found this link through Wikipedia - http://www.colorpilot.com/emfprinterpilot.html (allows to create Virtual Printers in different languages)
Why not consider using an alternative approach. Like using an intermediate ready made printing program, such as those freely available Print-to-PDF application. Then all you need is to decode PDF using some 3rd party library (which has free and opensource variance too) instead of cracking your head to reinvent the wheel. There are other Print-to-XXX application which you could also consider depending on the format you see fit.
I don't thing interpreting PDF approach is any good either. I don't know why you want to do what you want to do. Maybe you're trying to write a PDF printer of your own.
I think you should really give the Windows Driver Development thing a look. If you want to develop a printer driver, I think you'll have to do it in C++.
Good Luck.
If I remember correctly Microsoft does not support .NET within printer driver development. I have yet to come across a pure .NET printer driver. You will be a very brave man to do so! The website "Printer Driver Resource Toolkit" does not say that the driver has been written in .NET
I am looking for a way to interface with an Adafruit bluefruit LE (nRF8001 chipset) board, using c# in a windows desktop app (From what I've seen, I cannot use the Windows.Devices namespace without hacking it in.)
The device is properly paired to my tablet and seems to have no problems there, I'm just looking for a way to receive data from it in my program.
There has to be a way to do this, I cant think that Microsoft would limit using bluetooth to metro apps only, I just cant find it.
So, for posterity:
Everywhere on the net says to put the below in your csproj file:
<PropertyGroup>
<TargetPlatformVersion>8.0</TargetPlatformVersion>
</PropertyGroup>
This is actually incorrect if you are running windows 8.1, you have to put 8.1 there instead of 8.0. This change will allow you to reference the "Windows" assembly in the windows -> core section of the references dialog. Putting 8.0 there gets you a bunch of other things there that you don't want.
you also have to reference this dll:
C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETCore\v4.5.1\System.Runtime.WindowsRuntime.dll
Which contains extension methods that allow you to use regular await calls on Windows.Foundation.IAsyncOperation instances. This is required because those instances don't contain the GetAwaiter method that the await keyword looks for.
After that you should be able to use the WinRT API in your desktop application.
I am building WES 7 OS by running our C# application to see which package I need to add to. Most of the time I can get enough information from the error by viewing the System Event. Then I can add right package to the Answer file to create the OS image. But sometime I cannot find enough information from the System Event Viewer.
Is there any tool (debugger?) I can use to trace which file\library\dll is missing which cause our application crash during the runtime? I cannot install Visual Studio on that testing machine.
thanks,
Dependency Walker is a fantastic tool for this: http://www.dependencywalker.com/
It used to be included with the SDK, but I'm not sure if it is anymore. In any case, I'm sure the one on the dependencywalker.com site is more up-to-date.