NeoMAD 4.0 release notes

June 10, 2016

New features

Maps API

The Maps API is now supported for the Windows Store platform. The native map provider is used, which is Bing Maps.

Java 6

Enhance the language support in the transcompiler :

  • Enumerations
  • Generics
  • Assertions
  • Variable arguments
  • Foreach loop
  • Static imports
  • Auto-boxing / auto-unboxing
  • Method covariant return types
  • Annotations (they are ignored)

Enhance the support of the java base APIs: * Enumerations (java.lang.Enum) are supported * Generics are supported and some classes already in the API have been updated: java.lang.Class, java.util.Hashtable,

java.util.Stack and java.util.Vector
  • java.lang.Boolean, java.lang.Byte, java.lang.Character, java.lang.Double, java.lang.Float, java.lang.Long and java.lang.Short supports new valueOf methods
  • add java.lang.StringBuilder class that enables to easily manipulate char sequences
  • java.lang.String and java.lang.StringBuffer now implements java.lang.CharSequence
  • add java.io.FilterInputStream and java.io.FilterOutputStream
  • improvement of Collection, Map, Set and List API. The following classes have been updated or added and now support Generics: java.util.AbstractCollection, java.util.AbstractList, java.util.Abstract.Map, java.util.AbstractQueue, java.util.SequentialList, java.util.AbstractSet, java.util.ArrayDequue, java.util.ArrayList, java.util.Arrays, java.util.BitSet, java.util.Collection, java.util.Collections, java.util.Dictionary, java.util.Enumeration, java.util.HasMap, java.util.HashSet, java.util.Hashtable, java.util.Iterator, java.util.LinkedHasMap, java.util.LinkedHashSet, java.util.LinkedList, java.util.List, java.util.ListIterator, java.util.Map, java.util.MapEntry, java.util.NavigableMap, java.util.NavigableSet, java.util.Set, java.util.SortedMap, java.util.SortedSet, java.util.Stack, java.util.TreeMap and java.util.TreeSet

Windows Phone emulator

Windows Phone 8 emulators are now supported by NeoMAD.

PagerTitleStrip

A group of classes that enables to display in an interactive or not-interactive way the current, previous and next pages of a ViewPager. To do that, it enables to associate each page with a title string. Three different visual aspects are available:

  • PagerTitleStrip: the base class. Next, previous and current page titles are displayed above the pager. The current page title is centered, right there is the next page title and left the previous page title.
  • PagerTabStrip: same as the PagerTitleStrip however the title of the current page is highlighted (different color or underlined depending on the platform behavior).
  • PagerSlidingTabStrip: the titles are displayed in an horizontal list above the pager. The title list may be scrolled independently from the pager in order for the user to select a page far away by clicking on its title. When the pager page changes, the list scrolls in order for the current title to be always visible.

PagerTitleStrip classes are provided with an adapter PagerTitleAdapter that must be implemented to supply the pager titles.

Bar code API

The com.neomades.barcode package is a library to track and decode QR codes. It contains a screen and a view that use the camera to track QR codes. They can be configured with a listener that triggers when a QR code is scanned by the camera. The listener will return the decoded string of the QR code.

NB. only QR codes are supported. Other bar code formats will be added in the future.

AutoCompleteTextField

A TextField that show a drop-down list of suggestions in order to choose one of them.

InfoWindowClickListener

Maps can now listen when tap events occur on their marker info window. Add an InfoWindowListener to a map using setInfoWindowListener(InfoWindowListener) and implement the callback.

RichTextLabel

Fonts and text size customization

Two new methods were added to customize fonts and text size of the RichTextLabel:

  • setFont(Font): set a custom font (TTF or system) as the default font for the RichTextLabel. The font is applied to all the html tags. The font size is applied to the p tag and proportionally to the other tags.
  • setTextSize(int): change the size of the text (in dp). The size is applied to the p tag and proportionally to the other tags.

Homogenization

Homogenize the behavior of RichTextLabel between the different platforms:

  • HTML style font and attribute are ignored
  • HTML font tag is ignored
  • Improve support of badly formated HTML: try to display it even if the HTML is incomplete

Maps

Windows Phone and Windows Store Marker improvement

Windows Phone and Windows Store map markers have now the same behavior:

  • If no icon is set, the first letter of the title will be displayed as the marker in a black info window. When clicking on it, it will display the whole title. Clicking anywhere else on the map will “close” the info window and display the first letter of the title.
  • If an icon is set, the marker will have the same behavior as it has by default in Android and iOS. Firstly only the icon is displayed. Click on the icon, it opens its info window with title and snippet. Click anywhere on the map, it will close the info window.

