DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports Events Over 2 million developers have joined DZone. Join Today! Thanks for visiting DZone today,
Edit Profile Manage Email Subscriptions Moderation Admin Console How to Post to DZone Article Submission Guidelines
View Profile
Sign Out
Refcards
Trend Reports
Events
Zones
Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones AWS Cloud
by AWS Developer Relations
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Partner Zones
AWS Cloud
by AWS Developer Relations
The Latest "Software Integration: The Intersection of APIs, Microservices, and Cloud-Based Systems" Trend Report
Get the report
  1. DZone
  2. Coding
  3. Java
  4. Codename One - Making WORA Real Again For Mobile Devices

Codename One - Making WORA Real Again For Mobile Devices

Shai Almog user avatar by
Shai Almog
CORE ·
Apr. 10, 12 · Interview
Like (0)
Save
Tweet
Share
8.36K Views

Join the DZone community and get the full member experience.

Join For Free
The iPhone was the first major phone to launch without Java, changing the landscape dominated by J2ME into a reality with a different kind of fragmentation. The open source Codename One project unifies the mobile platforms (iPhone, Android, Blackberry, Windows Phone 7 etc.) into a single API and tool stack based on Java. It allows developers to write code in Java and get native applications that can be installed on all mobile phones legally.


Codename One binds together years of work from multiple projects in the Java space to create a single coherent environment while allowing you to leverage the full power of Java tools directly from NetBeans/Eclipse. The API is Swing like with many improvements (proper styles/theming, painters, animations etc.) & yet allows full access to the underlying native device code. A standard GUI builder, simulator & IDE plugins are included and are all open source.
Seeing is believing so lets jump right to the code... After installing the Codename One Plugin (available for Eclipse/NetBeans) we now have a new Codename One project entry.
 
 


 Codename One on the iPhone simulatorCodename One Android SimulatorCodename One Blackberry Torch Simulator


 
 
We can create and run a new GUI builder hello world or non-GUI builder project in 30 seconds just by following the Wizard.

There is an active developer community forming around Codename One which can help you get started with the tool and answer the obvious questions.

Where's the catch?

There are several things you need to know:
1. For maximum compatibility Codename One currently limits you to CLDC 1.1 syntax of Java. You can remove this limitation (by changing the build.xml file) but you will forfeit RIM/J2ME compatibility in the process.
Even if these platforms aren't important to you we still wouldn't recommend doing this since you are more likely to stumble onto a Java SE feature that isn't supported by a target platform. In the future Codename One intends to slowly add additional API's and features from Java SE in a compatible and controlled manner.


2. Building for device requires sending the build to the server, this removes the need of owning a Mac for iOS builds or a Windows 7 machine for Windows Phone/Blackberry builds.
Since Codename One is open source you can build locally from the source repository but its a very complicated process.  
Using the build server is free for reasonable usage and we intend to keep it that way.


3. Currently you can't change the classpath. We intend to add a library mechanism which will allow 3rd parties to include "native" code in the library. You will need all your code in CLDC 1.1 source form, most of the API's you will need (XML/JSON parsers, UI etc.) are already included in Codename One.

 
4. Codename One is new and its a work in progress, manage your expectations accordingly. However, we are very fast with the fixes and due to the years invested in the open source projects underlying Codename One the infrastructure is very solid.
 
I will write more about what you can do with Codename One and how to accomplish it in a future post.
Codename One mobile app Open source Java (programming language)

Opinions expressed by DZone contributors are their own.

Popular on DZone

  • Keep Your Application Secrets Secret
  • Introduction To OpenSSH
  • Solving the Kubernetes Security Puzzle
  • How To Choose the Right Streaming Database

Comments

Partner Resources

X

ABOUT US

  • About DZone
  • Send feedback
  • Careers
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 600 Park Offices Drive
  • Suite 300
  • Durham, NC 27709
  • support@dzone.com
  • +1 (919) 678-0300

Let's be friends: