Android :: Error Trying To Use XML Layout And Extended GLSurfaceView / Fix It

May 5, 2010

I won't beat around the bush here... I'm trying to put my GLSurfaceView (called ShapeSurfaceView) into a relative layout. Before trying to use a layout, everything has been working fine simply instantiating the view and calling setContentView(mShapeSurfaceView). Since I got this error I researched how to create the layout completing in the Java and that is working quite nicely... it's just a ton of code to setup the layout, view and rules for the view. I'd really rather have the XML method working.

Here's the main XML, I've added no other views yet...

The java from onCreate, nothing special...

setContentView(R.layout.main); mShapeSurfaceView = (ShapeSurfaceView)findViewById(R.id.glview);

Here is the logcat error. My previous logcat error was mentioning the class constructor missing the AttributeSet parameter so I added that to the constructor for the ShapeSurfaceView yet still ended up with this. code...

Android :: Error trying to use XML Layout and extended GLSurfaceView / fix it


Android :: In Java Extended GLSurfaceView Sees Get Height GetWidth

Oct 3, 2010

The title/subject pretty much covers the issue. Using various examples and and the API on googlecode, it seems like my extended GLSurfaceView class ought to be a good place to work my onTouchEvent inputs but when I try to set variables involving getHeight() and getWidth() when I make the call to my "where did the user touch class", the getHeight() and getWidth() are zero. I have verfied this by telling the class method to return the getHeight() or getWidth() int I passed it and it comes back as zero. I am using an extended SpriteTextRenderer to display the values from my "where did the user touch class", and I know that it is working well because because I can change the other method to return event.getX() or event.getY() and those values display and update just fine. My question is, is the extended GLSurfaceView class the place where I should be asking to get the getHeight() and getWidth() values?

View 1 Replies View Related

Android :: Transparent Sub-GLSurfaceView In Layout?

Mar 23, 2010

I'd like to display some 3d object on top of the normal 2d ui layout screen. The 2d ui screen has background image, and GLSurfaceView is child of the content layout. I tried the same technique of the Translucent GLSurfaceView in ApiDemos sample, but GLSurfaceView clears all and shows black background. Code...

View 2 Replies View Related

Android : Add Button And GLSurfaceView / Done Without Involving Xml Layout?

Aug 27, 2010

I have a GLSurfaceView where I show some animations using OpenGL.

I now want to add a button to this view. How is this accomplished?

Can it be done without involving the xml layout?

View 1 Replies View Related

Android :: Can't Find Solution For This GLSurfaceView Error / Solve It?

Feb 3, 2010

I have a code for GLSurfaceView which runs fine with sdk 1.5. I am trying to use it in the sdk 2.0 I am getting following error - > "*Application called a GL11 Pointer method with an Indirect Buffer*"

This is the line at which the error is coming, *gl.glVertexPointer(3, GL10.GL_FLOAT, 0, slicesBuffers[i]);

*Please anybody explains me why this error comes & how to solve it?

View 4 Replies View Related

Android :: Get Id In Different Layout - App Crash / Fix Error?

Nov 18, 2010

I have id "@+id/call" in single_item.xml when i use findVewById it (the layout setcontextview(R.layout.main)) .the app crash .how to fix the error

View 2 Replies View Related

Android :: Using ScrollView Inside Layout Xml File For A Widget - Got Error

Nov 22, 2010

I'm able to successfully use a ScrollView inside the layout xml file for an application. However, when I tried using a ScrollView inside the layout xml file for a widget, I get a "Problem Loading Widget" error as soon as I drop the widget in the emulator. If I comment out the ScrollView, then the widget shows up in the emulator. I've pasted my layout xml file below. Any thoughts on how to get past this error would be much appreciated.

<LinearLayout
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:orientation="vertical"
android:paddingBottom="3dip">

<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingLeft="6dip"
android:paddingRight="6dip"
android:paddingBottom="3dip">

<Button
android:id="@+id/ok_widget"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:text="@string/button_ok" />
</LinearLayout>

<ScrollView
android:layout_width="fill_parent"
android:layout_height="fill_parent"
android:fillViewport="true"
android:layout_marginBottom="50dip">

<LinearLayout
android:id="@+id/linear_layout"
android:layout_width="fill_parent"
android:layout_height="wrap_content"
android:orientation="vertical"
android:paddingBottom="3dip">

</LinearLayout>

</ScrollView>

<RelativeLayout
android:layout_marginTop="-50dip"
android:gravity="bottom"
android:layout_height="wrap_content"
android:layout_width="fill_parent">
<LinearLayout
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:orientation="horizontal"
android:paddingLeft="6dip"
android:paddingRight="6dip"
android:paddingBottom="3dip">
<Button
android:id="@+id/ok_widget"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_gravity="right"
android:text="@string/button_ok" />
</LinearLayout>
</RelativeLayout>
</LinearLayout>

View 1 Replies View Related

