NeoMAD 3.2 release notes

March 7, 2013

Prerequisites

System requirements

NeoMAD is now compatible with the Java SE Development Kit version 7 and can be run on a 64-bit Windows with a 64-bit Java SE Development Kit.

Java ME SDK

The Java ME platform SDK 3.0, used to build applications for Java ME and BlackBerry devices, has been replaced with the Java ME platform SDK 3.2 (on Windows only).

New Features

Supported targets

NeoMAD 3.2 introduces the support of iPad through the IPAD target and the support of Universal iOS Apps through the IOS target.

The support of Android 4.1 and 4.2 (Jelly Bean) has also been added and is available through the ANDROID41 and ANDROID42 targets.

On the other hand the ANDROID15 and WINDOWSPHONE70 targets are not supported anymore and have been removed.

Finaly, NeoMAD applications can now be built for the NOKIA306 (aka Nokia Asha 306).

Go to http://neomades.com/fr/liste-telephone.php to get an up-to-date list of targets supported by NeoMAD.

XML layouts

In addition to the previous Java implementation mode, it is now possible to define the application UI using XML.

Please refer to the NeoMAD User Guide for more information ($4.2.2.3 Declaring UI parts in XML).

Localization

NeoMAD allows to build binaries containing several languages (using the -m option). At the execution time, the application will automatically use the language according to the phone settings.

Please refer to the NeoMAD User Guide for more information ($3.2.1.2 Language(s)).

Build chain

Using target platform specific code

There is now a short version of the -generate-specific-impl command line option called -gsi.

The directories used in the specific code feature can now be renamed by using two parameters in the <parameters> section of the URS file:

  • <specificdefpath> to define the path of the folder containing the definition
  • <specificimplpath> to define the path of the folder containing the implementation

Please refer to the NeoMAD User Guide for more information ($6.2 Using platform specific code).

Generating the project in the target platform format

The -gp (-generate-project) option is now available for all the platforms supported by NeoMAD, including BlackBerry and Java ME.

Minor enhancements

  • Display a warning when the version of the XSD declared in the URS is not the same as the version of NeoMAD
  • Display a warning when a custom target is defined in the family description file but is already supported by NeoMAD
  • Allow to use several <resourcepath> variables to declare the resources in the URS
  • iOS: now the Bundle Identifier of the generated project takes the value of the <applicationidentifier> parameter declared in the URS (which is the <packagename> by default)
  • iOS: allow to modify the Bundle Identifier in the generated project (then Xcode can be used to compile the project)

Generic API

Support of tablets

Several classes and methods have been added to provide a better support of tablets.

The new SplitScreen screen (in the com.neomades.app package) manages the presentation of two side-by-side screens. This class can be used to implement a master-detail user interface for tablets devices. In NeoMAD 3.2 this feature is available for Android and iOS. It will be extended to Windows Phone in a future release.

The setActionBarEnabled() method (in the com.neomades.app.Application class) allows to enable or disable the ActionBar in Android devices.

JSON

It is now possible to read and write a JSON stream, in two ways: using the JSONReader and JSONWriter classes or the JSONObject and JSONArray classes (all of which are found in the com.neomades.json package).

This feature is available for all the platforms supported by NeoMAD except the Java ME CLDC 1.0 devices.

Camera

The Camera API (in the com.neomades.media package) allows to take a picture and/or a video with the device camera and to pick pictures or videos from the device gallery.

UI

All UI views are now extensible and can be overriden.

The TabScreen class has been added in the com.neomades.app package. It allows to create a tab-style selection interface:

  • in iOS, it displays tabs at the bottom of the window for selecting between the different modes and for displaying the views for that mode
  • in Android, it displays tabs at the top of the window for selecting between the different modes and for displaying the views for that mode
  • in Windows Phone, this screen interface displays tabs into the native Panorama interface (Metro style)
  • in BlackBerry and Java ME, it displays tabs into the menu

The SegmentedView control (in the com.neomades.ui package) allows to choose between several items displayed in a horizontal view with multiple segments.

The DatePicker control (in the com.neomades.ui package) allows to create a date picker to chose a date.

The Toast control (in the com.neomades.app package) allows to create simple popups. It is only supported on Android.

Finaly, it is now possible to customize even more the look of various UI controls:

  • the setBackground() method allows to define background of the control thanks to a new Background class found in the com.neomades.graphics package; NeoMAD 3.2 supports backgrounds with linear gradient and more background types will be added in future releases
  • the setBorderColor() and setBorderWidth() methods allow to choose the color and the thickness of the border
  • the setCornerRadius() method allows to set rounded corners

Util

New classes, methods and attributes have been added to the java.lang and java.util packages:

  • Boolean.TRUE, Boolean.FALSE constants
  • Math.E, PI constants
  • Math.abs(), ceil(), cos(), floor(), max(), min(), sin(), sqrt(), tan(), toDegrees(), toRadians() methods
  • NoClassDefFoundError class
  • java.lang.ref.WeakReference support (not supported by CLDC 1.0 phones)
  • java.lang.Double
  • java.lang.Float
  • Thread.interrupt()
  • Random.nextFloat(), nextDouble(), nextInt() methods

