layout: post author:
name: Steve Gill
url: https://twitter.com/stevesgill
title: "Cordova Android 5.1.0" categories: announcements
We are happy to announce that Cordova Android 5.1.0
has been released.
This update introduces a new API for Android plugin authors. Plugins that launch external activities can now better handle method calls on devices that are low on memory. In that scenario, the Android OS will sometimes kill the Cordova Activity when it is pushed into the background by the external Activity. This causes the plugin to lose any callbacks they have pending in the javascript. The new API allows the results of external Activity calls to be delivered via the resume event that is fired in the javascript after the Cordova Activity is destroyed and recreated. Plugin authors wishing to implement the new API should read the updated plugin guide here.
Two core plugins support this new API and have been updated to fix longstanding bugs:
Application authors are encouraged to update both their plugin and cordova-android versions to take advantage of these bug fixes. Please note that the aforementioned fixes require changes to your application as well. More information can be found in the READMEs of each of those plugins and in the new Android lifecycle guide that has been published to the Cordova documentation. This guide provides explanations and guidance on how to handle low memory scenarios on the Android platform as well as integrate the new resume APIs into your application.
To upgrade:
npm install -g cordova
cd my_project
cordova platform update android@5.1.0
To add it explicitly:
cordova platform add android@5.1.0
android.useDeprecatedNdk=true
to support NDK
in gradle
Theme.DeviceDefault.NoActionBar
applicationId
to package name
.gradlew _JAVA_OPTIONS
output during build.gitattributes
to prevent CRLF
line endings in repos.gitignore