**** BEGIN LOGGING AT Sat Nov 29 02:59:57 2008 Nov 29 04:30:15 Good evening #android-dev. Nov 29 11:02:04 trying to run http://pastebin.com/d659834cf in logCat always getting No window to dispatch, also i'm asking in order to run a client should i use another emulator instance and if yes how to do it from inside eclipse ? please correct me if i'm missunderstanding anything Nov 29 11:02:26 well Nov 29 11:02:32 you are blocking the application's main thread Nov 29 11:02:34 that's bad :) Nov 29 11:04:59 some more details , all what i tried to do is running appServer from eclipse run configurations, and then selected the application from the emulator's applications menu, please tell me what am i doing wrong Nov 29 11:05:40 like I said, you are blocking the application's thread Nov 29 11:05:53 you prevent your own application from running Nov 29 11:07:04 romainguy_, even i didn't get any of the output test statments in logCat Nov 29 11:07:04 romainguy_, and how to unblock it Nov 29 11:07:06 all the code you have that listens for Sockets to connect should happen on a separate thread Nov 29 11:08:05 romainguy_, what do you mean by happen on a separate thread, then which thread that it's currently used ? Nov 29 11:08:31 you have to create a new thread and run your code in that new thread Nov 29 11:08:41 otherwise you will prevent the user interface from ever being displayed Nov 29 11:08:49 and no event will be dispatched to your application Nov 29 11:08:57 romainguy_, trying to restart the application solve it , or is there a specific way to assign a thread to my application ? Nov 29 11:09:14 before going any further you should read tutorials on how to use Threads Nov 29 11:09:17 and especially in Java Nov 29 11:10:46 romainguy_, this code http://pastebin.com/d58068c0c can manage the thread usage Nov 29 11:11:42 yep that's it Nov 29 11:13:20 romainguy_. also i'm asking in order to run a client should i use another emulator instance and if yes how to do it from inside eclipse ? please correct me if i'm missunderstanding anything Nov 29 11:13:52 you can run a second emulator from the SDK directory Nov 29 11:13:56 no need to start it from Eclipse Nov 29 11:16:03 romainguy_, trying to build the code i posted recently^^, got The method run() of type OutgoingWriter must override a superclass method, quick fix available: Remove'@Override' annotation, i'm asking if i have to fix this way and what is this '@Override' ? Nov 29 11:16:28 you should learn Java before going further :) Nov 29 11:19:09 romainguy_, k but what's @Override :) ? Nov 29 11:19:34 learn Java :) Nov 29 11:22:27 can i include 2 classes in one single file >? Nov 29 11:23:10 you can if you create an inner class Nov 29 11:23:13 a class inside the class Nov 29 11:29:37 :( Nov 29 11:33:03 romainguy_, any clue one where to read about @Override ? Nov 29 11:40:10 romainguy_, what's pokeWakelock() Nov 29 11:40:26 get thee to a nunnery Nov 29 11:40:37 or in case an nunnery is not available go to #java Nov 29 11:49:50 any comment on this -> WindowManager No focus, dropping: KeyEvent{action=0 code=20 repeat=0 scancode.. Nov 29 11:51:55 romainguy_, still getting "No window to dispatch pointer action 1" Nov 29 11:57:55 Awhile ago I saw a project on googlecode to port android to be a Firefox plugin. Nov 29 11:58:15 I cant find it now. Nov 29 12:53:40 always i'm getting application not responding and prompt to wait to force close even if i wait a lot of time, any comment ? also i'm asking how to change the default activity ? Nov 29 12:55:12 Process com.android.phone is not responding 'Force close' 'wait' Nov 29 12:55:30 That doesn't sound good. Nov 29 12:56:00 jbq, so ..? Nov 29 12:56:23 what are you doing when this happens to you? Nov 29 12:56:40 jbq, when i hit wait i got a blank black emulator's screen Nov 29 12:57:05 ah, on the emulator. How fast is your computer (and how much memory?) Nov 29 12:57:51 jbq, intel atom proc./ 1G of RAM Nov 29 12:59:37 jbq, Activity (in application) is not responding Nov 29 12:59:37 in logCat -> WindowManager No focus, dropping: KeyEvent{action=0 code=20 repeat=0 scancode.. Nov 29 12:59:45 The atom might be a bit light to run the emulator as fast as a real device, so it's quite possible that you'd hit timeouts on the emulator that wouldn't trip on the device. 1GB is tight but should still be enough. That being said, even on the emulator those should be transient, so there might be something more sinister going on, but I don't know what. Nov 29 13:00:14 dalvikvm Wrote stack trace to '/data/anr/traces.txt' Nov 29 13:02:19 jbq, any way to check that wha's going on ? Nov 29 13:02:21 To be brutally honest, this might not get a whole lot of attention since it only happens on the emulator. Still, if you grab the output of "adb bugreport" and attach it to a bug report at b.android.com it might get looked at. Nov 29 13:02:56 jbq, how to adb bugreport ? Nov 29 13:03:34 Do you know how to run adb in general? Nov 29 13:03:54 jbq, no Nov 29 13:04:41 oww. that might be heavily machine-dependent, so I'm not quite sure how to guide you through the steps. Nov 29 13:04:52 jbq, i tried adb bugreport from the command line i got a lot of outputs Nov 29 13:05:07 ok, that's expected. it's typically a few hundred kB long. Nov 29 13:05:14 that means that it's working. Nov 29 13:05:24 jbq, so Nov 29 13:06:20 There's plenty of information in there that could help someone piece together what happened, but it's not something that can be figured out without a fair bit of background knowledge about the system, so it's unlikely that you'd find many people who could help you there. Nov 29 13:07:07 does anyone offhand know how to manually kill off a process/application in the same manner android would if it was trying to reclaim memory? I'm trying to debug a problem and trying to accelerate the process if I can. Nov 29 13:07:43 there's information about which specific app caused the problem, what the system was trying to make that app do, which apps were running at the time, what each app was doing, etc..., and some of that information often gives good hints about what might have been going on, but it's still detective work. Nov 29 13:08:20 ismarc: run the browser, open half a dozen tabs on "large" pages (bbc, espn, cnn, nytimes...) Nov 29 13:08:40 ismarc: that should put enough memory pressure on the system to start to make it kill processes. Nov 29 13:09:04 jbq: awesome, I've obviously been up to long because I didn't even think of that Nov 29 13:09:55 That being said, when the system kills processes it looks close enough to a SIGKILL that if you can just do that you'll have a close approximation (it may or may not be possible depending on the environment you're on). Nov 29 13:10:02 i was asking how to change the default activity ? Nov 29 13:11:35 I'm not quite sure what you mean by "default activity". Nov 29 13:12:01 jbq, you are using eclipse ? Nov 29 13:12:07 f00bar80: nope. Nov 29 13:12:27 I'm a vi + make guy. Nov 29 13:12:49 nevermind, it's the application main class extending the android activity Nov 29 13:13:39 Doesn't the android plugin for eclipse create a simple hello world app automatically in which you can see how the manifest and the main/launcher activity are setup? Nov 29 13:14:26 yes Nov 29 13:17:05 i got the hello activity sample working correctly Nov 29 13:19:14 From there you should be able to create a similar subclass of Activity, register it in your manifest, and it should show up on the home screen along with the other apps. But I'm not quite sure that's what you're asking. Nov 29 13:20:28 What's meant by Launch timeout has expired, giving up wake lock! , Activity idle timeout for HistoryRecord {4344ada8{my.package.name.. Nov 29 13:21:44 I'd say that your activity took too long to respond to the system when you launched it, so the system gave up and allowed the CPU to go back to sleep. Nov 29 13:23:30 When the system has stuff that your application should react on (e.g. launching your app), the system prevents the CPU from going to deep sleep until your app has had a chance to respond, but the window is only a few seconds. Nov 29 13:26:02 how to get all the applications available Nov 29 13:26:12 on the emulator Nov 29 13:26:35 I think there's an API in the package manager for that, but I don't know the details. Nov 29 13:26:56 I'm gonna have to go, sorry I can't help you any further. I hope you can figure it out. Nov 29 14:56:11 how do i get a pointer to a local service i started? Nov 29 15:18:17 or rather, how do i communicate with it... i guess i still have to bind to? Nov 29 19:47:21 anyone worked with listview? i've managed to get mine all mangled up. Nov 29 19:52:41 displays fine, but gets all mangled while scrolling (until it stops for a few, then it redraws fine) and i can't get dividers to work Nov 29 21:24:30 Disconnect: define "mangled" Nov 29 21:26:14 its a 2-line list using simplecursoradapter. when i scroll, the top line turns black and the bottom scrolls normally. (works fine on emu). clicking doesn't highlight unless i set the selectorontop to true (in which case it just prints a giant orange box overtop of everything - as expected, but not ideal) Nov 29 21:26:37 did you set a background on your list? Nov 29 21:26:45 yes Nov 29 21:26:59 then you have to disable the cache color hint as well Nov 29 21:27:01 and removed it from all the sub-drawables Nov 29 21:27:08 ahh ok Nov 29 21:29:09 cool deal that fixed the scrolling. :) Nov 29 21:29:34 how about getting a divider working? any hints? Nov 29 21:29:46 there's nothing to do to make dividers work Nov 29 21:29:48 they work by default Nov 29 21:30:45 heh. i set divider="#FF0000" dividerHeight="10px" and nada. (extreme examples, but it should do -something-) Nov 29 21:31:10 dividers made of a simple color won't wokr Nov 29 21:31:13 known bug, fixed Nov 29 21:31:29 you can use a simple 9 patch instead Nov 29 21:31:36 ahh. so "they work by default except.." :) Nov 29 21:31:51 simple 9 patch? Nov 29 21:31:55 no they work by default, period Nov 29 21:31:59 the default listview has dividers Nov 29 21:32:50 not trying to pick a fight. what am i missing? if i leave the divider options out, i get no dividers. Nov 29 21:37:42 I don't know what you're doing to poor ListView, but it's supposed to have dividers by default (like you can see in pretty much every list in the system, like the Contacts list) Nov 29 21:39:07 heh Nov 29 21:40:19 http://pastebin.ca/1270555 and it acts the same with or without android:divider. (actually.. lemme include the row layout too.) Nov 29 21:41:07 no need to make it clickable btw Nov 29 21:41:19 the text color is also useless Nov 29 21:42:14 yah clickable came when i was trying to solve the selection problem. (the solution there was that the background in the rows was hiding the selector display) Nov 29 21:43:39 ok found the problem with the highlight - hadn't finished pulling out backgrounds. but still no divider :( Nov 29 21:44:07 how do i display the small loading icon in the titlebar? :) Nov 29 21:44:20 well the default divider is white Nov 29 21:44:26 doh. that'd do it. :) Nov 29 21:44:26 on your white background it probably won't show up really well Nov 29 21:44:37 but it's a gradient Nov 29 21:44:41 so on the edges you should see faint gray Nov 29 21:45:10 nothing visible. but i'll change the bg and see what happens. Nov 29 21:45:19 if you want a white ListView it would be much easier for you to simply use the Theme.Light for your activity Nov 29 21:45:29 you'll get everything correct: dividers, background, text colors, etc. Nov 29 21:46:36 ok yah its there, just too faint to see against the white background :) Nov 29 21:46:44 :) Nov 29 21:46:58 bow before ListView, for it is mighty! Nov 29 21:47:37 heh. so i still accept that it is user error, but this xml thing is a pita. every time i get a handle on it it laughs at me and pees in my shoes. Nov 29 21:50:13 actually once you know how it works it's pretty enjoyable Nov 29 21:51:12 especially when you start taking advantage of the configuration specific directories Nov 29 21:54:07 ok that theme just solved, in about 2 minutes, a mess that i spent hours on. doh. Nov 29 21:54:16 ^^ Nov 29 21:56:00 is there a trick to leaving the selector lit up while the action is performed? (in this case, it launches a new activity. but the selector disappears as soon as the finger lifts rather than delaying long enough for the activity to light) Nov 29 21:56:11 no, don't do that Nov 29 21:56:25 on Monday there will be a blog post on the official Android blog explaining everything about this Nov 29 21:56:33 sigh. :) Nov 29 21:56:44 long story short: this is because in "touch mode" (as soon as you touch the screen), focus and selection disappear Nov 29 21:57:01 don't sigh, there are very good reasons behind this :) Nov 29 21:57:13 and the fact that no use ever complained about it make us feel it was a good decision Nov 29 21:57:19 its just a timing issue. Nov 29 21:57:39 "i'm working on my app" "not until monday cuz you're doing it wrong" .. :) Nov 29 21:57:55 you can keep working on it Nov 29 21:58:02 just don't try to keep the selection in touch mode Nov 29 21:58:12 yah i'll ignore that issue. i've got other stuff that needs doing anyway.. Nov 29 21:58:23 it's not an issue, it's the way the framework is built Nov 29 21:58:34 there's tons of code in the framework to take care of this ^^ Nov 29 21:58:40 its what, about 10 lines i think. i can redo that the right way when the post comes out. Nov 29 21:59:01 what does your code do? Nov 29 21:59:15 fire an edit-this-entry activity when you click the listview Nov 29 21:59:17 pretty basic Nov 29 21:59:23 that's fine Nov 29 21:59:28 why would you need to rewrite it? Nov 29 21:59:57 the post will just explain *why* focus/selection disappear in touch mode Nov 29 22:00:00 the interface is lacking. click {orange selector} release {selector disappears}.....new activity appears Nov 29 22:00:05 ah. Nov 29 22:00:13 that's fine, that's how it's supposed to work Nov 29 22:00:20 that's how every list works Nov 29 22:00:44 thats what i thought. its just that delay feels long. i'll look into speeding up my activity start. Nov 29 22:01:05 that's a better idea :) Nov 29 22:01:24 yah its about 2 seconds. (while being debugged, but still) Nov 29 22:01:35 that's pretty long indeed Nov 29 22:01:53 what app are you writing? Nov 29 22:03:53 a mileage tracker. Nov 29 22:04:33 i think i need to break activity startup into two pieces - show the default (empty) editor, then open the db and populate it. Nov 29 22:05:22 that's a good way to do it Nov 29 22:05:31 you should use traceview to see where you are spending the most time Nov 29 22:10:16 Grrrr 500 server error on review.source.android.com :( Nov 29 22:10:29 it just worked for me Nov 29 22:10:42 jbq: yah you can't reply, you can only post new comments. Nov 29 22:10:45 pita. Nov 29 22:10:53 Ah. Lemme try that. Nov 29 22:13:55 shoulda known you were out hassling me :) Nov 29 22:14:01 Disconnect: sorry for the -1 on your submission. I'd like to see the functionality go in, just not quite implemented like that. Nov 29 22:14:52 iptables and pand are both built as part of the platform build, so they could be shipped. Nov 29 22:15:46 i used busybox because, frankly, jf is the only one outside tmob thats doing platform work and his platform has busybox. so.... (or is the tmob "platform" more equal?) Nov 29 22:16:31 Do you know where iptables lives in the source tree? Nov 29 22:18:26 bah n/m it's a root project. Nov 29 22:25:33 I'm not a build system expert, but if I'm reading the makefile for iptables properly it shouldn't be hard to enable it in the build. Nov 29 22:28:16 its not a root project, its a platform patch. you're just lucky someone is actually testing it since it doesn't work on the emulator :) Nov 29 22:30:12 I understand that, and I understand that the end-to-end functionality can't be tested in the emulator. I still believe that relying on busybox that doesn't exist (yet) and can't be installed by regular means leaves the platform in an odd shape. Nov 29 22:31:30 yah but that is a simple fix - someone who understands the image bundling enables ifconfig and pand install and tell me where you want it. Nov 29 22:35:28 Sounds like it should be simple, yes, but I'm not an expert there. I think it'd be best to ask for some help on the android-platform list, so that someone who understands that can help you (or at least work with you on understanding how it works) Nov 29 22:37:07 i'm getting reports of serious bandwidth problems, so i'm prolly gonna hack on that first before i do a new rev. but yah thats a good thought. i should be on that list anyway (if i'm not already) Nov 29 22:37:40 Sounds good. Looking forward to seeing you there and making some shippable-quality progress :) Nov 29 22:38:13 heh Nov 29 22:43:37 is xbin the right place for built-but-not-shipped bins? (iptables, pand, dund, ..) Nov 29 22:45:58 I'm not quite sure, but I'd guess that /.../bin would make some sense too. I don't have much visibility on the layout of the system filesystem, though... (another question for the mailing list!) Nov 29 22:46:19 heh yah yah Nov 29 22:49:05 RyeBrye, still aorund? Nov 29 23:32:11 i'm sad. i can't get traceview working on osx. and my x86 boxes are all 64bit so it blows up there too. Nov 29 23:41:22 http://pastebin.ca/1270663 Nov 29 23:41:27 ia32 java on x86 Nov 29 23:53:06 i create a ListActivty and a local Service form the main thread(activity). the service does networking in an new thread and should add the response into the List. but it doesn't work because it's coming from a different thread. Nov 29 23:53:26 11-30 00:50:06.724: ERROR/AndroidRuntime(8700): android.view.ViewRoot$CalledFromWrongThreadException: Only the original thread that created a view hierarchy can touch its views. Nov 29 23:53:49 any hint how i can do this so it works? Nov 30 01:34:37 eldenz: I think the 'correct' way to communicate between threads is by sending a Message from one thread to a Handler in the other. Nov 30 01:35:40 Also, my java is a little rusty, but I believe that any class implementing the 'syncronized' interface is shared between threads. Nov 30 01:35:57 Which apparently doesn't include a ListActivity. Nov 30 01:37:27 not really Nov 30 01:37:37 a Handler is used to communicate with the UI thread Nov 30 01:37:42 it's not a generic communication mechanism Nov 30 01:37:56 and synchronized has nothing to do with sharing between threads Nov 30 01:38:01 synchronized is a locking mechanism Nov 30 01:38:28 Ahh. So are all variables shared, just potentially unsafe? Nov 30 01:38:39 that's correct Nov 30 01:38:50 actually the real assumption is that everything is unsafe by default Nov 30 01:39:03 you can use the volatile keyword to help in a few situations Nov 30 01:39:27 anyway the easiest thing to do in such a situation is to use View.post(Runnable) or Activity.runOnUiThread(Runnable) Nov 30 01:43:46 romainguy__: hey. Nov 30 01:50:53 What would be the best way to do something whenever the phone is plugged in? It looks like I'd need to start a service on BOOT_COMPLETE and register to recieve ACTION_BATTERY_CHANGED broadcasts (it says you can't declare yourself as a receiver of this in the manifest). Nov 30 01:51:56 Err, ACTION_BOOT_COMPLETED Nov 30 01:53:04 Is there a way to call some generic alarm mechanism and run a check every two hours or something? Nov 30 01:53:41 I'm going to assume most people leave such a power-hungry device on a charger overnight. Nov 30 02:03:25 Okay there is AlarmManager, that you can register with on boot. **** ENDING LOGGING AT Sun Nov 30 02:59:57 2008