What do you use to write cross-platform client apps? [closed] - java

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I'm writing a client app, quite old school, quite conservative. On Windows, I'd probably use .NET Forms, or maybe WPF, I'm not sure. On the Mac, I'd use Objective-C, Cocoa, and all that stuff. But I want this app to work on both, and I'd rather only write it once.
Should I write it in QT? I heard that when you get down to it, QT is buggy when you use it across platforms. Do I have to worry about continuity, what with Nokia's recent troubles? What does the community think about Digia?
Should I write it in Java? Newer Mac OS doesn't come with Java anymore, and Windows never has. How can I create a good setup experience like that? What about USB devices? There are some Java USB projects, but they're all Windows or Linux based, no Mac. I'm also worried about getting a native look&feel, but I guess Swing has me covered there.
Should I write it in Python? I'm worried about performance here. Also, I've written large Python apps before, and I found that Python scales poorly to large code bases, because of the lack of static analysis.
What do you write yours in?

I asked a similar question a few weeks back Building a Mac and Windows GUI Application.
With regards to "native look & feel": If you want this, don't use a cross-platform GUI library. Write the GUI layer once for each platform. You can share the core application logic. You can probably get away with using Qt or wxWidgets on Windows and Linux since requirements for look and feel are more relaxed, but it will look rather out of place on Macs.
If "native look & feel" isn't essential, I'd say go with Qt or wxWidgets and save yourself the headaches. I wouldn't worry about continuity for Qt. Its desktop framework is very mature and isn't maintained by Nokia (they maintain the mobile part). The open source community will keep it alive. Don't know how buggy it is, but what cross-platform framework doesn't have its share of bugs?
If "native look & feel" is essential, read on for languages choices for the core application logic.
Java: Don't. Swing doesn't actually provide a native look & feel. Just try and make any comprehensive GUI with it. Swing is also very painful to program in. There are plenty of alternatives to Swing, but I doubt any of them will be better than Qt. In addition, most apps will probably need to hook into the OS. Java bridging on Macs is deprecated. You'd have to use JNI for any extensions. Probably the same for Windows.
Python: That's the path I took. Python is not only cross-platform, it comes with a rich set of cross-platform libraries. Also easy to write C/C++ extensions on any OS. Downside is that it's relatively slow to start and takes more memory than a native C++ app. Trying to set up a deployable application is rather painful too. I wouldn't worry too much about performance though unless you plan on doing serious data processing.
C++: Also a good choice. It's not too hard to write a cross-platform app with C++ if you use cross-platform libraries like Qt or Boost (haven't tried, conclusions from questions and research). Also compatible with xCode, Visual Studio, etc, so it's easy to set up the project.

Being mainly a Java dev I lean heavily to java. Your concerns with java can for the most part be handled.
One I would JavaFX instead of Swing. It is still fairly new, but I have been playing it recently and it is pretty nice. You should be able to create what ever look you like, and it be pretty consistent. The other added benefit, is that they are adding Native packaging for JavaFX. It is still early, and that is not in the stable releases yet from what I understand.
No matter what you go with there will be hurdles and issues. So regardless of what I said above, you should pick whatever you are most comfortable in. Heck you could if may even be able to go the .net route and use Mono. I hear Mono works well, especially with projects built using it from the beginning.

There are number of options available to you
Java application
Web application
Use a wrapper like App Accelerator
Java Application
Writing a Java application which is platform independent would suite your need. But development wise you might face problems. Specially GUI experience.
Web Application
Web application is the right way to go but installing it and setting up a web server in local machine might be bit tricky. Moreover if you want to host the application this is the way to go.
Application Wrapper (App-Accelerator)
If you can use an application wrapper it will work in pretty much any platform - windows, mac os. A good example might be Wunderlist.

Related