MarkerIcon API

New methods and classes have been introduced to set the icon of a Marker:

  • MarkerIcon which represents the icon that will be set on a Marker. The icon can be the default one (platform dependent), optionally with a hue, or an image.
  • MarkerIconFactory class which creates MarkerIcon instances.
  • Marker.setIcon(MarkerIcon) method to set the icon on the marker.

Package content

Five new classes were added to manage errors in package content :

  • ParserException
  • TimeoutException
  • ServerException
  • NoConnectionException
  • AuthenticateException

ContentError class has new method getContentException() to get the correct type of error.

On Screen now use onContentResponse(ContentResponse response) and onContentError(ContentError error) to listen package content events. onReceiveError(ErrorEvent) and onReceiveResponse(ContentResponse) are now deprecated

Other enhancements

  • SlideScreen left menu item for the iOS platform: a button has been added in the navigation bar to open and close the left screen. It is not displayed if a menu is set on the SlideScreen or on the middle screen of the SlideScreen.
  • Calendar: adds the possibility to get the week of year using Calendar.get[WEEK_OF_YEAR].
  • Base64: enables to encode a byte array in a base-64 string or to decode a base-64 string into a byte array.
  • DateUtils.formatDate(Date) and DateUtils.parseDate(String): enables to format Date to String using the rfc1123 pattern and vice versa.
  • ImageLoader, ImageQuery: add new methods in ImageLoader to customize image requests (e.g. basic authorization HTTP headers can be added to the request)

Compatibility changes

  • NeoMAD has changed its default build behaviour for Android target. Now optimization and obfuscation steps are disabled by default. To enable them, use new options -optimize and/or -obfuscate. To release binaries for PRODUCTION mode, do not forget to enable optimization to minify the binary file, and obfuscation to protect the binary from reverse-engineering attacks.
  • NetworkResponse.getHeaders() return type changed from Hashtable to Map<String, String>.
  • ResManager.getString(int, Object...) now returns the resource name if the string resource is not localized for the device’s current locale.

Deprecation

  • The command line option -o has been deprecated. It has been replaced by -obfuscate option.
  • Maps: in the Marker class, the setIcon(Image), setHue(int) and getHue() methods are deprecated. Use the setIcon(MarkerIcon) method with MarkerIcon and MarkerIconFactory classes instead.

