Skip to content

Getting Started: Developers

WepSIM for Apache Cordova

1) Prepare the Apache Cordova Project:

  • 1.1) Follow Apache Cordova tutorial in order to create a new project:

    npm install -g cordova
    cordova create wepsim es.uc3m.inf.arcos.wepsim WepSIM
    cd wepsim
    cordova platform add android
    cordova platform add ios
    

  • 1.2) Install at least the following plugins:

    cordova plugin add cordova-plugin-console
    cordova plugin add cordova-plugin-device
    cordova plugin add cordova-plugin-dialogs
    cordova plugin add cordova-plugin-file
    cordova plugin add https://github.com/apache/cordova-plugin-file-transfer.git
    cordova plugin add cordova-plugin-splashscreen
    cordova plugin add cordova-plugin-web-share
    

2) Update WepSIM files:

  • 2.1) Copy WepSIM files into the www directory:

    wget https://github.com/wepsim/wepsim/archive/refs/heads/master.zip
    unzip master.zip
    

  • 2.2) Build www for the Apache Cordova project:

    ./wepsim-master/devel/mk_cordova.sh
    

  • 2.3) [Android Only] Add to file "platforms/android/app/src/main/java/es/uc3m/inf/arcos/wepsim/MainActivity.java" the code:

     ...
     import android.webkit.WebView;
     import android.webkit.WebSettings;
     import android.webkit.WebSettings.ZoomDensity;
     ...
     WebView webView = (WebView) appView.getEngine().getView();
     WebSettings settings = webView.getSettings();
     settings.setUseWideViewPort(true);
     settings.setSupportZoom(true);
     settings.setBuiltInZoomControls(true);
     settings.setDisplayZoomControls(false);
     ...
    

3) Build Android .apk:

  • 3.1) Build .apk:

    cordova build android --debug
    

  • 3.2) Run WepSIM's App...

  • ... on Emulator:
    cordova run android
    
  • ... on Device:
    adb -d install -r ./platforms/android/app/build/outputs/apk/debug/app-debug.apk