PhoneGap Android 2.2.0带来的新体验

对我最有用的是,

1、启动画面正式被支持

以前不知道设置多长时间好,因为不同的手机性能差异很大。

现在不用担心,可以设置个比较长的时间,比如10000ms即10秒,程序完成启动后,通过api来关闭启动画面。

这样更科学。

2、JS性能显著提高,最明显的表现是程序启动时间大约缩短了一半(phonegap+jquery+iscroll)

其他方面对我的应用影响不大。

如了解详情,请看原文。

1. FileTransfer API changes 

  • Added support for the onprogress event to get progress events for a FileTransfer operation
  • Added the abort function to cancel a FileTransfer operation


See the API doc . 

2. Graduated the Globalization plugin to core 

This plugin was previously in the phonegap-plugins repo (BB WebWorks 5, iOS, Android). The globalization object obtains information and performs operations specific to the user’s locale and timezone. 

See the API doc . 

3. Splashscreen API 

The Splashscreen API is now formally documented for iOS and Android. 

4. Android JavaScript to Java bridge improvements 

  • The callback server is gone.
  • Uses events to specify when a result it ready.
  • Up to 25 times faster.
Read issue  CB-638 for more information.
 
5. Partial support for video tag
 
We've been able to shim in support for the video tag. See my earlier  blog post for more details.
 
6. Hardware acceleration is enabled by default
 
When you run bin/create to make a new PhoneGap Android project then android:hardwareAccelerated is set to true by default on the main activity. 

See Android docs for an explanation of  hardware acceleration .

7. useBrowserHistory now defaults to true 

We've deprecated the current way that history is handled in Android apps in favour of the default way it is handled in the web view. To go back a page you should be using history.back(). Because of this change iframe's now work properly. 

If you need to enable the old way to handle history you can set useBrowserHistory to false in config.xml. 

8. Introduce CordovaPlugin class 

CordovaPlugin will be replacing the Plugin class for extending PhoneGap functionality. It adds a new execute method  public boolean execute(String action, String rawArgs, CallbackContext callbackContext) to enable developers passing large amounts of data to the native side provide their own JSON parser. It also cuts down on boiler-plate, makes multi-threading easier, and adds an application-wide thread-pool to CordovaInterface. Adds an onReset method that is called when top level navigation changes. This is where you should stop any long running processes like a file transfer that are no longer needed on the new page. 
9. Various bug fixes
  • Back and Menu button events now fire if the cursor is inside a text view.
  • Fixed a path where the whitelist was not being checked in DroidGap.
  • FileTransfer.download now supports the trustAllHosts option to allow downloading from servers with self signed certificates.
  • Removed trailing space from contact.name.formatted.
  • Properly set contact's IM type.
  • navigator.language is now set properly when the language is switched in Android settings.

转载于:https://www.cnblogs.com/zhengpai/archive/2012/11/18/2776296.html

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值