**** BEGIN LOGGING AT Thu May 21 02:59:57 2009 May 21 03:02:59 romainguy: the rest of the file wasn't consistent May 21 03:06:16 then match the javadoc you're editing May 21 03:06:23 romainguy: should it have added me as a reviewer? :/ May 21 03:08:22 you're not reviewing the change :) May 21 03:08:30 romainguy: even within that one function the param args had different indentation for line 2+ May 21 03:08:51 yeah - that's why I thought it was weird the page on gerrit listed me in the reviewers May 21 03:09:04 ah yeah May 21 03:09:14 you're automatically added when you make changes May 21 03:09:20 it's kind of weird but eh :) May 21 03:09:34 ok - nothing I need to do for it though, right? :) May 21 03:09:39 nope :) May 21 03:09:50 if the change gets approved, we'll submit it May 21 03:09:54 you're done May 21 03:09:58 thanks for your contribution :)) May 21 03:10:06 so do I win the prize for the lamest first patch ever? May 21 03:10:27 why lame? May 21 03:10:32 it's quite helpful May 21 03:10:36 such a small one May 21 03:10:42 yes but it fixes the doc May 21 03:10:45 yeah - mistakes in docs bug me May 21 03:10:50 so that helps pretty much all other devs May 21 03:10:57 and it's the kind of thing we often don't have time to take care of :(( May 21 03:11:10 we REALLY appreciate that kind of help May 21 03:11:12 and it was easy enough - plus now I've got no excuse to look at other stuff having it all setup properly now May 21 03:11:26 uhuh May 21 03:11:29 when using a PreferenceActivity, is there a way to override when they try to leave the activity? I'd like to kick off a task and cancel the finish() under some conditions May 21 03:11:35 and also you know how to submit a change ;-) May 21 03:11:40 if you notice any others fill free to fling them my way and when I get a bit of time I'll set down and sort it out May 21 03:11:50 hehe - good thing the indentation needed fixing ;) May 21 03:11:51 cool thanks skyPhyr May 21 03:12:03 at least you did read the docs and used --replace :)) May 21 03:12:07 np May 21 03:12:25 almost missed it - good thing I had to enter my password and double checked before doing so May 21 03:13:07 would have been a bit ironic incorrectly submitting a fix for docs because I didn't read the docs May 21 03:13:16 ^^ May 21 03:13:22 I wouldn't blame you May 21 03:13:27 I'm still struggling with @!# git May 21 03:13:46 yeah - it's different, but the branches in it are nice :) and it's damn fast May 21 03:13:57 so do I need to destroy my branch now or?? May 21 03:14:00 yes May 21 03:14:04 repo abandon branchname May 21 03:14:13 git is very powerful, like linux May 21 03:14:15 cool thanks :) May 21 03:14:22 and like linux, it's user interaction sucks ass :) May 21 03:14:30 s/it's/its May 21 03:14:40 haha, zing! May 21 03:15:01 hehe- I wouldn't switch back to windows though :) May 21 03:15:37 should I use repo to switch to master or just git? May 21 03:15:39 the problem I have with git is that working on several changes (hence different branches) increases the number of builds I have to make each day May 21 03:15:43 after the abandon May 21 03:15:46 and since I work on the framework, these are long builds May 21 03:15:55 skyPhyr: repo abandon will switch for you May 21 03:16:03 how long does a build take for you, romainguy ? May 21 03:16:15 a full build takes about 15/20 minutes on a MacPro May 21 03:16:21 up to 1 hour on a MacBook Pro May 21 03:16:35 building the framework takes between a few dozen seconds and a few minutes May 21 03:16:40 (depends on the dependencies that have changed) May 21 03:16:40 romainguy: I don't think it has, a git status immediately after comes up with "Not current on any branch." May 21 03:16:51 skyPhyr: that's what I meant May 21 03:16:57 that's where you should be May 21 03:17:16 oh - so master is referred to as not currently on any branch rather than the master branch? May 21 03:17:30 * skyPhyr is just learning git too May 21 03:39:56 is Thread.currentThread() an expensive call? May 21 04:00:31 romainguy, I've been looking through the source to SlidingDrawer and I'm a bit confused; does it only work because the hidden bits are completely off-screen? May 21 04:00:43 there's no way to adjust z-index or anything, is there? May 21 04:20:46 KNY: well yes, but that's the job of the drawer's container May 21 04:21:23 I don't know if you remember discussing it, but I asked about having a linearlayout slide out from underneath another, a bit like the drawer does May 21 04:21:38 and you said that it would have to redo the layout at every frame May 21 04:22:35 and I was wondering if I could do it by following slidingdrawer's example May 21 05:07:38 Hey, i got a question about intents. May 21 05:07:45 I use an intent to show a web page. May 21 05:07:49 *but* May 21 05:08:11 It shows the page, no problem. May 21 05:08:41 WheN I back out, and the enter again. It opens up a new browser. Is it possible to open it in such a way tehre aren't a bunch of new windows opened. May 21 05:08:41 ? May 21 05:20:45 svm_invictvs, I haven't been able to find a way May 21 05:20:57 of course I last looked during 1.0 so maybe something has changed May 21 05:21:03 This is 1.1 May 21 05:21:11 'cause i don't have cupcake on my retail g1 phone. May 21 05:26:15 hey guys! the question probably is dumb but as with perf issues assumptions can be quite counter-intuitive... when displaying a lot of moving sprites what is the most battery-efficient method? Picture, Canvas... or GL? May 21 05:30:51 tell eclipse to delete a file. It lets me know it has unsaved changes and asks for confirmation. You know - just in case I want to save those changes so I can delete them too. May 21 05:37:33 <_Auron_> cedricv: I'd think GL May 21 05:37:54 <_Auron_> considering it's hardware-accelerated and doesn't put strain on the cpu May 21 05:42:44 _Auron_: that's what I "counter-intuitively" think too, otoh it turns on some chip that would be powered off if not using GL... so i wonder if there is really a gain there. anyone has made measurements about it? May 21 05:45:10 yeah but you're still using the CPU :) May 21 05:47:25 romainguy: sure, but much less intensively so it could probably be in powersaving mode most of the time (like powersave governor is actually more battery-hungry than ondemand governor) no? May 21 05:47:34 no it won't be in power saving mode May 21 05:47:51 if your game is running at 60 fps your game is going to keep the CPU awake May 21 05:48:20 grumble May 21 05:48:36 is this a bug that a lockCanvas() is repetedly returning null? May 21 05:48:50 I'd say you're doing something wrong May 21 05:50:48 hmm yeah, FPS wakeups/sec is the obvious limit indeed. is there any tools to test and measure different strategies wrt battery life? May 21 05:50:59 DDMS May 21 05:51:04 in the Events log tab May 21 05:54:32 romainguy: I only call it after the surfaceCreated callback is made >< May 21 05:56:25 romainguy: thanks, will have a look May 21 05:56:37 the events log is pretty awesome May 21 05:56:42 you can display tons of really cool information May 21 05:56:57 and if you compile your own firmware you can enable data about drawing and layout May 21 06:15:06 neat, I never knew that you could attach a debugger to a process without restarting the app May 21 06:15:28 that would be very annoying otherwise :) May 21 06:15:35 yeah, tell me about it May 21 06:15:47 that's how I've been doing it for ~6 months now May 21 06:15:52 ouch May 21 06:15:52 dude May 21 06:15:53 :) May 21 06:15:56 haha May 21 06:15:58 <-- chump May 21 06:16:03 at least you don't restart the emulator each time May 21 06:16:18 I did that for about a week before I realized that you didn't have to May 21 06:16:19 haha May 21 06:16:39 you reboot your computer every time you recompile an app? :)) May 21 06:16:51 you don't? May 21 06:17:41 oh, and whoever made the decision that we don't need android:debuggable anymore is my hero May 21 06:18:38 you do May 21 06:18:41 on a user build May 21 06:18:56 ? May 21 06:19:16 you mean if you don't use eclipse? May 21 06:47:31 Anyone happen to know what I'm looking for so that my widget wakes the phone and displays itself (or the lock screen) May 21 06:51:36 MediaPlayer setVolume says it takes floats, but doesn't specify the range :/ May 21 07:13:04 hello, im trying to create a widget that uses an sqlite database, and need to delete rows when the widget gets deleted but onDeleted never seems to get called May 21 07:13:18 and as such, my database is getting quite cluttered May 21 07:18:46 how can i kill an app May 21 09:17:08 Does anyone know how to get a textview to interact with a clicked autolink ? May 21 10:02:40 hunterp: call finish() from within it May 21 10:03:06 ObsidianX: ping? May 21 10:03:17 pong! May 21 10:03:18 zomg May 21 10:03:22 howdy May 21 10:03:25 I know your issue May 21 10:03:32 i believei got it figured out May 21 10:03:38 hang on - will find a link - short of it is that it's a bug May 21 10:03:40 ahh cool May 21 10:03:40 i just overwrote onReceive :P May 21 10:04:01 yeah - exactly :) grab the Intent yourself and call onDelete May 21 10:04:03 figured it was a bug :P May 21 10:04:17 thanks for the help =) May 21 10:04:22 you're just too smart ;) it's what I get for looking at 3 hour old logs ;) May 21 10:04:25 haha May 21 10:04:27 no worries May 21 10:04:46 I'm doing exactly the same thing in a widget here lol May 21 10:05:21 nice little buggers aren't they? May 21 10:05:42 you working for the competition? May 21 10:05:46 or just for your own project? May 21 10:08:42 a bit of both - the competition as an excuse to do something a bit smaller May 21 10:08:48 hehe May 21 10:09:03 i just passed some milestones myself tonight May 21 10:09:12 not sure what I'll do with it after losing ;) maybe try sell it through some non-market store (Aussie devs can't sell still) May 21 10:09:21 ahh nice - what are you putting together? May 21 10:09:50 a slide show May 21 10:09:56 sweet :) May 21 10:09:57 my girlfriend came up with the idea =) May 21 10:10:09 finally got the slideshow SHOWING stuff tonight May 21 10:10:09 :P May 21 10:10:13 how about you May 21 10:10:15 hehe that's funny my wife inspired mine May 21 10:10:31 it's monitors how long since you've called someone May 21 10:10:37 little display ther May 21 10:10:40 oh nice May 21 10:10:45 then sets off alarms etc to remind you to call May 21 10:10:50 hehe, my girly will like that one :P May 21 10:10:57 so when you're out for drinks you remember to keep in touch :) May 21 10:11:00 haha May 21 10:11:04 thats a great idea May 21 10:11:15 I used to get in trouble all the time for forgetting May 21 10:11:20 hehehe May 21 10:11:31 just got it doing the alarm bit properly today - trying to get the call state stuff sorted May 21 10:11:56 maybe afterwards you could clue me in on alarms? i was browsing the AlarmClock code but it didn't jump out which part was actually the alarm service May 21 10:12:16 the PhoneStateListener kinda seems like it, but I'd like to know how it persists May 21 10:12:18 sure thing May 21 10:12:27 let me know when you wanna ask alarm questions :) May 21 10:12:35 hehe, will do ;) thanks May 21 10:13:20 you/your girl up for a test of this widget when I get this last bit sorted? May 21 10:13:35 i'd love to, and i'll tell her about it tomorrow May 21 10:13:40 (3am :P) May 21 10:13:52 hehe - add my gtalk - it's this username May 21 10:14:01 but gmail May 21 10:14:14 not that I'm unlikely to be here lol May 21 10:14:48 done May 21 10:14:55 so have you made any other android apps? May 21 10:19:40 part way through one May 21 10:19:48 said stepped to work on this May 21 10:19:51 side May 21 10:20:24 how about you? May 21 10:20:31 got two little things published =) May 21 10:20:44 http://www.cyrket.com/package/com.obsidian.free.today May 21 10:20:45 http://www.cyrket.com/package/com.obsidian.free.soda May 21 10:22:49 sweet - I was just thinking what a pita it is to get the date on android May 21 10:23:56 skyPhyr: pita? why not pulling down the notification window to get the date? May 21 10:24:21 biafra__ lol - how did I never noticed the date there? May 21 10:24:50 thanks :D May 21 10:24:52 cuz its out of the way ;P May 21 10:24:57 skyPhyr: np May 21 10:26:09 ObsidianX: be cool if you had an abbreviation for the day on the mini one :) May 21 10:26:44 i got some work to do on that once the competition is done =) May 21 10:26:56 user customization, tweaks, etc May 21 10:27:21 yeah - I've been finding it's driving me nuts that the closer you get to done the further away it seems May 21 10:27:37 I mean it's always like that, but when you're just learning a new platform it's even worse May 21 10:27:43 hehe May 21 10:27:46 yeah May 21 10:29:01 man - it looks like PhoneStateListener is my only option - worried that it might chew through a lot of juice - strange there isn't intents for getting that info May 21 10:29:57 I like the Calendar widget which shows the next appointment May 21 10:30:49 and I like putting bookmarks on the home screen. to bad its only three screens May 21 10:31:43 why not make it 5 or nine. you ca always go back to the middle by tapping home twice May 21 10:32:21 they should just let you add May 21 10:32:25 like aHome (i think) May 21 10:32:38 ObsidianX: oh. aHome does that? May 21 10:32:45 one of them does May 21 10:32:50 caps it for memory May 21 10:32:53 but still let you May 21 10:33:07 ObsidianX: and they replace the home screen? May 21 10:33:24 so they show when I hit the home button May 21 10:33:27 ? May 21 10:33:31 yup May 21 10:33:41 if you just publish the intent category of HOME you can replace the home screen May 21 10:34:08 ObsidianX: I thought they were only themes. need to have a closer look May 21 10:34:21 ObsidianX: do they support the new widgets? May 21 10:34:33 some have their own widget API's May 21 10:34:46 they were all made back in 1.1 May 21 10:35:17 hmm, gallery view is nice May 21 11:12:14 sorry for the silly question - how can I search the android market? i go to http://www.android.com/market/ but only see top apps, no way to search? May 21 11:16:54 thrope: you can use cyrket.com May 21 11:17:28 thrope: its actually not a silly question May 21 11:17:30 biafra__: ah thanks... I am thinking about getting a g1 and wanted to see what sort of apps were avaiable, but the official android market is pretty rubbish - it makes it look like there are very few May 21 11:17:57 searching the market even from a G1 is the joke May 21 11:19:02 I just don't get it how a search company (or THE search company) has such a bad search functionionality in their market May 21 11:23:18 maybe they want to keep the value of having an app 'featured' or 'placed' so they can charge developers for that May 21 11:23:35 if you could easily find whatever you wanted there would be no advantage to that May 21 11:24:31 thrope: I wouldn't attribute to malice what easily can be attributed to stupidity :-) May 21 11:24:51 or in this case lack of resources to do it right May 21 11:26:16 dont normally think of lack of resources when i think of google May 21 11:26:43 but i see your point May 21 12:25:31 I've got a listview which displays a bunch of articles.. I want to bind an image to each of the entries, however, I want it to be threaded (obviously) May 21 12:26:05 I'm new to Java (and especially threading), so I was wondering if anyone knew of any good tutorials or sample code for doing something like this May 21 12:27:11 I'm skeptical about firing up a new thread for every image on the list because of the amount of HTTP requests fired at once, and overloading the device with threads May 21 12:28:00 So I was thinking some sort of downloader queue.. but I need to pass an imageview or a reference to an imageview from the UI thread to the thread and back.. May 21 12:28:06 Rexxars: check out AsyncTask . Its like a managed thread which has a doInBackground method and a completeMethod which is called for you May 21 12:28:24 http://developer.android.com/reference/android/os/AsyncTask.html May 21 12:29:00 many thanks recursv :) May 21 12:29:27 If you're going to be firing off tons of them for a long list though it wouldn't hurt to include a pooling concept as well May 21 12:29:46 yeah, that's what I figured.. a pool/queue of some sort May 21 12:31:29 just note that any calls to the UI must be done on the UI thread and not from your background threads May 21 12:31:58 apparently, AsyncTask can only be executed once.. any suggestions on how I'd handle pooling? some sort of infinite loop with a sleep/check-cycle? May 21 12:35:16 You could implement a queue which stores requests to display images for articles. The queue then kicks off up to 4 asyncTasks. The asyncTasks call back to the queue in the postExecute method to say they are done and the queue then potentially kicks off a new task if required.. It does seem rather heavy height though. Perhaps there should be a simpler idea. Infact... May 21 12:37:46 If you implement a custom component which composes an image and a textview. Then make the image implement a proxy pattern and return a loading image if it has not loaded it's real image and kick off an async task to load the real image. When the real image is loaded, fire a invalidate view to repaint the real image. Then make the async task start when the image is visible and cancel it if still active when the component is no l May 21 12:39:26 sounds like a smart idea May 21 12:40:03 Cool, hope it works : ) May 21 12:40:21 just need to look into this asynctask stuff and find out how that works first :p May 21 12:41:11 suppose I should use UserTask instead, seeing as AsyncTask is 1.5 only May 21 12:43:08 Ok. I'm fairly new to the stack myself May 21 12:43:20 so Good to know May 21 13:13:33 I have a android developer phone, connected using usb to my linux machine. but adb doesnt see it. May 21 13:13:50 I run adb as root. what else could I have missed? May 21 13:14:30 is it a g1 or an openmoko device? May 21 13:15:29 a g1. May 21 13:19:26 Hmm, this isn't really the right channel for it and i've not got a g1 : ).. If you are on ubuntu you could check out http://www.maximyudin.com/2009/04/24/android/connecting-and-debugging-g1-on-ubuntu-904/ May 21 13:19:29 Might help May 21 13:21:02 this is not the right channel for android-development-things? May 21 13:21:08 Gelb, try connecting it to a on-board USB socket (as opposed to the front-facing usb sockets) May 21 13:21:47 recursv: but your URL helped! thank you! May 21 13:21:57 : D May 21 13:22:15 I think "sudo ./adb kill-server" - the HTC-webpage didn't mentioned it. May 21 13:22:20 helped May 21 13:24:15 WOOT! my widget is functionally complete (until users are whiny) May 21 13:29:02 ie: release day May 21 14:49:07 does anyone have a link on the structure for a color drawable xml file? May 21 15:01:18 mmmulani, there are a bunch of examples in the repo May 21 15:12:40 Having a problem with preference getting something to happen on an onclick : http://dpaste.com/46308/ May 21 15:13:03 my custom Preference, added in a window, it appears. May 21 15:13:06 NetworkPreference pref = new NetworkPreference(this, null ); May 21 15:13:18 I never see anything appear when I press it May 21 15:17:25 you've implemented OnPreferenceClickListener May 21 15:17:34 have you registered this somewhere as a listener? May 21 15:20:52 I guess that needs to be done, I thought java would be smart enough.. or it could do some kind of automatic hookup, since its abstract. May 21 15:21:19 can you do it in the constructor ? May 21 15:22:27 is there any other places besides ebay and cellulardr to by G1 hardware parts? May 21 15:22:48 uh May 21 15:22:53 ... I don't know why you're complaiing. May 21 15:23:00 you have to register for callbacks May 21 15:23:07 i'm not complaining at all. May 21 15:23:09 i simply dont know May 21 15:23:12 you may also unregister if you do not want something to give callbacks! May 21 15:23:17 this is my third week doing java. May 21 15:23:27 well, this would be the same thing in C++ :\ May 21 15:23:36 * vol blows a raspberr7y May 21 15:23:41 * wmealing_ doesn't c++ either May 21 15:23:53 well vb doesn't count May 21 15:24:06 oh now thats just insulting May 21 15:24:28 (C, btw) May 21 15:24:36 hahaha May 21 15:24:41 then you DEFINITELY need callbacks! May 21 15:26:29 would this.setOnPreferenceClickListener(this); do ? is that what you mean ? May 21 15:26:49 probably May 21 15:27:45 new languages, just like the old languages but more verbose. May 21 15:28:37 no good. May 21 15:28:38 * wmealing_ thinks May 21 15:32:32 make sure that code is actually getting called May 21 15:32:42 that is probably all you need May 21 15:46:32 Hi, I want to modify my AlarmClock Application. I downloaded the full android with repo and git. Now I have Eclipse set up with an " android " project containing the whole android source. Now I want to test my AlarmClock on emulator or on my phone, but I don't know how to do. I know I shouldn't use the eclipse build but if I run Make on the android root it doesn't prodecue any apk files. What should I do? May 21 15:48:07 is there anyone? May 21 15:49:02 panerai_go_: the alarm clock was probably merged into the source. Perhaps you can pull it out and create a new project in a new directly. May 21 15:49:09 So that you're only working with the alarm clock project. May 21 15:49:31 I tried that but it uses a lot of protected classes May 21 15:50:01 so if I use it as a new project all the protected methods are not visible May 21 15:50:07 Yes, you will need to create an android project that includes the android lib from the SDK. May 21 15:50:33 hard to inherit from a class that isn't linked. May 21 15:59:00 actually libraries are linked but a few are not visible from my project because it's external May 21 16:03:22 are there any vector formats for a drawable? May 21 16:21:48 does @android:drawable/empty exist in 1.5? May 21 16:25:45 my app is for firmware 1.1 and is currently in the market. what happens when I upload a version for 1.5? will the 1.1-version disappear, so that people with 1.1 can't download a working version anymore? May 21 16:36:29 Gelb, i think that the goal is that you write defensively May 21 16:36:31 and accept both versions May 21 16:44:45 wmealing_: I want to use some features only 1.5 has, so I can't support 1.1 any more. May 21 16:46:01 hm good question, what do 1.1 people see if an app requires 1.5? May 21 16:46:17 I think they just see an app. May 21 16:46:26 and then leave comments pissed that it doesn't work on their 1.1 build. May 21 16:46:42 i tried to search for my app on an 1.0-device, and I just didn't find it, seems to be invisible. May 21 16:46:45 from reading through comments, that seems to be the case. May 21 16:47:15 google should fix such things, if his is really the case. May 21 16:47:19 if this May 21 16:47:33 But surely this can't be the case. The app says which build it is for. Surely your market app is smart enough not to let you buy apps you can't run. May 21 16:47:57 Gelb, i dont think its support, perhaps you can wrap it ? May 21 16:48:08 i'm just guessing May 21 16:48:12 Gelb: what's the name of the app? May 21 16:48:15 maybe I just wait till 1.5 is shipped... May 21 16:48:17 perlmonkey2: Wapedia May 21 16:49:54 Gelb: nice May 21 16:50:08 thank you. May 21 16:51:20 The Market uses minSdkVersion in AndroidManifest.xml to filter apps May 21 16:51:48 morrildl: but as soon as I update my app to 1.5, people with 1.1 can't get the old app any more? May 21 16:51:55 so if you are using 1.5 features, set minSdkVersion to 3, and the app will not appear to existing users May 21 16:51:59 Gelb: correct May 21 16:52:33 nasty situation, that half of the world gets updated to 1.5, while the other half has to wait... May 21 16:53:27 yeah, because if you fork the namespace, you'll have two upgrade paths to maintain. May 21 17:03:49 Anyone have problems with the Sample API code hanging when you try to run the OS->Sensors in a VM? May 21 17:06:00 Gelb: well, the UK isn't half the android world sadly May 21 17:06:03 it's a small fraction of it May 21 17:06:08 but i agree it's unfortunate that there was a delay May 21 17:09:55 morrildl: morning ;) May 21 17:12:39 TD: as far as I know 1.5 is also shipped in germany. May 21 17:18:13 scan May 21 17:19:49 is there a way to trim out unused R.values.strings if they are not used/referenced anywhere ? May 21 17:20:09 i could probably write one, just thought there may be. May 21 17:22:41 wmealing_: there is a script in the android source tree under development/tools/findunused/findunusedresources May 21 17:22:50 but it must be modified slightly to work with projects outside the android tree May 21 17:22:54 and it is pretty crude May 21 17:23:27 i would recommend producing a real tool and attempting to contribute it to the android tree officially. May 21 17:23:40 that would be very cool, and im sure much appreciated by google May 21 17:24:23 yeah, will see what I can do. May 21 17:25:23 Gelb: even smaller :( May 21 17:51:33 anyone here tried guice 2.0 with android yet? May 21 17:53:41 hey there. is there a way to link to the market from my application? May 21 17:53:59 yes May 21 17:54:04 look at what cyrket does May 21 17:54:10 with 2d barcodes in particular :> May 21 17:54:50 vol, oh! nice! May 21 17:57:50 sammyF: launch a webview from your app with the url market://search?q=com.sammyF May 21 17:58:29 or just send an intent with that uri May 21 17:58:33 jt436: great! that's what I was looking for :) May 21 17:59:09 but cyrket is still very nice. at least I can see my paying applications now ;) May 21 18:00:07 cyrket is very useful May 21 18:03:22 when your service's process is killed for it's resources, is there anyway to save state before exiting? or handle it's shutdown? May 21 18:04:44 probably not I assume... May 21 18:04:52 it's not being stopped, it's just killing the process May 21 18:06:29 nope May 21 18:06:34 it's just sent SIGKILL afaik May 21 18:06:39 you have to regularly checkpoint state May 21 18:13:59 zhobbs: i'd be surprised if you don't at least get stopped first May 21 18:15:37 no, unfortunately you have to write services on the assumption you can die at any point May 21 18:15:46 the kernel will happily OOM kill you whenever it feels like May 21 18:15:59 one of the many joys of the android lifecycle :) May 21 18:16:03 oh services, sure May 21 18:16:10 TD: I have that problem too. May 21 18:16:12 well, not "sure" but you know what i mean May 21 18:16:20 actually, speaking of which May 21 18:16:43 if someone has used up all of memory but a call comes in, there's really nothing else the system can sensibly do. May 21 18:16:45 TD: can I be sure to be restarted right away when the situation gets better? May 21 18:16:45 :( May 21 18:16:46 one of our features is putting our app into the "background" which is to say starting a home intent but pretending WE ARE JUST LIKE WINMOBILE! :D :D :D! May 21 18:16:54 it's not _that_ hard to write code which checkpoints itself, but it is extra work we could do without. especially as android has a plethora of ways to serialize and it's not always clear which is best :) May 21 18:16:57 vol: ha ha ha May 21 18:17:00 is there any way to help our app stay around as absolutely long as possible? May 21 18:17:10 which is to say, reap it for memory last? May 21 18:17:24 hrm May 21 18:17:24 there is in 1.5 but don't use it, otherwise you will be lame forever May 21 18:17:32 : ( May 21 18:17:33 in fact i am amazed the api was made public in 1.5 May 21 18:17:36 tell me! May 21 18:17:39 which, TD? May 21 18:18:09 because. I Toast on restart and those Toasts show up when I unlock the screen. is my service restarted earlier? May 21 18:18:32 vol: no May 21 18:18:34 stop being so evil May 21 18:18:41 and onDestroy seems to be called like _never_ May 21 18:18:50 biafra__: the service will be restarted yes. don't change the UI in onCreate May 21 18:18:58 biafra__: and if onDestroy is never called it's because you leaked your service :( May 21 18:19:08 remember. onCreate() can be called without a corresponding call to onStart() May 21 18:19:23 : ( May 21 18:19:26 or onResume() May 21 18:19:26 so if your service is invoked by intent, rather than onBind(), you MUST implement some kind of timer to shut yourself down if no work is received May 21 18:19:51 otherwise you will unfortunately leak a process and the users phone will get slower until it is restarted May 21 18:20:01 easy to do, pretty disasterous when it occurs too. May 21 18:20:19 * TD is hoping/waiting for somebody to build a rails-like framework that simplifies all this down, somehow, magically .... May 21 18:20:28 vol: why do you want to do that ? May 21 18:20:37 TD: what do you mean by leaking a service? It should be running at all (possible) times May 21 18:20:42 Heya. Does android provide any functions for application settings or should I just create a SQL database and handle them myself? May 21 18:20:53 SharedPreferences May 21 18:21:04 vol: why should your app be reaped last? i mean, why is your app special? May 21 18:21:07 which play nicely with the preferences framework May 21 18:21:18 seeing as you have to deal with reaping anyway .... might as well get it out of the way and tolerate it happening at any time May 21 18:21:23 TD: because developers always think *their* app should be May 21 18:21:29 * TD has faith in vol May 21 18:21:33 right, vol? May 21 18:21:53 biafra__: ok, if that's intentional then why are you surprised onDestroy is never called? May 21 18:21:58 I am fine with killing my app if nexessary. but I need to be restarted as soon as possible May 21 18:22:05 you will be restarted within 5 seconds May 21 18:22:06 Thank you very much romainguy. May 21 18:22:13 TD: because the service is killed May 21 18:22:55 I'm having this weird problem where, when the phone is slow, users think nothing is happening so they hit a button multiple times, which launches an activity multiple times. Is there a clever way to prevent that? May 21 18:23:07 yes, it's an unfortunate consequence of androids design ..... the service can be killed with no corresponding call to onDestroy, because the kernel makes the decision on its own when memory runs out, and so it's not clear what the semantics of that would be May 21 18:23:19 eg, how much time are you allowed to sit in onDestroy and keep other apps waiting. how much memory can you allocate in onDestroy. etc May 21 18:23:51 TD: our app runs in the background,. May 21 18:23:53 you should not have to rely on onDestroy() May 21 18:24:01 The user might pop away to answer a phone call or something May 21 18:24:07 but our stuff is still running along smoothly May 21 18:24:19 i fail to see how a regular service is not enough ? May 21 18:24:21 if it is reaped unceremoniously, we don't really save state quite like we'd like May 21 18:24:25 TD: onLowMemory() is called at least sometimes is that something to rely on? May 21 18:24:33 TD: we're running as a (lot of)threads started inside a shared lib May 21 18:24:35 i mean, what if your app needs to be killed to start the phone call ? May 21 18:24:36 vol: don't you save your state in onPause/onStop? May 21 18:24:43 you'll get those if the user switches to another app May 21 18:24:44 if onLowMemory() is called things are already in the state of catastrophic low-mem handling May 21 18:24:51 biafra__: no. you cannot rely on anything being called on a service, except onCreate() May 21 18:24:58 hmm.. does Android's Java use the J2SE API? Like.. can I use the classes in the api like ArrayLists? May 21 18:25:00 ctate: yeah, that's kind of a stop gap, and we can try and clear some stuff. May 21 18:25:01 biafra__: you _must_ checkpoint state regularly. May 21 18:25:04 the9a3eedi: yes May 21 18:25:07 it's really J5SE May 21 18:25:07 TD: or onBind() if that's the usage model May 21 18:25:07 assume you will stop running at any arbitrary point May 21 18:25:08 TD: I do May 21 18:25:13 the9a3eedi: java.io, java.util, java.lang, java.net, etc. are there May 21 18:25:13 so you get all the wonderful stuff like generics May 21 18:25:14 ctate: right May 21 18:25:21 awesome. May 21 18:25:22 vol: no it's not, many packages are missing :)) May 21 18:25:25 TD: but I wanted to see, when and for how long my service was not running May 21 18:25:35 the9a3eedi: the Java language we use is J5, yeah. ==vol May 21 18:25:46 TD: by logging in onLowMem or onDestroy May 21 18:25:46 actually May 21 18:25:48 biafra__: if your service is intended to never stop, it'll only be stopped for periods of 5 seconds at a time (currently) May 21 18:25:52 * emmby reads up on android:launchMode May 21 18:25:54 you can use J6 if you want, too May 21 18:25:55 romainguy: well, it's mostly there. May 21 18:25:58 Was worried because once I tried compiling a java program with a non-sun jdk. Didn't work because ArrayList was undefined. So I thought maybe each development kit is different May 21 18:25:59 biafra__: you can watch "adb logcat" to see it be started/stopped by the system May 21 18:25:59 it's J2SE 5.0 version 1.5 :)) May 21 18:26:03 heh May 21 18:26:17 emmby: funny .... can't you just make the button disable itself when pressed? May 21 18:26:18 romainguy: 1.5? o_O why not 1.6? May 21 18:26:20 (some of our people use the 1.6 javac internally) May 21 18:26:24 emmby: although i've never actually seen the system get that slow myself May 21 18:26:30 the9a3eedi: 1.6 is called Java SE 6 May 21 18:26:34 TD: well. I'd have to start that in terminal. since those killings happen "on the road" May 21 18:26:37 the9a3eedi: javac 1.6 is not available for MacOS Tiger, which some of our people have to use May 21 18:26:41 so we can't mandate it May 21 18:26:42 and 1.4 was called J2SE 1.4 May 21 18:26:47 biafra__: it's logged anyway. you can get people to send you a bugreport when they encounter trouble. May 21 18:26:50 Sun == fucked up names May 21 18:26:50 TD: and that would kill my battery, wouldn't it May 21 18:27:07 ctate: that and we don't really need anything from 1.6 May 21 18:27:17 although I'd be happy to put @Override on interface methods May 21 18:27:20 TD: i suppose i could. launchMode seems right though since most of my activities shouldn't have multiple instances anyway. But if I did want to disable the button, when would I re-enable it? May 21 18:27:23 romainguy: we don't *need* anything, but i do really wish ==romainguy May 21 18:27:24 that. May 21 18:27:25 biafra__: if your users have the SDK they can use "adb bugreport" and mail you the result. if they don't, i have an app they can use to generate a bugreport then email it to you May 21 18:27:28 TD: for now, I take your word (that its restarted soon) :-) May 21 18:27:37 ctate: actually we could very well have the 1.6 API without the 1.6 compiler :) May 21 18:27:53 yeah but we'd have to write the @Override on interfaces handling ourselves. yuck. May 21 18:27:57 emmby: how long does your activity take to start? the minimum is like 200ms or something. how impatient are your users? May 21 18:28:14 biafra__: ok :) May 21 18:28:22 ctate: no, not if it's not used in the implementation of Harmony May 21 18:28:27 I never really saw anything in 1.6 that was too compelling May 21 18:28:48 vol: 1.6 is mostly interesting for the tools and the much much much improved graphics stack May 21 18:28:55 TD: it's usually not very long, but like i said, every once in awhile the phone seems like it takes slightly longer than usual so the impatient among my users may hit the button a few times May 21 18:28:58 ah May 21 18:28:58 the HotSpot VM also has some pretty wild optimizations May 21 18:29:00 ctate: I see.. though it's strange. wasn't 1.6 out a very long time ago? May 21 18:29:08 only a couple years May 21 18:29:09 the9a3eedi: blame Apple. May 21 18:29:10 vol: anyway, the "never reap me" setting is pretty dangerous, like i said, i wish it had not been exposed in cupcake. it's only going to be a matter of time before devs who don't grok the lifecycle start abusing it to never shut down. then the phones will start to crap out and die. May 21 18:29:13 the9a3eedi: yes, blame Apple for not updating their Java May 21 18:29:15 well they did May 21 18:29:20 but for 64 bits CPUs only May 21 18:29:25 and Leopard only May 21 18:29:36 TD: which setting is that again? May 21 18:29:38 emmby: well yeah but i'd say 500-1000msec is sort of pushing it to start an activity, and it's sort of hard to press a button several times in one second. May 21 18:29:49 ctate: May 21 18:29:55 TD: basically, I want to use it because we're huge and ugly and our startup time from a dead start is pretty terrible, and the user expects us to live in the background May 21 18:30:04 vol: what app is this ? May 21 18:30:07 TD: reminds me of devs who don't get the onDestroy/onCreate cycle on screen rotation and want to handle the rotation themselves instead May 21 18:30:09 TD: also, we have work in development to prevent apps from doing abusive things that prevent the lifecycle from applying normally. word to the wise. :) May 21 18:30:15 romainguy: hehe :) May 21 18:30:16 TD: That would be telling : ( May 21 18:30:32 romainguy: incidentally we do that as well. May 21 18:30:34 romainguy: well, in fairness to myself, i wouldn't care if webview did The Right Thing May 21 18:30:41 vol: if that's the app you showed me I would certalinly not expect it to always live in the background May 21 18:30:45 ctate: hmm, interesting :) May 21 18:30:52 romainguy: it is, and why not May 21 18:31:24 vol: because if I run it once and then I'm not going to use it before a day or two, why the hell would it stay around and prevent me from having other apps running? May 21 18:31:29 vol: so, that setting is meant for the home screen, and is an ugly hack to work around the fact that they didn't manage to make the home screen start up fast (imho) May 21 18:31:45 romainguy: it only lives in the background if the user hits "hide application" or presses the home button. There is also a notification to let you know it is living. May 21 18:31:46 TD: we did manage to make it start fast May 21 18:31:54 it is not really an application that you want living in the background for a day or two anyway. May 21 18:32:03 TD: the problem is there's nothing Home can do about it when the device is super busy because of other processes May 21 18:32:09 i still see it take several seconds to load the icons from time to time, even in cupcake .... May 21 18:32:11 ah well, maybe so May 21 18:32:22 yeah, 'persistent' is not the same as the kill priority May 21 18:32:26 by no means I will claim it's as good as it could be May 21 18:32:29 and is very, very heavy, as romainguy implied May 21 18:32:33 but I spent days working on its startup time May 21 18:32:43 and Home is very I/O intensive May 21 18:32:49 very, VERY I/O intensive May 21 18:32:50 actually very often it starts up slowly because of I/O contention May 21 18:32:55 yes, it's definitely improved in cupcake, and yes i realise reading from internal storage is a pig on the g1 :) May 21 18:32:56 and widgets made things MUCH worse May 21 18:33:16 i'd actually go so far as to say that IO is almost all of why Home is sluggish to start up May 21 18:33:30 whats it need to do? May 21 18:33:33 and that's why Home juggles iwth a bunch of threads at startup May 21 18:33:35 if you hacked a version of Home that didn't bother with the icons, it'd be MUCh faster May 21 18:33:36 * TD is sort of amazed io contention is actually an issue with solid state storage May 21 18:33:42 silverblade: read all the apks to get their infos (icon, name) May 21 18:33:46 ahh May 21 18:33:47 i mean, hard disks, sure, there is one piece of metal flying around the drive May 21 18:33:48 why do people think solid state storage is fast? May 21 18:34:04 no movement i guess May 21 18:34:04 romainguy: how comes it doesn't cache that info ? May 21 18:34:12 TD: Home does May 21 18:34:15 when the process is running May 21 18:34:19 but Home is not persistent May 21 18:34:30 but if its process is killed... May 21 18:34:32 ctate: cuz it is! the flash drives we're playing with at work are only about 10x slower than RAM May 21 18:34:33 it was at one point but we stopped that because it impaired overall system performance May 21 18:34:48 and Home's process has more than Home inside May 21 18:34:53 TD: desktop SSDs do not use the same kind of flash :) May 21 18:34:55 so keeping it around would penalize all other apps May 21 18:34:57 romainguy: ah, i see. i meant maintain a persistent cache of icons+names on storage. or is g1 too space constrained for that? May 21 18:35:07 also, the G1's mem bus is very slow May 21 18:35:20 ah ok May 21 18:35:22 TD: we're thinking about it May 21 18:35:24 my mistake then. i thought it was applied t home. May 21 18:35:54 but it's delicate because of apks installs/uninstalls/updates May 21 18:36:03 that May 21 18:36:19 and also the fact that activities can be enabled/disabled at runtime, etc. May 21 18:36:25 but yeah, that's something we want to do May 21 18:37:29 cool May 21 18:37:34 actually May 21 18:37:41 on a stock device, with no extra app installed May 21 18:37:45 does the magic have faster internal storage? May 21 18:37:48 and just the normal processes around May 21 18:37:55 Home can do a cold startup in about 400ms May 21 18:38:11 you can do whatever you want but I doubt many apps on Market are that good :p May 21 18:38:16 -do+say May 21 18:38:18 TD: the Sapphire (the hardware platform used by the Magic) is essentially the same as a G1, with different mem allocations. May 21 18:38:24 anyway, lucnh time May 21 18:38:47 and ofc without a hard keyboard May 21 18:39:21 oh, right May 21 18:39:25 when does the home startup time actually matter? May 21 18:39:32 romainguy: that's true. 400ms is pretty good May 21 18:39:39 btw is base startup time for a new activity 200ms still ? May 21 18:39:46 its started once after boot, right? May 21 18:39:50 uscheller_: well, when home has been killed and you press the home button May 21 18:40:04 ah k May 21 18:42:53 would it be possible to have one button mapped to switch between the last two active activities? like the browser and an IRC-Client? like command-tab on macosx? May 21 18:43:13 like the camera button on the G1 which does nothing May 21 18:43:24 except in the camera app May 21 18:43:31 there's a program on the market which does in fact do that May 21 18:43:35 so the answer is May 21 18:43:36 yes May 21 18:43:53 biafra__: hold down the home key May 21 18:43:54 TD: great. whats it called? May 21 18:43:58 it will show the last 6 activities May 21 18:44:07 vol: too comlicated May 21 18:44:12 ... May 21 18:44:17 takes too long too May 21 18:44:17 "task switcher" i believe. and yes there is already one built in. task switcher uses the camera button. it also presents a gui tasker switcher, but it's quite configurable May 21 18:44:26 off hand i don't know if it does a "toggle between last two activities" mode May 21 18:45:09 yeah, it does May 21 18:45:55 TD: its exactly what I was looking for. according to the description. thanks! May 21 18:46:05 well, it has a short delay - you have to hold the camera button May 21 18:46:10 so it might not be exactly what you want. but try it. May 21 18:46:13 one can certainly be written May 21 18:50:50 man.. people on ebay are jerks May 21 18:51:04 they want like $150 - $200 for a G1 with a broken LCD/digitizer + not sure if it even powers on May 21 18:51:04 Phantoon: try People on the Market for a change ;) May 21 18:51:13 I've been fighting a crash on orientation change on a TabActivity with two tabs: an expandable list activity, and a preference activity. The crash is a ClassCastException: android.widget.ListView$SavedState May 21 18:51:17 people on the market? May 21 18:51:36 ugh May 21 18:51:44 I have it down to a hello,world .. but first.. I'm creating the preference activity ui via a call to addPreferencesFromResource() May 21 18:51:47 Phantoon: android market has the same people that comment on youtube, but they're worse. May 21 18:52:03 vol: bah, FFS .. don't people have lives outside the internet May 21 18:52:03 Phantoon: the comments you get when you publish an application on Google Market are ... well ... very intelligent and thoughtfull ;) May 21 18:52:21 its shit like that , that makes you want to just.. not do that May 21 18:52:36 is there a 'better' way to create a preferencescreen than addPreferencesFromResource in onCreate()? May 21 18:52:46 im not great an coding or app dev, but when i write something, and spend my TIME and ENERGY into it.. it may suck, but its FREE and OPEN.. May 21 18:52:55 so in short you get what you pay for.. so if you want to offer suggestions, thast great May 21 18:53:03 bah May 21 18:53:04 rant May 21 18:53:05 Phantoon: I put out a $0.99 app so that we could test the marketplace webservices stuff. May 21 18:53:09 Phantoon: I don't think someone can top the "whoever developped this is a 5 year old idiot, and whoever buys it is one too" comment I got on my first application. So now I'm ready for anything ;) May 21 18:53:11 it was pretty nifty for $0.99 May 21 18:53:23 half of the comments were "OMG UR GREEDY 4 CHARGIN MONY 4 THIS FUK U" May 21 18:53:26 yea.. i mean shit May 21 18:53:29 vol: lol May 21 18:53:30 "ON STAR!%$21" May 21 18:53:39 i piss away $20-$200 a day hafl the time May 21 18:53:41 the other half were "You're a moron, read the description! Five stars!" May 21 18:53:44 so May 21 18:54:01 can't you delete teh comments? May 21 18:54:02 heh May 21 18:54:05 or keep people from commenting? May 21 18:54:08 no May 21 18:54:10 bah May 21 18:54:11 and that's a good thing May 21 18:54:15 well it is.. but May 21 18:54:19 when the majority is assclowsn May 21 18:54:25 so, for what it's worth: May 21 18:54:33 a) yes some people are barely literate idiots. welcome to earth. May 21 18:54:40 yea.. i guess May 21 18:54:51 b) some apps have a lot of crappy comments because they do in fact crash all the time or have a lot of problems, and the authors don't realize or are in denial May 21 18:54:53 (in my experience) May 21 18:55:04 c) comments are way OTT in both directions May 21 18:55:08 TD: 2 is definatly true.. however some issues are hard to replicate May 21 18:55:10 OTT? May 21 18:55:15 over the top. i routinely get comments that are absurdly positive May 21 18:55:22 given the simplicity of the app and the serious problems it has May 21 18:55:31 absurdly positive? May 21 18:55:31 people give it 5 stars and call it "the best app ever" and other stuff, which it clearly isn't May 21 18:55:35 hmm May 21 18:55:37 haha May 21 18:55:44 well at least your not stroking your own ego May 21 18:55:45 "this app didn't quite do what it was meant to, but it's a great idea. 5 stars" May 21 18:55:47 stuff like that May 21 18:55:52 though i tend to like sto stroke myself too May 21 18:55:53 :P May 21 18:55:55 so, don't take it too seriously, is all i can say May 21 18:55:57 TD: What's your app? May 21 18:55:59 it's nothing personal May 21 18:56:01 blanu: facebook sync May 21 18:56:10 Ah handy. May 21 18:56:15 TD, on the other hand you have "Download too too long (1 star)" May 21 18:56:18 yea, i really suck at anything development.. and i gotta wait til i can figure out why USB is so flakey on this phone May 21 18:56:23 TD, which is also a favourite ;) May 21 18:56:24 how do you move around a view within a relativelayout? (as in change the alignment after it has been added) May 21 18:56:59 but yeah.. just don't take the comments personally and you'll be fine May 21 18:57:13 sammyF: ehh yea. when i get to that point ill do just that May 21 18:57:18 people suck May 21 18:57:19 wmealing: ping May 21 18:57:21 wmealing__: ping May 21 18:57:39 sammyF: yeah that sucks May 21 18:57:44 sammyF: i understand why they say that though May 21 18:57:44 too bad you can't delete comments and put a disclaimer like "anything ill thought out or slanderish will be deleted" May 21 18:57:56 or report it to a moderator or something May 21 18:57:59 not that its a huge deal May 21 18:58:02 Phantoon: well that'd make it useless. i WANT to know if an app has serious bugs,crashes all the time etc May 21 18:58:13 TD: yes, but they can let you know without saying OMG YOU SUCK DICK May 21 18:58:17 or OMG LOL WUT May 21 18:58:29 that was what i was getting at May 21 18:58:35 yeah, stupid comments suck, but how would you filter out the stupid ones without losing the useful ones that are just poorly worded May 21 18:58:58 if they're poorly worded, they're probably stupid. May 21 18:59:05 simple.. look at the context for any personal looking attacks.. any one worht hearing is going to take time to address it in a manner that wont come off that way May 21 18:59:10 I really just think that there should be a 3 strikes rule for comments May 21 18:59:16 3 strikes and you can't comment anymore May 21 18:59:28 i think the market has started filtering swear words and the like now May 21 18:59:35 well it is fairly new so May 21 18:59:36 but i agree there should also be a "report as offensive" type option May 21 18:59:42 yea May 21 18:59:45 im sure thatll e coming soon May 21 18:59:53 * TD nods May 21 18:59:56 damn phone May 21 18:59:58 the market team have a crapload of stuff on their plate May 21 19:00:00 WHY ARE YOU SO FLAKEY May 21 19:00:07 for those apps that do crash a lot, it would be really nice if android provided a way to mail you stack traces when an app crashed May 21 19:00:11 i wonder ift he PCB board is messed up May 21 19:00:15 I'm missing something stupidly obvious here, I'm trying to get an app to open the browser with a URL, my code says: May 21 19:00:17 I tried playing around with JavaMail yesterday but couldn't get it working May 21 19:00:19 emmby: i agree. i wrote a stack reporter app for my own app May 21 19:00:28 Uri u = Uri.fromParts("http", "m.theregister.co.uk", null); May 21 19:00:29 so all apps are in java right? May 21 19:00:29 Intent i = new Intent(Intent.ACTION_VIEW, u); May 21 19:00:31 some of the stack traces i get back are amazing May 21 19:00:39 stuff i thought could never possibly crash, does. May 21 19:00:41 java and the android API/framework May 21 19:00:54 I get the browser, with google results for "http:m.theregister.co.uk", anyone got any ideas? May 21 19:00:56 right, all in java May 21 19:01:06 doc_savage: don't construct your uri using fromParts? Just use a regular string to built it May 21 19:01:12 TD: did you hook into Thread.uncaughtExceptionHandler or something? May 21 19:01:24 TD: I didn't see a constructor to do that, I'll have another gander May 21 19:01:30 (or method) May 21 19:01:46 so a new SD card didn't help the camera or USB issue, damn May 21 19:02:02 Phantoon: mostly. May 21 19:02:06 TD: ah ... parse() :) May 21 19:02:06 doc_savage: i think it's called parse or something May 21 19:02:10 there's nothing stopping you from using linux shared libs May 21 19:02:15 and writing stuff in C++ for part of it May 21 19:02:22 thanks TD and emmby :) May 21 19:02:25 aside from the overhead of jni and the compatability issues and the "not supported" part May 21 19:02:37 What's the right way to create the UI for a preferenceactivity addPreferenceFromResource in oncreate, right? May 21 19:04:53 emmby: nah, i just surrounded the meat of the code with a try catch May 21 19:04:57 This crashes on orientation-change (having a tabactivity with two tabs: expandablelist, and preferenceactivity) : http://pastebin.com/d1a146dd so simple, why the crash? May 21 19:05:23 emmby: the amount of stacks i get back even from that is large, so i don't anticipate needing to extend it for a while May 21 19:05:41 TD: hrm, problematic for me since I'd have to do that for each of my activities and each of my background threads May 21 19:06:05 emmby: it's really not that hard to wrap code in a try/catch handler, you need to do that anyway for most errors, as dying with the default message is rarely the right thing to do May 21 19:06:18 emmby: i just have a utility Utils.postExceptionAsync which does an HTTP post in a background thread May 21 19:06:20 super simple May 21 19:06:25 vol: "go ahead and write C++ linux native stuff, but if it doesn't work, don't call us." ?? May 21 19:06:26 soreachilles: which line crashes? May 21 19:06:44 kc8pxy: more like "Don't write C++ linux native stuff, and don't whine when it breaks" May 21 19:07:19 emmby: but i agree that if your code is quite spread out, it's more work May 21 19:07:51 TD: it doesn't crash in any of my code, it's an android stck track May 21 19:08:01 ends up with: 05-21 19:06:15.761: ERROR/AndroidRuntime(11442): java.lang.RuntimeException: Unable to start activity ComponentInfo{cc.PrefListTest/cc.PrefListTest.PrefListTest}: java.lang.ClassCastException: android.widget.ListView$SavedState May 21 19:08:01 vol: to me that sounds like shortcuts were made. but the java platform does just about everythingi can think of.. May 21 19:08:07 well yes. so we need to see the stack trace May 21 19:08:48 kc8pxy: not really. Dalvik is "supported". The public apis are "supported" May 21 19:09:04 it's kind of like reading the man page on a function where it says "doing xyz will cause unspecified behavior" May 21 19:09:12 I mean, yeah, it'll probably turn out ok. May 21 19:09:19 but, if it doesn't, you're the moron that did it. May 21 19:09:36 TD: stacktrace ... http://pastebin.com/d32751a11 May 21 19:10:30 soreachilles: yeah that looks like a bug in android, maybe romainguy would be interested in seeing that. at any rate i'd file a bug May 21 19:10:45 happens in 1.1 and 1.5 fwiw May 21 19:11:23 I'm sorta looking-for/hacking-out a workaround May 21 19:12:02 not sure, but romainguy is who you need. he does a lot of work on the widget library May 21 19:12:11 ok, thx May 21 19:12:35 i haven't used those classes before, so can't help. sorry. May 21 19:13:35 np... yeah wasn't sure if there's a better/different/safer way of creating prefs... i'll keep hacking on it May 21 19:13:53 you're creating a preference screen? May 21 19:14:00 soreachilles: best bet is to check how the shipped apps do it May 21 19:14:20 I have a PreferenceActivity and in onCreate() i'm calling addPreferencesFromResource May 21 19:15:03 the examples of preferenceactivity i've seen use this addPreferenceFromResource .. shrug May 21 19:15:25 there's probably another way May 21 19:15:30 there always is :) May 21 19:16:07 To inflate from XML, use the addPreferencesFromResource(int). The root element should be a PreferenceScreen. <-- Are you following this? May 21 19:16:17 yep May 21 19:16:33 http://pastebin.com/d1a146dd is all the code I'm doing and the preference xlm May 21 19:16:35 xml May 21 19:16:49 when implementing getView() in subclass of ArrayAdapter can I do something to ignore the current item? like returning null? May 21 19:17:35 I'd have to look into it, but I have to go grab a bite at the moment May 21 19:17:46 grab one for me May 21 19:18:06 if I have some time when I get back, I'll see what I can do...but I'm sure romainguy will pick it up before then :) May 21 19:18:23 heh k, I'm just throwing it out there while I look for a workaround/hackaround May 21 19:19:17 ahhh! dangit May 21 19:21:09 or do I have to remove those items from the Array? May 21 19:23:43 hi folks. i am having a problem when drawin a Bitmap via a canvas.drawBitmap May 21 19:24:28 the bitmap gets only drawn the first time i call the drawBitmap on my canvas. i am trying to draw the canvas again in a different location but that does not work May 21 19:24:49 do i have to refresh the bitmap? or duplicate the resource? or somthing? May 21 19:27:54 no, should just work as long as the bitmap exists. May 21 19:28:06 what do you mean draw the canvas again? May 21 19:30:19 like doing canvas.drawBitmap(bitmap, location1); canvas.drawBitmap(bitmap, otherLocation); May 21 19:30:31 loocation as in rect coords May 21 19:30:47 are you doing it in a context where the view system knows it has to update the display? May 21 19:31:13 ^^ May 21 19:31:17 it is all happening in a continuos render loop and i am building up the current frame May 21 19:31:32 how does one go about getting a dev phone? May 21 19:31:41 kc8pxy: get a market account, order one from there May 21 19:31:45 you may as well just get a G1 and root it, though May 21 19:32:20 soulreaper: drawBitmap has at least three arguments, looking at the canvas docs May 21 19:32:31 there's a src and a dest May 21 19:33:03 maybe you're abbreviating drawBitmap(bitmap, left, top, paint)? May 21 19:33:41 vol: the root unlocks it? May 21 19:33:53 vol: yes that was my entention May 21 19:34:09 i am actually doing: canvas.drawBitmap(stripVBitmap, srcRect, destRect, paintLines); May 21 19:34:34 kc8pxy: do you need an unlocked phone? if so you might want an adp1 I guess May 21 19:34:50 though I didn't have to unlock my phone when I went to taiwan using JF's RC33 build, so ymmv? May 21 19:36:28 soulreaper: does the render loop actually work? May 21 19:36:34 yes it does May 21 19:36:43 i mean, does drawing anything at all there work properly, or is it just that bitmap .... May 21 19:36:46 i can draw shapped based elements and animate them May 21 19:37:32 i just can not draw the bitmap a second time on a different location May 21 19:37:41 the same instance of that bitmap May 21 19:37:55 What can I do with ProgressDialog? May 21 19:38:35 oh nevermind.. May 21 19:39:04 heh "fixed" the bug May 21 19:39:28 by override onRestoreInstanceState(Bundle b) and not calling back up to super on it May 21 19:46:42 new View.OnClickListener() View cannot be resolved to a type... What the @%@.. What's wrong here :P May 21 19:47:41 you didn't import it? May 21 19:48:41 wow I'm stupid May 21 19:48:42 import android.view.View; May 21 19:48:53 romainguy: thanks May 21 19:49:22 hi romainguy: it was suggested I lob a bug regarding a crash with orientation change on a tabhost with an exandable list view, and a preference tab, your way. I just entered a bug for it though... do you want to see/hear about it? May 21 19:50:03 "Go to the Preference tab, then change orientation on emulator or open/close May 21 19:50:03 keyboard on G1." May 21 19:50:05 what preferences tab? May 21 19:50:32 I attached the code May 21 19:50:39 to the bug May 21 19:50:54 the .txt? May 21 19:50:57 y May 21 19:51:02 you couldn't attach several files? :)) May 21 19:51:13 shrug, I was posting it in pastebin, heh May 21 19:51:20 I have the project here, I can just upload it to the bug I guess May 21 19:51:28 soreachilles: that'd make my life easier :) May 21 19:51:32 k will do May 21 19:54:06 eeh my Toaster is almost invisible, can I give it a stylish look? May 21 19:54:29 I used this Toast example: http://code.google.com/p/android-for-gods/wiki/Toast May 21 19:55:38 romainguy: updated with a zip of all the stuff May 21 19:55:45 I mean.. normally it had a grey background or something May 21 19:55:58 bug 2732 May 21 19:56:23 did chatzilla turn that into a link? weird May 21 19:57:59 CoolShorts: almost invisible? May 21 19:58:05 CoolShorts: they always seem pretty visible to me May 21 19:58:09 i don't think there's a way to change the style May 21 19:58:12 yes it doesn't seem to have a background May 21 19:58:17 od May 21 19:58:25 well I'm rewriting it now May 21 19:58:32 so maybe in a few seconds it will be better May 21 19:58:42 CoolShorts: hmm. that example is stuffing a textview into it May 21 19:58:48 CoolShorts: i normally just use the standard "show this message" api May 21 19:58:53 I'm giong to repost the code though, I realized I hacked around with itlooking for a workaround May 21 19:58:55 one sec May 21 19:59:11 ah it's better now! May 21 19:59:18 I used makeText of the toast May 21 20:04:11 romainguy: ok reposted the code to the bug, this time without my random hacks while I was looking for a workaround-- I should have posted the clean version the first time, sorry 'bout that May 21 20:05:21 see, I told you he'd get to it before I had a chance to run through stuff :) May 21 20:05:30 he's a better person to have look at it anyways ;) May 21 20:05:50 now I'll feel really bad if it's not a bug, but it's me... May 21 20:06:21 actually I have a fix May 21 20:06:22 (I won't feel -that- bad) May 21 20:06:26 heh May 21 20:06:28 nice May 21 20:06:38 I've been waiting for the approval for 5 minutes :) May 21 20:06:49 you see my workaround? that's what I'm doing, but that causes the bundle to be null in the tab's on create May 21 20:07:29 but I don't care about the savedInstanceState in the tabs ... soo.. works for me.. May 21 20:10:40 what does setResult(RESULT_OK); do? May 21 20:12:16 How do I catch teh back button event again? May 21 20:14:28 soreachilles: bug fixed in Donut May 21 20:14:55 cool thanks, ... so regarding workarounds -- anything better than just killing onRestoreInstanceState in the tabhost? May 21 20:15:08 awesome May 21 20:15:25 romainguy has been on a bug fixing rampage lately it seems. lots of gui bugs fixed. May 21 20:15:44 TD: not more than usual and not more than other engineers May 21 20:15:58 it's just that most bugs are fixed in our internal database May 21 20:16:02 so you don't get to see it May 21 20:16:06 unfortunately :(( May 21 20:16:22 someday, romainguy May 21 20:16:29 I know :) May 21 20:16:38 Is the cupcake a lie? May 21 20:16:44 hm May 21 20:17:02 lol May 21 20:27:03 T-mobile USA hasn't deployed it have they? May 21 20:28:07 not yet May 21 20:28:42 can anyone point me to a article or tutorial on using imageviews as buttons and how to determine if they were touched and also being selectable using the arrows or trackball? May 21 20:31:15 BeBoo: do you just want to use an ImageButton? May 21 20:32:13 well, from the example in the SDK, no... I have graphical buttons I wish to use May 21 20:33:09 what's different from how you want to use an ImageView than what is available for use with an ImageButton? May 21 20:33:30 I'm just trying to get my head around what you're trying to do May 21 20:34:05 i want to use this: http://www.beboobailey.info/about.png May 21 20:34:29 you can do that with an ImageButton May 21 20:34:38 you just need the correct states May 21 20:34:53 I'll give you a link, just give me a second May 21 20:35:03 if i use an imagebutton it puts a white border around my image May 21 20:35:17 great, thanks =] May 21 20:35:33 http://www.craigethomas.com/blog/2009/03/restyling-android-imagebuttons/ May 21 20:35:58 ImageButton is just an extended ImageView with different attributes (for the most part) May 21 20:37:19 and you could also go the route of extending the ImageButton May 21 20:37:22 thanks. I'll look this over. May 21 20:37:31 i'm a newbie so don't confuse me ;p May 21 20:37:40 ok ;) May 21 20:37:43 i'm surprised i've gotten this far, tbh May 21 20:37:51 my app works quite well, i'm just perfecting it May 21 20:37:54 I can send you a link for extending views if you'd like May 21 20:38:04 please do, if you don't mind May 21 20:38:13 the more info i can soak up, the better May 21 20:38:52 http://developer.android.com/guide/topics/ui/custom-components.html#modifying May 21 20:39:26 in all honesty, for reusability, I'd go the route of extending the ImageButton May 21 20:40:00 or actually, you might be able to do it all in the layout May 21 20:40:31 by setting the background image May 21 20:41:06 also, you want to look into 9-patch images: http://developer.android.com/guide/developing/tools/draw9patch.html May 21 20:41:24 so you don't have to worry about different screen sizes May 21 20:45:12 thanks May 21 20:45:35 is next.setImageResource and android:src the same? May 21 20:46:57 yes May 21 20:47:06 then it's not workin.. lol May 21 20:47:21 well, it is but it's the same as an image button... nothing changed May 21 20:47:27 that first link you gave me May 21 20:47:43 let me check it out real quick, b/c I do do this in locations May 21 20:47:44 ;) May 21 20:47:54 i have to run in 3 mins May 21 20:48:25 i'll have to take a peek at extending the imagebutton if you feel that's a better route to take May 21 20:49:14 I won't be able to give you an answer in three minutes, so just pm me whenever you get back and I'll help a bit May 21 20:49:48 great, thanks for your help May 21 20:52:56 BeBoo: sorry, android:src isn't the same thing May 21 20:53:02 I'm sorry, that's the top image May 21 20:53:04 ... May 21 20:53:30 you want to change the background...oh drats you're gone May 21 21:02:43 uh, yikes May 21 21:02:52 80% of my installed apps just started showing that an update is available May 21 21:11:56 I've got a listview which is supposed to show a title and an image (which should be fetched from network), any ideas on how to solve this with proper threading? Are there any sample/open source projects out there doing the same thing? May 21 21:13:29 I tried to implement a UserTask/AsyncTask and firing one per image, but it seems to be updating the same ImageView multiple times until it suddenly breaks with a thread exception.. heh.. May 21 21:18:42 BeBoo: so I messed up, you want to replace the background image May 21 21:27:17 blort May 21 21:56:05 for some reason on my mac in eclipse I get errors for the @Overrides before a method implementing a method in an interface May 21 21:56:18 I have my compliance set to 1.6, and using 1.6 jvm May 21 21:56:33 ...are you sure? :) May 21 21:56:38 you broke java May 21 21:56:47 :) May 21 21:57:07 zhobbs: sure you dont have project-specific compliance? May 21 21:57:14 jasta: that's it, thanks May 21 21:57:38 also, dont use @Override on interfaces. that's a stupid reason to not build with a 1.5 compiler May 21 21:58:12 damage is done, unless there's an easy fix May 21 22:02:55 zhobbs: yes -- don't use @Override on interfaces. May 21 22:02:58 its very easy :) May 21 22:03:19 you can probably instruct Eclipse to auto-fix all this stuff in your project too May 21 22:03:28 what's the prob with java 1.6? May 21 22:03:37 Apple. May 21 22:03:50 specifically, Apple only supports java 1.6 on 64-bit cpus + Leopard May 21 22:03:57 zhobbs: nothing is wrong with it, i just feel that this particular feature is insufficient to require a 1.6 compiler May 21 22:04:12 since we need to support pre-Leopard versions of OSX, we can't require 1.6. May 21 22:04:57 if there's no downside to 1.6 then I don't really care May 21 22:05:21 if you use 1.6 you can wind up accidentally writing code that won't build on the Android build servers, which use 1.5 May 21 22:05:30 for your own personal SDK-based stuff, by all means use 1.6 May 21 22:05:44 or if you share code on a pc and a mac, you end up not being able to build. it blows May 21 22:05:59 a pre-Leopard Mac, yeah May 21 22:06:09 (there are people on the Android team running Tiger still) May 21 22:06:17 not many, but a few May 21 22:06:20 I thought you couldn't get 1.6 on any 32bit mac May 21 22:06:27 that is what i said. May 21 22:06:28 the only advantage of Java 1.6 really is when you run apps May 21 22:06:29 right May 21 22:06:36 it's a good idea to run your IDE on Java 1.6 for instance May 21 22:06:46 but to write Android, just target java 1.5 May 21 22:06:51 romainguy: i would actually say that the @Override-on-interfaces thing is more useful than it looks May 21 22:06:52 so if you share code on a pc and a 32bit mac, ie a macbook pro, it sucks to use 1.6 on windows May 21 22:06:54 you can just add flags to the compiler for that May 21 22:07:04 we've had bugs that would have been prevented by that. May 21 22:07:05 ctate: I totally agree and I *want* it May 21 22:07:05 ah ok May 21 22:07:07 but for Android... May 21 22:07:24 romainguy_: "add flags" meaning write the annotation yourself? or...? May 21 22:07:37 no no May 21 22:07:44 I meant to compile for 1.5 with javac 1.6 May 21 22:07:48 you can use -source 1.5 -target 1.5 May 21 22:08:15 oh yeah May 21 22:08:24 we should do that in the Android build if we haven't already :) May 21 22:08:47 note that in the platform build you need to set that in a few different places; javadoc should also be run as 1.5 May 21 22:09:10 [the one part of the android setup that actually cares about 1.5 versus 1.6 differences is droiddoc, i believe] May 21 22:09:30 * ctate wrote that code and wishes he hadn't had to. May 21 22:10:17 romainguy_: an open ended question, what would you say is the current state of the dalvik VM? is there room for significant optimizations and improvements? May 21 22:10:27 yes :) May 21 22:10:29 oh yeah May 21 22:10:31 it seems so unusually mature that it's hard to tell in usage alone May 21 22:10:32 definitely May 21 22:10:36 and im curious to see if you can comment May 21 22:10:36 everything can always be improved May 21 22:10:55 romainguy_: can you elaborate though? May 21 22:11:08 there are lots of potential optimizations it does not do May 21 22:11:26 like what? i'm wanting to learn. May 21 22:11:27 Two overall areas: memory/GC, and JIT. May 21 22:11:51 phones can benefit from [compiler] optimizations a whole lot more than desktop apps because production desktop/server C++ compilers really *are* mature, and have reached the point of dramatically diminishing retunrs May 21 22:11:55 but phones have not May 21 22:12:01 the basics still aren't there for your average phone May 21 22:12:15 i thought dexopt eliminated the need for JIT by just producing binaries particular to the host platform at install time? May 21 22:12:24 TD: along those lines, yeah, dx might also have room for improvements. May 21 22:12:28 no, dexopt produces optimized bytecode, but it's still interpreted May 21 22:12:39 a JITC would produce actual native code May 21 22:13:05 i see May 21 22:13:22 that said, there's plenty of optimizations that can be done which apply to both interpreted and natively compiled code. May 21 22:13:33 and this represents a significant performance yield? is it being worked on or planned? May 21 22:13:47 well, it's hard to say. performance is tricky. May 21 22:13:48 Dalvik could do two "simple" things taht would drastically improve the UI toolkit for instance: May 21 22:13:50 - inlining May 21 22:14:04 heh "simple" May 21 22:14:17 - heap allocations/generational GC for short-lived local objects May 21 22:14:26 ctate: make these quotes much bigger :)) May 21 22:14:36 heh """"simple"""" May 21 22:14:39 for instance, most likely very performance sensitive code will be written using C/C++ for the near/mid term future in android, as the NDK is coming and there has been no work announced on native compilation of java May 21 22:14:42 it's being researched. actual benefits are hard to predict (e.g. anything that significantly increases memory usage could actually end up making the entire system much slower). May 21 22:15:00 so dalvik optimizations might be better focussed elsewhere May 21 22:15:06 jbq: I want a generational GC :p May 21 22:15:13 * TD wants escape analysis May 21 22:15:17 don't need no stinkin gc :) May 21 22:15:24 yeah, GC implementation is of course another major potential area of research May 21 22:15:27 romainguy_: what is the VM's GC currently? May 21 22:15:37 dumb May 21 22:15:42 TD: or that, whatever May 21 22:15:52 TD: but a generational GC goes further than the escape analysis May 21 22:15:54 everyone thinks of JITs but GC design can have just as powerful an effect on system behavior May 21 22:16:08 jasta: it's just regular mark and sweep May 21 22:16:11 many performance issues with have during animations and scrolls are due to the GC kicking in May 21 22:16:21 the GC usually stops the app for 100 to 200+ ms May 21 22:17:15 jasta: i think it's also conservative, but they're working on fixing that iiuc May 21 22:17:19 don't recall exactly May 21 22:17:27 im waiting for android to build. so i'm just trying to do some research in my downtime :) May 21 22:17:43 hey, if you like graph theory, there's plenty of interesting work to do there :) May 21 22:17:44 snod FTW :) May 21 22:17:50 i find it amazing that we get the level of performance we do out of a VM so young May 21 22:17:56 ctate: not this time :) May 21 22:18:23 i'm sorry the droiddoc pass takes like three minutes on fast hardware but there is not a ton i can do about that :) May 21 22:18:34 jasta: from time to time it's nice to remember that it's a 384 Mhz CPU with an interpreted VM, a very expensive and dumb GC and no h/w acceleration for drawing May 21 22:18:43 ctate: i want to disable it. i dont see why that snot possible May 21 22:18:48 there are tons of optimizations we could do across the board May 21 22:18:52 but we're not doing too bad May 21 22:18:53 should have it totally off for userdebug or eng building May 21 22:18:58 jasta: because one of its outputs is the api checking May 21 22:19:30 * emmby is having a bizarro problem. I have a button Start that starts an Activity X, and activity X has a Cancel button which calls finish(). If I hit Start, X launches, and I can hit Cancel and it closes fine. However, if I hit Start and launch X, THEN ROTATE ORIENTATION, then hit Cancel, X gets launched again automatically somehow and I have to hit Cancel again for it to go away. May 21 22:19:34 ctate: well then it should be broken up May 21 22:19:39 api checking cant be that slow May 21 22:19:39 and honestly it's only 10% of the total build time May 21 22:19:45 at worst May 21 22:20:00 ctate: well, it's more if you are only rebuilding because of a framework change May 21 22:20:08 because that make will skip webkit and other native libraries May 21 22:20:24 emmby: sounds like a bug in the logic of your app honestly. not sure how easy that will be to debug over irc May 21 22:20:28 droiddoc is a pain but it's worth it May 21 22:20:35 if you're just changing the framework you should be rebuilding just the framework, jasta May 21 22:20:40 emmby: check that result code is being set properly? May 21 22:20:46 ctate: normally, yes. not always. May 21 22:20:46 oh.... May 21 22:20:57 i'm not setting the result code. evidently i need to? May 21 22:21:11 hm, maybe not. dunno :) May 21 22:21:24 jasta: i'm doing scary framework work these days and here's the shell func i use: May 21 22:21:27 i mean, i am presuing the first activity incorrectly restarts X for some reason May 21 22:21:32 fmake () May 21 22:21:32 { May 21 22:21:32 mmm -j6 frameworks/base/ frameworks/base/services/java/ frameworks/base/libs/utils/ frameworks/base/core/jni/ snod May 21 22:21:32 } May 21 22:21:36 HTH May 21 22:21:47 since when did mmm let you pass -j args? May 21 22:21:57 thatw as broken back when i first looked at it May 21 22:22:21 :) May 21 22:22:21 TD: i've verified that the only place I call startActivity for X is not being called again, so it's definitely the framework launching it again, not me May 21 22:22:34 odd. i'm not sure then. May 21 22:22:35 it doesn't help much because javac doesn't use it anyway, but still May 21 22:22:47 ctate: what exactly does the framework target do? romain once gave me a command-line like ONE_SHOT_MAKEFILE=frameworks/base/Android.mk make framework May 21 22:22:56 which is basically just mmm frameworks/base except with "framework" as an extra target May 21 22:23:08 jasta: i forget. ask a build guy, i.e. Not Me™ May 21 22:23:17 result code makes no difference May 21 22:23:42 are you connected to eclipse whilst doing that? May 21 22:23:52 i've noticed that messes up the activity stack pretty badly. at least on 1.1 it did. May 21 22:24:16 i'd try pressing back all the way to the home screen, then invoking the app via the device ui rather than running it via eclipse if so May 21 22:24:25 well, i'm not running an eclipse debugging session, but i'm on 1.1 and eclipse is running May 21 22:24:26 otherwise not sure sorry May 21 22:24:30 k, let me see May 21 22:24:32 jasta: now I use mmm frameworks/base frameworks/base/core/res/ May 21 22:24:38 emmby: sounds like you are not properly handling the destroy/recreate sequence that happens on orientation change May 21 22:24:42 jasta: the framework target is not reliable anymore May 21 22:24:59 not reliable? May 21 22:24:59 ctate: that's what I thought too, but I'm not doing anything special at all in this activity for that May 21 22:25:07 does it sometimes catch on fire? :) May 21 22:25:14 ctate: do i need to do something? May 21 22:25:19 jasta: as in doesn't compile everything :) May 21 22:25:28 romainguy_: do you know what in particular? May 21 22:25:39 emmby: well, verify that you are not accidentally starting X again May 21 22:26:11 ctate: i tracked down the only place in my code that calls startActivity with X as a parameter, put a breakpoint on it, and it's only ever getting called once May 21 22:26:25 basically, trace all the lifecycle callbacks in X and in the originating activity and look at what's happening May 21 22:26:34 hmm May 21 22:27:32 are you starting it from eclipse? May 21 22:28:04 soreachilles: yeah, although TD was suggesting I not May 21 22:28:15 if you are, before you do anything, try exiting via backbutton to the launcher, starting the app from there, and re-do'ing your steps May 21 22:28:18 right May 21 22:28:37 romainguy_: do you know which GC strategy is employed by the HotSpot VM? May 21 22:28:42 eclipse launches with a different intent than the launcher May 21 22:28:48 is it a combination of generational and mark-and-sweep? May 21 22:28:48 it's a multi-generational GC by default May 21 22:29:00 with mark-sweep-compact on the generations May 21 22:29:04 i see May 21 22:29:10 it has 2 eden, 1 young space and 1 tenured space May 21 22:29:22 it has several GCs available actually May 21 22:29:26 you can get bizzaro back-button, etc, behavior when launching from eclipse, and getting your app relaunched May 21 22:29:28 you can tweak many things from the command line May 21 22:29:42 you can even enable multi-threaded GCs which kinda rocks on multiple cores May 21 22:29:43 romainguy_: yes, i know, i was interested in its default May 21 22:31:39 ah, found it. Not eclipse-related. When the underlying activity gets re-created after the top activity finishes, it creates an onCheckedChangeListener on one of the buttons that launches X. Well, the OS is checking that Checkbox for me onResume, so my listener is getting called, and X is relaunched May 21 22:31:55 bingo May 21 22:32:08 that's kind of annoying May 21 22:32:13 werd May 21 22:32:16 i guess you need to maintain a "boolean paused" yourself May 21 22:32:29 so you can suppress the change listener during resume May 21 22:32:51 yeah, i might just setEnable(false) the button and check for isEnabled() before I launch the activity May 21 22:33:07 jasta: so fwiw the hotspot vm is designed for very fast desktop/server machines, really. for instance its GC does a lot of copying, which is gonna be really slow on a device with limited memory bandwidth like the g1/magic May 21 22:33:16 thanks for the help, all May 21 22:33:33 the android approach to reducing fragmentation is more to just kill the app and require it to be able to reinstantiate itself. simple, blunt, but effective :) May 21 22:34:17 of course, but that doesnt make the GC selection irrelevant May 21 22:34:27 in soviet russia, system reboots you! May 21 22:34:40 nope, just saying, the hotspot approach might not be the best approach to take for phones May 21 22:34:45 anyway, i'm just trying to learn a fair bit more about the details of these strategies May 21 22:35:12 I have a helper class that needs to obtain the AudioManager, should I pass the context from the Activity to the constructor of the class, or is there a better method for getting at the audio manager? May 21 22:35:28 i'm trying to make a new Intent inside an onClickListener... i have Intent wIntent = new Intent(this, GetData.class); but it's complaining about the "this" May 21 22:35:53 doc_savage: how about just passing the AudioManager in the constructor? May 21 22:36:27 BeBoo: you need to pass "this" through a final field May 21 22:36:28 luok: do I not need to use getSystemService(Service.AUDIO_MANAGER)? May 21 22:36:56 sorry luok, I see what you mean now May 21 22:37:10 TD: can you dumb that down for me? i'm kinda new May 21 22:37:42 can you paste the code you are using? i'll try and explain it May 21 22:37:45 use pastebin May 21 22:38:44 http://pastebin.com/d3e01b2e0 May 21 22:39:14 the reason it complains is that "this" inside your View.OnClickListener refers to that listener object, not the activity May 21 22:39:37 so how can i reference the activity instead? May 21 22:39:46 so you need to pass a reference through to inside the listener. the easiest way to do this is something like May 21 22:40:02 final Activity fActivity = this; // put this before the setOnClickListener call May 21 22:40:08 no TD May 21 22:40:14 there's a language construct for that May 21 22:40:23 can't you just do Classname.this in the listener? May 21 22:40:24 MyActivity.this May 21 22:40:24 * TD learns something new as well May 21 22:40:27 ya May 21 22:40:31 and use fActivity instead of this May 21 22:40:36 oh May 21 22:40:41 BeBoo: just replace this by MyActivity.this May 21 22:40:43 right, or, you could do what people who actually know java suggest :) May 21 22:40:52 heh May 21 22:41:02 hi... May 21 22:41:03 what sets up the check states of all my buttons again after an orientation change? is it onResume? May 21 22:41:08 thanks =] May 21 22:41:23 er, never mind, it's onCreate May 21 22:41:25 the view hierarchy gets a chance to persist state in onpause/onresume May 21 22:41:30 sorry May 21 22:41:34 yeah, oncreate/onsaveinstancestate May 21 22:41:38 I got an problem when I download android git source... May 21 22:41:40 how the heck does Classname.this work? May 21 22:41:54 doesn't this usually have to point to something in memory? May 21 22:42:14 it works because the compiler creates a "synthesized field" May 21 22:42:20 that points back to the outer class May 21 22:42:33 that's why you can call methods of the outer class from within the inner (non-static) class May 21 22:42:55 (or synthetic field, I always forget the name they give these things) May 21 22:43:16 I'm using repo to get all source, but it's no respond at this line "Getting manifest ... from git://android.git.kernel.org/platform/manifest.git"....What's wrong :(? May 21 22:43:22 oh so it only works when Classname is static May 21 22:43:26 no May 21 22:43:35 it works otherwise too :) May 21 22:43:57 how does it know which object this refers to if Classname isn't static? May 21 22:44:42 when you compile the inner class May 21 22:44:47 Can someone help me? Q_Q May 21 22:44:48 it's only defined to be meaningful inside an inner class May 21 22:45:02 ah ok May 21 22:45:04 it's just a compiler trick May 21 22:47:06 um...Got sleep...(cry) May 21 22:47:15 * luok learns about inner classes May 21 22:48:06 is there a way to "wake the display up" when my activity loads? i noticed in cupcake that when debugging my app, if the screen is already dimmed, it will stay dimmed until i touch it May 21 22:48:17 tired to try&try...(for many times... May 21 22:48:51 hi guys... May 21 22:49:22 BeBoo: PowerManager has something to do with screen brightness/wake locks etc. http://developer.android.com/reference/android/os/PowerManager.html May 21 22:50:13 romainguy_: my brain melted when i saw the syntax foo.new Bar() May 21 22:50:44 romainguy_: Java has a lot of cute little gems like that you wouldn't expect :) May 21 22:52:05 yep :)) May 21 22:52:18 like the least used keyword ever, strictfp May 21 22:52:30 ooo got a security exception... i need to add a line to my manifest, right? May 21 22:52:40 a permission line May 21 22:53:29 i wonder if there's a better place to learn about tricks like that other than the language spec May 21 22:53:46 the tutorial irritatingly claims inner classes are an "advanced technique" that it doesn't want to go into May 21 22:53:55 Does android support frame by frame animations or will I just have draw a few bitmaps one after the other? May 21 22:53:57 devicepower? May 21 22:54:04 java puzzlers is pretty good May 21 22:54:46 I am trying to run an AnimatedDrawable within the game thread of the LunarLander. Do I have to also interact to the View created on the XML layout via a Handler (just like the text view that such example uses?) May 21 22:55:42 Sorry, I meant AnimationDrawable May 21 22:59:10 I can draw straight to the canvas, but I suppose the best implementation (and easiest to maintain) would be through the AnimationDrawable. Any comments please? May 21 23:01:27 AnimationDrawable are supposed to be started from the UI thread May 21 23:01:31 and they take care of themselves May 21 23:03:56 Thank Romainguy_. Right, so using it to animate a Drawable from within the game thread is not the best way then. Should I just go with putting the thread to sleep in between getting the resources and drawing them with Drawable.draw(canvas) ? May 21 23:06:41 heh .. uhh.. can I define in xml the inverse of a drawable? I'm trying to do left and right imagebuttons, and made a selector drawable for the various button states for the right button, and just want to use the image-inverse for the left button... May 21 23:07:09 'flipped' is a better term I guess, since I don't want the inverse colors... May 21 23:07:39 you can create a scale drawable May 21 23:07:51 that scale by -1.0 on the X axis May 21 23:07:54 hmm use a matrix and just flip it May 21 23:07:58 and embed that in a translate drawable May 21 23:08:01 neta May 21 23:08:03 neat May 21 23:11:55 hi May 21 23:13:19 romainguy_: have you checked http://groups.google.com/group/android-developers/browse_thread/thread/042667043fcf3c82# ? should i post this elsewhere ? May 21 23:17:14 What's the best way of animating a Drawable from within the game thread then? May 21 23:21:30 I found some docs on the website. Sorry. May 21 23:21:48 Apparently one needs to draw directly to the canvas. May 21 23:30:13 Thanks, good night everyone. May 21 23:55:07 I'm looking through the documentation, but I don't know how to start. Should I start with the Hello world tutorials? or should I read the Framework topics first? May 21 23:55:51 I'm used to going through code examples, and explaining as they go.. The documentation is a bit different May 21 23:56:27 problem solved! I swiched git server and the download starts....TwT May 21 23:56:52 finally...(return to bed...=v=;) May 22 00:01:38 is there some big secret to working with BitmapDrawables? I'm calling the draw method but nothing is getting drawn. is there some configuration I need to set up for it? May 22 00:02:31 The BitmapDrawable was generated from a bitmap which I generated in turn from an image, which I got from BitmapFactory.decodeResource() May 22 00:02:36 set its bounds May 22 00:02:45 I do, using a rect. May 22 00:03:49 do I need to set the alpha or something? May 22 00:03:54 how do you deal with images? May 22 00:17:50 romainguy_: is there a non-hack way to center text on a tab May 22 00:18:19 I did it by taking apart the widget and setting the layoutparams for the textview May 22 00:33:34 is onSaveInstanceState called when the screen's orientation is changed? May 22 00:37:03 yes... yes it is :) May 22 00:55:42 how would I set the white background of my BitmapDrawable to transparent? May 22 00:56:38 meanburrito920_: first of all, you need to make sure your bitmap has an alpha channel May 22 00:56:58 How would I do that? May 22 00:57:03 so either RGB_4444 or RGB_8888 May 22 00:57:10 or ALPHA_8 I think May 22 00:57:22 Whats the difference? May 22 00:57:27 and then you fill it with 0xFF000000 May 22 00:57:42 the colour depth May 22 00:57:50 :) can you elaborate? May 22 00:57:52 you can choose the format when you create the bitmap May 22 00:58:08 how do you create your bitmap? May 22 00:58:12 why does rotation cause my app to go back to onCreate ? May 22 00:58:28 My bitmap is from BitmapFactory.decodeResource() though. May 22 00:58:48 meanburrito920_: if I'm not mistaken, those are unmutable May 22 00:59:03 meaning you can't actually change the bitmap May 22 00:59:10 so how should I get my images? May 22 00:59:37 meanburrito920_: let's ask it differently : what do you want to do with the bitmap? May 22 01:00:45 I'm making a chess game. I have a bunch of image files in res/drawable. I want to display them on my board. However, the images have a white background. So I need the background to be whatever color the square underneath is. May 22 01:00:50 meanburrito920_: I had to work with bitmaps for my current game, and the only solution I found to alter the bitmap without touching the original was to copy it in a fresh virgin one May 22 01:01:01 ohhhh May 22 01:01:05 that's WAY easier May 22 01:01:23 just save them as PNGs with an alpha channel May 22 01:01:33 you don't have to manually change anything May 22 01:01:35 how do I set the alpha channel? May 22 01:01:48 meanburrito920_: what are you using to create your chess pieces? May 22 01:02:09 I got the images from Wikimedia under CC license May 22 01:02:14 meanburrito920_: I mean, softwarewise May 22 01:02:25 meanburrito920_: you got Gimp or Photoshop? May 22 01:02:25 so I didnt actually draw them myself May 22 01:02:29 Gimp May 22 01:02:32 k May 22 01:03:42 just load each piece into gimp, , duplicate the backgroudn layer, delete the lowest layer, do a color selection of the backgrounc colour on the copied one and press your DELETE key, then save as a png May 22 01:03:45 et voila May 22 01:04:25 (or, as the non french english speaker like to write : "et viola" which roughly translate to "and Raped" May 22 01:04:50 haha thanks so much :) May 22 01:05:33 meanburrito920_: np. you understood the gimp part? I know how to do it, but I'm not sure I can explain it in any meaningful way May 22 01:09:00 not exactly May 22 01:10:14 meanburrito920_: you know how layers work in gimp? May 22 01:10:29 yep May 22 01:11:50 well ... you need to cut out the chess pieces from your background, and delete the background colour May 22 01:12:27 found a WAY easier way :) Colors>Color to Alpha May 22 01:12:29 you'll end up with your chesspiece on the transparency checker board May 22 01:12:33 takes 2 secs May 22 01:12:49 my way doesn't take longer ;) May 22 01:12:56 it's just harder to explain :P May 22 01:26:30 whats a good way to store an array of Bundles? May 22 01:32:32 Does anyone know if there is a way to detect (in Java from the SDK) whether the user has a multitouch patch (as included in JF) May 22 01:38:11 yay ... second game is on the market :) May 22 01:38:41 now I'll get drunk to survive the comments ;) May 22 01:39:45 sammyF: when I load up the app now, it displays a black box instead of my image. Is there some sort of filter that is automatically set? because the piece is black in the first place, so it would show up like that if the background had been set to black by android. May 22 01:41:25 in what format do you save your gfx? May 22 01:43:39 png? May 22 01:58:31 uh? Security fix for 1.5? May 22 02:27:51 sammyF: png May 22 02:28:01 security fix? May 22 02:31:34 meanburrito920_: yeah. just had a system update May 22 02:31:40 apparently a security fix May 22 02:31:58 anyway, png should be okay May 22 02:32:53 so what app did you just put on the market? May 22 02:32:54 meanburrito920_: would you mind sending me one of your pngs? May 22 02:33:05 meanburrito920_: check under games/casual May 22 02:33:21 should be the first one, based on the release date May 22 02:33:24 called Pin It May 22 02:33:37 sure. does IRC support image transfer? May 22 02:33:46 ah, figured out hte problem May 22 02:33:56 nice. what was it? May 22 02:33:57 some how the background is being set to black May 22 02:34:10 I'm not sure how May 22 02:34:21 I switched to an icon with color and the color parts show up May 22 02:34:52 with an all black background. my other icon was all black in the first place, so it just looked like a black box when the background was black. May 22 02:35:40 sounds like you are not using a colour depth with an alpha channel May 22 02:35:43 kind of weird May 22 02:35:53 how would I set that? May 22 02:37:08 meanburrito920_: would you mind pasting the relevant parts (where you load your drawables) at http://pastebin.com/ ? May 22 02:37:14 sure May 22 02:37:36 meanburrito920_: in my experience so far, alpha always workd May 22 02:37:42 workEd even May 22 02:38:08 http://pastebin.com/m69f51c9d May 22 02:38:28 oh May 22 02:38:46 why don't you just use a standard drawable? May 22 02:39:02 how would that benefit me? May 22 02:39:37 well .. for one, the alpha channel would be working ;) May 22 02:40:23 but BitmapDrawable inherits from Drawable, so shouldnt it be working anyway? May 22 02:43:20 http://pastebin.com/d6ac5f2f7 May 22 02:43:21 and if so, how would I load my images? I'm assuming I would have to make it call from a file path, not a resource? May 22 02:44:03 just don't forget to set the bounds (the values are bogus here of course) May 22 02:47:45 k cool thanks, I'll try that May 22 02:47:57 meanburrito920_: np. I hope it helps May 22 02:48:20 sigh .. And now someone has a forceclose on my new game, and I can't even contact the guy back to know what's up :/ May 22 02:58:12 sammyF: hm. still displays with a black background... May 22 02:58:21 sigh May 22 02:58:33 okay ... gonna pm you May 22 02:59:02 k no prob. **** ENDING LOGGING AT Fri May 22 02:59:57 2009