Search code examples
androideclipseibm-mobilefirst

Worklight does not rebuild javascript/html when deploying to Android Simulator


My worklight is working fine in the Android simulator. As per the documentation, I have two projects listed in Eclipse: The base worklight app and the Environment-specific Android project that was automatically built.

The problem is that when I change anything on the javascript side or my index.html and then click the Android-specific project using "Run As" => "Android Application", none of the changes in the parent project actually get propogated to the Android project.

Only if I select the parent project and then select "Run As" => "Run on Worklight Development Server", followed by the previous action do the actual JS/html changes actually get reflected in the Android simulator.

Why do I have to do these two steps? Why doesn't just re-deploying the APK automatically cause the parent project to be rebuilt in a single step?

Thanks!


Solution

  • The generated Android project is just that - generated.
    The generated Android project is a mirror of the android\native folder, It's a "copy".

    In order to update this "copy", you must build your project. It is an explicit action you must do and is by design.

    Additionally, I don't see the two steps that you mention.

    1. You write some code.
    2. There must be at least 1 initial deployment to the server
    3. You can now preview your app in the Worklight Console
    4. You can do additional changes, refresh the browser and you will see your changes w/out additional re-builds & re-dpeloyments
    5. You now want to see your changes in your actual app

    Because the generated native project is a separate "copy" of your app, you must re-build in order to get these changes into the actual app.