**** BEGIN LOGGING AT Wed Mar 04 02:59:57 2009 Mar 04 04:14:49 i keep getting a signal 11 (SIGSEGV) in my app. is that because i run out of memory, or is there a bug in android? Mar 04 04:16:39 and the app just quits, no "foreclose" option or anything Mar 04 04:24:21 * KNY sighs Mar 04 04:24:30 where did this "foreclose" term come from? Mar 04 04:26:16 it's rough times man, gotta double up on the meanings whenever possible Mar 04 04:28:14 haha Mar 04 04:31:55 lol Mar 04 04:32:49 khert: what was your app doing at the time? Mar 04 04:33:07 ive seen that behavior when using a crapton of skia fonts Mar 04 04:33:26 but sigsegv is a segfault in lower level native code Mar 04 04:44:08 hey guys, is there a simple tutorial to get the content of a URL? I want to retrieve a page (having passed some value as part of the URL) and then do some parsing of the response Mar 04 05:02:40 yllus, you could use either HTTPClient or URL Mar 04 05:03:09 (URL = java.net.URL) see here: http://developer.android.com/reference/java/net/URL.html Mar 04 05:04:19 hm, interesting! I'll give that a try, thanks :) Mar 04 06:00:15 hello, I have a question about activity lifecycles and when the current record should be saved to the database. Mar 04 06:01:30 I'm going by the notepadv3 example, where onPause() creates a new row and remembers the row ID (if the activity is creating a new record) or updates the existing row, and onSaveInstanceState() stores the current row ID in the bundle (if it's editing an existing row). Mar 04 06:02:00 the problem is, when I change screen orientation, onSaveInstanceState seems to be called first, so no row ID is saved in the bundle. Mar 04 06:02:20 then onPause creates a new row, whose ID is never remembered. the activity is recreated and thinks it's creating a new row again, so I end up with duplicate rows every time I flip the screen. Mar 04 06:02:55 s/never remembered/never stored in a bundle/ Mar 04 06:03:33 so what should I do to prevent this? create the record in onSaveInstanceState instead? or can onPause store the row ID somewhere that it can be read after the activity is recreated? Mar 04 06:08:35 slow night, huh? ;) Mar 04 07:58:10 morning Mar 04 08:14:36 i have a q in parsing an xml Mar 04 08:14:57 how to parse: anddev.org rulez =) Mar 04 08:15:16 i want values of myattr and values of mytag Mar 04 08:16:05 i tried characters() and startElement(). somehow the application did not travel inside mytag, but got the values of myattr. Mar 04 08:16:08 please help. Mar 04 09:41:52 moin all Mar 04 11:40:43 How do you detect if a sensor exists? Mar 04 11:41:35 I just noticed SensorManager.SENSOR_TEMPERATURE which I assumed doesn't exist in the G1, but I can't see a way of checking. I've registered a listener on it and am not getting anything from it Mar 04 11:42:36 Hmm. When doing a logcat it does say: W/SensorService( 51): could not enable sensor 4 **** BEGIN LOGGING AT Wed Mar 04 11:44:39 2009 Mar 04 11:45:38 well well.. "SENSOR_TRICORDER - A constant describing a Tricorder When this sensor is available and enabled, the device can be used as a fully functional Tricorder." Mar 04 11:46:10 mickeyc, "SensorManager.html#getSensors() - Returns available sensors " Mar 04 11:46:13 according to doc Mar 04 11:47:03 or you can register the sensor and look out for the return value: " registerListener (SensorListener listener, int sensors, int rate) - returns true if the sensor is supported and successfully enabled " Mar 04 11:50:22 if ((getSensors() & SensorManager.SENSOR_TEMPERATURE ) == SensorManager.SENSOR_TEMPERATURE) { sensor available } else { sensor not available } Mar 04 11:50:27 something like that maybe? Mar 04 12:21:42 How do you get the projected screen coordinated out of a proj & view matrix? (If you have the world coordinate vector) Mar 04 12:26:08 tauno: Thank you Mar 04 13:39:04 anyone on? Mar 04 13:41:39 If you have a question, just ask. If someone has an answer, they'll answer. If nobody does, you'll just get silence. That's IRC :) Mar 04 13:42:56 or you just felt lonely? :) Mar 04 14:57:18 android.hardware.SensorListener.onAccuracyChanged(int sensor, int accuracy) - What is the unit used for "accuracy" Mar 04 15:15:58 mickeyc, SensorManager.SENSOR_STATUS_ACCURACY_HIGH, SensorManager.SENSOR_STATUS_ACCURACY_MEDIUM, SensorManager.SENSOR_STATUS_ACCURACY_LOW maybe? Mar 04 15:16:01 just a guess Mar 04 15:16:10 i was wondering Mar 04 15:16:21 how do i display text that will be able to be seen when you scroll Mar 04 15:16:39 in my emulator my text covers the whole screen Mar 04 15:16:44 but i cant scroll down Mar 04 15:16:49 it gets cut off Mar 04 15:17:34 the text im displaying is in an xml layout using wrap it in a ScrollView Mar 04 15:19:22 don't believe the API docs if they say that TextView takes care of scrolling.. it's a lie ;) Mar 04 15:20:21 ..as is the pie Mar 04 15:28:52 so use scroll view and wrap_content Mar 04 15:44:41 tauno: I think that was it. Thanks again! Mar 04 16:26:32 tauno: don't believe the API docs if they say that TextView takes care of scrolling.. it's a lie << it does take care of it but only horizontally Mar 04 16:29:31 yeah, sorry Mar 04 16:31:06 romainguy Mar 04 16:31:19 the scroll view doesnt work Mar 04 16:31:21 i dont see my text Mar 04 16:31:32 I'm pretty sure ScrollView works though :) Mar 04 16:32:35 can you give me an example of it Mar 04 17:07:58 I get reports from users that my app force closes on rare occasions. Is there anything I can add to my app that will give me some kind of 'crash report'? Mar 04 17:08:35 PLZ SEND ME THE CODES :| Mar 04 17:09:05 essentiall i got that on my blog today in someone's comment - they must have not seen you can download the source code anyway Mar 04 17:13:13 morganx: you could implement logging, or ask for a repeatable test case of some kind. Mar 04 17:17:48 morganx: yes you can Mar 04 17:17:57 do tell Mar 04 17:18:24 Thread.setDefaultUncaughtExceptionHandler(new CustomUncaughtExceptionHandler()); Mar 04 17:19:57 I basically save the system's handler and then implement a custom handler that sends a log and then call's the system's handler Mar 04 17:21:20 interesting. i'll take a look at that. Mar 04 17:21:21 thanks Mar 04 17:21:39 seems to catch a lot of stuff Mar 04 17:21:51 doesn't seem to catch *eveything* Mar 04 17:53:48 Who here is into testing? Mar 04 17:54:07 I have a simple test... assertNotNull(this.mContext.getApplicationContext()) that fails Mar 04 17:54:24 its just an AndroidTestCase Mar 04 17:54:36 it gets interesting... If I sleep for a second before the assert, it passes Mar 04 18:05:14 pastebin a test case? Mar 04 18:13:49 quiet in here since we banned all the dans. Mar 04 18:14:01 oops. quiet in #android too, which is where i meant to say that :) Mar 04 18:25:39 morganx: Sure Mar 04 18:27:12 morganx: http://pastebin.com/d26a28a6d Mar 04 18:30:23 hey how can i extract values of mytag and myattr : ANDROID XML ? Mar 04 18:30:25 please help. Mar 04 18:31:55 you have to get that tag somehow Mar 04 18:32:07 is this just some xml file, or are you using this for layout Mar 04 18:32:20 some xml file i am parsing from the web Mar 04 18:32:40 and how are you parsing it? Mar 04 18:32:42 use one of the xml parsing packages Mar 04 18:32:51 DOM or SAX? Mar 04 18:32:58 famast: where are you calling setContext? Mar 04 18:33:48 SAX Mar 04 18:34:01 set an event for mytag objects then Mar 04 18:34:01 i am able to get the values of myattr. Mar 04 18:34:25 but somehow the app does not get inside characters() method to obrain mytab Mar 04 18:34:28 *mytab Mar 04 18:34:31 *mytag Mar 04 18:35:37 does characters never get called? Mar 04 18:35:45 yeah Mar 04 18:35:48 ever? Mar 04 18:36:00 it does not get called at all. Mar 04 18:36:11 put @Override above your implementation Mar 04 18:36:16 make sure you're actually subclassing the correct method Mar 04 18:36:38 s/subclassing/overriding/ Mar 04 18:36:48 if it throws an error, you made a mistake somewhere; double check the docs and your code. Mar 04 18:37:17 ok. thanks for the help. i am workign on it now. Mar 04 18:38:41 morganx: I'm not calling setContext. Do I need to? I thought it was done by the framework Mar 04 18:40:21 even if i change this.Context to this.getContext() I have no such luck. still null Mar 04 18:41:14 never done any testing with android (tho i really need to) Mar 04 18:41:21 can you override setContext Mar 04 18:41:32 and print a stack trace when it is called Mar 04 18:41:38 so you can see where it is being called from Mar 04 18:41:42 hmm good idea let me try Mar 04 18:41:45 or, better yet, use a debugger. Mar 04 18:41:48 yea i'm just starting to do testing with android Mar 04 18:42:07 debugger? pshaw Mar 04 18:42:47 jasta: its tough to catch it with eclipse debugger Mar 04 18:43:25 ...it is? Mar 04 18:43:33 jasta: Or I just dont know how. Since the tests are being run by something other then your app, you have to manually set in DDMS what app you want to debug Mar 04 18:43:52 jasta: And usually the test only takes a split second... Unless yuo sleep... but sleeping solves the problem..... Mar 04 18:44:04 Debug.waitForDebugger().... Mar 04 18:44:19 causes the VM to block until the debugger connects Mar 04 18:44:22 ah thanks Mar 04 18:44:41 shows up as a red bug symbol in DDMS too Mar 04 18:44:42 jasta: I was crudely sleeping. Still, this will only break for the running thread no? Mar 04 18:45:15 im uncertain on that. it is plausible to think that the VM would halt entirely Mar 04 18:45:21 but i do not know for certain Mar 04 18:45:22 that would be ideal Mar 04 18:45:44 i would suspect it does Mar 04 18:45:52 i know jwdp supports that Mar 04 18:46:05 jdwp that is Mar 04 18:48:42 AndroidTestRunner is calling setContext via method setContextIfAndroidTestCase Mar 04 18:48:56 it seems to call it for every test case too Mar 04 18:50:05 odd. i'm not seeing how it could be null Mar 04 18:50:33 morganx: Maybe its being called after or while the test case is running Mar 04 18:51:20 the context itself is not null, just getApplicationContext is... Mar 04 18:51:40 hey dan Mar 04 18:54:22 howdy Mar 04 18:56:39 why does repo default start you off a branch? Mar 04 18:57:09 also, why does git let you commit when you're on "(no branch)", but then on checkout appear to permanelty lose your changes? Mar 04 18:57:53 what is jdwp anyhow Mar 04 18:58:46 the java debug wire protocol Mar 04 18:58:58 hmm. how to run test cases from the command line. been so long since i did a junit setup from scratch. Mar 04 18:59:01 thanks Mar 04 18:59:27 morganx: If you look in the apidemos for AllTests.java there are some examples how to run in the cmd line Mar 04 18:59:43 thanks Mar 04 19:00:08 theres several ways to run it depending on whether your doing all tests, a particular test suite or whatever Mar 04 19:03:40 jasta: because you're using git wrong? :( Basically, everything should always been in an established branch. Mar 04 19:05:32 if you commit with (no branch), you're really creating unreferenced commits that just sit there until the next gc. Mar 04 19:08:44 hmm. i wonder if testing helpers will be added to build.xml Mar 04 20:05:20 who has a better solution for testing threads then to instantiate/start the thread, sleep for a few seconds (while the thread finishes) and then check the results? Mar 04 20:08:08 fadden: Thread.join()? Mar 04 20:09:01 I think you mean famast Mar 04 20:09:23 yea he does Mar 04 20:09:54 I never use join and keep forgetting about it. Thanks though that might be just what I need Mar 04 20:13:28 s/fadden/famast/ yeah, and Thread.join() is your friend if your design is to block until the worker thread exits Mar 04 20:15:38 otherwise you can use one of Java's several synchronization mechanisms Mar 04 20:15:44 like a countdown latch etc. Mar 04 20:20:47 I saw a sample of someone using a Lock, but join to me seems to be much better Mar 04 20:21:21 using Thread.join() is the *preferred* way of blocking until a worker thread has finished Mar 04 20:21:33 it's very clean and low overhead Mar 04 20:23:54 ctate: that remind me of a multi-threaded design I once created at Sun Mar 04 20:24:02 it was for a photo viewer app Mar 04 20:24:03 uh oh Mar 04 20:24:18 for a slideshow it was loading the photos in small batches in threads Mar 04 20:24:24 and somehow Mar 04 20:24:28 prefetch/predecode? Mar 04 20:24:30 after several long nights of work Mar 04 20:24:45 I noticed that I designed my code so that each thread was join()-ing on the previous thread Mar 04 20:24:46 ... Mar 04 20:24:53 ha ha ha ha ha Mar 04 20:24:59 poor romainguy_ :) Mar 04 20:25:44 fortunately the app is not too bad :) Mar 04 20:27:11 hey while parsing an xml from the web via SAX parser, my app does not go into the characters() method. Mar 04 20:27:38 ANDROID SAX Mar 04 20:27:54 i want to extract values of and myattr. Mar 04 20:28:05 my app gets the value of myattr. Mar 04 20:28:19 but does not get into character() method to get values of Mar 04 20:28:22 please help Mar 04 20:29:54 ... Mar 04 20:29:57 so, what happened last time Mar 04 20:30:06 when you put in @Override, was there an error about not overriding? Mar 04 20:30:14 or was it happy with that Mar 04 20:30:20 OHH viju85 why didn't you say you were using a SAX parser EARLIER Mar 04 20:30:24 if it was happy with @override, you probably have a larger issue. Mar 04 20:30:39 i didn't have a clue what you were talking abuot Mar 04 20:30:40 there was no error Mar 04 20:30:45 btw the SAX parser is too frikin slow =( Mar 04 20:30:58 but the app did not even get into characters() method Mar 04 20:31:02 why is that? Mar 04 20:31:06 god hates you? Mar 04 20:31:10 lolz Mar 04 20:31:26 actually Mar 04 20:31:32 I wonder if that only gets called on cdata Mar 04 20:31:34 it gets into the startElement and gets the myattr value Mar 04 20:31:38 or whatever the "literal" oen is. Mar 04 20:31:39 *one Mar 04 20:31:59 yeah, i wonder if that only gets called for CDATA Mar 04 20:32:12 i am not sure. Mar 04 20:32:14 the content of that node might be a TextNode Mar 04 20:32:16 can someone verify that? Mar 04 20:32:40 ANDROID SAX is not cdata? Mar 04 20:32:52 ok so I did an RSS parser so lets see... Mar 04 20:33:11 i use the characters method for inbetween stuff Mar 04 20:33:46 great Mar 04 20:34:00 incase if needed my XML feed is something like this: http://pastebin.com/pastebin.php?dl=m51034c21 Mar 04 20:34:53 so, it's getting travelid trackid="5" Mar 04 20:34:55 but not the 29 Mar 04 20:34:59 yes Mar 04 20:35:03 exactly Mar 04 20:35:16 and it records the endElement for travelid Mar 04 20:35:27 does the lack of an xml header matter? Mar 04 20:35:45 that might have something to do with it, but if it's getting the rest of this stuff, who knows. Mar 04 20:38:02 but there is no lack here. i open the tags and i also close the tags in the XML feed correctly. Mar 04 20:38:31 viju85: Just add an xml header and verify if that changes anything or not Mar 04 20:38:37 my code snippet is here: http://pastebin.com/pastebin.php?dl=d56299297 Mar 04 20:38:57 yeah thats what i have done. take a look at the code snippet. it is very small Mar 04 20:39:05 so you have Mar 04 20:39:07 in your xml file? Mar 04 20:39:44 Use the Log class if you're doing this in android instead of System.out.println Mar 04 20:39:50 viju85: also where is your else condition Mar 04 20:40:01 yeah, there's that too. Mar 04 20:40:34 why do u need else condition when else if is present? Mar 04 20:40:47 for every other possible condition Mar 04 20:40:50 just incase :) Mar 04 20:41:16 if(x) { } else if(y) { } else { z, p, q, r, null, etc } Mar 04 20:41:38 are you running this with a debugger, or are you just using the System.out.printlns for diagnosing your problem? Mar 04 20:41:57 i am running adb logcat Mar 04 20:42:02 set a breakpoint on startElement, endElement, and characters and run in debug; you might figure the problem out. Mar 04 20:42:09 viju85: Can you post your code that calls the parse method Mar 04 20:42:17 just the bits that do that part too Mar 04 20:42:17 as in actually use the debugger, not just logcat. Mar 04 20:42:50 my actual code is here which is also very small and simple. pelase have a look: http://pastebin.com/pastebin.php?dl=m34eb68f6 Mar 04 20:43:50 viju85: Yes but that is the handler code. I'm talking about what calls parse... Mar 04 20:44:01 viju85: What encoding are you using in the parse method Mar 04 20:44:18 something like Xml.parse(stream, Xml.Encoding.UTF_8, handler); Mar 04 20:45:03 i am not usign any xml encoding schema. Mar 04 20:45:05 ok Mar 04 20:45:11 i just use: xr.parse(new InputSource(url.openStream())); Mar 04 20:45:14 ok Mar 04 20:45:55 but the app should execute characters() method when it hits the tag right? Mar 04 20:45:57 viju85: the code looks fine at first glance (horrible mistakes aside), which is why we're asking you to step through with a debugger Mar 04 20:46:14 ok how to use the debugger Mar 04 20:46:14 ? Mar 04 20:46:25 you are using eclipse? Mar 04 20:46:28 let me use that also and see if i can find any loop holes Mar 04 20:46:29 yes Mar 04 20:46:47 http://www.ibm.com/developerworks/library/os-ecbug/ Mar 04 20:46:52 first hit on "eclipse debugger" Mar 04 20:47:07 you right click in the blue/gray area to the left of your code, and hit "set breakpoint" Mar 04 20:47:12 that sets a breakpoint Mar 04 20:47:19 ok then? Mar 04 20:47:21 then, use the little bug icon instead of the play icon to start debugging Mar 04 20:48:07 not directly android related, but i need to encrypt a file for my app once, then store the key in the app so users can read the file Mar 04 20:48:21 what would be the best way to store a AES SecretKeySpec ? Mar 04 20:48:39 save it as a file in the app directory Mar 04 20:49:04 I'm assuming that if they have root to get to there, they can look at Preferences, as well as any sql stuff. Mar 04 20:49:21 Alternately, store it with Preferences Mar 04 20:49:23 (cleaner) Mar 04 20:49:44 how though, should i get the byte array and store is as a string? Mar 04 20:50:16 I guess that's really up to you Mar 04 20:50:24 I don't think you need to worry about performance for something that size. Mar 04 20:50:35 storing it as a hex string is probably just fine Mar 04 20:50:48 ok i am using the debugger now Mar 04 20:53:12 ok if i want to continue the application process once hits the breakpoint. what should i do? Mar 04 20:53:55 i got it. thanks Mar 04 20:54:55 but still the XML parsing does not work. Mar 04 20:55:21 it gets inside characters(). but does not get inside the travelid loop Mar 04 20:55:27 well Mar 04 20:55:33 maybe you should see what values it passes for characters Mar 04 20:55:38 and you should see when and if it sets travelid Mar 04 20:55:41 and why! Mar 04 20:55:45 hit the step over button Mar 04 20:55:47 or even the step into button Mar 04 20:55:51 and STEP THROUGH your execution Mar 04 20:56:05 set breakpoints on startElement and endElement Mar 04 20:56:20 ok lookign into it now. Mar 04 21:02:02 Hey all.. I'm trying to get an AlphaAnimation runnin on a View object I've built, but it's not taking. Anyone have tips on how to figure out what's going on? Mar 04 21:02:13 what's not happening? Mar 04 21:02:30 the animation isn't running at all Mar 04 21:02:42 you're calling startAnimation? Mar 04 21:02:46 yep Mar 04 21:02:55 what's the duration on your animation? Mar 04 21:03:03 mPitch.startAnimation(animation); Mar 04 21:03:05 100ms Mar 04 21:03:28 The view is nested in another view, I was wondering if that could be an issue..? Mar 04 21:03:57 try a longer duration and see if it's more visible/noticable Mar 04 21:04:47 no dice Mar 04 21:05:16 so I've gotten it working on the parent view before. But I have a bit of a funny call trace set up. Mar 04 21:05:47 having a view nested in another view shouldn't be a problem Mar 04 21:06:38 didn't think so, but I was wondering if there was anything special I had to do. Maybe invalidate() or something (which I tried for kicks and it didn't seem to do anything) Mar 04 21:06:50 I have an AlertDialog whose negative button i want to have exit my app. I know in normal Java I would just write System.exit(0) or something. Is that safe and/or correct for Android? Mar 04 21:06:56 no,you should be able to just startAnimation() on the View Mar 04 21:07:02 yeah.. Mar 04 21:07:09 tbr: no, we don't do that in Android apps Mar 04 21:07:24 The view itself is a subclass of ImageView Mar 04 21:07:30 haha yeah i figured. what is the appropriate way to exit my application then? Mar 04 21:07:39 tbr: nothing Mar 04 21:07:47 tbr: finish() your activity Mar 04 21:07:50 tbr: either the user presses Back or that's it Mar 04 21:08:04 when the user presses Back, the activity is finish()-ed Mar 04 21:08:56 ok, thanks Mar 04 21:13:10 and .. thanks guys. i found where i was going wrong in the XML SAXparser. now i shall debug them. Mar 04 21:13:12 thanks. Mar 04 21:14:56 Does it matter if I am manually drawing my View objects? Mar 04 21:15:18 bdodson: how do you draw them? Mar 04 21:15:33 mPitch.draw(canvas); Mar 04 21:15:39 then yeah it matters Mar 04 21:15:42 it just won't work Mar 04 21:15:47 hah.. oh :) Mar 04 21:15:51 what should I be doing? Mar 04 21:16:01 it's the parent of the View that's responsible for driving/applying the animation Mar 04 21:16:08 why are you drawing the views manually? Mar 04 21:16:19 nothing else seemed to work.. Mar 04 21:16:26 ?? Mar 04 21:16:43 I need to programmatically create them Mar 04 21:16:54 bdodson: what does the view do? you said it's a custom ImageView right? Mar 04 21:16:57 bdodson, itäs your fault, really (believe me - it's always my fault if something seems not to work for me and I come here asking for help ;) ) Mar 04 21:17:07 ä==' Mar 04 21:17:16 I have an array of shapes that I've generated Mar 04 21:17:26 I stuck the Drawables in ImageViews and drew them Mar 04 21:17:28 bdodson: that doesn't mean you have to draw them manually Mar 04 21:17:33 just put the Views in a layout Mar 04 21:17:40 there are many things that won't work right if you don't do that Mar 04 21:17:45 sure Mar 04 21:17:46 ok Mar 04 21:17:47 (invalidate in particular just won't work) Mar 04 21:17:50 that makes sense Mar 04 21:18:14 so just use a generic LayoutView or whatever it is and stick my Views in there Mar 04 21:18:27 yes Mar 04 21:18:36 (except LayoutView doesn't exist... :) Mar 04 21:19:09 LinearLayout ;p Mar 04 21:19:18 ViewGroup Mar 04 21:19:21 thanks Mar 04 21:19:52 you can't use ViewGroup directly Mar 04 21:20:01 it's an abstract class Mar 04 21:22:00 that's fine, I had a class that should have extended ViewGroup Mar 04 21:22:09 do I need to do anything special with the onLayout method? Mar 04 21:22:18 yes Mar 04 21:22:22 you have to layout the children Mar 04 21:22:25 also Mar 04 21:22:28 you need to measure them Mar 04 21:22:44 this is gonna take some work :) Mar 04 21:22:49 not really Mar 04 21:22:53 the children are mostly wrapped Drawables Mar 04 21:22:59 why don't you use one of the standard widgets? Mar 04 21:23:02 er layouts Mar 04 21:25:39 why is AbsoluteLayout deprecated? Mar 04 21:26:03 android devices are different sizes Mar 04 21:26:21 and the elements may be different sizes as well Mar 04 21:26:25 grr - i'm trying to generate a AES key, convert it to hex and store it in my first activity, then I want to use it in another activity to encrypt a file. But when I pull it back out from the SharedPrefences, it doesn't seem to be a valid key. http://paste.ifies.org/397 is where i generate it and http://paste.ifies.org/398 is where i pull it out again Mar 04 21:26:26 fine, but if I calculate my object locations/sizes using the canvas size... ? Mar 04 21:26:34 can anyone see where i might be going wrong with it? Mar 04 21:26:40 easier to use a RelativeLayout in that case :D Mar 04 21:27:44 cool, definitely on the right track now. Gotta run to a meeting, thanks for the help :) Mar 04 21:28:23 line 71 in my second file, it causes 03-04 21:22:11.239: WARN/System.err(31827): java.security.InvalidKeyException: Key length not 128/192/256 bits. Mar 04 21:30:19 I have an activity that leaks memory when it is not defined as singleTask or singleInstance...don't get it... Mar 04 21:35:46 do'h, i was getting the byte array on the hext string, i need to convert it back to a byte array Mar 04 21:52:33 jasta: you ever have onUnbind() not get called when you think it should be? Mar 04 22:08:42 zhobbs: no. Mar 04 22:09:07 i use onUnbind to detect when i should cleanup my player service, which i have never observed not getting cleaned up Mar 04 22:09:38 do you bind/unbind in onStart/onStop? Mar 04 22:09:47 yes Mar 04 22:10:07 onCreate/onDestroy is the wrong model for a variety of reasons. some folks at google seem not to know that :) Mar 04 22:12:08 ctate: no, because Google's using git wrong. repo init / repo sync causes all projects to be on "(no branch)" Mar 04 22:14:34 if google were using git right, there would be no repo :D Mar 04 22:14:47 zing! :) Mar 04 22:33:30 zinx: if git were usable by humans... ;) Mar 04 22:35:56 us mere mortals Mar 04 22:36:08 use SVN! Mar 04 22:36:10 ctate: i think this is actually a bug in repo. Mar 04 22:36:14 a pretty big one :) Mar 04 22:36:25 file a bug, please Mar 04 22:36:34 well i'm not sure is why i'm asking Mar 04 22:36:40 maybe it was intentional and i just disagree? :) Mar 04 22:36:52 i've actually lost code because of this though Mar 04 22:37:01 well, what would you expect? that repo init / sync put all projects on 'master' ? Mar 04 22:37:05 i didnt expect that i would be on "(no branch)", and git happily allowed me to commit Mar 04 22:37:16 ctate: i expect it not to put you on any branch Mar 04 22:37:22 not the "(no branch)" branch. Mar 04 22:37:31 err, isn't that what "no branch" means? Mar 04 22:37:37 which poofs out of existence when you checkout to a new branch Mar 04 22:37:48 ctate: no, in git, not having any branches causes "git branch" to print nothing. Mar 04 22:38:00 repo, meanwhile, gives you a branch called "(no branch)" that disappears on checkout Mar 04 22:38:16 normally in git without a branch, git commit would complain at you Mar 04 22:38:17 hrm. what does 'git branch' print out after the repot init + sync, then? Mar 04 22:38:24 ctate: "* (no branch)" Mar 04 22:38:31 ah, is ee Mar 04 22:38:42 then git checkout -b master korg/master creates master, switches you to it, and deletes forever "(no branch)" Mar 04 22:38:51 any commits you put into "(no branch)" seem to go with it. Mar 04 22:39:01 maybe linus could manage to pull them out somehow, but lord knows how anyone else would Mar 04 22:39:12 i wonder whether repo has to create *something* in order to do its init Mar 04 22:39:16 well, its sync Mar 04 22:39:26 then it should be master. Mar 04 22:39:30 because that's what it actually checked out Mar 04 22:42:57 what does 'git branch' say after you checkout master? Mar 04 22:43:06 I have Activity 1 which starts Activity 2, which starts Activity 3. When I hit "back" in Activity 3, I want it to go back to Activity 1 instead of Activity 2. How do I do that? Mar 04 22:43:32 mickeyc: when Activity2 starts Activity3, it should then immediately call finish(). Mar 04 22:43:32 finish() Activity2 when you start Activity3 Mar 04 22:43:42 Thanks Mar 04 22:43:58 [which shuts down the activity and removes it from history] Mar 04 22:44:18 you might try passing flags also Mar 04 22:44:25 That makes sense. I understand the way activities are stacked. I should have guessed that to be honest Mar 04 22:44:34 mickeyc: have you looked at Intent flags? Mar 04 22:44:48 ctate: "* master" only, of course. "(no branch)" disappears forever. Mar 04 22:44:57 herriojr: for specifically what he wants to accomplish, we just gave him the preferred answer :) Mar 04 22:45:00 Nope. I only started looking at Intents for the first time a couple of hours ago Mar 04 22:45:11 Total newbie Mar 04 22:45:15 ctate: yeah, but he might want to know it for the future :) Mar 04 22:45:27 I'll look up intent flags Mar 04 22:45:28 ctate: subsequent repo sync's also keep it as you have it. so only the first time you do anything do you need to pay attention to this mysterious /dev/null branch Mar 04 22:45:42 damn, encryption and decription is slow on android :| Mar 04 22:45:44 ctate: and what if he doesn't hit the back button, maybe he wants to go back to activity 2 Mar 04 22:46:04 "I want it to go back to Activity 1 instead of Activity 2." Mar 04 22:46:16 in the specific instance he sited Mar 04 22:46:18 *cited Mar 04 22:46:32 finish() worked perfectly. Thanks Mar 04 22:46:38 ok ;) Mar 04 22:46:40 but that is the question i was answering! :) Mar 04 22:47:03 yes, for other kinds of history behaviors sometimes intent flags are part of getting the desired behavior -- herriojr is certainly right about that Mar 04 22:47:04 ctate: I'll just stop arguing :) Mar 04 22:47:05 I'll still look up intent flags anyway. ;) Mar 04 22:47:27 I'm currently scaling a steep learning curve Mar 04 22:47:31 activity/task/history stuff is subtle, yeah Mar 04 22:53:09 task is the concept I haven't figured out Mar 04 22:53:31 a task is more or less the sheaf of activities in history belonging to a single application Mar 04 22:53:48 "application" in a conceptual sense, though, not necessarily a single-apk sort of sense Mar 04 22:53:51 hence, it's weird :) Mar 04 23:05:28 the default icon for programs is 48x48 but i swear it's displayed as 64x64 everywhere online. What size should I be making them? Mar 04 23:06:16 online where? Mar 04 23:07:28 tbr: 48x48 Mar 04 23:07:34 where are you seeing them 64x64? Mar 04 23:08:00 the web app to manage/add applications to the market Mar 04 23:08:07 anyone here got experience using AES encryption? Mar 04 23:08:21 how to test the application on an android device for testing purposes? Mar 04 23:08:52 it displays them as 32x32 (scaled from the original 64x64) in the listings and as 64x64 when editing the details of an application Mar 04 23:09:03 don't worry about the web app Mar 04 23:09:11 tbr: wugh. where's this web app? you want them to be 48x48. Mar 04 23:09:20 http://market.android.com/publish/Home Mar 04 23:13:47 I saw 64x64 somewhere too, was a month or two ago though Mar 04 23:17:55 sigh. Mar 04 23:30:28 jasta: fyi, looks look you should probably return true in onUnbind() if you want to get onUnbind and onRebind events after everything as unbinded and rebinded Mar 04 23:30:46 you may have already figured that out Mar 04 23:31:47 otherwise it appears onUnbind only gets called the first time it's completely unbinded Mar 05 00:35:20 does alarm manager allow for scheduling at XX:XX:XX or does it only schedule delays? Mar 05 00:36:42 romainguy: you would know this... does alarm manager allow for scheduling at XX:XX:XX or does it only schedule delays? Mar 05 00:38:02 no I don't know this :) Mar 05 00:38:31 blah Mar 05 00:38:33 ok Mar 05 00:40:58 if you were going to schedule a Runnable to run at 10:00pm once a day, how would you approach that? Mar 05 00:41:20 mpardo: if you schedule against the RTC or RTC_WAKEUP sources, those are expressed in wall clock time. Mar 05 00:41:30 i have a ScheduledExecutorService instance scheduling it, but i don't know if there's a good way to schedule the time Mar 05 00:41:50 they use System.currentTimeMillis() as the time base, which is your device's local wall-clock time. Mar 05 00:43:36 when your alarm fires, you schedule a new event the same time the next day Mar 05 00:43:47 [in general this is how you handle recurring alarms] Mar 05 00:43:55 the way to do this simply is to use a Calendar to build the time for you Mar 05 00:44:32 Calendar calendar = Calendar.getInstance(); Mar 05 00:44:32 calendar.setTimeInMillis(System.currentTimeMillis()); Mar 05 00:44:32 calendar.set(Calendar.HOUR, 22); Mar 05 00:44:33 calendar.set(Calendar.MINUTE, 0); Mar 05 00:44:33 calendar.set(Calendar.SECOND, 0); Mar 05 00:44:33 calendar.set(Calendar.MILLISECOND, 0); Mar 05 00:44:35 calendar.add(Calendar.DAY_OF_MONTH, 1); Mar 05 00:44:55 then subtract SystemClock.elapsedTime()? Mar 05 00:44:59 set(AlarmManager.RTC, calendar.getTimeInMillis(), your10pmPendingIntent); Mar 05 00:45:10 ah ok Mar 05 00:45:16 err, that's alarmManager.set(....) Mar 05 00:45:22 see what the Calendar does? Mar 05 00:45:40 first, it is set to the current time Mar 05 00:45:52 then it sets the hour to 10pm Mar 05 00:46:04 [still on the current day!] Mar 05 00:46:18 then resets the hour/minute/second/etc to the start of the 10pm hour, still on the current day Mar 05 00:46:20 for a task i could just do ScheduledExecutorService.schedule(task, calendar.getTimeInMillis(), MILLIS) Mar 05 00:46:22 then it *advances* by one day Mar 05 00:46:42 so it points to "10:00:00.000 pm tomorrow" Mar 05 00:46:44 then sets the alarm then. Mar 05 00:48:19 hmm. i think using ScheduledExecutorService might be prone to drift Mar 05 00:48:29 its delay is always relative to "now" Mar 05 00:48:41 but you may be a few milliseconds (or seconds!) late by the time you call it Mar 05 00:48:47 then a few more the next time Mar 05 00:48:47 etc Mar 05 00:49:16 and it isn't tied to time-of-day at all Mar 05 00:50:26 i would personally use the alarm manager instead Mar 05 00:52:16 hmmm ok Mar 05 00:52:29 just trying to do as little work as possible lol Mar 05 00:53:07 saving time now will cost you more time later (pun intended) Mar 05 00:53:17 i have a bound service that runs the task Mar 05 00:53:48 there's callbacks and junk Mar 05 00:54:20 i don't know how that's gonna work if i have to filter callbacks through a service from a service to the activity Mar 05 00:55:24 like this activity starts service A which runs task A Mar 05 00:55:24 i would have to do this: activity starts service A which schedules service B which runs task A Mar 05 00:57:28 is the source to the "Alarm Clock" app out there somewhere? Mar 05 01:09:14 are handlers needed for multi threading? Mar 05 01:10:27 depends on what kind of multi threading Mar 05 01:10:52 but you can just call new Thread() Mar 05 01:11:12 morganx, that's probably half my battle, I am no genius with programming Mar 05 01:11:24 but there are restrictions on what that new thread can do (ie that thread can't update the View) Mar 05 01:11:42 morganx... ah... Mar 05 01:12:05 I think I am out of my depth, but dont really have any other options Mar 05 01:15:06 any good tutorial out there? I have googled till my fingers bled :p none really got to the point or were overly helpful Mar 05 01:18:50 depends what you are looking for Mar 05 01:19:19 did you read the basic docs on the android developers page? Mar 05 01:19:21 Maddeth: you need to understand threading first, out of the android context. Mar 05 01:19:42 this is a deep and complex topic, so do not expect to find a simple tutorial which "gets to the point". Mar 05 01:19:45 jasta, I get the gist of it Mar 05 01:19:52 hehe Mar 05 01:19:59 there is no "gist" of threading as a programmer. if you understand only the gist, you understand nothing. Mar 05 01:20:44 after you go through pages like http://developer.android.com/guide/topics/fundamentals.html Mar 05 01:20:58 i find that working through the ApiDemos is good Mar 05 01:21:41 what do you think you need threads for? Mar 05 01:21:47 I am trying, I just dont have a lot of time and am just stressing out, sill have a look through them thanks morganx, and sorry for seeming incompetent Mar 05 01:22:15 s/sill/I'll Mar 05 01:22:23 Maddeth: not everyone is meant to be an astronaut... Mar 05 01:22:30 if you know what i mean :) Mar 05 01:22:42 threads can be pretty painful. do whatever you can to avoid them. Mar 05 01:23:20 jasta, I know what you mean, I am pretty good with picking this kind of thing up usually, but because I have pressure on me, its kind of stopping me learing anything if you know what I mean Mar 05 01:29:36 arrr, mpardo left Mar 05 01:33:11 morganx: uhm, what? Mar 05 01:33:18 that is absurd advice. Mar 05 01:36:52 which part? avoiding threads? Mar 05 01:37:10 yes Mar 05 01:37:53 "whatever you can" suggests something broader than you think to folks like Maddeth. Mar 05 01:38:07 including producing an incorrect design. Mar 05 01:38:12 just saying i have seen so many people think they need threads just because they need to 'do lots of things' Mar 05 01:38:28 you did not say "carefully evaluate wheter you need them", you said "do whatever you can to avoid them" Mar 05 01:38:52 whether* Mar 05 01:39:05 that is why i asked him/her what they _thought_ they needed threads for Mar 05 01:39:47 perhaps i could have been more clear, but i'm not sure my advice was absurd Mar 05 01:51:24 Im a him, and I am trying to create a port scanner, yes I know there are a few already on the market (which has really annoyed me as I started this because there was not one) and I want to move on to creating a fully functional network security suite a bit like nmap. BUT. to start I have a deadline due in about 2 months, this includes a write up, I can get a basic functional scanner, but it causes the phone to hang for a minute while its worki Mar 05 01:51:24 ng, I presumed I needed to use multi threading so that it would not cause the phone to hang Mar 05 01:52:15 sounds like you are looking for a Service Mar 05 01:52:31 well Mar 05 01:52:32 morganx, go on Mar 05 01:52:52 is the scanner going to be running when the user isn't looking at your app Mar 05 01:52:58 or only when the user is looking at your app? Mar 05 01:53:10 like can i start a scan then go off and do other things Mar 05 01:53:14 I would like it to be able to run in the background Mar 05 01:53:14 then come back and see the results Mar 05 01:53:22 yes Mar 05 01:53:27 then you need a Service Mar 05 01:53:31 ok Mar 05 01:53:38 by the way, thanks for the help Mar 05 01:53:45 http://developer.android.com/reference/android/app/Service.html Mar 05 01:54:26 To be honest, if I could just get a simple TCP and a simple UDP scanner working within a week I will be over the moon Mar 05 01:55:32 well if you want quick and dirty then you might be able to get away with a thread Mar 05 01:56:02 I would rather do it right first time round, and learn as I go Mar 05 01:58:54 how long does a scan take? Mar 05 01:59:26 depends on how hard it is looking, but I would say 30-60 secs per 1000 pors Mar 05 01:59:34 ports Mar 05 02:00:35 you may well be able to get away with just doing it in a background thread Mar 05 02:01:21 that would be my first try Mar 05 02:01:31 then move to service if you need to Mar 05 02:02:26 ok, ty Mar 05 02:02:44 perhaps looking at this source would help? Mar 05 02:02:45 http://www.thenewfreedom.net/wp/2009/01/28/port-scandroid/ Mar 05 02:02:56 I am not usually this slow or thick, I am just tired and frustrated, and appreciate the help Mar 05 02:03:31 morganx, gah, yeah, I looked at that, its a mess, they have no idea what they are doing and basically ripped off someone elses work Mar 05 02:04:22 How do you correctly utilise a Canvas initialised with a GL object? Mar 05 02:05:21 I have a book, I might just go back to reading that Mar 05 02:30:19 I'mj trying to unit test a thread, verifying that a particular handler is getting the right Message from that thread. The problem I have is that the Message might not get passed until after my test case is over. Any suggestions on how to elegantly attack this problem? Mar 05 02:30:39 I can do a Thread.join, but the thread ends right after sending the message, so that doesn't help Mar 05 02:31:10 the only thing I can think of is to do a Thread.join and a quick sleep right after to give it some time to register the Message Mar 05 02:40:28 in this case i would skip the join Mar 05 02:40:51 and just spin for a few secs testing if the message was received every 100ms Mar 05 02:41:19 that is the approach taken by the concurrent testing framework i use and i find it works quite well Mar 05 02:43:16 morganx: Was hoping for a more speedier solution but if thats the best then thats that Mar 05 02:43:20 thanks! Mar 05 02:43:28 what do you mean by speedier? Mar 05 02:43:40 well sleeping will take time Mar 05 02:43:49 you check to see if you are done every 100ms (or 50ms if you like) Mar 05 02:43:53 only if it fails I suppose Mar 05 02:43:56 right Mar 05 02:44:04 and hopefully that doesn't happen much : ) Mar 05 02:44:07 i guess it shouldn't be doing that more then once =0 Mar 05 02:44:09 exactly ha Mar 05 02:44:28 Could you decrypt a reply hackborn gave me in the forums? Mar 05 02:44:38 http://groups.google.com/group/android-developers/browse_thread/thread/1b63e6a21c21e3fe/04a995bb2a5e24e0?lnk=gst&q=AndyM#04a995bb2a5e24e0 Mar 05 02:45:10 i appreciate DIanne's answer (as always) but I'm not sure exactly what the right solution is Mar 05 02:47:14 is the real question 'how do i get the context in my unit test'? Mar 05 02:47:45 pretty much yea Mar 05 02:47:48 how to make an image appear at the top of a listView, where ListView is implemented via setListAdapter? Mar 05 02:47:57 well getApplicationContext needs to pass a REAL context Mar 05 02:48:00 not null Mar 05 02:48:17 this.mContext is NOT null when the unit test is executed Mar 05 02:48:30 why are you messing with mContext? Mar 05 02:48:31 but it still seems to be in a somewhat init stage when I try to use it Mar 05 02:48:42 because I need my apps context Mar 05 02:48:44 that doesn't seem like a var you should be fiddling with? Mar 05 02:48:49 well its public Mar 05 02:48:57 hmm Mar 05 02:49:00 I thought thats why its there Mar 05 02:49:06 i need my context and I figured that was it Mar 05 02:49:19 sounds like a reasonable guess Mar 05 02:49:20 I expect the test runner to execute tests AFTER my app is setup but apparently that is not the case Mar 05 02:49:52 mContext is protected Mar 05 02:50:20 oh darn Mar 05 02:50:23 what about getContext Mar 05 02:50:52 it just return mContext Mar 05 02:51:04 but getContext IS public Mar 05 02:51:07 hmmm Mar 05 02:51:36 the thing is I tried getContext() and it dind't work either Mar 05 02:51:43 because as you said it just returns mContext Mar 05 02:52:17 the system calls setContext from time to time (after each test i believe) Mar 05 02:53:07 http://dtmilano.blogspot.com/2008/01/test-driven-development-and-gui-testing.html Mar 05 02:53:17 that code uses a method getTargetContext Mar 05 02:53:23 but i don't see the def for that method Mar 05 02:53:55 anyone who knows how to add an image to the top of the entire listView as a first entry to the ListView where ListView is implemented using setListAdapter? Mar 05 02:55:25 morganx: Seems they are using osmething called positron (whatever that is). maybe its aprt of that Mar 05 02:55:44 http://code.google.com/p/autoandroid/wiki/Positron Mar 05 02:55:51 looks interesting Mar 05 02:58:30 hmmm yes it does Mar 05 02:58:37 wonder if its still being worked on Mar 05 02:58:48 i like the eclipse integration Mar 05 02:59:07 " There are APIs to allow you to run code on the main thread to access its objects. " Mar 05 02:59:20 i'm not sure what that means **** ENDING LOGGING AT Thu Mar 05 02:59:56 2009