Thursday Feb 04, 2016

MAF 2.2.2 release available now

Approximately 6 weeks after the release of MAF 2.2.1 we have the next patch MAF 2.2.2 available. This release contains several important bug fixes and a new JVM optimized for 64 bit devices on iOS. The new JVM should provide a nice performance boost to your apps on most iOS devices. So we strongly encourage everyone to upgrade to this patch. Some key notes about the release:

  1. If you are already using MAF 2.2.1 picking up this patch should be a breeze. There is no migration needed if you are moving from 2.2.1 so you should be able to re-build your apps with the new release and good to go
  2. If you are moving from 2.2.0 or earlier release please be sure to follow the migration instructions provided here
  3. Bugs fixed in this release and other important release notes are available here

 

Tuesday Jan 19, 2016

MAF MCS Utility Patch for MAF 2.2.1

MAF MCS Utility is a library and public sample that simplifies integration of Oracle Mobile Cloud Service (MCS) in Oracle MAF applications. The MAF MCS Utility library and its sample application are shipped as part of the Oracle MAF public samples, located in the publicSamples.zip file, along with all the other MAF samples.

Sometimes things happen as they do! Unfortunately, when shipping Oracle MAF 2.2.1, the MAF MCS Utility provided with the release was broken. The effect of the defect is that you are getting re-routed to the login screen, or if you got around this problem, Storage and UserInfo don't work properly in the sample application. Using the MAF MCS Utility JAR file in a custom application may fail for Storage uploads in the response sent back from MCS.  

A fixed for MAF MCS Utility (maf-mcs-utility 2.2.1) will be shipped within the next version of Oracle MAF. However, no need to wait. For Oracle MCS and Oracle MAF customers to get the patch to the MAF MCS Utility now, the Oracle Mobile team made the MAF MCS Utility version 2.2.1 available for download online.

Please use the link below to download both in one: the MAF MCS Utility library (a JAR file) and the MAF MCS Utility sample application, which is a generic MCS tester that can be configured to run against any public Oracle MCS instance. 

Download Link: maf-mcs-utility 2.2.1


Wednesday Jan 06, 2016

MAF and iOS 9 multitasking

Apple introduced the concept of multitasking in iOS 9, meaning that you can open a second app on your iPad without closing the one that you are currently using.

Mobile apps built with MAF 2.2.1 support iOS 9 multitasking by default.

For your app to support multitasking, it must also support all possible device orientations. If your app does not support all possible device orientations, when you try to upload it to iTunes Connect, it will report an error message such as:

ERROR ITMS-90474: "Invalid Bundle. iPad Multitasking support requires these orientations: 'UIInterfaceOrientationPortrait, UIInterfaceOrientationPortraitUpsideDown, UIInterfaceOrientationLandscapeLeft, UIInterfaceOrientationLandscapeRight'

To fix this, you either need to add support for all device orientations, or opt out of multitasking support. If you must opt out of multitasking, you need to add the UIRequiresFullScreen key to your app’s Info.plist file with the value true.

The most convenient way to add this key is to create a very simple plugin that has a manifest file (plugin.xml) such as the following, without any additional files:

<?xml version="1.0" encoding="UTF-8"?>
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0" 
        id="maf-plugin-opt-out-multitasking" version="1.0.0">

  <name>maf-plugin-opt-out-multitasking</name>
  <description>Opt out of iOS multitasking on iOS 9</description>

  <platform name="ios">
    <config-file target="*-Info.plist" parent="UIRequiresFullScreen">
      <true/>
    </config-file>
  </platform>

</plugin>

Having created this plugin.xml file, open the maf-application.xml file’s Plugin UI and register this additional plugin, as follows:


A similar approach can be used any time you need to add a key to your MAF app's Info.plist file.

Wednesday Dec 23, 2015

MAF 2.2.1 HTML launch screen for iOS

MAF 2.2.1 has changed the manner in which you define a “launch screen” or “splash screen” for apps deployed to iOS devices.  Static images are no longer supported, meaning that if you previously used custom splash screen images in your app, you will need to create your own custom HTML launch screen for iOS when using MAF 2.2.1.

This post explains the reasons for the change and describes how to create a custom HTML launch screen for iOS.

Android splash screen images remain the same in MAF 2.2.1. For information about how to create a 9-patch image that stretches across different device screen sizes, refer to this blog post.

Background

When a user launches an app on iOS, the operating system displays a launch image while the app is loading.  The purpose is to give the user the impression that the app has launched immediately.

Prior to iOS 8, app developers were required to provide static launch images for every device screen size, resolution and orientation supported by the app.

