[android-beginners] Global Exception Handling
Hey guys! I was wondering if there is a way to set up a global exception handler in my application for unexpected exceptions. Basically, I'd like to catch anything that bubbles outside of a try block and gracefully present an error message to the user. (NPE, Runtime, etc) Can I wrap the onCreate of my application or something like that? Register a global handler in my Manifest file? I'm trying to find a way to do it but I'm not having much luck. Thanks! Evan -- You received this message because you are subscribed to the Google Groups Android Beginners group. NEW! Try asking and tagging your question on Stack Overflow at http://stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en
[android-beginners] Re: Global Exception Handling
And, as usual, 0.002 seconds after posting, I find the answer: Here's a thread from the other group about it: http://groups.google.com/group/android-developers/browse_thread/thread/ddf6863e9a31052f Thanks! E On Mar 15, 10:57 am, Evan Ruff evan.r...@gmail.com wrote: Hey guys! I was wondering if there is a way to set up a global exception handler in my application for unexpected exceptions. Basically, I'd like to catch anything that bubbles outside of a try block and gracefully present an error message to the user. (NPE, Runtime, etc) Can I wrap the onCreate of my application or something like that? Register a global handler in my Manifest file? I'm trying to find a way to do it but I'm not having much luck. Thanks! Evan -- You received this message because you are subscribed to the Google Groups Android Beginners group. NEW! Try asking and tagging your question on Stack Overflow at http://stackoverflow.com/questions/tagged/android To unsubscribe from this group, send email to android-beginners+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en
[android-beginners] Sprite Type Images Guy
Hey Guys, I was wondering if there was any sort of sprite support built into Android? Currently, I've got TONS of tiny icon-ish files (40x100, 90x90) and it's taking up a considerable amount of space. The first set is around 272KB total and the second is 432KB. When I sprite and optimize the images, it comes out to 88KB and 152KB, a savings of around 60%. Also, that 450kb just inflates the size of my apk dramatically. Is there any way to do Spriting? I use the icon currently in Images in both Grid and ListViews. Thanks! Evan --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: Where I wuz
Hey Guys, I'm still struggling with how to pick back up. When I hit the home key, I see that Android pauses all my activities, but when I go back to the Launcher it only resumes my MAIN guy. How can I get back to the last place in the Task stack and maintain the use of the back button, as if I'd never left? Thanks! E On Sep 21, 10:03 am, Evan Ruff evan.r...@gmail.com wrote: Hey guys, I've been working on my first real Android application and I seem to be missing something about the application state. Basically, let's say I'm moving through the application and I get to Activity #3. I then hit home, bring up the launcher, and get back to my app. I get taken immediately to Activity #1 that is defined with the android.intent.category.LAUNCHER intent. Is there a way to have the application pick up where it was automatically, or is that something I need to manage internally within my application logic? Thanks! Evan --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Where I wuz
Hey guys, I've been working on my first real Android application and I seem to be missing something about the application state. Basically, let's say I'm moving through the application and I get to Activity #3. I then hit home, bring up the launcher, and get back to my app. I get taken immediately to Activity #1 that is defined with the android.intent.category.LAUNCHER intent. Is there a way to have the application pick up where it was automatically, or is that something I need to manage internally within my application logic? Thanks! Evan --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: Follow up on my Acitivty Lifecycle Question
So I think I have a related question about the Lifecycle, but this is more having to do with the application itself. While I think I understand how the whole Tasks/Stack paradigm is supposed to work, I'm not really seeing that sort of behavior with my application when someone exits then comes back. So if I'm running my application and press 'Home', then go to the tray and select my application again, it ALWAYS starts me up at the (intent.action.MAIN, intent.category.LAUNCHER) Activity. I would expect it to just pick the application up from where it was. Is this not the case? Am I missing some sort of parameters or methods that I need to implement to let the application pickup where it was? Thanks! Evan --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Follow up on my Acitivty Lifecycle Question
Hey Guys, I've read through the Activity, Activity Lifecycle and Application Fundamentals articles and I'm still having some issues working through managing a few components of my app. Basically, I have two related activities: a view with a number in the middle, and another activity with a grid of numbers that fill the screen. Basically, when you press the number on view1, it switches to view2 (startActivityForResult) and then when the user clicks one of the grid numbers, returns the number. Here's the thing, it's calling create() and onDestroy() every time my Grid pops up. This is making the application feel a little sluggish if you're trying to change the number really fast. Basically, I don't understand how I can make the NumberGrid guy Pause instead of Destory, then do onResume instead of onCreate. (I call finish() in my click listener, but that's the only way I can figure out how to make it return) I imagine poping up the cached view would be WAY snappier than creating it every time. Am I completely missing what I'm supposed to be doing here? Thanks for you help! Evan --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: Follow up on my Acitivty Lifecycle Question
Thanks Mark, I was looking at the Task thing, but I wasn't sure I was really going to be able to get it to work as I would expect. I'll look into the Managed Dialog thing. Thanks! E On Aug 1, 4:22 pm, Mark Murphy mmur...@commonsware.com wrote: Evan Ruff wrote: Basically, I have two related activities: a view with a number in the middle, and another activity with a grid of numbers that fill the screen. Basically, when you press the number on view1, it switches to view2 (startActivityForResult) and then when the user clicks one of the grid numbers, returns the number. Here's the thing, it's calling create() and onDestroy() every time my Grid pops up. This is making the application feel a little sluggish if you're trying to change the number really fast. Basically, I don't understand how I can make the NumberGrid guy Pause instead of Destory, then do onResume instead of onCreate. (I call finish() in my click listener, but that's the only way I can figure out how to make it return) I imagine poping up the cached view would be WAY snappier than creating it every time. Am I completely missing what I'm supposed to be doing here? Well, your second activity is behaving as it should. It's supposed to go through onDestroy() after finish(), followed by onCreate() on the next open. Rather than using an activity for the second screen, you could try a managed dialog, as they're cached, so after the first pop, subsequent ones (for the same lifecycle of your first activity) should be held onto. Or, work out something else where you switch between two Views instead of displaying a whole 'nuther activity, such as using ViewFlipper. You might be able to figure out something using the whole task thing, but I'm dubious. -- Mark Murphy (a Commons Guy)http://commonsware.com|http://twitter.com/commonsguy _Beginning Android_ from Apress Now Available! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Re: Follow up on my Acitivty Lifecycle Question
Mark, I've converted everything over to extend the Dialog class. A couple things I've noticed is that if you use the actual Dialog theme the thing performs like a dog, regardless if you used a managed dialog. I switched to translucent and it's almost instantanious! Thanks again for your help, E On Aug 1, 4:41 pm, Evan Ruff evan.r...@gmail.com wrote: Thanks Mark, I was looking at the Task thing, but I wasn't sure I was really going to be able to get it to work as I would expect. I'll look into the Managed Dialog thing. Thanks! E On Aug 1, 4:22 pm, Mark Murphy mmur...@commonsware.com wrote: Evan Ruff wrote: Basically, I have two related activities: a view with a number in the middle, and another activity with a grid of numbers that fill the screen. Basically, when you press the number on view1, it switches to view2 (startActivityForResult) and then when the user clicks one of the grid numbers, returns the number. Here's the thing, it's calling create() and onDestroy() every time my Grid pops up. This is making the application feel a little sluggish if you're trying to change the number really fast. Basically, I don't understand how I can make the NumberGrid guy Pause instead of Destory, then do onResume instead of onCreate. (I call finish() in my click listener, but that's the only way I can figure out how to make it return) I imagine poping up the cached view would be WAY snappier than creating it every time. Am I completely missing what I'm supposed to be doing here? Well, your second activity is behaving as it should. It's supposed to go through onDestroy() after finish(), followed by onCreate() on the next open. Rather than using an activity for the second screen, you could try a managed dialog, as they're cached, so after the first pop, subsequent ones (for the same lifecycle of your first activity) should be held onto. Or, work out something else where you switch between two Views instead of displaying a whole 'nuther activity, such as using ViewFlipper. You might be able to figure out something using the whole task thing, but I'm dubious. -- Mark Murphy (a Commons Guy)http://commonsware.com|http://twitter.com/commonsguy _Beginning Android_ from Apress Now Available! --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---
[android-beginners] Simple RPC Solution
Hey guys, I've written a GWT application that I'd like to create an Android Client for. I understand that the GWT Servlet is not really externally compatible with vanilla stuff, so I've written a separate servlet that uses Dozer to map the beans to POJOs. What I'm struggling with now is actually transporting them across the wire. What is the best practice here? I've searched the forums and I see a lot of references to JSON, XML-RPC, full on SOAP, etc and I'm confused as to what is naively implemented in Android. Of course, I'd like to use the fastest, lightest weight transport layer available. All my POJOs are serializable and very simple, so I would also like to use something that's relatively easy to use. Is there an libraries or tutorials out there on how to accomplish this best in the 1.5 Android Implementation? Thanks a lot for any help! Evan --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups Android Beginners group. To post to this group, send email to android-beginners@googlegroups.com To unsubscribe from this group, send email to android-beginners-unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/android-beginners?hl=en -~--~~~~--~~--~--~---