**** BEGIN LOGGING AT Sun Jan 04 02:59:57 2009 Jan 04 03:38:17 How do I kill an app running on the phone? Jan 04 03:54:28 how do I grab the release-1.0 tag w/ git? I'm not familiar w/ git (I've only used svn before)? Jan 04 03:54:55 or would I use repo for that Jan 04 04:09:09 bherrmann: why are you trying to kill it? Jan 04 04:09:45 savid: You should probably ask that one over on #android, #android-dev here is for app development, rather than platform stuff Jan 04 04:16:27 morrildl, thanks. I actually figured it out :) repo init -u git://android.git.kernel.org/platform/manifest.git -b release-1.0 Jan 04 04:16:34 (at least I think I did) Jan 04 04:17:52 anyways, I'm not developing on platform stuff, but wanted the source from that ver. to help me figure out some inconsistencies between the latest source and 1.0 sdk. Jan 04 05:24:52 anyone in here know how to make an android service that can run a .sh script once a day? Jan 04 05:27:05 Anyone seen SanMehat lately? Jan 04 05:27:34 I think you want to set something up with AlarmManager. I believe you can run the script with Runtime.exec Jan 04 05:28:02 someone showed yesterday that an android app can run a .sh script, but i was wondering if it can be done with a service Jan 04 05:28:15 and i have no idea how, i dont do any programming :( Jan 04 05:28:21 I don't see why you couldn't use that in either. Jan 04 05:28:38 i wrote a .sh script to check and download the latest JF update and tested it, it seems to work great. i just need a way for it to be automated Jan 04 05:29:20 Sounds like it's time to learn Java. Jan 04 05:29:51 or find someone who is bored who can spare 5 minutes of their life to write it Jan 04 05:30:14 It just downloads it and saves it as /sdcard/update.zip? Jan 04 05:30:19 no Jan 04 05:30:33 then it adds a command for the recovery to auto apply it Jan 04 05:30:49 erm, xchat messed that up Jan 04 05:30:56 it was "no, /cache/filename.zip" Jan 04 05:31:07 Cool. How do you do that? Jan 04 05:31:34 echo "--update_package=CACHE:$jfile" > /cache/recovery/command Jan 04 05:32:15 i just ran it to upgrade from 1.3 to 1.31 and it ran perfectly Jan 04 05:32:24 And I assume /cache/recovery/command gets rewritten as part of the update?? Jan 04 05:32:26 next version will have an auto reboot Jan 04 05:32:40 yeah, seems to be erased after the update Jan 04 05:32:48 and /cache also seems to get cleared Jan 04 05:34:25 lemme reupload and refresh the script on my forum and ill let you see it Jan 04 13:33:57 correct me if i'm wrong but long 1231027200992 - 1000*60*60*24*30 != 1232730168288 right? it should be 1228435200992 Jan 04 13:45:19 my bc -l agrees Jan 04 13:45:43 but would any of these numbers fit in a long? Jan 04 13:51:14 Is this valid: Jan 04 13:51:15 static final int SCAN_COMPLETE = 0; Jan 04 13:51:22 IntentFilter i = new IntentFilter(); Jan 04 13:51:38 IntentFilter i = new IntentFilter(); Jan 04 13:51:48 yargh. cut 'n paste issues. one mo Jan 04 13:51:54 i.addAction (WifiManager.SCAN_RESULTS_AVAILABLE_ACTION); Jan 04 13:52:00 Intent bcreceiver_intent = registerReceiver(bcreceiver, i); Jan 04 13:52:00 pastebin ftw Jan 04 13:52:00 :D Jan 04 13:52:09 startActivityForResult(bcreceiver_intent, SCAN_COMPLETE); Jan 04 13:52:15 that last line I suspect may not be what I want Jan 04 13:52:34 basically, I want to know when my bcreceiver was called, so I can use the data it acquired Jan 04 13:53:39 rather, I want to be notified *AFTER* my bcreceiver has completed so I can access its list variable Jan 04 14:10:21 haakjes, should be, i'm subtracting from an epoch long Jan 04 14:12:00 zeroxten: isn't it a double? or is this something java specific? Jan 04 14:12:05 a long is only 32 bits Jan 04 14:12:19 er 31 if it is signed Jan 04 14:12:23 *or Jan 04 14:12:53 well, according to the android date docs, getTime() returns a long Jan 04 14:28:13 brb, off to the tower of london Jan 04 14:28:30 well, right back probably isn't quite true... bbiaw Jan 04 14:35:17 ok, so far i've only followed java examples of code Jan 04 14:35:38 in my app, I have the XML view with 2 buttons, one a login and one exit - how do i add event listners to them? Jan 04 14:37:34 nm, think i may have found what i was looking for Jan 04 14:37:50 setonClickListener()? Jan 04 14:38:39 Anyone here able to tell me how I can be notified in my main program (where I set a RegisterListener), when the target was called ? Jan 04 14:39:09 but i also need to do this.findViewById(R.id.button); Jan 04 14:39:13 ie, I do stuff in my onReceive(). and need to make that available to its parent Jan 04 14:41:55 digitalspaghetti: yes, you need to do that to find the view which you are calling setOnClickListener() for Jan 04 14:57:21 any idea why line 16 & 17 cause a NullPointerException? http://paste.ifies.org/208 Jan 04 14:57:28 sorry my java sucks Jan 04 14:59:52 app loads fine without me adding the event listner, but i've confirmed R.id.button_exit is in the R.java file Jan 04 15:03:10 Are you sure that button_exit exists in layout.loginscreen? Jan 04 15:03:30 yup Jan 04 15:04:32 What is throwing the nullPointerException? Jan 04 15:04:43 http://paste.ifies.org/209 Jan 04 15:04:57 2 secs i'll fire up debugging again Jan 04 15:07:23 the errors message is null Jan 04 15:08:01 did you step through it to see exactly where it is being thrown? Jan 04 15:08:38 I'd try that, I'm not that great with Java so I don't know anything else to recommend :) Jan 04 15:13:28 isnt it R.layout.button_exit ? Jan 04 15:14:29 no, it;s has been given an ID, so that becomes accessable via R.id Jan 04 15:14:34 hmm sec Jan 04 15:15:28 is implementing OnClickListener like that valid? I have no idea, I've been doing setOnClickListener(new View.OnClickListener() {}); Jan 04 15:16:14 dunno Jan 04 15:16:18 but i do it differently Jan 04 15:16:28 (btw my fault R.id.buttonname is ok) Jan 04 15:17:46 http://paste.ifies.org/210 Jan 04 15:18:38 yup, thats how I've been doing it Jan 04 15:19:32 why did you add implements View.OnClickListener Jan 04 15:19:45 mine is just public class connect extends Activity { Jan 04 15:28:29 i was following http://code.google.com/android/samples/NotePad/src/com/example/android/notepad/TitleEditor.html Jan 04 15:29:42 I would assume its valid then :) Jan 04 15:35:36 hrrm tried it your way too Jan 04 15:35:41 must be something with my resource Jan 04 15:38:21 maybe Jan 04 15:38:36 R.java sometimes gets messed up for some reason here :/ Jan 04 15:39:37 I also set the id of my resources using android:id="@+"... not sure if there is a difference between that and just id= Jan 04 15:39:43 yea, i notice eclipse likes to include it Jan 04 15:49:39 android:id seems to fix it Jan 04 15:49:41 thanks Jan 04 15:49:51 google really needs to update their examples :| Jan 04 17:54:11 duds. any idea how i get a custom Object from one intent to another? puExtra / Serialize could not be the way?! Jan 04 18:01:01 whats wrong with putextra? Jan 04 18:01:13 oh you mean an object instead of a value? Jan 04 18:02:22 Falcon4ever yes... an Object Jan 04 18:02:45 i need to send some custom objects to my ongoing intent Jan 04 18:04:26 hmm Jan 04 18:04:32 are you using a bg service? Jan 04 18:06:09 no.. Jan 04 18:06:22 but now im trying it to hold the object in a custom static singelton class Jan 04 18:06:24 maybe it will work Jan 04 18:23:03 if I have a LinearLayout that has two children, how can I populate each of those Lists and display both concurrently ? Jan 04 18:24:21 (eg, each as a pulldown) Jan 04 18:35:44 Are you sure you want ListView and not Spinner? Jan 04 18:41:48 where can i find org.apache.commons.httpclient ? Jan 04 18:42:39 android only seems to have the logging library Jan 04 18:43:04 marklar: no, I honestly have no idea :-) ... but either way, how do I populate two different views on a single screen (I have setup my XML, I think, and need to reference them by id afaik?) Jan 04 18:44:03 I have used LinearLayout, and within that: ListView, ListView, LinearLayout (for a button at the bottom) Jan 04 18:52:59 thats the general over view... create xml, setContentView() with the reference to the xml file, then use findViewById() to find individual views within the layout Jan 04 18:53:23 Spinner is a drop down list of sorts, listview is more for a list thats always visible Jan 04 18:53:39 ok Jan 04 18:53:46 afaik :) Jan 04 18:53:48 Spinner == a single list item visible at a time ? Jan 04 18:54:00 like a dropdown ? Jan 04 18:54:12 yes, and when you click on it it opens a larger list to select from, once you select back to a single itme Jan 04 18:54:16 just like on a webpage Jan 04 18:54:17 *nod* Jan 04 18:54:46 I don't think its recommended to have more than one listview in an activity, but I can't remember where I read that Jan 04 18:54:54 so, I SetContentView to my whole display (eg, the top-level LinearLayout) ... Jan 04 18:55:15 how do I bind an array to a specific list or spinner then ? Jan 04 18:55:43 Spinner s = (Spinner)findViewById(R.id.) Jan 04 18:55:55 is how to get the reference for an individual spinner Jan 04 18:56:23 then use an array adapter along with s.setAdapter() Jan 04 18:57:03 I think they did it in one of the examples, the notepad one maybe? Jan 04 18:57:03 hmmm. lemem try that - thank you Jan 04 18:57:07 np Jan 04 19:02:19 Spinner profile = (Spinner)findViewById(R.id.profile); <-- causes a "java.lang.NullPointerException" Jan 04 19:02:23 my XML contains: Jan 04 19:02:38 Is there something inherently broken with that ? Jan 04 19:04:10 yes Jan 04 19:04:19 the "profie" View is a LinearLayout Jan 04 19:04:21 g'mornin' squire Jan 04 19:04:26 and you are casting it to a Spinner Jan 04 19:04:39 also make sure you do the findViewById *after* setContentView Jan 04 19:04:39 ah. Jan 04 19:04:44 * gcinzh changes it to Spinner Jan 04 19:04:56 * gcinzh has another Q for romainguy, based on our musings earlier ... Jan 04 19:05:23 You said I should call startActivityForResult() to get the return value of an intent Jan 04 19:05:46 o/ Jan 04 19:05:52 but I cannot do that when the intent is called by a registerReceiver Jan 04 19:07:11 ie. I set a registerReceiver for wifi scan complete; I start a wifi scan; I display stuff to screen in a TextView; *only* if and when the broadcast listener is called, do I want to continue to another intent (display list of SSIDs) Jan 04 19:07:32 I haven't figured out how to launch when it's called, and I cannot fire an intent from a broadcastListener Jan 04 19:09:06 you can call startActivity() from the BroadcastReceiver Jan 04 19:09:26 in onReceive() you get a Context parameter Jan 04 19:09:33 just call context.startActivity(myintent) Jan 04 19:09:39 hmmm. that would be awesome! Jan 04 19:09:41 will try Jan 04 19:09:50 but first - need to resolve my View issue ... Jan 04 19:10:06 Context is the central class to pretty much everything in Android Jan 04 19:12:50 Do all components of a layout have to be populated (or at least addressed) ? Jan 04 19:13:40 ie, if I have and I bind something only to Spinner, can I still view it ? Jan 04 19:19:04 right, back to my long problem Jan 04 19:28:24 * gcinzh does a dance of joy Jan 04 19:28:40 (shortlived, though it no doubt will be ... but gotta take what I can get ;) ) Jan 04 19:32:58 heh yeah i know what you mean Jan 04 19:33:32 * zeroxten learns today that in java ints and longs don't play nicely together Jan 04 19:33:48 * zeroxten blames perl to being too easy Jan 04 19:33:52 ehe Jan 04 19:33:55 indeed. Jan 04 19:39:19 ok, so it's not crashing anymore ( \o/ ), and I've bound lists and so on ... but the screen doesn't show the content. .... Jan 04 19:40:40 * gcinzh throws in android:visibility="visible" for good measure Jan 04 19:40:56 you adding the content? Jan 04 19:42:06 List basiclist = new ArrayList(); Jan 04 19:42:11 basiclist.add("One"); Jan 04 19:42:16 setContentView(R.layout.selectssid); Jan 04 19:42:26 ssidview = (ListView)findViewById(R.id.ssidlist); Jan 04 19:42:39 ssidview.setAdapter(new ArrayAdapter(this,android.R.layout.simple_spinner_dropdown_item, basiclist)); Jan 04 19:42:56 hrmm, i'm getting a weird result in android vm. im trying to do a soap request to a URL which is there, i can view it in the browser. But i'm getting a java.net.UnknownHostException Jan 04 19:43:12 i have the 3g icon in the vm Jan 04 19:43:41 any ideas why? Jan 04 19:52:06 * gcinzh needs to attend a 1-week Android bootcamp for "non-programmers" Jan 04 19:52:45 (for some value of non-programmers .... non-Java-programmers, at least) Jan 04 19:55:16 can anyone recommend a resource for learning to use the accelerometer? Jan 04 19:57:18 jammr: first, find a really really tall building ... Jan 04 19:57:36 lol Jan 04 19:58:05 (if you want, I have a very very very simple totally useless programmed-by-a-non-programmer class that compiles to output all the sensors' data to a TextView) Jan 04 19:58:42 that would be great Jan 04 19:59:15 * gcinzh has an aha-moment Jan 04 19:59:31 and I don't mean ("Cry Wolf, ooooooooooooooooh, try not to worry") Jan 04 20:11:31 It does Jan 04 20:11:43 not display ... yarrgghh... Jan 04 20:55:31 one of those days gcinzh ? Jan 04 21:42:57 zeroxten: nah, it's been ok. I got another 2 lines of code working. :-/ Jan 04 21:43:35 (the most frustrating thing is that I'm *SO* slow at development on this thing so far, because I lack all the foundation. Once that's set, I expect pace to increase considerably) Jan 04 21:43:58 It seems I've managed to launch an activity via startActivity(intent), but it has no action ... Jan 04 21:44:07 so, the screen is setup but my class isn't really caleld Jan 04 21:44:10 *called Jan 04 21:52:18 Just to be clear: Jan 04 21:52:24 Intent DisplaySSIDList = new Intent(c, SelectSSID.class); Jan 04 21:52:28 c.startActivity(DisplaySSIDList); Jan 04 21:53:26 .... (from within "public void onReceive(Context c, Intent i)") should call SelectSSID.onCreate() ... right ? Jan 04 21:59:18 Anyone ? Jan 04 21:59:29 hi xtt Jan 04 22:08:46 So I'm noticing not everything in the android source code is available in the SDK. For example, android.Location.LocationManager,registerGpsStatusListener() is not available in the SDK. Why is that? Jan 04 22:13:07 because it's not a public API Jan 04 22:13:18 and also because some of the APIs might be new in cupcake Jan 04 22:19:01 romainguy, this was in the release-1.0 branch Jan 04 22:19:11 then it's a non-public API Jan 04 22:20:56 romainguy. please excuse my newbieness :) but how do I tell when looking at the source code what's public and what's not public? the methods are declared as public, so I guess that's why I'm confused. Jan 04 22:21:39 they're not public if there's a @hide or {@hide} tag in the javadoc of the class/package/method Jan 04 22:22:01 ahh, I see. thanks :) Jan 04 22:25:21 * gcinzh found out he didn't @Override his onCreate() ... so now has a new problem: Jan 04 22:25:53 java.lang.RuntimeException: Unable to start activity ComponentInfo{net.colmans.android.whisper/net.colmans.android.whisper.SelectSSID}: java.lang.RuntimeException: Your content must have a ListView whose id attribute is 'android.R.id.list' Jan 04 22:27:13 static public List ssidlist = new ArrayList(); Jan 04 22:27:14 ListView ssidview; Jan 04 22:27:14 ssidlist.add("Three"); Jan 04 22:27:14 ssidview = (ListView)findViewById(R.id.ssidlist); Jan 04 22:27:14 ssidview.setAdapter(new ArrayAdapter(this, android.R.layout.simple_list_item_1, ssidlist)); Jan 04 22:27:28 ..... and in my res/layout/...xml: Jan 04 22:27:28 android:layout_width="fill_parent" Jan 04 22:27:28 android:layout_height="wrap_content" Jan 04 22:27:28 android:layout_weight="1" Jan 04 22:27:30 /> Jan 04 22:27:38 gcinzh: pastebin? Jan 04 22:27:45 CompBrain: wilco. Jan 04 22:28:47 http://pastebin.com/d7aa0ae95 for the layout xml Jan 04 22:30:26 gcinzh: you are using a Listactivity, your list must have the id @android:id/list Jan 04 22:30:30 http://pastebin.com/d5b1c57ae for my dodgy code Jan 04 22:30:51 what if I have two lists - and want to reference both from the same class .... ? Jan 04 22:31:06 one has to be called @android:id/list Jan 04 22:31:11 but ONLY if you use a ListActivity Jan 04 22:31:15 you don't have to use a ListActivity Jan 04 22:31:27 (and using two ListView on the same screen is not a great idea imo) Jan 04 22:32:03 yeah, I switched one to a spinner after I learned about it ... but was curious. Jan 04 22:34:22 romain: I changed the id to "@android:id/list", saved the layout XML, and now if I try autocompletion of R.id. it doesn't show it Jan 04 22:34:37 so what would I use then, in findViewById ? Jan 04 22:34:43 android.R.id Jan 04 22:35:19 but the screen layout would still use my ListView params, right ? Jan 04 22:35:25 yes Jan 04 22:35:29 interesting ... Jan 04 22:36:22 seriously, if y'all weren't here I'd still be on Hello World! (and only in a TextView) Jan 04 22:36:25 it works! Jan 04 22:36:48 superb - thanks! Jan 04 22:37:56 next - how to bundle data using putExtra ... (else I can just refudge it as a String[])... Jan 04 22:38:03 but that's an exercise for tomorrow night. Jan 04 22:38:05 Thank you again Jan 04 22:58:35 Yay. Got passing data working now too. Jan 04 22:58:48 I really cannot afford another 03h30 morning, but it's so darn exciting ;-) Jan 04 23:03:54 yea, i think i need to get to bed soon Jan 04 23:04:02 it's maybe a blessing my client's API is down Jan 05 00:40:44 Right. Really going to sleep now :D Jan 05 00:40:58 * gcinzh is finally happy with the progress that he's making ... Jan 05 01:35:42 What's the accepted way to indicate a selection in a ListView -- do I need to set the background colour of the cell, myself ? Jan 05 01:35:57 (assuming I don't want it immediately to jump to another activity) Jan 05 01:36:22 (I couldn't find an example of selection persistence in the examples) Jan 05 01:42:33 nope Jan 05 01:42:36 there's nothing to do Jan 05 01:42:52 and if you want to persist selection (which we rarely do) you can use the choice mode API in ListView Jan 05 01:43:10 Is it possible in eclipse to disable "unused variable" warnings for a specific variable (ie, TAG)? Jan 05 01:43:40 yes Jan 05 01:43:44 press Ctrl+1 Jan 05 01:43:51 on the said variable Jan 05 01:43:58 and it should let you suppress the warning for the statement Jan 05 01:44:01 heh, cool :) Jan 05 01:44:06 it will add an @SuppressWarning annotation Jan 05 01:44:36 romain: just found simple_list_item_checked layout ... Jan 05 01:44:44 I'll go through the different layout options Jan 05 01:45:17 romain: I had already set ssidview.setChoiceMode(ssidview.CHOICE_MODE_SINGLE); Jan 05 01:46:04 check out the ApiDemos Jan 05 01:46:45 I did ... has lots of list stuff ... but nothing (afaics) that shows a list with a persistent single selection Jan 05 01:47:45 I kinda just need to go through every single layout option one by one to see how it behaves Jan 05 01:49:35 * gcinzh sees the time and gets nervous ... ok - gotta be up in 5 hours ... time to go :-o Jan 05 02:06:47 gcinzh: there is an example of single selection Jan 05 02:06:52 at least if I remember correctly Jan 05 02:06:59 anyway, the choice mode single is the way to go Jan 05 02:07:04 you just need to use the appropriate layout Jan 05 02:07:25 and android.R.layout.simple_list_item_checked is a good one Jan 05 02:12:13 that's what I did ;-) Jan 05 02:12:22 although since it's 3:12am I'm not really here answering you Jan 05 02:12:43 (actually, I'm trying to find the layout rule to center a button, *THEN* I'm done) Jan 05 02:12:59 android:layout_centerInParent="true" doesn't seem to be as effective as I'd hoped Jan 05 02:13:16 (parent is a horizontal LinearLayout) Jan 05 02:14:42 centerInParent is for relativelayouts I think, try android:gravity="center_vertical|center_horizontal" Jan 05 02:15:24 ah. Jan 05 02:15:25 center_horizontal. Jan 05 02:15:29 I tried only "center" earlier Jan 05 02:15:58 Nope. Jan 05 02:16:47 but doing that in the LinearLayout works Jan 05 02:16:55 (as opposed to in the Button definition) Jan 05 02:17:04 Many thanks! and now I'm really off to bed. **** ENDING LOGGING AT Mon Jan 05 02:59:58 2009