NeoMAD 4.5 release notes¶
June 13, 2018
Android Http¶
The com.neomades.io.http API does not use the Apache HTTP library anymore. It now relies on the java.net API as recommended by Google.
This improvement is transparent for NeoMAD users: nothing must be changed in your source code.
Location request improvements¶
com.neomades.location.LocationManager has two new methods to perform a location request with a timeout. This can be useful in cases you
do not want the user to wait too much time for a response (in cases the GPS does not find satelites for example):
requestMyLocation(long timeout, Criteria criteria, LocationListener locationListener): registers for a single location update using a Criteria.requestMyLocation(long timeout, LocationListener locationListener): registers for a single location update using the default Criteria.
The com.neomades.location.LocationListener has a new callback onLocationFailed(LocationErrorStatus locationErrorStatus) to handle error cases:
location disabled by user, unknown error during location search or timeout reach.
NB. if your code already implements a com.neomades.location.LocationListener, you must implement the new callback otherwise the code won’t build.
Boolean¶
Boolean class has been completed with some missing Java 1.5 methods:
- Constructor:
new Boolean(String bool): allocates aBooleanobject representing the valuetrueif the string argument is notnulland is equal, ignoring case, to the string “true” valueOf(boolean b): returns aBoolean``instance representing the specified ``booleanvalue.valueOf(String s): returns aBooleanwith a value represented by the specified string.Comparable<Boolean>interface implementationCompareTo(Object obj): compares thisBooleaninstance with another.
Math¶
Math class has been completed with some missing Java 1.5 methods:
acos(double a)asin(double a)atan(double a)atan2(double a)cbrt(double a)cosh(double x)exp(double a)expm1(double x)hypot(double x, double y)IEEEremainder(double f1, double f2)log(double a)log10(double a)log1p(double x)pow(double a, double b)rint(double a)round(double a)round(float a)signum(double d)signum(float f)sinh(double x)tanh(double x)ulp(double d)ulp(float f)
Compatibility changes¶
Android minimum API level¶
According to the Android market share and store usage statisitics, NeoMAD does not support Android devices with an API level below 19 (Android 4.4) anymore. API level 19 is still supported.
Command line option -gp (-generate-project)¶
The command line option -gp was deprecated in NeoMAD 4.2.0. The option was useless since the native project was always generated with the binary in the output folder after a build with NeoMAD.
It is now removed from NeoMAD and cannot be used anymore. Builds using this option will now crash: just remove the option from your build options.
Command line option -e¶
The command line option -e is not accessible anymore. To see all available targets please refer to the NeoMAD help message using the -h option.
ScreenParams¶
ScreenParams class can not be inherited anymore. Use composition instead of inheritance if you want to have specifc ScreenParams classes.
HttpRequest¶
HttpRequest.setMethod(String method) now throws a ProtocolException if the method parameter is not a valid HTTP method. Your code must be
updated to catch this error case.
SlideScreen¶
SlideScreen.setContent(int layoutResId) and SlideScreen.setContent(View content) cannot be use to insert the
content of a SlideScreen. It was already the case in previous NeoMAD version but now it will throw an
IllegalStateException on all platforms if one of the method is call for a SlideScreen.
LocationListener¶
The com.neomades.location.LocationListener has a new callback onLocationFailed(LocationErrorStatus locationErrorStatus) to handle error cases:
location disabled by user, unknown error during location search or timeout reach.
If your code already implements a com.neomades.location.LocationListener, you must implement the new callback otherwise the code won’t build.
Removal of deprecated methods¶
Following methods were deprecated in previous NeoMAD versions. They are now removed from the API:
Application.requestBackground()andApplication.requestForeground(): they already did nothing and can be removed from your code if they were used.Screen.onReceiveResponse(ContentResponse response)andScreen.onReceiveError(ErrorEvent error): respectively useScreen.onContentResponse(ContentResponse response)andScreen.onContentError(ContentError error)instead.PinchListener.onPinchGestureBegin(Pinch pinch, View view)andPinchListener.onPinchGestureEnd(Pinch pinch, View view): usePinchListener.onPinchGesture(Pinch pinch, View view)withPinch.getState()instead.Font.STYLE_UNDERLINED,Font.STYLE_DOTTED_UNDERLINEDandFont.isUnderlined(): use the methodsetUnderlineThickness(int)in the views where it is available instead. NB. these styles cannot be set anymore when declaring fonts in a xml resource.FileStorage.getPrivateDir()andFileStorage.getExternalDir(): respectively useFileStorage.getApplicationDir()andFileStorage.getExternalApplicationDir()instead.Network.TYPE_BLACKBERRY_MDS: constant is no longer supported.Marker.setHue(int hue)andMarker.getHue(): useMarkerIconFactory.defaultIcon(int hue)to get the platform default marker with the hue in parameter applied and thenMarker.setIcon(MarkerIcon markerIcon)to apply the color to the marker. Hue default color values have been moved fromMarkerclass toMarkerIconFactoryclass.Marker.setIcon(Image icon): useMarkerIconFactory.fromImage(Image image)andMarker.setIcon(MarkerIcon icon)to change the image of a marker.Camera.setCaptureActionText(String text),Camera.setCaptureActionText(int textResID),Camera.setRetryActionText(String text),Camera.setRetryActionText(int textResID),Camera.setConfirmPictureSelectionText(String text),Camera.setConfirmPictureSelectionText(int textResID),Camera.setConfirmVideoSelectionText(String text)andCamera.setConfirmVideoSelectionText(int textResID): they already did nothing and can be removed from your code if they were used.Notification.setActionText(String actionText)andNotification.setActionText(int actionText): these methods were used for iOS 5.1 which is no longer supported by NeoMAD.GLES20.GL_STENCIL_INDEX: constant is no longer supported (was not used before).TextEdit.setEditMode(int mode)(and all modes): useTextEdit.setTextMode(TextMode),TextEdit.setCapitalizeMode(CapitalizeMode)andTextEdit.setAutoCorrect(boolean)instead.LinearLayout.setBackgroundColorFocused(Color backgroundColorFocused)andLinearLayout.isFocused(): they already did nothing and can be removed from your code if they were used.ScrollView.addView(View child),ScrollView.removeView(View child),ScrollView.removeAllViews()andScrollView.getViewsCount(): useScrollView.setContent(Layout layout)and then work on the content layout to add, remove or count views.WaitView.setStyle(int style): useWaitView.setIndicatorStyle(int)instead.DeviceInfo.getName(): useDeviceInfo.getModel()orDeviceInfo.getDeviceName()instead.- Remove old deprecated constants of
DeviceInfo: Blackberry, JavaME, Windows Phone 7, Android up to version 2.2 and iOS up to version 7.0. - Remove old useless constants in
TargetInfo: keep only target name and target OS constants.
Depreciations¶
DeviceInfo: Android version constants up to API level 19 were deprecated since these versions are no longer supported by NeoMAD. Same thing for iOS version constants up to iOS 9.0.ScreenParams.putObject(String key, Object value)andScreenParams.getObject(String key): do not passObjectasScreenParams. Memory problems or crashes may occur sometimes on some platforms. Use other “put” methods that useStringor primitive types and build again your complex object with that.
Fixes¶
- Android:
- Fix HTTP PATCH method that was taken into account under Android 5.0
- Fix default support of TLS 1.2 for
HttpRequestfor all Android versions - Fix strange behavior in screen
Menuthat may occur in phablets: some menu items may be duplicated in the title bar - Fix a black screen or a strange visual effect that may occur when performing a
Controller.resetScreenStack(Class screen)on some Android devices - Improve application automatic restart after a crash: sometimes the application restart may cause the application to crash again
- iOS:
- Fix declaration of icons and launch images in Xcode generated project. Images were copied in the native project but not correctly included.
