Rajawali Tutorial 1: Basic Setup & a Sphere

Posted by on Aug 24, 2011 in 3D, Android, Rajawali94 comments

This tutorial is now on the Rajawali Wiki: Tutorial 01 – Basic Setup & a Sphere



Tags: , , , ,


94 comments

» Comments RSS Feed
  1. hey, building your project in eclipse works fine, but when i try to run it crashes in the simulator with a throw that opengl es 20 is not available. i used a 2.3.3 vm so this shouldn’t be a problem. i set a breakpoint and turns out that at this point:
    if(info.reqGlEsVersion < 0×20000)
    the reqGlEsVersion is 0 but the gles20 test in the phone emulation work.
    you got any idea what i did wrong.
    i just imported and ran your code, also tried different apis (2.3.3 / 3.0) with no luck.
    thanks

  2. Hey, good question. I’ve actually never tried it in the emulator myself. I always test on handsets and tablets. I’ll have a look into it.

  3. your project not running my emu later i’m using android 2.2 ….

  4. its showing force quit

  5. Yeah, this is a known issue. I always use my phone to run the apps. The emulator used to be really slow.
    I’ll take a look into this. For now just use a handset if possible.
    Cheers
    Dennis

  6. other question. small bugfixes i made (found a null pointer exception that can be checked beforehand) should i send you a diff via email?

  7. Hi,
    Thanks for that. Yes, please send me an email.
    Dennis

  8. Unfortunately, OpenGL ES2.0 is not supported by android emulator (yet). The only option is to test it on a real device.
    (http://developer.android.com/resources/tutorials/opengl/opengl-es20.html)

    I have another issue, with texturing. When I run my app on my phone (Motorola Defy+, Android 2.3, OMAP 3630) textures work without any problem, but when I run it on any tablet with Tegra 2 processor (Lenovo Thinkpad Tablet, Asus Pad Transformer), terturing doesn’t work. Everything else works fine.

    Do you have any idea what is the problem?

    Thanks very much

  9. Hi, I am getting a compile error: import rajawali.math.Number3D;

    I can’t find this anywhere in your sample code. Is that class missing? Thanks!

  10. Hi, i d like to thank you for this excellent engine.. great job!
    i have an issue whit lights. they dont seem to work , no matter what..

    on surface created , i add this:

    mLight = new DirectionalLight(1.0f, 1.0f, 1.0f);
    mLight.setColor(0, 0, 1.0f);
    mLight.setPosition(0.0f, 3.0f, 2);

    and this is my object i want to lightup

    ObjParser parser1 = new ObjParser(mContext.getResources(), mTextureManager, R.raw.plane1);
    parser1.parse();
    plane1 = parser1.getParsedObject().getChildByName(“Plane”);
    addChild(plane1);
    plane1.setTransparent(true);
    plane1.setLight(mLight);
    plane1.addTexture(mTextureManager.addTexture(texture1));
    plane1.setScale(1.0f);

    any suggestions???
    Thanks.. and sorry for my English,,

  11. I am getting the same error on ‘import rajawali.math.Number3D;’ as Will when I download the package directly from github. It looks like the sample code for the tutorial does not use the Number3D class so it works. Is there a separate download for rajawali.math.Number3D?

    Thanks!

  12. @Jeff @Will: this class has been added to the Github repository.

  13. Hi.
    at testing I get this Error:

    UNEXPECTED TOP-LEVEL EXCEPTION:
    java.lang.IllegalArgumentException: already added: LGLES20;
    [2012-04-18 08:08:16 - RajawaliTutorial] Dx at com.android.dx.dex.file.ClassDefsSection.add(ClassDefsSection.java:123)
    [2012-04-18 08:08:16 - RajawaliTutorial] Dx at com.android.dx.dex.file.DexFile.add(DexFile.java:163)
    [2012-04-18 08:08:16 - RajawaliTutorial] Dx at com.android.dx.command.dexer.Main.processClass(Main.java:486)
    [2012-04-18 08:08:16 - RajawaliTutorial] Dx at com.android.dx.command.dexer.Main.processFileBytes(Main.java:455)
    [2012-04-18 08:08:16 - RajawaliTutorial] Dx at com.android.dx.command.dexer.Main.access$400(Main.java:67)
    [2012-04-18 08:08:16 - RajawaliTutorial] Dx at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:394)
    [2012-04-18 08:08:16 - RajawaliTutorial] Dx at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:245)
    [2012-04-18 08:08:16 - RajawaliTutorial] Dx at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:131)
    [2012-04-18 08:08:16 - RajawaliTutorial] Dx at com.android.dx.cf.direct.ClassPathOpener.processDirectory(ClassPathOpener.java:191)
    [2012-04-18 08:08:16 - RajawaliTutorial] Dx at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:123)
    [2012-04-18 08:08:16 - RajawaliTutorial] Dx at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:109)
    [2012-04-18 08:08:16 - RajawaliTutorial] Dx at com.android.dx.command.dexer.Main.processOne(Main.java:418)
    [2012-04-18 08:08:16 - RajawaliTutorial] Dx at com.android.dx.command.dexer.Main.processAllFiles(Main.java:329)
    [2012-04-18 08:08:16 - RajawaliTutorial] Dx at com.android.dx.command.dexer.Main.run(Main.java:206)
    [2012-04-18 08:08:16 - RajawaliTutorial] Dx at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    [2012-04-18 08:08:16 - RajawaliTutorial] Dx at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    [2012-04-18 08:08:16 - RajawaliTutorial] Dx at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    [2012-04-18 08:08:16 - RajawaliTutorial] Dx at java.lang.reflect.Method.invoke(Method.java:616)
    [2012-04-18 08:08:16 - RajawaliTutorial] Dx at com.android.ide.eclipse.adt.internal.build.DexWrapper.run(DexWrapper.java:179)
    [2012-04-18 08:08:16 - RajawaliTutorial] Dx at com.android.ide.eclipse.adt.internal.build.BuildHelper.executeDx(BuildHelper.java:745)
    [2012-04-18 08:08:16 - RajawaliTutorial] Dx at com.android.ide.eclipse.adt.internal.build.builders.PostCompilerBuilder.build(PostCompilerBuilder.java:634)
    [2012-04-18 08:08:16 - RajawaliTutorial] Dx at org.eclipse.core.internal.events.BuildManager$2.run(BuildManager.java:728)
    [2012-04-18 08:08:16 - RajawaliTutorial] Dx at org.eclipse.core.runtime.SafeRunner.run(SafeRunner.java:42)
    [2012-04-18 08:08:16 - RajawaliTutorial] Dx at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:199)
    [2012-04-18 08:08:16 - RajawaliTutorial] Dx at org.eclipse.core.internal.events.BuildManager.basicBuild(BuildManager.java:321)
    [2012-04-18 08:08:16 - RajawaliTutorial] Dx at org.eclipse.core.internal.events.BuildManager.build(BuildManager.java:396)
    [2012-04-18 08:08:16 - RajawaliTutorial] Dx at org.eclipse.core.internal.resources.Project$1.run(Project.java:618)
    [2012-04-18 08:08:16 - RajawaliTutorial] Dx at org.eclipse.core.internal.resources.Workspace.run(Workspace.java:2344)
    [2012-04-18 08:08:16 - RajawaliTutorial] Dx at org.eclipse.core.internal.resources.Project.internalBuild(Project.java:597)
    [2012-04-18 08:08:16 - RajawaliTutorial] Dx at org.eclipse.core.internal.resources.Project.build(Project.java:124)
    [2012-04-18 08:08:16 - RajawaliTutorial] Dx at com.android.ide.eclipse.adt.internal.project.ProjectHelper.doFullIncrementalDebugBuild(ProjectHelper.java:961)
    [2012-04-18 08:08:16 - RajawaliTutorial] Dx at com.android.ide.eclipse.adt.internal.launch.LaunchConfigDelegate.launch(LaunchConfigDelegate.java:146)
    [2012-04-18 08:08:16 - RajawaliTutorial] Dx at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:854)
    [2012-04-18 08:08:16 - RajawaliTutorial] Dx at org.eclipse.debug.internal.core.LaunchConfiguration.launch(LaunchConfiguration.java:703)
    [2012-04-18 08:08:16 - RajawaliTutorial] Dx at org.eclipse.debug.internal.ui.DebugUIPlugin.buildAndLaunch(DebugUIPlugin.java:928)
    [2012-04-18 08:08:16 - RajawaliTutorial] Dx at org.eclipse.debug.internal.ui.DebugUIPlugin$8.run(DebugUIPlugin.java:1132)
    [2012-04-18 08:08:16 - RajawaliTutorial] Dx at org.eclipse.core.internal.jobs.Worker.run(Worker.java:54)
    [2012-04-18 08:08:16 - RajawaliTutorial] Dx 1 error; aborting
    [2012-04-18 08:08:16 - RajawaliTutorial] Conversion to Dalvik format failed with error 1

    what can I do about it?
    Thanks!

  14. Hi Robert,
    What Android version & what device are you using?
    Cheers
    Dennis

  15. I’m using Android 2.2 for the Project and a Lenovo Thinkpad Tablet (Android 3.1) and a HTC Legend (Android 2.3.3) for testing.
    The Error occures before the launch (Project Contains Errors, Please fix …) started.
    The Project Folder shows no Error.

    Thanks!
    Robert

  16. Thanks Robert, I’ll take a look. In the meanwhile you could also download the source to get started.

  17. Hi Robert,
    I figured it out.
    You probably have both the rajawali source folder and the jar file linked.
    When you remove the linked rajawali source folder then the problem should be fixed. (properties > java build path > source).

  18. Hi!

    I’m running this first tutorial, and it was easy and worked smoothly.
    However, when the screen turned off while the sphere rotates, and than turned on and returning to the view, there’s a rendering bug – the texture becomes horizontal stripes, like zebra, some rotating, some standing still.
    I also got this on the logcat:
    05-11 00:33:02.860: E/libEGL(4451): call to OpenGL ES API with no current context (logged once per thread)

  19. ..I’ve meant vertical stripes. sorry

  20. Hi Amir,
    What device are you using & what Android version is it running?

  21. Great works you have here! Its very help me to build my project.

    Oh yes, about the 3D rotation, I have to rotate a sphere based on touch. I can rotate the X axis and Y axis. But I think It’s pretty hard to figure rotation on Z axis.

    So, when I rotate diagonally, It rotates funny. Do your library have rotation based on matrix?

    Currently I’m using this code to rotate the sphere

    mSphere.setRotY(mSphere.getRotY() + angleY);
    mSphere.setRotX(mSphere.getRotX() + angleX);

  22. Hi William,
    It’s quaternion rotation. This tutorial (with source code) might be helpful: http://through-the-interface.typepad.com/through_the_interface/2012/04/creating-a-3d-viewer-for-our-apollonian-service-using-android-part-1.html?utm_source=twitterfeed&utm_medium=twitter&utm_content=AutoCAD.NET+development+programming

  23. I also get the same logcat error like amir

    “call to OpenGL ES API with no current context (logged once per thread)”

    also none of the tutorials were displayed except “Transparent GLSurfaceView” on Galaxy Note – 2.3.6
    but on asus tablet everything works smoothly but the “Fbx Scene Importer”

  24. Ah, that’s interesting. So it’s probably down to the PixelFormat. Let me play around with that. Thanks!

  25. on the contrary thank you for your great work and support :)

  26. I’ve sent you an .apk. Could you test it for me? Thanks!

  27. :( sorry still the same…

  28. Hey, looks like an awesome framework!

    I am having some trouble setting it up though (I am new to Android and Eclipse). What do you mean by “Just extract it in your libs folder”. I don’t seem to have one and I tried creating one in logical places and extracting the zip into them but there a libs folder never shows up when I; “click on the “Add Class Folder…”…”

  29. Is it possible to rotate an object to a custom center point? Now all the rotation are done on local object axles.

  30. Why if I use
    mCamera.setLookAt(0.0f, 1.0f, -25.0f);
    my screen is empty, and if I use
    mCamera.setLookAt(0.01f, 1.0f, -25.0f);
    All is renderer correctly?
    I have made some tests and if x=y=z=0 all is ok, but if x=0 y!=0 z!=0 no render is done. Have I missed something?

  31. Is also possible that changing the RGB components the light color doesn’t change?

    mLight.setColor(1.0f, 1.0f, 1.0f);

    Scuseme for all my dubs but I find many problems because I’m at the begining of OpenGL

    Best regards to everyone

  32. [...] http://www.rozengain.com/blog/2011/08/24/rajawali-tutorial-1-basic-setup-a-sphere/ [...]

  33. You talk about the initScene() method and the onSurfaceCreated() method like they are already there. Are they supposed to be already there or are we supposed to create them? Am I the only one this tutorial hasn’t worked for?

  34. Connor, yes you have to create them.

    Dennis, I did everything in this tutorial exactly verbatum how it says to do it, and my app launches and runs but there is no sphere. It’s like it doesn’t exist. Also if I try to rotate it in onDrawFrame(), I get a null pointer exception, like it was never initialized, even though it was initialized in onSurfaceCreated()… I also noticed that if I add an @Override annotation to the onSurfaceCreated() method, it tells me the method doesn’t exist in the superclass. Any thoughts as to what I may have done wrong? Thanks

  35. Hey guys, thanks for reporting the errors. I’ve updated the tutorial.

    Changes:
    - removed light position. A directional light needs a direction, not a position
    - changed the light’s direction to point towards +z, not -z
    - removed the startRendering() call. This isn’t necessary anymore

    Please give it a try and give me a shout when you encounter any other problems.

  36. Hi Dennis,

    I ended up figuring out my problem above, but are you aware you have a race condition? The line

    mSphere.addTexture(mTextureManager.addTexture(bg));

    will sometimes give a null pointer exception. So I went into RajawaliRenderer and initialized mTextureManager at the class level, and it fixed the problem.

  37. Hi,

    I am getting same exception as Robert:
    UNEXPECTED TOP-LEVEL EXCEPTION:
    java.lang.IllegalArgumentException: already added: LGLES20;

    This seem to be happening with adding rajawalilib.jar and libs directory both to classpath in latest version of SDK (Which in turn is adding all jar files in libs directory again). Any solution?

  38. Hi,
    I am also getting the same error as CD and Robert.
    A solution would be great!

    The error occurs because the Rajawali GLES20 and the android sdk GLES20 classes are conflicting, but i dont know how to solve this as im not very familiar with Eclipse!

    Building for 2.3.3!

    Anyways, thanks for a awesome library! Looking forward to be able to build with it!

  39. im getting the same error as Joey on post 34, hope this gets fixed soon

  40. I spent some time downloading and installing Rajawali. I’ve seen two problems so far:

    1) Can’t build the library myself. If you try to build the library yourself, Eclipse doesn’t want to put it in the app’s apk, doesn’t want to put the .so file you use into the jar, nothing. Not your problem, but anybody who’s getting ClassNotFound errors on startup… this is why. Follow the instructions for adding the lib to your projects EXACTLY.

    2) The initial tutorial was giving me a black sphere on black background! Luckily, I can see the different blacks if I look at my tablet sideways, so I could see the sphere. Turned out the problem was caused because BitmapFactory.decodeResource() really loves to resize bitmaps randomly. Putting the bitmap in different drawable-Xdpi folders did not help. What worked was to pass in an Options telling BF.dR() to quit resizing the input, thus:

    Options op = new Options();
    op.inScaled = false;
    Bitmap bg = BitmapFactory.decodeResource(mContext.getResources(),
    R.drawable.browntexture, op);

    You might want to consider adding a new TextureManager.addTexture() entry point with the signature,

    public TextureInfo addTexture(Context context, int resourceId);

    which can then load the bitmap itself with the SRSLY, DO NOT RESIZE flag set. Besides, I suspect that this will be the most common use case for addTexture()…

    Anyway, the lib looks promising. I’ll keep poking at it :)

  41. I want to try out your first tutorial, but it doesn’t work and I don’t know why? I tried out everything…
    I made everything how you wrote it. You are my last hope so I post here 2 links to the RajawaliTutorial1Activity
    https://dl.dropbox.com/u/6341335/RajawaliTutorial1Activity.java

    and the RajawaliTutorial1Renderer
    https://dl.dropbox.com/u/6341335/RajawaliTutorial1Renderer.java

    Please take a look on my Code and tell me what is wrong.
    Thanks Maiki

  42. Hi there, I’m quite new to this android development thing.

    The tutorial is good but unfortunately, its too confusing as you did not mention which set of codes should be designated to which window(e.g. RajawaliTutorial1Activity.java or RajawaliTutorial1Renderer.java).

    It would be much appreciated of you can provide a view of what the final codes would look like on the relevant window of codes. Thank you.

  43. Oh wait, sorry. My mistake!
    the final codes are provided at the end of this tutorial, sorry :P

  44. Hi there, its me again…
    I’ve copied exactly all the codes, methods, what ever you call it.
    In eclipse, everything seems fine.
    But when I run on my device, the app just crashes itself

  45. Hi there, this framework looks promising… I just can’t get it to work, it seems to be some sort of error in the linkage to the library:

    Exception Ljava/lang/UnsatisfiedLinkError; thrown while initializing Lrajawali/util/BufferUtil;
    threadid=11: thread exiting with uncaught exception (group=0×41391300)
    FATAL EXCEPTION: GLThread 3279
    java.lang.ExceptionInInitializerError
    at rajawali.Geometry3D.setVertices(Geometry3D.java:494)
    at rajawali.Geometry3D.setVertices(Geometry3D.java:483)
    at rajawali.Geometry3D.setData(Geometry3D.java:259)
    at rajawali.BaseObject3D.setData(BaseObject3D.java:140)
    at rajawali.BaseObject3D.setData(BaseObject3D.java:135)
    at rajawali.primitives.Sphere.init(Sphere.java:96)
    at rajawali.primitives.Sphere.(Sphere.java:17)
    at com.zebarnabe.terrainengine.Renderer.onSurfaceCreated(Renderer.java:35)
    at android.opengl.GLSurfaceView$GLThread.guardedRun(GLSurfaceView.java:1494)
    at android.opengl.GLSurfaceView$GLThread.run(GLSurfaceView.java:1240)
    Caused by: java.lang.UnsatisfiedLinkError: Couldn’t load bufferutil: findLibrary returned null
    at java.lang.Runtime.loadLibrary(Runtime.java:365)
    at java.lang.System.loadLibrary(System.java:535)
    at rajawali.util.BufferUtil.(BufferUtil.java:16)
    … 10 more

    I’m running Android 4.1 on a Nexus S (and compiling for 4.0.4, though I doubt it matters)

    I’ll probably implement everything from scratch, as that’s the way to go for me when stuff done by third parties is giving me headaches…

    Anyway, good luck, as I said, this library/framework looks promising…

  46. Hi,
    i try this tutorial but i have some error:
    The method initLoader() is undefined for the type RajawaliTutorial1Activity

    what i have to do to fix it?

    thanks

  47. @zebarnabe I got the same error. Try to download the source of whole project and put ndk libraries from this project into yours project -> libs folder. Worked for me.

  48. Hello Dennis,
    Nice library. Just been trying to get it to work in the emulator and thought I would share how I made it work.

    To test with the android emulator from eclipse you need to -

    -Download the source code and import the project with ‘Exisiting Android Code Into Workspace’

    -Update the line : “if(info.reqGlEsVersion < 0×20000)" in RajawaliActivity to : "if(info.reqGlEsVersion Android -> Library -> Add

    There is an error in the original Android source code that makes the normal test not work correctly with the emulator. By specifying Build.FINGERPRINT.startsWith(“generic”) fixes this problem.
    I’m not sure if it is good to leave this code in your final versions, but for testing with the emulator its an easy fix.

  49. Sorry, not sure what happened to the last post…but here are the missing steps:

    -Update the line : “if(info.reqGlEsVersion < 0×20000)" in RajawaliActivity to : "if(info.reqGlEsVersion Android -> Library -> Add

  50. Ok so this thing does not seem to be working and my posts are not correct.

    Dennis, if you can see the code maybe you can fix it? If not and you have access to my email address, let me know if you want the fix.

  51. Hi,
    You can also set checkOpenGLVersion to false, just before you call onCreate() in the Activity.
    I’ll modify your comment.
    Thanks!
    Dennis

  52. Using the emulator 4.1!!! in this u can run OpenGL ES 2.0 :P

  53. It is still painfully slow though. I’ve just tried it and even a simple spinning cube is running at about 3 fps or so. Does anyone know if there’s a way to speed up OpenGL ES 2.0 in the Android emulator??

  54. Dennis,

    Ok so checkOpenGLVersion to false is a much much easier solution. Can you tell that I’m a newbie? ;) Feel free to delete my posts.
    Sorry about that all.

    Thanks for the response Dennis.

  55. Hi, Dennis! Great job! My question is this: my project on HTC One S (4.0) and Samsung Galaxy Note 10.1 Tab(4.0.3) works fine, but on the Samsung Galaxy S GT-I9000 (2.2) i have black screen, though your examples work fine. :-D Could you give me advice what to do? IDE Eclipse. Thank you!

  56. Hey Dennis,

    This is an awesome way to implement OGL. I am totally new to Android dev, and I’m finding this very familiar and robust. I have been trying without success to get my MTL to display on my loaded model. My OBJ loads well, even displays on screen and complies with the animation I have set up. No matter what I try I can’t get the MTL to be used or respected. I noticed this morning in LogCat the following entry:

    10-11 10:39:12.863: E/Rajawali(1867): [rajawali.parser.ObjParser.MaterialLib] Could not find material library file (.mtl).

    Any thoughts? Apologies in advance if this is just newbness.

    Thanks!

    David

  57. Actually I found the problem in another thread on this site. It has to do with Maya’s method of exporting OBJs and MTL files.

  58. Doesn´t work. Nice shit

  59. :( I want to run and see how the basic 3d sphere look like, I copy and paste the example code (RajawaliExampleActivity.java, RajawaliBasicExampleActivity.java, RajawaliBasicExampleRenderer.java) however it waste me a lot of day for getting same error (application forced closing).

    :) Anyway i found out a simple solution:
    Step 1, Make SURE in main class, put setRenderer(MySimpleRendererClass)
    Step 2, In renderer class, put these code inside initScene() (ignore the rest methods other than initScene and constructor)
    It works =) thanks to rajawali library

    //initScene() code to display 3d sphere
    mCamera.setZ(-4.2f);
    BaseObject3D mSphere = new Sphere(1, 12, 12);
    DirectionalLight mLight = new DirectionalLight(0.1f, 0.2f, 1.0f);
    mLight.setPower(1.5f);
    mSphere.addLight(mLight);
    DiffuseMaterial material = new DiffuseMaterial();
    mSphere.setMaterial(material);
    Bitmap bg = BitmapFactory.decodeResource(mContext.getResources(), R.drawable.android);
    mSphere.addTexture(mTextureManager.addTexture(bg));
    addChild(mSphere);

  60. hi i followed all steps in the tutorial but i cant see any object and my application forced to close. Please englighten me regarding this matter.

  61. hi, i cannot download
    https://github.com/MasDennis/Rajawali/raw/master/build/rajawalilib.zip
    and the following message appears
    <>
    Can i get some help?

  62. Hello!
    I am trying to download the rajawali library (jar file) from https://github.com/MasDennis/Rajawali/raw/master/build/rajawalilib.zip but something is going wrong. Actually, the following message appears: “Unfortunately there doesn’t seem to be anything here / 404 This is not the page you are looking for”.
    Can anyone help me in order to download the jar file??

    Thanks in advance,
    Andrew

  63. Those of you having trouble with the zip, it recently got deleted. Please use a library reference instead:
    https://github.com/MasDennis/Rajawali#using-rajawali

  64. I’m having trouble following the tutorial with the updated reference now because eclipse complains that RajawaliActivity is deprecated. Any suggestions?

  65. Hi,
    I have been using min3d earlier in my augmented app and now planning to use Rajawali. My app is on Android , for markerless augmented reality. I have seen your sample application “RajawaliTransparentSurfaceActivity”. I would like to overlay live camera video steam on the “monkey_ser” 3d object. Specifically using Opencv.
    Any pointers would be appreciated.

    Regards
    Imran

  66. Hint for newcomers to this tutorial:

    Using @Suppress Warnings(“deprecation”) here above the class declaration:

    @SuppressWarnings(“deprecation”)
    public class RajaTutorial extends RajawaliActivity {

    Will let you continue on with this tutorial as planned.

  67. Any chance to get the Jar back?
    Eclipse seems to truncate files from the source code when importing.

  68. Hi admin,

    Currently i’m exploring your framework source, and features are jaw droping ! ,thanks for the excelent work.I would like to know whether the native source for libbufferutils.so ,and libfix-GLES20.so is available ?. i looked into trunk , but i’m unable to find it out ,any pointers ?

    Thanks,

  69. Hi,
    I tried install the framework. But I don’t know how I install it. I tried download the Sources from GIT and then added a library reference to Rajawa. What is wrong?

    Thanks

  70. Dennis, please update at least the first tutorial.

  71. I tested on next PC:

    [2013-01-02 15:32:26 - RajawaliTutorial1] Found 2 versions of android-support-v4.jar in the dependency list,
    [2013-01-02 15:32:26 - RajawaliTutorial1] but not all the versions are identical (check is based on SHA-1 only at this time).
    [2013-01-02 15:32:26 - RajawaliTutorial1] All versions of the libraries must be the same at this time.
    [2013-01-02 15:32:26 - RajawaliTutorial1] Versions found are:
    [2013-01-02 15:32:26 - RajawaliTutorial1] Path: C:\Users\Nicki\git\Rajawali\libs\android-support-v4.jar
    [2013-01-02 15:32:26 - RajawaliTutorial1] Length: 337562
    [2013-01-02 15:32:26 - RajawaliTutorial1] SHA-1: 27c24d26e4c5d57976e6926367985548678e913c
    [2013-01-02 15:32:26 - RajawaliTutorial1] Path: C:\Users\Nicki\workspace_android\RajawaliTutorial1\libs\android-support-v4.jar
    [2013-01-02 15:32:26 - RajawaliTutorial1] Length: 385685
    [2013-01-02 15:32:26 - RajawaliTutorial1] SHA-1: 48c94ae70fa65718b382098237806a5909bb096e
    [2013-01-02 15:32:26 - RajawaliTutorial1] Jar mismatch! Fix your dependencies

    What is wrong? Can anyone help?

  72. Nicki, you need to replace your “android-support-v4.jar”

    \git\Rajawali\libs\android-support-v4.jar
    with this one
    \RajawaliTutorial1\libs\android-support-v4.jar

    and don’t forget to close Eclipse before doing that.

  73. Thank you for your reply. But it didn’t work. Now I have downloaded the examples from:
    https://github.com/MasDennis/RajawaliExamples

    But the same problems. I have make a screenshot:
    http://www.dengao.lima-city.de/pic/error.PNG

  74. Hi Nicki,

    Nothing is required, just delete android-support-v4.jar from your project.

  75. Nicki, it another problem already =)
    I found only one solution of this problem.
    You need add this line @SuppressWarnings(“deprecation”) example:


    @SuppressWarnings(“deprecation”)
    public class RajawaliExampleActivity extends RajawaliActivity {
    private ImageView mLoaderGraphic;

    Or you can use Quick Fix in Eclipse instead manually editing.
    http://goo.gl/mfGs7

    If you need I can upload my full working source code of Rajawali Tutorial 1 and you can compare it.

  76. I am not able to download your library please help me.

  77. @Parikshit Singh Tomar,
    https://github.com/MasDennis/Rajawali#using-rajawali

  78. Importing the project only gives:

    The method setOffsetNotificationsEnabled(boolean) is undefined for the type WallpaperService.Engine Wallpaper.java /Rajawali-master/src/rajawali/wallpaper line 312

  79. Your tutorial is a little confused. The tutorial is different from the full source code attached.
    With the full source code i have some problems with different methods:

    ((RajawaliExampleActivity) mContext).showLoader();
    ((RajawaliExampleActivity) mContext).hideLoader();
    ….showLoader() and hideLoader()are undefined for the RajawaliExampleActivity class.

    public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    mRenderer = new RajawaliBasicExampleRenderer(this);
    mRenderer.setSurfaceView(mSurfaceView);
    super.setRenderer(mRenderer);
    initLoader();
    }
    initLoader()is undefined for the RajawaliBasicExampleActivity class.

    So, how can I solve them?
    Please help me.
    Thanks!

  80. Maybe the problem is that the RajawaliActivity class is deprecated…

  81. Moreover, the advised process for installing the framework doesn’t work for me. So i installed Rajawali converting the project in .jar file and then i took it in my project by properties/Java Build Path/Libraries/Add external JARs…
    …And then Rajawali is imported.

  82. If I don’t fix this issue, I will never use Rajawali.
    So, is there anyone who can help me?

  83. Hi Sandro,
    Please post your question here: https://github.com/MasDennis/Rajawali/issues?state=open

  84. hii…. From where to get rajawali lib file required here.. Tell me please

  85. Link above given to extract the lib file is not working.

  86. The default demo from Unity 3.4, this third person top-down shooter is well packed with gameplay. The player infiltrates a building filled with not very hap… More Information

  87. just downloaded new repo from github, link master lib. all compiling but on start i have exeption

    Could not find class ‘com.monyetmabuk.rajawali.tutorials.RajawaliMD2Activity’, referenced from method com.monyetmabuk.rajawali.tutorials.RajawaliExamplesActivity.

    in RajawaliExamplesActivity
    why?

  88. First tutorial and the source code …. are just so confusing ? can any one make it clear to us? the code does not match ….. and i am not able to understand why i don’t get my public void onSurfaceCreated(GL10 gl, EGLConfig config) {} neither the public void onDrawFrame(GL10 glUnused) {} something is just wrong here… please help.

  89. more over i cant download rajawalilib.jar
    this link aint working : https://github.com/MasDennis/Rajawali/raw/master/build/rajawalilib.zip

    Please Some one HELP !

  90. ((RajawaliExampleActivity) mContext).showLoader();
    ((RajawaliExampleActivity) mContext).hideLoader();
    ….showLoader() and hideLoader()are undefined for the RajawaliExampleActivity class.

    public void onCreate(Bundle savedInstanceState) {
    super.onCreate(savedInstanceState);
    mRenderer = new RajawaliBasicExampleRenderer(this);
    mRenderer.setSurfaceView(mSurfaceView);
    super.setRenderer(mRenderer);
    initLoader();
    }
    initLoader()is undefined for the RajawaliBasicExampleActivity class.

    So, how can I solve them?
    Please help me.
    Thanks!

  91. Hello, I had the same problem. Try to import Rajawali and RajawaliExamples libraries in this way…It will work!

    https://github.com/MasDennis/Rajawali/wiki/Importing-Rajawali-and-RajawaliExamples

  92. and the discussion…
    https://github.com/MasDennis/Rajawali/issues/332

  93. Hi, i am a newbie on the Rajawali framework developer.
    I think it’s great, it work really good and provides a good abstraction layer on OGL.

    Currently i am developin a live wallpaper using the SurfaceTexture to display a video on a Plane primitive object.

    It’s working perfect using the Rajawali VideoMaterial tutorial:

    http://www.rozengain.com/blog/2012/08/08/rajawali-tutorial-25-video-material/

    The problem is that it only works ok by using it on an Activity, but it does not work by using it on a live wallpaper.

    On the activity i can see the video and the audio.
    On the live wallpaper only the first frame of the video is played back, and the audio is fully played.

    The debug information is not very useful (i think).

    03-01 19:17:24.779: W/SurfaceTexture(1840): [unnamed-1840-2] updateTexImage: clearing GL error: 0×502
    03-01 19:17:24.789: E/Adreno200-ES20(1840): : GL_INVALID_OPERATION
    03-01 19:17:26.949: I/AwesomePlayer(119): we’re much too late (0.54 secs), video skipping ahead
    03-01 19:17:27.009: E/SampleTable(119): tried to find a sync frame after the last one: 1
    03-01 19:17:33.369: I/AudioHardware(119): set device to SND_DEVICE_SPEAKER device_id=0
    03-01 19:17:33.369: I/AudioHardware(119): disabling post proc features with mask 0×0000

    Thx in advance!!!

  94. If RajawaliActivity is deprecated then does anyone know the proper way to write the code in this tutorial?

Leave a comment