cordova

使用Phonegap/Cordova编写跨平台(Android/iOS)应用 (2) -- iOS篇

随声附和 提交于 2020-03-01 02:38:00
1. 先在xCode上安装 Command Line Tool. 具体可以在 Preference -> Downloads -> Components -> Command Line Tools. 选择并安装即可。 2. 如果你的terminal不能运行 npm,那先得安装 Node.js。 http://nodejs.org/download/ 要下载 "Macintosh Installer (node-v0.10.29.pkg)". 不要下载“Mac OS X Installer (.pkg) Universal”,因为这个包会报“No software to be installed”的错。 3. 在命令行terminal利用 npm安装 Cordova sudo npm install -g cordova 4. 开始建立第一个Hello的应用: $ cordova create hello com.example.hello HelloWorld -d -d 是为了在过程中能输出信息。 之后,在你运行上面这条命令的路径下,就会建立一个"hello"的目录。在hello目录下有一个 "www"的目录,将是你应用的hompage的目录。 执行命令,为hello添加iOS的平台支持 $ cordova platform add ios 执行成功后,在 hello

APN BadDeviceToken iff running dev version

泪湿孤枕 提交于 2020-02-27 05:13:46
问题 The problem I'm not receiving Push Notifications to my app when I'm working on it, and the APN server returns " BadDeviceToken " . The situation I've got to be missing something simple here, this is the situation : When I send a Push Notification to my app downloaded from the App Store it works When I send a Push Notification from the same server, to the same version (*) of my app but built off Xcode, the APN server returns a status: '400' fail with the failed[0].response.reason:

How can I detect the system language of an iOS device using JavaScript? [duplicate]

*爱你&永不变心* 提交于 2020-02-27 05:04:32
问题 This question already has answers here : Phonegap iOS retrieve device language (2 answers) JavaScript for detecting browser language preference [duplicate] (26 answers) Closed 6 years ago . I have found this previous question but it uses C. Is there a way to do this through JQuery or JavaScript? 回答1: UPDATE: This plugin is not required any more, and its no longer included in default installations. The current way of obtaining it is navigator.language() See https://developer.mozilla.org/es

How can I detect the system language of an iOS device using JavaScript? [duplicate]

懵懂的女人 提交于 2020-02-27 05:04:19
问题 This question already has answers here : Phonegap iOS retrieve device language (2 answers) JavaScript for detecting browser language preference [duplicate] (26 answers) Closed 6 years ago . I have found this previous question but it uses C. Is there a way to do this through JQuery or JavaScript? 回答1: UPDATE: This plugin is not required any more, and its no longer included in default installations. The current way of obtaining it is navigator.language() See https://developer.mozilla.org/es

File size not able to read when images is choosed from image album

家住魔仙堡 提交于 2020-02-25 07:16:05
问题 In my phonegap application(android version 4.4.2) i need to pick image form sdcard. In this i am unable to read the image size and name. My code is like. function getSkiImage(id,source){ navigator.camera.getPicture(function(imageURI){ alert(imageURI); window.resolveLocalFileSystemURI(imageURI, function(fileEntry) { alert(fileEntry); fileEntry.file(function(fileObj) { alert(fileObj.size); }); }); // tried this also /*window.requestFileSystem(imageURI, 0, function(data) { alert(data.size); },

Windows系统Ionic安装教程/Ionic环境配置

与世无争的帅哥 提交于 2020-02-25 02:38:36
原文链接:http://blog.csdn.net/superjunjin/article/details/43412017 参考文章 Cordova 3.x 基础(1) -- 环境搭建(Windows / Android) http://rensanning.iteye.com/blog/2016364 phoneGap之Android环境搭建 http://haomou.net/2014/08/06/2014_phonegap_android/ ionic框架配置 http://haomou.net/2014/08/07/2014_ionic/ ant的配置 http://www.cnblogs.com/yuzhongwusan/archive/2013/03/26/2982411.html 其实大体主要分两步:安装cordova和安装ionic 安装cordova 一,首先安装Ant(cordova工具生成android项目时,需要的编辑工具) 1,安装ant 到官方主页http://ant.apache.org下载新版(目前为Ant1.8.1)的ant,得到的是一个apache-ant-1.8.1-bin.zip的压缩包。将其解压到你的硬盘上,例如:C:\apache-ant-1.8.1。 2,配置环境变量 path C:/ apache-ant-1.8.1/bin

Unable to make a Cordova WebView on Android

£可爱£侵袭症+ 提交于 2020-02-24 09:09:24
问题 I'm following the instructions here to setup an Android WebView but I cannot get past step #2 below: Navigate to the Android package's /framework directory and run ant jar. It creates the Cordova .jar file, formed as /framework/cordova-x.x.x.jar. Running ant returns an error: build.xml:42: You need to create the file 'local.properties' by running 'android update project -p .' here. How can I get past this problem? 回答1: You will have to choose the version of android you want to use, if you

Unable to make a Cordova WebView on Android

家住魔仙堡 提交于 2020-02-24 09:07:31
问题 I'm following the instructions here to setup an Android WebView but I cannot get past step #2 below: Navigate to the Android package's /framework directory and run ant jar. It creates the Cordova .jar file, formed as /framework/cordova-x.x.x.jar. Running ant returns an error: build.xml:42: You need to create the file 'local.properties' by running 'android update project -p .' here. How can I get past this problem? 回答1: You will have to choose the version of android you want to use, if you

移动端跨平台开发框架对比分析

纵饮孤独 提交于 2020-02-23 13:13:39
前言 现在主流的移动开发平台是Android和iOS,每个平台的开发技术和运行方式都不一样,大家都是针对每个平台开发应用。自然会存在一个移动应用产品要针对每个平台开发一套的现象,这样带来的问题则是开发成本高、效率低下,进而会有进行跨平台开发的需求。从最开始以Cordova为基础的Hybrid混合开发技术,到React Native的桥接技术,到现在新兴的Flutter技术,跨平台开发技术一直在演进。 目前主流跨平台框架简介 Cordova Cordova 是Apache旗下的一个开源的移动开发框架。它允许你使用WEB开发技术(HTML5、CSS3、JavaScript)进行跨平台开发。应用在每个平台的封装器中执行,并且依赖规范的API对设备进行高效的访问,比如传感器、数据、网络状态等等。 Cordova通过对HTML、CSS、JS封装为原生APP。Cordova将不同设备的功能,按标准进行了统一封装,开发人员不需要了解设备的原生实现细节,并且提供了一组统一的JavaScript类库,以及为这些类库所使用的设备相关的原生后台代码。因此实现了“write once, run anywhere”(一次开发,随处运行)。 Cordova前身是PhoneGap。2011年Adobe公司将其收购对其开源,并捐献给Apache,重新命名为Cordova。 React Native React

cordova - Failed: q is not supported

巧了我就是萌 提交于 2020-02-23 09:10:29
问题 When I build cordova this message view: Using "requireCordovaModule" to load non-cordova module "q" is not supported. Instead, add this module to your dependencies and use regular "require" to load it. How fix this problem? PS. I updated npm before this build problem. So it was not problem buildings before update. Sorry my English)) 回答1: Solved this problem by installing a lower version of cordova. Seems like every version of cordova that is > 8.1.1 breaks a number of plugins. For instance,