Can JNBridge be used under linux? - c#

I have to consume some C# dll's under a linux host through java. Rewriting the code is currently not an option, and we can't expose the dll as a service because this linux server will exist in isolation.
Is it possible to generate my "java to .net" proxy JARS on a windows host with JNBridge, and then consume them under my linux box (presumably with mono).
This seems feasible in theory, but seeing as I have no experience with JNBridge or even mono I don't know if this is even possible, or what the degree of difficulty would be. Or, is there is a better route to go to solve my problem.
Thanks.

The JNBridge web site says that Windows is required. How about using a Windows VM for the .NET code (it shouldn't matter if your Linux server is in isolation)?

Update: JNBridgePro now supports Mono and can be run under Linux. Please see the JNBridge website for more information.
Shredder -- For some reason I can't do this as a comment on your comment, so I have to provide a reply.
JNBridgePro does not support Mono directly. jdigital's suggestion, to run the .NET inside a Windows VM, is the one we would recommend, although we would recommend that you use JNBridgePro to bridge between the Java code and the .NET code running in the VM. In this case, you would use the JNBridgePro tcp/binary channel to do the bridging.
You could use a Web service if it would work for you, but since you were considering JNBridgePro, I had figured that Web services weren't appropriate for your project. In general, JNBridgePro provides a number of capabilities not offered by Web services, including faster performance, cross-platform access to a finer-grained object-oriented API, and use of cross-platform pass-by-value and remote references.
Wayne Citrin -- JNBridge

Related

Looking for solution for cross platform development windows application and web application

I got project that will run on windows and web. I wonder if there is a solution to create that as a cross platform application . If you have any experience or any solution please let me know.
Create web service(s) for your business.
Consume them in both windows application and web application.
Configuring is the key here.
When it comes to consuming web services,may be little challenging for authentications, authorizations and marshalling data, but it is possible.
You can choose any programming language for creating web services. But languages like Java, C# or vb.net has good supporting libraries and easy to do. Any how your question tag says C#, dotnet frame work has good support for webservices using WCF.
You can share a lot of UI code between a desktop and web application using a framework like Electron. This is the method that a lot of popular products with both web and desktop apps (like Slack, Discord, and Ghost to name a few) use.

Tidekit and C#/Java/C++ native code compatibility

I am interested in this new platform - Tidekit. But I couldn't find any answer to my questions:
Is it possible to add C# (or at least C++/JAVA) code or Dll libraries to the solution?
Is it possible to make a package with html+js+css and native code (C#/C++/Java) working in one executable file or executable + dlls?
There are already working solutions like CefSharp, Awesomium, but there is a problem to make external resources (html, css, js) embedded inside the project.
I would like to hide my implementation from end users somehow.
I'll appreciate any answer related to my questions.
We don't support C#, but yes to the rest.
Again, no C#, but yes to answer this question.
Further explanation below:
We've developed TideKit to have a small and stable core so that the apps can be built up in a modular way with the functionality you want in your app. TideKit provides simultaneous extension in ObjC++, C++, Java, and JavaScript for web, HTML5 hybrid and native apps.
Generally, developers will consume modules without the need to write lower level code because the functionality already exists both natively and for HTML at the same time. So mostly it is about consuming modules and writing your app in JavaScript.
Modules allow a project to be built for desktop, mobile and web from a single base of code. TideKit is a uniquely develop once, deploy everywhere platform with easy-to-use JavaScript APIs and CommonJS modularity. The best way to write TideKit apps is CommonJS. More than 60K modules of CommonJS functionality is available through npm and components registries. Folks familiar with nodejs will be at home with it. You can also write conventional JavaScript or easily migrate an existing TideSDK app.
Automated packaging, installers, and distribution are part of our solution. There are packaging options that can provide bundled or network installs to take advantage of dynamic libraries for efficient runtime code to keep the amount of installable and distributable code to a minimum.
TideKit has the capability to build in different ways from your project source to optimize for AppStore compliance or even highest HTML5 compliance. You can use it to build HTML5 or native apps for virtually any platform you wish to support. On the backend, we have capabilities for the widest range of mobile and desktop operating systems and for web deployments. Beyond building your app simultaneously for multiple platforms, you can also develop, test, and deploy your APIs from the same base of code.
Our build service protects your code from exposure by encrypting and embedding the sources in a binary. Hope this helps.
I think it is possible to use DLL's with something in between using Ti.Process...
the idea to execute a DLL is to have something in return (a very especific process, only for windows desktop I believe). I'm facing the same challenge but I guess I will approach to Ambiance Air App which uses a DLL to validate the license of the product...
in short it could be
var myScript = Ti.Process.createProcess({
args:['python',Ti.API.application.resourcesPath + "/??????"]
//the unknown command for the exe that uses the dll? it should return an object! not even functions...
});
myScript.myObject;

Open source Virtual Machine writen in .net?

I am wondering if anyone knows of any open source virtual machine projects? The language it is in does not matter, I would just really love to see how they work. I have done alot of searching and could't find much. I am guessing due to the complexity. Even if it is not a full blow VM and just has that functionality, I.E a sandbox.
If anyone knows of one that would be great.
EDIT: I should have been more clear, I am looking for an open source Virtual machine like VMWare that is created in a .net language.
Cameyo does application virtualization and has a web service you can consume in your own .Net projects. More info on the web service can be found here.
You can find a read-only svn checkout of the SDK source code (written in C#) at http://code.google.com/p/cameyo/source/checkout
EDIT: the svn URL is http://cameyo.googlecode.com/svn/trunk/
There's Mono (and closely related Xamarin).
Mono is a free and open source project led by Xamarin (formerly by
Novell and originally by Ximian) to create an Ecma standard compliant
.NET Framework-compatible set of tools including, among others, a C#
compiler and a Common Language Runtime.
As mentioned on the comments, Mono is one open source .Net implementation; there is also DotGnu.

What's the best way to call c# code in c code on linux

I am doing a project and have a C# library but I need to call it in C code on Linux. What's the most efficient way to do this? Performance is the first consideration.
Of course, I can make a C# service and use TCP to talk. But I wonder if it's the best way...
Thank you!
You can also use CoreRT to create native libraries from C# code and call them from C. You can find an example here
Edit: CoreRT has moved to runtimelab feature NativeAOT. Updated link.
I think the most standard solution is to have your C# service export a "web services" remote API, which the C code can then access via the standard Linux web services packages. In effect these support a form of RPC, but with web pages encoding the request and also the reply. The advantage of using web services is generality; your solution will port to any platform and will work from any language, not just C.
Another way to go is to use one of the new open-source packages from Google, Facebook, Twitter, etc. A bunch of the cloud vendors are open-sourcing their RPC infrastructures because many customers pose your exact question and need these solutions. Those will definitely be faster and more powerful in other ways too: they include powerful performance visualization tools and debuggers of various kinds. Microsoft has a remote method invocation technology too. So these are an option, perhaps less general but definitely faster. So you then have to ask how important speed is, for this particular path...
The bottom line then is that there are maybe five packages you could use. No idea which is winning or best!

what are advantages and limitations of using mono project to run c# code on linux?

If anybody having the solution of advantages and limitations of using mono project to run C# Code on Linux, Please tell me your thoughts...
There's a huge advantage - it works. You can use C#, develop, and run on Linux (and other platforms, including Windows).
The disadvantage is that things don't always work the same way as they do in MS's .NET implementation, and there is some functionality that is not implemented at all, such as WPF.
Advantages
Investment - when you choose right software you don't have to pay for software licences when running Mono on Linux (this doesn't mean that it's free - Linux is only free if your time has no value).
No vendor lock-in - you have more choices for other software on Linux (for example DB or Web servers) when compared to MS solutions which works best with other MS stuff.
Mono specific libraries (for example Mono.Simd or REPL).
Open source (you, or others, can fix bugs/provide patches/improve code by yourself).
Limitations
Incompatibility with MS.NET framework.
In general you will probably spent more time with certain things (for example dealing with incompatibility or learning Linux administration and such).
Mono is not up-to-date with new API and features for some time when new version of .NET framework is released.
I have developed a few apps in C# and have tried to get a few running on Linux via Mono. Getting console applications to run in pretty simple. Most of the time, there is no code change needed to get these types of applications running under Mono. However, GUI applications are always more tricky. The first thing you should know is that your user interface will not blend in with the user's theme. The application will always look like a Windows 98 application, assuming you are using Microsoft's System.Windows.Forms.
If, however, you plan to write and run the application only on Linux, then you could use Mono's Gtk# to build the user interface. This integrates with Linux desktops much better than System.Windows.Forms. This page gives a good rundown of the different GUI toolkits, their pros, and their cons.
If you are sticking with System.Windows.Forms for the GUI toolkit in order to run your application on both Windows and Linux, keep in mind that even though Mono supports C# 4.0, you are better off keeping yourself limited to C# 2.0, as some of the features of 3.0 and up aren't implemented or do not work well on Linux.

Categories

Resources