I'm working with examples that have worked fine in the past, but after no modification whatsoever, I am now getting this error from Eclipse.
GLSurfaceView, cannot find source
If I'm not mistaken this is an Android class correct? Has anyone else had this issue or know a known bug/solution?
I'm working in Android 2.2 BTW.
Thanks!
If you are using the emulator to test OpenGL ES 2 this will not work, the emulator does not currently support OpenGL ES 2.
Related
I have searched and searched this one and cannot seem to solve. Im running OSX 10.9 on an iMac with a ATI RADEON 4670 and and trying to get Skobbler Scouts maps to run on an Android emulator. All I keep getting is the dreaded eglChooseConfig() returning false using the inbuilt Android Emulator with all the prescribed settings set by Skobbler (gpu on API level etc etc). Is this a hardware incompatibility issue or is the Emulator just not implemented with the attribute settings set by Skobbler? Alternatively does anyone know of a working emulator for this SDK?
Any help is much appreciated. Thanks
Andy
You can find a working configuration at http://developer.skobbler.com/getting-started/android#sec031 (I've tested with device = Nexus 5 and API level 20).
Unfortunately, due to the fact that the SDK relies heavily on OpenGL most emulators will exhibit weird behaviours - leaving only real devices as good testing options (the emulator's documentation also states that OpenGL support is "tricky": "OpenGL® Graphics - Emulation of OpenGL ES graphics may not perform at the same level as an actual device")
This may be a bit difficult, but I have a fairly complex question:
I'm fixing up an old Android phone I have from 2010 (very crap phone), to play with and experiment on. I want to write some OpenGL ES 1.1 programs (preferably in C) on it, but I have no idea how to set up my development environment.
Specifically, my question is this:
How can I set up my android device to run C code, and then link OpenGL ES 1.1 with it?
Would it be better to replace the OS (Android 2.1) with Ubuntu (or something else entirely)? I'm not sure it could run it very well, but it might simplify the process of getting the C code on it since I can just compile with GCC and run.
I've never really done something like this on a phone before (I've dabbled in the Java side of android), so any advice is appreciated.
Thanks!
You will need to setup your device to be able to deploy and debug with your system, which varies from device to device. If you've already got development in Java working on the device, then you shouldn't need to do anything additional to the setup device to develop in C/C++.
For your development machine, you will need to install at a bare-minimum the NDK. The NDK is also bundled as a package from several other sources, such as in the Tegra Android Developer's Pack, and now also Visual Studio 2015 RC. Which package you choose for development is a matter of preference.
In terms of developing for GLES 1.1, as far as I know, there are not any 'official' samples for developing for it, however, there are several tutorials around. In the NDK, you will need to #include <GLES/gl.h> to get the API. You can then take a look at Khronos' specifications on its usage.
I have some functions which draws the game screen using the Direct X library in Windows.
So, I am trying to use the functions in Android phone using the ndk.
But I have some problems. Dose the Android phone which use the Java recognize the Direct X functions? If it is possible, then I must have some controls about it?
I want your help...
Android (and iOS as well) doesn't support DirectX but OpenGL ES. Check out 3D with OpenGL on the Android developer site.
Android uses a linux kernel, not a windows one. So I'd suspect no.
OpenGL is pretty similar to DirectX it doesn't take too much effort to convert between the 2. Failing that you could probably find the implementation in the Wine source code on how they handle DirectX calls and pass them to OpenGL.
No, because Android is based on Linux Kernel, whch supports OpenGL.
I tested my app on some Android 2.1 and 2.2 devices. So I think that they support OpenGL ES 1.1
But on some devices I had problems whit my app. I get an unsupported operation exception means the device does not support the GL 11 interface. Is this a hardware problem? Are there some possibilities to avoid this problem?
Thanks,
Mijat
I think that the exception I get is not useful. Because I pick a peace of code from the net, and this one checks the extension I temporally need with all extension from the interface GL 11.
And if there is no agreement, the code throws a exception.
The Problem case is, that I have an app and I tried in on the HTC Desire and some model of LG. It works great, but on a third device which works on Android 2.2 I get this exception.
Means OpenGL ES GL11 isn’t covered.
From http://developer.android.com/guide/topics/graphics/opengl.html :
Finally, note that though Android does include some basic support for OpenGL ES 1.1, the support is not complete, and should not be relied upon at this time.
Pretty much answers the question.
I am trying to set up an Android emulator to do some playing around with OpenGL ES on it, but I am stymied by the fact that, every time I run my program on it, it unceremoniously grenades itself. The problem (at least the first nasty red error line in the log) is a missing package called libhgl.so. This is the OpenGL driver file required for running OpenGL ES on Android devices, but for some reason, my emulator doesn't have it. Does anyone know where I can get drivers for the emulator, or how to get an emulator that already has them?
In this link:
http://osdir.com/ml/android-porting/2009-06/msg00282.html
it says:
libEGL.so and libGLESv2.so implements EGL and OpenGL ES through
libhgl.so and libagl.so. That is, libhgl.so and libagl.so are
dlopen()ed by libEGL.so. All EGL and OpenGL ES calls will finally call
into libhgl.so and/or libagl.so.
and here:
http://osdir.com/ml/android-porting/2009-06/msg00288.html
libagl.so is an pure software impl. For your accelerated impl., you
need to provide libhgl.so so that libEGL.so will be able to use it. It
is expected that libhgl.so implements and exports both eglXXX and glXXX
symbols.
I guess that indicates that the missing file will only exist on the device itself, but that the app should run with the software driver on the emulator. The numerous screenshots on the web of OpenGL apps on the Android emulator also indicates that OpenGL should work fine on the emulator. Any other possible reasons why you are not able to get OpenGL going?
The logic of loading EGL user space driver is at frameworks/native/opengl/libs/EGL/Loader.cpp. Basically there are three cases:
Running with emulator in software rendering mode
Running with emulator in OpenGL mode. This is where libhgl.so is loaded for earlier version of Android.
Running with actual device.
The emulator coming with ADT does not work well for case 2. But emulators are improved over recent years. You can use latest Android Studio which has a better emulator or leapdroid at http://www.leapdroid.com/