Android :: Difficulty Resuming SurfaceView
Apr 24, 2009
I am stuck.My main activity creates and starts a SurfaceView.My app needs to access a listview via the options menu to change properties of the items shown in the view.Two strange things occur:
1.) When I scroll the listview quickly, the list sometimes gets farklempt.Words overlap each other.
2.) When I select the item and the app returns to the main activity, the thread is no longer alive.
If someone out there can offer help I will post the code.This will take a little effort.My code is loosely based upon LunarLander and the GLSurfaceView examples.If there is a good example (more recent example) someone can point me to, that would be boss.
View 8 Replies
Aug 20, 2010
One using a Surfaceview, and the other using a custom view. According to the android SDK development guide, using a surface view is better because you can spawn a separate thread to handle graphics. Th SDK development guide claims that using a custom view with invalidate calls is only good for slower animations, less intense graphics.However, in my simple app, I can clearly see that using a custom view with calls to invalidate seems to render faster.What do you guys know/think about this?My touchEvent code is exactly the same, and my drawing code is exactly the same. The only difference is that one is all in the UI thread, and the other is using a tread to handle the drawing.
View 1 Replies
View Related
Apr 12, 2010
Despite everything I have read about the difficulty of making low latency audio apps in Android, I am giving it a shot. To start, I loaded each note in an octave into a SoundPool, and then looped through each note that was to be played on that beat and called play(). This didn't even come close to being accurate enough for me, and got especially bad if a lot of notes were being played at once.
From what I read, the only way to do something like this is to mix the audio yourself, though I am not entirely sure how to go about this. My initial thought is that for each beat, I could precompute the sound the sound that is to be played (i.e., combine the wav's), and then pass that stream to an AudioTrack when it is time to be played.
Are there any good examples out there for how to mix audio like this, or libraries I could use to do this for me? How have coders of other music apps dealt with this?
View 8 Replies
View Related
Jul 18, 2010
I'm very new to Android so I've been working primarily with information from the android developer's page. Everything was going great until I added the code from the alert dialog section. The code they give alone gives me an error when I try to run it on the last line, saying I must initialize dialog, but I feel like I'm getting the NullPointerException no matter what the case is.If I don't instantiate "dialog" to "null" at the beginning, I cannot run the program. I'm not even trying to do anything crazy yet, any help would be great because I'm having alot of trouble trying to figure out what exactly this code is trying to do.
View 2 Replies
View Related
Oct 14, 2009
For some reason my hero has some difficulty with certain areas of the screen when pressing on those areas in keyboard mode. When in vertical keyboard mode the l, p and backspace keys take multiple presses to get the letter to enter. I do not know if this is something to do with the capacitative touch screen or is perhaps a defect in the device. Has anyone else had this issue?
View 5 Replies
View Related
Feb 22, 2010
My application uses a single activity to switch between different views. I premise I'm loading a good amount of bitmaps in one of this view (say the gamescreen view) constructor but I recycle everything on the onDetachedFromWindow method.All the Bitmaps are static and most of them loaded with BitmapFactory. decodeResource method.Furthermore I'm using a gallery wich content is a simple layout with eight imagebuttons.I know all the complications using this widget and all the risks of using static bitmaps, but, I guess my problem does not entail them because my application is running well if I try to switch between these two view (and I've tried to do it about 30 times without crashes!!!) but when I pause and resume the application two times (pause->resume->pause->resume) I run out of memory, and often without the crash message (it just stays on the actual view).
View 13 Replies
View Related
Mar 5, 2010
I have a notification in the status bar for my app.The problem with this is that when you press the home button from the app (pushing it to the background) then press on the notification in the list accessed from the status bar, it starts a fresh copy of the activity. All I want to do is resume the app (like when you longpress the home button and press on the app's icon). Is there a way of creating an Intent to do this?
View 1 Replies
View Related
Nov 17, 2009
We are developing an application that needs to suspend and resume threads like a debugger (meaning in a non-safe way like Object.wait() and Object.notify()).In the Java SDK the methods Thread.suspend() and Thread.resume() are deprecated but we can still use them. Also there is the Java debugger API which allows one to do that if you connect to the VM as a debugger. Is there some API for android we can use? Is there a published Java Debugger API we can apply for Android?
View 2 Replies
View Related
Apr 7, 2010
I'm having some difficulty figuring out the best ways to pause and resume my application. Is there any comprehensive tutorial or something similar that would help me make sure that I'm not missing any important steps?Mostly I'm just worried about not dealing with the memory being used by my application. There's a few apps I own that when you minimize them slow down the rest of the phone to a stand still and I want to make sure to avoid that.
View 1 Replies
View Related
Aug 20, 2010
Question, obviously asked in several previous threads, but I'm unable to resolve the next issue at hand with that data. When I power on, and hit hboot, I'm still seeing S-On, yet if I log into abb shell, su, I get "#", as well as now having the icon for "Superuser Permissions". Used both unrEVOked3 and forever in this process.
I've attempted to install the radio update "PB31IMG.zip" via root of SD card. I'm able to see / install it, yet baseband is still showing 1.00.03.04.06. I have W7, and have the option to "Hide extensions for known file types" off (Can't stand not seeing exactly what files are what). What am I missing? I've seen that others have had to do the "*22899 then *228 option 2", yet If it doesn't show it as being a valid install, I'm hesitant to try and reinstall it.
View 5 Replies
View Related
Jul 28, 2010
Balancing our newest game, Flick Defense. Many people have been giving us mixed reports on the difficulty, specifically the arrow angles. We would love to get some feedback! The Demo version is free to download!
View 3 Replies
View Related
Sep 17, 2009
I am trying to implement the functionality to resume a large file download, but have not found how to start downloading from a position that is not at the beginning of an InputStream.I am currently using the InputStream.skip() method to go to the position where I want to resume the download, but have found that this method actually reads all the data over the network and then throws it away.I would appreciate some help in learning the correct way to start reading from the resume offset of the internet file being downloaded, so that I can avoid wasting the phone network bandwidth, and also avoid the extra time delay caused by re-downloading all the data that was already previously downloaded.
View 2 Replies
View Related
Sep 23, 2010
I am trying to solve an issue sort of similar to what was done here (link text)Except in my case where Activity A, started Activity B, started Activity C, when the user resumes the app after pressing the home button - I want C, the last Activity, to be displayed. Instead what is happening is I am back to A.Also on a side note I have discovered that even when I exit the application, if I hold down the Home button, my app is still listed as an active app even though in the LogCat I can see that it exited OK.Also, in case it matters, I did recently add android:launchMode ="singleTask" in order to make some notification logic work correctly. I was seeing the Home button behavior before that though.
Activity B actually has several Activities that it chooses from (it has a list of Intents) to display based on input it receives but launches them all the same way as Activty A launched B. Once the first Activity is displayed the user swipe the screen to navigate to the left or right screen. When the user swipes left or right, the current activity puts info in its return Intent that Activity B uses to display the next Activity. Also since logic outside of the user's control could prompt a change in the screen displayed, each Activty calls finish on itself in onStop to avoid back-button issues.
View 2 Replies
View Related
Jun 18, 2010
I upgraded to the new beta of swype and since then have found one minor issue. when i try to loop on a letter to do a double letter like the t in the word letter, i have difficulty doing so. I have to make a very large loop that only crosses over the letter, rather than looping on top of it like i used to be able to do. i'm not sure if this is just something to do with a setting that got changed or if it is a bigger issue.
View 14 Replies
View Related
Jul 28, 2009
I've run into a very strange problem regarding OpenGL texture outputs, which only occurs when the app is resumed (particularly when leaving after pressing Home, and going back into the app).I'm not sure how or why, but it appears to be that it's reading bitrate of the pixels incorrect, or something else entirely. Furthermore, this issue only occurs on the device itself (testing on my G1/Dream), not on the emulator.Code as well as example screenshots in the zip file show exactly what I'm talking about. And to completely replicate the issue I've included the 2D sprite object framework I've developed for OpenGL so the situation is exactly the same as what I've run across when developing my game, so if it's somehow an issue in my framework you may be able to spot it.
View 6 Replies
View Related
Apr 7, 2009
I have two activities running: MainActivity and ChildActivity. Whenever the user clicks in the button in MainActivity, the ChildActivity is launched. What I want to do is this:When the active activity is the ChildActivity and the user clicks the home button then relaunch the application (like opening from the beginning), I want to see the ChildActivity instead of MainActivity that is launched. However; This is happening only when the user clicks from recent activities window. (the window opened when you long press the home button).I had some suggestions actually work arounds and I tried to manipulate onStart, onRestart, onResume, onStop, onDestroy events. But, they didn't fully solve the problem. There should be a smart way out there.
View 8 Replies
View Related
Apr 7, 2009
I have two activities running: mainActivity and childActivity. Whenever the user clicks in the button in mainActivity, the childActivity is launched. What I want to do is this:When the active activity is the childActivity and the user clicks the home button then relaunch the application, I want to see the childActivity instead of mainActivity that is launched.I had some suggestions actually work arounds. I tried to manipulate onStart, onRestart, onResume, onStop, onDestroy events. But, they didn't fully solve the problem.
View 3 Replies
View Related
Dec 9, 2009
Like to utilize my new GV number, but the difficulty integrating SMS and incoming calls with the built-in contacts program has me reluctant.
View 6 Replies
View Related
Jan 20, 2010
I have one simple question regarding Java TimerTask. How do I pause/resume two TimerTask tasks based on a certain condition? For example I have two timers that run between each other. When a certain condition has been met inside the task of first timer, the first timer stops and starts the second timer, and the same thing happens when a certain condition has been met inside the task of second timer.how do I pause timer1 while running timer2 and vice versa while timer2 is running? Performance and timing is my main concern as this needs to be implemented inside another running thread. By the way I am trying to implement these concurrent timers on Android.
View 4 Replies
View Related
May 1, 2010
I like to download podcasts to my hero which can take a while because they're pretty big files. If I get an email or text while downloading it pauses my download and says waiting for data connection. The same thing happens sometimes when it bounces from WiFi to Ev. The only way I can get it to start downloading again is to start another download. This is annoying so does anyone know a better way to resume a download or is there some setting I can change?
View 1 Replies
View Related
Jul 10, 2010
I have an application that I have running a media player and I want to resume the activity from my applications home activity. I can successfully do this by adding the following flags to the startActivity Call:
myIntent.setFlags(Intent.FLAG_ACTIVITY_SINGLE_TOP | Intent.FLAG_ACTIVITY_CLEAR_TOP);
I am worried that this is not an ideal way to do things since it took me a long time to find it. It made me think that no one uses it very much. Are there any pitfalls to using this method?
View 1 Replies
View Related
Nov 29, 2010
Recently I have experience this problem, I have downloaded some aplication from Market, it's already 100% but it's not installed on my phone, when I click on it, still said downloading, even it's already 100% and I have been waiting 1 hours, is there any way to resuming download manually? If I press cancel download, it will start from 0 and will happen again, getting tired with this :'( but this is not always happen to all application, mostly big size application.
View 1 Replies
View Related
Mar 25, 2009
Im creating a simple game using a SurfaceView for drawing the Graphics. It works fine, but now I tried to add a title screen, which is (for now) only a LinearLayout and a Start-button, specified in XML. However, when I click this button and try to switch to my SurfaceView (By doing setContentView(R.layout.game), the screen turns black. But if I do setContentView(R.layout.game) immediatly in my Activity.onCreate it works. But not if I start with my Title-screen and then try to switch
View 3 Replies
View Related
Apr 30, 2009
I am finally testing my application on a G1 and even though it works fine on the emulator, it crashes on the G1
It crashes when it does:
CODE:.........
And the view is defined like this:
CODE:..............
View 3 Replies
View Related
Jun 16, 2009
I want to play 2 videos one after one minimizing delay between each video. so I created 2 mediaplayer, one playing the current video and the other preparing to play the following video.
The 1st video is played correctely but I couldn't get the video track of the second video. only sound without any error.
This is my source code : (note that here, I am using files on sdcard but the application will use files on a web server. that's why I need to prepare the second video while the 1st is playing)
CODE:...................................
View 5 Replies
View Related
Sep 4, 2010
My app fc when activity that's using SurfaceView as content view calls startActivityForResult(...) and activity that has been started calls finish()
This does not happen if I change content view to something else than SurfaceView.
This would be the requested logcat:
CODE:..................
View 1 Replies
View Related
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
May 18, 2010
When exiting the activity in a thread in a SurfaceView. This log appears in this situation:.............
View 2 Replies
View Related
Sep 11, 2010
For years now I've maintained a Tandy Color Computer Emulator applet on my home page. With the purchase of an Incredible I decided to do a port. Getting it going in Android didn't take long but I'm really surprised how slow it runs. You can literally see the pixels painting. I know there are other successful Android emulators so I must be doing something wrong.
My approach was to use a SurfaceView for rendering. There's a separate thread that runs a virtual 6809 CPU. Whenever that thread updates the emulated video memory, it calls SurfaceHolder.lockCanvas() with a Rect describing the part of the screen requiring a repaint. Then it calls the gfx routines with the resulting Canvas...this is where I did a repaint() in AWT/Swing. The gfx routines are smart enough to just render what's in the clipRect. Perhaps I'm still stuck in AWT but I can't think of any way to make this thing run at an acceptable speed. I tried to coalesce the gfx calls but that didn't work either. Any thoughts?
View 1 Replies
View Related
Feb 11, 2009
I have a SurfaceView that is covering a portion of its parent, a RelativeLayout. I have a background image covering the full RelativeLayout area, and this is my Activity's main layout.
I would like to have the SurfaceView be transparent so that I can see through to the background image on its parent RelativeLayout. I have tried the approach shown in the API Demos example TranslucentGLSurfaceViewActivity, but this succeeds in making the transparency go all the way through my Activity to my desktop!
I'm using the "style/Theme.Translucent" theme on my activity, and setting this on my SurfaceView: mySurfaceView.getHolder().setFormat(PixelFormat.RGBA_8888);
The transparency to the desktop it kinda cool, but not what I'm trying to do! Is it possible to make a SurfaceView transparent only through to its parent?
View 2 Replies
View Related