Monday Feb 09, 2015

Oracle Mobile Development Certification Exam - Beta Testing

Get your Oracle Mobile Development 2015 Implementation Specialist Certification!

Oracle Mobile Development 2015 Essentials Exam (1Z1-441) is now available in beta testing.

This certification covers topics such as: Mobile Application Framework (MAF), Mobile Application Framework (MAF) Data Layer, User Interface (UI) Development, Device Services Integration, and App Security. Up-to-date training and field experience are recommended.

This certification is available to all candidates, but is geared toward members of the Oracle PartnerNetwork. OPN members earning this certification will be recognized as OPN Certified Specialists. This certification qualifies as competency criteria for the Oracle Mobile Development specialization.

Access the exam study guide in order to get pointers to resources meant to help you prepare for the exam!

Take the exam for free while in beta testing! Request a discounted beta voucher via the OPN Beta Certified Specialist Exam Voucher Request Form!

Usedful Links:

  • Oracle Mobile Development 2015 Essentials Exam Study Guide
  • Oracle Mobile Development Specialization
  • Oracle Enterprise Mobility Knowledge Zone
  • Wednesday Feb 04, 2015

    Migrating MAF apps with 3rd party Cordova plugins

    Cordova is used in Oracle Mobile Application Framework (MAF) to provide access to device features.   MAF 2.1.0 uses Cordova version 3.6.3 on Android and 3.7.0 on iOS, dramatically increasing the number of available plugins that developers can leverage.

    MAF 2.1.0 greatly simplifies the process of adding 3rd party Cordova plugins into a MAF app by internally using the plugman command-line interface to build the plugin and incorporate all the required artifacts into your MAF app.

    So how do you migrate an existing MAF app that uses a 3rd party Cordova plugin to MAF 2.1.0?

    The following steps and screenshots show the process of migrating the BarcodeDemo sample app from MAF 2.0.1 to MAF 2.1.0 using JDeveloper.

    Step 1 – Download JDK 8 and update MAF extension

    MAF 2.1.0 requires JDK 8. Download JDK 8 before updating the MAF extension to 2.1.0 via Check for Updates in JDeveloper. Following a restart, you will be prompted to enter the JDK 8 location on your local machine and to reconfigure the Android and iOS Platform Preferences in JDeveloper. Please refer to the Installation Guide for more detailed information.

    Step 2 – Automatic app migration

    Open your MAF app within JDeveloper and you will be prompted to allow JDeveloper to automatically migrate your app. The Installation Guide describes this process in more detail. 



    Step 3 – Remove the old plugin code

    In a later step, you will point JDeveloper to the location of the plugin’s source code on your local machine and JDeveloper will use plugman to build the plugin and incorporate it into your MAF app.

    Before doing that, you should remove the plugin artifacts that you had manually added to your MAF app previously.  This includes:

    • Android native code found in Projects > ApplicationController > Application Sources > plugins.BarcodeScanner.Android
    • iOS native code found in Projects > ApplicationController > ApplicationSources > plugins.BarcodeScanner.iOS
    • JavaScript files found in Projects > ViewController > Web Content > plugins



    Step 4 – Remove unnecessary iOS app icons and launch images

    This is an optional step to reduce the size of your app. You can remove the following iOS app icons and launch images for unsupported devices and operating system versions, found in Application Resources > Resources > ios:

    • Default-1135h@2x.png
    • Default-Land.png
    • Default-Landscape-Ipad.png
    • Default-Landscape.png
    • Default-Landscape@2x.png
    • Default-Landscape@2x~Ipad.png
    • Default-Portrait-Ipad.png
    • Default-Portrait.png
    • Default-Portrait @2x.png
    • Default-Portrait @2x~Ipad.png
    • Default.png
    • Default@2x-Landscape.png
    • Icon-50.png
    • Icon-50@2x.png
    • Icon-57.png
    • Icon-57@2x.png
    • Icon-72@2x.png
    • Icon-80.png
    • Icon-144.png
    • icon-72.png
    • icon.png
    • icon@2x.png


    Step 5 – Remove old plugin details from the Plugins UI

    To complete the removal of the old plugin, you should remove the references to it from within the maf-application.xml Plugins UI, by selecting each reference and clicking the red ‘x’ icon.


    Step 6 – Save all, Clean all

    At this point, save all modifications and then do a ‘clean all’.

    Step 7 – Download a new version of the plugin

    MAF 2.1.0 requires you to have the plugin source code residing on your build machine, located on the same drive as your app source code, in a path that contains no spaces.

    It is likely that there is a later version of the plugin that you have used previously which is compatible with the Cordova versions used by MAF.  You may even find that more recently someone has written a plugin that provides a better match to your requirements.

    Anyone can build a Cordova plugin and they can choose to keep it to themselves or to publish it for use by others. The most common way to publish a Cordova plugin is to store it in a Git repository and to register it with the Cordova plugin registry.  Launch your browser and open http://plugins.cordova.io.


    To find a barcode scanner plugin, type in “barcode” and search.


    Click on com.phonegap.plugins.barcodescanner to view the details of this plugin.


    You can see that this plugin requires Cordova version 3.0.0 or greater, works on Android and iOS, and was last updated 3 months ago to version 2.0.1. This page also provides a description and API documentation.

    To access this plugin, click on the link to its Git repository.


    To download this plugin, click on the link to Download Zip.

    Once the plugin has been downloaded, extract the zip file contents into a location relative to your app’s source code which does not contain spaces. For example, you wish to extract the plugin into your app’s src folder as follows:


    Step 8 – Add the plugin via the Plugins UI

    To import the downloaded version of the plugin into your MAF app, return to the maf-application.xml Plugin UI in JDeveloper and click the green ‘+’ icon. Navigate to the location of the plugin’s top-level folder and click the Select button.


    The details of the plugin, which are read from the plugin.xml file, will be displayed in the Plugins UI.


    Step 9 – Update the JS that calls the plugin API

    In most cases, you will need to update the JavaScript that calls the plugin API. Firstly, you no longer need to include the plugin’s JavaScript file because plugman will include this into your application at deploy-time. Secondly, the manner in which you invoke the plugin’s JS API may have changed.

    For the BarcodeDemo sample app, this means editing the scanner.amx file to remove the inclusion of barcodescanner.js and to change window.plugins.barcodeScanner.scan to cordova.plugins.barcodeScanner.scan as described in the plugin’s README.md file.


    Step 10 – Save all, deploy and test

    All that’s left now is to save all modifications, deploy your app (most likely to a device, since many plugins won’t work on a simulator or emulator) and test it.

    A tip for anyone using plugins with dependencies

    If a 3rd party Cordova plugin has a dependency on another plugin, this will be defined in the plugin.xml file. At deploy-time, JDeveloper calls plugman to build and incorporate the 3rd party plugins defined in the maf-application.xml Plugins UI. If one of these plugins has a dependency, plugman will automatically attempt to download the required plugin's source code so it can be built and incorporated into your MAF app.

    If your build machine is behind a firewall, this attempted download may cause the JDeveloper deployment to hang for a while before reporting error messages similar to the following:

    [10:21:35 AM] Fetching plugin "https://github.com/apache/cordova-plugin-device" via git clone

    [10:21:35 AM] Deployment Successful

    [10:21:35 AM] Failed to install 'de.appplant.cordova.plugin.local-notification':Error: Command failed: Cloning into '/var/folders/h9/84x8qcsj391c355v3v137n580000gn/T/plugman/git/1423102819927'...

    [10:21:35 AM] fatal: unable to access 'https://github.com/apache/cordova-plugin-device/': Failed to connect to github.com port 443: Operation timed out

    [10:21:35 AM] at ChildProcess.exithandler (child_process.js:648:15)

    [10:21:35 AM] at ChildProcess.emit (events.js:98:17)

    [10:21:35 AM] at maybeClose (child_process.js:756:16)

    [10:21:35 AM] at Socket.<anonymous> (child_process.js:969:11)

    [10:21:35 AM] at Socket.emit (events.js:95:17)

    [10:21:35 AM] at Pipe.close (net.js:465:12)

    [10:21:35 AM] Command failed: Cloning into '/var/folders/h9/84x8qcsj391c355v3v137n580000gn/T/plugman/git/1423102819927'...

    [10:21:35 AM] fatal: unable to access 'https://github.com/apache/cordova-plugin-device/': Failed to connect to github.com port 443: Operation timed out

    The solution for this is:

    • Download and extract the required plugin as per Step 7 above.
    • Remove the dependent plugin from the Plugins UI.
    • Add the required plugin to the Plugins UI.
    • Add the dependent plugin to the Plugins UI. 

    This will ensure that each plugin is built and incorporated into your MAF app in the correct order.

    How to manage iOS log files in MAF 2.1

    Where do I typically find the MAF log file?

    MAF logs to a file named application.log.  On both the simulator this file is created in the application’s documents directory under a subdirectory named “logs”. Locating the actual log file for an application, particularly since iOS 8 and Xcode 6, is a bit tricky.  To find the file we have to understand the file system of the iOS simulator (and underlying iOS).  

    The iOS simulator stores all it’s content in the CoreSimulator directory located in a path like:

    /Users/mvakoc/Library/Developer/CoreSimulator

    The simulator can have any number of devices and each device is uniquely identified by a UUID, so the contents of an actual device will be under a subdirectory with that UUID, like:

    /Users/mvakoc/Library/Developer/CoreSimulator/Devices/00DEC99D-0651-43A7-9AC8-319680B85C10

    The file structure isolates applications and their data into various containers.  Containers are a way to separate an application’s private resources (the application itself) from a location that may be shared with others (e.g. a directory shared between an application and an extension it bundles with it) and the data containers.  The application, when installed, will get put in the Bundle container location, something like

    /Users/mvakoc/Library/Developer/CoreSimulator/Devices/00DEC99D-0651-43A7-9AC8-319680B85C10/data/Containers/Bundle/Application/66D7BCF4-BDF2-4334-85AE-21DD7E3636C3/Oracle_ADFmc_Container_Template.app

    The data container is the location for the documents (user files), library (caches, preferences), and temporary files for a given application.  An iCloud enabled application can have multiple data containers in a given application.  MAF doesn’t use this so there will only be one data container containing the Documents location.  It will again be stored under a UDID in the sandbox area, like:

     /Users/mvakoc/Library/Developer/CoreSimulator/Devices/00DEC99D-0651-43A7-9AC8-319680B85C10/data/Containers/Data/Application/21BAF3C1-4244-4383-8584-9713B6979A01

    The actual log file will be contained in the documents directory contained inside, like:

    /Users/mvakoc/Library/Developer/CoreSimulator/Devices/00DEC99D-0651-43A7-9AC8-319680B85C10/data/Containers/Data/Application/21BAF3C1-4244-4383-8584-9713B6979A01/Documents/logs/application.log

    In short, it is very difficult to an outside observer (outside the application itself) to locate these resources.

    On a device you have much less insight into the directory structure.  If the application has been installed to the device using a developer provisioning profile you can use the Xcode devices window to view and download the installed applications container, which will contain the log file

    If you are using an App Store or distribution installed application it will be very difficult to obtain the log from the device.  You really need to add the ability to get the log file from the application itself (e.g. use email to send the log file.)


    What a pain.  Can I put the log file somewhere easier to get?

    Yes.  When running on the iOS simulator you can use the -consoleRedirect=/path/to/log/file.txt to send the log file to a more desirable and easier to find location.  You can specify these options directly in Xcode (if you are launching from the Xcode project) or directly in the Run/Debug configuration in JDeveloper.


    There are some limitations to this approach.  You must launch the application with this argument.  Directly launching the application already installed on a device will cause it to launch without this argument so the contents will go back to the regular location.   Use the JDeveloper run configuration (the green triangle) to launch and run the app and this should make life easier.

    Sunday Feb 01, 2015

    Oracle's MAF helps you keep up with the Apple mobile bullet train

    It's fairly easy to argue that the mobile world moves at a much faster pace to the enterprise world. Apple and Google are constantly releasing updates, sometimes several a year for their respective mobile platforms. This certainly creates pain for enterprises trying to build mobile apps, how do you keep up, or more importantly how do you make sure your mobile apps keep up with the latest mobile platform requirements?

    Of note late last year Apple announced that all new apps released to the Apple App Store must include 64-bit support and be built with iOS 8+ SDK by February 1st 2015 - today! And any existing apps must meet the same requirements if updated after June 1st 2015.

    Luckily if you're using Oracle's Mobile Application Framework v2.1 it is designed to specifically to meet Apple's latest requirements. Rest assured Oracle has you covered.

    To take advantage of these updates, ensure to download the latest MAF extension from inside JDeveloper 12.1.3, or alternatively you can download the extension from the JDeveloper extension page. Instructions for how to install and configure JDeveloper + MAF 2.1 can be found here.

    Monday Jan 26, 2015

    Announcing Oracle Mobile Application Framework 2.1 - Now Available

    The Oracle Mobile Team is happy to announce the release of Oracle Mobile Application Framework 2.1 - a major update to Oracle's mobile development framework.

    This new version focuses on upgrading the framework's infrastructure and includes the following new features:

    • Support for Java 8 - Java is the language used for business logic development on Oracle MAF, in fact Oracle MAF is the only solution out there that will run the same Java code on both iOS and Android.  Now developers can leverage the latest features of the Java language - such as Lambda expressions, Collections with Generics and more - while running on a 64bit JVM that supports the Java 8 Compact2 profile.
    • Cordova 3 support - Cordova is used in Oracle MAF to provide access to device features. Oracle MAF 2.1 updates the Cordova version to 3.6.3 on Android and 3.7 for iOS, dramatically increasing the number of available plugins that developers can leverage.
    • Simpler Cordova Plugin integration - Oracle MAF leverages the plugman command line to build and incorporate plugins into Oracle MAF apps.
    • Xcode 6 and Android 5 support - use the latest SDKs to compile and deploy your MAF applications across multiple devices.

    You can get Oracle MAF 2.1 by downloading the new Oracle MAF extension through the JDeveloper Help->Check for Updates functionality.

    We highly recommend that you read the installation guide and migration guide before you start your upgrade process. The setup might be a bit tricky because you'll need JDK7 to run JDeveloper but JDK8 to use the extension - so follow the instructions carefully. 

    Have questions? - join us on the Oracle MAF discussion forum on OTN

    Friday Dec 12, 2014

    Interview with Northumbrian Water

    Earlier in the year Grant Ronald, from the Oracle Mobile Product Management team, went up to Durham in the UK to interview James Robbins the CIO of Northumbrian Water on their mobile strategy and their use of Oracle's mobile framework. This video is a nice insight into a key utilities company's mobile strategy and how Oracle technology supported them.
    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
    « May 2015
    SunMonTueWedThuFriSat
         
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
          
    Today