SCENARIO
I have a small Android Phonegap/Cordova 2.3.0 application, I looked into /res/xml/config.xml file and found that so many plugins are there.
It is a very small app and I guess, all I am using is notifications and ChildBrowser plugin.
QUESTION: I want to know is it safe to remove all other plugin entries. If yes, then:
1) Is only removing them from /res/xml/config.xml enough ?
2) Which plugins are mandatory (without which ANY basic app won't work)? e.g., the first one ("App" plugin), I think it is required ?
3) Will removing plugins give me a increase in speed of my app ? Or smaller install size or .apk size.
For details,Here's the part of my XML file:
<plugins>
<plugin name="App" value="org.apache.cordova.App"/>
<plugin name="Geolocation" value="org.apache.cordova.GeoBroker"/>
<plugin name="Device" value="org.apache.cordova.Device"/>
<plugin name="Accelerometer" value="org.apache.cordova.AccelListener"/>
<plugin name="Compass" value="org.apache.cordova.CompassListener"/>
<plugin name="Media" value="org.apache.cordova.AudioHandler"/>
<plugin name="Camera" value="org.apache.cordova.CameraLauncher"/>
<plugin name="Contacts" value="org.apache.cordova.ContactManager"/>
<plugin name="File" value="org.apache.cordova.FileUtils"/>
<plugin name="NetworkStatus" value="org.apache.cordova.NetworkManager"/>
<plugin name="Notification" value="org.apache.cordova.Notification"/>
<plugin name="Storage" value="org.apache.cordova.Storage"/>
<plugin name="Temperature" value="org.apache.cordova.TempListener"/>
<plugin name="FileTransfer" value="org.apache.cordova.FileTransfer"/>
<plugin name="Capture" value="org.apache.cordova.Capture"/>
<plugin name="Battery" value="org.apache.cordova.BatteryListener"/>
<plugin name="SplashScreen" value="org.apache.cordova.SplashScreen"/>
<plugin name="Echo" value="org.apache.cordova.Echo" />
<plugin name="StatusBarNotification" value="com.phonegap.plugins.statusBarNotification.StatusBarNotification"/>
<plugin name="InAppBrowser" value="org.apache.cordova.InAppBrowser"/>
<plugin name="ChildBrowser" value="com.phonegap.plugins.childBrowser.ChildBrowser"/>
<plugin name="PushNotification" value="com.pushwoosh.plugin.pushnotifications.PushNotifications" onload="true">
</plugin>
P.S.: I searched all over Internet, not got any useful info anywhere for Android, so asking.
In answer to your questions:
1) Removing them from config.xml will not remove them from your app it will just make it impossible to call that functionality.
2) You should never remove App, Device or NetworkStatus. Without them you wouldn't get a "deviceready" event.
3) It will not make your app any faster. Those classes are lazy load, i.e. only instantiated when they are first used. It will not make your .apk any smaller as those classes are all in the cordova.jar file that is included in your app.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With