Java programming environment : emacs or eclipse? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I'm pretty new to Java, and I need to build up programming environments for it (editing, compiling, testing, debugging, and deploying/making jar files).
And, even though I'm not a super expert of emacs, I'm a big fan of this wonderful tool.
Here comes my question.
Is it wise to use emacs for Java development? Is Eclipse better for Java development?
And, what people normally use for Java development environment? I mean, using what tool may result in getting more help than otherwise?
As a die-hard Emacs user and professional Java developer, I can say that I choose Eclipse hands-down for Java, and Emacs for everything else. Every tool has its advantages, and I try lots of tools. But the ecosystem surrounding Eclipse is unparalleled (even by EmacsWiki!) and Eclipse has the best Emacs emulation of any editor I've ever found if you install the Emacs+ plugin (by MulgaSoft).
Depending on the type of Java programming you're doing, Eclipse has no competition, i.e. if you're working with anything related to Google technologies (GWT, App Engine, Android). The Mylyn component to Eclipse interfaces with just about every task management tool out there, which is fabulous if your work in a corporate environment that uses JIRA, Mingle, VersionOne, Bugzilla, etc.
My experiences with JDEE, while favorable and interesting, put in a distant 3rd place to Eclipse and Netbeans, respectively. I haven't really worked with IntelliJ, so I can't comment on that front.
I think it's pretty critical to understand that there is a hard, non-subjective line between "AST editors" (Eclipse/NetBeans/IntelliJ) and text editors like emacs, vi, slickedit, etc. etc.
In Eclipse/NetBeans/IntelliJ they compile all the code and read that byte code back into a large, fully connected and cached internal AST. So for example when you rename a method, they follow the AST to all code in the project that uses said method and update all usages.
This is significantly different than a text find/replace which is what you get from a text editor.
Java is a strongly typed language which is an incredible advantage when using an editor that knows how to follow and manipulate that type structure.
malabar-mode is the best existing solution for Java development in Emacs. It has nice maven integration, groovy shell, semantic support, etc...
Java IDE certainly outgun anything Emacs has to offer in terms of features related to refactoring and code analysis, but other than that the Emacs experience is way better - much more powerful editor, simpler and vast ecosystem of extensions and an overall aura of greatness ;-)
It's all a matter of taste in end - whether you prefer click-based programming, when everything happens in menu and popups or prefer to go down to the bare metal, write the code more carefully(because there won't be a tool to analyze it for you) and create...
If you go for IDEs do yourself a favor, ignore all the Eclipse propaganda and have a look at the competing projects - I personally recommend you IntelliJ IDEA. In the end one decides for himself, but the decision should be made objectively and not based on statements like "everyone is using Eclipse"...
Most of the Java developers I know use Eclipse. I prefer Emacs, and at times, NetBeans. Mostly I prefer to do all my editing in Emacs and use NetBeans only to generate the build file. I recommend NetBeans over Eclipse because it has a better Emacs mode and is lighter on resources (relatively!). If you are looking for a full Java IDE for Emacs, try JDEE.
Emacs is a fantastic editor which is very useful - when you take the time to learn it well.
Eclipse/NetBeans/IntelliJ are each a fantastic Java IDE which is very useful - when you take the time to learn it well.
The amount of additional functionality that is available in Eclipse because it knows by heart that you are working with Java code and understands that code, is so large that it is difficult to tell in a few sentences. Let me give a few examples:
Hovering the mouse over any identifier shows its javadoc in a popup.
A single keypress can let you choose any implementation of the interface at the cursor location, including sub-classes.
You can easily refactor things, i.e. change orders of parameters in a method call or rename it and Eclipse will change it in all files where it is used.
The builtin Eclipse compiler is very robust so even with errors elsewhere in your source, you can still refactor code giving you more freedom to work.
The list goes on and on. There are, however, plenty things that Eclipse is not very good at, and in those cases it can be beneficial to open the files in other editors, like Emacs or vim.
So, learn your tools well, and have more tools than just a hammer.
Ultimately, this comes down to what works best for you. Try emacs, IDE's, and other tools as you see fit and then use what you like and find easiest.
I have a co-worker who says he often has emacs and NetBeans up at the same time. He uses emacs for editing and NetBeans for investigating errors, building, testing, etc.
While I've dabbled off and on with Java for years, I'm just starting to get into it seriously due to a new job where it is the main development language. Previously, I've used emacs for most of my development; it's editing power is quite nice to have. However, for larger projects I find that for many things an IDE is nice also. So, I may adapt my co-worker's strategy of running both emacs and NetBeans simultaneously.
Prior to working on this job I'd worked a little with Eclipse, which I liked. However, NetBeans is the defacto standard where I'm now working, and has some good points, so I'm working on learning that.
Recently I learned of CEDET, which looks to be a way of wrapping an IDE around emacs. Unfortunately, I've not had time to investigate it yet, but you may find it worth a look.
I am using Netbeans but there are some limitations to it, like absence of a back-forward navigation in the tool-bar (am used to it), variable renaming in a class, not changing the caller methods etc. Eclipse seemed better to me.
Best would be to try using the community edition of Idea IntelliJ . I have used their premium edition, and must say the developer experience in terms of usability friendliness and refactoring help is much better in IntelliJ. Also, there are some really neat short cuts for example to show you all the child class of a particular class in one view (And then letting you choose which to open), refactoring help and lots more.
The community edition would also have most of the features.

