**** BEGIN LOGGING AT Tue Feb 24 02:59:57 2009 Feb 24 03:42:25 where do you set what shows up when a ListView is empty? Feb 24 03:44:09 KNY: if you have a layout with id @android:id/empty and use a ListActivity, it shows automagically ;) Feb 24 03:44:23 also the listview needs to be id @android:id/list Feb 24 03:44:39 throw em both in a framelayout fill_parent, and center gravity on the empty textview Feb 24 03:44:47 or use whatever layout you want for the empty Feb 24 03:45:02 jsharkey, I'm using a ListActivity but my XML just defines what shows up per row Feb 24 03:45:56 KNY: http://code.google.com/p/android-cookbook/source/browse/trunk/TunesControl/res/layout/gen_list.xml Feb 24 03:46:19 so if youre already using ListActivity, you just need to add something with that @android:id/empty id Feb 24 03:46:30 ListActivity will take care of showing/hiding it automatically for you Feb 24 03:47:12 jsharkey, alright, I'll look into it. Googling for "android listview empty" didn't turn up much. thanks for the link Feb 24 04:06:40 anyone figure out why i still can't see the pay apps? Feb 24 04:17:43 how can I make the label for a checkbox be on the left of the box instead of the righ? Feb 24 04:17:45 right* Feb 24 04:20:37 i'm writing an app with a background graphic... the app has a list view.. when I scroll on the list view the background graphic disappears... how do I make that stop disappearing? Feb 24 04:24:18 ah.. found the issue.. http://www.curious-creature.org/2008/12/22/why-is-my-list-black-an-android-optimization/ Feb 24 04:24:22 yay google! Feb 24 04:24:34 courtesy of romainguy_ Feb 24 04:28:41 well, what can I say except <3 romainguy_ Feb 24 04:44:30 KNY, rsteckler: evening Feb 24 04:44:39 mfisch, hey Feb 24 04:58:33 KNY: can I run an idea by you regarding my app? Feb 24 04:58:45 go for i Feb 24 04:58:46 t Feb 24 05:00:57 KNY: for my app I will be importing my data from an external data source, so I was thinking of using a script to basically take the data and write it as a big SQL insert query Feb 24 05:01:08 KNY: and then have my java code run it Feb 24 05:01:35 KNY: any thoughts on that idea? Feb 24 05:02:04 I do just that for CSV importing in one of my apps Feb 24 05:02:30 KNY: your app takes CSV as input? Feb 24 05:02:49 optionally, yes Feb 24 05:03:41 KNY: that would be easier for my scripts to do and the java can do CSV to sQL Feb 24 05:04:01 mfisch, yeah Feb 24 05:04:10 I use OpenCSV for the CSV processing Feb 24 05:04:32 KNY: cool Feb 24 05:33:35 KNY: I added a button, but when I try to registry the handler, I'm getting a null pointer exception Feb 24 05:33:51 KNY: button = findViewById(blah) Feb 24 05:34:00 KNY: button.setOnClickListener() Feb 24 05:34:17 (I know why the null pointer exception occurs obviously) ;) Feb 24 05:37:26 well, you need to cast the result of findViewById() Feb 24 05:37:29 but I assume you're doing that Feb 24 05:37:59 KNY: yeah, sorry, this button was working before in my old test app, so that part is solid. something about the XML piece that I dont get Feb 24 05:38:18 is your ID correct? Feb 24 05:38:43 KNY: wait, I think I see it, hold on Feb 24 05:38:43 can you pastebin the XML for the button and the java code that's causing problems? Feb 24 05:38:46 ok Feb 24 05:42:31 KNY: for one thing I had it in the wrong XML file Feb 24 05:42:41 KNY: just playing with Notepad and it has several different views Feb 24 05:42:59 haha Feb 24 05:44:12 KNY: hmm, still mad at me, lemme load pastebin Feb 24 05:45:19 KNY: http://pastebin.com/m2be57ce1 the piece is the only thing in the original Feb 24 05:49:00 mfisch, and the Java? Feb 24 05:49:15 KNY: oh, sorry, 1s Feb 24 05:49:34 yikes, absolute positioning? Feb 24 05:49:35 KNY: it was pretty simple: Button button = (Button)findViewById(R.id.button_more_recipes); Feb 24 05:49:48 KNY: just messing around, I'm up for changing anything Feb 24 05:49:58 mfisch, you're loading the correct XML file? Feb 24 05:50:13 KNY: I believe that to be the "main" view Feb 24 05:50:27 mfisch, it goes by the XML filename Feb 24 05:51:12 KNY: I am obviously missing something very fundamental, what do you mean? ;) Feb 24 05:51:25 If I was any more clueless, I'd run for Congress Feb 24 05:51:49 what's the name of that XML file? Feb 24 05:51:55 (the filename) Feb 24 05:52:54 note_editor.xml Feb 24 05:53:28 so you should be setting setContentView(R.layout.note_editor) Feb 24 05:55:02 KNY: ah, okay, this isn't the right XML again, hold on ;) Feb 24 06:01:26 KNY: thanks I think I have it figured out Feb 24 06:01:29 bedtime here though Feb 24 06:01:40 excellent. Feb 24 06:02:56 KNY: g'night Feb 24 06:02:59 KNY: thx Feb 24 06:03:05 no problem, mfisch Feb 24 06:27:30 Not sure how to approach this. I have a class that extends View and it's onDraw puts up a Drawable. I want to put that View in an activity's xml layout file, and use it as the "background" of my activity... Feb 24 06:27:49 Then everything else in the activity would float on top with alpha Feb 24 06:28:18 Right now I just have the activity setContentView(theBackgroundView); Not sure where to go from there. Feb 24 06:44:21 Got it. For anyone else curious, it's FrameLayout Feb 24 06:50:38 rsteckler: not sure if youre doing any custom work in the onDraw, but would android:background work in the layout? Feb 24 06:51:02 it takes any drawable, including 9-patches Feb 24 06:51:07 I'm doing animation in the onDraw. Feb 24 06:51:30 So I can't just throw up a static drawable as the background Feb 24 06:51:34 just a transition animation, or a constantly changing one? Feb 24 06:51:35 It's working well now, though Feb 24 06:51:41 constantly changing. Dynamic Feb 24 06:51:44 ah cool :) Feb 24 06:52:17 Relatively performant. I think my background thread is killing teh animation perf, though Feb 24 06:52:33 I wish I could specify thread priority or something - I'll have to look into if that's possible Feb 24 06:52:50 it is possible, but probably better to just let invalidate help with the drawing Feb 24 06:53:41 What I'm doing now is having the onDraw so a "step" of the animation, then just call invalidate() Feb 24 06:53:52 It seems a little dirty, but it works... Feb 24 06:53:55 hmm Feb 24 07:12:41 Yea - I added a .9.png with some text in a custom control on top of the animating background, while another thread is busy grabbing massive amounts of memory and network. Things are starting to get a bit slow in my screen updates. Feb 24 07:13:21 Wonder if perf would improve by moving to opengles... Feb 24 07:13:36 Or is animation on a drawable already hardware accellerated? Feb 24 15:11:16 screen rotation question: I have a Spinner that has an OnItemSelectedListener which is used to populate other fields in a form. I'm using the onRetainNonConfigurationInstance() method (courtesy of romainguy_ ) to save/restore the form, but the OnItemSelectedListener isn't being called until after I rebuild the form Feb 24 15:11:31 which wipes out the changes that I already restored. How can I get around this? Feb 24 15:57:19 when a content provider is called, is the provider created for each unique thread, unique package, or every object uses the same one? Feb 24 16:13:22 anyone have a good strategy for creating an EditTextPreference with 2 EditTexts? Feb 24 16:27:27 can anyone see why I might be getting this: http://paste.ifies.org/382 in this code: http://paste.ifies.org/383 Feb 24 16:27:44 basically as I fetch podcasts, I want to send a notification to the notification manager Feb 24 16:42:15 digitalspaghetti, is m_Notification properly initialized? Feb 24 16:43:14 yes, in onCreate I do setNotification(new Notification(R.drawable.icon, "Fetching Podcasts", System.currentTimeMillis())); Feb 24 16:46:35 bahh, i was passing null for the PendingIntent Feb 24 16:53:48 ok, so when using an SQLiteOpenHelper in my ContentProvider, am I not supposed to close the database after the insert/update/delete/query is done? Feb 24 16:54:43 I'm just trying to make sure I'm not leaking memory if I don't close it Feb 24 16:55:08 b/c when I close it, it causes exceptions when I have multiple threads acting on it Feb 24 16:55:15 acting on the ContentProvider that is Feb 24 17:14:01 herriojr, no, I believe it's all done through managedQuery() Feb 24 17:48:41 KNY: I'm talking about the SQLiteDatabase object, not the Cursor object Feb 24 17:48:54 KNY: do you happen to know about that? Feb 24 17:49:39 I believe you don't close either one Feb 24 17:49:46 unless you opened it Feb 24 18:11:17 KNY: in the content provider, I do open it, but I guess it needs to stay open for the cursor? Feb 24 18:11:53 I believe so Feb 24 18:11:56 ok Feb 24 18:12:01 that makes a lot of sense then Feb 24 19:04:23 is the "geo" command in the 1.1 SDK? Feb 24 19:51:47 <_avatar> is there a way to determine which type of mobile network (EDGE, 3G, etc) the device is currently connected to? I see ConnectivityManager.getNetworkInfo(), but NetworkInfo.getType() apparently only returns TYPE_MOBILE or TYPE_WIFI. Feb 24 19:56:03 _avatar: try .getExtraInfo() Feb 24 19:57:46 looks like the StatusBarPolicy uses .getNetworkType from a TelephonyManager Feb 24 19:58:08 (if it's mobile) Feb 24 19:58:43 (TelephonyManager)Context.getSystemService(Context.TELEPHONY_SERVICE) Feb 24 19:59:11 <_avatar> awesome, looks like TelephonyManager is where i should be looking! i see NETWORK_TYPE_EDGE, etc Feb 24 19:59:24 <_avatar> thanks :) Feb 24 20:17:25 Hi! Feb 24 20:18:08 Anybody used HttpPost on android? Feb 24 20:28:09 Anybody used HttpPost on android? Feb 24 20:39:06 MikHel: yes Feb 24 20:39:53 actually, no...I've done HTTP POST's, but guess I don't use the HttpPost class Feb 24 20:40:13 i've got a list with 20 views that have pics and some text. when the top few are displayed it constantly reloads the views from the adapter. Feb 24 20:40:51 and when i scroll down it will still try to reload the top few whenever i scroll enough to see a new item. Feb 24 20:41:02 what would cause this? i'm not sure how to debug it Feb 24 20:43:17 zhobbs_: I solved my problem. Was an authorization I had forgotten... Feb 24 20:43:19 :) Feb 24 21:45:16 taaz: a miriad of things could cause it Feb 24 21:46:03 depends on what kind of adapter, whether there is something that tells the view to invalidateViews or the dataset has changed, etc. Feb 24 21:46:50 taaz: is there anything that you have constantly running in a loop, like a recursive handler Feb 24 21:47:59 or actions onFocus Feb 24 22:06:44 herriojr: it's based off the efficient list adapter and starts up a UserTask to load and set the image Feb 24 22:09:03 i need to investigate some weirdness related to the actual setting of the image. Feb 24 22:09:58 if i don't actually try and set the image in the list item then it doesn't seem to do the crazy reloads at all. Feb 24 22:18:42 taaz: you can check how I did in code.google.com/p/shelves Feb 24 22:21:40 romainguy_: already done that. i'm stealing bunches of code from your fine apps :) Feb 24 22:23:11 i obviously failed to integrate various pieces of code properly though Feb 24 22:27:37 ^^ Feb 24 22:30:56 is there an example somehwere that does the Market app behavior of loading more data when you hit the bottom of a list? Feb 24 22:32:32 just use onScroll Feb 24 22:38:51 ok. thanks. Feb 24 22:40:01 romainguy_: hmm, bummer, TabHost does not permit you to do an adapter style binding to the content layout Feb 24 22:40:32 that is, having just 1 view allocated for the framelayout and just binding data to it on tab selection Feb 24 22:41:16 ita lmost does, except setContent(TabContentFactory) is wrapped with logic which prevents it. Feb 24 22:42:21 well, actually i misspoke. you could implement it with just 1 child view with that, but you couldnt do anything more fancy like use a ViewSwitcher and have exactly two children Feb 24 22:42:38 which is actually what im doing ;P Feb 24 22:43:41 TabHost/TabWidget seems like a weak widget in general. it's not stylable and is very inflexible compared to other widgets Feb 24 22:44:38 TabWidget pretends like its stylable, but then when you get into it you realize that TabHost actually hardcodes a layout and background drawable and does not respect the current theme for any of it. Feb 24 22:47:16 we had absolutely no time to work on it Feb 24 22:47:21 and nobody's working on it Feb 24 22:59:59 fair enough Feb 24 23:00:13 its good to know that my assessment is at least correct. Feb 24 23:00:22 maybe ill fix it. :) Feb 25 00:01:00 what is the best way to test how an app behaves in low memory conditions? Feb 25 00:02:37 eat memory? Feb 25 00:03:15 morganx: usually running large apps like Browser and Maps is enough Feb 25 00:03:54 [16:04] morganx: usually running large apps like Browser and Maps is enough Feb 25 00:03:57 oops Feb 25 00:04:16 morganx: /bin/kill :) Feb 25 00:27:09 jasta: /system/bin/kill... and that only works w/ the emulator or a dev phone :D Feb 25 00:48:56 zinx: yes, but it is the best way to test how an app behaves in low memory conditions. Feb 25 00:49:24 he didn't ask about using a G1 to test... Feb 25 00:52:44 Easy way to soak up a fantastic amount of memory: android.os.Debug.startMethodTracing("/sdcard/whatever.trace", 32*1024*1024); Feb 25 01:22:34 <_avatar> how can I apply the style used by an AlertDialog "message" TextBox to one of my own TextBox instances? Feb 25 01:45:03 what code do i use to connect to a different wifi ssid? Feb 25 01:46:36 <_avatar> nevermind about my question, got it Feb 25 01:48:22 _avatar: can you help em? Feb 25 01:48:26 me* Feb 25 01:48:39 AakashPatel: have you looked at WifiManager? Feb 25 01:48:47 jsharkey: ya i have Feb 25 01:48:51 over and over and over lol Feb 25 01:49:35 <_avatar> WifiManager.enableNetwork looks promising. but i don't know, i've never done it. Feb 25 01:50:06 ideally you'll addNetwork() then enableNetwork() Feb 25 01:50:09 <_avatar> WifiManager.getConfiguredNetworks() returns a list, then you'd select one, and use WifiManager.enableNetwork() Feb 25 01:50:18 <_avatar> but again, i don't know, i've never done it. i'm just looking at the docs Feb 25 01:50:43 _avatar: yep that sounds right Feb 25 01:51:51 what do i put in the ( ) Feb 25 01:51:55 ... Feb 25 01:52:11 sorry...i barely know java(at all) Feb 25 01:52:21 <_avatar> you need to learn the language, then Feb 25 01:52:32 _avatar: im trying Feb 25 01:52:38 <_avatar> sorry to be blunt, but you're just going to spin your wheels until you understand how things work Feb 25 01:52:50 wifi().addNetwork(config); Feb 25 01:52:50 * jsharkey agrees with _avatar Feb 25 01:53:14 AakashPatel: very few people on irc will have the time to walk through everything Feb 25 01:53:23 i know :-( Feb 25 01:53:38 ive just been tryin for a few days...so needed help Feb 25 01:54:02 keep playing around on your own, you'll figure it out eventually :) Feb 25 01:54:40 <_avatar> get a book on java and read it. if you can't afford to buy one, thinking in java is free and available on the net Feb 25 01:54:49 <_avatar> it's probably not the best book, but it's what i used to get started Feb 25 01:55:05 yawn Feb 25 01:55:08 wifi().enableNetwork(netId, disableOthers); Feb 25 01:55:25 do i make a variable called "netId"? Feb 25 01:55:40 and make the value my SSID? Feb 25 01:55:47 AakashPatel: you clearly don't have any experience writing code, let alone java. you should not begin with android if that is the case. Feb 25 01:57:24 i know Feb 25 01:58:52 ok...then can someone help me on this...if i see code with whatever(test, test1); Feb 25 01:59:09 what are teh "test" and "test1" Feb 25 01:59:14 are they varibles? Feb 25 02:13:43 hi Feb 25 02:13:55 I am having problems with play some little wv files in android Feb 25 02:13:59 could you drop me a line Feb 25 02:14:05 any online tutorial maybe... Feb 25 02:19:25 waht does this line of code mean? if (ap.SSID.equals("Test1")) { Feb 25 02:19:27 publicLevel = ap.level; Feb 25 02:19:28 } else if (ap.SSID.equals("Test2")) { Feb 25 02:19:30 privateLevel = ap.level; Feb 25 02:19:32 dang Feb 25 02:19:33 too big Feb 25 02:27:47 KNY: a question for you on Listviews Feb 25 02:28:47 KNY: the notepad example makes the main view the list of notes Feb 25 02:29:27 KNY: so when I added my button in the XML it ended up on each note Feb 25 02:30:47 KNY: what I'm missing is that there is no setIntent that says "use the list as my Intent" Feb 25 02:31:42 mfisch: are you trying to make a delete button? Feb 25 02:32:37 mfisch: usually with listview items, you want the primary action to be ListView.setOnItemClickListener(), and then put secondary actions in a context menu Feb 25 02:32:40 jsharkey: I am just playing with the notepad example and I wanted to have the layout be Note Note Note .... with a button on the bottom Feb 25 02:33:06 jsharkey: I'm trying to add a "global" button that would take the bottom 10% of the screen, roughly Feb 25 02:33:06 oh, just a button on the bottom of the original layout, not in each listitem Feb 25 02:33:10 ah cool Feb 25 02:33:12 jsharkey: yeah Feb 25 02:33:20 can you link me in that direction? Feb 25 02:33:29 jsharkey: ? Feb 25 02:33:32 youll probably want to find the layout that has the Feb 25 02:33:49 and make sure its wrapped inside of a vertical LinearLayout Feb 25 02:34:01 then android:layout_weight="1" on the ListView Feb 25 02:34:48 jsharkey: what does that do? Feb 25 02:35:53 so youll be putting both yuour ListView and Button in a vertical layout Feb 25 02:36:23 the weight on listview says "let this widget fill the screen using any remaining space" whcih will bumpt the button to the bototm of screen Feb 25 02:36:30 jsharkey: nobody will believe me but the Notepad example doesn't have the Listview anywhere in the XML layout files Feb 25 02:36:39 lol Feb 25 02:36:41 holon Feb 25 02:36:47 there is a TextView Feb 25 02:37:17 mfisch: is this WikiNotes, or where did it come from? Feb 25 02:37:29 jsharkey: I think from the Google, lemme get you a URL Feb 25 02:37:39 oh, notepad Feb 25 02:37:45 jsharkey: http://code.google.com/android/intro/tutorial.html Feb 25 02:38:01 jsharkey: exactly Feb 25 02:38:27 mfisch: its step 4 in exercise 1 Feb 25 02:38:32 whatever that layout is Feb 25 02:38:37 jsharkey: ok lemme look Feb 25 02:38:42 its already got the ListView and TextView inside of it Feb 25 02:39:08 thats a little odd how they put the TextView there for when its empty Feb 25 02:50:35 Deer googel. I'd liek sum mor heep space for chrismas. kthx. - ryan Feb 25 02:51:11 loading large pictures is challenging on the android. Feb 25 02:53:19 Drawable.createFromStream is failing with Feb 25 02:53:35 02-24 18:51:03.365: ERROR/dalvikvm-heap(22213): 1572864-byte external allocation too large for this process. Feb 25 02:53:35 02-24 18:51:03.365: ERROR/(22213): VM won't let us allocate 1572864 bytes Feb 25 02:53:41 02-24 18:51:03.365: DEBUG/skia(22213): xxxxxxxxxxxxxxxxxxxx allocPixelRef failed Feb 25 02:53:42 02-24 18:51:03.365: ERROR/AndroidRuntime(22213): java.lang.OutOfMemoryError: bitmap size exceeds VM budget Feb 25 02:53:46 02-24 18:51:03.365: ERROR/AndroidRuntime(22213): at android.graphics.BitmapFactory.nativeDecodeStream(Native Method) Feb 25 02:53:46 02-24 18:51:03.365: ERROR/AndroidRuntime(22213): at android.graphics.BitmapFactory.decodeStream(BitmapFactory.java:304) Feb 25 02:53:46 02-24 18:51:03.365: ERROR/AndroidRuntime(22213): at android.graphics.drawable.Drawable.createFromStream(Drawable.java:635) Feb 25 02:54:29 ddms reports 1.3megs free. Attempting a 1.5 meg allocation seems unfortunate - I guess the drawable needs to keep the entire decoded imaeg in memory for display **** ENDING LOGGING AT Wed Feb 25 02:59:57 2009