Furthermore, the following classes have been added to the com.neomades.util package:

  • the DeviceInfo class allows to set runtime conditions
  • the IOUtils class provides methods to convert InputStream objects to byte[] objects

Minor enhancements

In addition to the main features described in the previous chapters, several enhancements have been made to the NeoMAD Generic API:

  • Add the DoNotObfuscate interface. The classes that implement this interface will not be obfuscated by Proguard (when building a binary for Android, BlackBerry or Java ME).
  • Add Application.setForcedTheme(), setForcedAccentColor(), Application.THEME_DARK, Application.THEME_LIGHT
  • Add Application.onActivated(), onDeactivated(), onForeground(), onBackground(), onExit() lifecycle events
  • Add Application.setTitleBackgroundColor(Color), setTitleColor(Color)
  • Add Controller.getRootController(): used by TabScreens and SplitScreens
  • Add Screen.findView(int): search view by an ID inside the content of the screen
  • Add Screen.setContent(int layoutId): set the content of the screen with a layout declared in the URS
  • Add View.findView()
  • Add View.inflateXML()
  • Add TextField.setMaxLength() method
  • Add TextLabel.setUnderlineThickness()
  • Add MenuItem.getItemId(), setItemId()
  • Add MenuItem.setAsLeftAction(), setAsRightAction() to set action items at the left or right of the title inside the titlebar (for iOS and Android)
  • Add HttpRequest.setUploadProgressListener(), setDownloadProgressListener(): add HTTP download or upload progress listener (HttpProgressListener)
  • Add HttpRequest.setMethodHEAD(): HTTP HEAD method support
  • Add HttpResponse.getHeader() and HttpResponse.getDataStream()
  • Add HttpRequest.setPostContent(InputStream)
  • Remove TextField.setClickListener()
  • Remove Theme support
  • Remove ResourceNotFoundException constructor
  • Remove SmsResult constructor
  • Rename the IStrechMode, IAlignment and IEditMode interfaces into StrechMode, Alignment and EditMode
  • Android:
    • Allow to process received intents in platform-specific code
    • Add Application.setActionBarEnabled() to enable action bar mode
    • Add MenuItem.setShowsAsUpEnabled() to show UP indicator inside the action bar
    • Change TimePicker default mode (MODE_DIALOG_PICKER, MODE_INLINE), now the time picker shows pickers in a dialog
  • BlackBerry:
    • Implement setClickable() for ImageButton
  • iOS:
    • Add Application.setBackButtonText(String)
    • Add TabLayout styles
    • Add Menu setStyle() and setTranslucent()
    • Add MenuItem.setSystemItem() and MenuItem.SYSTEM_XXX constants in order to support native iOS items
    • Add MenuItem.setStyle()
    • Add MenuItem.setColoredImage() to enable colored image support for UIToolBar
  • Windows Phone:
    • Add Application.setForcedAccentColor() to change focused color
    • Add new Font styles

Documentation and examples

  • Add the iOS specific implementation in the PlatformSpecificCode example
  • Add the JSONExample that shows the two ways of reading and writing a JSON stream with the NeoMAD Generic API
  • Add the KeyEventExample that shows how to catch the key events in a NeoMAD application

Fixed Bugs

Build chain

  • Improve the error message displayed when an invalid expression in used as a condition in the URS
  • Android: fix the -source option used to compile the source code (set -source 1.5). This allows to use Java 5 in the Android specific code
  • Fix the usage of the <applicationidentifier> parameter combined with platform-specific code
  • Improve the optimization step for BlackBerry and Java ME targets
  • Fix ProGuard configuration files for Android
  • Fix the project.properties file generated for Android targets: the API level is now the same as the one specified in the targetSdkVersion parameter in the AndroidManifest.xml file
  • The JAR files declared with the <jarfiles> tag of the URS file are not correctly embedded in the iOS binary
  • Improve the error message when the mobile provision file declared in the URS is not found
  • Fix crashes when the version number given in the URS has only one or two parts
  • Fix several issues in the signature for Android and Java ME
  • Check the validity of the resources names declared in the URS (thus avoiding cryptic errors during compilation)
  • Fix the launch of the BlackBerry simulators
  • Improve the error message that is displayed when trying to use a full version while an evaluation license key is already installed

Generic API

  • Vibrator.startVibration() throws SecurityException when the permission is not declared
  • Button/TextLabel.setFont(Font) throws NullPointerException when the parameter is null
  • Fix a bug with succession of dialogs
  • Fix AudioPlayer.isPlaying()

Generic API for Android

  • TextField is no more erased when the phone’s orientation changes
  • Fix padding bugs: DP units are now used (instead of pixel)
  • Fix AudioPlayer.getVolume() bad value
  • Fix RadioGroup.getSelected(): the method returns the radio button which has called setChecked(true)
  • Fix TextArea bug: a newline button is added to the keyboard in order to insert newline characters
  • Fix a bug when the application restart after a crash