Starting with Android: Java or Python (SL4A)

I just ordered an Android smartphone and want to start playing around with creating my own applications. Now the question is which language to use, the native Java or Python using SL4A (former ASE).
I tend to Python, as I know it much better than Java, but I'm wondering what I would be missing using a "second class" language on Android. On the SL4A website it is also stated to be alpha quality software, which is not exactly encouraging.
I'm also not quite sure what the limitations of the scripting environment are and if they would be problematic.
At the moment you cannot create a releasable program with Python (or any other scripting language) using SL4A. I have heard rumours that this is something Google is working on, but even if they do enable it Python apps are likely to be slow and power-hungry compared to Java. Also the scripting API only gives you access to a limited subset of the native Java API. I would not consider using SL4A for serious development work at the moment, only for one-off scripts and prototyping.
Take a look at Scala. It is a statically typed language on the JVM, but uses type inference to remove most of the noise that you get in Java. It also fully supports functional programming, and has a lot of pythonish features. Because it is statically typed it is as efficient as straight Java with none of the disadvantages. IMHO it is the language that Java should have been in the first place.
A lot of people are blogging about using Scala on Android, so Google around for more information.
More likely will depend what type of applications you will develop.
I would start with Java to become familiar with Android SDK. Anyway first you need to look into some examples, tutorials. Most of them are done in Java, and only a few, probably on the dev site of SL4A for that.
Also there is native development Android NDK, that can be programmed with C++.
But anyway Java rules for general applications.
Adding an update to Dave Kirby's answer:
Issue 55, Distribute scripts as APKs, in the issue tracker at SL4A deals specifically with that.
There is a solution being worked out (may be complete by now) described at SharingScripts. The only issue seems to be that you need to have a interpreter APK already installed.
you may want to check out Ruboto it is a framework for developing Android apps based on JRuby which means your JRuby code can call Android APIs and can also be called back from the Android Java side.
Here is an introduction article .
Consider ising Kivy, if you want to write Android apps with Python. The process of packing script to .apk file is described here.
The problem is, resulting .apk will be big (~7Mb for 300Kb data). It is obvious, because you need to pack there Python runtime and all libraries.
Another solution I have heard of, is Pygame for Android, but it works on lower lewel, so you need to draw graphics manually.
Unfortunately, I have not tried any of this ways yet, but it looks, that I'm going to start using kivy soon.

What language / platform would you use for a shareware / freeware desktop application?

