How to get started with Ophone Widget SDK

Source: Internet
Author: User

Some people think that the Ophone Widget SDK can compete with Android or iPhone. How should we evaluate the Ophone Widget SDK. Here we will teach you how to quickly get started with the Ophone Widget SDK.

By reading this article, developers who contact JIL mobile widgets for the first time can quickly learn about JIL mobile widgets and how to use JIL mobile Widget SDK to create mobile widgets. For experienced developers, you can use this article to learn how to speed up the Widget development process.

I. Introduction

Now we will give a simple explanation of mobile widgets and Their sdks:

What is a mobile Widget? According to the official statement, mobile widgets are an interactive mini-application developed by Web technologies such as HTML, CSS, and JavaScript. In other words, a mobile Widget is a software package consisting of HTML, JavaScript, and CSS that can be installed on a handheld device. The Widget package is self-contained, that is, the Widget contains all the files required by the Widget. Therefore, the Widget can become a completely independent application. With this mini program, you can quickly and conveniently access content on the Internet on mobile devices. Example of a mobile Widget: daily weather update, news reading component, currency converter, clock or calendar reminder. In addition, widgets can access existing enterprise applications.

What is the mobile Ophone Widget SDK? Obviously, it is an integrated development environment for developers to develop, debug, and deploy widgets. The editor in this software development kit is specially customized. It not only greatly simplifies code writing, but also provides a convenient debugging tool. At the same time, this mobile Widget SDK also has a simulator. We can also preview our Widget masterpiece on the simulator.

It is easy to use the Ophone Widget SDK to develop a Widget application, all of which are based on the industry-standard Eclipse software development environment. With the help of the Widget wizard, we can build our project in just a few minutes, because this software development kit will automatically provide all the necessary files when creating the project, so it can speed up project completion. As mentioned above, the software development kit contains a mobile phone simulator that we can use to verify the developed widgets. The following example shows the complete Widget development process.

2. Establish a Development Environment

The following describes the installation methods for different systems. Either platform is the same, that is, before installation, it takes some time to check the software requirements. Among them, JDK is essential, which is http://java.sun.com/javase/downloads/index.jsp.

Download the SDK and decompress it to the appropriate directory. For a Windows operating system, double-click the SDK icon to run the installer, and then follow the prompts to install it on the system. The default installation directory is C: disk, but we can change the installation directory as needed during installation. After installation, you can find the jil sdk shortcut icon in the program group and desktop, and start Eclipse IDE to develop widgets.

On the Mac system, run the following command to start the jil sdk installation program. Then, follow the prompts in the Wizard to install jil sdk. By default, the installation directory is/application.

$ Java-jar jil_install.jar

On Linux, run the following command to start the jil sdk installation program. Then, follow the prompts in the Wizard to install jil sdk. By default, the installation directory is your home directory.

$ Java-jar jil_install.jar

The installed Development Kit includes documents, sample widgets, simulators, and Eclipse IDE with Widget development plug-ins. Note: You can set the "SDK Location" of the Widget sub-item in the first option in the SDK installation directory ".

3. Create our first Widget

Once the SDK is installed, we can start to create our widgets. As you can see below, this is actually very simple and can be done in just a few minutes.

First, create a HelloWidget project. To quickly create a Widget Project, open the jil sdk and select "File> New> Widget Project" in the menu bar, as shown in 1.


Figure 1 create a Widget Project

Here, specify a name for our project. In this example, It is HelloWidget. Click Finish to create a new Widget project.


Figure 2 create a HelloWidget Project

Now, you can view the new Widget through the file structure. By default, the toolkit automatically creates necessary files using predefined templates.


Figure 3 Widget file structure

These files include:

HelloWidget.html. This file is the entry point for displaying Widgets. It defines the overall layout of widgets.

HelloWidget.css. This file is usually used to tell the Widget's exterior, such as the color and font size of each element.

HelloWidget. js, which defines the actions that widgets can perform.

Config. xml. This file contains the meta information of the Widget, such as the Widget name and author.

Next, we start to write code for our widgets. We can double-click the hellowidget.html file to open the Widget to write code for it. In this example, we just want the Widget to display the text "Hello Widgets" and add a beautiful background image to the text. In code 4.

Figure 4 Widget code

Well, our first Widget has been created. Next we will run this Widget on the simulator to see how it works. Right-click the Widget project and choose "Run as> widget project" to start the simulator.


Figure 5 start the Widget in the simulator

When the simulator starts, our widgets are automatically loaded. Then, we can operate our widgets in the simulator.


Figure 6 widgets running in the simulator

Finally, we will introduce how to run widgets on a mobile phone. We can find a encapsulated Widget under the bin folder of the project. Its extension is wgt. Copy this file to the phone that has installed the Widget engine, so that we can run our widgets on the actual device.

As you can see above, creating a JIL Widget is very simple. Within a few minutes, we will use the jil sdk Wizard to create a project, run the Widget in the simulator, install it on a mobile device in development mode, and run it.

Iii. Ophone Widget SDK Summary

In this article, we first give a brief introduction to mobile widgets and the development environment of mobile widgets, and then demonstrate in detail how to use the SDK to create an instance mobile widget. By reading this article, developers who contact JIL mobile widgets for the first time can quickly learn about JIL mobile widgets and how to use JIL mobile Widget SDK to create mobile widgets. For experienced developers, you can use this article to learn how to speed up the Widget development process.

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.