Generic API for BlackBerry

  • Fix “marquee” effect for TextLabel: now scroll from right to left
  • Fix ScrollView bug: scroll indicators are now displayed when the ScrollView is scrollable in both side
  • Fix Application.onBeforeExit() bug: the method is now called when the application will exit with back button
  • Fix TextLabel drawing bug (some artifacts appeared)
  • Fix ComboBox listener bug: the listener of the ComboBox is now called only one time
  • Fix Controller.resetScreenStack(Screen) bug: the reset could now replace the root screen
  • Fix Controller.replaceCurrentScreen(Screen): avoid ClassCastException when another popup is shown over the screen
  • Fix RadioButton.setChecked(boolean) method, the method works when a RadioButton does not belong to a RadioGroup
  • Fix ImageLabel bug: ImageLabel is refreshed correctly when the image is changed (image with different size than the previous)
  • Fix Screen life cycle bugs: the onPause() and onResume() methods are not called on a screen when a popup is shown or hidden over it

Generic API for iOS

  • The java.lang.StringBuffer.append() method called with a null parameter appends "null" to the StringBuffer instead of throwing a NullPointerException
  • The String.startsWith() method called on an empty string returns false instead of throwing an NSRangeException
  • String.trim() method now returns the same values as in Java
  • Casting double into long or int now returns the same values as in Java
  • Fix rotation bugs
  • Fix TextField with opened keyboard bug: the screen will scroll to the selected TextField after the keyboard appears
  • Fix Layout visual bug when no child is visible
  • Fix ListView visual bugs with different types of items (Layout, Button)
  • Fix CheckBox click bug: the click over the label now checks the CheckBox
  • Fix ImageButton bug with the vertical stretching mode
  • Fix disabled styles for Button, TextField (under iOS 4.3)
  • Fix TimePicker bugs: setEnabled(), background image and background color now work
  • Fix ScrollView bug: scroll bar not well displayed under iOS 4.3
  • Fix Dialog life cycle bugs

Generic API for Java ME

  • Fix Button/TextLabel.getFont() bug: now returning the good value
  • Fix Screen bug: Screen.onPause() method is called when popping a screen
  • Fix Screen.setResult(ScreenParams) bug: setResult() pops the screen

Generic API for Windows Phone

  • Screen.onDestroy() is now called on Screen when calling Controller.popScreen()
  • Fix Menu items bug: some items are not duplicated in both menus (AppBar shortcut list and AppBar more list)
  • Avoid not cancellable dialogs: it is forbidden on Windows Phone (Microsoft Guidelines)
  • Fix performance issues with combo boxes which have very long list of items
  • Fix ComboBox.getSelectedItem() bug (the method was returning null in all cases)

Upgrading from version 3.1

When upgrading to version 3.2, you need to adapt your projects in order to have full benefit from the new features and improvements brought by this new version.

Prerequisites

Java ME SDK update

If you are targeting Java ME or BlackBerry devices on Windows, you must make sure that the right version of the Java ME SDK is installed on your computer. The Java ME platform SDK 3.0 has been replaced with the Java ME platform SDK 3.2.

This new version of the Java ME SDK being only available for Windows at the moment, the compatibility with the Java ME platform SDK 3.0 is kept on Mac OS. If you are using the Mac OS version of NeoMAD, there is nothing to do.

Java ME and BlackBerry configuration

In order to allow NeoMAD to build the application for Java ME and BlackBerry targets, the path to the Java ME SDK must now be indicated in the neomad.properties file located at the root directory of the NeoMAD installation.

neomad.properties file example (Windows version):

# Java ME SDK path
JAVAMESDKPATH=C:/sdk/Java_ME_platform_SDK_3.2

neomad.properties file example (Mac version):

# Java ME SDK path
JAVAMESDKPATH=/Applications/Java_ME_SDK_3.0.app

Using Java constants in the URS file

The format of the Java constant names used in the URS file has evolved to be clearer and avoid mistakes. All the constant names used directly in the URS file must now be called this way: ${CONSTANT_NAME}.

Example:

<icon path="res/RES_FOLDER/icon.png">
   <windowsphone tilebackgroundpath="res/RES_FOLDER/icon.png"/>
</icon>

will become:

<icon path="res/${RES_FOLDER}/icon.png">
   <windowsphone tilebackgroundpath="res/${RES_FOLDER}/icon.png"/>
</icon>

Please refer to the NeoMAD User Guide for more information ($5.6.4 Conditional coding in the URS file).

Note that resource variation names have a specific format, allowing to distinguish them from Java constants. In order to use variations names in resources declarations, you must use this syntax: #{VARIATION_NAME} where VARIATION_NAME refers to the name of the declared resourcepath.

Example:

<resourcepath name="RES_PATH" value="240x320">
   <variation size="normal" density="medium" value="320x480" />
   <variation size="normal" density="high" value="480x800" />
</resourcepath>

<resourcelot>
   <image name="IMG_LOGO_NEOMADES" path="res/images/Neomades#{RES_PATH}.png" />
   <image name="IMG_TITLE_LOGO" path="res/images/#{RES_PATH}/title_logo.png" />
   <image name="IMG_COMMAND_BACKGROUND" path="res/images/common/command_background.png" />
</resourcelot>

Please refer to the NeoMAD User Guide for more information ($5.7 Resource variations).