**** BEGIN LOGGING AT Fri Jul 25 02:59:57 2008 Jul 25 03:00:43 sayers: do you mean what associates a layout to an activity? the activity calls setContentView() Jul 25 03:01:31 I think I'm thinking to hard, that is ingeniously simple! Jul 25 03:03:10 also do note that nothing is inherent to the XML layout system that relates it to an Activity Jul 25 03:03:33 XML layouts generically inflate to View hierarchies. setContentView() merely inflates the view hierarchy, and then sets it as its root hierarchy. Jul 25 03:03:43 So, for example, you can compose multiple XML layouts into one, and people often do. Jul 25 03:04:02 For example, it is common to describe a list item in a separate XML layout, and inflate it for each item in a list as necessary. Jul 25 03:04:24 Android even has an efficient system in place to re-use those inflated views, assuming that they are sufficiently generalized (each list item has the same basic layout) Jul 25 03:04:38 This efficiency is hidden away in the details of list adapters. Jul 25 03:04:46 Well, partially hidden. Jul 25 03:08:03 jasta: /me particularly likes that bit of cleverness. Jul 25 03:19:35 Hm... problem is I added a new xml in layout but the setContentView() doesn't seem to have it... Jul 25 03:23:56 can you please rephrase that so it doesn't sound like gibberish? Jul 25 03:24:47 sure Jul 25 03:27:27 I created a new XML file for another GUI with one of my actives, I'm creating an application with multiple activities. However in the new activities java code when I try and load the gui the auto completion feature does not show anything called torcCalc which is the name of the GUI xml file Jul 25 03:28:38 Do you mean that the R.java file was not regenerated to include the new member in R.layout.? Jul 25 03:28:47 yes! Jul 25 03:28:59 Why didn't you just say that, instead of all that other gibberish? Jul 25 03:29:16 I forgot that was the median for all GUI's Jul 25 03:29:24 Anyway, there is probably an error in your XML layout: check your build environment's output. Jul 25 03:29:31 sayers: The what? Jul 25 03:29:41 it handles resources. Jul 25 03:29:59 Dude. I cannot follow the way that you speak. Jul 25 03:31:05 Like, what could R.java being the "median for all GUI's" mean? Jul 25 03:31:58 Ignore that , that was me thinking out loud, sorry. In any event yes it was a naming convention error. Jul 25 03:32:00 R.java is simply an autogenerated file to give you integer handles to your bundled resources, including layouts, strings, drawables, etc. The package manager assigns package-specific unique ids to these resources so they aren't referenced by name. Jul 25 03:32:13 R.java is just a developer convenience so that you can still reference them by name, even though the system does not. Jul 25 03:33:36 I'm in the "learning how things are done" stage, and yes I did search the doc for it but I saw how they had nothing specific in their layouts. Jul 25 03:34:25 Anyway, my advice to you remains the same: if R.java is not regenerated, it is likely because there is a fatal error in parsing the resources you defined. Jul 25 03:34:31 So check your build output Jul 25 03:36:15 yes Jul 25 03:36:22 and your advice worked Jul 25 03:36:59 I feel bad for asking lots of questions :( because I now have another one eek Jul 25 03:37:02 Jeez I can't wait for my RAM to arrive. 1GB doesn't go far with 10 tabs in FF, eclipse, the emulator, and a bunch of other junk open. Jul 25 03:37:11 yakischloba, Agreed Jul 25 03:37:20 sayers: There is no need to feel bad, just learn to ask good questions. Jul 25 03:37:20 yakischloba, what operating system are you on? Jul 25 03:37:27 Because you talk a lot of gibberish I can't follow most of the time. Jul 25 03:37:49 I'm on OS X 10.4. Jul 25 03:38:16 Should a back button be included in the UI of the application or is the hardware button supported ? Jul 25 03:38:57 to return back to the last activity that is, I know I saw something about it in 'the life of an activity' Jul 25 03:39:12 sayers: We assume the hardware back button is recommended for UIs, but we really don't know for sure. Jul 25 03:39:40 jasta, and to support that look at the activity doc ? Jul 25 03:39:55 It's very hard to appreciate how the end user experience will be with what we have now Jul 25 03:40:07 sayers: the life of an activity has nothing to do with the physical back button. Jul 25 03:40:32 then how would I support them wanting to return to the main screen of my application ? Jul 25 03:41:11 sayers: If it makes sense for your application, you would include a button. However it's unlikely that it makes sense. Jul 25 03:41:20 Do you have a smart phone now? Jul 25 03:41:23 no Jul 25 03:41:57 Well, then you are at a great disadvantage for having a familiarity with the type of user experience Android is trying to create. Jul 25 03:42:17 Indeed Jul 25 03:42:36 Regardless, smart phones allow the user to navigate various screens of an application with elaborate multi-tasking features. Jul 25 03:43:06 How can I reset my emulator environment? For example, I want to go back to not having any sqlite databases created. Is that the most practical approach? Jul 25 03:43:32 For example, in an e-mail application, opening the main app from the launch will return to the last screen they were on. if they want to perform some other action, they should be able to somehow cancel out of what they are doing and get back to a new launcher. Jul 25 03:43:43 this can be done iether using the back button, or more explicitly through menu items. Jul 25 03:43:51 for example, if a user opens email, presses compose, then starts typing a message Jul 25 03:44:02 goes back to the home screen, launches another app, then later returns Jul 25 03:44:28 the compose screen should still be up. if that's not what they meant, they can press back again, or go to menu -> cancel message, then return to the inbox where they can press some compose button again or go menu ->c ompose Jul 25 03:45:05 This is just an example of one type of application, but the point is that it is your job to provide explicit activity control in a way that makes sense, but also to trust that the user can use the window manager to navigate effectively (the back button, the home launcher, etc) Jul 25 03:45:07 yakischloba: try "emulator -wipe-data" Jul 25 03:45:26 Ah. Jul 25 03:46:45 sayers: One general strategy I recommend when designing a mobile UI is to remember that your application is not *THE* application the user cares about. It is simply one of many, and in fact they probably spend very little time interacting with it. Jul 25 03:47:01 This is easier to understand when you've spent some time with a smart phone already, even if its a crappy one like Windows Mobile. Jul 25 03:47:29 ah Jul 25 03:47:30 mickrobk_: Thanks Jul 25 03:47:39 I don't have that kind of budget Jul 25 03:47:45 Your app should flow smoothly based on what a user would want to do, and not be forced into the architecture of your application. Jul 25 03:48:05 Makes sense , powerful gui concepts. Jul 25 04:22:49 jeez, all this stuff is beginning to make a slight bit of sense to me. hurray Jul 25 04:23:03 powerful. Jul 25 04:23:17 totally Jul 25 06:26:45 so, does anyone want to proof my example to make sure i've not done something retarded? Jul 25 06:31:56 screw it, lets see Jul 25 06:32:12 you've had me waiting about 10 hours now Jul 25 06:32:28 well i was doing research Jul 25 06:32:30 and reviewing code Jul 25 06:32:34 i've managed to actually start writing my application in that time Jul 25 06:32:37 i have found something interesting Jul 25 06:32:52 http://code.google.com/p/android-random/source/browse/trunk/CancelHttpGetExample/src/CancelHttpGetExample.java Jul 25 06:33:07 this is the interesting thing i found: http://mail-archives.apache.org/mod_mbox/hc-httpclient-users/200506.mbox/%3c20050615164118.GA4936@uml24.umlhosting.ch%3e Jul 25 06:33:40 basically, the last hurdle to making this truly interruptible is actually a bug in HttpClient (sort of), in that it doesn't take advantage of new Java 1.4 features that can make this work. Jul 25 06:33:53 so HttpClient 4.x may have this fixed. I will need to follow-up to confirm. Jul 25 06:34:01 that would be excellent, as that is the version android is expected to use. Jul 25 06:36:51 hmm Jul 25 06:37:45 (but doesn't currently) Jul 25 06:41:34 interesting Jul 25 06:44:19 bed time now. I'm sure I'll be exploding with questions all weekend now that I've finally gotten rolling though. Jul 25 06:44:25 night Jul 25 13:11:46 here is Google Android channel? Jul 25 13:17:19 merck: yes Jul 25 13:17:56 tomgibara: thx Jul 25 13:18:19 tomgibara: this channel for SDK user? Jul 25 13:21:02 yes Jul 25 13:21:18 for Android developers basically Jul 25 13:26:24 tomgibara: oh, thanks. Jul 25 14:30:25 sweet, just confirmed that HttpClient4 does in fact abort a blocking connect(). Jul 25 14:33:20 now to test whether the release in M5 has this code... Jul 25 14:33:24 * jasta crosses his fingers Jul 25 14:38:32 hmmmmm. it does, but it might be buggy :) Jul 25 14:38:35 i'll have to test it. Jul 25 14:41:41 jasta: noticed this story: http://www.anddev.org/viewtopic.php?p=9316#9316 Jul 25 14:59:11 zhobbs_: i remember reading about this as well Jul 25 14:59:49 actually i read another comment from oleg elsewhere too Jul 25 15:00:03 but i would imagine the timeline here works out for google. they are probably trying to encourage a stable httpclient 4.x release Jul 25 15:00:13 as of that writing theyre already way passed beta1. onto beta 4 now. Jul 25 15:00:40 regardless, this is excellent news. httpclient 4.x fixes the 3.x bug that prevents you from interrupting a blocking connect(). Jul 25 15:00:43 morning Jul 25 15:00:58 so the strategy i discussed earlier will work perfectly with httpclient 4.x and java >= 1.4 Jul 25 15:01:05 so, android's covered. Jul 25 15:01:42 i'm gonna put together an android-specific example to confirm that the version provided in M5 does in fact use the correct socket shutdown technique. Jul 25 15:02:01 * jasta is excited. Jul 25 15:02:11 i will need to rewrite a fair bit of my existing android code if i can prove that this works though :) Jul 25 15:49:01 ugh, my co-workers are so melodramatic Jul 25 15:51:53 i guess i just don't get the workaholic thing. if you like your job so much that you feel like you need to be there for 10-14 hours a day, you've really screwed up somewhere. Jul 25 15:52:10 i love how they try to blame it on workload, and the company's performance, bla bla. it's obviously a personal issue. Jul 25 15:56:27 romainguy_: complaining about this made me remember our conversation yesterday. hopefully, i can restate another way: would you be interested in a user-contributed example demonstrating a synchronized download thread cancellation? Jul 25 15:57:06 it seems like a good "best practice" example. Jul 25 15:58:36 and, in some ways it is particular to Android as it requires HttpClient 4.x to implement this strategy effectively. Not many folks happen to be using HttpClient 4.x, however. Jul 25 15:59:32 other third party libraries likely work as well, provided that they can be built to take advantage of new features introduced in Java 1.4. Jul 25 15:59:50 but as it is, HttpClient 3.x cannot, and the URL#openStream approach cannot. Jul 25 16:01:35 jasta: are you not working all the time ;) Jul 25 16:04:55 This seems like it'd be way too technically challenging for the timeframe they're talking about here: http://www.engadget.com/2008/07/25/analyst-says-android-and-symbian-to-merge-nokia-and-google-to-g/ Jul 25 16:05:12 its a long process Jul 25 16:06:34 yeah, I think it's kinda stupid to think that they can just easily merge in a few months... Jul 25 16:14:45 jasta: i just rode by the block party being setup. you going tonight? Jul 25 16:19:59 no, fucking lame Jul 25 16:20:20 why? Jul 25 16:20:24 my gf's grandpa is sick, so suddenly we have to go to oregon to visit Jul 25 16:20:36 oh man that blows. you've been talking about this for a month or more :( Jul 25 16:20:49 its the right thing to do, but what timing? argh. Jul 25 16:20:53 i was pumped about this for months Jul 25 16:21:15 yeah, i'm really disappointed Jul 25 16:21:24 we're leaving tonight after work :\ Jul 25 16:41:21 that sucks. Jul 25 16:41:28 Gone all weekend I take it? Jul 25 16:41:36 yup Jul 25 16:41:38 be back sunday night Jul 25 16:41:44 :( Jul 25 16:43:31 can I incorporate API's like google's google calendar api ? Jul 25 16:43:33 I just got azn breakfast from Uwajimaya. Eggs, chicken and onions scrambled over rice. Hrm. Jul 25 16:43:39 Is there any dalvek restrictions on that stuff Jul 25 16:44:26 sayers: I've used a handful of different jars without a problem Jul 25 16:44:30 sayers: google calendar is a web api. that is, it consists of standard HTTP requests and responses. Jul 25 16:44:48 any 3rd party library to implement it in Java will just do that. Nothing magical there. Jul 25 16:45:03 Alright, good just checking before I wrote this app Jul 25 16:48:45 you sure write a lot of apps Jul 25 16:48:59 you're either really fast or they don't do much Jul 25 16:49:19 or work Jul 25 16:49:20 ;) Jul 25 16:49:30 no thats mine Jul 25 16:49:31 heh Jul 25 16:50:48 No all my apps work, and they are short. This next one will be a bit larger seeing as it will work with google calendar. Jul 25 16:50:59 gotta start somewhere Jul 25 16:51:24 i prefer to jump in way over my head Jul 25 16:51:40 * jasta prefers to read and study before he codes Jul 25 16:51:45 but meh, that's just me :) Jul 25 16:59:45 i learn best just by digging in and experimenting. i can only gain so much comprehension by reading docs by themselves. Jul 25 17:01:09 i have been bitten by C far too many times trying it that way ;) Jul 25 17:01:44 it also taught me that trial and error is a generally failing strategy for software engineering. Jul 25 17:04:44 I keep typing until it works...and then bitch cause it's so hard to maintain Jul 25 17:05:15 actually, I used to work with a lot of people I thought just type and typed until it seemed to work Jul 25 17:05:21 but, that's the web world Jul 25 17:05:56 honestly, that's been most of my professional experience to date. Jul 25 17:06:03 maybe i've just always had bad jobs :\ Jul 25 17:06:21 i wouldnt necessarily call what I do trial and error (not that I'm advocating it.) I figure out what i want to do, read some docs, write some code, and then test it to make sure that I understood it correctly. This doesn't necessarily render me transparent to discovering problems before they occur. Jul 25 17:06:24 i can say with confidence that i have only worked (at a company) with 1 engineer i respected. Jul 25 17:11:08 i wish android layouts would let you specify spacing in addition to padding and margin Jul 25 17:11:27 spacing being the default distance between each widget as its packed. Jul 25 17:11:45 s/default/minimum/g Jul 25 17:11:45 jasta meant: spacing being the minimum distance between each widget as its packed. Jul 25 17:12:12 i really do not understand why we don't ban that bot Jul 25 17:12:20 ;) Jul 25 17:37:17 dangit, my car is such a piece of crap Jul 25 17:38:14 jasta: the tab activity does not follow the activity lifecycle, right? Jul 25 17:38:30 the activity that hosts the tabhost does. Jul 25 17:38:56 right Jul 25 17:39:01 the other activities which represent the various panels accessible by tabs do not. they are only used for their view hierarchy. Jul 25 17:39:23 yeah, the create, resume etc., are called always Jul 25 17:39:46 there is nothing special about the activity that hosts the tabs. Jul 25 17:39:53 its life cycle is the same as any other app Jul 25 17:40:02 any other activity* Jul 25 17:40:43 yup Jul 25 17:41:05 does the iphone support tabs? Jul 25 17:41:38 of course, many iphone apps use them. Jul 25 17:41:40 for example, the music player Jul 25 17:41:53 hmm, ok Jul 25 17:42:14 donno why people say tabs are not really mobile user friendly Jul 25 17:42:31 because they are thinking of the manifestation of tabs in poorly designed desktop applications. Jul 25 17:42:58 yeah, I think tabs work well for tunewiki Jul 25 17:43:34 even though I wish they were a little more powerful Jul 25 17:43:40 right Jul 25 17:43:45 lot of them use tabs Jul 25 17:44:19 I need TabHost.setCurrentTab(int tab, Bundle extras) Jul 25 17:44:38 yeah Jul 25 17:44:53 or maybe even, setCurrentTab(int tab, Intent i) Jul 25 17:45:37 there's a lot that can be done Jul 25 17:46:19 what frustrates me is that you basically have to slag off the entire activity manager if you want to implement your entire application within a tabhost Jul 25 17:46:41 (like the iphone music player) Jul 25 17:47:37 looks like its neglected Jul 25 17:47:53 so TabHost won't destroy activities that aren't being shown (if it needs to) Jul 25 17:47:58 ? Jul 25 17:48:15 zhobbs_: the host doesn't actually even spawn activities when you switch tabs that are defined by activities. Jul 25 17:48:31 all it does is fire onCreate(), then collect the View hierarchy and attach it to the tabhost. Jul 25 17:49:14 i dont think onDestroy is ever even called, even when the host is destroyed. Jul 25 17:49:23 i could be wrong about that. Jul 25 17:49:24 jasta: how did you handle the tabactivity lifecycle? Jul 25 17:49:43 i didn't have much reason to. all my app ever needed to do was catch ondestroy and disconnect from services and tidy up threads Jul 25 17:50:14 but i arranged it so the hosting activity did everything. Jul 25 17:50:27 ok Jul 25 17:50:28 jasta: yeah I know and they just keep adding the views to the framelayout, just seems like it'd be nice to remove the views from the framelayout to save resources, or maybe it doesn't matter Jul 25 17:57:11 So will my UI state persist if my activity has onPause() then onResume() called? Jul 25 17:58:17 (I don't need to, for instance, refill data in TextViews when that happens?) Jul 25 18:00:58 I guess I mean to say that the 'icicle' is only used in cases where the activity is actually terminated? Jul 25 18:01:51 yakischloba: the strategy as i see it for recovering an application state is to save state in onFreeze() and recall it in onCreate() Jul 25 18:01:59 you will be given the bundle you save in onFreeze back during onCreate(). Jul 25 18:02:37 jasta: Ok thats what I thought. I just never saw it explicitly stated that everything was peachy as long as the activity wasn't terminated. Jul 25 18:03:08 that said, you may want to save changes in onPause or onStop as well. Jul 25 18:03:14 depending on your application logic Jul 25 18:03:26 so I didn't know if I had to restore from onFreeze() if I just went onFreeze() -> onPause() -> onResume() Jul 25 18:03:33 for example, if a user is editing an e-mail, and they navigate away, onStop will be fired, and the user probably expects the e-mail to be saved as a draft. Jul 25 18:03:41 Yeah Jul 25 18:03:58 say they turn off the phone, days later return, your app should check if drafts exist that haven't been prompted before, and offer to open them as new. Jul 25 18:04:01 so the user can send Jul 25 18:04:05 if they say no, then you just happily leave them in draft Jul 25 18:04:17 but that isn't necessarily the same as the onFreeze/onCreate contract Jul 25 18:04:27 yeah I understand Jul 25 18:04:36 onFree/onCreate is more for maintaining state that would not persist indefinitely, only through the resource reallocation phase. Jul 25 18:05:03 For example, the HttpDownloader app I wrote for you. That app should freeze the last source and destination urls and fill them in onCreate() if supplied. Jul 25 18:05:43 i may be wrong about this, the documentation is pretty clear but there aren't a lot of examples to study so... Jul 25 18:06:08 My case is a small amount of data that is not really appropriate to persist in any other way until the user is done entering it. Jul 25 18:06:49 morrildl's i/o talk helped a bit Jul 25 18:07:11 the real advantage to saving in the onFreeze/onCreate contract is that it's simple :) Jul 25 18:07:30 the persistent approach is tougher. Jul 25 18:08:50 yeah. though I'm ending up with pretty verbose code for those methods, probably just due to my lack of familiarity with Java such that I can't figure out a more efficient way yet ;) Jul 25 18:10:03 jasonchen: do you know what the story is on the HttpClient bundled with Android? Jul 25 18:10:30 It seems both 3.x and 4.x beta 1 are included? Is Google planning to keep the 4.x tree in there even if it stays in beta? Jul 25 18:11:03 I'd like to start writing applications to depend on 4.x as it fixes a critical issue for me regarding socket shutdown and threading. Jul 25 18:11:19 dont use old stuff Jul 25 18:11:21 4.x is good Jul 25 18:11:37 yeah why not use the latest? Jul 25 18:11:48 well, because it's beta and the API is changing. Jul 25 18:11:55 no it's not Jul 25 18:11:58 check apache httpcomponents Jul 25 18:12:04 how much have they changed Jul 25 18:12:05 they're nearing rc Jul 25 18:12:24 i just read a comment from Oleg complaining that now that Android uses httpclient they will have extra pressure to stabilize the API Jul 25 18:12:29 where previously that was not an issue Jul 25 18:12:36 httpclient4* Jul 25 18:13:11 still, i am not going to just blindly assume that google will launch with a beta or rc version of httpclient4. i'd rather have clarification from their team. Jul 25 18:22:02 jasta: i don't know off-hand. let me look into that and get back to you here Jul 25 18:22:34 Whats the best way to check the Bundle being passed into onCreate() to see if it is being called for the first time or if it contains state information?.. Jul 25 18:23:04 yakischloba: it's yours to do with it as you please. you can layer whatever logic you want. Jul 25 18:23:17 well, if it's null it's first time probably Jul 25 18:23:21 jasta: So there is nothing built-in to indicate that? Jul 25 18:23:26 zhobbs: Ok Jul 25 18:23:30 yakischloba: no, would that be helpful? :) Jul 25 18:23:57 So it passes null on the first time? Not some generic Bundle without any data? Jul 25 18:24:12 not a bundle, but just null Jul 25 18:24:16 ok Jul 25 18:24:27 thats good enough for me. Jul 25 18:29:46 jasta: is zhobbs' answer somehow different than what you were thinking of? Jul 25 18:30:02 I guess I phrased the question a little weird Jul 25 18:30:35 yakischloba: . Jul 25 18:30:37 err no* Jul 25 18:31:00 ok Jul 25 19:15:48 yes Jul 25 19:15:55 I have seen & used rotary-dial phone Jul 25 19:16:29 When will ADC Phase II winners be announced and how? Jul 25 19:19:09 kennethr: in august sometime Jul 25 19:19:58 http://code.google.com/android/adc_faq.html#deadline I mean the $275K & $100K awards. Jul 25 19:20:12 zhobbs_: is this page out of date? Jul 25 19:21:13 kennethr: yeah, out of date Jul 25 19:21:46 is there a new date(day/week) or just "Sometime in august?" Jul 25 19:24:15 the deadline for submission is aug 5 Jul 25 19:25:31 zhobbs_: is the purpose for the delay documented somewhere? Jul 25 19:25:48 nothing about round 2 of ADC I is documented anywhere... Jul 25 19:26:02 where did you get your information, then? Jul 25 19:27:03 cause I was in the top 50 Jul 25 19:27:24 was or am? Jul 25 19:27:40 am Jul 25 19:27:44 or was, same thing Jul 25 19:27:57 so it was in e-mail from google ADC people? Jul 25 19:29:04 they email us instructions and such Jul 25 19:29:39 they haven't indicated when the winners will be chosen? Jul 25 19:30:33 it won't take long, they only have to judge 50 entries Jul 25 19:31:10 so that's a no? who is judging the entries? Jul 25 19:31:26 dunno Jul 25 19:31:36 there's a list of the round 1 judges out there Jul 25 19:33:00 There's some background info on round 1 at google's android blog: http://android-developers.blogspot.com/ Jul 25 19:42:10 i wish the finally block shared scoping with the try block in Java :\ Jul 25 19:42:20 and the catch blocks, too Jul 25 19:50:10 it'd be nice to have scope carry into objects defined inline Jul 25 19:51:15 public void doSearch(String s) { Thread t = new Thread() { public void run() { String searchingfor = s; ... ... } }; } etc Jul 25 19:51:42 zhobbs: you can Jul 25 19:51:46 global vars Jul 25 19:51:50 no Jul 25 19:51:53 just declare the variable final Jul 25 19:51:55 My.this.bleh also Jul 25 19:51:59 and it will be visible from anonymous classes Jul 25 19:52:33 everything should be final almost Jul 25 19:52:39 for speed Jul 25 19:52:41 ? Jul 25 19:53:03 doesn't matter with local variables Jul 25 20:02:03 I'm using an AlertDialog and my single button is aligned to the left of the dialog box. I don't see a way to change its position, but I see a screenshot that has in centered in the dialog. What am I missing? Jul 25 20:02:08 jasta: get anything for sysadmin appreciation day? Jul 25 20:02:36 well, everyone got a 20% bonus check for the last 6 months of work Jul 25 20:02:39 so that's pretty sweet ;P Jul 25 20:02:54 ... Jul 25 20:03:02 disgusting imo Jul 25 20:03:10 should take me out for drinks Jul 25 20:05:50 f00f-: what is the performance implication of final? Jul 25 20:06:22 it's faster for objects if you dont extend them and let the compiler/vm know Jul 25 20:06:28 the only thing that i can see is that it gets to optimize away dynamic storage duration if it wants. Jul 25 20:06:45 which isn't something the runtime would even want to do very often Jul 25 20:06:56 f00f-: right, but i mean why? Jul 25 20:07:32 the storage duration check makes sense to me, especially since romain just confirmed that it doesn't matter for lcoal variables, since their storage duration would be unaffected. Jul 25 20:08:01 but i can't think of anything else that you could do with a final variable for optimization sake? Jul 25 20:08:20 it seems to me it's mostly a language construct to enforce constants Jul 25 20:08:31 it must save something to disable inheriatnce/overriding for finals? Jul 25 20:08:37 yes, perhaps Jul 25 20:08:38 like? Jul 25 20:08:46 with methods at the least it allows u to skip virtual method invocation Jul 25 20:08:50 something Jul 25 20:09:25 mickrobk_: yes, that makes sense. Jul 25 20:10:16 final fields are faster to access Jul 25 20:10:29 f00f-: we are talking about two different finals here Jul 25 20:10:41 I was talking about writing: doSearchString(final String s) Jul 25 20:10:48 vs your final class MyClass Jul 25 20:10:49 romainguy__: i can accept that, but i can't see why? Jul 25 20:10:58 i'm curious to learn Jul 25 20:11:13 oh right.. yeah i meant final classes/methods Jul 25 20:11:25 f00f-: i was talking about final variables ;) Jul 25 20:11:43 specifically member variables. Jul 25 20:11:47 I don't remember the specifics unfortunately, you would have to ask some VM :) Jul 25 20:12:01 "VM guy" Jul 25 20:12:22 i'll see if i can google around Jul 25 20:13:06 btw, i love the developer works articles at ibm.com on java Jul 25 20:13:21 i always seem to randomly hit on them when i'm looking for answers like this :) Jul 25 20:13:26 I wouldn't be surprised if with HotSpot a final getter method would be as fast as accessing a field directly Jul 25 20:14:04 romainguy__: yeah i guess that's what i was hinting at: what is it that a non-final member is required to do that final wouldn't be? seems like maybe a good opt potential but i don't really know what i'm talking about. Jul 25 20:14:33 the compiler and the VM know that the value will not change Jul 25 20:14:41 so they can probably do things like inlining Jul 25 20:14:56 or use some faster way to get access to the value Jul 25 20:15:06 but just like you, I don't know what I'm talking about here ;-) Jul 25 20:15:27 yeah, that's true, but inlining something other than a literal doesn't seem to make any sense from a performance stand point Jul 25 20:15:32 anyway, i'm reading ;) Jul 25 20:19:44 hehe Jul 25 20:19:46 "final is vastly overused for classes and methods (generally because developers mistakenly believe it will enhance performance)" Jul 25 20:21:22 lol Jul 25 20:21:41 uh oh Jul 25 20:21:43 that's em Jul 25 20:21:45 Me Jul 25 20:22:15 http://www.ibm.com/developerworks/java/library/j-jtp1029.html Jul 25 20:27:31 jasta: note that the article is from 2002 though Jul 25 20:27:42 who knows that HotSpot for instance did later Jul 25 20:27:47 right, i've eben looking for a more recent article as well Jul 25 20:27:49 and i can't find one Jul 25 20:28:20 which is slowly convincing me that perhaps final is as i thought it to be, a language construct to write more maintainable code :) Jul 25 20:28:52 romainguy__: thanks, nice to know that final trick for passing to inline classes Jul 25 20:29:12 zhobbs_: that's also how you can "return" values from anonymous classes Jul 25 20:29:16 you create a final array of 1 Jul 25 20:29:24 for instance final int[] result = new int[1] Jul 25 20:29:49 eww ;P Jul 25 20:31:36 ok after checking with the people who know, Dalvik doesn't optimize anything when it's final Jul 25 20:32:37 I have an EditText who's contents needs to end up as a Float. Currently I'm just parsing the contents as a String into Float and catching the exception if it cannot be parsed. Is this an appropriate way of 'validating' the contents or is there something better? Jul 25 20:33:04 yakischloba: yes, but a better way might be to prevent the user from entering invalid characters in the first place. Jul 25 20:33:20 jasta: Gotcha. Is this a facility of EditText? Jul 25 20:33:36 i'm not sure. if not directly, subclassing may be a possibility. romain? Jul 25 20:34:46 yakischloba: look through the api demos for edittext, i thought i saw a filter to that effect, i could definitely be wrong Jul 25 20:34:56 really, that should be a function of the virtual keyboard that should popup when you focus an EditText Jul 25 20:37:15 what virtual keyboard? Jul 25 20:37:29 a la iphone Jul 25 20:37:31 he means :P Jul 25 20:37:54 romain said "what virtual keyboard" once too, which made me speculate wildly that android devices would have a physical keyboard Jul 25 20:38:46 which would be lame, id rather have the phone be thin... :( Jul 25 20:38:55 aye Jul 25 20:39:02 jasta: that was just a reference to the fact that M5 has not virtual keyboard Jul 25 20:39:14 s/not/no Jul 25 20:39:42 i know, i was just fondly remembering the good old days Jul 25 20:40:09 romainguy__: do you know if there is any reason to call up to the super handleMessage in Handler? Jul 25 20:40:11 i think i may prefer having a smaller screen with hardware keyboard Jul 25 20:40:20 i saw a few places do that Jul 25 20:40:42 yakischloba: i prefer that as well. i tend to get my screen all slimy otherwise :) Jul 25 20:40:46 handleMessage is empty in Handle Jul 25 20:40:54 but it's just a good practice Jul 25 20:42:46 granted I haven't owned a phone with a virtual kb, i have used other peoples and didn't care much for it. tactile response is important to me Jul 25 20:44:43 right Jul 25 20:44:45 tactile feedback is nice, but i think if a virtual keyboard was done right it could be really good in terms of how well it predicted what u meant to type Jul 25 20:44:51 but it better succeed in the marketplace Jul 25 20:45:06 that is one of my worries Jul 25 20:45:08 i mean qwerty was designed so letters commonly hit in a row are far apart Jul 25 20:45:24 i think id have to be alot less accurate with a good virtual keyboard Jul 25 20:45:29 qwerty was designed by the us military, so who knows what angle they have on it Jul 25 20:45:39 but noone has managed to get it right Jul 25 20:45:56 well remember we have predictive text also Jul 25 20:45:57 qwerty was designed to make it easier for video surveillance to pick up what password you typed. Jul 25 20:45:59 that can help pinpoint Jul 25 20:46:01 the finger touch area Jul 25 20:46:05 some heuristics there Jul 25 20:46:46 qwerty was desgined by a machinist in the 1860's Jul 25 20:47:17 no wait Jul 25 20:47:22 qwerty was desgined by a machinist in the 1860's Jul 25 20:47:29 no wait Jul 25 20:47:51 BTW the proper method to use looks like setFilters() Jul 25 20:47:52 the patent was in 1878 Jul 25 20:48:41 and it was to provide a mechanical seperation beteween letters typed in sequence in order to reduce the likelyhoood of jams Jul 25 20:48:55 mmmm Jul 25 20:48:55 ooh Jul 25 20:48:58 yeah you're right Jul 25 20:49:02 altho i still get jams on typwriters Jul 25 20:49:23 i've never used a typewriter :) i've seen them though Jul 25 20:49:24 any news in the android world? Jul 25 20:49:45 new sdk or demo of the newer sdks on youtube maybe? Jul 25 20:50:10 nah bro Jul 25 20:55:57 saw the new sdk on bittorrent site the other day.... Jul 25 20:56:12 that's sad Jul 25 20:56:15 haha, j/k...did check though Jul 25 20:57:08 it does amaze me how google doesn't care that it's getting bad press with leaving us out to dry Jul 25 20:57:43 we don't even get a simple, we know you are expecting something, we'll have it to you soon or nothing Jul 25 21:01:42 tethridge: http://jbq.livejournal.com/151129.html Jul 25 21:01:59 Does anyone have an example of an InputFilter? Jul 25 21:11:43 I'm not turning anything up :( Jul 25 21:45:02 hmm. Jul 25 21:45:05 * jasta praises an eyebrow Jul 25 21:45:15 HttpClient 4 in Android seems quite broken Jul 25 21:45:27 hangs for a long time initializing the SSLFactory class, even when you don't require it. Jul 25 23:34:16 bleh Jul 25 23:35:22 hello all Jul 26 00:28:05 Anyone have an example of an InputFilter? Jul 26 00:52:17 Is there a slider gui widget? Jul 26 00:52:31 try SeekBar Jul 26 00:52:41 not sure if it's in M5 though Jul 26 00:52:52 romainguy__, I'll try that Jul 26 00:53:02 sayers: it's not in m5 Jul 26 00:53:09 then it's not in M5 Jul 26 00:53:17 sorry for that, you'll have to wait for the next SDK Jul 26 00:53:19 That sucks... Jul 26 00:53:38 sayers: I made one for M5: http://www.helloandroid.com/node/250 **** ENDING LOGGING AT Sat Jul 26 02:59:56 2008