**** BEGIN LOGGING AT Thu Feb 07 02:59:57 2008 Feb 07 06:01:14 anyone know how long you can tie up the ui thread without it borking? Feb 07 06:53:29 anyone? Feb 07 06:53:30 ui thread? Feb 07 06:53:31 no? Feb 07 07:11:33 jerkface03: Just don't tie it up :) Feb 07 07:18:35 romainguy: any specific preset amount of time before the watchdog jumps in? Feb 07 07:18:56 jerkface03: What do you call the watchdog? Feb 07 07:19:18 Do you mean what do I mean by the watchdog? Feb 07 07:19:21 the watchdog thread. Feb 07 07:19:33 the thread that checks that you don't tie up a thread for too long Feb 07 07:19:35 ala BREW Feb 07 07:19:46 assuming the same mechanism is being used in android Feb 07 07:20:02 tie up the thread rather Feb 07 07:20:09 are you talking about the dialog that shows up asking whether you want to force quit the application or keep waiting? Feb 07 07:20:18 bingo. Feb 07 07:20:29 I believe the current setting is 5 seconds Feb 07 07:20:41 k, 5 seconds should be more than enough time :) Feb 07 07:20:41 thx Feb 07 07:20:47 er Feb 07 07:20:49 don't do that Feb 07 07:20:55 ?? Feb 07 07:21:08 blocking the UI thread for more than ~150/300 ms is bad Feb 07 07:21:16 since it will prevent user interaction and repaints Feb 07 07:21:47 aye, i don't want to deal with too much threading at this point. i'll refactor it later. Feb 07 07:22:06 your call :) Feb 07 07:22:11 (but don't do that :) Feb 07 07:39:15 anyone around? Feb 07 07:48:07 jtoy: tes? Feb 07 07:48:10 yes, sorry :) Feb 07 07:48:42 I was wondering about a couple of problems, I'm not sure if its a java or android problem as I am new to java as well Feb 07 07:49:40 when using bundles, it seems to me like you can't pass objects that are not strings or integers, is this correct, I tried to pass an object with a bundle to different activities, but I got an error saying the object coudln't be marshalled Feb 07 07:51:17 the class was extremely simple though, class Person; public long id, public String name; } is it correct that arbitrary objects cant be passed through? Feb 07 07:51:48 here is the class for the code, extremely simple: http://pastebin.ca/894767 Feb 07 08:02:26 any idea? Feb 07 08:03:24 how do you try to pass your object to the Bundle? Feb 07 08:12:02 Intent i = new Intent(this, UserReport.class); Feb 07 08:12:17 i.putExtra("person",person); Feb 07 08:13:21 If you refer to the javadoc, it reads: "value The data value. Can only be an Integer, String, or HashMap." Feb 07 08:13:40 the reason for that is that an Intent can be received by another application/process Feb 07 08:13:49 and this application will not have your Person class Feb 07 08:14:18 ahh, sorry, I didn't see that part in the doc, so I guess I would use something like a hashmap Feb 07 08:14:28 yes :) Feb 07 08:15:13 hmm, thats too bad Feb 07 08:15:48 I had one more question, is it possible to have list views without a class that extends ListActivity? Feb 07 08:15:53 definitely Feb 07 08:16:13 ListActivity is there to make easy to create a screen with a list inside Feb 07 08:16:23 but you can use a ListView in a regular activity Feb 07 08:17:25 I have a class that extends Activity, then I just try to display the calhistory with a ListView, when I call: callList.setAdapter(new CursorAdapter(c, this)); I get the error Cannot instantiate the type CursorAdapter Feb 07 08:17:55 CursorAdapter is an abstract class Feb 07 08:18:00 it cannot be instanciated Feb 07 08:18:08 instead you can use SimpleCursorAdapter Feb 07 08:18:15 or extend CursorAdapter and make your own Feb 07 08:18:44 what would you recommend, I was trying to use some of the sample code in the docs Feb 07 08:18:53 try SimpleCursorAdapter Feb 07 08:19:48 ok I see, I will try that Feb 07 08:21:08 I have one more question about design, is there any good places that show good practices for accessing data from the db? I've tried to simplify things by making a a helper class for the DB, but i still feel that it is not very good Feb 07 08:21:34 All I can tell you is to look at the examples and tutorials on code.google.com/android Feb 07 08:21:47 I know how to design some very simple helper classes in ruby, but im not too sure about java Feb 07 08:21:51 I work on the UI widgets themselves so I'm not very helpful when it comes to DB :) Feb 07 08:22:16 ok thanks romainguy , I downloaded a few projects from google already and read through some of them Feb 07 08:22:43 romainguy: are you building the ui with xml or via code? Feb 07 08:23:45 jtoy: I meant, I work at Google on Android Feb 07 08:23:54 I write the *View classes Feb 07 08:24:00 oh, nice, I see Feb 07 08:24:19 But when I write UIs I try to use XML as much as I can Feb 07 08:24:32 because you can create variations of your layouts based on the capabilities of the target devices Feb 07 08:24:46 like layout/ layout-touch/ layout-land/ layout-touch-port/ etc. Feb 07 08:24:58 I hope that android will officially support other languages on the vm also, java seems to take out the fun in programming Feb 07 08:25:12 Oo Feb 07 08:25:22 You wrote too much Ruby :) Feb 07 08:25:53 I personally find Java a lot of fun to code with, especially thanks to the help of the various great (and free) IDEs Feb 07 08:25:54 well for me anyway, I'm sure other people love java , scala seems pretty nice, they already have gotten apps running on android, but the binaries are like 3 megs Feb 07 08:26:19 Also the problem can be performance Feb 07 08:26:28 Remember the apps are supposed to run on limited devices like cell phones Feb 07 08:26:41 Languages like Scala and Ruby are hard to compile efficiently for such devices Feb 07 08:26:52 yeah, scala has a very small performance hit compared to java as it compiles down to java anyway Feb 07 08:26:55 And they probably rely a lot on the JIT Feb 07 08:27:23 But yes, it'd be nice to be able to use other languages Feb 07 08:27:33 The issue, as you mentioned, is usually the associated runtime Feb 07 08:28:08 Anyway Feb 07 08:28:09 off to bed Feb 07 08:28:10 see ya :) Feb 07 08:28:13 from the little coding I've done on the iphone, objective C seems to be pretty nice, it does feel pretty dynamci Feb 07 08:28:16 ok, thanks for the help! Feb 07 08:28:19 nite Feb 07 08:28:23 Objective-C is a very nice language Feb 07 08:28:36 It still has some old things like header files, but I really like it a lot Feb 07 08:28:47 Especially Objective C 2.0 with the garbage collector :) Feb 07 08:29:02 (and they have very nice tools) Feb 07 08:29:04 yeah, i can see the smalltalk history on it, which makes me like it since ruby has history from smalltalk Feb 07 08:29:18 Java also has a lot of history from Smalltalk :) Feb 07 08:29:31 true Feb 07 08:29:41 (I've been trying to like Ruby since 2000 and I still can't; too much Python I guess :) Feb 07 08:30:05 yeah thats right, you guys love python over there, I started on python, but somehow moved to ruby Feb 07 08:30:29 To me Ruby always looked like the bastard child of Perl and Python Feb 07 08:30:42 I think you will like rubinius though, it removes a lot of cruft from the old ruby Feb 07 08:30:51 But at least it made people love dynamic languages Feb 07 08:30:59 Just like Java convinced the world that garbage collection was good :) Feb 07 08:31:12 Anyway, I'm really off to bed now Feb 07 08:31:18 ok, thanks, bye Feb 07 10:01:56 * davidw wonders about the best way for a web site to push something to android... Feb 07 10:02:36 sup dave Feb 07 10:02:47 not to sure if you can 'push' anything with http Feb 07 10:02:59 your only choice might be to poll Feb 07 10:03:07 well, not unless you put a server on android:-) and that's not a good idea IMO Feb 07 10:04:17 xmpp and sms are two ways Feb 07 10:05:15 ya but you said a website to push something Feb 07 10:05:18 sms != website Feb 07 10:06:52 jerkface03, interfaced with the proper things, a web site can push sms Feb 07 10:07:36 sure Feb 07 10:07:42 i thought you were strictly talking about http before Feb 07 10:08:25 nope, just a web site and a phone, with the web site needing to push information to the phone Feb 07 10:08:39 what are you making? Feb 07 10:08:43 if i may ask :X Feb 07 10:10:02 this is for a client, so I can't really say Feb 07 10:10:17 I spend most of my own time on hecl of course Feb 07 10:10:31 hows that going? Feb 07 10:10:34 but that's not really relevant in this case... I just want to be able to push data to a device Feb 07 10:10:36 pretty well Feb 07 10:10:43 good to hear Feb 07 10:10:48 http://journal.dedasys.com/articles/2008/02/06/remote-android-application-shell-with-hecl Feb 07 10:24:47 hi davidw nice blog :-) Feb 07 10:24:56 thanks Feb 07 10:25:46 'just left a comment Feb 07 10:26:15 davidw does hecl support symbian v7? Feb 07 10:26:59 well, it's java, so if that runs j2me stuff, then yes, but not natively Feb 07 10:27:13 you can python on that natively, no? Feb 07 10:27:31 v7's getting a bit old now, no? Feb 07 10:29:32 Stephmw well if you support v7 you've got them all, right? Feb 07 10:29:51 davidw that's the problem ;-) Feb 07 10:29:57 kristian-m: in a roundabout way... v9 makes things quite a bit harder Feb 07 10:30:29 kristian-m, what do you mean? Feb 07 10:31:24 * Stephmw honestly believes that anyone enjoying Symbian development must also be masochistic... Feb 07 10:31:27 davidw i thought there is no python support, but I'll try - just got my first symbian device Feb 07 10:31:43 Stephmw ;) Feb 07 10:31:59 kristian-m, i'm sure it runs j2me Feb 07 10:32:12 Hecl on Android is much more powerful because you get reflection Feb 07 10:32:20 ah i see Feb 07 10:32:32 so mostly you don't have to write new commands in Java, but can write them in Hecl Feb 07 10:33:01 you could probably still do something like that server pretty easily, but you'd have to write it in Java, and call interp.eval(incoming) Feb 07 10:33:02 kristian-m: if you get _really_ friendly with the VM vendor and the OEM, you too can get reflection in J2ME... Feb 07 10:35:45 davidw okay, i'll start looking into symbian stuff tonight - still hoping to use python in there (and maybe access java functionality somehow...) Feb 07 10:36:00 if you like Python, that's the way to go with Symbian Feb 07 10:39:56 * Stephmw nods Feb 07 10:41:34 can't wait to try it out Feb 07 10:43:36 Hecl can't do *everything*, so writing a native, C implementation for Symbian is sort of out of the picture...I'll just have to stick with Java Feb 07 10:43:48 although I bet 'Jim' would run quite well there.... Feb 07 10:44:02 http://jim.berlios.de/ Feb 07 10:59:19 davidw hmm, i'm thinking about writing a section on scripting in my thesis work, so i'll dig into that if i find the time Feb 07 16:20:49 anyone know offhand a core java method that can take null as an argument? Feb 07 16:28:05 davidw, I would think a lot of methods could Feb 07 16:28:34 davidw, not for basic types (int,float,double,etc), but for objects (String, Calendar, etc) Feb 07 16:30:03 offhnad? Feb 07 16:32:48 hmm..no, just tried one and get a NullPointerException :) Feb 07 16:33:43 .equals could take null probably Feb 07 16:34:05 ah, good one Feb 07 16:40:05 but actually, it could never be true though Obj.equals(null) Feb 07 16:40:22 cause if it was true it would give NullPointerException Feb 07 16:41:11 .equals() must accept null without throwing a NPE Feb 07 16:41:13 I just needed something to take null to test Hecl Feb 07 16:44:20 interesting.. Feb 07 16:54:23 exceptions are kind of expensive, aren't they? Feb 07 18:35:54 carpal tunnel is setting in... Feb 07 18:45:25 That's no good Feb 07 18:47:55 the people I'm working for want to pretend like the deadline wasn't moved Feb 07 18:48:25 so they want it done the 18th... Feb 07 18:49:13 morrildl, that sdk coming out next week? Feb 07 18:49:35 we don't precisely know Feb 07 18:49:43 * Stephmw rolls some dice Feb 07 18:49:55 It will be out ASAP, and we are working through the available tasks Feb 07 18:50:01 er, required, not available :) Feb 07 18:50:13 so basically it'll get released once our list reaches 0 Feb 07 18:50:51 my theory is that the new UI will be debuted at that mobile show in spain, and then sdk will follow Feb 07 18:51:07 at 3gsm? Feb 07 18:51:13 yeah Feb 07 18:51:58 sounds plausible Feb 07 18:52:01 http://www.reuters.com/article/businessNews/idUSWEB442320080207?feedType=RSS&feedName=businessNews&rpc=23&sp=true Feb 07 18:53:01 damn, wish i could go there :( Feb 07 18:53:12 it's gonna be very, very busy Feb 07 18:54:48 heh Feb 07 19:03:15 hmnf - from the story: "Research firm Strategy Analytics has estimated that Android will be in two percent of smartphones this year." Feb 07 19:08:27 i think i saw there's approx 30M smartphones - so that's 600K phones? sounds optimistic i'd think. Feb 07 19:09:51 are they saying total, or new sales? Feb 07 19:12:24 yah, probably just new, which would be closer to about a 1/3 of those numbers Feb 07 19:52:28 i dont mean to break up the android chat, but does anyone know where I can chat about blackberry development? i'd like to talk to some experienced people Feb 07 19:55:14 d03boy: J2ME-based? Feb 07 19:55:36 d03boy: #j2me has a fellow BB sufferer Feb 07 19:55:53 well thats actually what I am curious about... whether I want to use j2me or not Feb 07 19:55:55 i'll go there Feb 07 21:11:02 is there anyway to play a midi or an audio file from a byte array or an inputstream? Feb 07 21:47:55 hey guys.. is this the right channel for Android Development questions ? Feb 07 21:48:21 chadkouse, yep Feb 07 21:48:38 cool.. zhobbs your name is familiar -- are you involved with MusicDroid ? Feb 07 21:48:43 yeah Feb 07 21:48:47 I run helloandroid.com Feb 07 21:49:06 I'm not really involved with it, just stuck it up there... Feb 07 21:49:10 that's perfect -- I was just trying to get the latest source to run for MusicDroid -- and I have an error that MDSInterface.java is in the way of MDSInterface.aidl Feb 07 21:49:26 oh ok who wrote it ? Feb 07 21:49:34 I wrote it Feb 07 21:49:51 ah ok I thought so Feb 07 21:49:55 Just saying that I'm not actively adding features or anything Feb 07 21:49:59 what's the error? Feb 07 21:50:16 Oh...delete MDSInterface.jaa Feb 07 21:50:21 [2008-02-07 16:44:16 - MusicDroid] MDSInterface.java is in the way of MDSInterface.aidl, remove it or rename of one the files. Feb 07 21:50:25 MDSInterface.java Feb 07 21:50:26 ah.. and then it will be regen? Feb 07 21:50:49 yeah, it should regen when you save the aidl file Feb 07 21:51:31 if you're compiling from source you'll need that id3 tag jar also Feb 07 21:51:38 and voila... Feb 07 21:51:41 yeah I had that thanks :) Feb 07 21:51:52 hey I was looking -- is there not a horizontal progress bar control in android ? Feb 07 21:52:14 nope...you can create one...but there is just the circular one right now Feb 07 21:52:28 the next sdk will have a whole new UI, so maybe there will be different widgets Feb 07 21:52:56 ok... Feb 07 21:53:16 really what I need is like a slider bar... to drag back and forth the position of the playing song Feb 07 21:53:51 yeah, would have to be a custom view Feb 07 21:54:14 I need to add a custom view tutorial up there... Feb 07 21:54:15 can you point me somewhere to learn how tod o that ? Feb 07 21:54:17 hehe Feb 07 21:54:39 http://code.google.com/android/toolbox/custom-components.html Feb 07 21:54:49 And in the Api demos the custom view is the LabelView or something like that Feb 07 21:57:22 liek this: http://code.google.com/android/samples/ApiDemos/src/com/google/android/samples/view/CustomView1.html Feb 07 21:57:23 ? Feb 07 21:58:17 well.. yeah I see what you are talking about Feb 07 21:58:20 yeah, but the view isn't implemented in that one Feb 07 21:58:26 right..... Feb 07 21:58:36 if you look at the layout file referenced there you'll see that it uses a LabelView I think Feb 07 21:59:12 http://code.google.com/android/samples/ApiDemos/src/com/google/android/samples/view/LabelView.html Feb 07 21:59:13 Also, you might want to look at the "Touch Paint" app under graphics Feb 07 21:59:25 that will show you how to handle dragging the mouse Feb 07 21:59:43 with onMotionEvent Feb 07 21:59:44 I can actually put that off for now.... I just need some simple modifications to what you've done here.... Feb 07 22:00:01 that's cool, what you got planned? Feb 07 22:00:10 I want to show lyrics while the song is playing Feb 07 22:00:47 cool, let me know how it turns out Feb 07 22:01:19 Can you help me get started? I'm very new to android (and java really) but I'm pretty good with many other languages.. so I think I just need to kind of "get started Feb 07 22:01:20 " Feb 07 22:01:38 If I want to add a few lines of text and then update those lines, where do I start ? Feb 07 22:02:02 I would recomend the official google tutorial, get's you straight on the terms (activity, view, intent, etc) Feb 07 22:02:13 i actually did all of the tutorials and the extra credit Feb 07 22:02:48 for MusicDroid the text is all updated in the handler in ControlsMenu.java Feb 07 22:03:31 But the handler is only called when the song changes Feb 07 22:03:45 ok I see it... Feb 07 22:03:52 handleMessage Feb 07 22:03:56 yeah Feb 07 22:04:12 That's called from a seperate thread which can be seen in run() Feb 07 22:04:27 You can't update the UI in separate threads Feb 07 22:05:17 where is Run ? Feb 07 22:05:21 er run() Feb 07 22:05:26 it's in that ControlsMenu.java Feb 07 22:06:21 I see.. Feb 07 22:06:28 and you update the progress bar every 500ms Feb 07 22:07:05 yeah Feb 07 22:07:18 you can update progress bar from thread, but not TextView Feb 07 22:09:44 ok.... Feb 07 22:09:54 so how are you updating the TextView ? Feb 07 22:10:55 You send a message to the hanlder and the handler, and the handler runs in the UI thread Feb 07 22:11:55 ahh Feb 07 22:11:55 ok Feb 07 22:12:29 This explains a little about handlers:http://www.helloandroid.com/node/243 Feb 07 22:15:09 thanks Feb 07 22:15:59 after you create an aidl do you have to do anything to make it create the .java class? trying to make my own aidl file and when I save it nothing happens Feb 07 22:16:24 Hmm, it should create the java file Feb 07 22:18:08 ah mis-typed the package name Feb 07 22:33:31 thanks for your help I'm going to poke around at this for a while.. I'm sure I'll be back later ;) Feb 07 22:33:43 no probl, good luck! Feb 07 22:36:56 is there anyway to post with an HttpURLConnection? Feb 07 22:37:05 yeah Feb 07 22:37:36 you sure about that?? have you tried it before? Feb 07 22:37:46 http://www.theserverside.com/tt/articles/article.tss?l=HttpClient_FileUpload Feb 07 23:33:55 does anyone know if midi/mp3 files are actually played by the emulator? Feb 07 23:34:00 like does the emulator actually output audio? Feb 07 23:34:09 im trying it out here, it doesn't give me an error Feb 07 23:34:15 but it's not playing anything Feb 08 00:12:21 jerkface03: yeah it does Feb 08 00:12:30 you have to tell the emu to use audio though Feb 08 00:12:44 command line option: -useaudio Feb 08 00:30:29 aye, is there a way to pass cl params thru the eclipse plugin? Feb 08 00:33:52 na, it's not even working with useaudio Feb 08 00:33:55 i probably did something wrong Feb 08 01:07:58 I'm guessing you figured out how to pass cl params through eclipse ? Feb 08 01:08:41 ? no. ran it thru cl instead of eclipse Feb 08 01:08:46 i saw the msgs where it enabled audio Feb 08 01:08:48 but still no output Feb 08 01:08:53 so there must be something wrong with my code Feb 08 01:09:43 There's some simple mp3 player tutorials here: http://www.helloandroid.com/tutorials Feb 08 01:11:29 yep, saw them. i'm pretty close with my simple little class Feb 08 01:12:41 http://pastebin.com/m11eeef33 <-- doesnt look too different from the code on that website Feb 08 01:13:19 I haven't tried Midi's Feb 08 01:13:55 im sure they're supported on the emulator, like i said, i must be doing something wrong in my test code Feb 08 01:14:02 The mp.setDataSource needs a more complete path Feb 08 01:14:03 probably making a call at the wrong place Feb 08 01:14:32 like what? base + "/" + name? Feb 08 01:14:50 yeah, you can't just pass the filename in there, gotta have the path Feb 08 01:15:19 any idea how i can get the base path for my context? cause im dumping out using the context Feb 08 01:15:27 i have no idea where it actually gets placed Feb 08 01:15:42 Context.getFileStreamPath() will give you a File object Feb 08 01:15:51 http://code.google.com/android/reference/android/content/Context.html#getFileStreamPath(java.lang.String) Feb 08 01:15:56 k, sec, let me fix it up and see if that's the problem Feb 08 01:16:28 Then you can File.getAbsolutePath() to get the string Feb 08 01:19:10 wait, if im trying to play a file that doesn't exist Feb 08 01:19:18 why isn't the MediaPlayer throwing an exception? Feb 08 01:20:27 couldn't tell ya Feb 08 01:20:38 says it throws IOException Feb 08 01:20:44 maybe it's a bug Feb 08 01:21:54 hrm Feb 08 01:21:56 nodice Feb 08 01:22:05 thanks anyways Feb 08 01:22:38 sorry, if you want to confirm the file is there check /data/data//files Feb 08 01:22:47 via "adb shell" Feb 08 01:26:06 yep Feb 08 01:26:07 i see it Feb 08 01:26:24 is it's size > 0? Feb 08 01:26:24 is there anyway i can move it outside or view it's contents? Feb 08 01:26:35 yep size is 92018, which is right Feb 08 01:26:46 you can use "adb pull Feb 08 01:28:17 you guys ever notice Android log cat just stops responding sometimes? Feb 08 01:28:18 ya it's valid Feb 08 01:28:22 you have to close it and re show it Feb 08 01:28:28 chadkouse: ya i've noticed taht too Feb 08 01:28:41 zhobbs: i'll keep looking into it later. thanks for your help tho! Feb 08 01:33:58 also it seems like my SDcard keeps getting cleared. Feb 08 01:35:26 zhobbs: it also seems like when I run your musicdroid app it scans the SDCard and if it finds files (but no MP3's) it just sort of bugs out -- leaving the "Scanning the SD Card" message Feb 08 02:08:14 zhobbs: are you still here ? Feb 08 02:10:03 nm figured it out :) Feb 08 02:25:32 interesting..... the duration of a song changes as you play it? it's *normally* the same value but I'm sitting here watching it 5 times a second and it changes sometimes! **** ENDING LOGGING AT Fri Feb 08 02:59:56 2008