Android :: Testing OpenGL Rendering In Java Outside?
Aug 30, 2009
I would like to write OpenGL classes and test them in java outside of an Android device or emulator, and then use these in the Android.
Has anybody done this?: If so, are there JOGL implementations that are directly compatible?
I tried doing this on Windows using JOGL and writing wrappers, etc, but it turned out to be a real mess. I finally gave up when I didn't know how to get a GLU instance for a frustrum call.
View 4 Replies
Apr 27, 2009
I'm trying to compare the difference in speed between software and hardware graphics rendering. I have 2 apps right now - one written with only java/android 2D APIs, and one written with openGL calls...
View 6 Replies
View Related
Oct 27, 2009
From the adb log of my G1's boot time, it shows "requestGPU returned -1", among other stuff. Does this mean that my OpenGL app is being rendered using software? BTW, I see the same messages on Hero as well.
------------------------------------------ log begin ------------------------------------------
I/SurfaceFlinger( 81): SurfaceFlinger is starting I/SurfaceFlinger( 81): SurfaceFlinger's main thread ready to run. Initializing graphics H/W... D/SurfaceFlinger( 81): pid 81 requesting gpu core (owner = -1) W/SurfaceFlinger( 81): couldn't grant gpu core to pid 81 D/EGL ( 81): requestGPU returned -1 E/libEGL ( 81): h/w accelerated eglGetDisplay() failed (EGL_SUCCESS) I/SurfaceFlinger( 81): EGL informations: I/SurfaceFlinger( 81): # of configs : 6 I/SurfaceFlinger( 81): vendor : Android I/SurfaceFlinger( 81): version : 1.31 Android META-EGL I/SurfaceFlinger( 81): extensions: I/SurfaceFlinger( 81): Client API: OpenGL ES I/EGLDisplaySurface( 81): using (fd=19) I/EGLDisplaySurface( 81): .......
View 2 Replies
View Related
Jul 16, 2009
I've created a simple OpenGL app and created a rendering class which implements GLSurfaceView.Renderer. All it does is draw 100 triangles (NUM_OBJECTS = 100) on the screen and move them about, bouncing off the edges. The projection is glOrtho2D and there is no z-buffer. I'm running this on a G1 with continuous redraw enabled.
Here is the onDrawFrame method:
CODE:....................
View 23 Replies
View Related
Jul 24, 2010
I would like to be able to use the OpenGL API from both Java and C (via NDK).
In Java, there is a GL object passed, which has all GL methods on it.
In C, you just talk to the native library.
In a single onDrawFrame callback (for which Java is passed a GL), can I use methods on the GL object, and also call NDK methods which access the openGL library?
In other words, is the GL object just a wrapper for the same instance of the native library?
View 3 Replies
View Related
Mar 2, 2010
I want to write an application for Android devices that interacts with the surface and I need to be able to have the Android device display Microsoft Surface Identity Tags. I was able to create a class to draw the Byte Tags using the Byte Tag documentation but all I could find for the Identity Tags was this MSDN documentation and it doesn't include any information about how to draw them. Can anyone point me to some documentation on how to generate Identity Tags programmatically?
View 2 Replies
View Related
Nov 2, 2010
I cannot figure out why I can't get this method to enter the if statement.
CODE:.........
Note that the log and debug mode shows that "start = 0"
I also tried
if (start == 0l) {
if (start == 0L) {
What the heck am I missing here? Does 0 != 0?
I'm developing in Eclipse with Java for Android. Thanks.
@methodin - no sorry, that does not work.
@Aioobe - I have a breakpoint under the IF statement, that never gets made.
Here is the actual code I'm running since you've asked.
CODE:................
View 4 Replies
View Related
Oct 20, 2009
i get following error, if i test my app on a real android phone. On the emulator, my app works fine.
W/dalvikvm( 321): threadid=3: thread exiting with uncaught exception (group=0x4000fe70) E/AndroidRuntime( 321): Uncaught handler: thread main exiting due to uncaught exception E/AndroidRuntime( 321): java.lang.VerifyError: de.stefandahmen.android.TourList E/AndroidRuntime( 321): at java.lang.Class.newInstanceImpl (Native Method) E/AndroidRuntime( 321): at java.lang.Class.newInstance (Class.java:1472) E/AndroidRuntime( 321): at android.app.Instrumentation.newActivity(Instrumentation.java:1097) E/AndroidRuntime( 321):.....
View 3 Replies
View Related
Aug 25, 2010
I am learning Android development, specifically to eventually do OpengL 2.0 ES on it. So far I have read that the NDK supports Opengl 2.0 ES. However, is there also a Java API for it? If there is a Java API for it, which one is recommended? I know both C++ and Java, so it is not a big deal if I have to use the NDK, but I would prefer to work only in Java if possible and without a big performance hit.
View 1 Replies
View Related
Mar 12, 2010
i started a small project over at google code that provides you with bindings for OpenGL ES 2.0 in Java. I started just a couple of hours ago so it's not finished yet. The project includes the original GLSurfaceView plus all the helper classes from the latest Eclair build as well as a modified version of GLJNIView from the NDK samples which is now a fully functional GLSurfaceView subclass called GLSurfaceView20.
OpenGL ES 1.x and 2.0 are exclusive so you have to first check wheter GL ES 2.0 is supported. You can check this via the following method:
private boolean checkGL20Support( Context context ) { EGL10 egl = (EGL10) EGLContext.getEGL(); EGLDisplay display = egl.eglGetDisplay(EGL10.EGL_DEFAULT_DISPLAY);
int[] version = new int[2]; egl.eglInitialize(display, version);...................
View 6 Replies
View Related
Oct 24, 2009
I plan on writing a Java 3D game that will work both on PC and Android. Unfortunately it looks like there is no common OpenGL API for both platforms.Do the APIs differ significantly? Is there a way I could use the same 3D code in both versions? Is it a good idea?
View 3 Replies
View Related
Feb 24, 2010
I wrote a simplest test based on android.test.ActivityInstrumentationTestCase2.
CODE:..............
View 2 Replies
View Related
Feb 25, 2009
Single Threaded OpenGL game ! (check bottom, you can download and use the helper class) Lighting disabled ! Depth Buffer disabled ! Culling enabled ! Textures disabled !
Just 176 integers (x,y values only) making 88 vertexes along with 132 index numbers making "44 triangles only"
Framerates I get is
with GL_BLENDING disabled - 145 fps approx only! enabled - 110 fps approx only!
I have the screenshot of exact code in the draw function here.. just 2 damn lines ! I have hidden only the comments.. click here to see it http://prasna991.googlepages.com/drawframe.png
variable details in the 2 lines of code =========================== ipts = 176 elements (only x and y for each vertex) totallinetriangles * 3 = 176 lineindexes = 132 elements - type "short"
Here is the screenshot of output drawing and how it will look like http://prasna991.googlepages.com/screen.png
OpenGL single threaded Initialization Helper ================================ Here is my OpenGL helper class.. makes the OpenGL initialization for newbies a cakewalk http://prasna991.googlepages.com/OpenGLHelperclass.txt
I tested by rendering on the touch event only.. frame rate drops only when u touch and drag and here I have just tested by tapping and releasing gently on the emulator and on the device
Is this the device limitations ? So graphics is actually a lot lot lot slower than on iPhone ?
View 8 Replies
View Related
Apr 16, 2009
I've been exploring the Android test package and I'm very confused on how to implement functional testing for endpoint-to-endpoint.
Consider the example below, I have 4 activities: 1. A Contact List Activity 2. A View Contact Activity 3. An Add/Edit Contact Activity 4. A Sync Contact List activity
I want to automate a few tests that will go through multiple test cases simulating a user experience: From launching the application, to selecting 'Add contact;' opening the add contact activity, entering data, saving it, going back to the list activity, and verifying the new contact was saved properly.
As I understand it, ActivityInstrumentationTestCase<T extends Activity> and ActivityUnitTestCase<T extends Activity>, are only useful for testing single activity functionality.
But what if I need to switch between 2 or more activities inside a single functional test case?
View 5 Replies
View Related
Nov 10, 2010
I wrote a program in Android for setting different kinds of images as my background image, but it is not working with svg files. I am not getting any errors, it is not displaying any image and I'm getting a blank screen in my emulator when using svg files. Can any one suggest how to read and display svg files in Android with some code? Or should I convert xml code?
View 1 Replies
View Related
Sep 10, 2010
There's a decent amount of information out there on the Activity lifecycle. But I'm surprised how difficult it is to find a comprehensive description of the rendering lifecycle. By that I mean the order and rules by which a tree of nested activities, views, and drawables get to be sized and drawn to the screen, and the points at which a developer can modify rendering behavior.
View 1 Replies
View Related
May 13, 2010
I need to find out how big a view will be after attaching it to its parent.I have overridden this method: Do you think there is a way to get this information before rendering the view itself? Basically I need to know the actually size before attaching it and not attach the view at all if it would take more certain amount of space. Code...
View 2 Replies
View Related
Jul 15, 2009
Can anyone help me to understand how WebView decided which content it can render and which it can't? For example I am inside a webview select a link and if the link sends an XML file I want my application to handle to data instead of WebView, Is this possible?
View 4 Replies
View Related
Jun 22, 2010
I have an ImageView object that I'm setting the android:src="@drawable/some_xml_file" instead of a standard png and it seems to not always render the drawable, as you can see in the first row here (it also happens intermittently in other rows as well):
I've tried setting the src & the background property but they both have the same effect. the source code from my list view row item is this:
CODE:...............
Then my res/drawable/action_box.xml is this:
CODE:................
View 1 Replies
View Related
Apr 14, 2010
I need to render video on android. I got sw decoder which decodes stream to YUV or RGB with very reasonable cpu usage, but so far haven't found a nice way how to render frames.
I have tried 3 methods so far: 1) using opengl from native code: * create a texture of type GL_TEXTURE_2D * set coordinates to fill full opengl rendering area * to render a frame update the texture with glTexSubImage2D or glTexImage2D function (more or less the same method that is used in vlc media player)
With this method the performance is most terrible.. VGA rendering @5..7FPS uses up 100% of nexus one cpu!
2) rendering with canvas function Canvas.drawBitmap(int[] colors, int offset, int stride, int x, int y, int width, int height, boolean hasAlpha, Paint paint)Was hoping to use this via JNI. First i just made a simple perfo test: * colors array was initialized in java code * then I just called mSurfaceHolder.lockCanvas(); canvas.drawBitmap(colors, ... ); mSurfaceHolder.unlockCanvasAndPost(canvas); in sequence
Perfo is better than with opengl - VGA@30FPS uses up 40% of nexus one- s cpu...
3) Rendering with canvas function Canvas.drawBitmap(Bitmap bitmap, float left, float top, Paint paint), while updating bitmap in native code * in java code i do:
CODE:.......
To get native pointer to memory (need to link to native android library libskia.so to get these functions) * copy or decode the video frame to this memory
With this method i get only 10% cpu usage when doing VGA@30fps... but lets face it - its a hack which may break in future. Am I missing something or there really isn't any better way to render video? for example some opengl extension function etc..?
View 2 Replies
View Related
Mar 16, 2010
I'm putting together a simple test made up of two tutorials available online for OpenGL ES on Android. This is really just so that I can learn about the basics of OpenGL ES to better understand how I have to design my program.
Right now, when it tries to render, the mouse movement effect works, but I get no square drawn on the screen.
Here are the two source files I'm dealing with:
CODE:.......
The second one is the tile object itself:
CODE:........
View 1 Replies
View Related
Jun 15, 2010
When trying to process this png image, webkit displays it blurry.
View 2 Replies
View Related
Mar 26, 2014
I have an Android app with a C++ library which uses pthreads to break down rendering tasks. This is for devices running Android 4+.
Lets say I have a 100 x 100 array of elements into which I repetitively do CPU-intensive processing. Currently I'm breaking the array up into four 25 x 100 element chunks and handing it off to four Posix threads (from a pool of stalled, pre-created threads). This gives an almost 4x speed increase on iOS and desktop Mac but slower results than single-threading under Android.
So the same code is used successfully to speed up the app on iOS or desktop Mac but in Android it often makes it even slower. I have done some tests on it and only quite big junks of data speed up when using multi threading. If the whole process (all threads) takes around 2 seconds or more it will speed up in multi threading mode but if it is less (say only takes about 400ms) it will be either the same speed or slower than just calling the rendering function normally. Which could point to thread switching being really slow. The bigger the processing tasks, the more they profit from multithreading. My tasks are usually not as big, but not fast enough in single threading mode.
I have also noticed that on ARM builds the speed difference between slower multi threading and the faster single threading is quite significant (almost twice as fast in multi threading rather than single threading) whereas on x86 builds the multi and single threaded versions will run at about the same speed as single threading on ARM builds. So x86 builds do not get slower on multithreading but also not faster.
View 1 Replies
View Related
Jul 1, 2010
I'm currently developing my first android app, and my first game. I've been developing on a netbook with a CliqXT (HVGA). Things are going well, it renders perfectly on the smaller screen. I knew I'd have some issues when rendering on larger screens, but the issues I'm having are not what I was expecting and I'm kind of stuck.
So basically the game consists of a main SurfaceView which I'm rendering the tiled game world on to. I followed this tutorial to get started, and my structure is still pretty similar except that it calculates the boundries based on the player location:
http://www.droidnova.com/create-a-scrollable-map-with-cells-part-i,654.html
The game also has various buildings the player can enter. Upon entering it launches another activity for that particular building. The building activities are just normal Views with Android UI stuff defined in XML (Buttons, TextViews, etc).
What I expected to happen:
So I expected the the building UIs to render correctly on the larger screen. I specified all dimensions in "dp" and fonts in "sp" in hopes that they'd scale correctly. I expected the actual game tilemap to render generally correctly, but maybe be really tiny due to the higher resolution / dpi. I'm using a very similar function to the tutorial linked above (calculateLoopBorders(), my version is pasted below) to calculate how many tiles to render based on screen height and width (getHeight() and getWidth()).
What is actually happening:
The whole game is just being rendered as if it's HVGA. The tilemap, and the building UIs are just scaled down to the smaller screen size, leaving black borders around the left, right, and bottom (see images).
View 2 Replies
View Related
Sep 9, 2010
What is a rendering engine? Is there any for Android?
View 1 Replies
View Related
Apr 15, 2010
I'm in the following situation: I have a large bitmap (~1280x1024) that I'd like to display on screen, scaled down in a view that fits the phone's screen (~480x320). This bitmap is frequently updated (couple of tiles per frame at 15 FPS). I first wanted to implement the rendering with a SurfaceView but figured out that all the scaling would be done in software due to limitations in the Android SDK. The second solution would be to load and render textures in an OpenGL context. Would that accelerate the resizing? If yes, isn't the cost of loading textures going to offset what I'll win on the scaling side?
View 2 Replies
View Related
Jun 10, 2013
I was wondering why Android keeps lagging a bit. I mean, quadcore should be fast enough to stop that from happening right? So I started Googling.
I got this article: [URL] .....
Basically it says this: Android's UI rendering thread does not work in real-time (the priority is not set at that), unlike iOS'. It's just about the one thing that's still better about iOS in my opinion.
How to make this thread render in real-time?
View 1 Replies
View Related
Jun 15, 2009
I want to render 3d object on the screen. Before that I would like to compute the screen so that the rendered object can be given relative position. How that can be done?
View 2 Replies
View Related
Sep 13, 2010
For some reason the onPageFinished is firing before the WebView has finished loading -
I can't figure out why...
CODE:.............................
View 3 Replies
View Related
Apr 14, 2013
Is it possible to force specific apps to render themselves in smaller resolution than the native (device's) one and telling the device to rescale them? I'm talking specifically about old Gameloft games that don't work on new devices anymore due to no xhdpi support.
I managed to run Modern Combat 2 on LG Nexus 4 (mako) but it has severe bugs with touch area and aiming that make the game unplayable.
I wouldn't mind playing this game in lower resolution rescaled to fit the entire screen as long as it would actually work (MC2 has smoother gameplay than any other game in the series + smaller maps = better multiplayer experience when there is not much time to play).
View 1 Replies
View Related