Pender Android for Phonegap Cordova

0 favourites
  • OK, I figured out what target meant :). One step 2. Woot!

  • OK, I figured out what target meant :). One step 2. Woot!

    yeAH!

    almost done!

    6. update the example project so it references the library

    android update project --path <path> --library <libloc>

    "<path>" is path to your project

    "<libloc>" is path to your library

    assuming you've made both in the same toplevel directory as the repo, the command would be:

    android update project --path PenderExample --library PenderAndroidLibrary

    for project called PenderExample

    7. next copy over the assets directory to the client project, not the library

    cp -r pender-android/assets PenderExample/assets

    for project called PenderExample

  • OK, got 2 step 5 I believe :)

  • OK, I think I got confused. What path to my project? Is one of my projects that i have complated? In APK?

    Nevermind, I think I got it now. reread all the steps and it's making more sense.

  • finally, we build our project. Now, I haven't a hot clue if this will work: I think ant is distributed with the Android SDK. Let's find out:

    9. open the main activity for the example project in an editor

    look in PenderExample/src and follow the directory tree down to the activity

    open up the activity located in PenderExample/src/com/pender/example/exampleactivity.java

    10. replace everything under the package statement with:

    import android.app.Activity;

    import android.os.Bundle;

    import com.pender.Pender;

    public class PenderActivity extends Activity

    {

        /** Called when the activity is first created. */

        aay@Override

        public void onCreate(Bundle savedInstanceState)

        {

            super.onCreate(savedInstanceState);

            mPender = new Pender(this);

            mPender.init();

        }

        private Pender mPender;    

    }

    11. build your project,from your PenderExample root, run

    ant debug

    12. install on a device

    adb install bin/blah.apk

    where blah.apk will be something like PenderExample-debug.apk

    Alternatively to step 11, you can now import the Library and Example project to eclipse, and let it build and install for you

  • Try Construct 3

    Develop games in your browser. Powerful, performant & highly capable.

    Try Now Construct 3 users don't see these ads
  • OK, I think I got confused. What path to my project? Is one of my projects that i have complated? In APK?

    Nevermind, I think I got it now. reread all the steps and it's making more sense.

    great! Do you have an android device handy?

  • I do, I'm on the final few steps and I'll give it a whirl

  • I do, I'm on the final few steps and I'll give it a whirl

    woot!

  • Ok, I'm up to the build part. I've done everything in the past in Eclipse, what would be the command to build?

    Or should I just use eclipse?

  • Ok, I'm up to the build part. I've done everything in the past in Eclipse, what would be the command to build?

    Or should I just use eclipse?

    Step 11: run ant build

    Step 12: adb install bin/yourapkfile.apk

    running in eclipse is fine, I have to resort to it to debug :)

    Just be warned, eclipse will give you a bunch of bullsh*t errors which aren't actually errors.

    command line is quick, try it out, but open up eclipse and "file->import" the example and library project anyway.

    That way you can step through the code on the native side, if you like.

  • Yeah, I can't seem to find an ant command. Always non recognized command.

  • oh, one thing I should mention:

    there is an irritating issue that took a long time to solve: specify a min-sdk version in the manifest. Otherwise, the onSurfaceChanged function in the renderer misreports the device screen size, and you get smaller canvas. Pender handles this gracefully (no crash, no error) but it won't do the demo justice :)

    --edit-- ok, no ant. It must be *somewhere* on your system, as that's what the Eclipse Android SDK plugin uses as a backend, but let's not worry about that. Just go "file->import" and choose import existing Android project. Import both the ExampleProject and the PenderLibraryProject

    --edit 2--

    for the manifest, open AndroidManifest.xml, and right under the top Manifest tag, put:

        <uses-sdk android:minSdkVersion="8" />

    that'll prevent the canvas shrinkage issue :)

  • OK, importing as existing project doesn't work. I choose the directory (Either one) and it doesn't give me the option to import. No Projects to Import. I can do import existing android code though.

  • OK, importing as existing project doesn't work. I choose the directory (Either one) and it doesn't give me the option to import. I can do import existing android code though.

    yeah, that's the one. Existing project looks for an Eclipse project, which hasn't been created yet. Import android code is the option we want

  • Scratch that, just gonna go with eclipse. So I imported both folders, now what?

    Here is what I have now.

    <img src="http://content.screencast.com/users/ArcadEd/folders/Jing/media/99db3878-b555-4e81-84b8-1bc8eaec75e3/2013-03-20_0032.png" border="0" />

    Top one ACTIVITY_ENTRY_NAME is the Library

    arcaded is the Project

Jump to:
Active Users
There are 1 visitors browsing this topic (0 users and 1 guests)