Tuesday, January 31, 2012

Building Hello World With Codename One


Here is a quick tutorial for building/debugging a hello world application using Codename One that works on all devices.


We start by creating a new project in NetBeans and selecting the Codename One project.
It is important to use proper package names for the project since platforms such as iOS & Android rely on these names for future updates.

 

By default this project is a GUI builder project so we open the Codename One Designer with the content of this file.
  

The default Codename One theme, derives from the platform native theme. We can easily change the "base theme" in the preview to see how the theme will act in different devices by clicking the native theme option in the application menu.

 

Now we can edit the generated GUI and makes changes to the screens within the GUI builder. We can bind an action event to the button and go to the code to show a dialog.

 

Now we can edit the generated GUI and makes changes to the screens within the GUI builder. We can bind an action event to the button and go to the code to show a dialog. Just insert the code:
Dialog.show("Hello", "Hi There", "OK", null);

 

Now lets send a device build for a platform this is pretty trivial to accomplish by right clicking the project and selecting the device.

 

In the build server we can now see the progress of the build and the results for the build sent. We can email a link to the deployment files, download them or even use a QR reader to install them to the phone. We intend to offer a feature that pushes builds directly to development devices soon. 

Monday, January 23, 2012

Delaying Beta Release (Please Blame Git Hub)

I just lost two days worth of work because of f'ing github, its merge system and UI tool is such an unholy mess that it created a branch long story short I lost 2 or maybe more days of work. (Hard to tell just how much).
This will probably delay us further since now we need to find a new host for the open source and backend sources. I highly recommend you avoid github. They have a nice interface on the Mac but it just fails with weird error messages and on Windows git is a no show, tortoise GIT isn't even remotely in the league of SVN.

Sorry, I won't post any Codename One related material this week. We are trying to get the beta out of the door and this came out in the absolute worse time.

Friday, January 13, 2012

What Is Codename One

The signup for the private beta of Codename One is now complete, thank you all for the great response to this. You should receive an email within 24 hours regarding your signup status (assuming you signed up). 

Codename One is a cross device platform allowing you to write your code once in Java and have it work on all devices specifically: iPhone, Android, Blackberry, Windows Phone 7 & J2ME devices. The biggest goals for the project are ease of use/RAD (rapid application development), deep integration with the native platform & native speed.

To achieve this we looked at the pain points and missing elements within the current environments and added/refined the elements we think are missing. We used the portability experience of LWUIT to effectively reinvent Java programming for mobile devices and still allow full access to the underlying OS including embedding native components in place.

The Codename One solution consists of the following parts:

  • Codename One API - a Swing like API geared for mobile devices with support for IO, GPS, Media/Camera etc. The UI/IO portions of the Codename One API are based on LWUIT which is highly optimized to mobile device development, multi-resolution and multi-DPI programming.
  • Native Themes - Codename One ships with native device themes that are implicitly set to a project to ease the integration with the native OS.
  • NetBeans/Eclipse plugins - for the beta period we will focus mostly on NetBeans support but the intention is to provide a choice of IDE's. The plugin allows easy development without requiring any additional installations of device emulators or platforms.
  • Simulator environment - Codename One provides a FAST, easy to use and flexible simulator environment to simulate common devices on the market. This environment is highly pluggable and extensible allowing the community to quickly pick it up.
  • Codename One Designer - GUI builder, theme creator, localization tool and generally the Swiss army knife of Codename. It allows drag and drop application creation as well as unique features such as live preview of the GUI on an actual device.
  • Build Server - its remarkably hard to get a device build working on one platform and getting it working on 6 (RIM is effectively 2 or even 3 platforms) is one of the hardest things in device programming. Codename One offers a cloud service to seamlessly build your applications for free. You can always compile them locally and avoid the cloud service entirely, that is pretty difficult to accomplish in comparison it also requires a Mac for iPhone builds and Windows for RIM/Windows Phone 7 builds.
  • Cloud services - Codename One offers cloud services ranging from crash protection to on device debugging and access to web services, push notification, location etc.

I'm hoping you have lots of questions and feedback to give so please provide it in the comments section bellow. I will try to update the FAQ with answers  to all the questions.

Saturday, January 7, 2012

Simulate It


One of the things I really don't like about mobile development is the simulators. For those of you who might not know it, I was a member of the WTK (Sun Wireless Toolkit) 1.0 team and Chen was the lead for the Sprint WTK. So we have lots of experience in building device simulators and working with Simulators/emulators.

Despite our best efforts the experience of working with a simulator sucks there are better and worse simulators but the fact still remains that you can't provide the same tooling/ease of use that you get when developing "proper" Java SE  code.

As part of Codename One we intend to revolutionize simulators by providing the worlds simplest simulator, it supports proper device scaling (where the fonts are scaled separately to keep them readable) which allows developing on smaller screen sizes. Its wicked fast, highly pluggable, customizable and most importantly completely open source.

Check out the quick demo above and notice how the simulator adapts to different devices resolutions/scaling. I didn't show off some of the nicer things such as its ability to assume native device themes since the tzone demo enforces its own theme.

Tuesday, January 3, 2012

Live Preview On Device And Beta Signup



The video above shows the upcoming live preview resource editor feature that will be landing together with everything that's coming. This feature essentially allows you to edit a theme/GUI within the resource editor and the devices are updated INSTANTLY with the changes. This is a huge boon for designers who often need to feel the final result on the device.

Within a couple of weeks we will make the full announcement regarding the upcoming roadmap and exactly where we are headed...

You can start signing up for the private beta cycles by going here, please don't be offended if you don't get picked for the first beta cycles since we are trying to keep them small to iron out the kinks.