It's so many ways to create the programs for Windows and Linux, but I need something special.
1. My program should look same in Windows and Linux.
2. In windows version, the program uses .dll, in linux version the program uses .so
3. The program should implement the modern graphical interface (ideally designer provide me the psd or other format and I would can implement it in my program).
With Visual Studio and Mono I implemented the first two points, but the third point - it's hard to make.
WPF - is not implemented in Linux
Javascript - not so clear about how to work with .dll and .so files, running at some browser layer...
What technology can you suggest me to try?
Thanks a lot!
I think that QT is the solution. You can try some javascript frameworks, but I think it's not ready yet for the serious desktop application.
Related
I have years of experience developing on microsoft development stack primarily visual studio 2012/c#. But right now, im required to develop app on linux. While i know c++, its been years since i really touch that. I have few questions.
Can i develop using mono and compile binary for linux and windows with no code(or minimal) code changes?
Can i develop on windows platform using visual studio 2012, compile for linux on window platform? do i need to use virtual machine for compiling for linux in windows platform?
How do you setup your development environment if you want to develop linux app on windows platform(develop on windows, compile for linux and windows. my linux box use for testing is a separate machine.)
Some info on what im working on.
My project is about network channel analysis. The client is cheap industrial linux box most probably with no ui. Im using mono/c# to develop the client. The server would be windows develop using vs2012 c#. Most probably using wpf as ui. Im planning to share network/communication library between linux(client) and windows(server). My primary concern for using linux is for cost saving since the client is almost thousand units.
thank you.
Mono runs executables in PE (Portable Executable) format, the native file format of Windows. There's no need to "compile for Linux", as long as your app is pure MSIL. And even if you use native DLLs through p/invoke, Mono and Wine work together to run the Windows files on Linux.
(The a.out and ELF executable formats used by native Linux applications don't have mechanisms for storing .NET metadata, the PE format was modified to support .NET, so that's what .NET Framework (not Micro Framework) implementations use regardless of platform)
The most important things to consider at the beginning are,
WinForms of Mono is problematic. Not only most third party controls won't work properly, but also libgdiplus itself is not 100% compatible with Microsoft's GDI+. It might appear to be a sweet option, but later you might still need to fight hard against the incompatibilities.
WPF is not an option as Mono does not support it yet.
GTK# is your best choice for UI, which blends naturally with Linux distros. If you refactor your Windows project properly, you should be able to share the non-UI code between your Windows and Linux solutions. This is what Mono guys recommend (not only use native UI frameworks for Windows, Linux, but also for Mac/MonoMac, iOS/Xamarin.iOS, and Android/Xamarin.Android).
So go back to your questions,
You should never wish for no code change for a real world project. No, that's impossible. As I said earlier, you have a chance to share most non-UI portion.
You can develop the non-UI portion and the Windows only portion using VS2012 and test them out on Windows. If you plan to use Mono's WinForms or GTK#, you must develop and debug on Linux using MonoDevelop. Thus, you need either a virtual machine or physical machine of Linux.
For me, I frequently switch between Linux/MonoDevelop and Windows/VS.
As Mono + C# is much more productive than using C/C++, many successful Linux apps are developed on Mono, such as Banshee and Tomboy.
You can use Visual Studio without problems but for example you cannot use WPF, while Windows Forms are ok. For more information what you can use visit: http://www.mono-project.com/Compatibility
Moreover there exists Mono tools which integrates with VS: http://www.mono-project.com/GettingStartedWithMonoTools
We have a console app that runs in .NET 3.5. It connects to a USB device and spits out data received from it.
I'd like to port this over to OSX and have some questions about the strategy to do this. The USB Driver is already installed on OSX.
Mono looks promising but I don't get it. Does the end user have to install Mono or run something?
After looking at some other posts it seems that you can write a bash script and do some hacking to get the program installed...but I can't find a really good explanation of this. it also seems that mono wouldn't be installed in this process. These posts were also from '09 so I'm wondering if something has changed to make this easier.
My question is, what's a good way to approach running/porting a C# console app to OSX.
.NET is compiled down to IDL (bytecode) on all platforms including the windows platform. It is then run on the CLR (common language runtime iirc) which is a similar concept to the Java Virtual Machine. It just so happens that on most Windows machines that this CLR is installed by default. So if you wish your application to run on another platform you first need a CLR for that platform. Mono does include a CLR which can run on OSX. So either you (as part of your package/ bundle ) or the user would need to install this before your .NET will run.
The other issue you have is that .NET also contains certain API's which are not part of the ECMA standard which your application may or may not use. Some of these API's are present in mono, some of them are not. Those that are not usually have an equivalent or similar API which you can use to achieve the same thing however you may need to alter your application to deal with that scenario.
It really depends on what .NET api's your application is using as to how difficult it will be to port. I am guessing you are probably using winforms as part of your application so here is the guide from the mono site for that portion of the API
http://www.mono-project.com/Guide:_Porting_Winforms_Applications
You can bundle the Mono installer with your application (or your own build of Mono). You might even have the option of statically linking the mono runtime into your application on the Mac, I can't remember if it's supported (yet) or not. I'm pretty sure you can.
Also, wrt gordatron's warnings, if you use Path.Combine() to create paths instead of hard-coding \ as your path separator (which you should be doing anyway), you won't have to worry about having file system path problems.
For a nice easy way to check if your app uses any features which aren't available in Mono, you can use http://www.mono-project.com/MoMA to check for unsupported methods/classes and any other potentially non-cross-platform blockers like P/Invokes.
For a console application, I don't see you running into many issues (although you'll likely need to interface with the USB hardware differently than you do in Windows).
Forgive me for asking a common question, but I couldn't quite get what I needed from what I found so far.
First question - SQLite. I am using this DB as in my C#.NET 3.5 windows service and it works great, I was looking for a portable solution, because I would like port my service to a linux daemon etc, using Mono, which seems to support it. However, I am not sure how to implement this. I had thought the dll was compatable, but it seems there is a seperate dll for Mono/.NET which I should have expected. Does this mean I need to seperately code/compile for each platform or is there something that would allow me use of SQLite with the same code on various platforms? I have encountered this a few times in my searches, csharp sqlite, a "reimplementation". To be honest, this is quite new to me, is it of use? The Mono SQlite page says that they Mono.Data.Sqlite code is based on System.Data.SQlite and goes on to say...
"We have chosen this way as means to
provide a migration path for
developers using SQLite in their .NET
applications"
Are they referring to creating a new, seperate binary? Or could I run my code as is with some adaptation?
Second question - GUI. As far as I can tell the two main options for cross platform dev in .NET would be GTK# and Winforms. Again however, its the specifics of implementation that are a bit hazey. Can I create a win forms GUI in visual studio as I normally would then easily migrate this using mono? Or should I develop this in something like X-Develop or MonoDevelop?
Many thanks for your advice/patience :D
To help out a little bit here I used the full mysql dll file that was provided and I was able to compile my program on windows using visual studio, and then deploy it to Linux without changing anything(except the case of the mysql dll file, which is kind of annoying you'll see what I mean at some point).
Also from what I've heard winforms isn't totally supported by mono yet, but I may be wrong. I haven't done a gui cross platform yet, but I would test winforms first, just so you could develop it in visual studio, and if that doesn't work I think GTK should be fine.
You just need to make sure that the dll's are compiled for .net 3.5 or below and you should be fine(90% of the time).
Check this out here, http://www.mono-project.com/MoMA and also the link that chris provided.
I'm getting confused re the range of options for development & deploying some simple code & UI to both Windows & Mac. Can anyone assist re a good direction here. I do like Ruby, however if it makes sense to move away from this (e.g. java, c#) then so be it. Which development option would people suggest for this?
REQUIREMENTS
1. Support for Windows & Mac
2. The installation should be one-click and package all required dependencies as much as possible.
3. Scheduling capability required - so either via (a) installed as a service/daemon, or (b) ability for installation to schedule periodic call to script (former is preferred)
4. Functionality component requires - ability to access/parse web-sites, and then ability to make HTTP(S) calls out to my site to store parsed data. So heave on HTTP(S) methods. Proxy support required in app, so ability for user to enter host/port/username/password for the proxy server.
DEV OPTIONS ?? - This is where I need help/advice. Some of the many options that come to mind:
1. Develop in Ruby and then find packaging product to create Windows & Mac installation packages - not sure how doable this is yet? Especially if I need the installation to effectively install as a service.
2. Develop in Java for cross-platform? but then needs users to have installed JRE?
3. Develop as Firefox addon? I'm not across this, but even if you can write custom code, then the issue would be firefox would have to be running I guess.
4. Develop windows & Mac versions separately, for example using Visual Studio Express to develop the windows version (assuming it can do HTTP work & create packages for installing services).
What would people suggest here? (would be nice to write once, push a button and then get the Mac & Windows installation packages spat out)
Thanks
I've written cross-platform C++ code and this was the kind of decision we were faced with.
Apologies in advance, but I'm not aware of any cross platform libraries that you can use for this, the systems are sufficiently different that they will require different deployment strategies.
Suggestion 1:
build your application in Mono
build two deployment strategies, separating the deployment issues into the "installers"
on windows deploy with some scripting language or installer application that inserts your app into the task scheduler, or write some simple C# code (see below)
on the Mac use the built-in UNIX cron demon to periodically call your app.
I think this strategy is fairly simple. The platform-specific effort is centered on the deployment. The app uses no resources until it runs, and it uses simple mechanisms to activate it. Logging and error handling can be done using the file system.
Suggestion #2:
write the platform independent code as an assembly
write the platform-specific code for each platform as necessary:
on windows that's a windows service or a scheduled app installed with click-once
I've been away from a mac long enough that I don;t know what the strategy is there
again, additional effort for the deployment
This solution has the overhead of writing more specific code to interface with the particular services that the OS Supports. The benefit is that it should co-exist better with the OS with the additional effort (ie: hook into OS-level resource management, reporting, logging and error management).
Note: C# interface to the Windows task scheduler here Unfortunately it's probably not Mono-compatible.
Mono will support the cross platform Windows and Mac requirement.
Mono allowed me to develop a Windows Forms executable assembly on my Windows environment and then simply execute the exact same executable using Mono on OS X.
Some of the GUI controls behave a little differently, but if you're writing a Service you will probably not be creating a complex GUI.
Checking the mono docs, I see the System.Net.WebClient class is implemented and provides a simple cross platform way to retrieve data over HTTP.
I used Visual Studio 2008 on a Windows machine to develop the application completely as I would any other .NET Windows Forms app. Then the resultant executable can be run directly on the Mac machine by passing it as an argument to the mono runtime.
You probably want to treat installation/deployment as a separate issue from the implementation of the actual application code. You may well need a platform specific installer for each supported platform, but each installer will deploy the same single binary (or set of binaries) on each platform thanks to Mono.
I'm looking to create a very -tiny- application(s) in Windows 7. I'm looking for a programming language like C# and a simple framework that
Makes the application very light weight
Doesn't require any libraries or modules (only the *.exe and works on a newly installed Win7)
The IDE (Or the compiler) let me easily implement windows 7 features (like the menu, the graphics...)
The point: I want to create a small application (light weight so it can be easily transported), that focus mainly on Windows 7 graphic design and features.
I don't know if such IDE exists but also asking how will you solve it, mean if you have to create a tiny application (gadget like) how will you proceed?
Lightweight and regarding dependencies: Well, since you want kind of C#, you have the .NET Framework. That's not exactly lightweight, unless you're sure that the target system has it available. Be sure to check which .NET version comes preinstalled with Seven. Addendum: Now that 7 is out, it seems it comes preinstalled with .NET 3.5 SP1 (full framework, not client profile). That's a good thing.
Have a look at the Windows API Code Pack for Windows 7 for access to Windows 7 features. Like tvanfosson, I'd also stick with Visual Studio and .NET.
Personally, I'd stick with Visual Studio. You might want to get a utility like NuGenUnify, which makes it easy to use ILMerge to combine any extra libraries into the main exe if you want to distribute as a single file.
So far I haven't seen any other IDE that beats Visual Studio for windows app development. Especially soon after a Windows release. I'd be surprised if I am proved to be wrong.