If PhoneGap functionality is not required, you can make a few modifications to
remove all references to the PhoneGap library that is linked to the Hybrid Web
Container.
Leaving PhoneGap in place does
not cause any issues, but does increase overall application size by about 70KB.
- Open the UiHybridAppContainer.java file for editing and
comment out this line:
//import com.phonegap.DroidGap;
- Change the superclass of UiWorkflowContainer from
Droidgap to Activity:
public class UiWorkflowContainer extends Activity {
- Around line 80, change the USE_PHONEGAP variable to false, so the
line of code looks like this:
private static final boolean USE_PHONEGAP = false;
- At this point, there are 5 errors, which are caused by calling methods that were
inherited from the Droidgap class (but do not exist in the
Activity class); comment out the 5 lines that cause these
errors :
- To
find
these lines, search for "USE_PHONEGAP."
These lines are all contained in "if ( USE_PHONEGAP )"
statements.
- Around line 110, comment out:
// super.init();
// m_oWebView = this.appView;
- Around line 205, comment out:
// super.setStringProperty( "loadingDialog", m_sProgressText );
// super.setIntegerProperty( "loadUrlTimeoutValue", 300000 );
// super.loadUrlWithData( sBaseURL, abData );
- Switch to the Java perspective, right-click on the
HybridWebContainer project, and choose
Properties.
- Under Java Build Path, click the Libraries tab.
- Remove the PhoneGap library
(phonegap<version>.jar-HybridWebContainer/libs).
- Delete the phonegap<version>.jar file from the
HybridWebContainer\libs folder.