Friday, April 18, 2014

Debugging Oracle ADF Mobile Applications - Part I

I've been involved with the Oracle Mobile Application Framework (a.k.a. ADF Mobile) lately and one of the things developers typically ask me during my talks is how to debug mobile applications created with the Oracle framework.

To give you a little bit of context, the Oracle Mobile Application Framework does generate a hybrid app (native container + HTML/JavaScript) so standard debugging techniques apply here. The Oracle Mobile Application Framework has some other capabilities like running Java code on the device but that's a topic for another post.

So, there is more than one way for debugging Oracle-generated (read hybrid) applications depending on the platform your are own and the target device you are working on. I'll try to isolate specific use cases on different posts so you don't get distracted with irrelevant stuff.

The first one on the list is debugging Oracle Mobile Applications on iOS and Mac OS X.

The ingredients are:

- Oracle JDeveloper 11.1.2.4.0
- XCode 5.1 (for the Simulator)
- Apple Safari

The setup is pretty straightforward and here is what you have to do:

On the iOS Simulator (works on iOS +6.x), go to Settings > Safari > Advanced > and make sure Web Inspector is turned ON.

Open up the Safari web browser and enable the Develop features. To do that, go to Preferences > Advanced and check the Show Develop menu in the menu bar.


If you don't have an app deployed to the simulator yet, this is a good time to do so. Open up JDeveloper and deploy a simple application to the simulator (you can use the same approach with a real device but I'd rather start debugging on the simulator).

Once you have the app installed/deployed and running on your iOS simulator go to Safari and select the Develop menu.   

You should see something similar to the picture below where you select the iPhone Simulator and then the name of your application (in my case - MyWeatherChannel). The below HTML pages are part of your application and highlighting one of them in the Safari menu will also highlight them on the iOS simulator.


Selecting that highlighted page will bring Safari's Web Inspector up. Click on the first icon on the left (Resources) and that should show you the DOM for the page you selected.



At this point, you have many options but you may want to try enabling the Styles (click on the Styles button on the top menu) and make changes to the existing components on the page. That would give a good idea on what to look for when doing further debugging.

You can also manipulate the DOM to change the name or size of the labels and see how they are going to look like.


What is also very interesting are the Timelines (click on the Timelines button on the top menu) where you can see how long it takes to make a network request, to load different components of your application and the details of JavaScript calls.



The last thing I'd like to show you here is the option to enable the Console (click on the Console button on the top menu) and you can many other things like triggering commands or watching the console output. You can also reload the application by pressing Cmd + R.


In the test above, I just fired an alert command (alert("My Test Message");) from the console and saw the JavaScript alert on the simulator.

You can also change the current values (by also manipulating the DOM) in the app like the example below where the command: document.getElementById("ot3").innerHTML=72; changes the value of one the fields in the app.




Happy debugging!





6 comments:

  1. Oracle adf online training In 2004 Oracle, Inc. created its new step toward J2EE application development simplification, cathartic new RAD Oracle JDeveloper 10G. initial of all JDeveloper 10G is targeted to speedy net application building, utilizing all the achievements of J2EE World: net service, EJB, MVC frameworks, XML, etc. Oracle adf online training Oracle JDeveloper 10G permits you to conduct all full development cycle for complicated system - from UML diagram-based thought to debugging, identification and preparation
    Oracle adf online training

    ReplyDelete
  2. Smart mind online training provides best online training for Oracle adf . Adf Corporation has marketed elements of Oracle adf specifically ADF Business elements — then referred to as "JBO" and later as "BC4J" The current ADF design with the generic model/binding layer was introduced with JDeveloper.In June 2006 Oracle Corporation given the of Oracle ADF online training Faces element library to Apache Trinidad In Gregorian calendar month 2012 Oracle introduced a free version of the core Oracle ADF online training technologies below the name " of Oracle ADF online training Essentials".
    CONTACT US
    INDIA +91 9030400777
    USA +1-347-606-2716
    Email: contact@Hyderabadsys.com

    ReplyDelete
  3. Oracle ADF online training Oracle Application Development Framework known as Oracle ADF provides a Commercial Java framework for building enterprise applications. It provides visual and declarative approaches to Java engineering science development. It supports speedy application development supported ready-to-use style patterns, metadata-driven and visual tools. Smart Mind Online Training is one altogether the leading IT work Institution providing Training services like SAP CRM online training,SAP Security online training,Web design online training,Oracle ADF online training,Datastage online training,Etl testing online training.Oracle adf online training.

    ReplyDelete
  4. Oracle ADF Online Training -
    http://www.21cssindia.com/courses/oracle-adf-online-training-122.html
    Introduction to Fusion and ADF - Oracle ADF and Jdeveloper - Oracle Fusion Middleware - Oracle Fusion Architecture - ADF and MVC - More about ADF - Exploring Jdeveloper - Jdeveloper 11g New Features - Building ADF Application in Jdeveloper - Configuring Jdeveloper Preferences - Employees to learn at their own pace and maintain control of learning “where, when and how” with boundless access 24/7by 21st Century Software Solutions. contact@21cssindia.com ---- Call Us +919000444287

    ReplyDelete
  5. Comfortably, the article is in reality the greatest on this noteworthy topic. I concur with your conclusions and will thirstily look forward to your upcoming updates.
    orace rac training in chennai

    ReplyDelete
  6. Comfortably, the article is in reality on ERP topic. I agree with your conclusions, will thirstily look forward to your upcoming updates about e-commerce solutions .

    ReplyDelete