**** BEGIN LOGGING AT Tue May 19 02:59:57 2009 May 19 03:55:43 squalus: yeah, I'm trying to write a trivial app now and then I think I'm going to take a stab at writing a quick native kawa app to generate all of the nasty xml files from sexps May 19 03:57:20 'tho I'll have to take a break for a day or two (bah, neglecting my day job hacking CL for this...) May 19 04:42:05 bherrmann7: I had to switch mine to plain http, no ssl and then it worked again. Looking about found other people with the problem, but no fix, just a sidestep May 19 06:11:47 wow, bay to breakers was a blast :) May 19 06:11:50 so many boobs May 19 06:32:30 aww I miss that May 19 07:01:54 views.setInt(R.id.WidgetBackground, "setBackgroundResource", R.drawable.widget_frame_alert); throws an exception saying you can't use setBackgroundResource with RemoteViews. Any ideas for a workaround? May 19 07:11:34 skyPhyr: doh it might not be marked for remoteviews May 19 07:11:48 skyPhyr: what kind of view on the other side? May 19 07:14:33 you could easily work around this issue though... May 19 07:14:39 jsharkey: it's a RelativeLayout May 19 07:14:54 by just using a FrameLayout with an ImageView and set the image resource on that image view May 19 07:15:04 and then whatever otehr view to be on top of it all May 19 07:15:23 jasta: won't that mess with the content part of the 9patch? May 19 07:15:35 oh, well yes. May 19 07:16:14 jsharkey: If I created my own class inheriting from RelativeLayout could I mark the function on there to let this get through? May 19 07:16:34 jsharkey: if so how do I mark it to be remoteview friendly? May 19 07:17:20 jasta: Though I guess I could just make a copy of the same background image with completely transparent pixels so it just has the context portion of the 9 patch May 19 07:17:57 skyPhyr: one hack would be to have two layouts with the varying backgrounds, that the content May 19 07:18:08 its hacky, and slightly expensive, but would work May 19 07:18:20 jsharkey: the expensive bit was what I was worried about May 19 07:18:30 *because switching layouts means it doesnt recycle the layout May 19 07:20:50 jsharkey: yeah - chewing through battery rebuilding a fresh layout seems kinda bad May 19 07:21:14 the frameview and invisble image on top would be less expensive right? May 19 07:21:30 invisible background for the relative layout May 19 07:22:40 eek my source tree is out of date May 19 07:22:52 jsharkey: though I'm still very curious on how to mark functions as ok for RemoteViews :) May 19 07:23:09 i dont understand how RemoteViews security is enforced, actually. can't you just make your own View and mark it as remotable? May 19 07:23:09 skyPhyr: so the interesting part is that RemoteViews only trusts framework classes May 19 07:23:24 jsharkey: that's not interesting, it's disappointing ;) May 19 07:23:26 jsharkey: where is that implemented, exactly? May 19 07:23:41 jasta: its whoever is inflating the layout using an InflateFilter May 19 07:23:44 skyPhyr: well it's obviously necessary. RemoteViews run in another process -- allowing any view to be in another process would be a massive security hole. May 19 07:23:57 so you /could/ have a AppWidgetHost that ignores security May 19 07:24:03 that would be arbitrary code execution May 19 07:24:10 and just inflates whatever it needs May 19 07:24:14 jasta: like aHome :)) May 19 07:24:17 ahhh good point May 19 07:24:41 jsharkey: i was just curious to see how that enforcement was done. i'd like to learn :) May 19 07:24:43 romainguy: am i stuck supporting this stuff forever now :/ May 19 07:24:49 jsharkey: what stuff? May 19 07:24:52 widgets? May 19 07:24:52 you can't have it run in another thread and push to a buffer that's all that gets put forward May 19 07:24:53 yes May 19 07:25:03 so it's stuck within the same sandbox as the app? May 19 07:25:08 skyPhyr: a thread has all the same privileges as any other thread in that process. May 19 07:25:22 jasta: that and it can also walk the hierarchy May 19 07:25:24 yeah - I'm thinking of having it in a process of it's own May 19 07:25:28 and fiddle with the other views May 19 07:25:31 skyPhyr: go look at Launcher's AndroidManifest.xml -- look at all the permissions it has. May 19 07:25:33 and install listeners, etc. May 19 07:25:37 skyPhyr: so we dont want those processes spun up the entire time May 19 07:25:38 same as a regular activity May 19 07:25:47 you dont want launcher to actually be running 8 apps ;) May 19 07:26:16 jsharkey: ahhh ok - I'll eventually get used to the idea of limited resources ;) don't mind me - until then I'll ask dumb questions though May 19 07:26:33 well also, connecting Launcher to those apps arbitrarily totally borks the low memory killer model May 19 07:26:35 jasta: http://android.git.kernel.org/?p=platform/frameworks/base.git;a=blob;f=core/java/android/appwidget/AppWidgetHostView.java;hb=cupcake#l55 May 19 07:29:04 can I shift the limits of a relative layout without using a background 9patch with content lines? May 19 07:29:43 or is the frameview with images my best option? May 19 07:30:11 you could have "padding" s that you visibility gone and show May 19 07:31:23 is it possible for a relativelayout to have an image at the bottom that fills the whole thing? May 19 07:31:32 or will it just mess with all the other elements? May 19 07:33:05 jsharkey: privmsg May 19 07:33:28 damn slides May 19 07:36:15 nope - that won't work anyway - relativeLayout forces it into the content area :( ahh well May 19 07:36:55 jsharkey: should I log a bug for the setBackgroundResource issue or is it by design? May 19 07:46:24 can't use setInt and friends on any functions that have multiple arguments? May 19 07:50:24 jsharkey: add setBackgroundColor to the list of functions not oked May 19 08:01:26 Hey, so I'm having trouble with the emulator May 19 08:01:36 I'm trying to simulate the flip open/flip closed event. May 19 08:01:46 I'm pressing Control+F11 May 19 08:01:58 Is that the correct key? May 19 08:02:43 Ctrl-F12 and F11 May 19 08:04:28 numpad 7 does it too right? May 19 08:05:30 Yeah May 19 08:05:33 Numpad 7 May 19 08:05:36 I started mashing keys. May 19 08:05:45 Ugh May 19 08:05:51 I'm trying to debug a race condition May 19 08:06:17 That happens when the phone is opened and closed. May 19 08:07:16 And I can't get it to happen in debug >< May 19 08:07:30 Is there a way to dump all the stacks of the threads w/o being in debug mode? May 19 09:35:38 hmmm I've got a FrameView with a RelativeLayout and an ImageView beneath it. It portrait it works exactly right and things lay over each other properly May 19 09:35:46 the same setup in Landscape gives this http://imagebin.ca/view/u0Nme9.html May 19 09:36:00 I switched the background of the RelativeLayout to red May 19 09:36:05 and the ImageView to a while image May 19 09:36:09 white image May 19 09:36:15 should only see what May 19 09:36:25 I've specified margins and padding of 0dip May 19 09:36:31 s/what/white/ May 19 09:36:47 any ideas? the layout manager in eclipse does it correctly May 19 09:39:56 hi May 19 09:40:46 so in the google dev phone 1 I can install custom builds... if I wnat, I can install whatever lib I want to be able to use it in my phone or even install another SO (non-android) at least theoretically May 19 09:41:20 ...or not? I am asking =) May 19 09:41:53 Edulix - assuming you've got an unlocked phone and can compile it for the arm architecture May 19 09:42:20 skyPhyr: the dev phone 1 comes unlocked so.. May 19 09:42:36 btw incase anyone was wondering Scale Type matrix ftw on my previous problem May 19 09:42:39 Edulix - yep sure does :) May 19 09:45:08 cool May 19 11:06:52 hi May 19 11:07:07 so to register as an app developer in the android market it's 25$ May 19 11:07:30 and how much do I need to pay as transport fees for getting the mobile dev phone 1 to spain? May 19 11:19:08 Edulix: there should be a list. May 19 11:19:22 Edulix: for germany it's f*cking expensive due customs. May 19 14:15:25 Hi. May 19 14:15:32 lmfbdasa May 19 14:15:41 oops, wrong window May 19 14:16:39 jt436: time to change your password ;) May 19 14:19:31 is it necessary to register a appwidget somewhere? I tried to add a widget to my app, but when I try to test it in the simulator I am not able to add the widget. It doesn't appear in the widget-list. May 19 14:20:17 sammyF: ..... done ;) May 19 14:20:27 how is your game coming along? May 19 14:22:48 Gelb, you need the right intent in your manifest May 19 14:22:59 Gelb, I don't remember what it is, but I'm sure the docs have it May 19 14:23:02 the first one is out and not doing particularly well ..but that's okay. it was my first application in Java at all, and my first one for mobiles too May 19 14:23:11 second one is nearly finished, and definitely better :) May 19 14:23:26 KNY: I did this, but simply nothing is happening. tried to follow several examples. I even don't get any kind of error message. May 19 15:04:59 hey, I'm feeding my android app with data from an appengine app May 19 15:05:22 how can i get the account data registered with the phone May 19 15:05:26 ? May 19 15:06:24 i mean the users google account, so i don't have to prompt the user to submit data from the phone? May 19 15:09:18 pretty sure you can't for security reasons May 19 15:09:25 I don't know May 19 15:10:27 anyone here use MediaRecorder? May 19 15:52:44 hi May 19 15:53:04 My activity crashes/stops with an ArrayIndexOutofBoundsException if I remove an OverlayItem from an ItemizedOverlay and then tap the place where it used to be. I called populate() after removing, any idea what went wrong? May 19 15:53:40 hi rzr May 19 15:53:55 i am facing a weird bug May 19 15:54:14 me too :o May 19 15:54:24 my layout buttons are inactive in my service, but works as expected if loaded by an activity May 19 15:54:53 you load them from xml in both cases? May 19 15:55:22 yes May 19 15:55:27 same files May 19 15:56:06 what is intended, that they're inactive or active (as in, what does the xml want them to be)? May 19 15:57:13 that they're active, as you said May 19 15:57:24 i fear in some cases the listeners arent set May 19 15:59:06 Say I had a preferencecategory, what is the correct method to add EditTextPreference's to it ? May 19 15:59:17 however I'm trying it, i'm getting no love. May 19 16:01:55 Who handles registering the listeners? I'm quite new to android by the way. May 19 16:03:29 i am using standard imagebuttons May 19 16:04:58 should they be focussable or clickable to be hilighted ? May 19 16:07:19 maybe you could try using setclickable(true) on both the parent view and the buttons themselves? May 19 16:20:23 i did May 19 16:20:35 i noticed that in the working state May 19 16:20:45 i have mDrawableState[3] vs 2 May 19 16:57:12 hi May 19 17:07:47 sammyF: what genre if your new game? May 19 17:07:52 *is May 19 17:18:43 jt436: sensor based thingy May 19 17:18:44 :) May 19 18:19:44 Can't seem to add "https://dl-ssl.google.com/android/eclipse/" as a software update site in a fresh eclipse install (gannymede), http also won't work, any ideas? May 19 18:22:58 matt try adding index.html on the end of the url you feed to eclipse May 19 18:23:11 it works with this for me http://dl-ssl.google.com/android/eclipse/ May 19 18:24:32 i had problems with the raw url no file name on end May 19 18:24:33 just me, May 19 18:28:41 Hey May 19 18:29:06 How come Android does not use SVG for iconss May 19 18:30:38 because it has no SVG engine. also, because SVG is slow. May 19 18:31:44 ah, doesn't WebKit support SVG? May 19 18:32:56 renke: not in Android. May 19 18:33:05 I see May 19 18:40:34 is this an appropriate room for asking about the T mobile G1 phone and android? May 19 18:40:49 for development-related questions, yes May 19 18:41:02 Phantoon: if you are developing applications May 19 18:41:33 well this isn't so much on the application side as it is hardware.. take apart.. etc.. just a few quick questions to see if anyone could offer any advice on inserting the flex cable from the camera unit into the main board May 19 18:41:38 since its so tiny and hard to move May 19 18:42:39 i have the SDK and usb driver installed on win32, and i hook it up via USB, the phone charges, but it does NOT show me the "USB connected" in the notification bar.. May 19 18:46:05 Phantoon: did you enable USB debugging on the device? May 19 18:46:21 well im rpetty new to it, so im not sure how.. but ill look online for how to do that.. May 19 18:46:39 so far i love the phone.. its pretty amazing May 19 18:46:43 Settings -> Applications -> Development May 19 18:46:57 you will see a checkbox for USB debugging May 19 18:47:31 yes it is enabled May 19 18:48:02 while the phone is plugged in open a command prompt and type 'adb devices' May 19 18:48:05 is anything listed? May 19 18:48:43 holy crap May 19 18:48:48 it just worked for no reason i thkn May 19 18:48:50 sec May 19 18:49:59 uhh May 19 18:50:03 it says permissoin denied May 19 18:50:34 but now USB connected just showed up for some reason May 19 18:50:40 let me see if i can mount the SD card May 19 18:51:02 hmm.. nope :/ May 19 18:51:21 Phantoon: is it plugged into a USB 2.0 slot? May 19 18:51:30 yes May 19 18:51:41 it gets power from it no problem May 19 18:52:02 did you select the driver for the device? or just install the driver? May 19 18:52:17 i just right clicked the ini and installed it May 19 18:52:23 uhh one sec May 19 18:52:28 I'll link you to the proper way May 19 18:52:32 i tried going manually with add hardware too May 19 18:52:32 k May 19 18:52:53 Phantoon: http://developer.android.com/guide/developing/device.html#setting-up May 19 18:54:00 it doesnt pop up new hardwawre wizard for me May 19 18:54:15 wait May 19 18:54:18 there it goes May 19 18:54:20 wtf May 19 18:54:47 ahahaahah May 19 18:54:53 hopefully it installs this time May 19 18:55:06 it seems to only work when termianl was open.. wierd May 19 18:55:45 very odd May 19 18:56:23 has anyone fooled around with People.ContactMethods for interfacing with the Contacts DB? May 19 18:56:58 hmm May 19 18:57:02 adb devices shows nothing May 19 19:14:50 can a website be associated with a contact? May 19 20:28:47 is there a way i can be notify when the user has taken new photos? May 19 20:29:07 or is the best thing to just ru na service every so often to check ? May 19 20:29:16 chouman82: yes, there is an intent for it. May 19 20:29:21 look at the camera app to find out what it is May 19 20:29:29 oh cool thanks let me take a look May 19 20:29:29 use a broadcast receiver May 19 20:30:13 romainguy_: you there? May 19 20:32:15 chouman82: ideally you dont want to interact with the photos in the background without user interaction May 19 20:32:21 if you're uploading somewhere, for example May 19 20:32:30 you would want to tie into the "Share" menu May 19 20:32:37 Share menu? May 19 20:32:52 wat is this share menu? May 19 20:32:55 chouman82: the user can click "Share" on a photo, offering them options like upload to picasa, etc. May 19 20:33:03 you can attach to this menu using intents May 19 20:33:06 how do i do that? May 19 20:33:18 is there an example somewhere? May 19 20:33:49 so a setting in my app for automatically upload would not be good? May 19 20:34:05 i think that sounds reasonable May 19 20:34:08 but i would implement a scheduler May 19 20:34:17 dont just fire off a heavy network thread when a picture is taken May 19 20:34:23 instead, schedule that network thread to happen later. May 19 20:34:32 maybe just set up an alarm manager to wake up a queue and work through it May 19 20:34:45 ok sure that sounds good May 19 20:34:49 the reason you dont want to do this immediately is because the user is expecting a responsive phone after they take a photo May 19 20:34:56 you will hinder that expectation :) May 19 20:35:05 jasta: understandable May 19 20:35:11 but for the love of god, be efficient. May 19 20:35:18 jasta: so how do i do the share menu thing? May 19 20:35:27 jasta: any exmaple online? May 19 20:35:33 i am uncertain of the details. im sure a quick glance at the Camera app will tell you. May 19 20:35:47 (doesn't anyone realize this platform is open source!?) May 19 20:35:59 i do but didn't realize they have it in the source May 19 20:36:52 chouman82: grab the source and check out the packages/apps folder May 19 20:37:00 chouman82: you can learn a lot from those May 19 20:37:23 a _lot_ :) May 19 20:37:40 yea i have it May 19 20:37:49 but for the shared menu just wouldn't know where to start May 19 20:38:50 chouman82: your activity must have the correct intent-filder May 19 20:38:51 filter May 19 20:39:00 was that a life of brian reference jasta? May 19 20:39:44 no May 19 20:40:08 heh movies on my brain i guess May 19 20:41:07 heh...automatic photo uploader could create quite a stream of photos... May 19 20:41:25 chouman82: you want to filter for the SEND action. look at Email, Mms, etc as examples of apps that implement this. May 19 20:41:34 the intent-filter label si what shows up in the menu May 19 20:41:40 girfriend doesn't know a guys phone automatically uploads the photos to the public....and bam May 19 20:41:49 alright let me take a look thanks jasta May 19 20:47:25 ah I can't getIntent().getBundle() in onPause()? returns null pointer.. I just wanna shove some state info in there... May 19 20:47:54 must..save..all..state.. during..orientation...change May 19 20:48:08 palmos brainwasing in effect May 19 20:53:18 soreachilles: you want onRetainNonConfigurationInstance May 19 20:53:36 gehsuntheit May 19 20:53:46 you can later get that object by calling getLastNonConfigurationInstance May 19 20:53:48 nah I just didn't have a bundle in there when I thought I did -- works fine in onPause May 19 20:54:05 soreachilles: use onResume? May 19 20:54:15 so.... what's the benefit of getLastNon*etc ? May 19 20:54:18 saving state through configuration changes should be handled by onRetainNon... trust me. May 19 20:54:33 soreachilles: whoops, I mean onRestoreInstanceState May 19 20:54:51 I'm trying to bottlekneck all my state saving/restoring into onpause, basically.. so I don't have to care what's causing the world go go away and come back May 19 20:55:50 soreachilles: then youre missing out on an important optimization... May 19 20:56:34 at the expense of more code May 19 20:56:41 welcome to mobile development May 19 20:56:47 better learn to factor properly May 19 20:56:51 sure, usually code size is paramount May 19 20:56:56 no, it's not. May 19 20:57:07 code size, battery util.. May 19 20:57:11 anyway May 19 20:57:24 I'll profile around orientation changes to see if adding code will help perf May 19 21:00:35 unless there's a different type of optimization you're talking about with getLastNonConfigurationInstance, ie, something I can't actually measure May 19 21:01:34 like fragmentation... something hideous that I can't see... May 19 21:02:34 who has received the 1.5 over the air ? May 19 21:06:43 how does the google mail app on android get mail updates so fast? May 19 21:06:53 is that code opensource? May 19 21:07:29 no May 19 21:07:49 and I'm pretty sure that it checks for updates pretty often May 19 21:07:52 soreachilles: perhaps constant connection? May 19 21:08:15 it gets it faster than gmail in chrome... there's no way, they gotta be doing push somehow from a server, I'd think... May 19 21:08:21 it's awesome whatever they're doing.. May 19 21:09:03 I doubt they're holding a connection open until it times out, then reestablish,e tc, basically long poll on android... but who knows... maybe.. May 19 21:09:11 hehe, my droid gets gmail updates faster tahn gmail on the web does.hehe May 19 21:09:11 its nice May 19 21:09:21 i know, it's awesome, also sorta frightening May 19 21:09:23 there is a perm connection, you can see it with nestat May 19 21:09:27 soreachilles: they are. this is how most push services are implemented on mobile devices. May 19 21:09:29 netstat May 19 21:09:30 im loving this phone so far May 19 21:09:36 I think much is going over this one May 19 21:09:46 its nice to have a keyboard & a touch screen & be sexy to use May 19 21:09:47 its a long-lived tcp connection waiting for a tickle from the server with a 28 minute app layer keep alive timer May 19 21:10:19 no wonder the battery drains... May 19 21:10:22 heh May 19 21:10:22 this is extremely similar to Microsoft's ActiveSync design, although different than BlackBerry Enterprise Services which use some kludgey SMS stuff May 19 21:10:34 soreachilles: actually, this is very efficient on battery usage May 19 21:10:39 it is well in line with how the mobile radio is designed to work May 19 21:10:43 too bad you can't get a mobitex radio in there, the ole pager networks were nice for that.. May 19 21:10:57 your assumption of poor battery performance is based on a weak understanding i'm sure. May 19 21:11:00 ya May 19 21:11:02 it is May 19 21:11:06 i know. May 19 21:11:43 I'm assuming doing work to keep a connection alive would drain as opposed to being able to sit there doing nothing waiting for an sms-ish signal to arrive May 19 21:11:59 soreachilles: what "work" do you imagine is done? May 19 21:12:04 jasta: why 28 minute? May 19 21:12:31 zhobbs: i do not know the details, but i would confidently guess that it was an arbitrary number based on various factors designed to balance the likelihood of TCP failure against battery performance. May 19 21:12:38 oh doing reconnects to a server while the user sits in a movie theater with no coverage, etc.. May 19 21:12:44 a common range for TCP services is 20-30 minutes, even when PCs are involved May 19 21:13:06 soreachilles: it would never reconnect until coverage re-establishes. May 19 21:13:11 or sits in intermittent coverage, doing reconnects over and over, heh May 19 21:13:15 and even then, it employs an exponential backoff as is reasonable with any similar service May 19 21:13:54 exponential backoff to how long? May 19 21:13:55 a day? May 19 21:14:05 or like 20 seconds May 19 21:16:17 who has received the 1.5 over the air ? May 19 21:17:19 no one May 19 21:18:42 i have May 19 21:18:57 with a special t-mobile testphone May 19 21:26:53 soreachilles: the exact tuning of the service is unknown to me, but any sane engineer can guess at what they are doing with reasonable accuracy. May 19 21:27:04 I guess I disagree, but that's ok May 19 21:27:26 hunterp: i know it's been OTAd by TMobile in europe May 19 21:27:37 on what basis? your thorough investigation into the innerworkings of wireless radios and networks? or on your exhaustive study of TCP? :) May 19 21:27:38 but i haven't heard of TMUS having done so yet May 19 21:32:55 im sad that the latest build out of google is telling me i must reset user data :( May 19 21:33:11 goodbye dev phone :) May 19 21:49:29 sheesh what am I doing wrong.. trying to have a uniform way to handle saving activity state between any sort of onPause() onCreate() onResume() event (including orientation change, shutdown, anything). But I can't figure out how to reference the same bundle the bundle that's passed into onCreate(). That is, getIntent().getExtras() does't seem to be the same bundle as is passed to onCreate() May 19 21:49:50 and onCreate() doesn't seem to get the same bundle as one created in onPause() and passed to getIntent().setExtras(bundle) May 19 21:50:08 the bundle passed to onCreate() is your previous instance's saved state icicle May 19 21:50:23 I'd like to get at that bundle during onPause() May 19 21:50:31 getIntent().getExtras() is whatever parameter bundle was attached to the Intent through which you were launched May 19 21:50:37 ah May 19 21:50:38 so store a copy of it in onCreate(). May 19 21:51:00 ofc you need to be aware that it may be empty or null or whatever May 19 21:51:05 like, the first time you're launched May 19 21:51:10 sure May 19 21:51:31 so if I copy it in onCreate() (after I create it) and push stuff into it in onPause(), another call to onCreate() will see what I stuck in there? May 19 21:51:51 you don't have to copy it, do you? May 19 21:51:55 just stash the one you're given May 19 21:51:58 right May 19 21:52:03 in a varaible May 19 21:52:07 well, a class variable May 19 21:52:14 then you will always have it close May 19 21:52:18 to keep you warm and snug May 19 21:52:57 I was doing that, but storing it with getIntent().setExtras(cachedBundleFromOnCreate) May 19 21:53:10 but onCreate was doing getIntent().getExtras() and it was null.... but I'll double-check May 19 21:53:10 erm May 19 21:53:32 i am not sure you can successfully write to the launch intent as handed to you via getIntent() May 19 21:53:38 I just want to get/set that bundle onCreate's playing with... May 19 21:53:41 also, why bother? just save the object. May 19 21:53:54 k.. maybe that's a better way May 19 21:53:59 onCreate(Bundle icicle) { mSavedIcicle = icicle; .... } May 19 21:54:05 et voila! May 19 21:54:09 right May 19 21:55:00 however, my problem was mSavedIcle.putInt("flag", 123) in onPause() and getting that back in the intent (not sure the wording here) so it would be the same bundle passed in onCreate() May 19 21:57:20 onCreate() { if savedInstanceState == null, savedInstanceState = new Bundle(); mSavedIcle = savedInstanceState;} onPause() { mSavedIcle.putInt("flag", 123"); } but when onCreate() is again called, I'm not getting a bundle with "flag" in it. I'm clearly doing something wrong -- how do I stick the updated mSavedIcle back into the intent? May 19 21:58:34 why are you trying to make the getIntent() one be the same? May 19 21:59:03 so I'm not trying to do anything tricky here... just beat me if I'm doing it wrong and there's a better way May 19 21:59:15 I just want to push state into the bundle that will eventually be passed to onCreate May 19 21:59:16 that's like trying to change a command-line program's arguments to include its preference file contents May 19 21:59:52 it's apples and oranges May 19 22:00:12 the Intent is your command-line arguments, essentially May 19 22:00:27 but the saved icicle is just a record of your state so you can pick up where you left off when the user switches back to your app May 19 22:00:44 great May 19 22:01:12 how do I record that state-record in onPause()? May 19 22:01:31 err, how do I write to that state-record in onPause() May 19 22:02:39 maybe I should just do all state saving with prefs instead of bundles May 19 22:03:00 uh May 19 22:03:17 if you do what i suggested, you have that state record in onPause() because you stored it into mSavedIcicle May 19 22:03:21 back in onCreate() May 19 22:03:25 y May 19 22:04:12 and in onPause() I write to it. However, when onCreate gets called, the savedInstanceState passed in onCreate is null May 19 22:05:44 it's like I need to shove that mSavedIcicle back on the intent... or something... I dunno, or I use prefs I guess May 19 22:06:02 what do I have to import to make ArrayAdapter a resolvable type? android.widget.ListAdapter doesn't seem to be it May 19 22:07:03 bah, android.widget.ArrayAdapter May 19 22:07:34 <_Auron_> anyone know what would cause my openGL surface to be completely blank if I run my app, go back to home, and run it again? May 19 22:09:03 maybe it android decided you didn't need it and deleted it May 19 22:18:50 ... in other words, why isn't a bundle passed to onPause() .. I guess that's ultimately what I'm trying to simulate -- in onPause(), get the same bundle that's passed to onSaveInstanceState() May 19 22:19:58 but since onSaveInstanceState isn't always called, and I have state to save, I'm trying to do it onPause() May 19 22:20:31 I just don't think it can be done -- I think I gotta sprinkle state-saving code around each activity to handle the various cases, or use prefs.. May 19 22:22:42 dont use prefs too aggresively, they get flattened to xml for every commit May 19 22:23:39 a bundle isn't passed to onPause() because YOU ARE STILL RUNNING May 19 22:23:49 ahem. sorry for the shouty. May 19 22:24:27 also, there is no bundle passed *to* onSaveInstanceState() -- there's one *returned* from it. May 19 22:29:33 I'm not running when onSaveInstanceState is called? May 19 22:30:52 I guess I don't see how to write to the bundle in onPause() such that when onCreate gets called, I can get at that bundle. Maybe I missed something May 19 22:31:37 I can create the bundle in onCreate, I can save if off, I can write to it onPause(), but when onCreate gets called, in this particular case due to orientation change, I'm seeing a null bundle May 19 22:31:54 shrug, no biggie, I'll move along May 19 22:47:10 soreachilles: the only way to get information to onCreate() is to set it up in onSaveInstanceState() May 19 22:47:34 anything else you do to carry data across to new instances of the activity has to go through disk storage May 19 22:47:34 which isn't always called May 19 22:47:39 y May 19 22:47:42 ok thanks May 19 22:48:37 onSaveInstanceState() is not a lifecycle callback May 19 22:48:39 Having a freeze when the orientation is changed. May 19 22:48:39 http://rafb.net/p/Gz9O4h15.html May 19 22:48:49 A simle of a testcase as I possibly can make it. May 19 22:49:02 it's called when you're going to be killed May 19 22:49:12 which is not necessarily true each time you're paused, say. May 19 22:49:18 read http://developer.android.com/reference/android/app/Activity.html#onSaveInstanceState(android.os.Bundle) a few times :) May 19 22:49:27 yeah I read it a lot May 19 22:49:38 I was just thinking that since onPause seems like the main state-saving thingie May 19 22:49:52 that I should be able to get at the bundle and do my mojo there.. but... oh well May 19 22:50:12 and of course see also onRestoreInstanceState() May 19 22:50:14 yeah May 19 22:50:14 soreachilles: there are multiple levels of state, by the wya. May 19 22:50:35 yeah... lots of things to do to save state.. I was just trying to bottleneck it all into onpause and shove stuff in that bundle May 19 22:50:48 thanks for the help ctate May 19 22:50:51 there is View/UI state, environment state, and data persistence. you must decide what makes sense for each. May 19 22:50:52 ofc May 19 22:50:57 question about handling ui events: when i click on a TextView, the text inside switches color briefly to acknowledge the click. Is there a way to have that textview still do that when i click on its parent? May 19 22:51:35 emmby: yes, duplicateParentState="true" and make sure the parent has the same state. May 19 22:51:44 that is, the parent is clickable May 19 22:51:47 nice! i'll try that, thanks May 19 22:51:56 android:duplicateParentState, btw. May 19 22:52:52 I think I have to 'go to disk' to save all state accross an orientation change.. unless I do that other hook that is sometimes called, to save an object across orientation change.. May 19 22:53:25 soreachilles: or you could do what youre supposed to do and use onRetainNonConfigurationInstance May 19 22:53:29 like i suggested to you hours ago May 19 22:53:32 that's the optional one May 19 22:53:46 yeah that's the one I was referring to. May 19 22:54:01 er May 19 22:54:06 forget about that estcase I posted May 19 22:54:09 I was hoping to bottlekneck it all into one place, onpause, to handle all cases May 19 22:54:10 what youre proposing is to write a file to disk in the very same process and thread that will read it back out again moments later. May 19 22:54:14 it makes no sense May 19 22:54:18 right May 19 22:54:23 I agree May 19 22:54:24 you could just put all your state in a single object and return the damn thing. then read your state right back in May 19 22:54:29 its totally trivial May 19 22:54:42 it's not a lifecycle callback, it's optional, all these redflags around it that say "i might not get called" May 19 22:54:46 vs,.. onpause on the bundle May 19 22:54:48 your reluctance is mind boggling. May 19 22:54:50 heh May 19 22:54:54 less moving parts = better May 19 22:54:59 one way to save state is better than two May 19 22:55:07 correctly responding to the parts that move = better. May 19 22:55:43 soreachilles: this isnt about having multiple ways to save state, its about multiple dimensions of state May 19 22:56:03 for instance, what if you a had a background thread working on downloading a file and the user changed orientation. what should happen to the thread? how will you get a handle to it again? May 19 22:56:06 yeah I don't disagree at all. onPause "seemed like" the place to handle saving state, so was trying to shove my bits into the bundle there. But, it looks like I would actually need to go to disk in onPause, or handle the method you mentioned,and prlly onSaveInstanceState() onRestoreInstanceState May 19 22:57:03 what if your method to save an object across orientation change isn't called? May 19 22:57:07 it's not guaranteed May 19 22:57:54 if my understanding is correct... May 19 22:58:02 onRetainNonConfigurationInstance() is called only in certain narrowly-defined circumstances May 19 22:58:03 onRetainNonConfigurationInstance right? May 19 22:58:27 specifically: it's called when your activity is being destroyed & relaunched due to a configuration change May 19 22:58:32 Maybe I'm just too anal, but I read this, "This function is called purely as an optimization, and you must not rely on it being called." as "don't rely on me" May 19 22:58:40 ctate: which is what he's handling, by the way. May 19 22:58:58 well sure, you should work properly even if you don't get that call May 19 22:59:07 soreachilles: what it is saying is exaclyt what i am telling you: it is for a particular dimension of state May 19 22:59:15 i.e. if your app gets shut down then happens to have been launched again in the other orientation, say May 19 22:59:16 which jasta's bg thread case wouldn't... May 19 22:59:22 specifically, the dimension of environment state. May 19 22:59:35 not persistent state. May 19 22:59:49 but it's actually pretty damn reliable for the specific case it addresses May 19 22:59:57 ok May 19 22:59:59 [relaunch in the same process to handle an orientation change] May 19 23:00:15 so can someone list all the places I need to handle saving state and restoring it? May 19 23:00:21 for persistent state, you must do something else. something likely different and permanent. May 19 23:00:33 I have two ints i need to save May 19 23:00:35 soreachilles: that sort of depends on what you want the resulting behavior to be May 19 23:00:45 you guys are nuts :) May 19 23:00:54 in a good way... May 19 23:01:21 they're unlreated to anything interesting, like color and uh... some other inet May 19 23:01:22 int May 19 23:01:38 do these ints change "a lot" during the running of your activity, and you want it to look like you're seamlessly picking up where you left off whatever happens? May 19 23:01:46 y May 19 23:02:22 soreachilles: do you realize how easy it is to use onretainnonconfigurationinstance? May 19 23:02:24 even if the user hits 'back' to quit the activity? May 19 23:02:25 yes May 19 23:02:28 it is literally just passing yourself an object May 19 23:02:30 I realize how easy it is May 19 23:02:36 you can hold all your state in a single object and just bloody return it May 19 23:02:39 jasta: yes, but it covers only one of the cases May 19 23:02:43 exactly May 19 23:02:45 and if you get it back on onCreate, take a fast track to getting the data set back up again May 19 23:02:53 so ctate, I can do this... May 19 23:02:57 it is used for environment state preserved during orientation changes May 19 23:03:01 or other config changes May 19 23:03:03 like font changes May 19 23:03:06 it's not that hard, I don't need you to write some doc on how to handle this May 19 23:03:07 soreachilles: i would say do what jasta suggests, storing your ongoing state in a single object that you can pass along through onRetainNonConfigurationInstance() May 19 23:03:19 ok May 19 23:03:25 and then identify the lifecycle points where you want to persist it outside May 19 23:03:26 and then if you really want PERSISTENT state, implement that by serializing your state object May 19 23:03:41 there is an obvious design which can provide both the optimization and the persistent path in a graceful way May 19 23:03:51 that's sort of the high level overview May 19 23:04:07 when you need to persist it is when you know the app is going to be shut down May 19 23:04:21 onSaveInstanceState() is one such indication May 19 23:04:36 it's a pita, I was hoping to do it in onPause.. where's my damn pony... May 19 23:04:49 there's seldom any need to store state in onPause() May 19 23:05:01 that's good, cuz it's pretty hard to do so anyway :) May 19 23:05:22 i mean, not to beat the dead horse, but *why* did you think you needed to save your state in onPause() ? May 19 23:05:33 (maybe we can improve the docs on this) May 19 23:05:35 This callback is mostly used for saving any persistent state the activity is editing, to present a "edit in place" model to the user and making sure nothing is lost if there are not enough resources to start the new activity without first killing this one. May 19 23:05:46 ahh May 19 23:05:49 that's the docs for onpause May 19 23:06:00 "because the docs said so" is a fair reason :) May 19 23:06:14 shrug May 19 23:06:37 although hmmm. May 19 23:07:02 <_Auron_> question.. does using original images based off the android logo violate anything? May 19 23:07:04 it also states that onSaveInstanceState should be used May 19 23:07:05 one would think that onSaveInstanceState() would be called on you if you were going to be killed to free resources for the new activity May 19 23:07:24 _Auron_: there's a discussion on the website of what license pertains to the various images May 19 23:07:36 soreachilles: okay, without consulting the code, here's what i think happens May 19 23:07:42 So I'm having a SurfaceView problem. May 19 23:07:44 onPause() gets called when your app is no longer frontmost May 19 23:08:02 if, in that state, your app is going to be killed unexpectedly, onSaveInstanceState() is called May 19 23:08:17 huh ok May 19 23:08:17 onStop() comes after that May 19 23:08:35 I get an surfaceDestroyed callback and I put the thread drawing on the surface into a wait state after that call. However, the app just locks up after that. May 19 23:08:35 i believe you can get onSaveInstanceState() without a prior onPause() May 19 23:08:45 yes May 19 23:08:47 that happens May 19 23:08:58 but you always get an onpause May 19 23:08:59 svm_invictvs: locks up? sounds like you're deadlocking or blocking the main thread May 19 23:09:15 soreachilles: possibly not in some weird edge cases but okay :) May 19 23:09:20 right May 19 23:09:34 ctate: Yeah, the main thread is blocked in the UI system. NOt in my code. I think I'm putting the surface view into an undefined state. May 19 23:09:40 the point is that i'm not at all sure that you ever get killed unexpectedly without onSaveInstanceState() being called May 19 23:10:20 so here's the thing though... I handle onSaveInstanceState, which I get during oriention change, and I shove bits into it May 19 23:10:21 ctate: http://rafb.net/p/cUHFyK77.html May 19 23:10:26 when onCreate is called, the bundle is null May 19 23:10:45 unless I'm screwing something up, which I can check May 19 23:11:07 soreachilles: huh. May 19 23:11:12 that surprises me May 19 23:11:14 is the bundle passed to onSaveInstanceState not the same bundle that'll be sent to onCreate during orienatiaon change? If so... May 19 23:11:30 maybe it's me.. don't hold me to that yet, it's just what I saw without double-checking May 19 23:11:37 "Called to retrieve per-instance state from an activity before being killed so that the state can be restored in onCreate(Bundle) or onRestoreInstanceState(Bundle) (the Bundle populated by this method will be passed to both). " May 19 23:11:43 yeah exactly May 19 23:11:56 so I thought I'd use that instead of that onRetain function to pass the object thru an orientation change May 19 23:12:01 ctate: http://rafb.net/p/gHv4FP70.html May 19 23:12:05 so i'd expect that after onSaveInstanceState() pushed some stuff into the bundle, the subsequent onCreate() would have that stuff in the bundle May 19 23:12:09 That's the state of the two threads of interest. May 19 23:12:11 yeah met oo May 19 23:12:19 svm_invictvs: i really am not savvy about graphics stuff :( May 19 23:12:46 I'm thinking I need to post the outstanding calls. May 19 23:13:22 svm_invictvs: yeah, the main thread is clearly blocked waiting for something May 19 23:13:47 and the renderer thread is waiting for the surface... is it holding a lock at that point/ May 19 23:13:49 ? May 19 23:14:34 ctate: Well, it has a canvas object returned by a call to lockCanvas() But the canvas get destroyed. May 19 23:14:45 er, not the canvas, but the surface May 19 23:14:55 mmmf. i'm so not the person to ask this :) May 19 23:15:14 ctate: I'm thinking i need to keep better track of my states and post the draw even if the surface has been destroyed. May 19 23:16:11 I'm thining that blocking the UI thread while posting the last draw is a BadIdea(tm) May 19 23:16:32 ctate: This is the last bug before i relase my game >< May 19 23:21:44 svm_invictvs: woo? ;) May 19 23:22:44 Yeah May 19 23:23:05 ctate: Who could we talk to about getting it "featured" May 19 23:23:30 i have no idea. look through the Market publisher UI for info or contacts, i guess. May 19 23:23:40 (And how big of a check do I have to write?) May 19 23:42:59 so I've got a hello,world app where on orientationchange, onSaveInstaneState is called, I shove bits in the bundle, and it's there in onCreate() -- as expected -- phew. So I may impl that onRetation function as an optimization, but hooknig these onSaveState() onRestoreState() seems reasonable too May 19 23:44:11 do you get onSaveInstanceState() in the changed-orientation case? May 19 23:44:19 i would expect so May 19 23:44:39 yeah May 19 23:45:25 I shove bits into the bundle, and they're there onCreate() which is good enuf.. I can hook onPause for stuff that may need to go to the db, and onSaveInstanceState for stuff that doesn't May 19 23:45:49 I think that's what the docs are saying to do anyway, I was just trying to do everything in onpause May 19 23:47:27 i have a possibly-wrong theory, soreachilles May 19 23:47:50 which is that you can save state in whichever of onSaveInstanceState() or onStop() is called first May 19 23:47:55 and not worry about anything else May 19 23:48:02 awesome May 19 23:48:05 onstop? May 19 23:48:10 :) May 19 23:48:10 is a bundle passed to that? i didn't even check May 19 23:48:12 no May 19 23:48:15 heh May 19 23:48:40 but if you want to store state across actual quit/restart sequences -- like, with the user hitting Back -- then you need to deal with that as well May 19 23:49:00 you may not get an onSaveInstanceState() call in that case, since the teardown of your activity is "expected" May 19 23:49:31 yep -- but... May 19 23:49:57 mmm? May 19 23:50:02 in the back-button case, I"m not sure how you'd get to your bundle.. actually I need to work up these scenerios in hello,world as I'm kind of polluted my main app May 19 23:50:26 soreachilles: in the back button case, you would need to use persistent storage May 19 23:50:35 yeh nevermind, at this point, knowing new stuff, I gotta work up from hello,world -- but what i was going to say is I don't thnk onPause lets you write to the bundle that shows up in onCreate May 19 23:50:37 for instance, Gmail saves your message as a draft if youre in compose mode. May 19 23:50:42 it saves this permanently to the database May 19 23:50:53 you can't use the bundle? May 19 23:50:58 no, of course not May 19 23:51:13 soreachilles: we're talking about saving state when the user quits your app May 19 23:51:14 ya that makes sense, from one pov... May 19 23:51:16 sure May 19 23:51:16 your thinking is all wrong soreachilles :) May 19 23:51:23 nah, I get it.. but from a lifecycle pov May 19 23:51:24 the Bundle handling is just for *unexpected killing* of your app May 19 23:51:27 it's the same as orientation change May 19 23:51:29 ya May 19 23:51:59 i think it's nearly the same flow of events as orientation change though... in which case you do get onSaveInstanceState so you can shove bits in the bundle May 19 23:52:04 it's a convenience for "oh sorry i had to tear you down but here's what you said to save HTH" May 19 23:52:09 yeah May 19 23:52:34 so when's onSaveInstanceState called? Just orientation change? May 19 23:52:42 but you don't get that when it's an explicit quit due to 'back' or if the activity calls finish() or whatever May 19 23:52:55 i did tell you to read the javadoc on it several times :) May 19 23:53:11 it's called when the OS determines that your activity is going to be killed unexpectedly May 19 23:53:32 let's say you're Activity A May 19 23:53:41 and the user hits Home May 19 23:53:50 A keeps running, of course. May 19 23:53:54 hehe May 19 23:54:02 but then let's say the user goes to the browser and tries to open up a 4chan page or something May 19 23:54:08 grind grind memory urk May 19 23:54:32 so to clear up some space, the OS winds up killing live apps that happen to be int he background, i.e. yours May 19 23:54:39 THEN you get onSaveInstanceState() May 19 23:54:53 (iirc) May 19 23:55:13 cos you're being killed without the user or the app having done anything to say you want to go away now May 19 23:55:15 but it passes an 'out' bundle May 19 23:55:26 soo... May 19 23:55:29 which the OS stashes and gives back to you the next time you're launched May 19 23:55:32 awesome May 19 23:55:43 i'd like that on every other onAppExit case too... May 19 23:55:46 basically.. May 19 23:55:52 "O HAI i had to kill you off summarily last time, but you said this was what you wanted me to tell you next time so here" May 19 23:56:21 seems like the same case as user hits back button, gimme the same bundle you'd give me (which is an outbundle) onSaveInstanceState May 19 23:56:21 but that's as far as the OS goes in terms of helping you out May 19 23:56:38 a lot of apps just save to their usual backing database or whatever in their onSaveInstanceState() methods May 19 23:56:45 ah May 19 23:56:47 right May 19 23:57:03 yeah I wanted to use that bundle... and use that bundle in every other 'app exit' scenerio too May 19 23:57:14 it's like android's nice and hands you a bundle when it's killing you, but when you're just exiting, you're on your own.. May 19 23:57:16 oh well :) May 19 23:57:19 y May 19 23:57:21 :) May 19 23:57:24 in the general case, the bundle isn't enough May 19 23:57:34 you happen to fall into the category where it IS enough May 19 23:57:37 sorry :) May 19 23:58:23 it's all good, I think this works fine, and I don't need to persist an object accross orientation... and I've now got the bbq fired up, come on over, bring beer :) May 19 23:58:35 just 3000 miles or so... May 19 23:59:31 bbq? In Australia I hope? Beam and coke instead of beer ok? May 20 00:00:51 just keep 'em separated :) May 20 00:01:08 * ctate is more an Old Fashioned guy than a mix-with-coke guy May 20 00:02:40 now i hear my bottle of Bookers calling my name. curse you. May 20 00:04:03 pig's cookin May 20 00:07:57 mmm Bookers, nice. Don't mind Evan Williams either May 20 00:19:07 at the moment i have a mostly-empty bottle of Baker's and a 2/3-full bottle of Bookers that was on humongous sale May 20 00:19:14 both are quite nice :) May 20 00:19:54 * emmby is rather fond of Noah's May 20 00:20:51 Bookers and Bakers are great too, but noah's has a smooth finish May 20 00:27:49 good to know May 20 00:29:09 i'm told i should acquire some Four Roses as well May 20 00:30:39 emmby: that's Noah's Mill? May 20 00:30:50 yeah May 20 00:30:54 four roses is great! May 20 00:31:03 oh, lots of rye in Noah's. that's not typically something i favor. May 20 00:31:13 (not a fan of Basil Hayden, for example) May 20 00:31:16 but noted! May 20 00:31:37 they were a great brand 40+ years ago, but then they got bought out and started selling the budweiser of bourbons in the US (but kept shipping their good stuff to the UK) May 20 00:31:45 meh May 20 00:31:45 but they just last year started releasing their good stuff in the US again May 20 00:31:59 i have to say Beam has a great lineup May 20 00:32:22 too bad about you and rye, i've basically made the jump over to rye these days and really like it May 20 00:32:25 there's a bar in SF that has 35-40 different bourbons May 20 00:32:27 heh May 20 00:32:35 i should get up there again soon May 20 00:32:41 alembic? May 20 00:32:46 that's the one! May 20 00:32:56 it's within stumbling distance of my place :) May 20 00:32:57 expensive but they're really good May 20 00:33:02 lucky you May 20 00:33:06 or unlucky May 20 00:33:11 heh May 20 00:33:26 * ctate lives on the other side of the bay bridge from you May 20 00:33:34 on the off chance, do you know someone named Nori? May 20 00:33:42 i don't think so May 20 00:33:56 k, she's often at whiskey thursdays May 20 00:34:01 drinking buddy of mine May 20 00:34:03 aha May 20 00:34:08 i've only been to the Alembic twice so far May 20 00:34:16 wound up spending a ton on food both times :) May 20 00:37:26 if you're just looking for selection, there's another bar at 14th and Folsom called Nihon that supposedly has the most whiskeys in SF. http://www.goodrec.com/restaurants/san-francisco-ca/nihon/ May 20 00:38:03 alembic has better stuff (and MUCH better staff), but nihon has a wider selection May 20 01:57:02 Hey, how do I make a long textview (or group of textviews) scrollable? May 20 01:58:06 ttuttle: I think Android does it by default if the text is too long May 20 02:01:10 no hard buttons, how to process home, back and menu? May 20 02:01:21 sammyF: It doesn't, AFAIK. May 20 02:04:59 ttuttle: one sec. I'll paste my eula activity's layout and the code May 20 02:05:15 sammyF: I got it. May 20 02:05:17 sammyF: No need. May 20 02:05:30 ttuttle: it has a scrollbar, and I'm not aware of having specified it should (not that I don't want it, on the contrary) May 20 02:06:45 what's the best way to play sound effects without getting too much of a framerate hit? May 20 02:41:26 how do you find the version of your app in code? May 20 02:57:58 how do you find the version of your app in code? May 20 02:58:29 nwmotogeek, getContext().getPackageManager().getPackageInfo(getContext().getPackageName(), PackageManager.GET_ACTIVITIES).versionName May 20 02:58:31 :) May 20 02:59:09 I have a very technical question ... May 20 02:59:20 also nwmotogeek, please don't repeat your question, especially 15 minutes from each other May 20 02:59:24 sammyF, so go ahead and ask May 20 02:59:52 what would you use on a button, as opposite for "Zen Master" (which would be the hard level) in a game asking for concentration and calm hands? ;) **** ENDING LOGGING AT Wed May 20 02:59:57 2009