Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Which are the unnecessary Phonegap plugins to remove in app?

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.

like image 361
shamittomar Avatar asked Jan 17 '13 22:01

shamittomar


1 Answers

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.

like image 168
Simon MacDonald Avatar answered Sep 22 '22 11:09

Simon MacDonald