Web编程学习八:通过Apache Cordova将Web应用移动化

本文介绍了如何通过Apache Cordova将一个基于HTML5的Web应用转化为iOS上的移动应用。详细步骤包括安装Cordova、创建Cordova项目、添加iOS支持、集成SAPUI5资源、修改index.html以及在XCode中运行和测试。利用Cordova,可以轻松将Web应用迁移至不同手机平台。

上一个练习,做了一个简单但是完整的Web应用,使用HTML5技术实现的。

今天做个更加有趣的小练习,现在我再通过Apache Cordova来将其封装为iOS上的移动应用。

我们可以看到基本上不需要做任何修改就可以迁移到iOS平台上了。

Cordova就是以前的PhoneGap。

主页地址:https://cordova.apache.org/


1.安装Cordova

我这里安装的cordova 3.0.6


2.创建一个项目Apache Cordova 项目,名称叫employee

cordova -d create ~/Documents/CordovaProjects/employee com.sample employee


增加对iOS的支持:

cordova -d platform add ios


3.下载sapui5的包,解压缩后将resource文件夹拷贝到employee/www下


4.修改一下index.html

<!DOCTYPE html>
<!--
    Licensed to the Apache Software Foundation (ASF) under one
    or more contributor license agreements.  See the NOTICE file
    distributed with this work for additional information
    regarding copyright ownership.  The ASF licenses this file
    to you under the Apache License, Version 2.0 (the
    "License"); you may n
评论 1
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值