**** BEGIN LOGGING AT Sat May 16 02:59:57 2009 May 16 03:01:08 meanburrito920_: they return 0 before the first layout May 16 03:32:15 hmm, all this sync machinery sure is interesting to read :) May 16 03:32:23 i wonder if this is how google services implement sync May 16 03:32:36 cool how you can make memory resident sqlite databases ;) May 16 03:35:17 romainguy: so how would I get it to layout in the constructor so i can grab the size when I construct it? May 16 03:35:25 you don't May 16 03:35:28 you wait for onLayout() May 16 03:35:35 or onMeasure() May 16 03:48:15 has anyone verified the appwidget example in ApiDemos? There seems to be a lot wrong with it May 16 03:48:36 what's wrong with it? May 16 03:49:47 in ExampleAppWidgetProvider.java it sets COMPONENT_ENABLED_STATE_ENABLED in both onEnabled and onDisabled. Which may be right, it just didn't seem logical May 16 03:49:58 it doesn't have the workaround for onDeleted not being called May 16 03:50:00 could be a copy/paster mistake May 16 03:50:06 jsharkey: ping ping May 16 03:50:17 and the broadcastreceiver May 16 03:50:34 calls loadAllTitlePrefs to populate some arrays May 16 03:50:38 but that function is empty May 16 03:54:04 is there an existing way to get a list of all widgetids of a particular type? I was thinking of adding a static ArrayList and initializing/populating it in the onCreate of my provider then writing a static function to retrieve it if not. Anything wrong with that approach? May 16 03:54:18 ask jsharkey May 16 03:55:44 cool - thanks romain :) May 16 03:56:12 sorry I can't help more :) May 16 03:56:38 no worries - if everyone knew everything about the android api I'd already know it and be questionless :) May 16 03:57:09 yeah but in a way I should know about appwidgets :)) May 16 04:05:07 having trouble figuring out from the SmsManager docs if there's a broadcast intent I can receive for STATUS_ON_SIM_SENT and STATUS_ON_SIM_READ May 16 04:16:50 :/ can't find the ISms service implementation in git - I guess it's not in base - anyone seen it? :D May 16 04:34:36 romainguy: hm? May 16 04:34:48 romainguy: ohbtw i hacked listview so i know when it scrolls :) May 16 04:34:55 argh May 16 04:35:21 I'm not gonna accept a patch that fires an event every time it scrolls by one pixel :) May 16 04:35:51 romainguy: no i just inherited May 16 04:35:53 i grab the offset May 16 04:36:20 then that's fine :p May 16 04:36:34 hi jsharkey - you up for some widget harassment? May 16 04:36:41 yes he is :p May 16 04:36:43 doh May 16 04:36:45 err I mean questions :) May 16 04:36:54 actually taking a call, but ill brb May 16 04:37:10 B-) May 16 04:39:33 skyPhyr-: back :) May 16 04:39:45 you really meant the r in brb :) May 16 04:39:54 eh i didnt know how long phonecall would be May 16 04:40:13 I have a whole bunch of questions - though I guess I'll start with the ones about docs May 16 04:40:40 can you check an hour and 2 minutes ago in here to save me spaming again? May 16 04:40:53 sure lemme scrollback May 16 04:41:03 sorry - not that long May 16 04:41:07 52 minutes :) May 16 04:41:49 hmm yea the apidemos example was kinda neglected there for awhile May 16 04:42:08 cool - just thought I'd check that first incase I was not understanding something :) May 16 04:42:25 just after that I ask about a widgetid list :) May 16 04:42:25 i dont think anyone has actually tested it for a couple months May 16 04:42:50 yep, use getAppWidgetIds(ComponentName provider) May 16 04:43:02 ahhh sweet - thanks - that's much easier :) May 16 04:43:12 where the component name is the actual widget type (the broadcastreceiver/appwidgetprovider) May 16 04:43:22 from appwidgetmanager May 16 04:43:31 gotcha :) thanks May 16 04:43:48 i had to do that in my forecast example because i had multiple types in the same project May 16 04:43:57 is there anything wrong with my having the widget get called by an alarm? May 16 04:44:19 nope, thats actually how we did the calendar one. it schedules an alarm for the next time it needs to flip May 16 04:44:26 which might be 30min or 3 days May 16 04:44:28 I decided to put something together for the droid dev contest as it gives me practice and an app I can maybe one day sell. Being in Australia can suck sometimes May 16 04:44:43 aw australia is awesome :) May 16 04:45:04 hehe tell that to Eric - he didn't even reply when I asked wtf with regards to Australian devs in the market May 16 04:45:28 I did ask it more politely than that though :) May 16 04:45:33 oh? i know they are working hard to roll stuff out asap May 16 04:45:34 eh May 16 04:45:46 it's not that easy :) May 16 04:45:53 there was nothing public at the time I ordered my dev phone saying paid apps would only be US and UK initially May 16 04:45:53 if it were, it'd be done already May 16 04:46:14 yeah - I know - was just annoying that I didn't find out that I can't sell any apps through there until after I'd ponied up the cash for the phone etc :) May 16 04:46:14 believe us, the market team is working really hard to roll out in different countries May 16 04:46:27 at least it gives you time to polish your app :) May 16 04:46:40 i worry they arent getting enough sleep :/ i keep seeing them there at random hours May 16 04:46:42 hehe - I've been focusing on stuff that can hopefully generate cash while being released free May 16 04:46:51 cool May 16 04:46:59 this widget is an exception, but it's good practice - may just give it away May 16 04:47:07 would have saved my arse a number of times in the past May 16 04:47:19 what is it? (if you can say) May 16 04:47:24 it's to monitor when you last had contact with someone (i.e. the Mrs) and set off an alarm if it's too long May 16 04:47:36 so when you go out drinking you dont' forget to call each hour May 16 04:47:37 uhuh May 16 04:47:41 or your mom lol! May 16 04:47:51 hehe May 16 04:48:07 damn May 16 04:48:10 I need to write my slides @!# May 16 04:48:13 yeah - I put a days option in there for that mum case :) May 16 04:48:34 I assume I should avoid having the widget flash when the alarm goes off? May 16 04:48:40 just highlight the call buttons or something? May 16 04:49:19 romainguy: wow you kept your abstract very vague May 16 04:49:42 jsharkey: like you said, I have experience :p May 16 04:50:04 any ideas where I can find isms? I want to check what broadcast I need to receive to know when an sms is sent/received May 16 04:50:23 or is isms closed? May 16 04:50:54 jsharkey: I just read my abstract, it's not that vague May 16 04:51:33 it could be a set for an hour long session on listview :P May 16 04:51:37 this for google|io romain? May 16 04:51:41 yeah May 16 04:51:44 jsharkey: I wouldn't dare May 16 04:51:56 but yeah, I could have a 4 hours session on ListView :) May 16 04:52:05 want someone to look over it before? ;) can't make it there myself :( May 16 04:52:21 no thanks :) May 16 04:52:45 romainguy: thats because you'll finish it the morning of :P May 16 04:52:52 actually May 16 04:52:55 I did do that a couple of times May 16 04:53:06 once for JavaPolis/Devoxx I started writing the slides at 4am May 16 04:53:09 the session was at 9am :p May 16 04:56:05 hmmm - would I be correct from the SmsManager stuff that it doesn't broadcast sms notification system wide for anyone to pickup? May 16 05:03:46 OK this is driving me crazy: Does anyone have a tutorial that shows one how to change the UI at runtime? I have a reference to a linearlayout, I create a new linearlayout, add to it a textview and add the new one to the old one, but nothing ever changes. May 16 05:04:57 wait what May 16 05:05:05 you add a linearlayout to a textview?? May 16 05:05:08 No May 16 05:05:15 ah sorry May 16 05:05:16 misread :)) May 16 05:05:20 I add a textview to a linearlayout then add it to the parent one :p May 16 05:05:22 anyway May 16 05:05:24 show your code May 16 05:05:34 I'll summarize and pastebin May 16 05:07:29 are the telephony providers included in 1.5, but not mentioned in the docs? May 16 05:07:33 http://pastebin.com/m1fbcf3fe May 16 05:07:57 er maximumbob May 16 05:08:37 what are the LayoutParams here? May 16 05:08:54 'import android.widget.LinearLayout.LayoutParams' May 16 05:10:06 doesn't look wrong to me May 16 05:10:17 have you tried calling playerList.requestLayout()? May 16 05:10:31 I know that every part of the code is reached through log messages May 16 05:10:59 Well that fixed it May 16 05:11:05 do I have to do that every time I change something? May 16 05:11:16 yes May 16 05:11:19 aha :) May 16 05:11:21 well, when you change the layout May 16 05:11:27 invalidate() is used when you change the drawing May 16 05:11:31 ok May 16 05:11:46 Yeah I looked everywhere for a 'repaint' or 'redraw' sort of method May 16 05:11:54 I adapted that code from a tablelayout tutorial May 16 05:11:57 where it didn't need that May 16 05:12:32 well May 16 05:12:33 it's weird May 16 05:12:42 because, as I thought, addView() does a requestLayout already May 16 05:13:42 hm May 16 05:13:48 odd May 16 05:14:05 I just added the requestLayout the next line after addView and it worked fine May 16 05:14:41 Also, quick eclipse question you might know: Is there an option to automatically run as "android application" when I hit run? May 16 05:14:41 then I don't know what's going on with your code ^^ May 16 05:21:22 How do I 'use' an R.string value? May 16 05:21:27 in the code itself May 16 05:21:39 getString(R.string.xxx) May 16 05:21:43 or getText(R.string.xxx) May 16 05:21:51 Which is preferred? May 16 05:21:58 getText() May 16 05:22:02 oh jsharkey: the SYNC_ID stuff you mentioned. Any chance you've popped on the dev list this morning? I had a couple more Qs there about that May 16 05:22:04 ok thanks May 16 05:22:09 because it supports formatting and stuff like that May 16 05:22:15 _SYNC_ID rather May 16 05:22:32 ill take another pass over, brb May 16 05:23:09 jsharkey: you rock - thanks May 16 05:23:24 Hm - strings.xml seems to ignore leading spaces. Shall I escape it? May 16 05:23:36 the syntax is: May 16 05:23:40 that didn't work May 16 05:23:45 " string with leading spaces" May 16 05:23:50 Aha May 16 05:23:59 stripping out leading spaces is part of the XML spec May 16 05:24:01 and if I need to use a quotation mark? May 16 05:24:04 really? May 16 05:24:10 \" inside the "" May 16 05:24:16 Funny - I use xml a lot and never seem to have run into it :p May 16 05:24:38 that's the only way you can get indent working correctly :)) May 16 05:25:57 skyPhyr-: doh i forgot about the non-synced stuff May 16 05:27:37 skyPhyr-: are you going to be writing contacts data? May 16 05:27:58 jsharkey - no - it's just for that widget. May 16 05:28:04 oh ic May 16 05:28:22 jsharkey: as people could have it on their desktop for a long time May 16 05:28:48 I could just go for name I guess and assume it won't change/have dupes May 16 05:29:08 or make it just work for a single phone number May 16 05:31:00 ugh there isnt anything that joins contactmethods+contacts by name May 16 05:32:02 so have it work on a single phone number is probably the most reliable option? May 16 05:32:16 and wait for donut ;) May 16 05:32:31 hmm you probably want to stay away from write contacts May 16 05:32:49 otherwise you could throw the appwidgetid into a contactmethod with a weird IND May 16 05:32:52 *KIND May 16 05:33:07 although im not sure if a sync blows away stuff it doesnt recognize May 16 05:34:32 skyPhyr-: yea sry :/ its not an easy problem to solve May 16 05:34:39 hmmm bugger May 16 05:34:48 no worries, thanks for taking a look May 16 05:35:35 are you mostly interested in the phone number (for sms+call), or the rest of the contact methods too? May 16 05:35:51 jsharkey: I want listview and custom views in widgets :p May 16 05:35:57 mostly sms and call - I could just grab all numbers and store them May 16 05:36:02 romainguy: go away :P May 16 05:36:07 aaaw come on :) May 16 05:36:23 just means if they edit the contact later the number wouldn't update May 16 05:36:29 which would make people pick on me May 16 05:36:32 and point and laugh May 16 05:36:47 numbers dont change /that/ often though May 16 05:36:57 yeah - names probably less often May 16 05:37:00 perhaps I store the name May 16 05:37:10 the issue with the name is that youd have to do two queries May 16 05:37:12 skyPhyr-: people pick on me because Home's contacts shortcuts don't update :p May 16 05:37:28 one to find all contactids with that name, then a second one to lookup all matching contactmethods May 16 05:37:35 though if I just did it in onCreate that'd be ok right? May 16 05:37:46 so in onCreate I pull the name - get the PERSON_ID May 16 05:37:51 and use the person ID for that session May 16 05:38:04 that way PERSON_ID is being used for a relatively short period May 16 05:38:15 actually phone could sync within a session May 16 05:38:18 blasting that away May 16 05:38:24 skyPhyr-: oh yes, those ids are plenty good for that length of time May 16 05:38:26 romainguy: Home's contacts? May 16 05:38:42 yeah if you create a shortcut to a contact on Home's screen May 16 05:38:46 skyPhyr-: yea, home stores the person_id in its contact shortcuts :/ May 16 05:38:47 and change the contact's name or photo May 16 05:38:50 it doesn't update the shortcut May 16 05:38:58 jsharkey: I blame Contacts.apk :p May 16 05:39:04 romainguy: why not? ;) May 16 05:39:06 hehe May 16 05:39:18 skyPhyr-: because I don't have time to do it :p May 16 05:39:48 the contact shortcut thing will be fixed in an upcoming version tho May 16 05:39:55 jsharkey: any sync could change the PERSON_ID right? May 16 05:40:00 it needs more than that jsharkey May 16 05:40:10 we also need to make the shortcuts update their labels on locale change May 16 05:40:12 bleh May 16 05:40:13 skyPhyr: it /could/, but probably wont May 16 05:40:26 is there a broadcast when somebody's details change? May 16 05:40:31 name/number/something else? May 16 05:40:42 sup jeffrey May 16 05:40:43 hmm i dont think so May 16 05:40:47 mr jasta ^.^ May 16 05:40:59 gonna be in SF sat thru mon btw May 16 05:41:05 like tomorrow? May 16 05:41:08 yup May 16 05:41:18 oh sweet May 16 05:41:38 going to bay to breakers with some googlers May 16 05:41:47 is there a broadcast when sync finishes? May 16 05:42:14 going to bay? May 16 05:42:27 "bay to breakers"... May 16 05:42:42 * jsharkey still lost May 16 05:42:56 jsharkey: look it up May 16 05:42:59 http://en.wikipedia.org/wiki/Bay_to_Breakers May 16 05:43:06 it's some fucked up San Francisco thing :p May 16 05:43:17 i've heard only good things ;) May 16 05:43:28 doesn't mean it's not fucked up :p May 16 05:43:36 almost guarantees that it is May 16 05:44:00 although... May 16 05:44:01 "In February 2009, city officials and race sponsors announced major changes to the race regulations. The regulations included an official ban on Floats, alcohol, drunkenness, and nudity" May 16 05:44:10 if that applies, it will probably a lot less fun than it usually is May 16 05:44:13 yeah i know, but i've heard that they are taking a big step back May 16 05:44:19 because they got so much public outcry May 16 05:44:21 * skyPhyr forgot jsharkey before: is there a broadcast when sync finishes? May 16 05:44:26 no kegs this year though, but still there should be drinking May 16 05:45:07 skyPhyr: yea i was just looking, it doesnt look like it :/ May 16 05:45:21 even though there is ACTION_SYNC, it doenst look like anything broadcasts it May 16 05:45:36 jsharkey: d'oh - all these creative ideas to sidestep it and they all suck :( May 16 05:46:49 ok - how's this for a plan May 16 05:47:03 each time I need to check again to see if there's been a more recent call to my contact May 16 05:47:22 oh before that... I store name, and all phone numbers May 16 05:47:32 when they first choose the contact May 16 05:48:05 now each time I check I first lookup the PERSON_ID and compare the name with the stored one May 16 05:48:21 if that's the same I assume it's the same contact and update the phone numbers from the list May 16 05:48:32 if the name doesn't match I check if any of the phone numbers do May 16 05:48:48 if one of the phone numbers stored matches I assume the name changed May 16 05:49:22 if neither the name nor the phone numbers match I do a search for the stored name and update the stored PERSON_ID to that if it's found May 16 05:49:43 if I don't find the name I cause the phone to freeze (can you help me out with that bit - could be hard) May 16 05:50:39 jsharkey, romainguy: any thoughts on if that's ugly enough? May 16 05:51:21 skyPhyr: I would have to read the last 20 lines first :)) May 16 05:51:29 and it's Friday night :)) May 16 05:51:46 Does anyone here know how to debug c code in android source (part of the android platform)? May 16 05:51:52 ahh yes - timezones are fun - Saturday afternoon here :) May 16 05:51:57 hehe May 16 05:52:08 go have yourself a good scotch/rum May 16 06:09:49 this is very interesting. google's sync machinery is pretty clever. seems to version every single record and implement the merging of remote and local databases totally generally May 16 06:09:59 as just merging two compatible abstract databases May 16 06:10:48 im surprised all this code is open sourced :) May 16 06:11:10 eh, we do some things right :p May 16 06:11:25 i could possibly even find a way to use this code... May 16 06:11:38 if only you had a syncid for local numbers :( May 16 06:11:50 the only thing that i wonder about is how the server knows which records to play back. there must be some sort of per-row signaling happening to mark that the client got that particular update just fine May 16 06:12:12 also, from the looks of it it seems to permit "partial" syncing but im not sure how that can be done generally like this May 16 06:12:19 jasta: which library are you reading? May 16 06:12:25 the database could get into an inconsistent state if you treat the sync atomically on a per-row basis May 16 06:12:33 skyPhyr: AbstractTableMerger, mostly. May 16 06:14:17 i guess the interesting part that im missing here is who implements SyncableContentProvider and TempSyncAdapter May 16 06:14:24 err TempProviderSyncAdapter May 16 06:15:26 oh wait, maybe it doesn't actually merge these changes into the real provider until after it all succeeds May 16 06:15:35 it just lets the temporary content provider remain dirty May 16 06:15:40 thats an interesting little design :) May 16 06:15:58 Is there any existing persistent store that handles Bundles? SharedPreferences seems to just be the basics. Writing files my best option? May 16 06:16:22 the platform only provides sqlite and SharedPreferences :) May 16 06:16:25 dont persistently store a bundle, its serialized format will not be guaranteed portable May 16 06:16:31 romainguy: it also provides files. May 16 06:16:44 jasta: well besides files I meant May 16 06:17:02 thanks romainguy - sqlite seems overkill so I'll go for files. Should be performant enough for small settings right? May 16 06:17:07 skyPhyr: sharedprefs are backed by files, btw. there's no reason to impelment your own file-backed storage that acts just like it May 16 06:17:11 why not sharedpreferences? May 16 06:17:26 I want to have arrays May 16 06:19:14 kind of surprised it doesnt have that actually May 16 06:19:15 shame :) May 16 06:19:17 would be very nice if sharedpreferences supports anything Parcelable May 16 06:19:33 patches are welcome :p May 16 06:19:36 skyPhyr: it doesnt on purpose. as i said, Parcelable's don't have storage portable formats May 16 06:19:41 romainguy: not this time :) May 16 06:19:53 Parcelable should not be serialized to disk. It's format could change between android releases. May 16 06:19:56 jasta: they're portable if you make it so it flattens them right? May 16 06:20:16 when you're making your class May 16 06:20:23 skyPhyr: no, they aren't portable. a future android version could change the format with no regard for backwards compat. then, your stored data would be unreadable. May 16 06:20:24 Parcelable is just an interface May 16 06:20:40 ahhh - thanks jasta May 16 06:20:43 you could write Parcelables to disk in a different format than the one used for ipc for instance May 16 06:20:51 but May 16 06:20:53 I'm ok to use them for temporary data right? May 16 06:20:59 it's not a good idea indeed May 16 06:21:09 if only because there are parcelable things you don't want in sharedprefs May 16 06:21:09 skyPhyr: yes, so long as you do not intend to store that data. May 16 06:21:13 like Bitmaps :p May 16 06:21:43 romainguy: this is strongly worded in the documentation of Parcel :) May 16 06:21:50 yeah - makes sense - arrays of the basics would do the trick for most stuff I'd want to put there anyhow May 16 06:22:07 skyPhyr: of course, you could just serialize your array and store it as a string in sharedprefs May 16 06:22:07 plus a fromString for your classes should solve any others you really wanted May 16 06:22:07 jasta: that doesn't mean we cannot change the implementation to support a different kind of persistence May 16 06:22:22 but yes, the current and only implementation is definitely not portable May 16 06:22:32 romainguy: yes i think that it does. it is defined to not be appropriate for persistence. May 16 06:22:44 argh May 16 06:22:45 if you later redefine it, fine, but that would not make its current definition invalid. May 16 06:22:53 that's what I'm saying May 16 06:23:39 would it be possible to inherit from SharedPreferences to add support for arrays in an app delivered to 1.5? May 16 06:23:58 skyPhyr: only superficially, since you don't have access to its serialization mechanics. May 16 06:25:15 jasta: ahhh ok - so I'd have to use some kind of hack that just mangled keys? May 16 06:25:44 basically, but dont do that May 16 06:25:54 i suggest you just serialize your array if its trivial. store it then as a string. May 16 06:26:03 if your data is not trivial, design your own file-backed persistence. May 16 06:26:06 or use sqlite May 16 06:26:25 thanks jasta - it's trivial enough - just a list of phone numbers May 16 06:26:26 whatever you do, don't use Serializable. May 16 06:26:52 does android make any guarantees regarding formatting of phone numbers? May 16 06:27:06 skyPhyr: oh, well my suggestion does not scale btw. so it might be best to just write keys like foo0, foo1, foo2. that said, for this functionality i ended up designing my own persistence ;) May 16 06:27:12 I noticed the input ones (which are really annoying over here as we don't format our numbers that way) are just applied at input May 16 06:27:40 skyPhyr: i doubt that it does. there isn't a reasonable standard for formatting phone numbers because they are location dependent May 16 06:27:42 well especially since shared prefs are currently stored as XML May 16 06:27:43 jasta: yeah - already need to do something like that for widgetIds May 16 06:27:52 storing arrays can be... hmm... not very efficient :) May 16 06:28:21 I don't think there'll ever be many to put in there May 16 06:28:27 it'll just be the numbers for a particular person May 16 06:30:06 hmmm maybe I should be less lazy and use SQLite May 16 06:30:11 probably May 16 06:31:04 yeah - will do that and stop being lazy :) May 16 06:31:20 at least it'll be relatively clean May 16 06:36:26 eh May 16 06:36:47 patches from T-Mobile May 16 06:36:49 nice May 16 06:37:03 i saw that you rejected it. give 'em hell ;) May 16 06:37:09 it's not rejected May 16 06:37:13 I just didn't approv May 16 06:37:14 +e May 16 06:37:15 hehe May 16 06:37:20 yes, true May 16 06:37:30 but that's the kind of patch I like May 16 06:37:39 small bugs, easy to fix, that none of us have time to look at May 16 06:38:15 ive got a few changes im trying to get approved to go into the tree too May 16 06:38:35 getting approved by t-mobile you mean? May 16 06:38:40 basically fixing some places where you guys got lazy with your styled attributes system :) May 16 06:38:44 yes, by t-mobile. May 16 06:38:52 eh, we had to ship 1.0 :) May 16 06:39:11 a couple of them im not so sure if theyre bugs or what May 16 06:39:36 like LinearLayout not calling through to its super(context, attrs, defStyle) constructor May 16 06:39:53 makes it so you cant style a LinearLayout if you extend it. May 16 06:40:48 that's probably because we never had to style LinearLayout :p May 16 06:40:57 right, but meanwhile RelativeLayout and such do. May 16 06:41:02 yeah May 16 06:41:04 so it's kind of odd May 16 06:41:04 it depends :) May 16 06:41:09 like I said May 16 06:41:11 we had to ship :) May 16 06:41:23 well anyway i fixed it, and many other places just like it May 16 06:41:39 the Dialog system in particular just sacks the whole theme/style thing entirely. May 16 06:41:54 entirely is a strong word :) May 16 06:42:00 yeah well look at it! :) May 16 06:42:04 yeah I know May 16 06:42:04 it hardcodes everything May 16 06:42:21 but I remember writing the goddamn ContextWrapper or something like that to make dialogs and themes work May 16 06:42:28 and the AlertDialog stuff to make that framed popup is such a shame. May 16 06:42:33 but AlertDialog's implementation is a mess May 16 06:42:33 ContextThemeWrapper? May 16 06:42:36 yes that one May 16 06:42:51 I'm not responsible for AlertDialog and I despise its implementation :p May 16 06:43:01 im glad, so do i :) May 16 06:43:34 other than the Dialog mess, i adore the theme system :) May 16 06:43:39 obtainStyledAttributes is sexy May 16 06:43:50 I find it very confusing and complicated :) May 16 06:44:01 oh yes, the C++ side is a zoo May 16 06:44:16 but once you understand it, it's very nice May 16 06:44:49 to be fair with AlertDialog May 16 06:44:50 there are a lot of misnomers in the code though. like when you call the paramtere defStyle but you really mean themedAttr May 16 06:44:54 it's the AlertController I hate May 16 06:45:11 yeah we should rename defStyle May 16 06:45:27 the theme/style thing is confusing too May 16 06:45:36 especially since they are defined pretty much in the same way in the resources May 16 06:45:49 confusing, but very powerful and well generalized for the most part May 16 06:45:55 oh yeah May 16 06:46:01 well, themes are styles. there isnt a difference. May 16 06:46:15 except by convention in how they are used. May 16 06:46:21 exactly May 16 06:46:40 i like that fact, even though google never exploited it. it means you can make a theme which has an attribute referring to another theme. May 16 06:46:41 it's gonna be fun if we ever implement runtime theming... May 16 06:46:44 so you can theme references to themes :) May 16 06:47:03 yes you can do some pretty cool stuff with that system May 16 06:47:18 still remains not very friendly compared to other theming systems out there May 16 08:14:17 yo dawg, i heard you like theming your apps, so i put themes in your themes... May 16 08:47:51 jsharkey: ping? May 16 09:12:41 anyone know if there's a way to get multi-line string literals in java when deving for android? or just use + and the compiler will optimize it? May 16 09:20:17 you can define multi line strings in xml May 16 09:21:18 dalvik has some magic for string literals May 16 09:21:30 much denser encoding in the binary, faster to read, etc. May 16 09:46:07 The WordWiget example is using the following android:name identifer: .WordWidget$UpdateService. What is the meaning of the $ sign? Is this Java-specific syntax? May 16 10:00:22 thanks uscheller and spike May 16 10:00:30 spikebike rather :) May 16 10:35:23 hi May 16 10:38:51 hi Switch` May 16 10:40:57 dies a call to invalidate() always result in a call to onDraw() ? May 16 10:41:10 because I can't get my app to redraw itself May 16 10:46:28 hiho May 16 10:47:02 hi May 16 10:47:43 hi, anybody trying to animate things around here? Having a bit of a sticky situation with a drawable that's not being animated as it should. May 16 11:33:59 djola: yes i have problems with animations to May 16 11:34:12 or not animations, rather updating a View when the user presses a key May 16 11:48:41 . May 16 11:50:01 nice dot May 16 11:50:17 :) was checking my connection May 16 12:31:54 qaz: have you followed the lunarlander example? May 16 12:46:45 yeah im doing that but i dont get it May 16 12:46:51 if i extend a View May 16 12:47:09 doesnt it have the same rights as aView then?¨ May 16 12:52:07 what I am doing here is to extend an ImageView and then redraw things from within its onDraw method, but with a Drawable object - I do not think this is the best method, but it is one that works at present. :) May 16 13:22:09 anyone happen to know how to get a widget to work with breakpoints? May 16 13:26:59 got it - just had to go to the ddms and click the debug this process thing after getting into the config activity for my widget May 16 13:47:26 hey there May 16 13:48:27 when you use BitmapFactory.decodeResources, is the colour depth automatically reduced to the G1s colour depth? May 16 13:52:53 no matter. the answer is yes, but the downsampling be controlled through bitmapFactory.options May 16 13:55:34 I'm kinda short on ideas why my widget suddenly stopped adding itself to the desktop http://pastebin.ca/1424632 That trace give anyone an idea? Doesn't even seem to point to my code any more May 16 14:05:53 sorry.. no idea about your problem skyPhyr :/ May 16 14:06:29 no worries - thanks sammyF - it's a bit strange May 16 14:06:45 guess I should revert some code and see when it worked May 16 14:07:54 this output give people any ideas? http://pastebin.ca/1424646 May 16 14:08:08 skyPhyr: "strange" seems to be the keyword when developping for Android ;) May 16 14:08:31 hehe - it was all fun and games until somebody lost their sanity :D May 16 14:10:10 I am using a bitmap as a collision map for my game, and wondered why I was never getting the color I KNEW was there. turned out Android was dithering and downsampling the bitmap. I only found out after screwing with my code for hours, thinking I was doing something wrong ;) May 16 14:59:14 is there a difference at how static initilization blocks are called between android and Java? It seems sometimes the static initalizers are not called May 16 15:04:36 is it possible that classes are still "loaded" after a service is terminated? so the static initializers won't get called a second time when the service is restartet? May 16 15:04:41 restarted even May 16 15:12:37 my crazy crash that was sending me insane was because I changed widgetId to long instead of int for some/no reason. Probably confused it with personId, d'oh May 16 15:12:51 * skyPhyr == #fail May 16 15:14:57 yes May 16 15:15:50 even if you close all activities and restart your app your statics might not get initialized again May 16 15:18:19 ezome: also if I reinstall? May 16 15:18:54 ezome: so this is due to the class-sharing between java-processes? May 16 15:19:04 or dalvik processes May 16 15:19:32 imho this is because the process of your app is detached from your activities/services May 16 15:20:13 you could use init/deinit functions to create/destroy singleton instances May 16 15:20:47 ezome: I am using the smack xmpp-library. that is using static initalizers May 16 15:22:04 so the lib changes its statics but there is no way to reset them May 16 15:22:35 it adds a ConnectionCreationListener() to be infomred everytime a connection is created May 16 15:23:09 and? May 16 15:23:43 in the handler it creates a PrivacyListManager. May 16 15:23:50 that handler is null later May 16 15:24:04 because the callback is also not called again May 16 15:24:48 so I am not sure if that callback is still registered. May 16 15:25:07 after the service is restarted May 16 15:25:18 try using a static urself May 16 15:25:40 initialized = false; and set it to true after initializing your lib May 16 15:26:16 ezome: that could work. thanks. I will try that May 16 15:26:22 if its still true when you start the service again you don't need to initialize the lib again May 16 15:26:30 np May 16 15:47:20 Hey, I'm looking at "requestWindowFeature(Window.FEATURE_INDETERMINATE_PROGRESS)" May 16 15:47:30 I get the error: 05-16 17:40:46.619: ERROR/AndroidRuntime(1529): android.util.AndroidRuntimeException: requestFeature() must be called before adding content May 16 15:47:44 am I missing something? May 16 15:48:16 progressbar_4 is working and I don't see the difference May 16 15:57:59 what irritates me is that the exception thrown, comes from the call to requestWindowFeature rather than where I try to do something with it May 16 16:05:12 where did u put the sentence ? May 16 16:06:06 in onCreate May 16 16:06:29 the first line ? May 16 16:07:06 should it be? what is there to know about ordering? May 16 16:09:19 ok now it's in the first line and works May 16 16:09:35 the exception just told u that it should be called before setcontentview May 16 16:11:26 ahh I see, thx May 16 16:11:39 maybe should be in javadoc May 16 16:13:13 or error message more explicit May 16 17:02:37 Hello all, I've installed the latest eclipse and android SDK and i'm just trying to create the first android app, but i'm getting the oddest errors. May 16 17:03:38 it says: Project 'Test' is missing required folder 'gen' May 16 17:03:57 never mind.. i'm just confused now... May 16 17:04:12 error went away after it taught about it for a few minutes May 16 17:37:02 Hey May 16 17:37:38 * wmealing__ waves May 16 17:38:08 Can I reuse already localized strings? May 16 17:38:16 say, from the browser or something like that May 16 17:39:17 i dont know if apps can use each others resources without trickyness. May 16 17:39:25 you could always just copy the xml in at write time May 16 17:45:15 yes, true May 16 17:46:03 it would be quite convenient to have some strings that are commonly used May 16 17:46:05 * wmealing__ nods May 16 17:48:13 renke, feature request on the issue trackerr ? May 16 17:50:30 good idea May 16 17:51:48 its not unreasonable. May 16 17:52:35 I find the need for that quite natural, actually May 16 17:52:59 * wmealing__ nods May 16 17:53:38 renke, question for you.. do you know if its possible to write a "plugin" for settings May 16 17:54:17 I just started some minutes ago, sorry ;) May 16 17:54:30 no problemo May 16 17:55:50 "plugin"? May 16 17:56:01 looks like its not possible to do plugins due to the need to have activities declared in the manifest. May 16 17:56:05 ziyong, yeah, have it appear May 16 17:56:06 yes May 16 17:56:19 becoz settings.apk appears to run as an app May 16 17:56:36 there may not be permission to run what you want May 16 17:56:44 yeah May 16 17:57:05 also that you need to insert the code-base UI into that activity, not sure if its possible May 16 17:58:04 wmealing__: better off as an widget? May 16 17:58:22 possible? using widget for the UI? May 16 17:59:22 aye. May 16 18:01:19 no, there isnt a way to add anything into the existing Settings app on the device May 16 18:03:17 sadness. but ok May 16 18:13:49 I'm looking at some of the icons in "packages/apps/Browser/res/drawable", can I reference them somehow from my app, or will I have to copy them? May 16 18:20:15 renke, what happens when you try to do something like import com.settings.android.R ? May 16 18:21:17 well it's not in the build path May 16 18:21:52 ah, thats right its not runtime. May 16 18:21:54 my mistake. May 16 18:22:18 hm, I need icons, too May 16 18:22:37 dont we all. May 16 18:23:02 maybe some of the icons from core apps should move into "/frameworks/base/core/res/res/drawable" May 16 18:23:18 you can't even uninstall some of the default apps May 16 18:23:28 so their always gonna be there May 16 18:23:36 they're May 16 18:27:03 ah, there is a way to reference resources from other packages May 16 18:27:25 that probably works for strings, too May 16 18:30:10 I guess the strings in android.R.string are strings that can be reused by other applications May 16 18:30:28 (those are not many, though) May 16 18:30:50 but those are core, not other packages May 16 18:31:06 indeed May 16 18:31:33 i guess it would be bad anyway, dependencies etc. May 16 18:31:52 probably May 16 18:50:56 there are free software coders, where are the free software artists. May 16 18:52:31 ah, nm. May 16 18:58:24 coder == artist ? May 16 19:01:00 lol, emo_im_wtf.png May 16 19:04:08 hehe May 16 19:04:24 is that an android? May 16 19:04:35 jup May 16 19:04:44 with this expresion: o_O May 16 19:04:58 jup May 16 19:05:04 looks kind of funny May 16 19:14:35 Why is it that those xml stuff for menus (probably others, too) uses true and false for boolean values? May 16 19:17:00 renke, you mean like android:defaultValue="false" /> May 16 19:17:17 yes May 16 19:17:25 well May 16 19:17:34 something like "checkable" May 16 19:19:54 that, I dont know May 16 19:20:33 say I had multiple "settings" profiles, is it possible to trick PreferenceManager into using differernt files ? May 16 19:23:34 probably just smarter to use sqlite May 16 19:23:52 How the heck does the metal detector app work? May 16 19:24:19 using the magnetometer May 16 19:24:36 built in to the phone, as part of the compass stuff May 16 19:45:54 ohh May 16 19:46:20 i thought there was some kind of random pointless metal detecting device within it lol May 16 19:53:25 what was the best offline rss feed program ? i need to play pods for podcast May 16 20:01:41 Johnster, perhaps more suited for #android May 16 20:31:44 I've finally gotten the ADT installed and found what i thought was a great youtube tutorial on getting started. but the code in the example, seems at least partially deprecated. May 16 20:32:47 http://www.youtube.com/watch?v=I6ObTqIiYfE May 16 20:36:48 wehre do i find the right info for the fixes? May 16 20:37:28 kc8pxy, start by what you think is incompatible, no flash on this machine. May 16 20:39:12 kc8pxy: use the latest documentation to get started May 16 20:40:52 is there a findPreferenceByID or something similar ? May 16 20:41:03 think "findViewById" but for preferences May 16 20:42:04 Hi! May 16 20:42:45 Is it possible to have a spinner with icons rather than text options? May 16 20:43:28 build your own by extending it May 16 20:44:16 eyedol: Wish there was a sample. You'd think it should be a common operation. May 16 20:45:21 shouldn't be that easy, check the custom labelview sample code May 16 20:45:30 should give you an idea how to build custom views May 16 20:45:44 <_wmealing> (are you talking to me ?) May 16 20:46:47 hi May 16 20:47:09 ah, I mean't shouldn't be that difficult michel May 16 20:47:19 is there a way to prevent my app from closing when the screen goes dark or user presses "hangup"? May 16 20:48:38 <_wmealing> calamari, save the sate, present it back to the user when they start it again May 16 20:49:17 wmealing__: I need it to not close, because otherwise it stops voice recording May 16 20:49:49 <_wmealing> calamari, background service ? May 16 20:50:00 <_wmealing> (and you can record voice ???, i didnt think it was possible) May 16 20:50:03 that's the only way? it's the foreground app, seems weird May 16 20:50:45 <_wmealing> i'm not saying it is.. May 16 20:51:00 <_wmealing> although its not a foreground app once the dialer starts May 16 20:51:10 so the other apps that stay open are automatically staying open are somehow saving state and reloading when the screen comes back on? May 16 20:51:18 dialer? May 16 20:51:25 I'm not dialing May 16 20:51:42 hangup meant that red button May 16 20:51:45 <_wmealing> ah, sorry.. my assumption that the user was in the dialer. May 16 20:51:53 no prob May 16 20:52:05 the red button makes the screen turn off quicker, without having to wait May 16 20:52:27 <_wmealing> calamari, i think you may wish to give your app the correct permissions May 16 20:52:35 <_wmealing> can stop sleep, etc. May 16 20:52:50 <_wmealing> that may work around the sleep problem May 16 20:52:55 so sleep is different than the screen turning off? May 16 20:53:13 I want the screen to be able to turn off, saves battery May 16 20:53:19 <_wmealing> i believe so (i'm not a definitive source) May 16 20:53:27 okay cool, I'll try it :) May 16 20:53:36 thanks May 16 20:53:48 <_wmealing> If you wanted to save battery, your app may be able to turn the screen off May 16 20:53:58 <_wmealing> and keep the rest of the phone running May 16 20:54:35 I can't imagine it being this complicated.. almost every app imaginable has the ability to not close when you push the red button May 16 20:55:17 <_wmealing> i'm probably wrong then. May 16 20:55:26 <_wmealing> go look at the source code for those apps May 16 20:55:31 good idea May 16 21:00:29 <_wmealing> AddAnotherNetwork = (Preference) findPreference("add_another_network"); May 16 21:00:42 <_wmealing> findPreference(key) is the correct way to find preferences, instead of by id, May 16 21:00:51 <_wmealing> i think May 16 21:13:39 _wmealing: it was my fault.. my onPause code was causing an exception May 16 21:13:39 does anyone know if the Log.d are stripped out when I remove the "debuggable" and build for distribution? May 16 21:14:57 <_wmealing> calamari, all fixed ? May 16 21:15:04 _wmealing: yeah May 16 21:15:25 localtone: no, they still come out in production May 16 21:15:51 often because its useful to have some data coming back from the field when you get user errors May 16 21:16:33 Hi, anyone ever tried to use the animation of Drawables? May 16 21:16:35 one common approach is to have a LOGD flag inside each class that you enable as needed May 16 21:17:21 eyedol: Instead of extending Spinner, isn't it possible to just use the ArrayAdapter? May 16 21:29:48 jsharkey: thanks! May 16 21:31:04 jsharkey: It just wasn't clear in the documentation about this point. I'll put flags in the classes. May 16 21:47:23 _wmealing: sorry, walked afk. the sample app simply picks iup the list of contacts, and dumps them into a ListActivity, and dials them on click. i've waded through the oncreate. May 16 21:58:23 I am recieving a broadcast twice when i send it from the same context as the reciever May 16 21:58:30 how do i stop this? May 16 21:59:28 i tryed abortbroadcast but apparently it still gets sent to the onRecieve method of the context that executed sendorderBroadcast May 16 22:02:15 _wmealing: it's when i get to creating the intent in the onlistitemclick, it doesn;'t seem to make as much sense as i thought. mebbe i just don't know the layout of the base structures yet. May 16 22:10:43 hi everyone May 16 22:11:43 can I filter in android market somehow which apps are open source? May 16 22:11:56 those are the only ones that I am interested in as a developer May 16 22:16:41 grr.. a I use a 3rd party lib that works just fine in j2se but fails with "java.io.FileNotFoundException: http://google.com \n at org.apache.harmony.luni.internal.net.www.protocol.http.HttpURLConnection.getInputStream(HttpURLConnection.java:1064)" on Android. (it basically does some magic and tries to open a HttpUrlConnection to the given host) May 16 22:17:37 I wonder what harmony does differently than j2se builtin stuff? I mean.. j2se builtin stuff can open it, harmony implementation can't May 16 22:24:49 How can I create an array of icons in a resource file? May 16 22:26:03 any meebo devs in here? May 16 22:30:16 Or how do I take a resource name and get the corresponding ID? May 16 22:30:38 look at the Resources class May 16 22:32:09 Hey romainguy! Good to see you. Had been looking for you :) May 16 22:32:26 Found some presentation document you made :) May 16 22:32:35 which one? May 16 22:32:59 Oh it was about... I forgot what you called them now :) ... Applications May 16 22:33:25 The presentation slides needed your commentary :) May 16 22:34:23 slides are not meant to be standalone :) May 16 22:35:13 I know :) That's why I said they needed you :) May 16 22:36:13 Anyway, you can help me for this, I am sure: I want to put images in a Spinner instead of TextViews. I created an subclass of ArrayAdapter May 16 22:36:43 Now my problem is to correctly populate my list of drawables from their reference in an array resource. May 16 22:37:25 new Drawable[] { May 16 22:37:28 I can get the text of the references, but frankly it does not help unless I can convert the text "res/drawable/image1.png" into an actual drawable. May 16 22:37:40 context.getDrawable(R.drawable.blah), etc. } May 16 22:37:50 besides May 16 22:37:56 I just answered: May 16 22:37:57 "MikHel: Or how do I take a resource name and get the corresponding ID? May 16 22:37:57 [3:30pm] romainguy: look at the Resources class" May 16 22:38:47 romainguy: I saw that. Does that mean I have to call getIdentifier(String name, String defType, String defPackage) ? May 16 22:39:17 I guess so :) May 16 22:46:03 romainguy: I am still not able to do it. The string that has been created from @drawable/image1.png is "res/drawable/image1.png". May 16 22:46:13 What do I pass as defType and defPackage? May 16 22:46:32 do I pass that whole string as name? May 16 22:47:26 correction: In the array I put @drawable/image1 May 16 22:47:29 no .png May 16 22:48:46 hey any of you did create a soap client program ? May 16 22:51:42 http://www.android-portal.com/2007/12/20/secure-server-socket-with-tlsssl-on-android-fails/ May 16 23:05:48 (sry for doublespamming) I have a problem with getting HttpURLConnection working, the 3-line-problem is here: http://pastebin.com/d2c41b32c For me it seems that the implementation is a little different in Android if you compare it to j2se and my problem is - how do I get the contents of a page that uses a 401 response code? (getInputStream() and getContent() - both fail with FileNotFoundException, getErrorStream() is null) May 16 23:07:56 googling for the exception messages/classes gets me some results for people who have had the same problem in different forums/mailinglists but no one has found a solution/answer May 16 23:09:31 and no, switching to httpclient is not an option (it's a 3rd party lib and I really can't rewrite their connection handling thingie) May 16 23:15:08 I mean.. I could try to write them that "Hi guys, please rewrite your lib to use httpclient because I'm apparently the only one using it on Android and HttpURLConnection is acting kinky there, kthxbye" but I guess that won't work May 16 23:15:52 "kinky" lol May 16 23:16:23 is that a word in english? :) May 16 23:16:43 yea i suppose a synonym might be "deviant" May 16 23:17:05 let me look that up :P May 16 23:17:36 "a person or thing that deviates or departs markedly from the accepted norm." ah yeah, that's exactly what I wanted to say :) May 16 23:27:34 Hey May 16 23:28:35 tauno, the thirdparty thing is that running at the server prat ? May 16 23:28:37 part ? May 16 23:30:43 no, I use a third party lib in my client code (the lib is a huge and strange monster that uses HttpURLConnection to communicate with the cloud) May 16 23:34:00 ah..damn.. j2se also throws a IOExcpetion but not a FNF one.. I have no idea why the 3rd party thingie fails when it gets a FNF but works when it gets a generic IOE May 16 23:34:33 apparently they do some dark magic somewhere to recover from a general IOE.. May 16 23:39:56 ok, they have to do something silly because I can't understand how they are able to handle an IOE but not a FNF. or I'm doing something silly.. probably the later May 16 23:41:07 ugh, 2:40 am here, I better quit for today :/ May 16 23:47:24 tauno a third party lib in for the android ? May 16 23:54:26 hii May 17 00:18:59 I've heard skype works on android.. and I bet it's not been rewriten in java :P May 17 00:20:29 its just the text messaging May 17 00:20:31 not the voice May 17 00:22:33 oh ok May 17 00:22:47 yes, it sux May 17 00:22:48 :) May 17 00:27:01 sipdroid works fine? May 17 00:27:57 never tried that one, just thought I would give Skype a go, but then found out incoming or outgoing calls (even for other skype numbers) would cost you SkypeOut credits. May 17 00:29:32 Any View/Drawable animation knowledgeable person around? I am trying to understand whether the images on a game should be created as separate Views or only Drawables. May 17 00:31:28 I am following the LunarLander example. There, the space ship is generated using Drawables, but in an OO world, it would make more sense to create a separate SpaceShip class (I know this topic is debatable as one could try to use as many code as possible to streamline execution) May 17 00:32:00 sorry, as little code as possible and not as many code as possible May 17 00:40:46 guess my huge amount of text scared people away, eh? heheh May 17 01:10:45 i have a listactivity filled with a list of my contacts. when i click one of the names on the list, how do i get a content_uri that corresponds to that person's PH#? May 17 01:11:05 (to feed to my action_call intent) May 17 01:20:51 anybody know if SMS logs or broadcasts are available? I've not managed to find them in the docs and the part that would tell me is closed source and just has an aidl exposed. http://groups.google.com/group/android-developers/browse_thread/thread/baaa80da2d45353c# Awful quiet on the list May 17 01:25:08 is there a way to distinguish between an activity thats minimized and an activity thats obscured by another activity when onStop is called? May 17 02:28:13 It's easy to record a .3gp file, but the MediaPlayer doesnt like to play them back... is that correct? **** ENDING LOGGING AT Sun May 17 02:59:57 2009