**** BEGIN LOGGING AT Sat Jun 06 02:59:59 2009 Jun 06 03:18:12 what's the best way to create a setup wizard, like K9 does? Jun 06 03:18:15 K9 or Email Jun 06 03:40:43 what causes android:layout_below....to not work? Jun 06 03:40:53 i cant figure out why this button wont go down Jun 06 04:06:10 http://digg.com/gadgets/A_web_url_to_view_Android_Google_Phone_apps Jun 06 04:20:59 dugg Jun 06 05:40:00 if I were going to edit the names of Home shortcuts, and I can't use AnyCut after 1.5, what would I use? Jun 06 05:40:16 someone said they're in a sqlite database... but I can't seem to find it. Jun 06 06:31:58 Is the author of ksoap2-android here and alive? :) Jun 06 07:26:39 <_Auron_> okay, I'm a bit erked that my drawable is stuck, even though I fully uninstalled the app and restarted my phone, cleaned my project in eclipse, restarted eclipse, and installed it again on my device, yet the drawable won't change Jun 06 07:26:43 <_Auron_> wtf :/ Jun 06 07:56:06 hi. how can I simulate traffic via WiFi in the emulator (OSX 10.5) ? Jun 06 07:58:02 So no WiFi for the emulator that is. Jun 06 08:02:21 you likely cannot. do you have a G1 for testing? Jun 06 08:04:07 no, currently not. It's on it's way from the states. Jun 06 08:05:49 so basically, our program will have to make sure to only use the WiFi to connect to a server. That's what I wanted to test. So from a theoretical point, I guess I'll have to go for the connectivity manager. Any other thoughts on how to ensure the traffic goes via WiFi? Jun 06 08:24:40 srm: just use the ConnectivityManager. it is very simple. see requestRouteToHost. Jun 06 08:25:30 you should also check if that network type is up, and if necessary detect when it comes up Jun 06 08:25:36 this all depends on your application's logic Jun 06 08:48:51 jasta: yes. will do the check everytime. one thing came up when looking at the api for the ConnectivityManager. What is this: ACTION_BACKGROUND_DATA_SETTING_CHANGED Broadcast Action? I've not seen such a thing like a broadcast action before and I'm wondering, how I'll make my application "listen for this broadcast". Jun 06 08:55:51 do I have to think of an icmp broadcast meant to be sent through all networkinterfaces? Jun 06 09:04:13 no, a broadcast is a component oft eh android system. an intent receiver can listen for those messages. Jun 06 09:04:39 that particular one will inform you when the user toggles the background data setting. Jun 06 09:04:53 much more discussion can be found in the documentation on android components. Jun 06 09:05:06 and i believe there is a session on youtube from I/O about this. Jun 06 09:16:19 thank you. Jun 06 10:35:10 hi, how can I get the size of the screen in opengl? Jun 06 10:35:26 wanting to make a 2d shape the size of the screen Jun 06 11:09:47 is there like a hidden android development community site around that I don't know of? Jun 06 11:10:13 I'm looking for a blog or site with news about development, snippets, tutorials, cool new open source projects etc Jun 06 11:10:16 Rexxars: nah. I think you know all the hidden ones Jun 06 11:10:29 :P Jun 06 11:10:33 heh Jun 06 11:10:34 anddev? Jun 06 11:10:42 hi I've downloaded mkbootimg from repo - but what do i need to compile this? Jun 06 11:11:06 anddev is just a forum, I'm looking for more of a blog/news site Jun 06 11:11:36 so far I've really only found a couple of sites, and they're very rarely updated :/ Jun 06 11:11:47 (how are Android.mk file used?) Jun 06 11:12:50 Rexxars: hmm ... there is a blog I have a bookmark to, but it's in japanese (tbh, I only bookmarked one page, cause it has some handy references to intents, and I don't know how the rest of the blog is) http://iceskysl.1sters.com/?action=show&id=459 Jun 06 11:13:29 Rexxars: if you can read german, I think there are quite a few good blogs on Android developments Jun 06 11:14:12 (in german I mean) Jun 06 11:14:15 thanks for the link Jun 06 11:14:32 I'm norwegian and don't know more than about 5 words in german Jun 06 11:15:04 okay .. it' s not even japanese, it's chinese ;) Jun 06 11:15:42 wonder if there is any interest in a new android development blog by.. well, developers Jun 06 11:16:32 maybe some kind of planet, like planet.gentoo.org Jun 06 11:17:49 Rexxars: not sure. there seems to be plenty of dev blogs for android already. on the other hand ... you might provide better/different infos, so, why not Jun 06 11:18:03 == a blog aggregator Jun 06 11:19:10 sammyF: that's why I was asking, I dont know all that many.. Jun 06 11:19:34 srm might be onto something though Jun 06 11:19:42 Hoi can I open a url using the browser intent? Jun 06 11:20:08 I think that something in the api has changed or something, since code I find on the web, doesn't work... Jun 06 11:20:46 Rexxars: dunno ... http://lmgtfy.com/?q=android+development+blog Jun 06 11:20:51 Rexxars: idea is to setup an initial list with known links and the possibility to update this list, later on something like a subdomain on android (or somewhere else) where you see an aggregated view of all blogs related to android. Jun 06 11:21:55 srm: seems it's already been done (just didnt find it before now) http://www.planetandroid.com/ Jun 06 11:22:02 :D Jun 06 11:22:03 Balachmar: check this page : http://iceskysl.1sters.com/?action=show&id=459 Jun 06 11:22:05 so easy Jun 06 11:22:13 balachmar: still works Jun 06 11:22:38 sammyF: thanks! Jun 06 11:22:51 nice link Rexxars, need a hardcoded reference for this. Jun 06 11:23:16 Rexxars: NICE Jun 06 11:23:26 grr .. capslock key ist stuck Jun 06 11:24:08 btw. the google IO sessions are really good, if you haven't watched them yet Jun 06 11:24:34 has anyone used gl.glGetIntegerv in android? Jun 06 11:24:39 thats opengl btw Jun 06 11:50:05 http://stackoverflow.com/questions/959522/getting-the-size-of-the-opengl-window-in-android Jun 06 12:39:49 hi im having problems with running the android emulator from eclipse; when i close it, it doesnt close? is this a known bug? im using the 1.5r2 sdk, with eclipse 3.5rc2 Jun 06 12:40:51 shud also mention im on ubuntu 9.04 Jun 06 12:44:39 where do i find the sqlite file i created on the File Explorer on my app? Jun 06 12:50:59 is there a grep replacement on the shell of adb? Jun 06 12:55:56 busybox Jun 06 13:00:25 i might just try eclipse stable Jun 06 13:24:10 Hi all,I try to use MapView,I also apply a API KEY,but it seems can't get the data from google. Jun 06 13:25:47 android:id="@+id/mapView2" Jun 06 13:25:48 android:layout_width="fill_parent" android:layout_height="fill_parent" Jun 06 13:25:48 android:apiKey="0HKNVk1jSOL0VRkbvFBp3PdbuXjsWk8ctcWbm3Q" /> Jun 06 13:26:03 And this is the layout. Jun 06 13:29:18 then you are probably using the wrong key Jun 06 13:29:52 Do I need to sign the APK file before I run the Application> Jun 06 13:29:53 ? Jun 06 13:30:06 if you didnt sign it, it has been signed with your debug key Jun 06 13:30:16 then you need to get a maps-apikey for that debug key Jun 06 13:30:40 jarsigner -verbose -keystore pjq.keystore bin/GooglemapSample.apk pjq Jun 06 13:30:52 First I sign the APK. Jun 06 13:31:00 Then Install it . Jun 06 13:31:12 adb install bin/GooglemapSample.apk Jun 06 13:31:50 and this keystore is the keystore I used to apply for the API key. Jun 06 13:32:09 thats the correct way Jun 06 13:33:39 I can't find why it can't get the data. Jun 06 13:34:00 pjq: you have the internet permission in androidmanifest? Jun 06 13:34:38 Yes,I add the permission. Jun 06 13:34:54 I will push the code in github.com Jun 06 13:34:55 does logcat not give any useful info as to what's going wrong? Jun 06 13:36:23 It say MapActivity: Couldn't get connection factory client Jun 06 13:37:39 Hey all. Can anyone tell me how I can connect to a EditTextPreference that I have declared in a XML file? findViewById(R.id.description) doesn't work, since it's not able to cast from a View to an EditTextPreference. Jun 06 13:38:15 pjq verify your maps apikey is correct by generating it again Jun 06 13:38:39 ulrich: OK,I will verify it again. Jun 06 13:39:15 aVirulence: I've only scratched the surface of the PreferenceActivity, but the EditTextPreference should have a "key" value, which I assume is how you get at the setting via code, although I haven't got that far yet :) Jun 06 13:39:56 doc_savage: thanks, but I'm trying to get the EditTextPreference itself, so I can change the text/summary. Jun 06 13:40:16 oooh, I saw that done somewhere... ! lemme see if I can find it Jun 06 13:42:11 aVirulence: I haven't tried it, but this seems to be what you want: http://stackoverflow.com/questions/531427/how-do-i-display-the-current-value-of-an-android-preference-in-the-preference-sum Jun 06 13:46:59 doc_savage: thanks a lot! it's not exactly what I was looking for, but it does have what I need! Jun 06 13:47:23 np :) Jun 06 13:49:59 ulrich: Hi,I regenerate the keystore and apply for API KEY again.But it also can't get the data. Jun 06 13:50:12 http://github.com/pjq/Google-Map-for-Android/tree/master Jun 06 13:50:28 ulrich: You can get the source code here. Jun 06 13:51:31 Anyone have time to help me to test the code? Jun 06 13:51:37 Thanks~~ Jun 06 13:59:18 pjq: if you don't need feedback right away, I can check it out a bit later. Need to clean up my house first Jun 06 14:00:29 its your apikey Jun 06 14:00:32 mine works Jun 06 14:00:49 just keep in mind that in your sources there are 2 mapviews Jun 06 14:01:59 sammyF: Thanks Jun 06 14:03:24 ulrich: I just have one mapview in the main.xml Jun 06 14:03:37 http://github.com/pjq/Google-Map-for-Android/blob/b4e9e66588c7886188abfd959577ce2ae8de2c9c/res/layout/mapview.xml Jun 06 14:03:42 http://github.com/pjq/Google-Map-for-Android/blob/b4e9e66588c7886188abfd959577ce2ae8de2c9c/res/layout/main.xml Jun 06 14:03:59 they have different keys Jun 06 14:04:36 ulrich: I will delete the mapview.xml Jun 06 14:04:53 when i use my own debugkey in your main.xml, the map is showing Jun 06 14:06:39 ulrich: May be the procedure I do have probelms. Jun 06 14:07:21 ulrich: I will paste the whole steps i do. Jun 06 14:08:57 keytool -genkey -v -keystore pjq.keystore -alias pjq -keyalg RSA -validity 10000 Jun 06 14:09:05 first create the keystore Jun 06 14:09:21 keytool -list -keystore pjq.keystore Jun 06 14:09:27 then get the MD5 Jun 06 14:09:39 Then apply the Jun 06 14:09:44 API KEY. Jun 06 14:10:04 jarsigner -verbose -keystore pjq.keystore bin/GooglemapSample.apk pjq Jun 06 14:10:09 then sign the APK. Jun 06 14:10:16 adb uninstall com.pjq.googlemapsample Jun 06 14:10:24 Then uninstall the apk. Jun 06 14:10:32 adb install bin/GooglemapSample.apk Jun 06 14:10:47 Then install it, Jun 06 14:11:18 i'm sort of curious, is it possible to get sensor/location information synchronously, rather than through listeners? Jun 06 14:11:40 pjq you should recreate the apk as well :p Jun 06 14:11:56 ulrich: Yes, I recreate the apk. Jun 06 14:12:29 ulrich: After save the source code,it will generate the apk automatically. Jun 06 14:13:13 all i can tell you is that your key/maps-key pair is wrong. Jun 06 14:15:33 ulrich: Yes,Thanks all the same. Jun 06 14:16:13 ulrich: Thanks for your patient. Jun 06 14:24:51 so... is that a "no, not possible" or "hmm... i don't know" Jun 06 14:26:22 Keylime: what about a separate listener thread, that you can then call from your UI/other code to get the "present" value Jun 06 14:27:28 sure, i know that i can implement it, i just didn't want to do so if it was possible with the api, and i just didn't know how =D Jun 06 14:28:08 ah, I'm not sure if it can be done synchronously via the api Jun 06 14:28:55 okay. =) Jun 06 14:31:56 for location information you simply query for the last known location Jun 06 14:32:13 and if necessary, let the position be updated in the background Jun 06 14:34:45 Does anyone know where to get the Android Market's source code? Jun 06 14:35:01 no reason to update it, actually... unless the person is approaching the speed of sound, the location detail that's required vs the time the app will run won't require updates ;) Jun 06 14:35:32 but but, is there an api call to get the "last known" location? Jun 06 14:35:39 yes Jun 06 14:36:32 oh... so there is. thanks! Jun 06 14:37:09 orientation information is the bigger issue for me, sadly... Jun 06 14:37:20 http://nopaste.info/14446eaaf4.html Jun 06 14:38:19 yaya Jun 06 14:42:45 hi is this the right place to report bugs with the sdk? Jun 06 14:56:32 wrsg, b.android.com Jun 06 14:56:56 jdavidandroid, Market isn't open source Jun 06 14:57:44 Thank you very much for your answer KNY! Jun 06 14:57:57 no problem Jun 06 14:59:48 thnx KNY Jun 06 15:40:51 hey romainguy_, I think you need to yell at the eyes-free guys; they're using a FrameLayout to just layer in another overlay Jun 06 15:41:05 (I'm watching their talk right now) Jun 06 15:42:39 hey, can someone please point me to a tutorial/example which shows how to open files with your app? (Add a file's mimetype so it get's opened by your app) Jun 06 15:44:54 aVirulence, look at OI File Manager; I believe that has the example intents you'll need Jun 06 15:45:03 KNY: thanks! Jun 06 15:51:09 Hi everyone. I have a simple ListView that when a new row is added the text or background color changes based on some condition. How might anyone recommend to do this? Jun 06 15:52:13 what's the best way to get your own versioncode ? Jun 06 15:52:31 i know i can use the package manager to look it up but that seems kinda indirect. is there a direct way to get that data? Jun 06 15:55:58 To answer my own question. I guess doing a custom view would work. Was really trying to avoid all of this code for just a simple change of the color of a row. http://developer.android.com/guide/samples/ApiDemos/src/com/example/android/apis/view/List4.html Jun 06 16:12:03 hmm, I added an intent-filter to my app, but the webbrowser doesn't recognize the mimeType Jun 06 16:35:08 Ok, I managed to add an intent-filter which allows files from the webbrowser to be opened by my app. However, I cannot find how I can open this file? Where is the information on the file? Jun 06 16:38:06 aVirulence, it would be in the intent Jun 06 16:46:28 Hey. Jun 06 16:46:43 I'm trying to make an app that lets people search for stuff, and displays the results on a map. Jun 06 16:47:05 So, when my MapActivity starts, I start a new thread to do the query, and a handler gets a message when the query is done. Jun 06 16:47:13 This works great, except for screen rotation. Jun 06 16:47:58 Is there a good place to find videos of google io sessions about android? like this one: http://www.codeandroid.org/2009/06/05/google-io-android-workshops-on-youtube/ Jun 06 16:51:01 hi wmealing Jun 06 16:51:32 biafra, they're all online on the IO site Jun 06 16:51:39 biafra, google io session videos: http://code.google.com/events/io/sessions.html Jun 06 16:51:46 * wmealing_ waves Jun 06 16:52:03 jove: thanks Jun 06 16:52:08 np Jun 06 17:20:36 I'm trying to read a large file (3.3 mb) into a String. However, I'm getting a outofmemory error. Can I do this another way? Jun 06 17:21:52 aVirulence, it really depends what you want to do with said data Jun 06 17:22:35 wmealing: there's an XMLRPC call in which I have to send that String Jun 06 17:24:50 aVirulence: can you just stream the file directly to the network socket without loading it into memory? Jun 06 17:25:55 unknown_lamer: I'm not sure, I think I the XMLRPC library takes only String arguments, no streams Jun 06 17:26:55 aVirulence: which xmlrpc library? Jun 06 17:27:45 unknown_lamer: http://code.google.com/p/android-xmlrpc/ Jun 06 17:30:43 hrm, lame Jun 06 17:32:27 Hey. Jun 06 17:32:59 So, I'm writing this activity that makes an HTTP request when it starts. Is there any safe way to cancel it if onSaveInstanceState is called? Jun 06 17:33:54 ttuttle, use AsyncTask and then just call cancel(true) on it Jun 06 17:34:03 and you can shutdown the client, if need be Jun 06 17:34:11 Will that work? I was using a Thread and things got very confused. Jun 06 17:35:00 ttuttle, asynctask >>>> thread Jun 06 17:35:01 :) Jun 06 17:35:07 KNY: cool :) Jun 06 17:35:26 ttuttle: to misquote ctate : "asynctask RvlZ0r" Jun 06 17:35:40 he might have said the rvlz0r thing a bit differently though Jun 06 17:35:53 but he is right anyway ;) Jun 06 17:36:41 Hi everyone, i have a problem. Did anyone try to create two slightly applications from the same source base. How can i avoid that there are conflicts (same package name) in the android market ? Jun 06 17:37:03 blandi: use different package names Jun 06 17:37:29 blandi: rename it Jun 06 17:37:54 but if i use different package names, R.java is generated in that package name and all references to R are leading to compiler errors Jun 06 17:38:15 blandi: if you're using Eclipse, there is a very handy "refactor" menu when you rightclick on your package in the package view Jun 06 17:38:36 blandi: it will try to fix every reference to the package name when you rename it through it Jun 06 17:39:18 @sammyF: that will work but i wondered if there is a better way Jun 06 17:39:31 aVirulence: you could modify the serialize() method in the xmlrpcserializer to take a stream and use a char[] buffer to dump chunks of the file at a time Jun 06 17:39:54 aVirulence: (it would be straightforward, I just poked through the source) Jun 06 17:40:22 i want to easyly switch development between demo/full version, but about 95% of the code are equal Jun 06 17:40:55 i want to avoid to do a lot of manual refactoring steps Jun 06 17:42:34 blandi, you could probably set up an ant task to change the package names for you Jun 06 17:45:13 unknown_lamer: ok, thanks. I'll try to find out how to do that Jun 06 17:45:22 i thought android package name != java package name ? Jun 06 17:45:58 @kny: thanks, i think that is the best idea. i will try to create ant tasks to deploy/modify all into another eclipse project Jun 06 17:47:03 blandi: have you tried simply modifying the package attribute ? Jun 06 17:49:12 @TD yes, like i said before, if you change the package-attribute R.java is generated in the new package, this leads to plenty of compiler errors in old classes referencing the old R.java Jun 06 17:49:54 ah, I see. sounds more like an eclipse plugin problem than an android OS problem. could you modify the classpath to include the new directory to fix that? Jun 06 17:50:48 blandi, there are ant tasks to do search-and-replace Jun 06 17:51:14 you could just replace your.package.app and your.package.app.demo, build, replace back, build again Jun 06 17:52:05 and then have the app determine whether or not it's a demo based on the package defined in the manifest Jun 06 17:53:11 @kny: yes, the only thing to decide is if the canges should be made within the same project, or if everything should be copied to an paralell project Jun 06 17:54:22 i think i will try it to modify within the same project first Jun 06 18:10:17 So this AsyncTask thing isn't working. Jun 06 18:10:27 It's not crashing anymore, but it's also not hiding the ProgressDialog I ask it to hide. Jun 06 18:11:44 @KNY: yeah, that already works fine!! Jun 06 18:11:58 IRC is not twitter; there is no need for @ before nicknames. Jun 06 18:11:59 blandi, awesome Jun 06 18:12:20 ttuttle: it definitely "works", but that doesnt guarantee that you are smart enough to use it :) Jun 06 18:12:25 jasta: :P Jun 06 18:12:37 jasta: I'm still figuring out how the whole reconfiguration thing is handled -- what is preserved and what isn't. Jun 06 18:13:12 during config change? nothing. but you can use onRetainNonConfigurationInstance to hang onto objects that you know not to be affected by it Jun 06 18:13:19 without serializing them, which is very important. Jun 06 18:13:40 for instance, if you had a download thread going and a config change occurred...you would want to return that thread handle and get it back again when you recreate Jun 06 18:13:40 Well, it seems to handle dialogs for me. Jun 06 18:13:57 ttuttle, if you use managed dialogs, yes Jun 06 18:14:02 Also, it keeps saying I'm leaking windows. Jun 06 18:14:45 jasta, when you're passing an asynctask between rotations, doesn't the UI bit get broken? That is, onPostExecute() could get called before the UI has been recreated which would cause problems, no? Jun 06 18:15:05 I'd be fine cancelling the AsyncTask, if cancelling it works right. Jun 06 18:15:15 ttuttle, it does Jun 06 18:15:18 Okay. Jun 06 18:15:21 well, i dont know specifically about AsyncTask's implementation. but a primitive thread implementation would work just fine. Jun 06 18:15:24 ttuttle, pastebin? Jun 06 18:15:29 It's sorta complicated. Jun 06 18:15:30 ttuttle: cancellation works, but you must understand you can't just "stop" a thread abruptly. Jun 06 18:15:36 jasta: Oh, I know. Jun 06 18:15:48 the thread must be made to stop by some other means, typically resulting from your correct design Jun 06 18:15:48 jasta: I don't mind if it takes a minute. I just don't want it posting stuff to the UI thread after it's died. Jun 06 18:15:56 it doesnt have to take a minute Jun 06 18:16:00 jasta: Well, 99% of the time I'm waiting on HttpClient. Jun 06 18:16:02 but it does have to be correctly designed. Jun 06 18:16:04 jasta: So how do you interrupt that? Jun 06 18:16:22 ttuttle: here's a good start: Jun 06 18:16:26 http://devtcg.blogspot.com/2008/07/interruptible-io-example-using.html Jun 06 18:16:31 ttuttle, getConnectionmanager().shutdown() or something like that Jun 06 18:16:46 nice link, jasta Jun 06 18:17:54 ttuttle: this describes, though somewhat redundantly, how to perform an orderly shutdown on the socket such that any blocking connect or read calls will be interrupted abruptly, with logic to handle that condition Jun 06 18:18:16 from your perspective, the thread will appear to halt "instantly", but further synchronization is recommended if you require it. Jun 06 18:18:44 another functional example of this can be found here: Jun 06 18:18:44 TBH, the downloads are so small (search results) that I don't care if they finish or not when I'm cancelling it. Jun 06 18:19:19 ttuttle: you must always handle cancellation logic yourself, though. Jun 06 18:19:24 * ttuttle grumbles. Jun 06 18:19:27 even if you think that it is insigificant Jun 06 18:19:30 insignificant* Jun 06 18:19:58 for instance, if you dismiss a dialog when the socket disconnects, you would need to know whether that dialog or activity that spawned it is even still around Jun 06 18:20:05 Yeah, I know. Jun 06 18:20:15 Oh, maybe I should put the logic in my AsyncTask instead of in the download part. Jun 06 18:20:20 so i find it simpler really to just gracefully shutdown the thread on demand and back out Jun 06 18:20:26 so i dont have to worry about ugly state management like that Jun 06 18:20:39 What do you mean "back out"? Jun 06 18:21:22 i mean that with the code i sent you, you can ensure the thread exits quickly. you can even wait on it to exit before proceeding in the main thread. Jun 06 18:21:29 Okay. Jun 06 18:21:34 here is a functional example of this: Jun 06 18:21:38 http://code.google.com/p/five/source/browse/trunk/android-client/src/org/devtcg/five/music/util/streaming/DownloadManager.java Jun 06 18:23:46 i have studied this problem in great detail. i strongly suggest you design your logic similar to this. Jun 06 18:27:33 Okay, this is making sense now. Jun 06 18:27:58 ttuttle: look at the docs for Thread.interrupt() Jun 06 18:28:04 the high-level overview is that i'm ordering the shutdown of the socket so the read or connect calls will immediately fail. Jun 06 18:28:07 TD: erm, _no_ Jun 06 18:28:15 Thread.interrupt is not the right function to examine. Jun 06 18:28:28 I tried Thread.interrupt, and everyone got sad. Jun 06 18:29:18 my call to interrupt() is actually to protect against an impossible condition in my own example. that is, if the downloading thread was in a sleep or wait call, the interrupt would get it out. Jun 06 18:29:31 but as i said, in my example, this would never be possible Jun 06 18:29:52 oh, we're talking about asynctask, sorry Jun 06 18:30:12 TD: irrelevant. we're talking about sockets. Jun 06 18:30:30 blocking I/O calls do not abort with a call to Thread.interrupt Jun 06 18:31:02 the way to abort blocking I/O calls is to perform an orderly shutdown on the socket itself, triggering either an exception or a short read / EOF. Jun 06 18:31:09 you must handle either condition. Jun 06 18:31:52 in the case of HttpClient, this is handled for you. with the Socket class you would be expected to deal with both cases. Jun 06 18:31:56 is there a way to use a PreferenceScreen but not have it actually save to a preference file? Jun 06 18:32:08 KNY: yes, just don't give it a key. Jun 06 18:32:20 the key property is what makes it write to a SharedPreferences object Jun 06 18:32:24 yes they do Jun 06 18:33:01 the http libraries i've used definitely use interruptible channels Jun 06 18:33:05 jasta, I've got a preferencescreen without a key and it saves to a file Jun 06 18:33:18 TD: interruptible channels are not relevant here either. at least not for HttpClient or Socket Jun 06 18:33:22 it just generates com.myapplication.package_preferences or whatever Jun 06 18:33:28 KNY: uhh, then i'm not sure. Jun 06 18:33:34 because without a key it should have nothing to store Jun 06 18:34:07 jasta, well children of it have keys.. Jun 06 18:34:20 KNY: interruptible channels are part of a different API, related to non-blocking I/O. blocking I/O is far more nuanced and poorly implemented in Java. It is relying on the underlying host OS to do the right thing rather than its own APIs or specification. Jun 06 18:34:39 did you mean to highlight someone else on that, jasta ? Jun 06 18:34:48 KNY: oh, i see what you are saying. you want to abstract it away from the SharedPreferences engine for all the Preferences you display? Jun 06 18:34:53 yes, i meant to say TD: Jun 06 18:35:20 jasta, yes. I ultimately want to send these preferences to a server and not save them locally, but I don't want to build my own UI if I can help it Jun 06 18:35:31 yes, and for the basic case where you want to download something in the background in an android app, then possibly cancel it, i haven't had problems using interrupt() so far. unless there's a race i don't know about? Jun 06 18:35:44 TD: to that end, POSIX and even Windows standards require that an orderly shutdown of a socket must break a blocking I/O call. but the two platforms do it differnetly, this is why you must handle the two separate cases yourself when using the Socket class. Jun 06 18:36:01 how can I set the sharedPreferences which a PreferenceActivity should use? Jun 06 18:36:02 TD: interrupt will do nothing -- you did not cancel yoru thread. Jun 06 18:36:14 rather, you just pretended it canceled, and it stopped on its own at some point in the future. Jun 06 18:36:53 jasta: Occasionally that's okay. Jun 06 18:36:57 unless of course you really were using non-blocking I/O and you had an interruptible channel. unlikely. Jun 06 18:37:00 no, i've tested this quite thoroughly. calling interrupt() breaks me out of a blocking io with an exception. my own code checks the interrupt flag at intervals as well. Jun 06 18:37:12 i catch that exception then shut down the thread Jun 06 18:37:23 list view in a dialog is driving me nuts :\ Jun 06 18:37:29 TD: your code is by definition incorrect. please consult the Javadoc on interrupt(). Jun 06 18:37:58 again, unless you are using an interruptible channel. Jun 06 18:39:02 HttpClient does have an NIO module, but you would know if you were using it. Jun 06 18:39:31 I don't see it. I have a PreferencesActivity which can correctly load and save values, however, I cannot find out how I should open these preferences from another class.. Jun 06 18:39:48 the reason that interrupt works on an interruptible channel is because it is obviously non-blocking so there's nothing to interrupt. Jun 06 18:39:54 aVirulence, they're associated with your application Jun 06 18:40:06 aVirulence, read the docs/examples on SharedPreferences Jun 06 18:40:56 KNY: so what values should the arguments in getSharedPreferences(String, int) be? Jun 06 18:41:35 aVirulence, this is in the docs, but one is the name of the prefs file and the other is the mode Jun 06 18:43:14 is there a way to write your own kind of prefences for the PreferencesActivity Jun 06 18:44:14 for e.g. i have a list of strings as a preference (i have to save it in a DB though) Jun 06 18:45:39 KNY: thanks, I was trying examples the whole time, but it seems I made one tiny mistake in following the docs.. found it out now. Jun 06 18:47:19 TD: also, in your situation, you are probably testing for the interrupt flag inside your read loop, right? Jun 06 18:47:36 so, you expect that read successfully reads something after you interrupt in order to actually break Jun 06 18:47:47 i'm using readFully Jun 06 18:48:31 where is that implemented? Jun 06 18:48:41 it likely implements the same logic i'm describing Jun 06 18:48:47 where it checks the interrupt flag inside the tight loop Jun 06 18:48:52 which makes it totally broken :) Jun 06 18:49:00 DataInputStream Jun 06 18:49:52 if you're interested in exploring just how this is broken, use a mechanism like iptables to DROP all packets coming in from the remote peer, then try to cancel your connection Jun 06 18:50:17 if you are using interrupt alone and not HttpClient#abort, you will notice that it waits up until the read timeout before it actually breaks out of the blocking I/O Jun 06 18:50:38 similarly, if you drop packets coming in prior to making a connection you will block up until the connect timeout in HttpClient#execute Jun 06 18:51:25 but really all you must do is read the Thread.interrupt documentation. It tells you quite plainly that your solution is incorrect. Jun 06 18:52:27 the basic problem is that Thread.interrupt doesn't interrupt syscalls, right? Jun 06 18:53:33 hmmm. suck. Jun 06 18:54:35 right. i'm reading the interrupt implementation in dalvik Jun 06 18:54:52 it's entirely based on pthreads. ugh. Jun 06 18:56:37 TD: it has nothing to do with the implementation, it's defined not to interrupt blocking I/O. Jun 06 18:57:25 ttuttle: no, its that its defined to interrupt _only_ sleep, wait, join, or non-blocking I/O. Jun 06 18:57:30 s/or/and/ Jun 06 18:57:52 it has nothing to do with syscalls or not. it's just that only those areas it affects. Jun 06 18:57:53 it's defined to interrupt an interruptible channel, which has a long list of subclasses that mention sockets and files. i (apparently wrongly) assumed that meant IO on sockets would be interruptible Jun 06 18:58:06 TD: interruptible channels are part of NIO. Jun 06 18:58:12 indeed, i see that now Jun 06 18:58:24 and as i said its obvious why that works. NIO isn't blocking :) Jun 06 18:58:46 the underlying host OS, hwoever, can interrupt a blocking I/O call no problem by simply closing the descriptor that's being waited on. Jun 06 18:59:03 for sockets, this means an orderly shutdown of the input (for read) and output (for write) Jun 06 18:59:09 and a close for connet Jun 06 18:59:10 connect* Jun 06 18:59:28 but this is not mentioned or provided by Java. it is rather an implementation detail of the platforms its layered on. Jun 06 19:00:04 which i think is a somewhat pathetic oversight from the Java designers, given that all the supported platforms have similar implementation details by design. Jun 06 19:02:08 HttpClient implements this in HttpMethod#abort Jun 06 19:02:32 but you still must be able to handle the state that leaves your thread and socket in Jun 06 19:06:01 how can i get the title background color for a dialog? Jun 06 19:07:06 it's sort of surprising (to me at least) that the high level HTTP classes weren't reimplemented on top of nio when it was released. Jun 06 19:07:54 i wonder what the easiest way to fix my code is Jun 06 19:08:23 thanks jasta, by the way. i didn't realize the interruptability of network ops depended on which io library was in use. Jun 06 19:08:33 (i mean, interruptability by thread.interrupt) Jun 06 19:08:54 jasta: http://devtcg.blogspot.com/2008/07/interruptible-io-example-using.html << in this example your lock should be final, otherwise its semantic can potentially be wrong :) Jun 06 19:10:02 is there a reason to use an explicit lock object here rather than synchronize on the thread object itself? Jun 06 19:10:32 TD: it's more flexible to use a dedicated lock Jun 06 19:11:01 true, but more overhead and apparently harder to get right Jun 06 19:11:09 the overhead is minimal Jun 06 19:11:12 what is the wrong semantic if the lock isn't final by the way ? Jun 06 19:11:24 well if it's not final, you can reassign the reference Jun 06 19:11:54 which means you can potentially be locking on difference objects Jun 06 19:12:24 oh, i see. you mean just in the general sense that making things final when they aren't meant to change is a good thing. Jun 06 19:12:39 that's a good thing in general yes Jun 06 19:12:54 but in the case of a lock, changing the value can break your synchronization code Jun 06 19:13:17 to be fair, it's very unlikely that jasta would change the lock's value in his code Jun 06 19:14:25 http://code.google.com/p/five/source/browse/trunk/android-client/src/org/devtcg/five/music/util/streaming/DownloadManager.java << here the lock is final :) Jun 06 19:21:45 is there a way to make httpclient or httpconnection use nio internally? Jun 06 19:21:55 i presume it's not as simple as setting a parameter. Jun 06 19:26:39 jasta: ah Jun 06 19:30:50 it's sort of sad how much code is required to download something correctly :( Jun 06 20:00:42 romainguy_: hmm? Jun 06 20:00:59 romainguy_: oh the variable should be final Jun 06 20:01:17 wait, it is? Jun 06 20:02:26 oh, in the example code it's not. yeah, a small omission. Jun 06 20:03:10 TD: httpclient can use nio, but its not what youre interested in, trust me. Jun 06 20:03:34 TD: to correct an earlier statement you made though, the interruptibility doesnt depend on the library, but rather whether its blocking or non-blocking I/O. Jun 06 20:03:56 HttpClient supports both, and is blocking by default. the latter is much more difficult to interact with in general. Jun 06 20:05:12 s/the latter/non-blocking/ :) Jun 06 20:06:17 yes, i know, i've worked with async io code before (not in java)( Jun 06 20:06:26 TD: threading remains a sophisticated topic and well worth significant energy to understand correctly. i strongly advise you to purchase a book on the topic. Jun 06 20:08:06 i have personally read http://oreilly.com/catalog/9780596007829/#top and highly recommend it Jun 06 20:08:09 well, i've been improving my knowledge of threading for many years, but every language/runtime i encounter has its own annoying quirks Jun 06 20:08:20 language/runtime/cpu architecture Jun 06 20:08:36 language/runtime/cpu architecture/operating system Jun 06 20:15:22 romainguy_: hehe, im watching your session at I/O :) Jun 06 20:26:09 * jasta raises an eyebrow Jun 06 20:26:14 what is this "droid donut" command you ran? Jun 06 20:26:24 looks like source build/envsetup.sh and a choosecombo or lunch run? Jun 06 20:26:39 ah cool, the videos are out Jun 06 20:28:10 layout weight is so awesome, I'm doing webdev again and I'm missing it :( Jun 06 20:30:27 ohh, Debug.setAllocationLimit(0)...neat :) Jun 06 20:34:18 jasta: it's just a bash function that cd into the donut tree, envsetup then lunch Jun 06 20:35:11 (or master tree when I type droid master) Jun 06 20:54:07 romainguy_: is there a trick to make a LinearGradient smooth? i tried to use it when originally implementing my app but it produced heavily banded results, so i ended up with a bitmap background (watching your presentation) Jun 06 20:54:53 TD: nothing special must be done to make it smooth... Jun 06 20:55:03 you must have used it incorrectly... Jun 06 20:55:11 TD: what gradient are you producing? Jun 06 20:55:27 sometimes there just isn't enough color difference to make it smooth Jun 06 20:56:08 there was a pretty large color difference. i mean the same gradient rendered fine in the gimp Jun 06 20:56:20 argg...3 hrs just to change the background colour of a listview Jun 06 20:56:24 and it still doesnt change :\ Jun 06 20:56:50 whats the color depth of your screen compared to your phone? Jun 06 20:57:30 does anyone know what all i should be doing apart form setting the background color to a custom value and setting cache color hint to 0 Jun 06 20:57:32 why would that make any difference? the same color gradient rendered to a png by gimp renders just fine on the phone. lineargradient did not. same screen, same colors, different way to generate them Jun 06 20:57:49 ahh ok Jun 06 20:58:41 i was more thinking that there were more colors on your computer screen to lessen the banding effect Jun 06 20:58:56 TD: enable the dithering on the Paint Jun 06 20:59:28 romainguy_: thanks, i'll try that next time i revisit the graphics code. Jun 06 22:24:12 lo Jun 06 22:26:27 Hi can you please tell me how to query Contact Photo of each contact? Jun 06 22:31:07 lucius, it's a column on contacts.people I believe. See the API demos app for an example. Jun 06 22:33:59 thanks. Jun 06 22:34:01 I did read Jun 06 22:34:02 http://developer.android.com/guide/topics/providers/content-providers.html Jun 06 22:34:14 it has Jun 06 22:34:15 int nameColumn = cur.getColumnIndex(People.NAME); Jun 06 22:34:15 int phoneColumn = cur.getColumnIndex(People.NUMBER); Jun 06 22:34:22 but how to get the photo? Jun 06 22:34:33 i don't understand how to get the photo Jun 06 22:34:36 from that example Jun 06 22:35:35 i appreciate if you can help me understand how to extend that piece of code to get photo of the contact Jun 06 22:36:36 Contacts.Photos, sorry Jun 06 22:38:04 Why does my custom view lose focus and stop accepting onKeyEvents when my phone goes into sleep mode or I pop up a dialog and then close it again? Jun 06 22:41:29 sorry, i don't understand how to change the example code http://developer.android.com/guide/topics/providers/content-providers.html to get Contacts.Photos Jun 06 23:25:17 somehow i cannot get this hello world mapview example to work Jun 06 23:25:29 did google change something? Jun 06 23:39:05 * jasta hearts the Apache Foundation Jun 06 23:39:05 :) Jun 06 23:40:47 jasta: that's because you haven't seen how Harmony is implemented Jun 06 23:41:19 actually i was referring to Harmony Jun 06 23:41:45 i did notice though that android has a couple of harmony hacks sprinkled around the source Jun 06 23:41:52 we had to Jun 06 23:42:04 my favorite example of Harmony is that they decided to localize the exception messages Jun 06 23:42:07 right, i assume those are what youre referring to :) Jun 06 23:42:18 so the first time an exception is thrown, it loads a huge text file Jun 06 23:42:23 eek. Jun 06 23:42:28 which uses about 1 MB of memory Jun 06 23:42:31 well that's just not even a good idea. Jun 06 23:42:36 but they're smart, so it's a softreference Jun 06 23:42:41 so next time an exception is thrown Jun 06 23:42:44 the file is reloaded AGAIN Jun 06 23:42:45 yay Jun 06 23:43:21 other examples include doing a String comparison ("turkish".equals(getLocale())) for every character of a String when calling toLowerCase() Jun 06 23:43:25 what would be the advantage of something like that? i wouldnt expect that exception strings should even be localized Jun 06 23:43:30 or allocating memory when removing objects from a list (ArrayList) Jun 06 23:43:35 no clue Jun 06 23:43:42 and the messages keys are not even manageable Jun 06 23:43:53 at least if the key was something like file.io.cannotopen.error Jun 06 23:44:03 but the keys are stuff like KZ70082 Jun 06 23:44:22 so they have a comment in the source telling you that KZ70082 is "Cannot open file" in English Jun 06 23:44:25 wtf Jun 06 23:44:38 ugh, yeah Jun 06 23:44:43 anyway, Harmony is a really cool project but it's definitely far from being optimized Jun 06 23:44:47 even for the desktop Jun 06 23:45:20 its neat being able to look at the code and see what youre referring to ;) Jun 06 23:45:32 // BEGIN android-added Jun 06 23:45:36 * The remove(Object) implementation from AbstractCollection creates Jun 06 23:45:37 * a new Iterator on every remove and ends up calling remove(int). Jun 06 23:45:38 :)_ Jun 06 23:45:52 yep Jun 06 23:46:14 I did a couple of fixes in there myself Jun 06 23:46:16 :p Jun 06 23:46:35 btw i'd like to commend you guys on all the information coming out of your team lately Jun 06 23:46:42 thanks Jun 06 23:46:53 the android-developers blog has moved toward much more interesting topics and I/O this year has vastly improved sessions Jun 06 23:47:16 gotta go, but thanks, I'm glad to know it helps Jun 06 23:47:21 i'm excited to see android's commitment to quality showing through Jun 06 23:47:29 is it possible to setup eclipse to keep my project synced to google code? Jun 06 23:47:42 bmk789: use the Subversion plugin Jun 06 23:47:45 bmk789: you can use the Subclipse plugin and use Subversion to manage source. Jun 06 23:47:51 but that isn't really "keeping it synced" Jun 06 23:48:08 but ill be able to upload and download changes right? Jun 06 23:48:16 uhh, sure. Jun 06 23:48:26 in the way that version control systems allow, yes Jun 06 23:49:08 ok Jun 06 23:58:50 i installed subclipse, where is the world is the menu? ive looked everywhere Jun 07 00:00:39 hum cannot get that damn map example to work Jun 07 00:00:47 i wonder what is wrong Jun 07 00:10:42 basdards! Jun 07 00:12:12 why include a with google api target if it does not work :/ Jun 07 00:17:03 Yo, so I'm looking at the examples in api demo and I'm having an issue with TableLayout Jun 07 00:17:21 I have 1 item, 1 item, 1 item, 1 item, 2 buttons Jun 07 00:17:29 and it's only showing 1 of the two buttons Jun 07 00:34:32 :< Jun 07 00:40:56 Cay|Home: the layouting can be tricky Jun 07 00:41:03 check your xml file Jun 07 00:41:08 anyway good night Jun 07 00:41:20 blkhawk- yes it is figee'd it out thanks Jun 07 00:41:24 forgot to add android:layout_span="2" Jun 07 01:40:13 how do i revert back to a t-mobile build of Android after i've installed JesusFreak's build? Jun 07 01:40:34 Laserbeak43: just download an official update.zip and place it on your storage card then enter recovery mode Jun 07 01:40:40 but fyi, this is a developer channel. you want #android. Jun 07 01:40:52 ahh ok no prob :P Jun 07 01:40:54 thx Jun 07 02:07:39 Hey is there a way to take a value from the strings.xml and actually store it in a string array? Jun 07 02:07:46 it returns int from the R value Jun 07 02:07:54 and I can't seem to find a seemless way to cast it Jun 07 02:10:29 Cay|Home: getString(R.string.WHATEVER) Jun 07 02:10:42 should do it Jun 07 02:11:40 sammyF how about R.array.Whatever? Jun 07 02:15:32 sorry. my cat was destroying my screens. The string you want is stored is in an array or is it just a string? Jun 07 02:16:05 array Jun 07 02:16:26 can't help you there then. never did that Jun 07 02:16:37 :( Jun 07 02:16:44 and nothing in the hot choice window Jun 07 02:23:55 herro Jun 07 02:24:51 herrrro Jun 07 02:25:27 some dirty war vet-hobo threatened to kill me tonight Jun 07 02:25:30 good times Jun 07 02:25:50 how are you doing? :D Jun 07 02:26:10 oh just finishing up my app Jun 07 02:26:18 trying to figeeeeee out why this isn't working Jun 07 02:26:20 you know Jun 07 02:26:23 the same ol' ol Jun 07 02:26:56 sounds like a better use of time :S Jun 07 02:46:03 oh well... no more filthy hobos here. gn **** ENDING LOGGING AT Sun Jun 07 02:59:57 2009