Android :: Relative Layout In Java Code With Inflate And Custom View - Position Error

Jun 16, 2009

I have a custom view that I had to write for a large scrollable image, as the images are larger than the size of the screen. Before, I had tried to do it by putting the image into a ScrollView but that of course didn't work. The view itself is within a RelativeLayout within the activity and at the bottom of the screen I have two buttons that are used for navigation and at the top a TextView with a caption for the activity (the main header is already being used here for instruction). In my below code, I've checked the Hierachy Viewer to confirm all the elements are loaded and in the Activity I can see the TextView, however it overlays the ZN5ScrollView area and below the image I just have a blank area of the size defined rather than my buttons. For the bottom navigation, the Hierachy Viewer is saying the absolute_y of the bottom navigation is 480. I'm wondering if anyone can help with my layout code here to get this working correctly? Bottom navigation is 50px high, ZN5ScrollView is 365px above the navigation, and the TextView takes up the rest of the area at the top

View 4 Replies View Related

Android :: Android Layout Error - Relative Widths In Percent Using Weight

May 26, 2010

I am trying to assign relative widths to columns in a ListView that is in a TabHost, using layout_weight as suggested here:Unfortunately, it seems to want to fit all the columns into the space that the button occupies, as opposed to the width of the screen. Or maybe there is another constraint that I do not understand.

View 2 Replies View Related

Android :: Error While Opening Eclipse Android Layout Editor

May 5, 2010

Since yesterday everytime I open my layout Editor in Eclipse for the Android UI the last part goes on and on as expected if an Stackoverflow Exception occurs.Anybody else experiencing this and found a solution?I'm working with the latests android sdk on Mac OS X with Eclipse 3.5.2.I just installed the Carbon Version of eclipse and I get this error even in this fresh copy of eclipse.Very strange that I'm the only one experiencing this error. Maybe it is not an Eclipse problem but an problem of my project setup.

View 2 Replies View Related

Android :: Can't Find The GLSurfaceView?

Jun 12, 2009

i want to start programming in OpenGL on Android, but Eclipse can't find the GLSurfaceView. I'm using the 1.5 SDK. Do I have to set specific entries in the build path?

View 2 Replies View Related

Android :: GLSurfaceView And Key Presses

Nov 30, 2009

Following the samples and examples, I've successfully been able to load a model on screen and rotate it with the DPAD keys and overriding the onKeyDown method of the GLSurfaceView. Trying to use a letter though, causes a small box to appear at the bottom accepting the text that is being typed. What I'm not entirely clear on, is since I don't have a listener defined in the main Activity, why those key letter key presses are being intercepted by some other inherent listener(?). I setup an OnKeyListener for the view to call my own method and that does work... but I'm wondering if there is perhaps a better way to handle it.

View 3 Replies View Related

Android :: Set EglSwapInterval When Using GLSurfaceView?

Sep 3, 2010

I am a lazybones using GLSurfaceView and loving it. But now that my code is running too darn fast (heh), I would like to slow it down via setting eglSwapInterval to 2 or something. Just to be nice to the battery. But, being a lazybones, I can find no way of doing this when using GLSurfaceView. (and hacking an early return from onDrawFrame() was very unsatisfying).

View 2 Replies View Related

Android :: GLSurfaceView On App Widget?

Mar 31, 2010

currently GLSurfaceView is not supported in app widget .can we make changes to framework to make it support? is there any limitation? if possible what framework change is required?

View 12 Replies View Related

Android :: Deadlock In GLSurfaceView

Jul 27, 2009

We are developing an application that uses a GLSurfaceView to display 3D objects. We regularly get the "Application Not Responding" dialog. Inspection of the dumped threads reveals something that looks suspiciously like a deadlock. I have added the three thread dumps involved below. The first thread is the main application event thread, and it is waiting on a join with a GLThread.

The second thread is a brand new GLThread that is waiting for a semaphore lock presumably so it knows it has exclusive access to the graphics hardware. The third thread is probably a previous GLThread (the one the main thread is waiting for to finish), that is waiting to be notified. The strange thing is that the main application thread has just done a "mDone=true; notify();" prior to calling "wait()", so the third thread should have been awaken? .........................

View 3 Replies View Related

Android : Put GLSurfaceview On Top On A SurfaceView

Dec 16, 2009

Look at this: http://nhenze.net/?p=172

They show that it is possible to put an GLSurfaceview on top on a SurfaceView. I hope it would be useful.

View 2 Replies View Related

Android :: Screen Flickering In GLSurfaceView

Mar 18, 2010

I'm using GLSurfaceView to create a simple OpenGL drawing application. Since the elements drawn in each frame must remain on screen in order to be composed into the whole drawing, I don't use gl.glClear(GL10.GL_COLOR_BUFFER_BIT) at the beginning of each frame. But not clearing the color buffer leads to substantial flickering. Is there any way to eliminate flickering while still not clearing the screen at the beginning of each frame?

View 7 Replies View Related

