Monday, November 26, 2012

Mobile ADF: Webservice Call Using Oracle ADF Mobile Framework (Android)


Web-service Call Using Oracle ADF Mobile Framework (Android)

Writing web service 

I have written a simple webservice which will take String as parameter and return result in the form of String itself.


package samplewebservice; 

import javax.jws.WebMethod; 
import javax.jws.WebParam; 
import javax.jws.WebService; 

@WebService 
public class SampleService { 

    public SampleService() { 
     super(); 
    } 

    @WebMethod 
    public String sayHello(@WebParam(name="name") String name){
      return "Hello, "+name+" !!!!!!!!!!!!!!!!!!!"; 
    } 
 } 


Deploying Web-service 

Once service developed you have to deploy that service on some server. I am using weblogic server to deploy HelloService(You can select any server). Start your server.


  • Select Application as Mobile Application(ADF) template
  • Provide application name like WebServiceCall 
  • Click on finished. it will create 2 project in application ApplicationController and ViewController
  • Select ApplicationController and created webservice datacontrol.
  • Provide WSDL with your system IP address because localhost and 127.0.0.1 doen't work for mobile. 
  • Enter webservice url and datacontrol name
  • Click on next then select method and click on finished.
  • Now Select the ViewController Project and Right Click and go on new.
  • Select ADF mobile from the Client Tire from category
  • Provide the feature name like WebserviceCall and click on Ok button. It will created a folder with name of WebServiceCall inside public_html.
  • An Entry with the feature name will added to adfm-feature.xml file
  • Select the feature id from feature table
  • Go to content tab
  • Click on the + icon of file
  • Select the taskflow it will ask you to enter name for task flow enter name and same taskflow will created.
  • Now select the WebserviceCall feature folder and create amx page with name of LoginPage.amx
  • Drag and drop that amx to taskflow as default activity
  • Create responsePage.amx for showing service response
  • Define the ControlFlow as ShowResult
  • Expand created data control
  • Drag and drop name from parameter to amx page as inputtext.
  • Provide label as Enter your name
  • Surround it with panelFormLayout 
  • Drag Drop sayHello method as button screen
  • Open responsePage.amx and dragdrop String as outputtext with label.

Deploying Application to Android simulator

  •  Select the Application
  •  Goto properties and define deployment profile
  • Start your AVD

  Please follow my previous post to setup AVD click here

Running Application

  • Open Application 


  • Enter your name



Note : Replace the IP in the downloaded files with your machine IP address



Tuesday, November 20, 2012

Retrieve af:table row data on enter without Java-Script

Retrieve af:table row data on enter without Java-Script

As we all know that Oracle ADF framework is tightly coupled with JavaScript and Ajax. Its never advisable to use you custom JavaScript. And its a common requirement to get selected row data on enter click.

Here in this sample I have invented a way to retrieve row data on enter key click in backing bean and display same on jspx page. Best thing of this sample application is that it reduce the overhead of making selected row as current row in ViewObject. 

This approach might have some limitation when you following any specific architecture but it suites best to retrieve selected row data on enter click without any JavaScript. 

 


Sample Application is uploaded SampleApplication

Wednesday, October 24, 2012

Oracle ADF Mobile App

Oracle ADF Mobile App 
Great news Oracle released first version of Oracle ADF Mobile framework. This is the only framework in which you can develop mobile app using Oracle ADF Mobile Framework and deploy on multiple OS.
Current Version of Oracle ADF Mobile Framework providing you facility to deploy same application on iOS(iPhone/iPad) as well as on Android SDK.

Earlier we have to created different app for iOS(iPhone/iPad) and Android. 
Now they have reduce the overhead of creating same app for different platform.

Let's hope to get Windows and BlackBerry Support soon.

Here I am explaining how you configure the environment for Android Development.

Download Oracle JDeveloper 
As you want to start with ADF Mobile development you have yo install JDeveloper version 11.1.2.3.0. This is the recent release from Oracle which support the Mobile App Development.

Download the JDeveloper from below link

Install the JDeveloper.

Download ADF mobile Framework Extension
 Download Oracle ADF Mobile Extension from below link
Install ADF Mobile framework
  • Click on check for Update under help menu.
  • Select your downloaded file with name adf-mobile_bundle.zip
  • Accept the license and click on finished after that your jdeveloper will restart.


Configure Android SDK
Lets now download the Android SDK from below location http://developer.android.com/sdk/index.html 
After successfully installing the Android SDK open Android SDK Manager and download the recent Android API

Once you finished with API download.
Open AVD manager(Android Virtual Device Manager)


Create new machine by clicking on new button
Provide the values like below screen
 Open JDeveloper preferences and select the platform location.
Now you environment is ready for Android Development with Oracle ADF.