Building an app with Eclipse

Forum Home Forum Home > Construct 2 General > Construct 2 general
 Post Reply Post Reply Page  12>
Author
2,241 Rep
Post Options Post Options   Quote FredQ Quote  Post ReplyReply Direct Link To This Post Topic: Building an app with Eclipse
    Posted: 29 Apr 2012 at 11:06pm
@Ashley no reason in particular, just playing around with it out of curiosity. I saw the PhoneGap Low Latency Audio tutorial and thought I'd give it a go. I also like the idea of being able to use the phones hardware such as the camera or the torch which isn't currently possible direct through C2 so the phonegap plugins were appealing.
Back to Top

Scirra Developer
81,207 Rep
Post Options Post Options   Quote Ashley Quote  Post ReplyReply Direct Link To This Post Posted: 29 Apr 2012 at 6:27pm
@FredQ, any reason you're not just using PhoneGap Build? It's literally 10x easier and was designed to avoid all this hassle.
Back to Top
2,241 Rep
Post Options Post Options   Quote FredQ Quote  Post ReplyReply Direct Link To This Post Posted: 29 Apr 2012 at 5:21pm
Thank you. That's sorted it :)
Back to Top
9,831 Rep
Post Options Post Options   Quote ramones Quote  Post ReplyReply Direct Link To This Post Posted: 29 Apr 2012 at 4:29pm
In the main activity. You just need to add the getWindow().... line
Back to Top
2,241 Rep
Post Options Post Options   Quote FredQ Quote  Post ReplyReply Direct Link To This Post Posted: 29 Apr 2012 at 4:21pm
Thank you. Does the above go in the manifest then? Or the main *Activity.java?
Back to Top
9,831 Rep
Post Options Post Options   Quote ramones Quote  Post ReplyReply Direct Link To This Post Posted: 29 Apr 2012 at 3:54pm
Seems the config.xml is only for the phonegap build service. You need to put the icon/orientation/permissions/etc. info from config.xml into AndroidManifest.xml.

And for fullscreen:

public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        getWindow().setFlags(
                  WindowManager.LayoutParams.FLAG_FULLSCREEN,
                  WindowManager.LayoutParams.FLAG_FULLSCREEN |
                  WindowManager.LayoutParams.FLAG_FORCE_NOT_FULLSCREEN);
        super.loadUrl("file:///android_asset/www/index.html");
    }

Back to Top
2,241 Rep
Post Options Post Options   Quote FredQ Quote  Post ReplyReply Direct Link To This Post Posted: 29 Apr 2012 at 1:30pm
Done it, it's now working. Thanks!

One problem though, the status bar is showing now. I think it's ignoring my config.xml because if I auto-build using the phonegap website then the fullscreen mode (no status bar) works. Just not through eclipse.
Back to Top
9,831 Rep
Post Options Post Options   Quote ramones Quote  Post ReplyReply Direct Link To This Post Posted: 28 Apr 2012 at 10:18pm
I just set this up now. One problem I ran into was that the index.html file was looking for 'phonegap.js' and the downloaded file is called 'cordova-1.7.0rc1.js' so I had to rename it.
Back to Top
2,241 Rep
Post Options Post Options   Quote FredQ Quote  Post ReplyReply Direct Link To This Post Posted: 28 Apr 2012 at 6:24pm
Thanks will try later :) Does anybody else have anything to add on the matter? I think it would be good to get a guide together that is construct 2 focused.
Back to Top
3,255 Rep
Post Options Post Options   Quote simwhi Quote  Post ReplyReply Direct Link To This Post Posted: 28 Apr 2012 at 10:22am
@FredQ.

Your media and images folders are in the correct place. However, your libs folder should be moved up to the same level as the assets folder. This is how my project is set up. I'm using cordova-1.6.1 by the way.

Within the res folder I have an xml folder. Place the config.xml file there.

I hope this helps you.



Back to Top
 Post Reply Post Reply Page  12>

Forum Jump Forum Permissions View Drop Down