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 newBackgroundclass found in thecom.neomades.graphicspackage; NeoMAD 3.2 supports backgrounds with linear gradient and more background types will be added in future releases - the
setBorderColor()andsetBorderWidth()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.FALSEconstantsMath.E,PIconstantsMath.abs(),ceil(),cos(),floor(),max(),min(),sin(),sqrt(),tan(),toDegrees(),toRadians()methodsNoClassDefFoundErrorclassjava.lang.ref.WeakReferencesupport (not supported by CLDC 1.0 phones)java.lang.Doublejava.lang.FloatThread.interrupt()Random.nextFloat(),nextDouble(),nextInt()methods
Furthermore, the following classes have been added to the com.neomades.util package:
- the
DeviceInfoclass allows to set runtime conditions - the
IOUtilsclass provides methods to convertInputStreamobjects tobyte[]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
DoNotObfuscateinterface. 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()andHttpResponse.getDataStream() - Add
HttpRequest.setPostContent(InputStream) - Remove
TextField.setClickListener() - Remove Theme support
- Remove
ResourceNotFoundExceptionconstructor - Remove
SmsResultconstructor - Rename the
IStrechMode,IAlignmentandIEditModeinterfaces intoStrechMode,AlignmentandEditMode - 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
TimePickerdefault mode (MODE_DIALOG_PICKER,MODE_INLINE), now the time picker shows pickers in a dialog
- BlackBerry:
- Implement
setClickable()forImageButton
- Implement
- iOS:
- Add
Application.setBackButtonText(String) - Add
TabLayoutstyles - Add
Menu setStyle()andsetTranslucent() - Add
MenuItem.setSystemItem()andMenuItem.SYSTEM_XXXconstants in order to support native iOS items - Add
MenuItem.setStyle() - Add
MenuItem.setColoredImage()to enable colored image support for UIToolBar
- Add
- Windows Phone:
- Add
Application.setForcedAccentColor()to change focused color - Add new
Fontstyles
- Add
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
targetSdkVersionparameter 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()throwsSecurityExceptionwhen the permission is not declaredButton/TextLabel.setFont(Font)throwsNullPointerExceptionwhen the parameter is null- Fix a bug with succession of dialogs
- Fix
AudioPlayer.isPlaying()
Generic API for Android¶
TextFieldis 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 calledsetChecked(true) - Fix
TextAreabug: 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
ScrollViewbug: scroll indicators are now displayed when theScrollViewis scrollable in both side - Fix
Application.onBeforeExit()bug: the method is now called when the application will exit with back button - Fix
TextLabeldrawing bug (some artifacts appeared) - Fix
ComboBoxlistener bug: the listener of theComboBoxis now called only one time - Fix
Controller.resetScreenStack(Screen)bug: the reset could now replace the root screen - Fix
Controller.replaceCurrentScreen(Screen): avoidClassCastExceptionwhen another popup is shown over the screen - Fix
RadioButton.setChecked(boolean)method, the method works when aRadioButtondoes not belong to aRadioGroup - Fix
ImageLabelbug:ImageLabelis refreshed correctly when the image is changed (image with different size than the previous) - Fix
Screenlife cycle bugs: theonPause()andonResume()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 theStringBufferinstead of throwing aNullPointerException - The
String.startsWith()method called on an empty string returns false instead of throwing anNSRangeException 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
TextFieldwith opened keyboard bug: the screen will scroll to the selectedTextFieldafter the keyboard appears - Fix
Layoutvisual bug when no child is visible - Fix
ListViewvisual bugs with different types of items (Layout,Button) - Fix
CheckBoxclick bug: the click over the label now checks theCheckBox - Fix
ImageButtonbug with the vertical stretching mode - Fix disabled styles for
Button,TextField(under iOS 4.3) - Fix
TimePickerbugs:setEnabled(), background image and background color now work - Fix
ScrollViewbug: scroll bar not well displayed under iOS 4.3 - Fix
Dialoglife cycle bugs
Generic API for Java ME¶
- Fix
Button/TextLabel.getFont()bug: now returning the good value - Fix
Screenbug: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 onScreenwhen callingController.popScreen()- Fix
Menuitems 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).