Fixes

  • Windows Phone and Windows Store generated projects can now be correctly opened even if generated from a Mac.
  • Fix an encoding problem that may happen when using srcencoding and applicationidentifier at the same time in the URS.
  • applicationname, vendor and description parameters in URS now accept special characters (like quote, punctuation characters…)
  • TextArea: setLines(int) called with -1 now correctly cancel the previous call of setLines(int) and reset the default behavior of the TextArea.
  • Fix MapListener.onMapLoaded(): the behavior of the callback was not the same in all the platforms. Now it is called each time the map has finished rendering.
  • RichTextLabel: <a> tags with hyperlinks are now supported by the RichTextLabel. The corresponding text will be highlighted and the link can be clicked to open the page in the web browser.
  • StringUtils.replace(String, String, String) and StringUtils.replaceAll(String, String, String): throw NullPointerException if one of the parameter is null. If the replace pattern is empty, returns the original String without modifications.
  • Fix EventBus retaining the instance of the last handled event.
  • Fix ContentQuery crash when a query is re-sent through ContentManager
  • Fix CacheEntry.refreshNeeded() let the server updates the cache when server responses do not contain Cache headers
  • Fix cache update behavior when doing a request while the online date has not changed (data were systematically downloaded again from the server).
  • Android:
    • Fix ViewPager.notifyDataChanged(): call to notifyDataChanged() does not change the selected page anymore (it was resetting the pager to the first page).
    • Fix the interception of some touch events by GridView: the click and touch events were not always transmitted to child views.
    • Fix NullPointerException when the system wants to release memory by trimming memory from application.
    • Fix SmsManager: Application crashed when using send(Message, SmsResultListener) on device with Android 4.4 and above.
    • Fix SlideScreen bug with MenuItem created by Middle Screen.
    • Fix MarkeClickListener: the callback is no longer called if the info window of the marker is opened.
    • Fix RichTextLabel: application crashed when using <ul><li> inside <li> tags.
    • Fix RichTextLabel: ellipsize may have been applied even if not necessary. Ellipsize has been deactivated for RichTextLabel.
    • Fix ZoomView: Touch events can be handled through TouchListener now.
    • Fix ZoomView: The zoomed view does not blink now.
    • Fix SlideScreen NullPointerException crash when there is pinch gesture.
    • Fix Maps memory leak: the map was keeping a strong reference to a marker after removal, preventing marker instances to be garbage collected.
    • Fix Maps memory leak: the MapView was never garbage collected.
    • Fix LocationManager always keeping a reference to the LocationListener used in requestMyLocation(LocationListener) or requestMyLocationChanges(LocationListener).
  • iOS:
    • Fix Xcode build failures with method with name starting with alloc, init, new, initialize
    • Fix ComboBox: items were correctly not updated when the ComboBox content has changed between two ComboBox opening
    • Fix RadioButton.setCheckChangeListener(CheckChangeListener): the callback is now correctly called when the state of the RadioButton changes
    • Fix JSONObject: encoding problems may occur with strings when using method JSONObject.optString(String)
    • Fix Preferences: save() method did not work if called from two different threads at the same time
    • Fix ListView: list may disappear under iOS 8 if the number of items changes while performing a notifyDataChanged()
    • Fix ListView: list may freeze with an error message “no index path for table cell being reused” under iOS 8 when the content of the list is refreshed.
    • Fix ListView: ListView items may have a wrong height if their layouts were too complex and if they were in MATCH_CONTENT on their height.
    • Fix layout calculation when the container view has a border.
    • Fix PagerTitleSlidingTabStrip: sometimes when UI calculation occurred in the ViewPager while the PagerTitleSlidingTabStrip was scrolling, the PagerTitleSlidingTabStrip may have frozen.
    • Fix PagerTitleStrip: title was not set to the current page if setCurrentPage(int) was called before the PagerTitleStrip was displayed.
    • Fix ViewPager: the height of the pages was too small for its content if the pager had a PagerTitleStrip.
    • Fix GestureDetector conflict with ScrollView pan gesture.
    • Fix TextLabel: The method setLines(int) now correctly change the height of the TextLabel.
    • ListView, GridView and HorizontalListView do not have a minimum default row height (or width for HorizontalListView).
    • Fix Transition for iOS 9: during “in” transitions the destination screen went under the navigation bar.
    • Fix setBackground(Background), setBackgroundColor(Color) and setBackgroundImage(Image) for PagerTitleStrip: background was not applied.
    • Fix ViewPager: when added a ScrollView inside a ViewPager, vertical scroll was disabled.
    • Fix Stack synchronization problem that may introduce thread-lock bugs.
    • Fix ImageLabel size when using ScaleType.SCALE_ASPECT_FIT and one of both side is in MATCH_CONTENT.
    • Fix Xcode signature step for installing automatically mobile provision
    • Fix the database upgrade mechanism (the version number was not updated in the database).
    • Fix compilation failure due to an unneeded reference to the declaring inner static class that was generated in an anonymous type.
    • Fix an EXC_BAD_ACCESS occurring when executing a string concatenation with a double in transcompiled code.
    • Fix MenuItem.setAsLeftAction(): the first letter of the native back button was displayed under the left action item.
    • Fix Density.toDP(): pixels were not correctly converted to their dp equivalent.
    • Fix ListView, HorizontalListView and GridView: item margin was not correctly displayed.
    • Fix AppStore``submission failure caused by missing icon size for ``iPad Pro (167x167)
    • Fix ViewPager: onPageChanged callback was not called when a page was changed by selecting the tab of a PagerTitleStrip.
    • Fix StringUtils: the format method crashed with some format specifiers (for example %-4d)
    • Fix Xcode build for simulator step failures: now warning or error from Xcode are printed out. The build is considered as FAILED if Xcode cannot build the project.
    • Fix Float.parseFloat(String) that was not throwing NumberFormatException when the string was malformed.
    • Networking data: deactivate default cache policy in order to correctly handle 304 HTTP response.
  • Windows Phone:
    • Resolve a compilation failure when the generated project path is too long.
    • Fix ScreenResultListener: callback was never called if the Screen was inside a SlideScreen.
    • Fix a crash happening sometimes when using ComboBox.removeAllItems() or ComboBox.removeItem(int).
    • Fix ComboBox: items were not updated when the ComboBox content has changed between two ComboBox opening
    • Fix ComboBox.getSelectedItem(): when ComboBox was opened with openChooser() method, the index returned was always 0
    • Fix RadioButton.setCheckChangeListener(CheckChangeListener): the callback is now correctly called when the state of the RadioButton changes
    • Fix PagerTitleTabStrip.setTabIndicatorColor(Color): the title of the page is now correctly colored (an exception was thrown before)
    • Fix View.findView(int) when called on a ListView.
    • Fix SlideScreen: title customization on Screen inside SlideScreen had no effect.
    • Use the version number declared in the URS in the generated project (it was previously ignored).
    • Fix ResManager.getResourceAsStream(String): a NullReferenceException was thrown if the path did not exist
    • Fix a transcompilation bug: methods were sometimes marked virtual instead of override.
    • Fix AbsListView.setSeparatorHeight(int): When the height set was 1, the separator disappeared.
    • Fix the database upgrade mechanism (the version number was not updated in the database).
    • Fix ListView crash (layout life cycle exception) that may have occured if an ImageUrlLabel was set in a list item and if the height of the list item was dependent of the ImageUrlLabel height.
    • Fix ViewPager: onPageChanged callback was not called when a page was changed programmatically by using setCurrentPage(int).
    • Fix TextArea.setBackgrounColor(Color) and TextField.setBackgrounColor(Color): color was not applied when the TextArea or TextField had the focus.
    • Fix Float.parseFloat(String) that was throwing unexpected NumberFormatException.
  • Windows Store Apps
    • Resolve a compilation failure when the generated project path is too long.
    • Fix RadioButton.setCheckChangeListener(CheckChangeListener): the callback is now correctly called when the state of the RadioButton changes.
    • Fix Application.setSupportedOrientation(int) and Screen.setSupportedOrientation(int). Warning : the method will work only on real devices and not on the simulator.
    • Fix a bug related to Dialogs: sometimes even if the dialog was closed, its content stayed visible above the application
    • Fix PagerTitleStrip: refresh the titles when notifyDataChanged() is called on the pager to update the titles
    • Fix ViewPager: PagerTitleStrip height was taking into account inside the ViewPager even if it was not visible.
    • Fix Preferences: save() method did not work if called from two different threads at the same time
    • Fix PagerTitleStrip: Items became white after selection.
    • Fix PagerTabStrip.setTabIndicatorColor(Color): Color was not applied correctly.
    • Fix TextLabel: label height is now correctly adjusted when setLines(int) or setMaxLines(int) are called.
    • Fix a crash occurring when calling Application.openUrl(String).
    • Fix WebView.shouldOverrideUrlLoading(WebView, String): the method was never called.
    • Fix Screen back button: the back button is not displayed if the title is not visible.
    • Fix Menu: MenuItem did not appear and were not clickable on Windows 8.0.
    • Fix Menu: was shown every time a screen was displayed.
    • Fix SlideScreen: title customization on Screen inside SlideScreen had no effect.
    • Fix ImageButton: padding was not correctly applied.
    • Fix ImageButton: borders were not correctly set.
    • Fix MapSettings.setMyLocationEnabled(boolean): the method was not implemented For Windows Store Apps.
    • RichTextLabel: update font size of various html elements in order to have more readable RichTextLabel.
    • Fix ResManager.getResourceAsStream(String): a NullReferenceException was thrown if the path did not exist.
    • Fix Screen.getOrientation(): the method always returned PORTRAIT_OR_LANDSCAPE in some Windows devices.
    • Fix a transcompilation bug: methods were sometimes marked virtual instead of override.
    • Fix AbsListView.setSeparatorHeight(int): when the height set was 1, the separator disappeared.
    • Fix Controller.resetScreenStack(Screen): onDestroy() was not called in the screens previously in the stack.
    • Fix ImageUrlLabel: images were not loaded sometimes.
    • Fix Font: TTF fonts declared in the URS file can now be used in the application.
    • Fix TextField: setTextColor() did not apply the color to the text.
    • Fix the database upgrade mechanism (the version number was not updated in the database).
    • Fix TextArea.setBackgrounColor(Color) and TextField.setBackgrounColor(Color): color was not applied when the TextArea or TextField had the focus.
    • Fix Float.parseFloat(String) that was throwing unexpected NumberFormatException.
    • Fix Thread.join() that was doing nothing.