Is there a Java API for touching devices such as tablets? - java

I'm a java developer and I love this techonology. However, in my advisor next research we are going to use extensively touch-screen devices on Windows. This is a problem for me, because I'm used to programming on Linux and with Java.
The question is, is there an API for Java for touchscreen devices? If yes, is this API good/mature? The need for a Java API is not only because I love Java but because I don't know how to program specifically to Windows, that is, I've never used Win32 or .NET. If there isn't is there something available for Mono? I hate to exclude platforms.

Gosh, if you really want to offer a bounty on a question that can be answered in 6 seconds using google:
https://sites.google.com/site/gmitresearch/mt4j/mt4j-basics
http://code.google.com/p/sparsh-ui/
http://developers.sun.com/learning/javaoneonline/2008/pdf/TS-6127.pdf
How to develop multi-touch applications in Java?

This is an old question but i find it may still be useful.
Java Swing does not have native support for touch-events. However, Java FX does. Java FX is already integrated in Java SE 7 and 8 and could be installed on Java SE 6.
See this article from Oracle

Related

Using Xcode5 to code in Java

I have been developing Java code for doing data analysis in astronomy and physical sciences for several years using xemacs and JDE, which I have grown accustomed to and like. However, I would like to use all the wonderful features included in Xcode to make my coding easier and better.
I know that Apple encourages developing in objective C, but I don't have the time or motivation to start with this at this time. I know Java pretty well, and therefore, I want to stick with it, as least for now.
After several hours of searching the web, I haven't been able to find any decent instructions on how to setup and use Xcode under Mountain Lion or Mavericks to develop Java code. And I don't really care about all the features that are related to developing application for OS X or iOS, I am coding libraries of classes to do statistical data analysis. I just want a nice IDE to do it in, and I don't really like the look and feel of Eclipse, which is the standard for Java.
So, in the end, my question is very simple, but I cannot find the answer by googling: how does one develop in Java using Xcode5?
XCode did previously support java development but that was removed when Apple decided to stop supporting Java on OS X.
Either you need an old version of XCode, or you should go - which I would recommend you to do - with a Java IDE like Netbeans! eclipse and/or IntelliJ. After installing oracle java 7, all of them run well.

Apple Retina Display Support in Java JDK 1.7 for AWT / Swing

