Add this line to the imports
import org.apache.cordova.DroidGap;
EDIT:
If you are using Eclipse, you can use the key combination Ctrl + Shift + O
to organize imports. This removes unused imports, and also will import the needed packages and/or classes (If there are multiple possibilities, e.g. android.view.View.OnClickListener
and android.content.DialogInterface.OnClickListener
, Eclipse will give you the chance to select the desired class to import).
EDIT:
You did not add the cordova jar to the build path. I checked your .classpath
file on the github repo, and it lacks this line: <classpathentry kind="lib" path="libs/cordova-1.8.1.jar"/>
.
Solution: Right-click on the codova-1.x.x.jar
-> Build path -> Add to build path.
Please try to follow the steps defined here.
EDIT
Do the following: 1. Right-click the project. 2. Click properties. 3. On the left, select Java Build Path. 4. You see four tabs: Source
, Projects
, Libraries
, Order and Export
. Select Libraries
. 5. On the right click the button Add JARs...
. 6. Search for cordova-1.x.x.jar
in your project, and select it. 7. Click OK
. 8. Done
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…