This approach has been supported by all MAF versions up to and including MAF 2.2.0. In fact, MAF extends this approach and continues to display the appropriate launch image while the framework is being initialized within the app.

Since iOS 8, Apple has encouraged use of a new approach, which is to use a single storyboard to define the launch image.

iOS 9 has introduced the concept of multitasking, meaning that apps can now be launched into a window that does not fill the device’s entire screen. To support multitasking, an app must use a storyboard to define the launch image as fixed-sized images will not work.

MAF 2.2.1 accommodates iOS 9 multitasking by allowing app developers to specify a single HTML-based launch screen, which has the added benefits of removing the onerous task of creating and maintaining a number of static launch images and reducing the size of the app.

Creating a custom HTML launch screen

If your app previously used the default MAF splash screen images, then there’s nothing you need to do when you uptake MAF 2.2.1, as MAF 2.2.1 provides a default HTML launch screen that contains the Oracle logo and copyright similar to the previous default images.

If you previously used custom splash screen images in your app, then you will need to create a custom HTML launch screen for iOS, as follows:

  1. Open the Application page of the maf-application.xml file's Overview editor.
  2. Select the "Custom" option under the Launch Screen section.
  3. Enter the location of an existing HTML page relative to the ApplicationController/public_html directory of your MAF application, or create a new page.

Since the launch screen is based on HTML, CSS and JavaScript, you now have much greater control over what can be displayed.

To get ideas about how to scale images and text across different window sizes, you can refer to the default HTML launch screen included in MAF 2.2.1.

Understanding the default HTML launch screen

To view the default HTML launch screen:

  1. Deploy any MAF 2.2.1 application to an iOS simulator or package.
  2. Navigate to the deploy/<iOS deployment profile>/temporary_xcode_project/FARs/OracleStandardADFmfUiComponents/public_html directory.
  3. Open maf-launch-screen.html in a text editor.

Without analyzing every line of code, let’s take a look at some of the important parts of this file..

JavaScript

The JavaScript functions at the top of the file are used to show and hide a loading indicator and a busy message based on a MAF event. You can include the same logic in your HTML launch screen if you wish to display a loading indicator and/or busy message.

If you don’t want a loading indicator or busy message to be displayed, you can remove the JavaScript and remove the loadingWrap and loadingBox page sections described below.

Page sections

The page is divided into the following sections:

  • background
  • logo
  • copyright
  • loadingWrap and loadingBox

The background and logo sections work together to display a small scalable vector graphic (SVG) image on a solid background color, which is the recommended approach for both performance and logistical reasons.

The launch screen will only be displayed for a short amount of time, so there’s not much time for a high-definition image to be loaded and displayed. In addition, a background image will be stretched and/or cropped to fit various window sizes, which may result in an unnatural-looking image.

If you would prefer something fancier than a solid background color, CSS supports linear and radial gradients. Online sites such as w3schools describe the syntax and provide examples. You can even find online CSS gradient generators at sites such as ColorZilla.

A small SVG image can stretch in a natural fashion to any window size without loss of quality, with the background color filling in the rest of the window. In the default launch screen, the image is embedded in the CSS as a data URI, but you could also co-locate the image file with your HTML launch screen and reference its location in the CSS.

The copyright section contains plain text that is displayed at the bottom of the page. The CSS determines the font size based on the available width of the window in which the launch screen is displayed. You could emulate this approach to display any text you want on your launch screen.

The loadingWrap and loadingBox sections are used to display an animated GIF loading image and a busy message. The JavaScript at the top of the file controls the visibility of these sections and the displayed message.

Conclusion

With MAF 2.2.1 you no longer need to create and maintain a number of splash screen images for iOS and your app size will be decreased.

If you previously used custom splash screen images for iOS, you must now create an HTML launch screen and the default HTML launch screen within MAF 2.2.1 can be used as a guide, as described above.


Oracle MAF 2.2.1 New Features

Happy Holidays! to everyone. We are glad to announce a new update to MAF in time for the holidays. 2.2.1 is a patch on top of 2.2 release. This release includes some key functionality for iOS platform that every one using MAF should pay attention to.

The primary focus of this release :

  • Support for using XCode 7 and iOS 9 SDK for building MAF applications : Even though earlier releases of MAF supported apps on iOS 9 devices at runtime, XCode 7 could not be used for building the apps. With this release developers can use XCode 7 and iOS 9 simulators.   
  • HTML based splash screen for iOS. MAF now uses a responsive HTML page to display a launch screen when your app is launched on an iOS device. 
  • Provide critical bug fixes

Setup details:

