**** BEGIN LOGGING AT Fri Mar 06 02:59:57 2009 Mar 06 03:18:57 is it possible for a TabHost to call into a child window? Mar 06 03:19:00 child tab* Mar 06 04:12:58 http://developer.android.com/guide/practices/design/performance.html -- are these specific to DalvikVM or are they due to Java in general? Mar 06 04:13:08 specific to Dalvik Mar 06 04:13:18 the may or may not apply to Java in general Mar 06 04:13:20 depends on the VM Mar 06 04:13:29 but with Hotspot it usually doesn't really matter Mar 06 04:13:29 ah, okay. I'd never heard the "cache your member variables" position before Mar 06 04:13:31 ah Mar 06 04:21:24 http://developer.android.com/guide/practices/design/seamlessness.html -- how does one open the notification area without a touch screen? Mar 06 04:21:42 oops, that link should have been http://developer.android.com/guide/practices/design/seamlessness.html#keyboard Mar 06 04:22:02 KNY: Menu > Notifications Mar 06 04:22:18 ah. Mar 06 04:22:39 damn you, romainguy__ for thinking of everything Mar 06 04:22:44 ^^ Mar 06 04:23:05 we do have stuff that doesn't work without a touch screen though Mar 06 04:23:07 like sliders Mar 06 04:23:09 we're fixing that though Mar 06 04:24:53 it seems like you have to have one of either a touch screen or a trackball Mar 06 04:25:01 or else it would be really awkward to use Mar 06 04:25:07 or a dpad Mar 06 04:25:25 the UI toolkit was first developed for a dpad Mar 06 04:25:28 even using the dpad on the emulator is a pain, though Mar 06 04:25:45 it's very different from a real physical dpad Mar 06 04:25:51 maybe it's because I'm spoiled by the trackball though :) Mar 06 04:29:16 speaking of which, when is the emulator going to be updated for the virtual keyboard? is there an timeframe on that? Mar 06 04:29:33 the emulator doesn't need to be updated Mar 06 04:29:34 just run cupcake Mar 06 04:30:06 on my G1? Mar 06 04:30:09 :) Mar 06 04:30:21 you just asked about the emulator Mar 06 04:30:24 so no, not on your G1 Mar 06 04:30:31 build cupcake and run the emulator with that Mar 06 04:31:32 does it support changing from portrait to landscape without restarting? Mar 06 04:31:56 Mar 06 04:31:56 ah, I didn't know you could run different images (is that the right term?) on the emulator. I haven't looked into it too much, though (clearly) Mar 06 04:32:13 KNY: you can also just use the emulator that comes with the cupcake tree :p Mar 06 04:32:24 stop making so much sense! Mar 06 04:33:18 sorry :p Mar 06 04:39:34 I give up on WebView. Mar 06 04:40:02 hey romainguy__ I think there's a bug with your syntax highlighting code on your blog. http://www.curious-creature.org/2009/03/04/speed-up-your-android-ui/ (look at the XML under "This drawable is simply referenced by the theme:") Mar 06 04:40:23 yeah Mar 06 04:40:27 I use Google's prettyprint :) Mar 06 04:40:32 guess I should update :p Mar 06 04:40:35 haha Mar 06 04:44:09 fixed Mar 06 04:44:10 thanks :) Mar 06 04:44:21 berk Mar 06 04:44:23 they added a border Mar 06 04:45:27 fixed Mar 06 04:51:13 much better :) Mar 06 04:53:51 reminds me I should write blog posts about the UI thread, handlers and AsyncTask Mar 06 04:54:18 yeah, I'd be interested in AsyncTask Mar 06 04:54:24 have you used it? Mar 06 04:54:36 no, it's not in the SDK yet, right? Mar 06 04:54:50 no but you can grab it from android.git.kernel.org Mar 06 04:55:46 yeah, I've got the repo but I haven't had time Mar 06 04:55:57 by the time I have time to play with it, it'll be in the SDK :) Mar 06 04:56:39 ^^ Mar 06 04:56:50 it takes a couple of minutes to use it Mar 06 04:58:44 is it basically an abstraction of doing tasks in threads and such? Mar 06 04:59:01 yes Mar 06 04:59:05 it spawns off a thread for you Mar 06 04:59:22 and takes care of interacting with the UI thread Mar 06 04:59:26 nice Mar 06 04:59:27 all you do is override a few methods Mar 06 04:59:34 sounds excellent Mar 06 04:59:37 onPreExecute() and onPostExecute() which run on the UI thread Mar 06 04:59:45 and doInBackground() that runs on the worker thread Mar 06 04:59:53 and doInBackground can pass results to the UI thread Mar 06 05:00:00 it also handles updates/progress Mar 06 05:00:42 damn you guys for not having it in there before ;) Mar 06 05:00:48 * KNY goes to poke through the source Mar 06 05:00:48 sorry :)) Mar 06 05:01:06 frameworks/base/core/java/android/os/AsyncTask.java Mar 06 05:01:20 yeah Mar 06 05:01:31 what's with the Status enum? I thought enums were bad...? Mar 06 05:01:41 only in performance sensitive code Mar 06 05:01:52 this enum is only used to know whether the task is running Mar 06 05:01:54 so... Mar 06 05:02:07 ah Mar 06 05:02:52 do you guys use eclipse? Mar 06 05:03:03 many engineers do yes Mar 06 05:03:06 I prefer IntelliJ Mar 06 05:03:25 do you know if the code formatter specs published anywhere? Mar 06 05:03:36 you mean our code style? Mar 06 05:03:57 yeah Mar 06 05:04:18 eclipse can import/export the code formatter preferences; just curious if that was published somewhere Mar 06 05:04:22 ah Mar 06 05:04:28 we have that in our internal tree Mar 06 05:04:30 we should publish that Mar 06 05:04:41 it'd be handy Mar 06 05:04:55 agreed Mar 06 05:05:08 although our style is very very close to the standard Sun Java code style Mar 06 05:05:13 yeah Mar 06 05:05:28 the biggest difference is prefixing fields with 'm' Mar 06 05:05:32 (which IntelliJ does for you \o/) Mar 06 05:05:35 yeah, I tend to do m_ Mar 06 05:05:41 I hate prefixes Mar 06 05:05:54 it's better than littering your code with this. Mar 06 05:06:18 I disagree Mar 06 05:06:18 also Mar 06 05:06:23 IDE colorize fields differently now Mar 06 05:06:25 so... :) Mar 06 05:06:40 it's fewer keystrokes to do m_? than to type this. Mar 06 05:06:48 lol Mar 06 05:06:50 haha Mar 06 05:06:56 the fewer keystrokes argument is the lamest :p Mar 06 05:07:03 agreed Mar 06 05:07:06 however, i like mFoo Mar 06 05:07:07 * KNY goes to use vi(m) Mar 06 05:07:36 does intellij have a format-on-save feature? Mar 06 05:07:46 it has a format on commit Mar 06 05:07:46 eclipse does, so I figure they must Mar 06 05:07:50 even better Mar 06 05:07:50 I don't know about format on save Mar 06 05:08:31 romainguy__: my normal style is quite unlike Android's style :) Mar 06 05:08:39 yeah I saw that Mar 06 05:08:58 my style was basically Android's, so... :) Mar 06 05:09:27 quite unlike "most" people's style. except quite like K&R, so i feel justified. Mar 06 05:09:47 jasta, what does yours look like? Mar 06 05:09:56 KNY: "bad" :)) Mar 06 05:10:07 romainguy__, I'm not one to judge :) Mar 06 05:10:08 KNY: like K&R's, except with 2 major differences. Mar 06 05:10:29 the first being that i tend to introduce blank whitespace lines between logical blocks of code. my C often reads like: Mar 06 05:10:32 Mar 06 05:10:35 int foo; Mar 06 05:10:44 stuff; Mar 06 05:10:45 Mar 06 05:10:47 return foo; Mar 06 05:10:54 I do that too Mar 06 05:11:07 I wouldn't define this as part of the code style Mar 06 05:11:08 with other whitespace breaks where it makes sense, generally before and after conditionals, loops, etc. Mar 06 05:11:12 does K&R do? Mar 06 05:11:25 a friend of mine does that but will put arbitrary numbers of blank lines, like 5-10 between logical sections. drives me up the wall. Mar 06 05:11:29 (Android's style guide doesn't specify when you should add blank lines) Mar 06 05:11:31 romainguy__: K&R doesn't define any style, K&R's style is "defined" by how those two guys code. Mar 06 05:11:34 KNY: ahah I hate that Mar 06 05:11:38 jasta: uhuh Mar 06 05:11:51 and they dont put that whitespace in their code Mar 06 05:11:51 :) Mar 06 05:11:58 berk Mar 06 05:12:23 anyway, the other major difference is that where K&R places the opening brace on the following line for functions, i place it on the following line for conditions and loops as well. Mar 06 05:12:32 K&R bugs me how they put braces on new---yeah, what jasta said Mar 06 05:12:50 keep it consistent Mar 06 05:13:02 however to my great frustration, i make a special exception for try, catch, finally, where i place the brace on the same line as the keyword. Mar 06 05:13:18 heh Mar 06 05:13:53 the main reason i do this is because try, catch, and finally are syntactically inconsistent with conditions and loops. Mar 06 05:13:56 for instance Mar 06 05:13:58 you can't do: Mar 06 05:13:59 I prefer braces on end-of-line because vertical space is far more precious than horizontal Mar 06 05:14:01 try Mar 06 05:14:04 foo; Mar 06 05:14:05 catch Mar 06 05:14:06 bar; Mar 06 05:14:10 like you can with if, else, etc. Mar 06 05:14:14 jasta, yeah Mar 06 05:14:20 so i treat them special in my style, to put the brace on the same line. Mar 06 05:15:12 anyway, bbl, dinner Mar 06 09:31:57 does anyone know if I can be sure that Build.MODEL (and all other constants in Build) are never null? Mar 06 09:34:34 doh, I can look it up in the source. silly me Mar 06 09:34:52 not used to working with open source stuff :) Mar 06 13:43:28 anyone from sweden in here? Mar 06 13:44:28 take a chance take a chance take a take chance chance Mar 06 13:44:30 :-) Mar 06 13:44:44 sorry, was just listening to abba :-) Mar 06 13:59:09 I have something that runs in onStart(), if a given Intent is specified. The trouble is that if I get a call and then hang up, the app goes back into onStart() and it performs the action again. Any way around that? Mar 06 14:01:08 you could put something into the preferences for the activity on onPause, then check for it again onStart Mar 06 14:01:32 something like this: http://paste.ifies.org/401 Mar 06 14:03:42 hmm Mar 06 14:04:16 or I could just setIntent(null) in onPause(), no? Mar 06 14:06:24 doing setIntent(null) worked perfectly. I suppose I should have thought about it for 30 seconds before asking :) Mar 06 14:06:25 thanks, though Mar 06 14:06:42 heh, i always do that Mar 06 14:06:56 irc it's not so bad, but when it's a mailing list and you then just figure it out :) Mar 06 14:07:10 and it's always just after you hit send Mar 06 14:07:29 yup Mar 06 14:22:56 is it possible to get access to the views inside a specific tab from a TabHost? (if that makes sense) Mar 06 14:23:09 I need to populate a text field Mar 06 14:24:04 i tend to create a tabhost with intents Mar 06 14:24:11 so my code is within the intent, not the tabhost Mar 06 14:24:50 digitalspaghetti, ahh, good call. Mar 06 14:25:07 yea, saves my eyes too trying to read through the code Mar 06 14:25:31 i still haven't worked out how to move stuff between tabs though Mar 06 14:26:00 something about my class has to impelemtn Parcelable, but i haven't had time to look into it yet Mar 06 15:14:08 does anyone have a GestureDetector/MotionEvent example? Mar 06 15:27:10 Am I right in my understanding that you can't get a list of nearby bluetooth devices using the current sdk? Mar 06 15:27:35 correct. Mar 06 15:28:27 yes, the BT stack is not available yet Mar 06 15:30:15 Ok, thanks Mar 06 15:30:36 I just got RC9 delivered to my phone which is the UK version of the 1.1 firmware Mar 06 15:30:46 The maps api still doesn't have latitude in it Mar 06 15:30:50 The maps application I mean Mar 06 15:31:29 Strange. That's one of the things I was expecting as it was in the US RC33 release Mar 06 15:31:47 mickeyc: you may have to do a factory reset Mar 06 15:31:58 Really? Mar 06 15:32:05 Hmmm Mar 06 15:32:06 i had to when i did RC33, although my RC9 is fine when i installed it over RC33 Mar 06 15:32:20 since it was already enabled Mar 06 15:33:20 I'll try that now Mar 06 15:34:36 backup your SMS's though Mar 06 15:34:52 (there is a free app in the market to do that to your gmail account) Mar 06 15:35:18 and you'll loose any apps alrady installed, but the market will give you a list again in My Downloads Mar 06 15:35:40 I'm not bothered about retaining sms's Mar 06 15:35:51 And I only have a couple of free apps installed Mar 06 15:37:14 Done Mar 06 15:37:21 Right, I still don't see latitude anywhere Mar 06 15:37:57 where are you looking? Mar 06 15:38:28 I click maps, and then hit the menu button Mar 06 15:38:47 I figured there'd be an option somewhere round there, or a settings menu or something Mar 06 15:39:03 yes, it is :( Mar 06 15:39:17 this is weird - i've had some folks with RC9 got it fine, some don't Mar 06 15:39:41 I'm not overly bothered as I don't want to use latitude. I was just expecting it to be there, that's all **** BEGIN LOGGING AT Fri Mar 06 16:41:29 2009 Mar 06 18:00:46 geez, I managed to get a hue-picking color wheel drawn in 480ms in the simulator down from its original 5600ms. Mar 06 18:01:04 nice Mar 06 18:01:15 I'll probably have to build one soon... Mar 06 18:01:33 You can just use mine. It's going into ConnectBot. Mar 06 18:01:40 Unless you have a licensing problem. Mar 06 18:01:59 http://the-b.org/~kenny/temp/picker-interp4.png Mar 06 18:02:31 hi ever'body Mar 06 18:02:49 probably won't be able to use yours...the app I'm working on isn't open source unfortunately Mar 06 18:03:01 I was wondering if anybody has seen: Mar 06 18:03:06 ERROR/GLLogger(1701): validate_display_surface:779 error 300d (EGL_BAD_SURFACE) Mar 06 18:03:21 And knows what might be causing it Mar 06 18:03:36 anyone got luck using android.resource:// to set a custom sound for Notification? Mar 06 18:03:38 jbq: This could be a good interview question. Mar 06 18:04:28 heh, sounds like a serious optimization you did there. Mar 06 18:04:34 There don't seeem to be any other surface flinger errors around it, and it only happens occasionally Mar 06 18:05:25 in fact it seems to happen only when I am trying to run in debug mode Mar 06 18:05:39 where things are moving noticably slower Mar 06 18:07:48 nemyhlovecraft: egl_bad_surface occurs in a few places. Mar 06 18:08:12 try checking returns? I dunno Mar 06 18:08:34 returns from what? Mar 06 18:19:19 good morning Mar 06 18:39:22 When i use the camera in my application the image preview is all distorted until i flip out the keyboard on my G1, then it displays correctly... Mar 06 18:39:27 anyone else have this? Mar 06 18:45:07 camera on the G1 only works in landscape mode (grrrr) Mar 06 18:46:14 :( Mar 06 18:46:22 any work around? Mar 06 18:46:37 force your app to be landscape-only? :/ Mar 06 18:46:50 (well, just the activity that has the camera) Mar 06 18:47:06 so im just gona have to display something like "please flip out the keyboard" Mar 06 18:47:09 :( Mar 06 18:47:16 thats a bit meh.... Mar 06 18:47:56 you can force the orientation to lanscape for that one activity, it'll switch automatically (like the built-in camera does, or youtube when playing videos) Mar 06 18:48:09 why is it landscape only? like whats the restriction? Mar 06 18:48:11 ah, ok Mar 06 18:48:19 i must have a look for that Mar 06 18:48:27 here's how camera does it: http://android.git.kernel.org/?p=platform/packages/apps/Camera.git;a=blob;f=AndroidManifest.xml;h=574d301c42e7854f0e09071c54dc8f1b02997d86;hb=HEAD#l20 Mar 06 18:49:08 ah Mar 06 18:51:00 thanks for that Mar 06 18:51:07 sure Mar 06 18:51:32 I wish there was a better option in terms of user experience, but at least that's a simple one-liner. Mar 06 20:14:22 jbq: A clean build seems to have succeeded, but the emulator spins just the same even after 38+ CPU minutes. Mar 06 20:14:59 I'll restart the VM with another half-gig and see if that helps. Mar 06 20:26:45 No Joy (tm). I seem to have enough RAM to run. I don't even get into the swap with 1.5GB, with about 1GB free (according to free). Mar 06 20:29:26 are you watching its logcat output to see what it thinks is going on? Mar 06 20:44:48 ctate: it never gets up far enough to see logcat output. Mar 06 20:46:46 adb says: - waiting for device - Mar 06 20:47:51 ctate: emulator seems to burn about 92% of the CPU doing nothing, with no display and no disk activity that I can descern. Mar 06 20:59:58 TreyB: you're passing the -logcat "*:v" argument to the emulator when you run it? Mar 06 21:00:16 if you are, and it's still not producing any output, that suggests that it never really starts running at all Mar 06 21:05:38 Let me kill and restart it with that. Mar 06 21:07:00 Nope. Still waiting, no matter which ordrer I start them. Mar 06 21:08:07 order Mar 06 21:15:35 gdb says I have three threads, one in a fork from android_emulation_setup, and two in audio_pt_wait in a pthread_cond_wait. Mar 06 21:46:37 How do you do font/typeface discovery on Android? Mar 06 21:47:03 I see how to create one from a name as a string, but how do I discover what are valid family names? Mar 06 21:48:24 kencausey: I use the static members of Typeface Mar 06 21:48:46 I suppose downloadable fonts don't yet exist. Mar 06 22:21:38 Hey all Mar 06 22:22:19 im wondering if each activity that has an onCreate() can have an onStop() Mar 06 22:22:39 I have several activities in my app that call onCreate() Mar 06 22:24:29 can, sure Mar 06 22:24:34 kk Mar 06 22:24:48 any activity can override any of the lifecycle callbacks Mar 06 22:25:09 yeah so when its overridden IF there is a onStop() that called? Mar 06 22:25:14 or is that onPause? Mar 06 22:25:29 onPause() and onStop() will always be invoked Mar 06 22:25:34 kk Mar 06 22:25:43 sweet thanks Mar 06 22:25:44 it's just that if you haven't overridden them, then only the superclass implementation will be run Mar 06 22:25:56 gotacha Mar 06 22:25:57 you have to call the super versions if you override them, too -- see the docs on that Mar 06 22:26:13 the base Activity class implementation does a lot of work) Mar 06 22:26:25 ok yeah Mar 06 22:26:27 i follow Mar 06 22:27:29 thanks Mar 06 22:28:07 in the javadoc for these lifecycle callbacks you'll typically see a note like "Derived classes must call through to the super class's implementation of this method. If they do not, an exception will be thrown." Mar 06 22:28:41 ok Mar 06 22:34:23 ctate: I've added android specific rules in PMD to check for correct usage of the onXXX() methods. It's part of the 4.2.5 release I've generated a couple of weeks ago. Mar 06 22:38:27 "PMD"? Mar 06 22:38:58 also woohoo checks on that Mar 06 22:39:14 there are runtime checks too, of course, but having it complain at or before build time is awesome Mar 06 22:40:00 well I just created a basic ruleset for android and wanted to release it. Enhancements are welcome, specially from people from Google... Mar 06 22:40:55 I'll probably release a new version of the PMD eclipse plugin with that version soon so it will be easier to use Mar 06 22:41:15 i am embarrassed to say that i don't know what "PMD" stands for here Mar 06 22:41:33 is there a way to port j2me app on android? Mar 06 22:42:13 ctate: think findbugs :) Mar 06 22:42:35 no easy way that i know of, viju85. obviously the app core logic is already in java, which helps, but it still needs to be incorporated into the Android application model by writing a proper Android app/activity set for it. Mar 06 22:42:44 I have to admit. I don't know, I'm not the original author... see http://pmd.sourceforge.net/meaning.html for the meaning Mar 06 22:43:15 oh, it's a static-analysis thing. gotcha. neat! Mar 06 22:43:48 ctate: that's why we should all use this in Eclipse or IntelliJ that has something similar enabled by default Mar 06 22:44:07 ctate: because when I open some of our .java files in IntelliJ, my IDE just light up in yellow with dozens of warnings :P Mar 06 22:44:11 wuh oh Mar 06 22:44:13 (possible NPEs, dead code, etc.) Mar 06 22:44:21 I should show you when you have a couple of minutes Mar 06 22:46:19 well, once I'm a little further along with writing my Android app, I'll work on the eclipse plugin and update you with the status :) most likely by the end of the weekend Mar 06 22:47:56 viju85: someone announced a program that will port your j2me program to android. I have no idea how well that will work though. Mar 06 22:49:02 i've seen a couple of J2ME-to-Android ports that were basically functional, but as far as fitting into the Android UX were *awful* Mar 06 23:06:44 hmmm... thanks... Mar 06 23:07:07 but i dont think u can port any j2me app to android. Mar 06 23:07:12 there must be some restrictions Mar 06 23:08:43 well, the app models are totally different Mar 06 23:09:11 as far as the language, Android has real Java, while J2ME is just a limited subset. That would make it potentially very hard to go from Android to J2ME, but doesn't much affect the other direction. Mar 06 23:21:55 do i have to do anything to a TextView to get it to render a bold tag? Mar 06 23:52:09 meep meep Mar 06 23:58:07 To clarify something ctate said at 15:09... Mar 06 23:58:12 Android does not have "real Java". Mar 06 23:58:21 oh, that's true Mar 06 23:58:26 We do, however, have something very like J2SE, which is very much a superset of J2Me. Mar 06 23:58:34 it supports a much fuller version of the language than J2ME does Mar 06 23:58:56 but definitely take fadden's word over mine if they ever conflict on this stuff Mar 06 23:59:26 Mostly I want to be clear that we're not claiming to be Java(tm). Mar 06 23:59:32 right Mar 06 23:59:41 We just happen to work with code written in the Java programming language. Mar 07 00:01:54 random: have any of you written iphone apps? Mar 07 00:02:59 i've looked around for someone reviewing both from a dev perspective but i haven't found much. Mar 07 00:03:21 not that i'm ever going to write an iphone app, but... **** ENDING LOGGING AT Sat Mar 07 02:59:57 2009