I have a DVD cataloging application that I wrote a few years ago with MFC. Records are saved in a sqlite database, so basically it's a CRUD app. UI-wise, it has a tree view on the left, a list view (grid) on the top right, and an HTML view (embedded IE) on the bottom right. Nothing fancy.
I wanted to update the app with more features, but I've been using Java EE for the past couple of years and I realized that I wasn't productive at all with MFC. So I'm thinking maybe I should use something else to boost my productivity. Cross-platform would be a big bonus, but it's not absolutely required.
Here are the options based on my research:
Java / Swing: I can utilize my Java knowledge; great third party libraries (such as Spring for IoC and Hibernate for ORM); cross-platform. Downside is, JRE required for users; Swing seems to be in the "maintanence" mode and it's not getting much attention from Sun.
C++ / Qt: native application;
cross-platform. But I'm new to Qt so
I have to learn it first.
C# / WPF: WPF seems to be the future
of Windows GUI development and I'm
impressed by some WPF sample apps. I
have some experience with C# but I
need learn WPF. Downside is, Windows
only; .NET 3.5 runtime required.
So what would you use if you were in my situation? Thanks in advance for any suggestions.
If you want to learn some new skills while developing this application, then C# / WPF, and LINQ in C# 3.0 is really great if you didn't have it in Java.
If you just want to get on speed, then you already answer your own question, Java / Swing. It is what you are good at.
I'm actually a big C# fan, but since you said that cross-platform would be a huge bonus, I think that Qt might actually be better for that. C# can be cross-platform via Mono, but I've had better results with Qt in that respect. They also have real good documentation in QtAssistant to get you started.
Consider PyQt + Python as well if your productivity is a big issue. Trust me when I say the learning curve for Qt is well worth it, and not as hard as it may seem at first.
Sqlite support is in both the Python standard libraries and the QSql module in Qt if you prefer to use that.
PyQt + Python is a cross-platform option as well, since Python is available for many platforms and Qt's cross-platform to begin with.
The controls you mentioned you used in your application are all available in Qt.
The only other tool apart from raw C++ is Delphi. Period.
With other tools you will have problems in the deployment.
With Delphi you will produce native exes, self-contained. Also, the database connectivity is great.
You never will be dissapointed by lack of controls or 3d party tools, a lot with source code and with free/commercial toolset.
And the compiling times are the fastest in this galaxy ;)
So, if you are serious in provide no-hasle app for your customers, and that customers are not tech-oriented like developers so could be confused because which one of the 4 .NET runtimes install, want minimal support, easy downloads, click-click-install-go, apps that work instanly like Skype,TopStyle (made with Delphi) and others,then Delphi/C++ is are your only option. Seriously. The ONLY options.
If you want a cross-plataform solution, then FreePascal/Lazarus could work if your GUI is minimalist.
In most cases, as long as the scope of the project is reasonably small, and the computational needs are modest, I tend to favor using TCL/Tk. I have not yet learned a gui api in which I'm more productive than tk (not to say that there isn't one, just that I've tried several and found them slower). TCL is not the most wonderful language to program in, to be sure, although there are a number of add-ons that help a lot, specifically [incr tcl] and tcllib.
The reason I choose this instead of other systems, I prefer coding in python, for instance, is because deployment with tcl/tk is close to unbeatable. With Starkit, you end up with a single file double clickable application that requires no installer, and is trivially portable.
Well if you really want a class platform type of application, I would convert it into a web application and host it. That way if one user uploads dvd information or a dvd cover picture another user could take advantage of that information already input into the system.
If your going to develop for the desktop try to make feel like its an application made for that platform by utilizing the OS UI tools. And for windows, pick your 3rd option C# /WPF.
If you have some non UI code in your MFC app that you would like to reuse then consider QT. Otherwise pick whatever you prefer to learn.
Instead of C#/WPF you could give Silverlight a look. You app seems simple enough that it would not take a lot to get up and running. Similar to the demos that are shown off at conferences.
Once you get the basics down it will be fairly easy to add some cool features like animations, movie clips, album art, coverflow like interface etc.
You will be able to target Windows/Mac users and possibly Linux with Moonlight. But I haven't looked at Linux in the past 8 years so I really can't say much about it.
With Eclipse RCP, you get Java, cross-platform development (see Delta Pack), native look (via SWT) and a great framework collection for desktop development (declarative UI, plugin management etc.). You should definitely give that a try.
I went the C++/wxWidgets (but you could do Qt) route a few months back when presented with almost the exact same scenario (upgrade an app with a SQLite db). wxWidgets was fairly easy to pick up, had everything I needed, and was way easier than MFC. The best part was I found a good C++ wrapper for SQLite on CodeProject (e.g., CPPSQLite) and had the whole thing up an running in no time... The project sold me on wxWidgetss, in case you couldn't tell.
I would actually look very closely at something like adobe air. It is cross platform and can be html/javascript based so chances are you won't have a heck of a lot to learn except maybe a javascript library or two. It has the ability to talk to a local datastore or over the interweb to a webservice or RESTFUL service. Development is free with aptana. Check out some of the stuff written in it:
http://www.adobe.com/products/air/showcase/

