Creating an Android Phone Based on Phonegap in Android Studio

I have worked with Phonegap using Eclipse and ADT plugins in the past, and now I'm trying to do this in the new Android Studio IDE.

Since Phonegap v3 seems to rely on some kind of NodeJS host installation, which I don't know anything about, I downloaded Phonegap v2.9 instead. Also, since Android Studio is so new, and it looks like the documentation only covers importing existing Eclipse projects or projects built using Phonegap, I am trying instead to follow the old Eclipse documentation.

To understand, I created a project in Android Studio and checked that it works. Then I created / assets / www and copied cordova.js and the base index.html file. I copied cordova-2.9.0.jar to / libs and right-clicked to add as a library. Finally, I made the appropriate changes to MainActivity.java and AndroidManifest.xml, respectively.

The problem is that when the assembly gets "import org.apache.cordova. *;" in my MainActivity.java file, this is an error with 'Gradle: org.apache.cordova package does not exist'.

Can someone please point me towards some documentation on creating a Phonegap ap application using Android Studio (instead of importing from Eclipse or from something created using the Phonegap command line), or even just describe how I must edit build.gradle so Gradle can find Cordoba?

Great importance.

+4
source share
1 answer

Ric is really easy to work with Phonegap and ANDROID Studio. That's what I'm doing:

  • Creating a Phonegap project: phonegap create testproject com.testproject.name Name ;
  • Enter the project directory: cd testproject ;
  • Add Android platform: build android phone screen saver ;

You have a ready-made phone game project. Now open Android Studio. Select "Import Project" and follow the instructions. If you do not have plugins added to your project, it will fail by clicking NEXT until you get to the end.

It's all. If you need more information, say that we will be happy to help you.

If you prefer a snapshot, you can find a very simple guide: Phonebook and Android Studio

+4
source

Source: https://habr.com/ru/post/1494099/


All Articles