I just became aware that AWT / Swing under Java JDK 1.7 (as of JDK 7u15) does not support Retina displays on Apple Macbook Pros. Netbeans, for example, is nearly unbearable to use for more than a few minutes running on a Retina display and using JDK 1.7.
This has been somewhat addressed in a StackExchange question here, and quoting one specific post:
Apple's Java 6 JRE will support HiDPI, however it is not currently supported by Oracle's Java 7 JRE. It also doesn't work under the latest dev builds of Java 8. Swing and JavaFX apps are blurry on a Retinia MacBook. This is why IntelliJ still runs under Java 6.
My question is more specific than what is asked by the OP of the above thread.
My employer of less than a month uses Swing in all of its applications. For several reasons we are interested in migrating to Java 7 from Java 6. Within the last several days, another developer (who is on Windows), moved our platform over to Java 7. As I'm running a retina Macbook Pro, I noticed the issue when I pulled the latest stable branch of our code.
I am new to Java with less than a year of experience in the community, hence my question: Will the Java community be fairly responsive to this issue moving forward, or should a substantial delay be anticipated (months to a year or more) before Swing in Java 7 is compatible with Apple Retina displays?
Java 7u40 Early Access now supports HiDPI (Retina) displays, as shown by this changelog. So retina support is now available on:
Java 6
Java 7u40ea or greater
Java 8
last month I was also interested in the same topic and after some time I found out on net that nobody can answer the question exactly.
There is an open bug for this at Oracle:
http://bugs.sun.com/view_bug.do?bug_id=8000629
According to that it should be fixed for Java 1.8. But what I am afraid of is that I am not sure if it also will be fixed for Swing or only for JavaFX. I read somewhere that there is already fix for JavaFX (but not sure if official), which doesn't solve the problem for Swing.
To answer short, after some days of searching on internet unfortunately I couldn't find the answer ...
Regards,
Lubos
Retina is fully supported by Oracle starting 1.7.0_40ea. However, there are lacks of APIs for Retina. For instance, there is no support for HiDPIScaledImages like in Apple JDK. You can find some cool tips about Retina support in Oracle JDK here http://bulenkov.com/2013/06/23/retina-support-in-oracle-jdk-1-7/
According to a long thread that I read some months ago (http://lists.apple.com/archives/java-dev/2012/Oct/msg00127.html) the only way to get Retina in Swing is to install the Apple JDK, which in turn just uses a "hack" to make applications retina-compatible. That thread mentions JavaFX as a workaround (which of course is no real workaround when you already have a complex piece of software written in Swing).
I myself tried to write a simple JavaFX application with Java 7 after reading the above thread and it looked sharper on Retina; same with Ensamble (the JavaFX demo application, available on the App Store) which also seemed to render a lot nicer than a normal Swing application (like the Java Control Panel) but perhaps it's just the power of suggestion.
Since I am actively testing each new Java 8 Snapshot release I can also confirm that little to no work has been done to get Swing look passable on retina displays.
Our best bet right now (just an opinion, don't have any secret knowledge) is that someone at Oracle (or a OpenJDK contributor) will buy a retina mac and fix it in Java 8. I don't think Apple will fix it by supplying the Java 6 fixes since the guy from Apple said that they just reverted code related to rendering back to Quartz. It did give the desired result but is heavily tied to proprietary OS X internals which are not being open sourced.

Is there any language other than Java that will work as ubiquitous on mobile?

I'm trying to write a rogue-like game for my blackberry and hopefully
any other phone that supports some sort of JVM.
Because I use Java in my job I'm looking to write the game in another language but I cannot find a language that will work on multiple phones.
Am I stuck with Java?
If you're programming for Android, you could for example use Scala, see Scala on Android. Scala compiles to Java bytecode. There are also other languages which can be compiled to Java bytecode; I don't know how well-suited they are for Android programming.
You could try to use another language for the Java platform. Unfortunately you'll be rather limited there as well, because J2ME is based on a rather ancient version of Java SE and most modern languages for the Java VM need either Java 5 or at least Java 1.4.
Lua runs very well on small devices (I use it on my handheld), but it is designed to be coupled into a C API. You may well have to write glue code yourself, which is easy, but if the official APIs are Java APIs and there is no C API, you'll be out of luck.
Actually C++ is pretty universally supported at this point. However you are completely stuck with Java for Blackberry.
Technically, I think the second (JavaME being first) most widely deployed runtime worldwide is Flash Lite.
Whether it would be a good idea to use it for your game development is another matter entirely of course.
Number three is Symbian OS C++ but that won't work on your Blackberry.

Visual Studio for Java? [duplicate]

This question already has answers here:
Using Java with Microsoft Visual Studio 2012
(9 answers)
Closed 6 years ago.
Did anybody have the idea to create a Visual Studio extension for Java ?
Somebody wrote an article here:
http://www.improve.dk/blog/2007/09/29/compiling-java-in-visual-studio
But nobody seems to have the idea of using the free visual studio isolated shell to create an IDE for Java?
Good question. There are some plugins for VS that allow production of other code, such as SapphireSteel Software's Amethyst (allowing Flex development with VS) so it's only natural to ask if there was a plugin for a language as popular as Java.
After searching around the web for a bit (damn NerdSniping :P) I found something very interesting: Grasshopper, a MSIL to Java Bytecode crosscompiler that allows running VB and C# 3.0 webapplications on Java Application Servers and also extends VS to work with Java Bytecode (debugging capabilities, IntelliSense for Java classes, etc).
Perhaps someone else has some firsthand experience with this product or could give some more information regarding the actual capabilities of the crosscompiler.
You can also use J# to write your java code in VS. Dont see the real point of having a java plugin?
People would probably rather spend time improving Eclipse or Netbeans.
Microsoft don't like Java. Those who do, write IDE's in Java.
Yes, there is a plugin that supports the JAVA language in Visual Studio:
http://visualstudiogallery.msdn.microsoft.com/bc561769-36ff-4a40-9504-e266e8706f93
Answers to the same question here:
http://discuss.joelonsoftware.com/default.asp?dotnet.12.384449.7
... except nobody can't really answer because there is none indeed !
Anybody realize there is a HUGE Business Opportunity to do so ? Thoough Mainsoft has done a great job at recompiling .net for j2ee, they would have made more $$$ by just creating an ide fully for java.

How can one develop iPhone apps in Java? [closed]

Closed. This question needs to be more focused. It is not currently accepting answers.
Want to improve this question? Update the question so it focuses on one problem only by editing this post.
Closed 5 years ago.
Improve this question
I was wondering if is it possible to develop iPhone applications using Java plus XMLV, which claims to cross-compile Java-based Android applications to native iPhone applications.
Is XMLV a viable way to develop iPhone applications using Java?
Here are a few Java code examples used to build and application in an iPhone:
http://www.xmlvm.org/iphone/#
I think we will have to wait a couple of years more to see more progress. However, there are now more frameworks and tools available:
Here a list of 5 options:
Codename One
RoboVM <-- Closed
Avian no maintainer
XMLVM
J2ObjC
Multi-OS Engine not maintained
If you've completed your other projects, why not take the time to learn Objective-C? There is a ton of material out on the web to help you get started. Honestly, it won't be that hard and learning to do some memory management will be a great learning exercise. Have you programmed in C before?
Most cross compilers won't do a great job in converting your code, and debugging your project may become much more difficult if you develop them this way.
I think your teacher sent you down the wrong path.
This is a classic example of trying to put a square peg into a round hole. The best way to develop for the iPhone is with the iPhone SDK and objective C. The best way to develop for Andriod is Java and the Android SDK. The best way to develop for WinMobile is C#/VB and the .Net Framework.
As you can see each has their own "best" SDK. Since you are only learning Java I would second the suggestion to play around with Java and Android.
There is anew tool called Codename one: One SDK based on JAVA to code in WP8, Android, iOS with all extensive features
Features:
Full Android environment with super fast android simulator
An iPhone/iPad simulator with easy to take iPhone apps to large screen iPad in minutes.
Full support for standard java debugging, profiling for apps on any platform.
Easy themeing / styling – Only a click away
More at Develop Android, iOS iPhone, WP8 apps using Java
take a look at codenameone.com project, it's a cross platform mobile framework where the ui part is a fork of LWUIT.
This project leverage xmlvm to translates the java bytes code to Objective C
You can also take a look at RoboVM.
It translates Java byte-code into native ARM or x86 code which can run directly on the processor without any VM or interpreter needed. Most of the Obj-C UI elements are already bridged into Java and follows the usual Java design patterns.
Edit
Robo VM recently announced that it would be shutting down the service - Source
You need to know at least basics of Objective-C to develop for iPhone. However, it is possible to use C++ classes.
As far as I know Adobe is working on building Flex/Flash applications for iPhone. Read more here: http://theflashblog.com/?p=1513
You can't.
Note however that Monotouch allows you to develop in C# instead of Objective-C. http://monotouch.net/
If you plan on integrating app functionality with a website, I'd highly recommend the GWT + PhoneGap model:
http://blog.daniel-kurka.de/2012/02/mgwt-and-phonegap-talk-at-webmontag-in.html
http://turbomanage.wordpress.com/2010/09/24/gwt-phonegap-native-mobile-apps-quickly/
Here's my two cents from my own experience: We use the same Java POJOs for our Hibernate database, our REST API, our website, and our iPhone app. The workflow is simple and beautiful:
Database ---1---> REST API ---2---> iPhone App / Website
1: Hibernate
2: GSON Serialization and GWT JSON
Deserialization
There is another benefit to this approach as well - any Java code that can be compiled with GWT and any JavaScript library become available for use in your iPhone app.
I'm answering this question 2 years down the line and I must stress that I did have pretty much the same problem as you did. However I'm so happy that Android has evolved into what it is today.
Having said that, I do regret that I did not learn C/C++ while I could have and I don't want to blame my teachers for it cos where was my brain when the time was right?
I'm sunk in Java today and I'm glad that I did not make the mistake of learning too many languages and being less productive... However I did learn HTML5 which really made things a lot easier, maybe someday, I might get motivated to learn C/C++ . Or if I get an Apple mac at a real throw-away price, I might learn Objective-C :)
I think Google Open Sources Java To Objective-C Translator will make it possiblöe to develop in Java for iOS https://code.google.com/p/j2objc/
try to use TotalCross. It is a Java Framework to help devs create iOS and Android apps with only one source code. Different from the others platforms, it doesn't require any knowledge in iOS (Objective-C or Swift) nor Android (SDK or NDK)
there is a maven integration
https://gitlab.com/totalcross/TotalCross/wikis/building-with-maven
http://www.xmlvm.org/android/
Specifically talks about Java based Android apps being ported to the iPhone using non-Apple hardware.
You might also want to check out MonoTouch (C# rather than Java...but the two are very similar).
Perhaps you should consider Android applications instead of iPhone applications if you really want to develop in Java for smartphones. Android natively uses Java for it's applications; so perhaps this might be a better option?
As for iPhone, I would recommend you to look into Obj-C or C/C++ depending on the type of applications you want to make. Should be fun to dabble into a new language! :)
You can try iSpectrum ( get it at http://www.flexycore.com )
You'll be able to develop and debug your Java apps in Eclipse. You'll still need a Mac and XCode to launch it on the simulator, or install it on the real device, though.
But you won't have to actually use XCode editor. Plus you can use it for free if you're planning to work on an open source project.
To add to this there's: http://www.oracle.com/technetwork/developer-tools/adf-mobile/overview/index.html
A Java & HTML5 Based Framework for Developing
Oracle ADF Mobile enables developers to build and extend enterprise
applications for iOS and Android from a single code base. Based on a
hybrid mobile architecture, ADF Mobile supports access to native
device services, enables offline applications and protects enterprise
investments from future technology shifts.
Even if the question states Java, most of the answers have digressed. So I thought I would do the same :)
We have been using Adobe AIR for the last 5 years and it is truly cross-platform and provides native-like performance with the same code base (at least 99% of our code is the same). Adobe AIR got some bad press at the beginning during the 'beta' period (slow, no GPU, Flash 'dead' etc.) But now, it's amazing what you can do with it. Not to mention the wealth of open source libs out there.
With the same code base you can push your app onto:
iOS
Android (x86 and ARM)
Flash (still VERY useful)
ChromeBook
PC (as native with installer)
Mac (as native with installer)
Why bother with Java or Objective-C ?
The only common platform not covered is Window Phone. But that's coming soon too.
Build a hybrid app. Anyways Java is not enough for a software engineer , you need to learn JS,HTML5,CSS as well for becoming a full stack mobile/app developer.
Build the complete backend using Java & frontend using Cordova/Phonegap.
I'm assuming you dont need the last drop of juice from the hardware even hybind app should suffice your needs.
Build a responsive webapp using Bootstrap 4 + React JS. Use https://github.com/ipselon/structor to quickly build up the frontend. Now the web app becomes an app in the browser.
You could also take the same app and build it using cordova to publish a app on ios/android platform.

Categories