Author Topic: Need help getting started  (Read 3965 times)

Offline Wahagn

  • byte
  • *
  • Posts: 6
    • View Profile
Need help getting started
« on: October 13, 2013, 04:31:06 pm »
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.


« Last Edit: October 13, 2013, 04:33:20 pm by Wahagn »

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Need help getting started
« Reply #1 on: October 13, 2013, 08:03:52 pm »
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:

Code: [Select]
<?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>

Offline Wahagn

  • byte
  • *
  • Posts: 6
    • View Profile
Re: Need help getting started
« Reply #2 on: October 14, 2013, 05:24:43 pm »
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?
« Last Edit: October 14, 2013, 06:03:28 pm by Wahagn »

Offline Wolf17

  • int
  • **
  • Posts: 77
    • View Profile
Re: Need help getting started
« Reply #3 on: October 14, 2013, 07:12:01 pm »
   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 !
« Last Edit: October 14, 2013, 07:36:52 pm by Wolf17 »

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Need help getting started
« Reply #4 on: October 14, 2013, 08:16:15 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.

Offline Wahagn

  • byte
  • *
  • Posts: 6
    • View Profile
Re: Need help getting started
« Reply #5 on: October 14, 2013, 08:21:26 pm »
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:

Code: [Select]
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

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Need help getting started
« Reply #6 on: October 14, 2013, 08:46:27 pm »
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.

Offline Wahagn

  • byte
  • *
  • Posts: 6
    • View Profile
Re: Need help getting started
« Reply #7 on: October 14, 2013, 09:38:00 pm »
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
« Last Edit: October 14, 2013, 09:43:16 pm by Wahagn »

Offline EgonOlsen

  • Administrator
  • quad
  • *****
  • Posts: 12295
    • View Profile
    • http://www.jpct.net
Re: Need help getting started
« Reply #8 on: October 14, 2013, 09:53:24 pm »
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.

Offline Wahagn

  • byte
  • *
  • Posts: 6
    • View Profile
Re: Need help getting started
« Reply #9 on: October 14, 2013, 11:42:21 pm »
Thanks but that's actually exactly what i did. If you have a look at my first post you'll see.


Offline Wolf17

  • int
  • **
  • Posts: 77
    • View Profile
Re: Need help getting started
« Reply #10 on: October 15, 2013, 12:43:06 pm »
 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!

 
Quote
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.
Thanks for the light egon! :)

Offline Wahagn

  • byte
  • *
  • Posts: 6
    • View Profile
Re: Need help getting started
« Reply #11 on: October 15, 2013, 04:42:21 pm »
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
Code: [Select]
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.