**** BEGIN LOGGING AT Thu Jan 22 02:59:57 2009 Jan 22 03:00:07 ie adb -d shell ls /data/data//shared_prefs/ Jan 22 03:00:15 where package is com.your.package.name Jan 22 03:01:17 when i did the ls on shared_prefs Jan 22 03:01:24 it says opendir failed Jan 22 03:01:26 Permission denied Jan 22 03:01:51 hmm, sounds like a problem Jan 22 03:01:55 yea Jan 22 03:01:56 do you have room on your phone? Jan 22 03:02:00 root Jan 22 03:02:03 on your phone? Jan 22 03:02:21 dont think so Jan 22 03:02:26 i'm looking at one thread that suggests removing your package dir Jan 22 03:02:33 ie rm /data/data/ Jan 22 03:02:40 ok Jan 22 03:02:52 when you update your code are you uninstalling and reinstalling? Jan 22 03:02:59 or just updating? Jan 22 03:04:32 well i just do a run app from eclipse Jan 22 03:04:37 i think it reinstall it right? Jan 22 03:04:42 not 100% sure Jan 22 03:05:17 yea i see it says removing package and then new package installed Jan 22 03:06:11 hmm, when my sdk removes a package it also removes /data/data/ Jan 22 03:08:36 ok Jan 22 03:09:35 so is there special settings required to store sharedpreferences Jan 22 03:11:05 not sure. i don't see any from the javadoc, but i see many newsgroup posts where people are having problems. and I've seen a couple mentions of a possible processID bug. Jan 22 03:11:32 yea from the google group i see that it should be pretty easy to do this Jan 22 03:11:44 but i have been sitting here all day trying to figure this out Jan 22 03:11:44 is this your problem: http://code.google.com/p/android/issues/detail?id=940&q=SharedPreferences commit&colspec=ID Type Version Security Status Owner Summary Jan 22 03:12:07 suck Jan 22 03:12:27 funny, i was just about to add shared prefs to an app Jan 22 03:12:36 haha Jan 22 03:12:58 well from the last thread, ppl mentioned that it returns false as a bug Jan 22 03:13:12 but it also mentioned that the data were still stored Jan 22 03:13:15 but not in my case Jan 22 03:15:59 hmm, on mine it returns false but stores the data Jan 22 03:16:09 let me try updating an existing value Jan 22 03:16:15 ok Jan 22 03:16:53 updating an existing value works (but also returns false) Jan 22 03:16:55 do u need to ass any permission in the manifesst? Jan 22 03:17:02 i didn't Jan 22 03:17:03 add i meant Jan 22 03:17:09 argh Jan 22 03:17:14 out of ideas Jan 22 03:17:46 what does 'ls -l' show for your shared_prefs dir? Jan 22 03:18:03 ie adb -e shell ls -l /data/data//shared_prefs Jan 22 03:18:10 same opendir failed, Permission denied Jan 22 03:18:33 are you using eclipse? Jan 22 03:18:47 yea Jan 22 03:19:36 hmm, do you see the same behavior with the emulator? Jan 22 03:20:01 actually didn't even try in the emulator Jan 22 03:20:08 thought go straight to the phone Jan 22 03:20:20 i would try the emulator as a sanity check Jan 22 03:20:33 if it doesn't work there you are hosed : ) Jan 22 03:21:33 great Jan 22 03:23:57 there is no need of a xml file or anything for me to use the SharedPreferences right? Jan 22 03:24:29 ok it shows up as false in emulator as well Jan 22 03:24:32 i must be doing something wrong Jan 22 03:24:51 well, in my emulator it always returns false Jan 22 03:24:57 but it always stores the value Jan 22 03:25:03 i emant when reading it back? Jan 22 03:25:15 or when doing a contains? Jan 22 03:25:52 my test was 1) store value 2) look at service_data.xml to see if the value was there Jan 22 03:26:36 can you check if the file exits on the emulator? Jan 22 03:26:58 yea i see the file Jan 22 03:27:10 i can't use vi on android? Jan 22 03:27:42 use 'cat Jan 22 03:28:06 ok yea it's empty Jan 22 03:28:25 just have the xml tag and the map tag Jan 22 03:29:47 and you code looks like this: Jan 22 03:29:48 http://android.pastebin.com/m60a9ea55 Jan 22 03:32:41 i actually have it like http://android.pastebin.com/d55207f28 Jan 22 03:32:55 gonna try to get the Editor object and see if it makes a difference Jan 22 03:34:10 oh, yeah you need to use the same Editor Jan 22 03:40:14 YESSSSS, thank you Jan 22 03:40:21 now i feel really dumb Jan 22 03:40:34 don't Jan 22 03:41:00 great thanks a lot Jan 22 03:41:03 the android API isn't exactly 100% clear Jan 22 03:41:05 i was about to give up Jan 22 03:41:08 glad to help Jan 22 03:41:10 bedtime Jan 22 03:41:15 alright Jan 22 03:41:16 goodnight Jan 22 03:41:16 later Jan 22 04:23:41 Is there anywhere to get the reason for a failed editor.commit() ? Jan 22 04:25:54 I always get false from editor.commit() - yet I can see that the value were written successfully when i cat /data/data/com.foo.my.app/shared_prefs/MyPrefs.xml Jan 22 04:36:08 interesting. seems that Editor.commit() always returns false in android sdk 1.0 land. it appears to have been fixed in cupcake tho. Jan 22 12:06:38 Is there a possibility to use strings from strings.xml in the arrays.xml? Jan 22 12:06:54 I have tried @strings/name but it doesn't work Jan 22 12:58:11 anyone use remoteviews? Jan 22 13:16:43 can you sub-folder resources Jan 22 15:45:45 hiii Jan 22 15:55:38 morning Jan 22 15:59:57 have you played with remoteviews? Jan 22 16:00:31 no sorry I haven't Jan 22 16:04:05 trying to figure out if i can discover where the user clicked on a notification Jan 22 16:04:18 or have events triggered by clicks on different views in side the remoteview Jan 22 16:04:54 brb Jan 22 16:19:25 is there a sample where _COUNT is used when querying a content provider? Jan 22 16:19:34 and I did google search it :) Jan 22 17:25:28 does anybody know a way to discover if the user has a photo? the APIs to read photos all return a Bitmap even if there's no such photo, and I'm not sure if I can easily compare it to whatever default I pass (i think object equality won't work as it will be newly instantiated from storage) Jan 22 17:27:51 TD: contact image? or photo from media provider? Jan 22 17:28:10 contact image, as stored in the address book Jan 22 17:43:18 blau-MikeDG what do you want to know about remote views? Jan 22 17:43:41 TD: well, just check to see if the contact has the photo URI Jan 22 17:43:52 TD: if that's what you're talking about Jan 22 17:44:20 not sure how to do that ... there's no column constant for it in Contacts.People. How do I obtain just the raw URI? Jan 22 17:44:38 just a sec, I'll look it up Jan 22 17:44:48 thanks! Jan 22 17:45:09 there's a PHOTO_VERSION column, but i'm not sure what that is in the various cases. it just says it's used for sync. Jan 22 17:46:57 so the query is built as follows: Jan 22 17:47:31 Uri.withAppendedPath(person,Contacts.Photos.CONTENT_DIRECTORY) Jan 22 17:47:36 herrior: hey sorry Jan 22 17:47:47 np Jan 22 17:47:56 herriojr: i was trying to find out if theres any way for a remote view to interactc with the user Jan 22 17:48:10 like for it to detect swiping on it, or to detect a touch in a certain location Jan 22 17:48:33 blau-MikeDG: so, there's only a limited number of view types which can be part of a RemoteView Jan 22 17:48:42 right Jan 22 17:49:17 actually, I never got past that since what I was doing required more view types than were supported Jan 22 17:49:36 what are RemoteViews used for? Jan 22 17:49:51 zhobbs: they're used for Notifications currently Jan 22 17:50:12 Ahh, so you can add a View to the notification bar when it's pulled down? Jan 22 17:50:13 TD: did that help? Jan 22 17:50:25 yeah im using them for notifications Jan 22 17:51:09 zhobbs: yes, you can have a limited-custom UI for your notification Jan 22 17:51:58 so can you use remote views to provide a view another app can drop in their UI? Jan 22 17:52:04 blau-MikeDG: as I said, I never got far enough to try getting user input....let me know how it goes since I'm interested in whether it can be done :) Jan 22 17:52:15 zhobbs: yes, but it is very limited Jan 22 17:52:25 hmm, interesting... Jan 22 17:52:39 zhobbs: there are better ways of doing it if all the applications are written by you Jan 22 17:53:06 herriojr: yeah...was thinking about for other developers Jan 22 17:53:36 zhobbs: ok then :) Jan 22 17:54:21 can you use ProgressBar? and can the process using your remote view touch them? Jan 22 17:54:54 herriojr: i'm just reading the docs for the Contacts.Photos[Columns] classes. so if I query via the contentresolver a URI something like content://contacts/people/123/photo then I'll either get an empty result set, or a single photo record? Jan 22 17:55:53 TD: I don't know for sure, I'll have to look at it Jan 22 17:56:01 hmm. ok. i'll try it. thanks Jan 22 17:56:16 i want the user to interact with my stupid notifications so bad :( Jan 22 17:56:48 blau-MikeDG: yeah, a button could be useful in some notifications Jan 22 17:56:57 the distinction between CONTENT_URI and CONTENT_DIRECTORY isn't clear to me right now. your example seems to be right, that's how other apps do it, but i'm not sure why yet ... i'll keep reading Jan 22 17:57:06 "mark read" for sms/im Jan 22 17:57:15 i agree Jan 22 17:57:17 TD: I think one is just for convenience Jan 22 17:57:39 just tried subclassing textview and adding a listener, no dice :( Jan 22 17:58:13 what about just a vanilla TextView or ImageView with a listener? Jan 22 17:58:33 dont know how to do that, cant get to the views afaik Jan 22 17:58:40 ahh Jan 22 17:58:57 I haven't looked at the docs...didn't even know they existed Jan 22 17:59:43 TD: here's the code that from People.Photos: http://pastebin.com/m4cebe7b8 Jan 22 17:59:47 pastebin.ca seems to be down Jan 22 18:01:08 thanks. interesting. i thought binary resources were handled by storing a file path in sqlite and then having some kind of binder rpc to open it, but i guess not in this case. Jan 22 18:01:23 yeah, depends on how you do it :) Jan 22 18:01:35 that code looks simple enough. i guess the disadvantage is, it actually loads the whole photo if there is one, whereas all i care about is if one exists or not. oh well :) Jan 22 18:36:37 how can a Service get a context in its onCreate method? Jan 22 18:37:40 one sec Jan 22 18:38:42 gmm thought i did it Jan 22 18:38:43 guess not Jan 22 18:40:44 BlindOracle: this Jan 22 18:40:46 BlindOracle -> use this Jan 22 18:41:09 ? Jan 22 18:41:32 Service extends Context Jan 22 18:42:10 (indirectly I think) Jan 22 18:44:31 zhobbs: I actually tried that already..but I wasn't calling it correctly...I went off into left field Jan 22 18:44:32 thanks Jan 22 18:45:53 anyone here good with the apache HTTP Client? Jan 22 18:46:11 I've used it... Jan 22 18:46:14 works like a charm when you actually call it correctly...thanks again... Jan 22 18:46:45 zhobbs: have you ever seen this error before? org.apache.http.client.NonRepeatableRequestException: Cannot retry Jan 22 18:46:50 request with a non-repeatable request entity Jan 22 18:47:18 no, but I don't really reuse the requests Jan 22 18:48:31 hrmm, it's a weird one - the request does work, the second time I try it, but never the first it always fails with that message Jan 22 18:48:40 and only if I try pass paramters Jan 22 18:53:49 it'd be nice if the adt eclipse plugin would help you with strings.xml when it says resource not found or something have a "quick fix" for "create a new string resource" Jan 22 18:54:29 patches are welcome :)) Jan 22 18:55:36 I know...if I make that change to the adt plugin and start using it's probably be a net time gain eventually Jan 22 18:59:16 LOCAL_CERTIFICATE := platform Jan 22 18:59:41 if I put this in the Android.mk for a package I'm building, am I pretty much signing with the platform key? Jan 22 18:59:56 which is to say, am I unable to distribute this on anything but my own firmware image? Jan 22 19:01:04 I'm trying to understand this a little better Jan 22 19:06:11 Anybody? Bueller? Jan 22 19:06:22 romainguy: how do I go about submitting a new patch for the framework (I want to submit a new adapter) Jan 22 19:06:30 source.android.com Jan 22 19:06:34 kk Jan 22 19:06:41 but before you submit something that big, please discuss it on the mailing list Jan 22 19:06:46 in particular, discuss it with me Jan 22 19:07:00 I made a SortAdapter Jan 22 19:07:27 so given a list of Cursors, and how to compare them, it returns them in the sorted order Jan 22 19:07:54 I still have yet to test/optimize it Jan 22 19:08:25 you may not want to submit it then. Jan 22 19:08:32 presented like this, it's a bit vague Jan 22 19:08:39 list of Cursors? Jan 22 19:08:40 vol: I wasn't planning on submitting it until then :) Jan 22 19:08:42 "hey guys here have this untested patch, maybe it works, maybe shit breaks, who knows" Jan 22 19:08:47 please send an email to the -framework mailing list to discuss the usefulness Jan 22 19:08:48 and the API Jan 22 19:09:07 from this description, I would say it is not something I would accept in the framework Jan 22 19:09:10 romainguy: kk Jan 22 19:09:13 in any event, can someone explain to me the significance of LOCAL_CERTIFICATE? Jan 22 19:09:22 vol: ask on the mailing lists Jan 22 19:09:24 most of my google search results are source files Jan 22 19:09:25 romainguy is my nub Jan 22 19:09:27 our build experts are not around Jan 22 19:09:31 boo : ( Jan 22 19:16:08 so romainguy: I actually meant a SortCursor not SortAdapter Jan 22 19:16:57 romainguy: the need, is for example, you want to display a list consisting of both Call history and SMS history in reverse chronological order Jan 22 19:17:04 why don't you simply do the sort when you send the query Jan 22 19:17:12 anyway, send an email to android-framework, we'll discuss it Jan 22 19:17:16 two different tables Jan 22 19:17:22 kk Jan 22 19:17:37 and I don't deny the need of such a cursor in some apps Jan 22 19:17:49 you have to think about whether it's a good fit in a *platform* Jan 22 19:17:55 ok, I will discuss further in the list Jan 22 19:17:56 oh ok Jan 22 19:17:57 we can't add features that are too specfic Jan 22 19:18:06 (we already have too many of these :) Jan 22 19:18:06 np Jan 22 19:19:36 it would be nice to have extended api jars...such that we can go to the code.google.com/android and download the more specific things Jan 22 19:19:52 if it shouldn't be stuck in the rest of the framework Jan 22 19:22:51 herriojr: stick it in http://code.google.com/p/android-random/ Jan 22 19:31:20 zhobbs: will do when I finish testing/optimizing Jan 22 19:38:15 Is there an easy way to try and get a location through the gps and if that fails, fall back to network location? Jan 22 19:38:35 not really Jan 22 19:39:03 well, that I know of Jan 22 19:39:17 that is a pity, then I guess I should just ask for both locationProviders and keep the one with the best accuracy... Jan 22 19:39:43 keep the location with the best accuracy I mean Jan 22 19:48:56 mmm shouldnt that work on its own? Jan 22 19:49:17 if you specify a blank criteria, it will return best-accuracy, falling back as needed? Jan 22 19:52:51 Well, you can ask specifically for GPS or network provider. I don't know if it automatically switches to network provider if GPS fails... Jan 22 19:54:00 I use the requestLocationUpdates and there you have to specify the provider. Jan 22 20:02:10 hmm. i'm a sql newbie, but is it really the case that there's no "update or insert if does not exist" type command? Jan 22 20:02:22 i have to try an insert and catch the except, then retry with update? :/ Jan 22 20:02:51 google search results suggest that sql can't actually do this, but i feel that has to have been fixed with an extension or something like that Jan 22 20:05:53 not that I know of Jan 22 20:06:14 instead of doing the insert, you can try to see if it exists Jan 22 20:06:26 by doing a select Jan 22 20:07:58 i guess so. although that'd require duplicating the query three times in slightly different phrasings. catching an exception from insert means i only need two phrasings. hmm. Jan 22 20:08:25 true, but catching an exception isn't "cheap" Jan 22 20:09:08 yeah, but i think a select isn't either. and you only have to catch the exception in the uncommon case (assuming there *is* an uncommon case for your app) Jan 22 20:09:37 i'm surprised though. sql has lots of features but implementing a basic map.put type operation is a lot of work. oh well. Jan 22 20:09:44 A select is pretty cheap if it uses an indexed value Jan 22 20:11:00 i have a service that is supposed to be woken up by the AlarmManager every 5m (using RTC_WAKEUP). 90+% of the time it wakes up on schedule, but sometimes it skips a wakeup. does this sound like a case where I need to acquire the wake lock? Jan 22 20:17:09 romainguy: Actually, who are the build people who would know this? Do they hang around on IRC? Jan 22 20:17:21 I'm looking for documentation before I post a probably stupid question Jan 22 20:19:13 How can the Geocoder work without an internet connection? Jan 22 20:19:43 It can hardly be that there is a complete database of addresses on the phone... Jan 22 20:23:17 balachmar: it doesn't. Jan 22 20:23:24 the geocoder sends the address back to google's servers Jan 22 20:23:34 recent requests might be cached, but that's it Jan 22 20:24:02 vol: Then why does it work, without my app having permission to get onto the internet? Jan 22 20:25:19 It could of course be that it uses Google maps to do it, but then it is a bit nasty. Because then my app would make Google maps go online without the user knowing... Jan 22 20:25:56 balachmar: look at network usage when you make a geocode request. It uses a seperate service to do this, which is how you get around requesting network permissions Jan 22 20:26:37 vol: But isn't that strange? Jan 22 20:27:19 yes, it's probably a design flaw to not request permissions for this. Jan 22 20:28:09 I'll add it to the bugtracker then Jan 22 21:09:33 how can i keep a listview background transparent on a scroll? Jan 22 21:11:06 mpardo: not sure if this is relavent or not: http://android-developers.blogspot.com/2009/01/why-is-my-list-black-android.html Jan 22 21:11:28 looks abour right. thanks Jan 22 21:11:30 I just scanned it Jan 22 21:11:32 k Jan 22 21:11:57 from within a BroadcastReceiver i want to get battery stats, but afaik getting battery stats requires a receiver. but android won't let me chain receivers. Jan 22 21:12:26 morgan: gotta start a service Jan 22 21:12:37 you can't do async stuff in a receiver Jan 22 21:13:20 ok, i'll try receiver -> service Jan 22 21:13:21 cacheColorHint is the attribute, thanks Jan 22 21:13:24 thanks Jan 22 21:14:11 zhobbs: that works Jan 22 21:14:28 that was quick :) Jan 22 21:15:16 i had gone partially down that path then turned back so i was almost there Jan 22 21:18:22 if i am doing: receive broadcast -> get lock -> start service -> do work -> release lock Jan 22 21:18:28 do i need to call stop service? Jan 22 21:19:03 you don't really want to block in your receiver Jan 22 21:19:28 you really want your receiver to just be done after it starts the service, and when your service is done call stopSelf() in the service Jan 22 21:20:32 ok Jan 22 21:27:21 morgan: also, remember you can pass in data to the receiver by adding the data to the intent Jan 22 21:27:30 so you don't need to bind or anything Jan 22 21:28:09 or into the service, right Jan 22 21:28:33 i wonder why getting battery data has to be async? Jan 22 21:29:05 yeah, into the service I meant Jan 22 21:29:49 yeah...it makes sense to have that option if you're making a battery meter, but would be nice to be able to just get the level in one call Jan 22 21:30:44 and it seems like writing a getBatteryLevel() method would be complex Jan 22 21:31:20 because you couldn't call it from all contexts Jan 22 21:31:36 (not android Contexts) Jan 22 21:32:12 anyone worked with detecting if a sd card is present or not? Jan 22 21:32:53 jt436: yeah Jan 22 21:33:20 new File("/sdcard").exist() ? Jan 22 21:33:23 jt436: see android.os.Environment Jan 22 21:33:36 hehe, i guess it couldn't be that easy Jan 22 21:33:39 getExternalStorageState() Jan 22 21:36:34 external may be other devices besides the sd card though Jan 22 21:37:06 oh you can get the directory too Jan 22 21:37:17 jt436: well, when you access the sdcard in theory you should probably use Environment.getExternalStorageDirectory() Jan 22 21:37:41 (I think I'm still hard-coding "/sdcard" so I'm not one to talk) Jan 22 21:38:29 2secs, need to test something Jan 22 21:39:06 morgan: that statement will return true even if the sd card doesn't exist Jan 22 21:39:39 yeah, cause the /sdcard mount point exists, just nothing mounted to it Jan 22 21:40:26 wonder how many developers don't think of that though Jan 22 21:41:12 yeah...there's a lot of stuff in the docs you'd never find naturally Jan 22 21:44:40 if you do /sdcard/mydir it will return true also, you won't get false until you actually try to create something Jan 22 21:44:57 hmm, that's surprising Jan 22 21:45:59 yes, had to check it a few times Jan 22 21:46:12 it will return true for directories but once you try to create a file you will get false Jan 22 21:49:55 odd Jan 22 21:50:44 SanMehat is king of everything SD, so he could probably tell you what's going on... Jan 22 21:51:48 android.os.Environment yields similar results Jan 22 21:52:36 hi. Jan 22 21:52:48 hey ;) Jan 22 21:52:54 whats up? :) Jan 22 21:53:18 poking around with detecting if a sd card is present or not Jan 22 21:53:49 jt436: funny, i'm working on all that right now :) Jan 22 21:53:51 whats up? Jan 22 21:54:05 can you scroll up like 20lines you will see the conversation Jan 22 21:54:11 sure Jan 22 21:54:39 you should use getExternalStorageState() Jan 22 21:55:04 yes i know.. this kinda sucks... i'm going to be adding support for multiple external volumes soon... but for now use that. Jan 22 21:55:16 i tried, i received "mounted" and then for getExternalStroagedirectory() i received /sdcard Jan 22 21:55:28 then you should be good to go. Jan 22 21:56:03 ha, with all the testing of it in and out I have left it in, muppet ;( Jan 22 21:56:22 haha Jan 22 21:56:28 so... whats the issue? :) Jan 22 21:56:43 might be none in a minute when i retest Jan 22 21:56:53 'none'? Jan 22 21:57:21 none as in no issue Jan 22 21:57:26 oh okay :) Jan 22 21:57:57 SanMehat: so eventually getExternalStoragedirectory() will have multiple values? Jan 22 21:58:49 zhobbs: no... 'im going to need to design a superset... Jan 22 21:59:28 i suppose we may need to look at either wiring up the old apis to the new thing and shimming it so that legacy apps can use the default Jan 22 21:59:55 and then eventually deprecate those calls, but i have yet to think about that part. Jan 22 22:00:01 i'm still working on the underlying support. Jan 22 22:00:49 could external storage really be a large internal fixed storage? Jan 22 22:01:12 yeah... ie: a soldered on sd-card, etc.. Jan 22 22:01:29 or an iphone-like large flash volume? Jan 22 22:01:33 yeah. Jan 22 22:01:39 or a second SD card.. Jan 22 22:03:03 I need to make a custom listview so the rows will have black text, do i just need to make the layout? Jan 22 22:03:08 what else is required? Jan 22 22:03:47 make a layout to pass to the adapter, and change the bg color on the listview Jan 22 22:03:58 or on the layout holding the listview, etc Jan 22 22:04:15 or...use the white theme... Jan 22 22:04:17 hmm i did that and it throws an error Jan 22 22:04:39 ah true, that would be easier... i have an idea i'll need to know how to do this in the future though Jan 22 22:05:21 so passing my custom R.layout.blah into SimpleCursorAdapter will work? Jan 22 22:06:42 it should Jan 22 22:07:16 blah, ok... I'll keep looking for mistakes Jan 22 22:08:30 ah i figured it out. Malformed xml Jan 22 22:08:34 bye guise Jan 22 22:12:54 jasta: is the white theme still small, or was it redone for touch? Jan 22 22:13:13 i assume it was redone. i don't know. **** ENDING LOGGING AT Fri Jan 23 02:59:57 2009