Uploaded image for project: 'Apache Cordova'
  1. Apache Cordova
  2. CB-13919

Android WebViews - Docs Missing Steps/Confusing

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Duplicate
    • cordova-android-7.0.0
    • None
    • None
    • None

    Description

      I am having some issues walking through this document. I suspect that the project has been updated and the docs just haven't kept up. Someone may just generally want to review the article and update it.

      https://github.com/apache/cordova-docs/blob/master/www/docs/en/dev/guide/platforms/android/webview.md

      (I haven't contributed anything before so if I did anything wrong, apologies)

       

      Issues:

      Issue #1 - Step 1 and 2

      Doc says:

      "Download it from cordova.apache.organd unzip its Android package.

      Navigate to the Android package's /framework directory and run ant jar. It creates the Cordova .jar file, formed as /framework/cordova-x.x.x.jar."

      If I download the source from "http://apache.claz.org/cordova/platforms/" "cordova-android-7.0.0.tgz", open it (on Mac), terminal into the 'framework' folder, then execute `ant jar`, the following error occurs:

      ```

      BUILD FAILED

      /Users/gb/temp/package/framework/build.xml:42: You need to create the file 'local.properties' by running 'android update project -p .' here.

      ```

      If I add a `local.properties` file, and add `
      sdk.dir=/usr/local/Cellar/android-sdk/24.4.1_1` to it, then the error goes away.
       
      Also, 'android update project -p .'  is not a valid command anymore, so that instruction might need to be updated.
       
      Issue #2 - Step 4
       
      "Add the following to the application's /res/xml/main.xml file, with the layout_heightlayout_width and {{id }}modified to suit the application:"
       
      I don't see this file in my Cordova project. Its not in `/res/xml/` or `/platforms/android/res/xml/`. Is it supposed to be created?
       
      Issue #3 - Step 5
       
      "Modify the activity so that it implements the CordovaInterface. It should implement the included methods. You may wish to copy them from /framework/src/org/apache/cordova/CordovaActivity.java, or else implement them on your own. The following code fragment shows a basic application that relies on the interface. Note how the referenced view id matches the id attribute specified in the XML fragment shown above:"
       
      This step is a bit confusing.
       
      What Activity should I modify? Is the intention to create a new class and inherit from the 'CordovaActivity.java' class? Are we talking about the 'MainActivity' file in my Android project?
      I'd assume if Java classes are being modified they need to be put in a place where they won't be overwritten if the 'platforms' folder gets overwritten (since it seems like thats a new-ish~ thing in Cordova)
       
      Issue #4 - Step 9
       
      "Copy the config.xml file from /framework/res/xml to the project's /res/xml directory."
       
      I don't see this folder exist anywhere: '/framework/res/xml'
       

      Attachments

        Issue Links

          Activity

            People

              Unassigned Unassigned
              gregberns Greg Berns
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: