**** BEGIN LOGGING AT Wed Jan 21 04:28:46 2009 Jan 21 04:45:35 anyone here that has tried using limits with SQLiteQueryBuilder? Jan 21 11:33:35 herriojr_, yes Jan 21 11:33:49 you need to omit the LIMIT afaik Jan 21 11:34:18 (if that is the question^^) Jan 21 13:43:36 is there a way to insert a row and return the pk id with execSQL? Jan 21 15:35:35 mpardo: what do you mean the pk id? Jan 21 15:35:37 Is there a reason why onUpdate isn't being called when I changed the db version? Jan 21 15:35:53 herriojr: i fixed that problem nvm Jan 21 15:36:37 herriojr: pk = primary key Jan 21 15:36:55 ah ok Jan 21 15:37:06 umm, mine works Jan 21 15:37:55 you're using an SQLiteOpenHelper, right? Jan 21 15:38:09 yep Jan 21 15:38:10 http://pastebin.com/m75c81a63 Jan 21 15:38:15 there's the constructor Jan 21 15:39:12 all I have in mine is super(context, DATABASE_NAME, null, DATABASE_VERSION); Jan 21 15:39:28 I don't use openOrCreateDatabase() Jan 21 15:39:47 it works either way Jan 21 15:39:56 I was just letting you know :) Jan 21 15:40:17 but as long as DATABASE_VERSION is incremented is should call onUpdate right? Jan 21 15:40:36 as long as DATABASE_VERSION != the last version it should Jan 21 15:40:44 call onUpgrade Jan 21 15:40:49 not onUpdate Jan 21 15:40:58 oh yea, that's what i meant Jan 21 15:41:38 yeah, I don't know what's going on for you then Jan 21 15:42:11 yea, weird Jan 21 15:44:00 the only thing I can think of is that you're not calling your constructor, but I'm sure you're doing that :) Jan 21 15:47:06 yep Jan 21 15:47:46 i even deleted the db via adb, and it will step into the constructor, but not onUpdate or onCreate Jan 21 15:53:25 should i be overriding onOpen or not? Jan 21 15:53:48 it doesn't look like it needs onOpen to call onUpgrade Jan 21 15:54:16 are there instructions for the new VM stuff anywhere? I created a VM but when I tried to use it I get "emulator: ERROR: bad config: unknown platform version: '3'" Jan 21 15:56:09 The new SDK stuff is in a state of flux and doesn't currently work. Jan 21 15:58:48 i see. i was going to run the unit tests against my change. i guess i'll let the reviewer do that :/ Jan 21 16:19:30 in this method: http://pastebin.com/m735aa0ad , will the db and cursor be closed because of their scope, or do the need to be closed still? Jan 21 16:22:52 if your cursor goes out of scope, it's probably safest (and nicest) to just close it anyway. Jan 21 16:22:58 instead of hoping for the best Jan 21 16:23:24 Oh, I see what you did there. Jan 21 16:23:29 yea Jan 21 16:23:36 i'm returning the cursor Jan 21 16:23:59 and if i close the db connection will the cursor close too? Jan 21 16:24:05 well, I would assume that all of the necessary references to whatever database you use will be referenced in the cursor Jan 21 16:24:21 if you close the db connection, the cursor will close. but, you're not necessarily closing the db connection Jan 21 16:24:30 it's just going out of scope, and the reference is ready for garbage collection Jan 21 16:24:38 assuming that the cursor doesn't have a ference to it Jan 21 16:24:40 *reference Jan 21 16:25:04 it get's passed directly to another method which closes the cursor passed into it Jan 21 16:25:42 I would assume that this is all fine Jan 21 16:25:49 but you might want to wait for someone else : ) Jan 21 16:25:53 like this: http://pastebin.com/m74d759ab Jan 21 16:26:11 it works this way... i'm just worried about memory leaking Jan 21 16:29:49 also vol: I was asking earlier why onUpgrade wouldn't be getting called on my SQLiteOpenHelper extended class Jan 21 16:29:59 any suggestions? Jan 21 16:30:18 how to include a custom view in an ArrayAdapter? I have a JSON feed of JSONObjects, and I've created a custom LinearLayout. But I don't see how to a) pass it the ArrayList and b) how to invoke it in the Activity for the ListView Jan 21 16:32:20 at the moment, my code looks like this: http://paste.ifies.org/263 and it works, but all I see is the JSONObject as a String. THis is the ListView item i'd like to look like: http://paste.ifies.org/264 Jan 21 16:33:02 why do you create a class just to inflate an XML? Jan 21 16:33:10 why don't you pass the XML directly to the adapter? Jan 21 16:33:25 also, you will need to override your adapter's getView() Jan 21 16:34:18 romainguy: do you know why onUpgrade wouldn't be getting called when I change the database version? Jan 21 16:36:57 romainguy: i tried just passing the XML like this: aa = new ArrayAdapter(this,R.layout.note_view,friend_array); this is my xml file: http://paste.ifies.org/265 Jan 21 16:50:02 duh, its the adapter i need to extend :| Jan 21 17:37:37 im using execSQL to insert a row, how can i get last_insert_rowid() in the same transaction working? Jan 21 17:40:51 does this work? Cursor lastInsert = db.rawQuery("SELECT last_insert_rowid()", null); Jan 21 17:46:06 mpardo, you may want to use db.insert...() functions as it returns the row id Jan 21 17:46:20 .beginTransaction() Jan 21 17:46:29 .insertOrThrow( blah ) Jan 21 17:46:56 .setTransactionSuccessful() Jan 21 17:47:01 .endTransaction() Jan 21 17:47:12 doh....he left Jan 21 17:48:10 Can anyone tell me if the google maps api can tell you terrain altitude MSL? For example, where I'm at, I'm ~550 feet MSL Jan 21 18:09:06 what controls whether the launcher icon takes you to the top of that apps activity stack, or starts you again from the first one? Jan 21 18:09:16 your app Jan 21 18:09:29 yes but what in the app. i'm trying to figure out why alarm clock and music do it differently Jan 21 18:09:39 and then what the recommended approach is. and then how to ensure my app does it :) Jan 21 18:09:41 check ou the AndroidManifest Jan 21 18:13:14 i did but am still confused, sorry :( the behavior just isn't consistent. for example, if i start alarm clock, then select an alarm, hit home, click alarm then i'm back at the alarm details screen. so it didn't change the task stack. but in music, if i start music, go to an album list view and do the same then either [a] it starts again at the home screen if I have not played anything yet OR [b] if I have a track paused it resets to the ho Jan 21 18:14:11 argh. i restarted my phone and now the behavior is different again Jan 21 18:14:14 that's why you should try to change that behavior in your app Jan 21 18:16:00 so which behavior is correct? it seems that the launcher icon is meant to take you to whatever screen you used last in that app Jan 21 18:16:05 but i've seen the phone not do that Jan 21 18:16:48 hmm. maybe it was just messed up. now i rebooted it i can't reproduce that behavior. the apps are all consistent again. Jan 21 18:17:45 are there any good examples of a persistence layer or orm? Jan 21 18:18:44 I'm running into problems and I need to know how to make my orm use only one db connection Jan 21 18:18:46 TD: both behaviors might be correct, the apps can decide how they behave when "launched" Jan 21 18:19:07 I did not work on these apps so I don't know the rationales behind their workflow though Jan 21 18:19:58 mpardo: did you get your insert row question answered? Jan 21 18:20:12 hrmmm. now i can't reproduce the confusing behavior i saw. so either i was dreaming or 1.0 has a bug where the behavior of the launcher can change. Jan 21 18:20:22 never mind. ignore me. if i see it again i'll investigate. Jan 21 18:20:30 the launcher has NOTHING to do with this Jan 21 18:20:42 I already told you, the *apps* can choose what they want to do when launched Jan 21 18:21:01 BlindOracle: no... and i think the reason i can't get it to return anything but 0 is because I am creating a new instance of SQLiteDatabase every time I do a query Jan 21 18:21:42 BlindOracle: which I shouldn't be doing, but that's how I've been doing it until I figure out the correct method Jan 21 18:22:46 romainguy_: i mean from the users perspective. i understand what you say from the developers perspective, but as an end user the behavior of the phone changed when i restarted it. that can't be right. Jan 21 18:22:51 mpardo: hold on. I answered your questions before I realized you had already left Jan 21 18:22:59 ah ok Jan 21 18:23:03 mpardo, you may want to use db.insert...() functions as it Jan 21 18:23:03 returns the row id Jan 21 18:23:07 .beginTransaction() Jan 21 18:23:10 .insertOrThrow( blah ) Jan 21 18:23:15 .setTransactionSuccessful() Jan 21 18:23:20 .endTransaction() Jan 21 18:23:47 ok Jan 21 18:23:50 i'll take a look Jan 21 18:24:05 ideally, you'll have try { .beginTransaction() ; setTransactionSuccessful() ; } finally { endTransaction() } Jan 21 18:24:26 with your insert in the try block Jan 21 18:24:54 preferably, you'll use insertOrThrow which will prevent the setTransactionSuccessful() call and trigger the endTransaction in the finally block Jan 21 18:24:55 http://pastebin.com/m4f8b8b1b <-- that won't work? Jan 21 18:25:27 mpardo: it may but if it does, it's less an optimal Jan 21 18:25:41 getting a link for you Jan 21 18:25:46 ok thanks Jan 21 18:26:05 i may have to redo my whole orm =S Jan 21 18:26:42 http://code.google.com/p/android/issues/detail?id=1794 and Jan 21 18:27:00 http://code.google.com/p/android/issues/detail?id=1732 Jan 21 18:27:07 will likely be very helpful to you Jan 21 18:27:20 thanks Jan 21 18:27:40 those will give you an idea how to structure and use combined with above comments Jan 21 18:28:24 if you use the insertOrThrow, it returns the inserted row id Jan 21 18:28:38 thusly, you don't have to then turn around an issue another query to obtain it Jan 21 18:28:45 and the parse the cursor Jan 21 18:29:06 this way, you get a row id if the insert worked and no id if it fails Jan 21 18:29:11 no extra work required Jan 21 18:31:35 mpardo: Using the "batchExecSQL" method I provided, you can then build up SQL in your ORM layer and then batch execute it within a single transaction boundary; which is likely what you require for correctness. You don't get that via execSQL. Jan 21 18:32:08 ...via execSQL, in of it self. Jan 21 18:32:23 ah... i see what's going on there Jan 21 18:33:02 mpardo: that help? Jan 21 18:33:14 yes Jan 21 18:33:56 i can't use SELECT statements in the batch though, correct? Jan 21 18:34:36 mpardo: that's just an example to get you running. You do selects and the returned result will reflect the state of the database within the current transaction. Jan 21 18:34:38 nvm... i know what to do now Jan 21 18:34:42 thanks Jan 21 18:35:02 mpardo: the point was to avoid those extra selects by using the insertOrThrow, which returns the row id Jan 21 18:35:15 yep i understand it now Jan 21 18:35:15 thanks Jan 21 18:35:37 np ;) Jan 21 19:40:28 is it possible to play audio out the ear speaker rather than the speakerphone? Jan 21 19:48:46 can I not create a index in sqlite if the column I'm using is a reference to a column on another table...for example: Jan 21 19:50:19 can i add items to a listView without binding to it with a listviewadapater? Jan 21 19:53:11 CREATE TABLE table1 ( _ID INTEGER PRIMARY KEY AUTOINCREMENT, table2_id INTEGER REFERENCES (table2._ID)); CREATE table2(_ID INTEGER PRIMARY KEY AUTOINCREMENT); CREATE INDEX IF NOT EXISTS table12Index ON table1(table2_id); Jan 21 19:53:30 I keep getting an error saying that on creating the index, table2_id does not exist Jan 21 19:53:49 in table1 Jan 21 19:57:38 herriojr: It doesn't exist at that point does it? Jan 21 19:57:59 I create the tables before I create the indexes Jan 21 19:58:44 And its triggering the error from the index, and not the CREATE TABLE 1 statement? Jan 21 19:58:45 unless SQLiteDatabase.execSQL runs Asynchronously Jan 21 19:58:52 correct Jan 21 19:58:59 they are separate execSQL statements Jan 21 19:59:39 hmm, sorry my sql is a little rusty don't know what it could be Jan 21 20:00:51 yeah, mines rusty too since I'm used to dealing with phones which aren't sophisticated enough to have databases :) Jan 21 20:01:49 haha tell me about it Jan 21 20:11:37 romainguy_: sorry, i'm confused again. in the emulator, with logcat, if i start the alarm clock (AlarmClock activity) and then select an alarm i see it says "Starting activity SetAlarm" which is what i'd expect. If I then press home, and click alarm clock icon again, it says "Starting activity AlarmClock" which makes sense, but then on the screen the SetAlarm activity appears. Jan 21 20:11:46 however the contacts app doesn't work this way Jan 21 20:12:18 there the launcher always invokes the DialtactsContactsEntryActivity and the first screen of the app always displays. Jan 21 20:12:33 i can't see any obvious difference in how the activities are defined in the manifests, except that contacts is using an activity alias Jan 21 20:12:54 it has to do with the way the apps manage their own activity stacks Jan 21 20:13:37 "starting activity" in the log just means that the activity manager is going to ensure that that activity (a) is running, and (b) is frontmost Jan 21 20:13:41 [usually frontmost] Jan 21 20:14:04 but the activity may already be running, in which case (a) turns out to be mostly a no-op in the activity manager's processing Jan 21 20:15:27 hrrm, I am getting some weird results from my custom adapter. I'm passing it a JSONArray, and it has a length of 20, but when my activity view is being created, it seems to only loops through teh first 5, three times Jan 21 20:15:34 so what about (b)? if I see Jan 21 20:15:45 oops. if I see "starting activity foo" i'd expect it to pop to the top? Jan 21 20:15:54 digitalspaghetti: in getView() you mean? Jan 21 20:16:28 TD: well, you expect to see its *task* pop up; it's slightly complicated when activities/applications use unusual task management Jan 21 20:16:41 which AlarmClock does -- it uses Intent.FLAG_ACTIVITY_NEW_TASK a lot Jan 21 20:16:50 (when starting its activities) Jan 21 20:17:14 AlarmClock is a pretty awful example application, i'm afraid Jan 21 20:17:23 it does a few things in unfriendly ways. this is one of them. Jan 21 20:18:00 (the other big one is that it forces itself to the front, interrupting the user, rather than using a proper notification to indicate that an alarm has gone off) Jan 21 20:18:08 i'm looking at the AlarmClock code though, and unless this is not what's running inside the emulator, it's not using FLAG_ACTIVITY_NEW_TASK. there's an if (true) { } block, and the false case does, but the true case does not Jan 21 20:18:31 i mean for the AlarmClock -> SetAlarm transition, which is the one i'm testing Jan 21 20:18:39 it just does a regular startActivityForResult Jan 21 20:18:48 hm. i'm looking at the cupcake AlarmClock code and it uses FLAG_ACTIVITY_NEW_TASK when calling startActivity*() a lot Jan 21 20:19:00 oh, specifically for that one? Jan 21 20:19:21 yeah. what i'm doing is, starting the alarm clock, clicking an alarm in the list. the SetAlarm activity pops up Jan 21 20:19:25 ah right Jan 21 20:19:34 so what that does is brings up the SetAlarm activity in the same task Jan 21 20:19:53 then you went Home, i.e. you said "hold on a second while i do something else" Jan 21 20:20:01 romainguy_: i think so. http://paste.ifies.org/267 is my LinearLayout and http://paste.ifies.org/268 is my Adapter Jan 21 20:20:05 then you switched back to AlarmClock, and found yourself back in the state you'd left it Jan 21 20:20:22 SetAlarm isn't a dialog, it's a separate Activity Jan 21 20:20:26 well, i switched back by using the alarm clock icon again, which fired the intent for the very first activity (not SetAlarm) Jan 21 20:20:33 digitalspaghetti: then there's no problem with getView being called only 5 times Jan 21 20:20:56 so what you're saying is, if I start an activity with an intent for activity X, the activity that appears on the screen might be activity Y, if Y was started by X? Jan 21 20:21:06 TD: when you did that, it found the activity you're requesting *already running* Jan 21 20:21:13 romainguy_: no, it's not being called 5 times. here is the log output: http://paste.ifies.org/269 Jan 21 20:21:14 so it shuffled that activity's entire task stack to the front Jan 21 20:21:15 oh Jan 21 20:21:17 and waiting for the result Jan 21 20:21:35 it can't pop the main screen to the top of the z-order, because then that activity would never get a result Jan 21 20:21:35 it never reorders activities within the stack Jan 21 20:21:35 gah Jan 21 20:21:38 it shows a length of 20, but it keeps looping over 0-4 Jan 21 20:21:50 and calls that 3 times Jan 21 20:21:57 that's fine Jan 21 20:22:18 well, but it does with contacts :) this is so confusing. if i hit contacts, pick a contact i'm in the ViewContact activity. now if i press home, hit contacts icon again, then i end up *not* at ViewContact but rather at the first DialtactsEntryContactsActivity again. Jan 21 20:22:24 so it's popped the ViewContact activity off the stack Jan 21 20:22:37 i think this must be related to the startActivityForResult call .... that's what's different between contacts and alarm Jan 21 20:24:31 does that sound right? Jan 21 20:24:41 hrrm, i hate these kinds of bugs Jan 21 20:25:37 digitalspaghetti: it's not a bug Jan 21 20:25:46 it just means that your listivew is laid out three times Jan 21 20:25:53 which can happen for a number of reasons Jan 21 20:26:00 romainguy_: in my app it was a bug that in doing nothing it just suddently fixes itself Jan 21 20:27:32 ctate: the alarm clock doesn't even seem to use the result! it asks for it but there's no onActivityResult defined. Jan 21 20:27:35 no wonder this is so confusing. Jan 21 20:27:39 TD: there is actually no real difference between startActivity() and startActivityForResult() in this area Jan 21 20:27:51 i TOLD you AlarmClock was a crappy example app! Jan 21 20:27:53 awww. Jan 21 20:28:15 Contacts is probably doing much more sophisticated task management than AlarmClock Jan 21 20:28:26 (which uses a separate task for everything *except* SetAlarm) Jan 21 20:28:57 you should probably sit back and think about what sort of history behavior you want to accomplish Jan 21 20:29:01 TD: you can go on #android and blame ttuttle, he worked on AlarmClock :) Jan 21 20:29:01 and work from there Jan 21 20:29:12 (hint: you want the default behavior :) Jan 21 20:29:17 romainguy_: he did? ha ha ha Jan 21 20:29:38 ctate: I blame him for the stupid selection system in the alarms list Jan 21 20:29:42 what romainguy_ said. don't use any of the special task-management flags unless you're positive that you need them. Jan 21 20:30:09 it's easy to accidentally make your app "feel" wrong. just look at AlarmClock. ;) Jan 21 20:32:26 i can't figure out what the default is meant to be. this is why i'm so confused. Jan 21 20:32:30 i don't use any special flags at all. Jan 21 20:32:39 but the way my app behaves is _not_ the same as the way the other apps on the phone behave Jan 21 20:32:50 actually it seems 50/50 whether an app goes to the last screen i used or the first screen of the app Jan 21 20:32:59 don't bother about the other apps Jan 21 20:33:10 alarm and music seem to go to the last screen i interacted with. contacts and my own app restart from the beginning. Jan 21 20:33:22 alarm, music and contacts do their own weird stuff Jan 21 20:33:28 stop comparing your app with them Jan 21 20:34:08 it restarts from the beginning when you've launched a subactivity, then hit Home and relaunched? Jan 21 20:34:11 hm. Jan 21 20:34:14 fine, it doesn't bother me. but as there is no HIG for android the only way to make my app "fit in" is to try and copy what the native apps do. Jan 21 20:34:22 to make them feel right ... Jan 21 20:34:25 ctate: yes Jan 21 20:34:43 ctate: the only way I start activities in my app is with startActivity(new Intent().setClass(...)). the last screen in my app has extras. Jan 21 20:35:38 just checking: if instead of hitting Home you hit Back repeatedly, does it follow the expected activity set back to the Launcher? Jan 21 20:37:15 urgh, no, it doesn't. that's strange. i must have broken something in my last change. it looks like the activity stack just gets longer and longer, and clicking the launcher icon doesn't clear it. Jan 21 20:37:28 i had to back up through quite a few identical copies of some screens to get back to the launcher Jan 21 20:38:09 that sounds suspiciously like you're using some task-related stuff in your manifest Jan 21 20:38:22 Don't Do That(tm). ;) Jan 21 20:38:31 [AlarmClock does. *SIGH*.] Jan 21 20:39:10 i am not. my manifest looks like this: http://pastebin.com/m25dcc51f Jan 21 20:39:30 so 4 activities which define nothing except their name, the first of which has an intent-filter for MAIN/LA Jan 21 20:39:40 MAIN/LAUNCHER. hmm, still not used to this keyboard. Jan 21 20:39:57 TD: your usage of screenOrientation and configChanges just made me cry a little Jan 21 20:40:15 the main activity doesn't need it anymore, i'll delete that. Jan 21 20:40:30 the login activity does. otherwise popping out the keyboard makes the webview reload the whole page for no reason. Jan 21 20:40:53 (the login activity consists of a single web view widget) Jan 21 20:41:32 the other activities force the orientation because otherwise after going to the login activity (which forces landscape) they would stay that way. Jan 21 20:41:57 why do you force landscape on the login activity? Jan 21 20:42:02 login forces landscape because the facebook login page doesn't fit on screen otherwise, and on the G1 they'll have to rotate anyway. Jan 21 20:42:26 so it looks way more professional to have the login screen look the right size by default. rather than scroll half off the screen until you open the keyboard. Jan 21 20:42:42 i realize this will not work well with soft keyboards or devices that do not have a need to rotate the screen to access the keyboard. Jan 21 20:43:38 i'm hoping facebook provide a mobile-screen sized login page at some point before I have to jump this hurdle ... then that hack can go away. Jan 21 20:43:50 huh. i'm kind of weirded out that history seems to be working oddly for you. Jan 21 20:44:33 TD: it certainly does, have you tried the fBook app on Market? it shows the mobile version of the facebook website Jan 21 20:45:00 unfortunately facebook.com the website is not the same thing as facebook connect, the officially approved way to get an API session key. Jan 21 20:45:23 the login screen i display is the second, because i need API access. this app copies friends profile photos into your address book. Jan 21 20:46:31 ctate: :( it seems navigating back to the launcher screen has reset something. now i can't reproduce that behavior. i must be doing /something/ wrong Jan 21 20:46:47 odd. Jan 21 20:47:47 now it works like the alarm app. using the launcher icon puts me back at the last screen. this is all on the emulator, but i had this issue earlier with other apps on my adp1. in that case after restarting the phone the weirdness went away. Jan 21 20:48:57 okay, that's the expected behavior Jan 21 20:48:59 well, i mean, contacts is still not doing the "default" thing, but whatever. i can live with that inconsistency. Jan 21 20:49:05 right, it's doing its own thing Jan 21 20:50:29 if i hit back repeatedly and get back to the launcher, does my app process quit? Jan 21 20:51:05 nope Jan 21 20:51:26 not *necessarily* :) Jan 21 20:51:28 (unless the system decides that it's out of memory and needs to clean up) Jan 21 20:51:40 right Jan 21 20:51:53 the activity gets stopped, iirc Jan 21 20:52:01 so, "it depends", and depends on aspect that you can't control. Jan 21 20:52:06 +s Jan 21 20:53:13 oh, actually the activity gets *finished*. Jan 21 20:53:27 but the process doesn't necessarily get torn down Jan 21 20:54:33 yeah, now no matter what i do i can't reproduce this behavior. weird. at least now i know what the default is meant to be though. Jan 21 20:57:46 now it's back Jan 21 20:57:50 i wonder if this is debugger related Jan 21 20:58:15 i changed my manifest to clean up the eclipse tabs/spaces mess, and took out the orientation attribute on the last two activities to see if they're still necessary. Jan 21 20:58:35 i reran my app and at the last screen, hit the home button and clicked my apps icon again. now i'm back at the first screen. Jan 21 20:58:51 and pressing the back key takes me to the last screen i was at before i pressed home. Jan 21 21:00:02 i think this must be it. i pressed back as far as i could go and clicked my apps icon again. now it's behaving as expected. Jan 21 21:00:15 i bet the behavior is different when the app is restarted from within eclipse. Jan 21 21:00:46 and rewinding all the way to the home screen somehow forces eclipse to let go, and stuff starts behaving normally again. Jan 21 21:01:19 oh, huh Jan 21 21:01:29 that could be. i have no idea what Eclipse does under the covers. Jan 21 21:01:36 and reinstalling on the fly sounds ominous. Jan 21 21:02:37 this is what's printed in the eclipse console when i press "run" Jan 21 21:02:38 http://pastebin.com/m70f83fe9 Jan 21 21:02:52 i had assumed that reinstalling the app would clean up any runtime state associated with it. perhaps not. Jan 21 21:03:08 ohhh .... hmm. the last line looks wrong. Jan 21 21:03:19 yeah, if it's left over in the activity stack at all, Weirdness Ensues. Jan 21 21:03:30 shouldn't it be sending the same intent the launcher would send to start the app? It's actually just sending an explicit comp= intent. Jan 21 21:03:53 to make sure that YOUR activity gets run Jan 21 21:04:01 otherwise you might wind up in the activity chooser Jan 21 21:04:08 i think that's probably fine Jan 21 21:04:36 probably picking the MAIN activity out of your app's manifest and specifying it explicitly Jan 21 21:06:04 reinstalling the app should destroy the current task associated with that app right. it's behaving as if the task stack sticks around and the welcome activity is launched on top. Jan 21 21:25:36 does anyone out there create many custom Dialogs? seems like a pain... Jan 21 21:26:57 looks like once you have started an activity with orientation=landscape, it'll stay in landscape mode until you change it back Jan 21 21:28:51 oh, hmm, maybe not. weird. i wonder why if X is landscape, X+1 doesn't go back to portrait even if i pop the keyboard in/out a few times, but X+2 does. Jan 21 21:37:07 zhobbs: AlertDialog.Builder and Dialog.Builder are your friends Jan 21 21:37:55 Hmm. I'm trying to see where java.lang.Runtime.freeMemory() hooks into Jan 21 21:38:19 the closest thing I found was frameworks/base/core/jni/android_util_Process.cpp, which appears to scrape /proc/meminfo (wtf?) Jan 21 21:42:47 no sysinfo call? no getpagesize() and get_phys_pages() etc ? Jan 21 21:43:36 ctate: can you add EditText, etc to a Dialog like that? Jan 21 21:43:46 yes Jan 21 21:44:03 that's what Home does to rename folders Jan 21 21:44:36 romainguy_: thanks, I'll have to take a look Jan 21 21:44:54 sigh. Where's fadden when you need him? Jan 21 21:58:06 is there a way to make a linearlayout gain scrollbars when needed? the examples i can find online show people building a linearlayout -> scrollview -> linearlayout chain, which seems kinda heavy. Jan 21 21:58:31 put it in a scrollview Jan 21 22:06:54 oh of course, the scrollview can be the root element. i keep thinking the roots have to be <*Layout> tags but that's not the case. Jan 21 22:08:31 you can even use as the root tag Jan 21 22:13:56 hm, only seems to be mentioned in the change notes for m5-0.9 Jan 21 22:37:33 Sigh. Jan 21 22:37:36 Debugger isn't attaching Jan 21 22:37:47 debug is definitely set to true in manifest Jan 21 22:37:51 was debugging just fine before Jan 21 22:37:55 ... Jan 21 22:39:16 clean, build project, restart eclipse, restart emu? :> Jan 21 22:39:33 there we go, restarting eclipse did it Jan 21 22:46:54 apparently restarting Eclipse is the new reinstalling Windows95 Jan 21 22:48:31 reinstalling Windows95 is the new changing your IRQ Jan 21 22:48:55 ddms in the eclipse plugin can get into some wierd states, though Jan 21 23:12:20 Eclipse can actually end up holding a TCP connection open. Jan 21 23:12:33 This makes it impossible to re-attach to a VM. Jan 21 23:12:44 oh hey fadden Jan 21 23:12:45 I don't know if that's what you're seeing. Jan 21 23:12:48 (hey!) Jan 21 23:12:54 16:41 < vol> Hmm. I'm trying to see where java.lang.Runtime.freeMemory() hooks into Jan 21 23:12:57 16:41 < vol> the closest thing I found was frameworks/base/core/jni/android_util_Process.cpp, which appears to scrape /proc/meminfo (wtf?) Jan 21 23:13:06 16:48 < vol> sigh. Where's fadden when you need him? Jan 21 23:13:23 Yeah. That. Jan 21 23:13:29 really? Jan 21 23:13:38 that's uggo :< Jan 21 23:14:04 dalvik/vm/native/java_lang_Runtime.c (cupcake tree -- not sure when I split "native" into pieces) Jan 21 23:14:30 hmm, not looking at cupcake yet Jan 21 23:14:42 still looking at the crusty older branch Jan 21 23:14:43 It's either there or dalvik/vm/InternalNative.c Jan 21 23:15:11 It calls dvmGetHeapDebugInfo() in alloc/HeapDebug.c, which rummages around in the heap stuff. Jan 21 23:15:24 I could once again kiss you Jan 21 23:15:48 I once again pass. :-) Jan 21 23:16:58 :* Jan 21 23:18:39 So, it looks like Runtime.freeMemory only really provides free memory for the dalvik heap? Jan 21 23:19:03 "Returns the amount of free memory in the Java Virtual Machine." <-- spec for Runtime.freeMemory Jan 21 23:19:06 therefor, I shouldn't rely on it for things that I malloc in native code Jan 21 23:19:11 Right. Jan 21 23:19:20 well, I was hoping for voodoo magic where you're really providing total memory available Jan 21 23:19:29 i.e. "oh man I'm sick of writing more code" Jan 21 23:19:53 No such luck. The native malloc() will just keep grabbing memory until you run out of physical pages. (I don't think we have a ulimit set.) Jan 21 23:20:01 ho hum Jan 21 23:20:11 yeah, we've run into an issue with running way out of memory lately Jan 21 23:20:18 we know what causes it, we just don't quite know WHY. Jan 21 23:20:31 Have you tried "procrank"? Jan 21 23:20:42 well, it runs out of memory really, really, really fast. Jan 21 23:21:56 also, can't seem to find any info about procrank Jan 21 23:21:57 Are you building from source? (I can't remember) Jan 21 23:22:01 no Jan 21 23:22:09 if you mean android Jan 21 23:22:15 we're using stock images Jan 21 23:22:17 There's a libc with malloc debugging enabled, called libc_debug.so. Jan 21 23:22:22 It's not installed by default. Jan 21 23:22:34 If you install it and set a magic flag, you can view the contents of your native heap in DDMS. Jan 21 23:22:51 hmm. Jan 21 23:23:27 "procrank" scans /proc/maps and does some fancy formatting Jan 21 23:24:40 * fadden notices that procrank doesn't actually work on cupcake... whoops. Jan 21 23:25:35 adb shell ls "/system/lib/*debug*" <-- shows have or have not Jan 21 23:26:18 nope Jan 21 23:26:32 I actually just got a dev device today Jan 21 23:26:40 we've been using the emu as our debug method Jan 21 23:26:44 Not on emulator either? Jan 21 23:26:47 nope Jan 21 23:26:52 this is I think rc1 windows build Jan 21 23:27:32 https://bugs.eclipse.org/bugs/show_bug.cgi?id=179384 <-- eclipse bug mentioned earlier Jan 21 23:27:53 I believe you : ) Jan 21 23:28:24 before I go and build the thing, is there really no Cursor where, when given a list of cursors and a list of columns from each to compare, it will sort them? Jan 21 23:29:38 hmm, for some reason I can't always setTitle(...) and setSummary(...) in Preference.onBindView(...) Jan 21 23:29:47 sometimes it works, sometimes it doesn't Jan 21 23:33:55 ahh...gotta call super.onBindView() after I setTitle/Summary Jan 21 23:51:45 phew my project is almost done, time for a new one! **** BEGIN LOGGING AT Thu Jan 22 01:14:15 2009 Jan 22 01:58:53 the first time i start my app (on a g1) traceview says that a single call to Resources.getTimeZonesNative takes 1500ms. does this seem normal? Jan 22 02:35:58 hey guys, i am gaving some problem commiting data to the sharedPreferences Jan 22 02:36:05 anyone knows anything about i t? Jan 22 02:38:02 what is the problem? Jan 22 02:42:23 so i did getSharedPreferences(REFERENCE_NAME, Context_private); Jan 22 02:42:47 then i get the editor to put int and string and other data Jan 22 02:42:52 then i did commit Jan 22 02:42:59 but every time the commit returns false to me Jan 22 02:44:49 does the commit actually happen? (even tho it returns false) Jan 22 02:45:03 http://groups.google.com/group/android-developers/browse_thread/thread/fd23e97e014116a8/e30c76f7a59b1869?lnk=gst&q=SharedPreferences+commit#e30c76f7a59b1869 Jan 22 02:45:51 argh, somehow i didn't come across that thread when i was searching for it Jan 22 02:45:54 let me look over it Jan 22 02:45:56 thanks! Jan 22 02:46:14 np Jan 22 02:49:22 umm actually, i am not able to read the values back Jan 22 02:49:56 morgan: i do a SharedPreferences.contains(KEY) right after commit and it returns false Jan 22 02:54:45 is this on the emulator? Jan 22 02:55:02 on the phone Jan 22 02:55:30 did you try with MODE_WORLD_WRITEABLE ? Jan 22 02:55:37 not yet Jan 22 02:55:46 let me try Jan 22 02:57:20 yea tried that and still false when i do a contains Jan 22 02:58:42 does /data/data//shared_prefs/ contain anything? Jan 22 02:59:03 can we access the data folder? Jan 22 02:59:52 yes, by using adb **** ENDING LOGGING AT Thu Jan 22 02:59:57 2009