Please suggest a platform to port C# app to Mac? - java

Greetings,
I need to port this Windows utility: http://solinker.com to Mac.
The app was written in C#, .NET 2.0.
The main requirement is:
The app should be able to talk with AppleScript to interact with Photoshop. The program is small and UI is simple so I could consider to fully rewritte the app.
Possible candidates are:
MonoMac
Unity 3D (seems it doesn't required to install the Mono)
XULRunner (Flickr Uploader written by XULR)
QT
Java (convert all the app to Java + 2 different connector to photoshop:
for Mac and for Win)
I would be appreciate for any advice!

I'm not experienced with others but can definitely suggest MonoMac. It looks and feels like any other Mac app while running on Mac. On the other hand, if the application was written with Visual Studio on Windows, it never properly works on MonoMac. So prefer MonoDevelop, if you go this route.

If you check the documentation for MonoMac, you will see they have a packager which bundles all dependencies with the final app. So, no need for a seperate Mono install:
http://www.mono-project.com/MonoMacPackager
As for AppleScript, MonoDevelop does some wrapping of AppleScript. You should take a look at their source:
https://github.com/mono/monodevelop/blob/master/main/src/addins/MacPlatform/MacInterop/AppleScript.cs
I would say MonoMac is your best approach.

Related

Coding with tools only downloadable in Microsoft Store

My laptop is broken and is at the service right now so I got a borrowed laptop from school. Unfortunately we have no administrator rights on these laptops and a lot of stuff is limited by the administrator. The only way to download tools/applications is through the Microsoft Store. (It is not in s-mode or something, really restricted.) So I want to program and write projects in Java. Normally I use IntelliJ, but that was not in the MS store. I downloaded Visual Studio but am unable to download the JDK.
My question to you: Is it at all possible to create and run java projects with Microsoft Store as the only download store? (Windows 10 Enterprise 21H1)
Thanks in advance!
Tried visual studio but can not run because JDK is missing
Tried a browser IDE, but they work terrible and not really suitable for writing projects
Visual Studio Code might be an option if it works https://apps.microsoft.com/store/detail/visual-studio-code/XP9KHM4BK9FZ7Q, but your best bet would be the following:
You can use an online tool called GitHub Codespaces: https://github.com/features/codespaces
Codespaces runs a VSCode environment in your browser. You will run a java project just as you would if you where using VSCode. How to use GitHub Dev https://github.com/github/dev
Check out this link if you want to know more about advanced use of Java in a Codespace: https://docs.github.com/en/codespaces/setting-up-your-project-for-codespaces/adding-a-dev-container-configuration/setting-up-your-java-project-for-codespaces

Java application installer as a windows service or startup

I am using netbeans to create a project, and the final result needs to be an installer, that when you install the app, it would automatically turn itself on after every computer reset.
I was looking (still am) for any software that would help me, but cant find anything.. I found a simple install creator and it makes an installer but it doesnt automatically puts the app as a windows service (i could use the CMD to make it as a service after the installation, but i want it to be automatic).
Another alternative is that the installer would put the application exe in the users startup group, but again, i want it to do so automatically.
Can someone recommend me some simple software for this.
Thank you.
Try Install4J. Although it is not free.
install4j offers full support for generating and installing services (daemons). For services, install4j generates service executables on Windows, startup items on Mac OS X and start/stop scripts on Unix/Linux platforms.
I don't think this is a right SO question.
Any how, have a Look at WhatInStartup
(it's free)
Create a exe Jar file of your program, add just add to it.
To do it in a easy way,Look at Jar2Exe
We have used Java Service Wrapper at my job, and it has worked fine for years. It is not free though.

Java IDE for working over Remote Desktop

I have recently found out that anything Swing(NetBeans, IDEA) is excruciatingly slow to paint the UI over Remote Desktop(RDP).
Can you guys give me any suggestion for something that will work properly over RDP?
Actually, contrary to everything I've seen - mostly the "Dsun.java2d.noddraw=true", which is mentioned in a number of places, it is actually setting it to false that fixed the drawing issues(for me at least). Go figure.
RDP is optimized for native Windows apps and, regrettably, newer versions of RCP (like Vista/Win7's default RDP) is even more hostile to non-native apps than older (XP/Server 2003) versions. Here's a good link:
http://devnet.jetbrains.net/thread/280673
http://bugs.sun.com/bugdatabase/view_bug.do?bug_id=4204845
One workaround is to get a screaming fast CPU/graphics board, tons and tons of memory and a super high-speed network connection :)
Another is to:
Select "32-bit true color" in your Terminal Services settings
Select "Modem"
Reduce screen resolution (heck, use 1024x768 if possible)
Here are some additional tips:
http://www.codinghorror.com/blog/2006/04/remote-desktop-tips-and-tricks.html
Try setting "Dsun.java2d.noddraw=true"
http://ubuntuforums.org/archive/index.php/t-1129187.html
http://www.mindfiresolutions.com/Solving-DIRECT-DRAW-ddraw-problems-in-Java-Swing-730.php
I am launching a java swing application from Linux, and display it as a Windows frame thanks to MobaXterm.
If you haven't done it already, please have a look at the following documentation :
https://docs.oracle.com/javase/8/docs/technotes/guides/2d/flags.html
Using -Dsun.java2d.noddraw=true did not fixed my issue, but setting xrender to true did.
So here's the code I used on Linux :
export _JAVA_OPTIONS='-Dsun.java2d.xrender=true'
java -jar my_java_application.jar
Maybe it's not only Swing that paints slow over Remote Desktop. However, Eclipse is based on SWT, based on native widgets, so it is not Swing.
You should give JavaWIDE a try. It is an IDE designed for access to a JDK without it installed on a system, with a built-in storage system so you just need access to the internet. It's not exactly a program for accessing everything on the computer but it will do a good job with your programming. It may take a while however, as the compiling is done on a separate server.

Java application launcher

I have written a very simple Java application. Can anyone tell me how to create a launcher like icon to run that application both in Ubuntu and Windows ??
Thanks in advance..!!
An executable JAR should work fine for a launcher on both Windows and Linux. However, that won't get you a custom icon.
On Windows, you can use JSmooth, which will create a .exe wrapper around your JAR file. The JSmooth program will let you create an icon for the EXE as well (it also has options such as getting the user to download the necessary version of the JVM, or only permitting one instance of the program to run).
If your java application is to be distributed from a web server, you should have a look at Java Web Start which can do what you ask for based on a JNLP-file. Notably see
http://download.oracle.com/docs/cd/E17476_01/javase/1.5.0/docs/guide/javaws/developersguide/faq.html#104
Ubuntu and Windows will both have different ways to launch the application. I see two routes to follow here. One is to use Java Web Start and use a web interface to start your application. The other is to search for some sort of 3rd party installer that will create setup/installation programs for all the platforms you want to use.
I actually used a third party install program before, InstallAnywhere, but it was almost ten years ago. It offered the functionality you are looking for, though.
There are different ways to do this, sometimes the simplest is the best approach. One solution as suggested is a simple starting script. Roll your application into a jar, then include a script that does nothing more than "java -jar myscript.jar". I do this all the time for internal customers that may be running various types of *nix and whatever version of windows (a few macs as well). How sophisticated you need it to be depends on the audience served.
Create a bat/shell script which starts your application.
And than create a shortcut/launcher for it.
Shortcut file in windows has extension lnk.
Update
See example - SQuirreL launch file.

How to start a local port on user's computer (Edited question)

sorry in the past I have not been able to formulate my question coherently. This will be my last try. =|
Basically, I want to do something like this website is doing: http://www.ninjavideo.net/video/56388. They are rendering an iframe that points to a port on localhost. You will see nothing in the iframe if you dont have their applet running (which can be found here: ninjavideo.net/applet.php ). I want to write a script that does something like what applet.php is doing, but I don't think they are using only php code as it won't run on computers that don't have php installed. Do you suppose they are using Java/C to do this?
Thanks for all your suggestions.
An Applet is basically a piece of Java code which is served by a webpage and is supposed to run at the client machine. You can learn more about Applets at Sun's own Applet tutorial. If you're green to Java as well, then I recommend to go through Trials Covering the Basics first. Opening sockets (ports) using Java code is covered here.
That PHP script is just serving the applet code from the server, so that the client can download it.
You could do this in PHP using a ready-to-run Apache setup (there are some that are ready to run from a USB key, should be possible to make into something that a client can install, but is complicated, see e.g. this tutorial) or a product like NuSphere Dock:
PhpDock is a deployment platform for PHP applications.
PhpDock enables you to deploy any PHP web application as a Stand Alone Windows Desktop application w/o any changes in the code.
PhpDock combines NuSphere's powerful embeded Srv webserver and browser components.
I would usually say that if you are looking to build a Windows application, you should go with a tool that is aimed at just that, i.e. C++, C#, Java, the .NET platform, Delphi, and the likes. But if you need some kind of daemon or local web server, you may actually be well off with a product bringing a web server to the desktop.

Categories