Wednesday Feb 04, 2015

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.

Thursday Dec 11, 2014

How do I install 2 versions of the same version of JDeveloper?

This has been covered before by other Oracle blogs, but for our mobile customers it’s worth restating.

From time to time the requirement comes up from our customers, how do I install 2 separate versions of JDeveloper? And sometimes more specifically how do I install two instances of the same version of JDeveloper?

Let’s address the first question.

How to install 2 *different* versions of JDeveloper?

If you want to install 2 separate versions of JDeveloper, say JDeveloper 11.1.1.7.0 and 12.1.3.0.0, this can be easily achieved at installation time. On installing each version of JDeveloper, when the installation wizard prompts you, specify a *different* installation directory for each.

What you should not do is install them in the same directory.

Important to the discussion coming up, it’s worth noting that each JDeveloper installation maintains its “System” directory, that is a directory containing it’s temporary files & configuration files, by default in separate locations. As such if you have JDev 11.1.1.7.0 and 12.1.3.0.0 installed separately, under Windows 7+ you will have the following directories:

C:\Users\<username>\AppData\Roaming\JDeveloper\system11.1.1.7.40.64.93
C:\Users\<username>\AppData\Roaming\JDeveloper\system12.1.3.0.41.140521.1008

And under a Mac these directories:

/Users/<username>/.jdeveloper/system11.1.1.7.40.64.93
/Users/<username>/.jdeveloper/system12.1.3.0.41.140521.1008

How to install 2 versions of the *same* version of JDeveloper?

Sometimes rather than using 2 different versions of JDeveloper, we want to install the same version twice, essentially 2 instances. A common reason for doing this is you maybe using JDeveloper with multiple extensions, and you want to maintain separate JDeveloper instances for each extension. For example you might want to support 2 different versions of the MAF extension which are currently both on JDeveloper 12.1.3.0.0.

To achieve this is a little more tricky because of the “System” directory we talked about in the previous section. While different versions of JDev have their own default System directory with a specific version number for that release, two instances of the same version of JDeveloper will clash as they will attempt to use the same versioned default System directory.

The following steps will show you how to install a JDeveloper instance such that it doesn’t use the default System directory, but one of your choosing, nicely avoiding the clash. We’ll assume you’re installing JDeveloper 12.1.3.0.0 twice.

1. Install JDeveloper 12.1.3.0.0 the usual way, but ensure the JDeveloper installation directory is unique for the installation. For example under Windows I might choose to install two instances of JDev 12.1.3.0.0 under:

C:\Oracle\Middleware\JDev121300Instance1
C:\Oracle\Middleware\JDev121300Instance2

And alternatively under a Mac:

/Users/<username>/Desktop/JDev121300Instance1
/Users/<username>/Desktop/JDev121300Instance2

You might want to use better names than Instance 1 & 2, but it will serve our purpose in describing the steps here.

2. When the installation process is complete, *dont* allow JDeveloper to start, just complete the installation process and allow it to close naturally.

3. Via your Windows Explorer or Mac Finder, create an alternative directory for where the JDev instance’s System directory will go.

e.g. For Windows:

C:\Users\<username>\AppData\Roaming\JDev121300Instance1
C:\Users\<username>\AppData\Roaming\JDev121300Instance2

e.g. For Mac:

/Users/<username>/.jdeveloper121300Instance1
/Users/<username>/.jdeveloper121300Instance2

4. In the JDeveloper home, locate /jdev/bin/jdev.boot and open it in your favourite text editor

5. Locate the ‘ide.user.dir.var’ property, and rename it to ‘ide.user.dir’ (yes, drop the dot var)

6. Change the value for ‘ide.user.dir’ to include the directory you created in the previous step, using backslashes for the directory path regardless if it’s for Windows or Mac.

e.g. For Windows

ide.user.dir= C:/Users/chris/AppData/Roaming/JDev121300Instance1

e.g. For Mac

ide.user.dir=/Users/chris/.jdeveloper121300Instance1

7. Save your changes and close the file

8. Start JDeveloper

That’s all that needs to be done. Once JDeveloper has started and opened to the default start page, it’s worthwhile checking in your new System directory for that JDeveloper instance, that you can see JDeveloper is using that directory and creating files. For JDeveloper 12.1.3.0.0 for example we would expect to see that under the directory you created, for example /Users/chris/.jdeveloper121300Instance1 on Mac, you can now see a subdirectory system12.1.3.0.41.140521.1008. If that directory exists, JDeveloper is correctly setup.

From here you are now in a position to install your 2nd JDeveloper instance following the same steps above.

Once done you are now free to download and maintain separate extensions for each JDeveloper instance. Just make sure you don’t get confused which JDeveloper you’re running!

One side effect of changing the ide.user.dir option in the jdev.boot file, is JDeveloper’s ‘mywork’ directory will now be defaulted to the new System directory you specified.

Sunday Dec 07, 2014

Rethink Mobile: Beyond Mobile First with Oracle

Get.Ready.

December 17, 2014 - Mark your calendars to get an update on Oracle's mobile strategy: Rethink Mobile: Beyond Mobile First with Oracle. We will be available to answer your questions via live chats. The Oracle guest lineup includes: Suhas Uliyar, Vice President, Mobile Strategy, Product Management, Laurent Pacalin, Group Vice President, Product Management, Jeanne Lowell, Vice President, E-Business Suite, and Rimi Bewtra, Sr. Director of Product Marketing.

And if you happen to be at Gartner AADI this week (Las Vegas!) stop by and say hello.  I'll give you a mobile tour at no extra charge and perhaps some free poker lessons. ;-) 

Here's a great trailer for the main event you do not want to miss.

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
« March 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