2

I'm still struggling away with how to deploy my app directly to my phone via command-line. But when I used eclipse I could easily deploy and build directly to my device.

But android studio is meant to be all in one development software.

So far all I have been able to is either create a new project, unsuccessfully or try and import my phonegap project which then only displays:

enter image description here

So nothing really has been imported. In my mind I'm going to have to get eclipse back up and running, which seems counter productive.

All I'd like to be able to do is, work from within android studio and deploy the complied app, again from within android studio directly to my phone.

Community
  • 1
  • 1
Jamie Hutber
  • 26,790
  • 46
  • 179
  • 291

2 Answers2

3

I am using Android Studio and it's pretty complete. You can very easily import any PhoneGap project. You just have to open Android Studio, Use import and follow the instructions. From there you can sign your apk and other tasks.

It is really easy to work with PhoneGap and Android Studio. Here is what I am doing:

  1. Creating Phonegap project: phonegap create testproject com.testproject.name Name;

  2. Enter Project directory: testproject;

  3. Add Android platform: phonegap build android;

You have your phonegap project ready. Now open Android Studio. Select Import project and follow instructions. If you don't have any plugins added in your project it's preaty pushing NEXT till you get to the end.

That's all. If you need more information tell me will be happy to help you. Have in mind that as for phonegap <3.0 you had to import android sub directory of your phonegap progect, as for phonegap 3.0+ you include the main directory. In the example above will be directory TESTPROJECT, not /testproject/platform/android/ ...

If you prefer snapshot you can find a very easy to follow tutorial here: Phonegap and Android studio

isherwood
  • 58,414
  • 16
  • 114
  • 157
divoto
  • 295
  • 1
  • 11
0

I'm using 0.5.4 Android Studio on Mac OS and not sure about Windows one.

Select [Build] then [Generate Signed APK] from drop down menu.

Please make sure you set android:debuggable to "false" in AndroidManifest.xml.

<application
        android:allowBackup="true"
        android:icon="@drawable/ic_launcher"
        android:label="@string/app_name"
        android:theme="@string/AppTheme"
        android:debuggable="false"
        >

</application>

The guide to generate key store ishere.

If you are unfamiliar with Google Play, please refer here.

Tamura
  • 1,788
  • 1
  • 14
  • 10