Aimago mobile development platform | Make app making more convenient

This article is from Qiu Yang (Terry), CTO of Aima Ge

With the popularity of HTML5 and Node.js , Javascript , a language that was born in the early days of the Internet, is bursting with vitality. Javascript unifies front-end and back-end development. "Everything is JS " seems to be only a matter of time. The only hurdle is on the mobile side, because native apps are still prevalent on both Android and iOS platforms. HTML5 has been highly expected, but the heart-wrenching history of a group of companies represented by Facebook practicing HTML5 technology on the mobile side shows that HTML5 can be an effective supplement to native application development, but it is far from being enough to replace native. But now, with the growing popularity of iMAG.js , this situation is changing.

Demystifying the dark horse of iMAG.js

iMAG.js is a Javscript mobile cross-platform development framework launched by the domestic Aima mobile platform. Its features are simple and efficient, and at the same time powerful, it can use Javascript to replace native development. The principle of iMAG.js is somewhat similar to Node.js running on the server side . It encapsulates the Javascript engine and uses Javascript to call the underlying API interface. The difference is that the controls of mobile applications are mainly UI modules and user interface development. For this, iMAG.js introduces XML template technology, combining XML and Javascript , which is very suitable for the display of mobile phone interfaces.


<Let's see how iMAG.js can replace native development and accomplish things that HTML5 cannot. > DISCOVERY

 

1

The first is to encapsulate native UI controls. We all know that mobile phone systems, whether Android or iOS , have their own characteristics, and the most intuitive feeling these characteristics give users is the user experience. Although Android and iOS apps can be designed to be similar in appearance, the user can only operate it twice. It's easy to tell which is Android and which is iOS . Therefore, the most fundamental way to exert the maximum effect of the system itself is to use native UI controls as much as possible, and all the controls provided to users in the iMAG.js framework are native , but the Javascript interface is encapsulated in the upper layer . For example , the Label control in iMAG.js is the UILabel control that calls the system on iOS , and the TextView control that calls the system on Android , so that the performance and user experience can be exactly the same as the native application. The mobile phone has limited resources such as CPU and memory, and the native controls are optimized in some details, such asThe reuse mechanism of Android ListView uses ViewHolder to reuse View to save memory usage and maintain smooth scrolling. Likewise, iMAG.js makes full use of these mechanisms to ensure that apps developed based on iMAG.js can operate as smoothly as native apps .

2

The second is a unified development framework. Different from the chaotic development framework on HTML5 , you will always feel very smooth based on the API tailored by iMAG.js for mobile development. The most intuitive feeling of iMAG.js developers is that this framework is prepared for mobile development. After learning and mastering an iMAG.js control, developers can roughly guess how to use other controls even without reading the documentation, thanks to the good design and packaging of iMAG.js. The iMAG.js framework supports XML template technology, so that all UI controls can be written in XML , which greatly simplifies development. Just like building blocks, even people who are not tech-savvy can use iMAG.js to quickly build the App prototype they want and present their ideas to customers intuitively. In addition to the display of the static interface, interaction with the user is also the focus. For example, in combination with the background database, the interface data is dynamic data from the database, and the data input by the user can be stored in the database in a synchronous and asynchronous manner. And all these dynamic things can be done in iMAG.js through Javscript script. Javascript itself is a highly extensible dynamic scripting language.

3

iMAG.js同样适合开发大型的App项目。一个大的开发团队,除了有开发人员,还有专业的产品经理,专业的美工,专业的测试,成员之间彼此分工协作来完成项目。在精密的分工协作下完成的App通常是一个UI界面很精确的东西,比如美工根据设计做的图,通常是精确到像素的,文字的字号多大,文字图片之间的间距多少都是严格定义的,不能只是一个大致差不多的东西。iMAG.js通过css样式来控制这些内容,实现UI元素的精确布局,而且充分考虑到了手机屏幕大小的不规则性,能对不同平台不同屏幕大小的手机进行自动适配,让跨平台开发变得更容易。在兼容性方面,由于iMAG.js框架自身对AndroidiOS平台良好的兼容性,真正做到了一次开发多处运行,避免了类似于HTML5开发上出现的由于内核的不同在不同手机上展示不一致的情况。再就是iMAG.js提供了离线应用和在线应用两种模式,习惯了web后台开发的开发者可以很轻松地切换到在线应用这种模式下,因为这根本就和开发网页一样。

4

功能也是用户关心的,到底能有多少种UI展示效果,有多少种手机能力可用,决定了APP开发能够达到的层次。iMAG.js框架本身已经封装了上百种原生控件,比如TextView, ListView, UIScrollView, UITableView这些,支持电话、短信、定位、蓝牙、通讯录等几十种手机能力的使用,而这些本地功能调用都相当容易,比如:$phone.call(‘10086’)表示拨打这个电话。当然iMAG.js本身提供的功能再丰富也有不够用的时候,因为移动开发常常会面对一些复杂的场景,比如多人视频会议,不仅复杂可能还需要跟底层特定硬件结合。幸好iMAG.js是一个跟Node.js类似的东西,Node.js作为后起之秀能够迅速走红很大程度上得益于良好的扩展性,iMAG.js也是一样,iMAG.js支持原生插件,所有“不够”的能力,都可以通过原生插件的方式来实现。如果你想实现一个视频会议的插件,那么可以通过$phone.plugin(‘MyVideoMeeting’)来调用你自己用原生代码实现的视频会议模块,这里MyVideoMeeting是一个在爱码哥平台发布的插件代码。当然你其实并不需要自己专门去开发一个视频会议的模块,因为这种功能模块往往是现成的,你只需要向第三方购买相应的SDK即可。

5

前面介绍了iMAG.js看起来比较“酷”的地方,但你可能还有疑虑:既然这么高大上那我用iMAG.js开发一个微信怎么样?iMAG.js努力的方向是能够完全替代原生App的开发,即便是使用原生来开发也是以插件的形式集成进来,这样模块都是可以复用的,因此用iMAG.js来开发微信类的应用是完全可行的,并且官方已经有这样的案例。因此iMAG.js提供了一种方式,能够将Javascript语言引入到移动端,并且通过插件化模块化的方式将移动领域各种原本分散的解决方案打包成一个整体呈现给开发者和企业,让企业能够通过爱码哥平台快速实现移动化。

Guess you like

Origin http://10.200.1.11:23101/article/api/json?id=326943031&siteId=291194637