This release requires use of XCode 7.2 for building applications for iOS. Customers are required to update their existing XCode version to 7.2  from MAC AppStore as a pre-requisite to using 2.2.1. However, most customers would want to maintain 2.2.1 dev env along with 2.2 or a previous version. Please follow the instructions detailed here.

Important migration information:

  • As part of moving to XCode 7, Apple is enforcing Application Transport security(ATS) which requires use of HTTPS for all your server communications. Please refer to details here to turn-off ATS and the min requirements for accessing back end data services
  • MAF 2.2.1 has changed the way developers define a splash screens for apps deployed to iOS devices.  Static images are no longer supported, so if you previously used custom splash screen images in your app, you will need to create your own custom HTML launch screen for iOS when using MAF 2.2.1. Detailed information about creating HTML splash screen is available here. We will be publishing another blog with details about this shortly.
  • Customers who use custom URL schemes in their MAF applications to invoke other applications must register each custom URL scheme in the Allowed Schemes list in the maf-application.xml file. This change addresses iOS 9’s requirement that applications declare any URL schemes they use to invoke other applications. More information about this configuration step can be found here.


Tuesday Dec 22, 2015

Android 9-patch splash screen images

A very handy, but little advertised feature introduced in MAF 2.2.0 is the ability to use 9-patch splash screen images for Android.

By using 9-patch splash screen images, you are able to define how your splash screen images will stretch to fit all Android device screens.

You define which area(s) of the image can be stretched, whilst ensuring that other areas such as those containing a logo or text will remain a constant size.

What is a 9-patch image?

A 9-patch image is a standard PNG image that includes an extra 1-pixel wide border and is saved with a .9.png extension.

The border is used to indicate which area(s) of the image can be stretched and optionally which area(s) of the image are fillable (i.e. can be overlaid with text when the image is used as a background image for an Android View object, such as a Button).

To start with, all border pixels must be completely transparent. You then indicate the stretchable and fillable areas by adding black pixels to the corresponding border areas.

For the purpose of a splash screen image, you only need to define the stretchable areas of the image. The top and left borders are used for this purpose. A black pixel in the top border row indicates that the image pixels in that column may be stretched horizontally. A black pixel in the left border column indicates that the image pixels in that row may be stretched vertically.

The following example 9-patch image has a blue background, white log and red box.  I've doubled its size here so you can more easily see the black pixels in the top and left borders.

The black pixels in the top and left borders ensure that only the blue background portion of the image will be stretched when the available display area is larger than the image size.  The center logo and the outer red box will remain static.

For more information, the official Android documentation on 9-patch can be found here and a really good tutorial can be found here.

Creating a 9-patch splash screen image

The best place to start is with your existing set of PNG splash screen images.

Since 9-patch images can only stretch, not shrink, ensure that you start with an image size equal to or smaller than the size of the smallest area in which you expect your app to be launched (remember that some Android versions support launching apps into a window that does not fill device’s entire screen).

For best results with images that contain logos and text, create a separate 9-patch image for each screen density. You may find that a single 9-patch image works in both portrait and landscape mode for the specified density, which will reduce the number of splash screen images you need to create and maintain.

The Android SDK provides a WYSIWYG editor called draw9patch that enables you to create a 9-patch image from an existing PNG image. It is very easy to use and dynamically shows you how your image will stretch. More information on this tool can be found here.

If for some reason you would rather use your favorite image editor, remember the following 9-patch image constraints:

  • The border must be only 1-pixel wide and must surround the entire image, even if you don't wish to define the fillable area.  Thus a 100x100 pixel image becomes a 102x102 pixel 9-patch image.
  • The border must consist entirely of only fully transparent or solid black pixels.  A slight difference in color or alpha level will fail silently at runtime.
  • The image file must have a .9.png extension.  

Using 9-patch splash screen images in your MAF app

Having created 9-patch versions of your splash screen images for each Android screen density and orientation, copy them into your MAF project and reference them in your Android deployment profile.

Conclusion

By using 9-patch splash screen images, you are able to define how your splash screen images will stretch to fit all Android device screens or windows in which your app is launched.

Creating 9-patch splash screen images from your existing PNG splash screen images is simple using the draw9patch tool available in the Android SDK.

The above information is only relevant to Android, since iOS does not support 9-patch.

About

This blog is is dedicated to announcements,tips and tricks and other items related to developing, integrating, securing, and managing mobile applications using Oracle's Mobile Platform. It is created and maintained by the Oracle Mobile product development team.

Archive of past entries

Even More Mobile Development Blogs

Oracle A-Team Site - Mobile Related Entries

Code samples from the Community

Fusion Middleware Blogs

Search

Archives
« February 2016
SunMonTueWedThuFriSat
 
2
5
6
7
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
     
       
Today