cordova-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Richard Knoll <rikn...@microsoft.com>
Subject [DISCUSS] Core Plugins and Android API 23
Date Thu, 07 Jan 2016 00:08:07 GMT
Hey all,

As has been very thoroughly discussed at this point, the cordova-android 5.0.0 update included
breaking changes for plugins in response to the new permission model that Android Marshmallow
introduced. Unfortunately, this means that our plugins that took advantage of the new permission
APIs are no longer able to build on Cordova platforms before cordova-android 5.0.0. Really,
this update only came down to two new methods in CordovaInterface: one for requesting permissions
and one for checking them. Since this is such a minor API change, it is trivial for us to
modify the core plugins that require permissions to use reflection and allow projects that
are still using the earlier Android APIs to keep using them. I have done so for the camera
plugin as an example [1]. All it took was writing a helper class for permissions that I made
general enough to be easily included in the other core plugins.

This change gives users who are not ready to embrace Android API 23 some more time before
they are forced to update (e.g. if they are still using some other plugins that have yet to
be updated). It also helps us reduce some of the current plugin versioning woes we're having.
Anyone using Cordova 5.x stands to benefit, since this can prevent some confusion and frustration
caused by broken builds when their cli fetches the latest plugins. In my opinion, the cost
of copying a helper class is worth that potential payoff. What do others think?

I did a little testing with my modified camera plugin and cordova-android 3.7.1 (which I arbitrarily
chose) and it built/seemed to work fine. If people support this idea, I can do a bit more
testing and make PRs for the other plugins.

For the record, the affected plugins are as follows:
    cordova-plugin-camera
    cordova-plugin-contacts
    cordova-plugin-file
    cordova-plugin-geolocation
    cordova-plugin-media

Thanks,
Richard
[1] https://github.com/apache/cordova-plugin-camera/compare/master...riknoll:reflection?expand=1

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message