简体   繁体   English

将Phonegap项目转换为IBM Worklight项目

[英]Convert Phonegap Project to IBM Worklight Project

I have designed Phonegap app by using jQuery Mobile. 我已经通过使用jQuery Mobile设计了Phonegap应用。 Now iam having complete project from Phonegap+jQueryMobile. 现在,iam已完成了Phonegap + jQueryMobile的完整项目。

Now iam learning IBM Worklight, So i need to convert this project into IBM Worklight project. 现在我正在学习IBM Worklight,因此我需要将该项目转换为IBM Worklight项目。

What are the steps i have to follow? 我必须遵循哪些步骤?

Cant i do straight forward? 不能直接做吗?

Provide the steps to do the project in IBM Worklight.. 提供在IBM Worklight中执行项目的步骤。

You may select to upgrade straight to MobileFirst Platform 7.1 which introduced support for Cordova applications, meaning your upgrade path is even more minimal. 您可以选择直接升级到MobileFirst Platform 7.1,该版本引入了对Cordova应用程序的支持,这意味着您的升级路径变得更小了。 See more here: https://developer.ibm.com/mobilefirstplatform/documentation/getting-started-7-1/foundation/hello-world/integrating-mfpf-sdk-in-cordova-applications/ 在此处查看更多信息: https : //developer.ibm.com/mobilefirstplatform/documentation/getting-started-7-1/foundation/hello-world/integrating-mfpf-sdk-in-cordova-applications/

You will only need to copy your web resources to the new app and that is all. 您只需要将您的Web资源复制到新应用程序即可。 All remains the same, with the added value of now beng 一切都保持不变,现在的附加值是beng

Alternatively, Worklight/MobileFirst Platform Classic Hybrid apps come bundled with Cordova, to the basic step to take is to simply copy over your web resources (HTML, JS, CSS) into the Hybrid project generated for you using MobileFirst Studio. 另外,Cordova捆绑了Worklight / MobileFirst Platform Classic Hybrid应用程序,基本步骤是将Web资源(HTML,JS,CSS)复制到使用MobileFirst Studio为您生成的Hybrid项目中。

  1. Install the MobileFirst Studio plug-in for Eclipse. 安装用于Eclipse的MobileFirst Studio插件。
  2. Create a new Hybrid project and application and add any required environment ("platforms" in Cordova lingo) such as Android or iPhone 创建一个新的Hybrid项目和应用程序,并添加任何必需的环境(在Cordova术语中为“平台”),例如Android或iPhone
  3. The application structure will be familiar to you. 您将熟悉应用程序的结构。

    • Copy your HTML to the provided common\\index.html - be careful not to override it(!) but rather add the missing pieces to it: 将您的HTML复制到提供的common \\ index.html- 注意不要覆盖它(!),而是将缺少的部分添加到其中:
    • the jQuery references are needed 需要jQuery引用
    • the cordova.js reference is not needed 不需要cordova.js参考
    • Copy the CSS to common\\css 将CSS复制到common \\ css
    • Copy the JS to common\\js 将JS复制到common \\ js
    • Adjust any paths such as to the files of jQuery Mobile (easiest would be to place it in the common\\js folder, but you can later tweak this) 调整任何路径,例如到jQuery Mobile的文件(最简单的方法是将其放置在common \\ js文件夹中,但是您稍后可以对其进行调整)

That should be about it in general. 总的来说应该如此。 Now simply build your app by right-clicking the app folder and selecting Run As > Run on MobileFirst Development Server and preview your app. 现在,只需右键单击应用程序文件夹并选择“运行方式”>“在MobileFirst Development Server上运行”并预览您的应用程序即可构建您的应用程序。

If you have Cordova plug-ins that will be more challenging. 如果您有Cordova插件,将更具挑战性。

I suggest that you will first learn about developing MobileFirst apps before attempting to migrate an existing app. 我建议您在尝试迁移现有应用程序之前先学习开发MobileFirst应用程序的知识。 See more here: https://developer.ibm.com/mobilefirstplatform 在此处查看更多信息: https : //developer.ibm.com/mobilefirstplatform

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM