Building an app with Eclipse

Discussion and feedback on Construct 2

Post » Fri Apr 27, 2012 11:25 pm

I've followed the 'Getting started' guide from the PhoneGap website. I've completed the 'Hello World' tutorial, I feel as thought I have a basic grip on things. Extremely basic.

However, I haven't found any tutorials that are C2 specific. Can someone take a look at my folder structure below and see anything obviously wrong? The app force closes on launch every time. Where should my media and images folders be etc? Are they in the right place?

Thanks in advance for any help.

ImageImage
Mr. Green - Platform/puzzle game out now!
B
24
S
7
G
1
Posts: 222
Reputation: 3,325

Post » Sat Apr 28, 2012 10:22 am

@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.



B
26
S
5
G
5
Posts: 151
Reputation: 6,279

Post » Sat Apr 28, 2012 6:24 pm

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.
ImageImage
Mr. Green - Platform/puzzle game out now!
B
24
S
7
G
1
Posts: 222
Reputation: 3,325

Post » Sat Apr 28, 2012 10:18 pm

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.
B
54
S
28
G
18
Posts: 1,520
Reputation: 25,000

Post » Sun Apr 29, 2012 1:30 pm

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.
ImageImage
Mr. Green - Platform/puzzle game out now!
B
24
S
7
G
1
Posts: 222
Reputation: 3,325

Post » Sun Apr 29, 2012 3:54 pm

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:
[code]
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");
    }

[/code]
B
54
S
28
G
18
Posts: 1,520
Reputation: 25,000

Post » Sun Apr 29, 2012 4:21 pm

Thank you. Does the above go in the manifest then? Or the main *Activity.java?
ImageImage
Mr. Green - Platform/puzzle game out now!
B
24
S
7
G
1
Posts: 222
Reputation: 3,325

Post » Sun Apr 29, 2012 4:29 pm

In the main activity. You just need to add the getWindow().... line
B
54
S
28
G
18
Posts: 1,520
Reputation: 25,000

Post » Sun Apr 29, 2012 5:21 pm

Thank you. That's sorted it :)
ImageImage
Mr. Green - Platform/puzzle game out now!
B
24
S
7
G
1
Posts: 222
Reputation: 3,325

Post » Sun Apr 29, 2012 6:27 pm

@FredQ, any reason you're not just using PhoneGap Build? It's literally 10x easier and was designed to avoid all this hassle.
Scirra Founder
B
359
S
214
G
72
Posts: 22,951
Reputation: 178,578

Next

Return to Construct 2 General

Who is online

Users browsing this forum: glerikud and 12 guests