Android :: GLSurfaceView Transparent Bg Within ViewGroup

May 12, 2010

I am able to get a GLSurfaceView to have a transparent background with:

CODE:............

when I set the Activity's window background to transparent and the GLSurfaceView is the contentView of the Activity.

But, let's say my GLSurfaceview is parented by a ViewGroup and I want GLSurfaceView bg to be transparent to see the Viewgroup's background - I am not able to do so with the code above. Is this a limitation or am I missing something?

View 2 Replies View Related

Android :: Draw GLSurfaceView To A Bitmap

Nov 4, 2009

I have an application that uses GLSurfaceView to draw OpenGL ES graphics. This is all working (mostly) how I would expect.

Now, I would like to implement a screenshot feature. For normal views, it seems that the standard practice is to create a new Canvas with a Bitmap and then draw to that Canvas using View.onDraw(Canvas).

I've tried using SurfaceView.draw(Canvas) in a similar fashion, but it always results in a blank (black) image.

I've also tried using the drawing cache with the exact same result.

View 3 Replies View Related

Android :: Draw Text On GLSurfaceView

Apr 12, 2010

how to draw text on GLSurfaceView in Android?

View 5 Replies View Related

Android :: Use GLSurfaceView Similar To ViewGroup?

Jul 22, 2009

How can one use a GLSurfaceView similar to a ViewGroup, in the sense of adding Views(CustomViews) over it? Is there any means to make the GLSurfaceView be the canvas on which the view draws its contents?

View 5 Replies View Related

Android :: How To Overlay GLSurfaceView Over A MapView?

May 13, 2010

I want to create a simple Map based application in android ,where i can display my current position.Instead of overlaying a simple Image on the MapView to represent the position, i want to overlay the GLSurfaceView on the MapView. But i don't know how to achieve this. Is there any way to do that?. Please anybody knows the solution help me.

View 1 Replies View Related

Android :: How To Overlay GLSurfaceView Over A CameraPreview?

Sep 22, 2010

I am trying to merge two examples from the ApiDemos so one overlay over the other. 1. CameraPreview.java 2. TranslucentGLSurfaceViewActivity.java I guess GLSurfaceView is not really necessary, I saw demos that uses a GL layer as a Camera PreviewCallback, but since I am such a noob at OpenGL, I am kind of lost. Can someone points me toward the light (figuratively speaking)?

View 1 Replies View Related

Android :: GLSurfaceView With Drawable Background

Oct 2, 2010

I have a GLSurfaceView with a drawable as background, however only the background is visible when rendered without surfaceView.setZOrderOnTop(true)I need to avoid using setZOrderOnTop(true) because there are static TextView's being used on top of the GLSurfaceView. Any suggestions for getting this to work?

View 2 Replies View Related

Android :: GlSurfaceView With Overlay Using XML / Java

Nov 8, 2010

I started an Android OpenGL application and I have the following classes: class A extends Activity class B extends GlSurfaceView implements Renderer When class A's onCreate is called, it creates an object of type class B and calls: How should I use my custom class that extends glSurfaceView in my XML file/Activity? Code...

View 2 Replies View Related

Android :: 1.5 SDK Installed In Most Of Phones / Want To Use GLSurfaceView

Aug 10, 2009

I would like to use GLSurfaceView for my new cool application. But I am still hestitating because Android 1.1 and Android 1.0 do not have GLSurfaceView class. And another question, If I don't use GLSurfaceView, how can I use OpenGL with SurfaceView class?

View 2 Replies View Related

Android : Want To Load Bitmap In GLSurfaceView

Jul 20, 2009

I want to load a bitmap on a GLSurfaceView.. I do it like this: Code...

But the bitmap repeats itself on the surface and is also inverted.. why is this.. How do i make it appear only once...kindly help!

View 6 Replies View Related

Android : Overlay A GLSurfaceview On A Surfaceview?

Apr 27, 2010

Is there anyone who knows how to overlay a GLSurfaceview on a Surfaceview? The Surfaceview is used for the camera preview..

View 4 Replies View Related

Android : Prevent GLSurfaceView Destruction

Mar 5, 2010

I am currently porting a 3D app on Android. This app consists of a 3D view (embedded in a GLSurfaceView) and of menu screens (for settings, search , etc.).

My main activity is the one containing the GLSurfaceView. It's always the root of it's task. The problem is that my GLSurface gets destroyed whenever I launch another activity and all the GL objects (VBOs, textures) that I created in the GL context get deleted/invalidated along. So whenever my users go in the menu, the 3D scene has to be fully reloaded. Wouldn't there be a way to prevent the surface's destruction ?

View 2 Replies View Related

Android :: Prevent GLSurfaceView From Swallowing All KeyEvents?

Nov 27, 2009

as there's a GLSurfaceView in use, no other views receive any KeyEvents. MotionEvents however, are still working as expected. Is there a way to prevent GLSurfaceView from swallowing all KeyEvents?

View 4 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved