Android :: Open GL Surface View Renders Black On First Start

Apr 1, 2009

I have an Activity that was created based on the TriangleRenderer example. It works flawlessly as a standalone project, but when I use it as the tab of a tabhost there is a problem. At startup the whole activity is just black - I can get touch events and do everything else but it doesnt show anything. When I change the orientation (and therefore recreate the activity) it all works well. Maybe the problem comes from the View focus. My SurfaceView is not focused when created inside of the tabhost. I tried to fiddle around with the methods available in my onCreate() and onPostCreate(), but couldnt find a way to get the SurfaceView focused. The following sourcecode blocks in the guardedRun() method because needToWait() is true because !mHasFocus is true. If I exclude the ! mHasFocus, it goes on but shows a black View anyways. Do you have any idea why it does work after orientation change, but not at the first startup? The Activity looks quite simple.

Android :: Open GL Surface View renders black on first start


Android :: Possible To Start Surface View With Game Thread

Aug 7, 2010

I've read several example programs and tutorials to try and solve my problem but they all seem to go the same way. I've used a couple Activities and xml documents to create a menu that loads when my game starts.When the user clicks the "Start The Game" button, it loads a new Activity that sets the view with my game thread and all of the game properties.I know this activity works because I've run it alone as its own project, but every way I've tried to start it after the Menu,I get a nullPointerException and it force closes.I read the SurfaceViewOverlay tutorial and attempted to use that implementation, but I'm using a SurfaceView, not a GLSurfaceView.I'm debating rewriting my entire program to use OpenGL but I figured I would see if anyone else knows what I'm doing wrong here.If you need the code snippets I can paste some here, but it's not really the specific code that's wrong.

View 1 Replies View Related

Android :: Possible To Start Surface View With Game Thread Anytime / Other Than At Startup Of Program?

Aug 7, 2010

I've read several example programs and tutorials to try and solve my problem but they all seem to go the same way.I've used a couple Activities and xml documents to create a menu that loads when my game starts. When the user clicks the "Start The Game" button, it loads a new Activity that sets the view with my game thread and all of the game properties.I know this activity works because I've run it alone as its own project, but every way I've tried to start it after the Menu, I get a nullPointerException and it force closes.I read the SurfaceViewOverlay tutorial and attempted to use that implementation, but I'm using a SurfaceView, not a GLSurfaceView. I'm debating rewriting my entire program to use OpenGL but I figured I would see if anyone else knows what I'm doing wrong here.If you need the code snippets I can paste some here, but it's not really the specific code that's wrong, I think it's the way I'm using(abusing) the language.

View 1 Replies View Related

Droid :: How To Create Blur Surface From Android.view.Surface?

Jan 22, 2009

How do I create blur surface from android.view.Surface?

View 2 Replies View Related

Android :: How To Bind One Object On Surface Of Another In Open GLES?

Apr 14, 2010

Can somebody tell me if we could bind one object on to another in openGL ES.say draw multiple squares on the surface of a cylinder.I know we can draw them independently,but how to make them look like one single object??Is this possible?

View 2 Replies View Related

Android :: How To Add Image On Surface View?

Aug 29, 2009

I am trying to add an image on surface view. I have coded...

View 5 Replies View Related

Android :: Way To Change Size Of Surface View On Phone?

Nov 11, 2010

I want to change the size of surface view at run time when it is changed to Landscape Mode?

View 1 Replies View Related

Android :: GL Surface View GlText Image2D GlDrawTexiOES

May 3, 2010

I'm trying to render a 640x480 RGB565 image using OpenGL ES on Android using GLSurfaceView and Native C code. Initially I had a 0x0501 error with glTexImage2D, which I was able to resolve by changing the image dimensions. But now, in the "drawFrame" call, when I do glDrawTexiOES to resnder the texture, I'm getting the following error on the Logs: drawtex.c:89: DrawTexture: No textures enabled I'm already doing glEnable(GL_TEXTURE_2D), is there anything else I should do? Is there a complete example showing GLSurfaceView with native code using textures?

View 4 Replies View Related

Android :: How To Draw Overlay On Surface View Used By Camera?

May 29, 2010

I have a simple program that draws the preview of the Camera into a SurfaceView. What I'm trying to do is using the onPreviewFrame method, which is invoked each time a new frame is drawn into the SurfaceView, in order to execute the invalidate method which is supposed to invoke the onDraw method. In fact, the onDraw method is being invoked, but nothing there is being printed (I guess the camera preview is overwriting the text I'm trying to draw).

This is a simplify version of the SurfaceView subclass I have:

public class Superficie extends SurfaceView implements SurfaceHolder.Callback {
SurfaceHolder mHolder; public Camera camera; Superficie(Context context) { super(context);
mHolder = getHolder(); mHolder.addCallback(this); mHolder.setType(SurfaceHolder.SURFACE_TYPE_PUSH_BUFFERS);
} public void surfaceCreated(final SurfaceHolder holder) { camera = Camera.open();
try { camera.setPreviewDisplay(holder); camera.setPreviewCallback(new PreviewCallback() {
public void onPreviewFrame(byte[] data, Camera arg1) { invalidar();
} } ); } catch (IOException e) {} } public void invalidar(){ invalidate(); }
public void surfaceChanged(SurfaceHolder holder, int format, int w, int h) {
Camera.Parameters parameters = camera.getParameters(); parameters.setPreviewSize(w, h);
camera.setParameters(parameters); camera.startPreview(); }
@Override public void draw(Canvas canvas) { super.draw(canvas);
// nothing gets drawn :( Paint p = new Paint(Color.RED);
canvas.drawText("PREVIEW", canvas.getWidth() / 2, canvas.getHeight() / 2, p);
} }

View 1 Replies View Related

Android :: Not Able To Draw A Transparent Image On Surface View / Fix It?

Jul 6, 2010

My objective is to run a glowing animation on an image.I am changing the image alpha to produce this effect.

I have used basic AlphaAnimation provided in android framework but found that its slowing down other animations. So i extended a class from SurfaceView and created a thread to update it. ( Again here, i am manipulating alpha of the image ).

Everything seems fine, except that i am not able to draw a transparent image onto SurfaceView.Its showing black color on the transparent areas of the bitmap.code...

View 1 Replies View Related

Android :: Overlay Images Onto Camera Preview Surface View

Aug 23, 2010

I have a SurfaceView that is being used to draw custom animations and I would like to overlay them onto a live-feed from the phone's camera. Currently, the SurfaceView that contains the animations has a white- background, but if I were to overlay them onto the phone's camera feed, they would have to be transparent. The camera and animation drawing cannot be done on the same SurfaceView. Is it possible to make a SurfaceView transparent? What is the best course to pursue the use of multiple views? My end goal is to essentially overlay the contents of another SurfaceView onto the Camera SurfaceView.

View 2 Replies View Related

Android :: Surface View Draw Images Overlay On Camera Preview

Aug 23, 2010

I have a SurfaceView that is being used to draw images, and I would like to overlay them onto a live-feed from the phone's camera. Currently, the SurfaceView that contains the images have a white-background, but if I were to overlay them onto the phone's camera feed, they would have to be transparent. The camera and animation drawing cannot be done on the same SurfaceView. What is the best course to pursue the use of multiple views that involve managing the camera and drawing images? Is it possible to make a SurfaceView transparent?

View 4 Replies View Related

Android :: Access APIs Android View Surface.cpp From My Native Code

Oct 5, 2010

I am working on video renderer application which need surface and control of surface. And through isurface i can register heap buffer to that surface and post buffer operation. I have gone through android_view_surface.cpp file. It is having all required APIs which are helpful for my application. But i don't know how can i implement it. What are the procedures to get access of those APIs.

View 2 Replies View Related

Black Screen Lag On App Start Up - Splash Not Displaying?

Mar 7, 2012

My app has a splash page on startup, during this time it will connect to a server and download a file, once the download is done a 3 second timer will start then the main page of the app will load.

However, due to crappy connection in my workplace, the download can sometimes take a while, during this a black screen will show until the download is done, then the splash page and timer will start. What I want to know is why the splash page will not display over this black screen?

Code:
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.splash);

[Code]....

View 3 Replies View Related

Android :: Height Of ScrollView - Only Renders 45px High

Aug 10, 2009

I'm trying to build an interface and I'm having some trouble with the ScrollView component. Basically, no matter what height I set the ScrollView, it only renders 45px high. Even if I set the height to a fixed pixel number (like, 200px) it still only renders into a tiny area of the screen.

Generally, I've got a pair of tabs at the top, then the FrameLayout. Inside of that, my first tab is a vertical LinearLayout, with a horizontal LinearLayout holding small labels, then a ScrollView with a ListView inside of that. The FrameLayout appears to be rendering the full height, as my second tab fills the space as you would expect.

Here is the XML:

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

View 3 Replies View Related

Android :: How To Open Application When OS Start Up?

Jun 14, 2010

Is there any one know how to open an App when the Android OS start up, I have to do it in an embedded system?

View 4 Replies View Related

Android :: HTML Page On 2.1 Browser Renders Small Font

Apr 9, 2010

I have a bunch of pages that render normally on the Android 1.6 native browser as well as on the iphone Safari browser, but are heavily zoomed out and small by default on the Android 2.1 native browser.The pages are zoomed out by about 4x making them appear very small.Of course I can manually zoom in, but I dont want the users to have to deal with that.Anyone else face this issue, and is there a fix for this that doesn't break how it works on other browsers?

View 2 Replies View Related

Android :: Make A Dialog Box To Open When Start A Program?

Feb 9, 2010

I'm trying to make a dialog box to open when I start a program. Eclipse likes my code, I like my code =), but the emulator does not like my code. It says that something went totally worong and the application has to shut down. Bellow you can see my code. When I run it in debug mode everything seems to go as it should but when it gets to "return dialog; " eclipse debug windows says source not found.

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

View 6 Replies View Related

Android : Weird Black Line On Top Of List View / Ran Into This Before?

May 6, 2010

I am creating a layout with a ListView and at the very top of the list there is this weird black line that I can't seem to figure out how to get rid of! It's part of the ListView because it moves up and down as I size the ListView. Has anyone ran into this before?

I couldn't get DDMS to take a screen capture for some reason so I took a picture of the screen with my G1, so please forgive the quality! As you can see the line is there at the top of the fade out in the list.

View 2 Replies View Related

Android :: Droid Black Glossy Header / Footer View?

Aug 1, 2010

In the Gmail app on my HTC Android phone, the headers are glossy black, much like the header on an iPhone.

Is there a setting on a view that I can use to create this background look, or is it a graphic they are over laying?

View 1 Replies View Related

Android :: Way To Start A Sub Activity In Same View?

Nov 4, 2010

I want to start a new activity intent in my current view! How i can do that?

View 3 Replies View Related

Android :: How To Start An Activity From A View In Droid?

Jun 18, 2010

Is there a way to start an activity from a view? I have this nice view that renders these menu buttons and when they click a particular button (Trapped in an onTouch event) I want to start the "clicked" activity. It seems that there from my view startActivity method is uncallable. So that leads me to believe that there is no way to do this, in which case I guess I am asking, what do I do here when I want this menu to have a view that animates drawables and can get touches to know what "button" was pressed to know what activity to start?

View 2 Replies View Related

General :: Error (Cannot Start App Due To Insufficient Permissions) When Open Weblink

Jan 3, 2013

I encountered the message "Cannot start the app due to insufficient permissions" when open web link in facebook for android or friendcaster or some news apps. Before, I rooted my Xperia and do some mods with Small Apps and Toggles.

View 1 Replies View Related

Android :: List View Selection To Start A New Activity

Aug 6, 2010

I'm working with a list view trying to get specific activities to open when a certain item is selected. This is the code that I'm working with right now. I know its wrong but am not sure what I need to change it make it work. I think I need an intent and tried a few ideas but did not come up with much.

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

View 1 Replies View Related

Android :: Start View Contact Activity On Droid?

May 20, 2010

I want to create a tab which contains a tab for viewing contact detail. Here is what i did code...

It throw security exception.

View 1 Replies View Related

Android :: Way To Open Activity From View?

Oct 2, 2010

How to open activity from view.i am develop a game if game is over i need to move user to main menu activity.Please help me its very urgent to me.

View 2 Replies View Related

Android :: Open New View By Onclick

Jun 28, 2010

I am trying to create a list view where each item will open up a new view and display a picture and text describing the item when said item is selected. I am working with this tutorial novice-tutorials-f8/opening-windows-i-e-webbrowser-reacting-on-clicks- t22.html?hilit=reacting%20on%20Clicks

so is there a way i can use this code to open up a new view

[code]@Override protected void onListItemClick(ListView l, View v, int position, long id){ super.onListItemClick(l, v, position, id);

// Get the item that was clicked Object o = this.getListAdapter().getItem(position); String keyword = o.toString();

// Create an VIEW intent Intent myIntent = null; // The intent will open our anddev.org-board and search for the keyword clicked. myIntent = new Intent("android.intent.action.VIEW", Uri.parse ("" + keyword + "")); // Start the activity startActivity(myIntent);}

View 3 Replies View Related

General :: Galaxy Nexus Phone - Can't Open / Start Google Calendar

Aug 13, 2012

I've got a Galaxy Nexus phone recently and since I'm not familiar with Android (ICS) at all it took me a while to get used to it.

Since I was not very satisfied with the pre-installed googleCalendar I was told to install the app aCalendar, which I was very happy with for a while. But whenever there was an Calendar alarm which I wanted to change the note opened in the old googleCalendar. And that's why I thought I might change that by disabling the googleCalendar. Yes, what I did not know at that time was that the aCalendar depends on the googleCalendar. Afterwards I couldn't make any entries to the aCalendar anymore. So I went back to the apps-list and to my horror there was no appropriate button for enabling the calendar again (why not???). In despair I went to Settings and Reset app preferences, which seemed to work for a while - the old Calendar worked again.

A couple of days later, however (I don't have the slightest clue whether it had anything to do with my former actions or with anything else) it stopped working again and I didn't find any possibility to start it again - which is EXTREMELY FRUSTRATING, since I need a calendar!

HOW do I start the googleCalendar again??? If I go the app in the app-list it obviously still exists, but there is NO button to make it start again! (Why do they put an DISABLE-button there, if they don't give you the option to ENABLE it again!?)

I have a file manager installed and I see that the calendar app is stored in /system/app (actually there are two calendar files - CalendarGoogle.apk & CalendarProvider.apk). When I try to say install, it won't install and says App not installed. ?

Don't come up with things like "You have to root your mobile", because this is no option for me and I don't want to mess up with the system even more).

View 10 Replies View Related

General :: Automatically Start Service When Joining Open / Free WiFi?

Apr 29, 2014

im not sure if there is a app that does this but i want to automatically start a service/app (VPN) when joining a open/free wifi if not, then how would i best do this?

View 3 Replies View Related

Android :: Animation Not Start Immediately When The Target View Is Out Of Window

Jun 10, 2010

When I apply some animation to the view, which is out of window, the animation not start immediately. And then, I scroll the screen to show the animation target view, the animation will start. I hope to the animation will start immediately when it apply.

Bellow is sample code.................

View 3 Replies View Related







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