Need help getting started

Started by Wahagn, October 13, 2013, 04:31:06 PM

Previous topic - Next topic

Wahagn

Hey everyone,

I'm new here and trying to get started with the JCPT - AE engine.
I do not see a sticky anywhere which would help me with that nor is there much information on the wiki pages.
I think I have done everything but I get errors when running.

This is what I have done so far:
- I have downloaded the ADT bundle for Windows (http://developer.android.com/sdk/index.html)
- I have downloaded JPCT- AE
- Made an android project in the eclipse which comes with the bundle
- Created a device to test my apps on in eclipse
- Added the .jar of JPCT-AE in the project propeties -> build path
- Copied the text from the HelloWorld JPCT-AE into the the main activity src file an tried to run the app

resluts (errors) :


The public type HelloWorld must be defined in its own file   MainActivity.java   /Journey/src/com/example/journey   line 37   Java Problem

icon cannot be resolved or is not a field   MainActivity.java   /Journey/src/com/example/journey   line 180   Java Problem


Thanks in advance.



EgonOlsen

You have to edit your AndroidManifest.xml so that it points to the correct package and Activity. This, for example, is the one that comes with the HelloWorld-AE example in the distribution package:


<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
      package="com.threed.jpct.example"
      android:versionCode="1"
      android:versionName="1.0">
     
        <supports-screens
          android:largeScreens="true"
          android:normalScreens="true"
          android:smallScreens="true"
          android:anyDensity="true" />
     
    <application android:icon="@drawable/icon" android:label="@string/app_name">
        <activity android:name=".HelloWorld"
                  android:label="@string/app_name">
            <intent-filter>
                <action android:name="android.intent.action.MAIN" />
                <category android:name="android.intent.category.LAUNCHER" />
            </intent-filter>
        </activity>
    </application>
</manifest>

Wahagn

#2
Hmm .. I have been trying all the time but I'm still getting errors.
I'm quite new to this Android thing and I don't really understand what everything is for

So I don't know which part of this manifest to copy and paste.. Because I have an activity in my application also do I need to delete it and just point to the .java of the example ? How then? And there are two manifest files one is in the bin do I have to change this too? I have no idea what to do exactly. 

Should I maybe do so more research on how android programming works. I know the c++ and java basics and have developed with a c++ engine for the desktop. But I haven't done research into android programming I was hoping to learn with this engine but maybe I should read on general android programming first before I start using an engine?

Wolf17

#3
   Yeah! It is a must.Try some basic stuff first if you are new to java and eclipse. It won't take much time to get through. And regarding Your project setup ..... you do not need to copy paste helloworld code. Just import it in your workspace. i.e:
files->import->android->existing android project->......browse your location for helloworld sample.....

that should do it! :) ;)

Edit: note that you can 't use emulator for opengles2 apps. The helloworld sample would work fine on the emulator but the second sample(helloshader)wont work as it uses gles2.You have to run that on actual device !

EgonOlsen

Quote from: Wolf17 on October 14, 2013, 07:12:01 PM
Edit: note that you can 't use emulator for opengles2 apps. The helloworld sample would work fine on the emulator but the second sample(helloshader)wont work as it uses gles2.You have to run that on actual device !
With newer versions of the SDK, you can run ES 2.0 apps in the emulator. You have to enable hardware support for graphics in the settings of the virtual device. By default, it's off.

Wahagn

Thank you

I am indeed quite new to Java but I have used Eclipse with C++ together with a 3d engine in the past.
Anyway I will look more into Android programming in general.

I think my problem was that I thought I could program something for Android real quick. See I am programming an RPG for the computer with C++. But untill now I have done more mini-games for the RPG than the RPG game itself. And I had a new idea for a mini-game but I thought it would be cool if it was a standalone android app as well, since I haven't programmed anything for android yet. That's why I decided to look into Java programming and this engine.

As for the importing of an existing project. I had already tried that but got 4 errors:


Unable to resolve target 'android-7' HelloWorld-AE Unknown Android Target Problem
The project was not built since its build path is incomplete. Cannot find the class file for java.lang.Object. Fix the build path then try building this project HelloWorld-AE Unknown Java Problem
Unable to resolve target 'android-7' HelloWorld-AE Unknown Android Target Problem
The type java.lang.Object cannot be resolved. It is indirectly referenced from required .class files HelloWorld.java /HelloWorld-AE/src/com/threed/jpct/example line 1 Java Problem

EgonOlsen

Something seems to be broken with your general Eclipse/Android-plugin setup. It seems to be unable to find java.lang.Object, which actually means it can't find the most basic java class in existence.

Wahagn

#7
Aha so it can't find the general Java libraries right?
Is there something wrong with my setup?

Maybe I should do it without this ADT Bundle and set everything up manually?
How did you set it up can you give me advice on what to do exactly?  Anyway why would there be anything wrong with the bundle?

Btw I can program normal java code in JavaEditor (it's a small unknown java IDE with UI ) and run it without any problems. So I think Java is installed right on my device. But maybe eclipse can't find it

EDIT: when I try code that works fine in this JavaEditor, in Eclipse I get a warning en when running  it says on the bottom of the window: "Applet not initialized" and the applet obviously doesn't work

EgonOlsen

I suggest to download the complete SDK package with Eclipse + ADT plugin from here: http://developer.android.com/sdk/index.html

it should have everything included and setup.

Wahagn

Thanks but that's actually exactly what i did. If you have a look at my first post you'll see.


Wolf17

 Check this link -
http://stackoverflow.com/questions/18075343/the-type-java-lang-object-cannot-be-resolved-it-is-indirectly-referenced-from-r
Maybe that would fix it!

QuoteWith newer versions of the SDK, you can run ES 2.0 apps in the emulator. You
have to enable hardware support for graphics in the settings of the virtual
device. By default, it's off.
Thanks for the light egon! :)

Wahagn

Thanks, it did solve some errors I think

Most of the times I have had an error when programming it's been an engine problem that's why I made this beginners mistake of not googling it.

Anyway now I've got this problem
Cannot find the class file for javax.microedition.khronos.opengles.GL10.

I am sure I can figure it out but I will let this rest for a while. It has turned out to be very time consuming. I can better program this game in c++ first and then port it to an Android engine instead of doing it the other way around.