How do you make websites with Java? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
This might be a really trivial question, but I've been writing Java programs at my school and I just found out that I can create websites with Java as well.
How can I do that? Any good books/tutorials for that?
Which is better for Web development, Java or PHP?
Also, when using PHP, MySQL comes into picture and while writing Java programs for desktop, we just use File I/O, so what is better for web dev, File I/O or MySQL?
You are asking a few different questions...
How can I create websites with Java?
The simplest way to start making websites with Java is to use JSP. JSP stands for Java Server Pages, and it allows you to embed HTML in Java code files for dynamic page creation. In order to compile and serve JSPs, you will need a Servlet Container, which is basically a web server that runs Java classes. The most popular basic Servlet Container is called Tomcat, and it's provided free by The Apache Software Foundation. Follow the tutorial that cletus provided here.
Once you have Tomcat up and running, and have a basic understanding of how to deploy JSPs, you'll probably want to start creating your own JSPs. I always like IBM developerWorks tutorials. They have a JSP tutorial here that looks alright (though a bit dated).
You'll find out that there is a lot more to Java web development than JSPs, but these tutorials will get you headed in the right direction.
PHP vs. Java
This is a pretty subjective question. PHP and Java are just tools, and in the hands of a bad programmer, any tool is useless. PHP and Java both have their strengths and weaknesses, and the discussion of them is probably outside of the scope of this post. I'd say that if you already know Java, stick with Java.
File I/O vs. MySQL
MySQL is better suited for web applications, as it is designed to handle many concurrent users. You should know though that Java can use MySQL just as easily as PHP can, through JDBC, Java's database connectivity framework.
Read the tutorial on Java Web applications.
Basically Web applications are a part of the Java EE standard. A lot of people only use the Web (servlets) part with additional frameworks thrown in, most notably Spring but also Struts, Seam and others.
All you need is an IDE like IntelliJ, Eclipse or Netbeans, the JDK, the Java EE download and a servlet container like Tomcat (or a full-blown application server like Glassfish or JBoss).
Here is a Tomcat tutorial.
I'll jump in with the notorious "Do you really want to do that" answer.
It seems like your focus is on playing with Java and seeing what it can do. However, if you want to actually develop a web app, you should be aware that, although Java is used in web applications (and in serious ones), there are other technology options which might be more adequate.
Personally, I like (and use) Java for powerful, portable backend services on a server. I've never tried building websites with it, because it never seemed the most obvious ting to do. After growing tired of PHP (which I have been using for years), I lately fell in love with Django, a Python-based web framework.
The Ruby on Rails people have a number of very funny videos on youtube comparing different web technologies to RoR. Of course, these are obviously exaggerated and maybe slightly biased, but I'd say there's more than one grain of truth in each of them. The one about Java is here. ;-)
While a lot of others should be mentioned, Apache Wicket should be preferred.
Wicket doesn't just reduce lots of boilerplate code, it actually removes it entirely and you can work with excellent separation of business code and markup without mixing the two and a wide variety of other things you can read about from the website.
Also be advised, that while Java is in general very beginner friendly, getting into JavaEE, Servlets, Facelets, Eclipse integration, JSP and getting everything in Tomcat up and running is not. Certainly not the easiest way to build a website and probably way overkill for most things.
On top of that you may need to host your website yourself, because most webspace providers don't provide Servlet Containers. If you just want to check it out for fun, I would try Ruby or Python, which are much more cooler things to fiddle around with. But anyway, to provide at least something relevant to the question, here's a nice Servlet tutorial: link
Look into creating Applets if you want to make a website with Java. You most likely wont need to use anything but regular Java, unless you want something more specialized.
I'd suggest OOWeb to act as an HTTP server and a templating engine like Velocity to generate HTML. I also second Esko's suggestion of Wicket. Both solutions are considerably simpler than the average setup.

