Mobile Zone is brought to you in partnership with:

Shay Shmeltzer is a group manager for Oracle JDeveloper. He has occupied various roles in the software development industry, ranging from development to marketing. Shay has posted 3 posts at DZone. You can read more from them at their website. View Full User Profile

Oracle Gets Java Running on iOS Devices

10.25.2012
| 65162 views |
  • submit to reddit

This might have been hidden somewhere between the lines, but you can now run Java on iOS devices.

Oracle found a solution for the "iOS can't run Java" problem, and released it in the new Oracle ADF Mobile solution. This enables you to use Java to write the logic layer of on-device applications that run on iOS devices such as iPads and iPhones (oh, and the same code and application will also run on Android devices).

Oracle ADF Mobile uses a native container that runs applications on both iOS and Android from a single source base. One part of that native container is a headless/lightweight JVM.

So when you build an application with Oracle ADF Mobile, you write your business services layer with Java. You  develop UIs either by coding HTML5/CSS3, or if you rather use a component based approach for UI definition (think JSF), you can use Oracle's mobile optimized AMX components to define UI.

This approach makes it very easy for any Java developer to become an iOS developer without the need to learn XCode coding.

Check out this quick demo

ADF Mobile also includes an incripted SQLite database for local/offline data storage, as well as an abstraction layer that allows you to access device services such as camera, location, contacts, SMS etc.

You can learn more about ADF Mobile and download it here:

P.S. The first ADF Mobile application is already on the iTune store and it offers a monitoring application for Hudson

 

 

 

Published at DZone with permission of its author, Shay Shmeltzer.

(Note: Opinions expressed in this article and its replies are the opinions of their respective authors and not those of DZone, Inc.)

Comments

kent gibson replied on Fri, 2012/10/26 - 7:21am

Are you sure it uses a headless/lightweight JVM? It is not clear from the documentation if that is the case.

 In this diagram:

Architecture Diagram

They show PhoneGap and a Java component on the Mobile Device. Which begs the question what the PhoneGap component is doing. Is it really only interfacing the device services? Or is it the core of the solution, ie Java is converted to JavaScript.

Shay Shmeltzer replied on Fri, 2012/10/26 - 11:10am

If you look at tht code for the samples that ship with the product you'll see that PhoneGap only handles device service interactions.

The demos show Java used for things like database access through JDBC, navigation and UI control (managed beans).

http://www.oracle.com/technetwork/developer-tools/adf/adf-mobile-samples-1865088.html 

Mark Unknown replied on Fri, 2012/10/26 - 12:20pm

I watched the demo.  I don't care for coding in "XML", even with just the UI, but it is definitely better than hacking out a UI in JavaScript.  

So how much does it cost?  

Greg Brown replied on Fri, 2012/10/26 - 1:29pm

>  I don't care for coding in "XML"

In most XML-based UI toolkits (Flex, WPF, JavaFX, etc.), you "declare" the UI in XML. You still "code" in Java, C#, or whatever. In other words, the markup doesn't encode any logic, just structure. I'm not all that familiar with ADF, but I imagine it is similar.

Shay Shmeltzer replied on Fri, 2012/10/26 - 2:34pm

The nice thing about using components to define the UI in XML is that you just define the structure, and the actual technical implementation can be done in multiple ways.

For example, initially the components in ADF Mobile were leveraging JQuery Mobile to render their output - but the performance of the JQuery Mobile components wasn't great, and skinning them was hard. So we changed the code that the components used and removed JQuery Mobile - which made our applications faster.

While this change was happening - the people who were already basing their applications on the components - didn't need to change anything in their application - and suddenly their applications performed better.

 

As for the price question - if you are already licensed for an Oracle WebLogic Server or Oracle FMW, then this is free. Otherwise you buy an Oracle ADF server license and you are free to develop as many applications for as many users you want. More in the FAQ.

Mark Unknown replied on Fri, 2012/10/26 - 3:28pm in response to: Greg Brown

I meant "coding" in the generic sense.  So, i don't care to define the GUI in XML either. But like i said .... better than some things.

Mark Unknown replied on Fri, 2012/10/26 - 3:37pm in response to: Shay Shmeltzer

I was about to say ... I dont have Weblogic or FMW, but then i remembered we do use WL for a few things. I dont ever touch them so I totally forget about it.

The FAQ is not clear - if we have Weblogic ... how many apps and developers can use it? And how do we get it?

Shay Shmeltzer replied on Fri, 2012/10/26 - 4:35pm

If you have a server license then there is no limit on the number of developer or apps.

To get ADF Mobile, just download the latest production Oracle JDeveloper, then use the help->check for updates to get the mobile extension, and then follow the tutorials on the ADF Mobile web page.

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.