Oracle ADF Mobile Framework Development Guide Notes

Source: Internet
Author: User

In this article, I'll show you how to use this new platform. I've seen a lot of developers being stuck on basic technology. I will try to illustrate the example of writing Hello world. So that any individual can take the path of development and benefit from the platform.
Note: In order to describe the development process in detail, I pasted some pictures. So this article seems to be relatively long, in fact, the practicality is very high.
Background
Here are some of the connections that describe what Oracle ADF Mobile is. Because you're about to start demonstrating using a new platform, these connections can help you set up your development environment.
What is Oracle jdeveloper
What is Oracle ADF Mobile
Developing an ADF Mobile environment
Please browse the above connection and set up the development environment. If you have any questions, please let me know in time.

Code
Configure your development environment.
Here are the development steps that the ADF mobile beginner needs to learn.
In this section, we'll create a click button that pops up the example Hello World.
Open JDeveloper Studio. Open the development environment as described below Start->all programs->oracle Fusion middleware 11.1.2.40->jdeveloper Studio 11.1.2.40.

.
If the select role is popped, select the default Studio Developer (all Features) and click OK.
Select Application in the top-level menu bar click New ...
After that, a dialog box pops up. The dialog box will show all supported project types. Now, we select the mobile application (ADF) and click OK.
A dialog box with the name of the program will then pop up and enter the name of the program in Application name: I named it Myfirstapp, in application Package Prefix: Enter the prefix of the package. Usually, in practice, we are accustomed to naming packages in lowercase letters. I'll name it: MyApp. After you have set up your program to add a prefix, click Next.
In the first step, name the package, enter the project name, or use the default name, such as Applicationcontroller. We will use the default name. You can change the file path or take the default path.
On the Java Settings page, use the default settings, such as Myapp.application, and then click Next.
In the Project 2 name interface, use the default settings and click the Next button directly.
In the Project 2 Java settings interface, use the default package name and click the Finish button.
Once you click the Finish button, the ADF will create two projects for you. You can view all the projects in the IDE's left project panel. Of course, he also opened the Adfmf-feature.xml also. You can add different features to this file. The role of the file will then be described in detail.
When the Adfmf-feature.xml file is open, if the IDE does not open the file, do the following to open the file viewcontroller->application sources->meta-inf-> Adfmf-features.xml, in the Features form, select the Click button to add new features to your project.
A function is a model of a component or program. It can make a Web page (HTML or ASMX), or a workflow task. If you continue to develop applications and explore different scenarios, we will look at the details of this.
Click to open a dialog box. The dialog box prompts you to enter a feature name. You can name the newly added features at random. Because, we develop the mobile phone program, only one screen. So, we named FirstPage. then click OK.
The IDE will add the feature FirstPage to the XML feature file (Adfmf-feature.xml). Be assured that the file opens by default.
Below the features page, you can see the General page. When you enter the Content tab, you can see the ID and type input box: content is automatically added. Note that after this, the type of feature is the ADF Mobile AMX. You can change its name by the Drop-down list. However, here we will take the default option as an example for example development. Then, click across the file input box.
When you click the button opposite file, it displays two options, the ADF Mobile AMX Page ... and Task flow. Here, select the first option.
A dialog box will then pop up and add the filename. Select all items in the page facets area and click the OK button.
Now, you can see the FIRST.AMX page. In this file, you have UI design for your app. Note that we can only use one screen. First.amx the lower-right corner of the page and drag to the left. In the right panel, click the Preview tab. This way, you can preview the UI you are designing. Also, the changes made in the XML file will be reflected.
Now drag the output text to the FIRST.AMX page from the text and selection in component palette.
It will be displayed as the default value for OutputText1. Note: Be sure to drag the control to the source file instead of the preview interface.
Now select Amx:outputtext to view the Property Inspector panel (lower-right corner, below component palette). We'll use the Expression Builder to modify its value.
In the same property check form, click the arrow in the Drop-down list to select expression Builder ....
A dialog box will then pop up to build the expression. In the expression area, add an expression #{viewscope.actionevent}, and then click OK. In the following section, we will discuss the contents of Viewscope in detail.
Have you noticed yet? Changing the output text into an expression is displayed in the preview panel.
Now, just like dragging outputtext, drag a button control from the Control Panel and place it in the First.amx page. Put the button control under the Amx:outputtext label.
Now we need to add a handle to the button event. When a button is clicked, we will change the contents of the input box to Hello World. We will use the Java Managed Beans class to implement this functionality. Now, leave the blank area of the Amx:commandbutton or selected button selected. It displays the Property Check window just as you would a preview Amx:outputtext control. Select the properties in the button Action to check the form. Click the action Listener in the Drop-down list, and then click Edit ....
The IDE then opens a dialog box that specifies the Bean class. Because we did not create a bean class. So, click New to create a new class.
The pop-up dialog will have some required entries, and when you enter, click OK.
The pop-up dialog will have some required entries, and when you enter, click OK.
After we add the bean class, we need to write the event that is triggered when the button is clicked. So click New ... Create a new method.
Enter a method name and click OK.
After you have specified the classes and methods, click the OK button to view the generated classes. The generated class is located in Viewcontroller->application Sources->myapp.mobile->eventhandler.java.
Double-click the file to see the contents of the class. This class contains the default constructor and the method of the event handle that was added earlier.
Now, in the OnClick method, add the following code.

对了,我们需要添加两个引用:
·  javax.el.ValueExpression
·  oracle.adfmf.framework.api.AdfmfJavaUtilities.
现在,做完了!该向安卓模拟器添加部署你的程序了。
Deployment
为了创建一个安卓模拟器,进入安装安卓sdk的文件夹。进入tools 文件夹。以我为例,我的路径如下:
D:androidsdkadt-bundle-windows-x86_64-20140321sdktools
Run the Android Windows batch file in the Tools folder. A form will then pop up. Select Tools in the menu, then click Manage Avds ....
All available devices are then displayed in the Android Virtual Device Manager form. In my case, I've created an Android virtual machine that I'll use to run my app.
Note: You need to select or create an emulator with the Google API.
Wait a moment, there will be an Android boot interface. Now in the JDeveloper menu, select Applications ... . Then select Deploy and then select New Deployment Profile .... Note that you can use an existing item.
Select ADF Mobile for Android under Profile type, and enter any name in deployment profile name. Click the OK button.
The Properties form will then pop up.
In application images you can specify a picture as your icon. We will select the default icon. Click OK to create a deployment file. Now that the Android simulator is running, and now we need to deploy our app in the simulator.
In JDeveloper, after entering Applications->deploy, choose Emulator .... This is the file that we just created.
ment a deploy emulator deployment form will pop up. Select Deploy application to emulator and click Next .
An overview of the programs with application Bundle Id File and Deployment mode will be shown to you.
Now click Finish to start the deployment. You can see the details of the deployment in deployment log below the Deployment tab.
When the deployment is complete. will show deployment Jane pick. The deployment may take several minutes, so please be patient.
The deployment is now complete in the Android simulator. Click the menu button to locate Myfirstapp click Run.
An Oracle-based flashing form is displayed. When it's over, click CommandButton1 to display the Hello World text.
Output Hello world.
So far, we have completed the process of creating and deploying Hello World. I hope this guidance article will help you.
My bugs, feedback will always remain logged in.

Points of interest
We learned how to use ADF mobile to create our app. This is just a starter program. Perhaps, compared with the local development of an Android/ios program, it looks like it will take more time. However, in fact, ADF Mobile can improve your development efficiency. such as a development, run everywhere! Once you start using it to develop your app, you'll find a significant difference in the development process!

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.