Getting started with mobile programming. What is a good platform? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
What is a good mobile programming platform to go with for a c++ developer?
Is learning android a good option?
If you already know C++ then Symbian has the largest install base, and isn't sandboxed like java/android vm/iphone.
Whilst the iPhone and Andriod may seem interesting, if you actually look at the figures Symbian really is the only option when looking at market share. Despite apple's advertising behemoth and cult following, it is far from being anywhere near the 200+ million Symbian smart phones out there. (there are approx 5 million iphone users).
Added to the fact that "java" on mobiles doesn't always mean the same thing. Different phones include different versions so unlike the PC environment, java on mobiles is not as "write once, run anywhere" as it makes out.
I have started playing with Android with the latest SDK. It is super easy to develop because of the coolness of Java, richness of android platform and eclipse IDE is very easy to use. I think Android is going to make a big difference in the moile application side.
UPDATE : Now you have the option of Windows Phone 7 too, which is my favorite at this point because I am a .NET developer for many years. Just get the WP7SDK and start coding in your visual studio itself.
Java ME will give you the widest choice of deployment options and market share, because most mobile phones support it. Going from C++ to Java is quite easy, since Java has fewer gotchas than C++. As a positive side effect you will also get to learn Java on a platform whose footprint is a lot smaller and manageable than Java SE.
I would advice the .NET Compact Framework for easy and fast development. The included emulator in Visual Studio makes it that much easier to develop.
But I also think that it depends on your intended application, I would for instance not advice the compact framework for writing a game with demanding graphics.
The downside of using the .NET Compact Framework is that you'll get limited on your target hardware, because it will only run on Microsoft Windows CE versions (and I thought on SymbianOS).
Personally, I started out with the Windows Mobile platform and Microsoft Embedded C++.
It was a natural shift because I'd come from the MSVC compiler/Visual Studio 6 environment, so I was already quite familiar with aspects of the compiler and the IDE.
In fact, because I was so familiar with those other tools, picking up the emulator and (notably) the oddities of working with ActiveSync became much easier. I also found the OS to be easy to use (including the familiar File Explorer and system design).
So, to more accurately answer your question, I think it depends on which platform you are familiar with previously and how confident you feel with the tools available. Especially for debugging and emulating!
in Symbian you can reach all the phone functionality == do really cool things, but Symbian is a bitch when you are trying to learn it from scratch - it's complicated.
JavaME - popular, very quick to start, light API, but sandboxed, access to different phone areas varies from vendor to vendor, from model to model. You can do stuff like connect to net, draw graphics and display menus on pretty every phone, but access to phone book, camera, sms messaging varies greatly
Sometimes it takes time to get app working exactly the same on different phone models (i don't know exactly, but i think this would be a problem on all the mobile platforms)
You surely need to check out Windows Phone 7, it is C# and have great tool support with VS2010 and Expression blend to develop quick Windows Phone applications. Not only this will benefit you in Phone. The same dev-skill set can be used to make Silverlight as well as WPF applications easily.
You can try to use StartJava which illustrate Android application creation.
http://www.en.assoft.ru/startjava
https://play.google.com/store/apps/details?id=com.assoft.StartJava
I want suggest you android is best technology among all now a days android phones are increasing tremendously so the development are also increasing like wise and it can be learn any developer...on the internet many tutorials are available to teach you android programming....so i would like to suggest you is that android is the best option...

Categories