**** BEGIN LOGGING AT Sat Jan 03 02:59:57 2009 Jan 03 08:58:00 ello Jan 03 08:58:25 I just found out that this chat room existed. I had no idea! Jan 03 08:59:21 Are any of you guys doing priced apps when it's available? Jan 03 08:59:38 im going to make a flashlight app for $29.99 Jan 03 08:59:40 a month Jan 03 08:59:46 wicked Jan 03 09:00:17 i just need someone who will write it for me for $1 Jan 03 09:00:29 (or 1% of the sales, whichever is lowest) Jan 03 09:00:38 Done. Paypal that to my email and I'll send you the apk. Jan 03 09:01:56 I've been racing to get my latest game done before they turn that on. Jan 03 09:02:11 anyone know when it is? Jan 03 09:02:36 I'm thinking within the next 4 weeks but that's my speculation. Jan 03 09:03:12 I have to charge for this one cuz my multiplayer server certainly isn't free to operate Jan 03 09:04:40 What are you working on? Jan 03 09:06:15 Besides the flashlight app Jan 03 09:06:25 nothing Jan 03 09:06:26 For 29.99/mo Jan 03 09:06:31 i dont know java :( Jan 03 09:06:48 Oh for real? Jan 03 09:07:12 yup Jan 03 09:07:18 So what brings you to this channel? Jan 03 09:07:19 i just sit in here to read the fun stuff Jan 03 09:07:27 i am a collector of information :) Jan 03 09:07:43 Well I'm sure by now you've absorbed enough knowledge to start coding something :) Jan 03 09:08:06 well, i wrote a hello world, but gave up dealing with the xml crap Jan 03 09:08:18 Did you use the eclipse plugin? Jan 03 09:08:21 yeah Jan 03 09:08:26 ill stick to .sh scripts for now Jan 03 09:08:38 let the ppl who know what they are doing write the apps Jan 03 09:08:40 Once you get used to the editors, the xml isn't nearly as bad as it seams Jan 03 09:08:48 I rarely edit any xml raw now Jan 03 09:08:49 i couldnt figure out the layout stuff Jan 03 09:08:51 I use the tools they gave Jan 03 09:08:58 Yeah it's a little annoying at first Jan 03 09:09:04 You have to get over the hump Jan 03 09:09:18 My new app has like 20 screens Jan 03 09:09:25 Ok maybe 12 Jan 03 09:09:37 but still, I'm surprised at how fast I can crank out the app once I know the tools and api Jan 03 09:10:32 For my first game all I did was start with an example and start ripping stuff out and adding things until I had what I wanted. Jan 03 09:10:38 That's not a bad way to go. Jan 03 09:11:53 Do you have a G1? Jan 03 09:12:29 yes Jan 03 09:13:05 Did you try the game light racer? Jan 03 09:13:46 lol, i downloaded it but never ran it Jan 03 09:13:50 i just realized that tonight Jan 03 09:13:54 i was looking at my largest apps Jan 03 09:14:03 ive had it since it first came out Jan 03 09:14:25 get the 1.0.1 update if you're going to try it Jan 03 09:14:44 Anyway, I wrote that using the Lunar Lander and Snake examples as a kind of template Jan 03 09:15:23 It's not very well writte and my new game does a much better job being efficient and using the framework correctly but you can totally take the demos and examples as a starting point to develop something Jan 03 09:22:46 lol Jan 03 09:22:48 got to level 19 Jan 03 09:22:57 and died and accidentally rolled the ball down :( Jan 03 09:24:05 Heh yeah I hear that happens a lot. I'll fix that when I get back around to updating the game. Jan 03 09:30:37 ok, bedtime for me Jan 03 09:30:40 gl on your games Jan 03 13:59:19 anyone around ? Jan 03 14:00:17 Guess I need to hang around in USA/West Coast daytime :-o Jan 03 14:03:16 Who owns http://code.google.com/android/samples/ApiDemos/src/com/example/android/apis/app/ ? All the links to ".xml" are b0rked. Jan 03 14:50:52 is it me or are date calculations in Java a pain? Jan 03 15:33:06 zeroxten: they are always a pain Jan 03 15:36:51 everything is a pain in Java Jan 03 15:38:24 i second that Jan 03 15:39:21 rofl Jan 03 15:39:28 i think i am slowly getting there. Jan 03 15:39:37 what are you trying to do? Jan 03 15:39:43 just trying to get the midnight of the start of the week Jan 03 15:44:43 almost there... Jan 03 15:57:32 and getting the start of the week in c is more easy? Jan 03 16:02:17 actually, it was pretty easy :) Jan 03 16:32:03 hi guys, this may seem a really stupid question but is the android market, just a webpage or is there an actual program i can click on inside the emulator Jan 03 16:34:56 Market program isnt on the emulator Jan 03 16:35:08 if you get an actual device, it'll be there Jan 03 16:35:22 aha cheers, so theres no way to get it either Jan 03 16:35:32 Not to my knowlage at least Jan 03 16:35:42 aha ok, thanks Jan 03 16:36:10 its on both the T-Mobile and the Dev device iirc. Jan 03 16:37:56 i havent got a device tbh, im comparing the symbian S60 SDK with Android, so far android is winning by far Jan 03 16:40:52 you can play with the andappstore.com, which is similar Jan 03 16:42:57 cheers looks interesting Jan 03 17:15:52 I've made my own custom list adapter (extends array adapter) and I want to make the row selectable, and be able to detect when that row is selected. How do I do that? Jan 03 17:18:04 the row will be selectable by default Jan 03 17:18:15 and you can use an OnItemSelectedListener to be notified when it's selected Jan 03 17:20:50 does anyone know why for any reason when i start up the emulator that things keep crashing and my app just won't start Jan 03 17:23:40 romainguy, I guess I'm expecting the row to be hilighted when I touch it. Do I need to enable something for that? Jan 03 17:24:25 anyone any idea what ZygoteInit$MethodAndArgsCaller.run() line: 745 is? Jan 03 17:25:12 savid: no, that's normal Jan 03 17:25:32 savid: read this http://android-developers.blogspot.com/2008/12/touch-mode.html Jan 03 17:26:20 ahh, my error traces to this: Jan 03 17:26:46 java.lang.ClassNotFoundException: org.ifies.livelocations.LiveLocations in loader dalvik.system.PathClassLoader@433e76f0 Jan 03 17:27:01 romainguy, awesome, thanks. Jan 03 17:28:00 digitalspaghetti, just curious, how are you running the emulator? Jan 03 17:28:09 from debug in Eclipse Jan 03 17:28:40 hmm.. no idea. perhaps it has something to do w/ your Java version but I don't know Jan 03 17:28:47 just a guess Jan 03 17:29:49 java.vm.version=11.0-b16 Jan 03 17:29:50 java.version=1.6.0_11 Jan 03 17:29:50 digitalspaghetti, is org.ifies.livelocations.LiveLocations Jan 03 17:29:50 digitalspaghetti, is org.ifies.livelocations.LiveLocations your app? Jan 03 17:30:10 package is org.ifies.livelocation, LiveLocations is the main app which extends MapActivity Jan 03 17:32:08 Ah, so that's the app you're developing. Looks like it's simply not able to find the main LiveLocations class. Perhaps your project settings are not right Jan 03 17:34:05 http://paste.ifies.org/206 Jan 03 17:36:33 digitalspaghetti, and you're sure that you have a class name called "LiveLocations" in LiveLocations.java in org.ifies.livelocations? Jan 03 17:37:16 digitalspaghetti, if all else fails, you might try creating a new project from scratch and slowly adding your source code back to it Jan 03 17:37:30 public class LiveLocations extends MapActivity { Jan 03 17:40:44 yeah, no idea. I'd suggest creating a new project and testing that while slowly adding stuff back in Jan 03 18:19:37 romainguy, I read that article, and I've added an onListItemClilcked listener, but I guess I'm still unclear on how to make it so that touching the list item causes the background of the item to change colors (to give the user feedback that the item was touched) Jan 03 18:26:30 romainguy, basically I'm trying to get it to behave like a normal list view. For example, in your notifications list if you touch an item, the background changes color, until you release. Jan 03 18:37:46 it does that automatically Jan 03 18:38:19 unless that is you change the list selector Jan 03 18:40:03 romainguy, no I haven't changed the list selector (that I know of) Jan 03 18:40:21 savid - did you set a background on the listview? Jan 03 18:40:22 did you put a background on your list items? Jan 03 18:40:52 nope, no backgrounds Jan 03 18:41:06 then it should work Jan 03 18:41:20 there's nothing to do for the list item to change color when you touch it Jan 03 18:41:37 as long as you don't change the list selector or don't give your own background to the items Jan 03 18:41:40 Oh wait I had this happen one time. Let me think of what it was... Jan 03 18:41:44 here's my row layout: http://pastebin.com/m21cc04d6 Jan 03 18:42:39 and my listview http://pastebin.com/m7f8a1927 Jan 03 18:42:56 then it should work Jan 03 18:43:15 I'm using a custom list adapter Jan 03 18:43:21 that doesn't matter Jan 03 18:43:22 (extends ArrayAdapter) Jan 03 18:44:16 darn. I'll see if I can reproduce it in a simple app setup, and then post the source code Jan 03 18:45:36 savid - how will that work if your listview has a height of 0px? Jan 03 18:46:09 it has a weight of 1 Jan 03 18:46:14 so if it's in a linearlayout, it works Jan 03 18:46:29 oh i've never done it that way. Jan 03 18:47:56 But wouldn't you want the height to be wrap_content anyway? Jan 03 18:48:06 rbgrn, jasta showed me that. I guess it saves a little processing time. Jan 03 18:48:12 Oh ok Jan 03 18:48:26 Yeah because it's going to ignore the height and follow the weight so I see what you're saying. Jan 03 18:50:17 Are any of you guys doing apps where you are running your own server? Jan 03 18:51:20 Here's what jasta said about that: "setting the dimension's value to 0 is merely an optimization asking linearlayout not to bother computing its size because it doesn't matter: it will just grow as big as possible." Jan 03 18:51:50 yup, I get it. So long as there aren't any weird side-effects, it's a good idea. Jan 03 19:02:50 rbgrn: But wouldn't you want the height to be wrap_content anyway? <, wrap_content doesn't mean anything for a ListView Jan 03 19:03:02 it works but it just gives the list a height of one item Jan 03 19:03:06 and it's very expensive Jan 03 19:16:53 ah Jan 03 19:16:53 ok Jan 03 19:27:43 Is there any way to get your google account info IE the email address used for the gmail/calendar/contacts integration? Jan 03 20:01:38 romainguy, still around? here's some reproducible code of what I was experiencing earlier. ListDemo.java: http://pastebin.com/m1225cb17 , main.xml: http://pastebin.com/m2e6d8662, row.xml: http://pastebin.com/m64e95ef2 Jan 03 20:05:05 except the height of the listview, I don't see any problem Jan 03 20:08:38 can you try and run that code as a project? Jan 03 20:09:08 the trackball works, but touching an item does not hilight it. Jan 03 20:10:41 ah Jan 03 20:10:51 it's probably because the checkbox gets the touch events Jan 03 20:10:56 remove the checkbox, it should work Jan 03 20:11:09 (instead of using checkboxes in lists, we usually rely on ListView's choice mode) Jan 03 20:13:11 romainguy, the checkbox is more just a visual queue if anything else. Is there a way to make this work? Jan 03 20:13:25 like I said, ListView's choice mode Jan 03 20:14:54 romainguy, some items in the list view might not be a choice, this list view can contain multiple types of widgets, ie, it could contain a text view that pops up another activity to select a value Jan 03 20:15:06 would choicemode still apply in that case? Jan 03 20:16:51 nope Jan 03 20:17:24 is there any other way, other than choicemode, to hilight an item when it's clicked? Jan 03 20:17:46 there is nothing to do Jan 03 20:17:55 you just need to not use items that respond to touch events Jan 03 20:18:03 in that case you would need to make the checkbox as small as possible Jan 03 20:18:47 now I'm real confused. The PreferenceActivity seems to pull it off fine with a normal size checkbox Jan 03 20:18:58 it's not using checkboxes I think Jan 03 20:19:06 oh Jan 03 20:19:22 I see. so I could just use an image to "emulate" a checkbox Jan 03 20:26:14 Not sure if that's the best way to do it though. Guess I'll have to dig into PreferencesActivity to see how they do it Jan 03 20:43:58 ugh... I can't seem to figure out how Preferences does it. Jan 03 20:44:00 I'm at a loss Jan 03 20:55:40 romainguy, so are you thinking the checkbox is stealing input from the list item? If that was the case, shouldn't the checkbox be checked when I touch the item? Jan 03 20:59:31 Ahh, I think I figured it out. I set "android:focusable" to false on the checkbox. I think the fact that it was focusable meant that onItemClick wasn't getting fired. Jan 03 21:27:53 hmm, what determines the "id" in a listview? Jan 03 21:39:17 set it in the xml Jan 03 21:39:29 @+id/this_is_whatever_you_set_it_as Jan 03 21:39:48 oh in a listview Jan 03 21:39:52 not of a listview Jan 03 21:39:59 sorry Jan 03 21:40:17 It's up to your data provider Jan 03 21:40:47 So if you use a simple arraylist of objects, you can just make the ID whatever sequence number Jan 03 21:41:08 But if you use the providers, it can be the primary key of the record Jan 03 21:41:49 Also if you use an external data provider (HTTP/XML/RPC/JSON,etc) you can use the databases primary key Jan 03 21:59:36 grr, i just cannot get this example code to work Jan 03 21:59:44 i created a clean project, but getting the same error Jan 03 22:00:37 java.lang.ClassNotFoundException: org.ifies.livelocations.LiveLocations in loader dalvik.system.PathClassLoader@433e76f0 :| Jan 03 22:25:05 rbgrn, I am using a custom adapter which wraps up some db stuff. id is the primary key from the db and i've tried itemList.add(id,item) but I'm getting an error. Jan 03 22:25:24 Its starting at 1 but I guess a ArrayList doesn't like that Jan 03 22:46:34 hmm, i'm guessing its through getItemId Jan 03 23:09:49 is itemList an arraylist? Jan 03 23:22:37 yeah, i think I worked it out. Added id as a field in Items and method to get it etc. Just need to sort out problems with deleting i think Jan 03 23:22:50 or at least why I got a stackoverflow Jan 03 23:29:10 yeah I was gonna say, if you're adding to a java.util.List (ArrayList, etc), you can't use the id for the add() method Jan 03 23:29:22 add(index, object) adds to a point in the array Jan 03 23:30:14 All you need to do for your adapter for the getItemId(position) method is do return itemList.get(position).getId() Jan 03 23:30:31 ;) did that Jan 03 23:30:33 Assuming the object returned knows its ID Jan 03 23:30:35 Ok good Jan 03 23:31:22 yeah, I think things got slightly messy on the way, gotta tidy up, do some debugging (log.v with ids etc) whilst looking at sqlite db and then some thorough testing Jan 03 23:31:39 I went the provider route with my local db Jan 03 23:31:46 Used the notepad example Jan 03 23:31:47 it worked. Jan 03 23:32:20 The app I'm working on now has an external database which I've got a rails server providing REST/JSON services. It works really well. Jan 03 23:32:30 ah cool Jan 03 23:32:38 I love rails. Jan 03 23:32:42 hehe Jan 03 23:32:50 I looked at it briefly once Jan 03 23:32:58 more of a perl person mysql Jan 03 23:33:20 Annoying learning curve and you _must_ stick to their conventions but once you "Get it", you basically don't have to write any tedious code ever again. Jan 03 23:33:25 tend to mostly do sysadmin scripting, all this OOP stuff is kinda new to me (well, when done properly anyway) Jan 03 23:33:30 It's the fastest dev platform I've ever used. Jan 03 23:33:35 cool Jan 03 23:33:54 Japanese invention/design right? Jan 03 23:34:14 I was a unix sysadmin for about 4 years but have been in Java land for about 10 years now. Jan 03 23:34:31 I dunno where ruby came from. Jan 03 23:34:46 Ruby's author is Japanese indeed Jan 03 23:34:59 whoop... pub quiz here i come Jan 03 23:35:10 Hi. Two questions: 1. I have three classes: 1st - main, registers received for wifi scan complete, starts a scan, and starts a TextView to indicate scanning in progress; Class 2 - the broadcast receiver callback that gets all SSIDs into a list; Class 3 - ListActivity class that displays the SSIDs to screen. I don't know how to assemble them together - I want to call class 3 from the onReceive function of Class 2, but startActivity Jan 03 23:35:19 It's a really powerful language but by virtue it can be a bastard to debug. Jan 03 23:35:49 it gets especially fun when 3rd party libraries modify the classes :) Jan 03 23:35:58 (and if I try to call my Class 3 display method directly, my program dies -- I suspect because it's switching from Activity to ListActivity ?? Jan 03 23:36:07 romainguy - THat's exactly what I'm talking about. You can swap out base class code and not even know it! Jan 03 23:36:16 (from TextView to whatever ListActivity uses) Jan 03 23:36:17 heh with great power comes great responsibility, and with great responsibility comes leet debugging skillz Jan 03 23:36:23 Ruby is very powerful but I never managed to like the syntax Jan 03 23:36:26 I just hate it :) Jan 03 23:36:32 You don't like => ? Jan 03 23:36:33 :) Jan 03 23:36:43 How about romainguy.ishappywiththis?() Jan 03 23:36:45 and | x | and pretty much everything else :)) Jan 03 23:36:57 oh | x | kills me still Jan 03 23:37:07 anyway Jan 03 23:37:12 i'm *still* freaking out about python and whitespace Jan 03 23:37:28 gcinzh - startActivity(new Intent(this, 3rdClass.class)); Jan 03 23:37:49 I always used vim to do python because it's really good about whitespace. Jan 03 23:37:55 I set my tabs to be 4 spaces. Jan 03 23:37:58 r Jan 03 23:38:24 and remember to ":set noautoindent" before pasting anything using a mouse ;) Jan 03 23:38:50 rbgrn: eclipse believes startActivity is not valid from within a BroadcastReceiver. Should I set it all up from my onCreate in class 1 ? Jan 03 23:38:59 Ohhh Jan 03 23:39:30 the problem is - I have a pure SysAdmin-type background ... I'm no Java coder, so the whole paradigm is new to me ... fried my brain, but I'm a persistent bugger so here I am .. ;) Jan 03 23:39:34 I'd have your first activity manage the results from the broadcast receiver and flow to the second class. Jan 03 23:39:41 err second activity Jan 03 23:39:45 understand. Jan 03 23:39:49 same here gcinzh Jan 03 23:39:53 gcinzh: you'll get used to it Jan 03 23:40:11 gcinzh: actually you have an advantage here, the Android APIs are very different from the usual Java libs/APIs Jan 03 23:40:16 And having an Intent will take care of the change of display type from TextView to List, or will I *have* to update XMLs (other than listing the intent) Jan 03 23:40:16 ? Jan 03 23:40:20 Android is a bit like rails in this - Stick to convention and you'll steer clear of problems. Jan 03 23:40:26 gcinzh: so it might be easier for you to learn than if you already knew Java :) Jan 03 23:40:34 romain: \o/ :-) Jan 03 23:41:05 gcinzh - For now, have 1 layout xml per activity. Have each activity manage everything that happens with that view and then fire off an intent to get to your next activity. Jan 03 23:41:23 Stick stuff into a bundle that needs to be passed and add the bundle to the intent. Jan 03 23:41:28 gcinzh: before Android I worked on the JDK, it took me a couple of months to get used to the Android way :) Jan 03 23:41:32 It only needs to be serializable and you'll be set. Jan 03 23:41:37 Gotta say - first time I'm using eclipse and with the SDK, it's **brilliant** ... The Android folks really anticipated idjits like me and wrote fantastic documentation ... the problem is, idjits really are unpredictable ;) Jan 03 23:41:43 rbgrn: not serializable, parcelable :) Jan 03 23:41:54 ^^^ what he said. Jan 03 23:42:17 I did some of my stuff as serializable and used putSerializable and getSerializable Jan 03 23:42:19 romain: so if I can manage all intents from class 1 (the "main" one), then I can have a single variable that controls state and knows flow based on that ... perfect. Jan 03 23:42:20 Is that bad? Jan 03 23:42:50 gcinzh: er waht? Jan 03 23:43:22 romainguy: another Q - what is the accepted way to check for values ... is a callback kinda "mandatory", or could one do something like: while (var != "what I'm waiting for") { try {thread.Sleep(100) } catch { ....}; } ? Jan 03 23:43:31 gcinzh - umm, no not really an umbrella manager, just think of it like this. If you have one main screen which takes some input and does some stuff, then you want to bring the user to another screen for more, have 2 activities and the first activity starts the second. When the user is done on the second, it'll return back to the first. Jan 03 23:43:44 gcinzh: don't do the loop version Jan 03 23:43:52 rbgrn: *nod* Jan 03 23:43:55 gcinzh: it's usually done with callbacks or in the case of Android, intents and/or Messages Jan 03 23:44:10 gcinzh - startActivityForResult() and then onActivityResult() Jan 03 23:44:17 gcinzh: have you looked at code.google.com/p/apps-for-android? Jan 03 23:44:24 romainguy: I'll read up about those - thank you. Jan 03 23:44:26 Using those will call out and activity and tell you what it returned. Jan 03 23:44:57 gcinzh: this URL contains a bunch of apps written by the Android team, the apps are small enough so that you can read the code and understand them pretty easily, but they're complicated enough to be interesting Jan 03 23:45:03 romain: not since I started attempting to write code ... I viewed it when I first learned about it. thanks for the reminder. Jan 03 23:45:09 np Jan 03 23:45:23 you should also join the Android Google Groups Jan 03 23:45:26 so romain, why should I use parcable over serializable? Jan 03 23:45:37 romain: the apidemos and samples were complete enough to get an idea of api calls, but incomplete-enough that I couldn't quite make out the "best practise flow of an android app" Jan 03 23:45:42 with regards to bundles Jan 03 23:45:42 so this is probably exactly what I need Jan 03 23:45:53 rbgrn: because Android does not use serialization :) Jan 03 23:45:54 gcinzh - check out the notepad app. Jan 03 23:46:02 gcinzh: that's what apps-for-android is for :) Jan 03 23:46:15 so what's with Bundle.putSerializable and Bundle.getSerializable Jan 03 23:46:29 oh because it's easier Jan 03 23:46:34 I used those the other day and they worked for me Jan 03 23:46:36 but the preferred way is to use parcelables Jan 03 23:46:41 Ok Jan 03 23:46:50 I'll see about switching if it's a best practice. Jan 03 23:47:03 it's also more efficient than serialization if I recall correctly Jan 03 23:47:04 rbgrn: I did. it was inconclusive (in that imho to get enough from those samples, they assume a base knowledge which I'm only starting to achieve) Jan 03 23:47:12 ah Jan 03 23:47:18 Well keep trying and you'll get there. Jan 03 23:47:23 I don't think you're too far off. Jan 03 23:47:57 rbgrn: http://code.google.com/p/apps-for-android/source/browse/trunk/Photostream/src/com/google/android/photostream/Flickr.java << look at line 239 for a simple example of a parcelable class implementation Jan 03 23:48:03 almost 1am here in Zürich, and my wife is already upset that I've spent so much time on it the last few days (and elected to miss my kids' friends' birthday party later today so I can make progress on it), so I'll continue on it then ... but bedtime for now Jan 03 23:48:04 the trick is the CREATOR field Jan 03 23:48:10 thank you both for your assistance Jan 03 23:48:29 hmm Jan 03 23:49:00 Aw man I gotta implement the parsing myself then huh Jan 03 23:49:26 I was happily implementing serializable and calling it a day. Jan 03 23:49:32 :) Jan 03 23:50:23 speaking of parsing - is there a regex lib in Android (or even better, something that can parse HTML) ? Jan 03 23:50:42 Can I recommend not parsing HTML unless you absolutely have to? Jan 03 23:51:05 I need to pull the values from a few tags on a return page... Jan 03 23:51:17 You may end up pulling your hair out instead. Jan 03 23:51:22 I can do it easily in regex if available Jan 03 23:51:36 Do you control the site that you are hitting? Jan 03 23:51:42 no Jan 03 23:51:43 How do I view log messages that are logged using Log.v() ? Jan 03 23:51:50 logcat Jan 03 23:51:51 Does the site have an XML/JSON interface? Jan 03 23:52:04 rbgrn: nope. Jan 03 23:52:08 zeroXten, does logcat show Log.v() messages by default? Jan 03 23:52:09 Hrm Jan 03 23:52:30 (as opposed to Log.d() ) Jan 03 23:52:32 rbgrn: standard WISPr-compliant response from any public wireless hotspot Jan 03 23:52:38 ah, hmmm, seems to on mine. Jan 03 23:52:56 Well for the awful task of scraping data out of HTML, I've used an HTML to XML converter but that's kinda heavy Jan 03 23:53:06 so it'll be a bunch of easily-parseable data (for some definition of easily-parseable once I learn what Android provides ;-) ) Jan 03 23:53:24 I dunno, better start searching. Jan 03 23:53:24 rbgrn: oh, I can simply slurp it all into a string and regex it if that's an option ... Jan 03 23:53:35 Well you can, String supports regex search Jan 03 23:53:39 perfect Jan 03 23:54:10 it doesn't need to be efficient, it just needs to work. It runs once. Jan 03 23:54:38 bedtime. really. (bet I'll be back in 30min with questions about that intent+setActivity ;-) ) Jan 03 23:55:15 Also look at java.util.regex Jan 03 23:56:11 thank you Jan 03 23:56:48 * gcinzh runs svn checkout ...apps-for-android Jan 04 00:00:24 oh - while you guys are here ... ;) Jan 04 00:00:50 If I run eclipse in debug mode, or even run logcat, and get a stacktrace -- it sometimes traces down a few steps then says "and 11 more lines" or somesuch. Jan 04 00:00:59 Often, the juicy bits would be on that 11th line! Jan 04 00:01:44 not usually. The stuff you want is usually on the top 3 lines Jan 04 00:01:47 What's the catch -- do I need to pull the logs off the phone via adb pull ? Jan 04 00:02:01 not the line of *my* code that caused the issue ... Jan 04 00:02:05 No that's actually a thing with java's stacktrace Jan 04 00:02:29 Well often times you'll want to look at the line of your code (top of stack) because it did something that caused a problem down deeper Jan 04 00:02:44 or not top of stack but just under Jan 04 00:02:48 Usually not way at the bottom. Jan 04 00:03:17 my line wasn't indicated at all inmy stacktrace ... ie, where I called class3.method() from class2.method() which caused it to blow up Jan 04 00:03:32 it dumped its stack ... but I didn't know which of my operations had led to it. Jan 04 00:03:57 (at least, I had to find out by trial and error by uncommenting line by line until it b0rked) Jan 04 00:04:22 (in comparison for eg to Python where it's quite explicit) Jan 04 00:04:28 no matter .. Jan 04 00:07:02 gcinzh: the easiest thing to do is probably to just step into the call tree from Eclipse Jan 04 00:07:05 -- another Q (tell me when to shove off please ...). I just downloaded apps-for-android, and had a look at Translate. specifically, Translate.java, since I suspect that's where the entrypoint of the code is. There's no onCreate defined, but there is a translate() method. Yet the file is called Translate.java. Jan 04 00:07:17 You should be able to see the full stack trace from the Eclipse debugger, even if logcat isn't showing it Jan 04 00:07:51 Should I assume that since the package is called domain.name.translate, that the method called "translate" will always be called (after onCreate) ? Jan 04 00:08:13 gcinzh: there can be multiple entry points since an Android .apk file is really just a collection of components registered with the system Jan 04 00:08:14 morrild1: nope, eclipse showed as little information afair. I'll try repeat it later to verify. Jan 04 00:08:32 gcinzh: what you want to do is look at AndroidManifest.xml and see which classes have entries Jan 04 00:08:46 Those are probably the entry point or points you're looking for Jan 04 00:08:46 morrild1: so how can one guarantee which screen will be displayed to the user, if multiple components are "valid" ? Jan 04 00:09:07 gcinzh: you specify what you want Jan 04 00:09:59 if your Activity wants to launch another, it can either specify it via its class name, or you can issue an Intent constructed so that it will match the of the Activity you want to launch Jan 04 00:10:27 the first is unambiguous but brittle, the second is more flexible and safer, and the preferred way Jan 04 00:10:53 in the case of Translate there are two activities: TranslateActivity and HistoryActivity. Jan 04 00:11:10 morrildl: indeed -- I was concerned about entrypoint on startup Jan 04 00:11:56 ie, surely there needs to be an entrypoint in the code *somewhere*? Jan 04 00:12:07 what if you need to initialise state upon which all other classes depend ? Jan 04 00:12:43 My futzing around to this point led me to believe it was an onCreate function in the title-named class ... it appears that may not be the case Jan 04 00:12:50 no, that's correct Jan 04 00:12:52 1 sec Jan 04 00:13:17 gcinzh: http://www.youtube.com/watch?v=TkPiXRNee7A Jan 04 00:13:28 If you have an hour, that will probably shed a lot of light on the nuts and bolts of what is happening Jan 04 00:13:54 But yes, onCreate is the main entry point (more accurately: the FIRST entry point) for an Activity Jan 04 00:14:21 I see there's a TranslateActivity.java file, in which there *IS* a lot of setup and an onCreate ... and based on your earlier indication that the AndroidManifest.xml indicates activities, I suspect *THAT* is where it starts. Jan 04 00:14:53 You can make an Activity appear on the Home screen's app launcher by setting the appropriate on your Activity in AndroidManifest.xml. That is how you make an Activity the apparent entry point for a user, but it doesn't guarantee that that Activity is run before any others Jan 04 00:15:04 Thank you - opened into browser ... I should watch that when I wake up. Jan 04 00:15:09 (01h15 here now) Jan 04 00:15:14 gcinzh: heh :) Jan 04 00:15:15 I appreciate the pointers. Jan 04 00:15:24 GMT+1? Jan 04 00:15:29 (and, ironically, the *LACK* of pointers in Android :-) ) Jan 04 00:15:34 hahahaa Jan 04 00:15:35 Zürich, yes Jan 04 00:15:39 very cool Jan 04 00:16:26 my biggest hurdle thusfar has been that the IDE and SDK make it so accessible, but I *really* have to bootstrap myself since I have no background in common with Android code *at all*. Jan 04 00:16:46 In a nutshell: most of hte time you'll have one main Activity which is your entry point 80% of hte time. It's perfectly okay to do init work in that Activity's onCreate. Just be aware that anything you set up there may not be available to other Activities Jan 04 00:17:00 so I know what I want to do, and get led mostly down the path by autocomplete and the incredibly superb documentation, but lack the knowledge to glue it together. Jan 04 00:17:13 gcinzh: ah yes, well that's what we're here for :) Jan 04 00:17:19 the other thing I miss are global variables :-P Jan 04 00:17:26 gcinzh: yeah that's a Java thing Jan 04 00:17:36 global variables are for small apps. Jan 04 00:17:46 gcinzh: you should investigate SharedPreferences (search the Android docs), which might help in some cases Jan 04 00:18:02 My last big project had 50 developers and cost 14 million. I thank god no person could define global variables. Jan 04 00:18:07 in perl, python, and other languages that don't enforce "good" programming, I'd simply pass data to functions, or as globals Jan 04 00:18:15 rbgrn: ;-P Jan 04 00:18:35 apparently Jython lives again Jan 04 00:18:36 morril: actually, I'd rather learn (and commit to) "best practise" from the start Jan 04 00:18:40 You're doing OO now. You'll appreciate it later. Jan 04 00:18:53 and there is a "jythondroid" project too Jan 04 00:19:02 I hope that pans out, it would be awesome to write Android apps in Python Jan 04 00:19:21 Jeez Jan 04 00:19:24 I'd rather not Jan 04 00:20:45 My current game is getting really big with the multiplayer code and I couldn't imagine doing it in python Jan 04 00:20:51 * gcinzh invites morrildl and/or romainguy to Zürich for a while .. :-) Jan 04 00:20:58 It'd be so hard to follow Jan 04 00:21:04 morrildl: ping Jan 04 00:21:10 rbgrn: if your game is "Snake"m it could *BE* Python! Jan 04 00:21:21 hahaha I did light racer Jan 04 00:21:23 gcinzh: Well, we do have an office there :) It's one of my goals, to visit that office. Jan 04 00:21:28 My new game is called "Wuzzle" Jan 04 00:21:34 ttuttle: howdy Jan 04 00:21:46 morrildl: Can you ping rlove for me, if he's on Google Talk? Jan 04 00:22:13 I want to do another action game though Jan 04 00:22:32 I'm rusty on my 3D stuff but I think I'm going to take a stab at a simple 3D action game next Jan 04 00:22:40 morrildl: I sent him a patch to some code he wrote ages ago, at Novell :) Jan 04 00:23:17 ttuttle: I don't see him Jan 04 00:23:29 morrildl: Alright. I sent him an invite from my puny non-Corp Gmail account. Jan 04 00:23:52 morrildl: Thanks. Jan 04 00:24:16 np Jan 04 00:24:43 rbgrn: someone I knew has the domain wuzzle.org :-) Jan 04 00:24:58 I'm thinking about doing a game that's kinda locorocoish Jan 04 00:25:00 well, had.. about 8 years ago ... I suspect they still do Jan 04 00:25:10 That's cool - I don't plan on getting a domain for it. Jan 04 00:25:25 Yep - still theirs. Jan 04 00:25:40 I'm actually done with the game and all the art but I'm at the last few miles with the multiplayer stuff right now. Jan 04 00:25:56 morrildl: (So, I just got a Thinkpad, and kernel 2.6.28 adds a generic -- and mainlined, more importantly -- way to unload the heads on a hard drive. rlove wrote some code for reading the Thinkpad accelerometer, which was later turned in to the protection daemon. I ported the daemon to use the new interface.) Jan 04 00:26:32 morrildl: Also, Thinkpads rock. Jan 04 00:27:13 T61p here Jan 04 00:27:42 8GB of ram - because, you know, you need that. Jan 04 00:27:51 rbgrn: Grr, I only have 4 GB :( Jan 04 00:27:56 rbgrn: Does it take 4 DIMMs? Jan 04 00:27:59 I don't know why I got 8. Jan 04 00:28:05 I have 2 4GB dimms Jan 04 00:28:07 rbgrn: To prove you're running a 64-bit OS! Jan 04 00:28:10 haha Jan 04 00:28:12 rbgrn: Wow, that must've cost a fortune. Jan 04 00:28:22 I am, and I don't have a working driver for android because of it! :) Jan 04 00:28:36 I have that one that some guy made porting the 32 bit one but it's not signed :( Jan 04 00:29:06 rbgrn: Mine is a Thinkpad X200 with Core 2 Duo P8600 (2.4 GHz), 4 GB RAM, 250 GB 5400 RPM HDD, no optical drive, Intel WiFi (802.11a/g/n) + WiMax, Bluetooth, AT&T 3G + GPS, 9-cell battery. Jan 04 00:29:10 rbgrn: Gets 9 hours of battery. Jan 04 00:29:17 rbgrn: ...wait, you're running *Windows*?! Jan 04 00:30:25 ttuttle - it was $370 Jan 04 00:30:31 G.Skill I think from newegg Jan 04 00:30:32 rbgrn: What, Windows, or the laptop? Jan 04 00:30:35 rbgrn: Oh, the RAM. Jan 04 00:30:37 rbgrn: Nice. Jan 04 00:30:49 I'm an IBM employee so I got a nice discount on the machine. Jan 04 00:31:03 rbgrn: Nice :) Jan 04 00:31:11 rbgrn: Damn, I could've mooched a discount code off of you :P Jan 04 00:31:26 :) Jan 04 00:31:44 rbgrn: Eh, I got a pretty decent price on this. It's about $300 lower than the current price for the same config. Jan 04 00:32:34 Mine was $1500 in May - T9500, 15.4" 1680x1050, 120GB HD, nvidia 570m, etc.. Jan 04 00:32:50 err 160gb hd Jan 04 00:32:51 whatever Jan 04 00:33:06 blah, stupid network Jan 04 00:33:13 Now you'd have to get a W500 cuz they stopped making the T61p Jan 04 00:33:53 I love my t61p Jan 04 00:34:14 Your machine sounds pretty nice Jan 04 00:34:27 I get terrible battery life Jan 04 00:34:28 Thinkpads rock. Jan 04 00:34:35 I'm down to 2 hours Jan 04 00:34:40 Originally it was 3 Jan 04 00:34:43 rbgrn: :( Jan 04 00:34:50 rbgrn: Mine gets 9 =D Jan 04 00:34:51 My old Asus Pentium M 2.0ghz got almost 6 Jan 04 00:34:59 Yeah the X200 is much more power efficient Jan 04 00:35:10 rbgrn: Ooh, I had an Asus M2400Ne with Pentium M 1.7 GHz. That was a nice box... Jan 04 00:35:16 I like asus. Jan 04 00:35:38 If I end up non-mobile for a while I'd be pretty excited to build an i7 machine Jan 04 00:35:44 That i7 processor is crazy fast Jan 04 00:35:55 2x faster than the leading core 2 Jan 04 00:35:57 * ttuttle should configure mplayer to cache more by default so it doesn't run out of media when I decide to pick up and carry the laptop around (tripping the hdaps). Jan 04 00:36:29 And once again moore's law is upheld. Jan 04 00:36:47 And the coders can write even slower code and get away with it. Jan 04 00:36:49 yaaaay Jan 04 00:37:09 morril/(or others): Will onResume be called the very first time an activity starts (after onCreate and onStart)? (yes, I'm watching the youtube video ... :-) ) Jan 04 00:37:14 yes Jan 04 00:37:20 okie dokey - thanks. Jan 04 00:37:22 onResume is the kick-off Jan 04 00:37:26 *nod* Jan 04 00:37:29 gcinzh: onResume: yes. onRestart: no, only if onPause was called first Jan 04 00:37:45 wait hold on let me go check the state diagram Jan 04 00:38:02 gcinzh - a good way to learn is to throw a logging statement on all 7 of the lifecycle methods and watch what it does when you mess around with the activity Jan 04 00:38:11 I can find out myself -- I could do with the coding exercise :) Jan 04 00:38:15 ahh, right Jan 04 00:38:17 http://code.google.com/android/reference/android/app/Activity.html Jan 04 00:38:18 there you go. Jan 04 00:38:22 okay so Jan 04 00:38:46 the "launch from nothing" case is onCreate -> onStart() Jan 04 00:38:49 ah. I saw that in the vid (but not running fullscreen/HD so couldn't make it all out ;) ) Jan 04 00:39:05 thanks ... Jan 04 00:39:06 if onPause() is called, then onResume() will be called after onStart() Jan 04 00:39:32 if you look at that state diagram, there is also stuff about onStop/onResume -- you can generally ignore that. Jan 04 00:39:36 * gcinzh votes for 30hour days ... Jan 04 00:39:39 They'll only be called extremely rarely Jan 04 00:39:44 *nod* Jan 04 00:40:14 one reason I love that video so much is because it took me a long time to work it all out :P Jan 04 00:40:16 heh heh Jan 04 00:40:26 :) Jan 04 00:41:31 to store user/pass data for an activity, is it preferable to use sqlite or the key/value pairs ? Jan 04 00:41:46 gcinzh: both will be equally secure Jan 04 00:41:52 the choice is yours Jan 04 00:41:59 for straight-up user/pass, I'd use SharedPrefs Jan 04 00:42:01 okie dokey. key/value it is... sounds simpler ;-) Jan 04 00:42:08 ++ for sharedprefs Jan 04 00:42:11 later Jan 04 00:42:16 rbgrn: later Jan 04 00:42:26 * gcinzh adds "SharedPrefs" to his list of "Learn about this stuff" Jan 04 00:43:01 thank you for your help, rbgrn (RedBlueGReeN?) Jan 04 00:44:10 gcinzh: SharedPrefs are easy: SharedPreferences prefs = getPreferences(MODE_PRIVATE); Jan 04 00:44:14 and then Jan 04 00:44:23 prefs.edit().putFloat("min_distance", (float) (EARTH_RADIUS_KM * 2 * Math.PI)).commit(); Jan 04 00:44:32 (as an example from one of my apps) Jan 04 00:45:12 prefs.edit() returns an "Editor" object that is used to transactionally update your preferences. In that example I only had 1 operation to do, so I chained it together as a single line Jan 04 00:45:13 everything is easy in Android .... (really) ... but only if you know how. Jan 04 00:45:15 but you don't have to Jan 04 00:45:20 gcinzh: Indeed :) Jan 04 00:45:25 It really is a very well thought-out language, imho. Jan 04 00:45:29 If you want an Android book, my favorite so far is Reto Meier's Jan 04 00:45:39 Well, we can't take any credit for Java :) Jan 04 00:45:54 but for the APIs, they core framework folks have done an awesome job Jan 04 00:46:04 Dianne and Jason and all Jan 04 00:46:23 I kinda like the online reference ... but it does assume some basic Java knowledge which I lack (but am acquiring at a more than glacial rate, fortunately ;) ) Jan 04 00:46:46 ie, it assumes a familiarity with the nomenclature Jan 04 00:47:15 heh heh Jan 04 00:47:17 yeah Jan 04 00:47:28 Java is a pretty straightforward language to learn if you know C or C++ Jan 04 00:47:45 I haven't done any C or C++ coding (rather than *reading* code) in 15 years. Jan 04 00:47:48 Personally I don't find it all that fun to program in (I like Python way better) but it is very utilitarian and gets the job done Jan 04 00:47:50 last time was at University Jan 04 00:48:26 Java got a lot more fun with the Annotations support they added in 1.5 tho Jan 04 00:49:33 last Q for now (if I ask more, ignore me ... it's almost 2am and my kids are gonna wake me at 8am): Jan 04 00:49:44 heh :) Jan 04 00:49:53 what are vacations for, if not late night hacking? Jan 04 00:51:11 if I want a display with two lists (one above another), and a button at the bottom of the screen, do I design it in layout/...xml (haven't looked at the format yet, but did come across the concept) and then simply define the two lists, and button, then .show() them ? Jan 04 00:51:50 morril: no, vacations are bad ... means I'm kept from the office, kids+wife are far more work! Jan 04 00:51:59 * gcinzh points to his 70 days of accrued vacation Jan 04 00:52:07 ig you do it in xml, you don't have to define them anywhere else Jan 04 00:52:15 if Jan 04 00:56:12 is there a way (perhaps via adb or another external method?) to kill a misbehaving app? I've gotten into a situation a few times where my under-development (does nothing yet but outputs state info to TextView) app becomes a bit of a CPU hog and I want to terminate it while still connected via USB... ? Jan 04 00:56:28 adb shell ps -9 thepidoftheapp Jan 04 00:56:31 or you can use DDMs Jan 04 00:56:35 there's a button to kill the app Jan 04 00:56:47 DDM ? Jan 04 00:56:50 DDMS Jan 04 00:57:00 look in the tools/ directory of the SDK Jan 04 00:57:01 * gcinzh adds that to his list of things to learn ;-) Jan 04 00:57:11 the Eclipse plugin has the equivalent of DDMS in its UI somewhere Jan 04 00:57:16 ok Jan 04 00:57:17 you can see the list of all processes, threads, etc. Jan 04 00:57:22 ah - cool! Jan 04 00:57:41 I assume you mean "kill -9" above Jan 04 00:57:48 er yes Jan 04 00:57:57 okie Jan 04 00:58:21 it also lets you look at the amount of memory the app is using Jan 04 00:58:31 I think it's time to send some more Swiss chocolate to Mountain VIew ... I really appreciate your assistance/answering q's Jan 04 00:58:34 you can graph events (GCs, battery, etc.) Jan 04 00:58:40 *nod* okay ... Jan 04 00:58:41 you can also track memory allocations Jan 04 00:58:44 and tons of other stuff Jan 04 00:58:58 it's basically THE tool we live with on the Android team :) Jan 04 00:59:06 what, chocolate ? Jan 04 00:59:11 ;-) Jan 04 00:59:12 that too :) Jan 04 01:00:17 when is the "proximity" sensor intented to fire ? Jan 04 01:00:22 no idea Jan 04 01:00:28 docs don't indicate "proximity to what" Jan 04 01:00:38 proximity to your head probably Jan 04 01:01:13 so, distance of an object from the face of the device perhaps ... Jan 04 01:01:14 to avoid your face causing touchscreen events Jan 04 01:01:23 ParkAssist for mobile devices Jan 04 01:02:00 taaz: sounds reasonable Jan 04 01:03:50 can someone explain what the difference between "preferences" and "settings" are? in what context are each of those supposed to be used? i use the words interchangable normally so it's confusing that the api and apps use them both in ways i don't understand. Jan 04 01:20:01 * gcinzh finishes watching morrill's talk, and unwillingly forces himself to go to bed... Jan 04 01:27:45 How can I see what version of the android sdk I have installed? I have it installed in /usr/local/lib/android (on Ubuntu). Jan 04 01:41:47 Ok, let me try a different question. How can I view the android source code as it was as of release 1.0_r2? Jan 04 01:56:55 you could check docs/RELEASENOTES.html to get the sdk version. Jan 04 02:06:45 hmm. ok. Is it possible to somehow view the source code at that particular release? Jan 04 02:17:12 well there's a release-1.0 branch Jan 04 02:17:21 and a release-1.0 tag Jan 04 02:23:20 How does Dialog fit in? Can someone point me to a good tutorial? Do you use it the same way you use the Activity class? **** ENDING LOGGING AT Sun Jan 04 02:59:57 2009