**** BEGIN LOGGING AT Sat Jun 20 02:59:57 2009 Jun 20 07:55:40 anyone know why my surface view runs about 30% slower if i leave it and then return to it? Jun 20 07:55:56 cant see any reason why at all but its def slower, goes from 60fps to 40fps Jun 20 08:56:13 raugust: you need the position, not the id Jun 20 10:57:37 anyone familiar with the AudioManager class? Jun 20 10:58:37 I can't seem to get setBluetoothA2dpOn(boolean on) to work. Jun 20 12:48:20 hi there... Jun 20 12:51:08 im really new to java/ android just did c++ and a lot of psp coding back in the day Jun 20 12:51:29 and im stuck with my latest app anybody willing to help me a bit Jun 20 12:52:40 ok i just explain my problem... sorry im a dumb noob when it comes to java Jun 20 12:53:27 i created a user interface which starts a service... so far so good Jun 20 12:54:40 i need to run a if-else statement in a loop since i want to use the audiomanager sercice to check if a the mode is MODE_NORMAL or MODE_IN_CALL Jun 20 12:55:11 i did that before in a gui only ad it works just fine when i use a onclicklistener Jun 20 12:55:32 but i dont know hoe to run it in a background service Jun 20 12:56:27 i placed a while loop in onstart and it tells me the mode but just one time Jun 20 12:56:36 whats wrong Jun 20 12:56:36 mechanicFFM: check out asynctask. It might be what you're looking for Jun 20 12:57:09 * sammyF is waking up, so give him a few hours and some coffee before he can get more specific :P Jun 20 12:57:34 thanks will take a look Jun 20 12:58:11 im shure its just a damn noob problem as im new to android Jun 20 12:58:31 never coded in java before only c++ Jun 20 13:00:19 if someone is willing to help i could send some code example of what im trying to do Jun 20 13:02:35 checked the asynctask but im not shure if thats what i need Jun 20 13:05:43 can i put a while loop in onstart in a service? Jun 20 13:06:21 or do i need a custom listener if i want to check the audio modes Jun 20 13:15:14 looks like im alone with my problem Jun 20 13:15:51 anyway if someone is willing to help me out let me know thanks Jun 20 14:02:16 Is it possible to profile your app? Jun 20 14:06:38 ravon: http://groups.google.com/group/android-developers/browse_thread/thread/7b368027d23b7c17 Jun 20 14:07:53 also google for "android traceview" Jun 20 14:10:32 Rexxars: ah, thanks! Jun 20 15:37:07 I need to create an Http connection then I need to read the data from server,Which class are necessary for that Jun 20 15:38:17 there is 50 different ways to do it Jun 20 15:38:25 *are Jun 20 15:39:14 tell me the esiast way,I need the connection with the http server and need to read raw data Jun 20 15:40:01 really depends on what you're trying to do... HttpURLConnection and an InputStreamReader could be helpful Jun 20 15:40:46 you really should Google this stuff, there are plenty of resources out there that shows different ways Jun 20 15:41:30 Actually I need to convert a java source code to Android,if you have experience in java then I can tell the used class Jun 20 15:42:06 are you sure you can't use the same class? Jun 20 15:43:08 yes,I donot find the classes in android Jun 20 15:43:13 k Jun 20 15:43:26 generally speaking, you should look at the org.apache.http.* classes Jun 20 15:43:34 http://d.android.com/reference/org/apache/http/package-summary.html Jun 20 15:43:48 hope that helps you to get started Jun 20 15:44:52 Ok,thanks Jun 20 16:09:48 Hey, I just created a new project with eclispe, the tutoriial says it should include import android.os.Bundle;, but it doesn't. is os.Bundle needed anymore? Jun 20 16:10:29 Nevermind Jun 20 17:45:24 hi I was directed here from #android with my question, so here it is: Jun 20 17:45:25 let's say I found bugs in one of the external projects, like apache-http or other projects in /external/. if I decide to fix it, should I commit to the android git repo or try to get them into the external project repositories and they will somehow make it in to android ? Jun 20 17:46:40 android uses the SDK with some of there own extensions. If you find a bug, report it to the official channels. If it is a bug in an android package then go for the android channels...imo Jun 20 17:47:12 unless you hunt the bug down to an incompatibility with an androidpackage Jun 20 17:47:28 than it would be probably android in the first place :) Jun 20 17:49:20 wojtek_kalicinsk: I'd suggest both; we typically don't have time to forward a bunch of patches from people, especially if getting them accepted upstream might require a couple rounds of iteration Jun 20 17:50:09 wojtek_kalicinsk: but if it's a bug that affects Android, we'd probably take a well-written patch (and then suggest that you send it upstream :o) Jun 20 17:51:39 ok I was going to ask something more but I think your answer about sending patches both to android and to the external project makes sense Jun 20 17:52:30 the reason for me coming here was that I found some things that are plain wrong for example with the implementation of some java classes in apache harmony Jun 20 17:53:08 * xsdg doesn't know anything about harmony :o) Jun 20 18:19:34 anyone knows how to use the map overlay? Jun 20 18:56:40 looks like nobody is willing to help me out damn Jun 20 18:57:38 you're still stuck with your constant monitoring thing? Jun 20 18:58:42 still stuck with my little service problem yeah Jun 20 18:59:09 i tested a lot of thing but im just experienced in c++ and other things Jun 20 18:59:18 looks like i have to learn a lot more Jun 20 18:59:51 everything works just fine expect the loop thing Jun 20 19:00:56 should be a easy thing for someone with a bit more knowledge Jun 20 19:01:51 mechanicFFM: well .. I'm not that knowledgeable and I write games, so all this ui stuff generally goes way over my head. sorry :/ Jun 20 19:03:20 i created a service and i just need to know how to loop my if/else statement Jun 20 19:05:42 i would post some code but dont know if that would help if nobody cares Jun 20 19:06:48 i would like to fix the problem myself but since im not very experienced its hard for me Jun 20 19:07:04 to find the problem Jun 20 19:07:39 im shure its just a small thing i dont get Jun 20 19:08:51 the ui works fine also the service starts properly as far as i can see i just dont get how to loop my code in there Jun 20 19:09:22 when i add the code zu my ui in a onclick listener everything works fine Jun 20 19:10:22 anyway... thanks sammy for responding to my poor noob question Jun 20 19:11:54 can dev versions of the g1 use paid market apps? Jun 20 19:29:48 how do u draw multiple points on the mapOverlay without hindering the performance? Jun 20 20:02:53 i am having a hard time drawing line on the map overlau Jun 20 21:38:49 seems like findViewById is returning null, and I can't see why Jun 20 21:55:49 anyone willing to take a look over my code at pastebin? Jun 20 21:56:08 this drives me crazy Jun 20 22:02:49 * Skail is stumped also Jun 20 22:03:26 http://pastie.org/518741 Jun 20 22:03:34 anyone? Jun 20 22:04:05 i dont see why it works like it should Jun 20 22:04:27 not works lol Jun 20 22:04:43 what's the error? Jun 20 22:04:50 any error messages? Jun 20 22:04:53 no error Jun 20 22:05:00 it just dont works Jun 20 22:05:04 -.- Jun 20 22:05:07 aha Jun 20 22:05:21 when i add the code in a on clich listener it works fine Jun 20 22:05:56 but since there is no click event i have to loop it in the service class Jun 20 22:06:01 what means 'loop doesn't loop as it should' ? how should it loop? and 'it dont work' is not...hm..specific Jun 20 22:06:21 take a look at the code Jun 20 22:06:28 in onstart Jun 20 22:06:34 i added a loop Jun 20 22:06:39 yes? Jun 20 22:06:47 which should loop my if-else statement Jun 20 22:06:53 ok? Jun 20 22:06:59 but it doesn't loop, right? Jun 20 22:07:06 yes! Jun 20 22:07:23 if you can explain the use of the return you might answer your question by yourself Jun 20 22:08:07 as i said when i use it in the ui app it works fine when i use it in a onclicklistener Jun 20 22:08:24 hmmm maybe u notice im very new to java/ android Jun 20 22:09:14 the return returns from the onStart method so your loop is not looping. that's not android that's a programing fact :) Jun 20 22:09:16 when i use no return i get no toast message Jun 20 22:10:22 you might want to rethink the program-flow logic. and maybe you want to place the return somewhere, where the method returns only under certain conditions. Jun 20 22:10:26 what does this mean, "No package identifier when getting value for resource number 0x7f060000" Jun 20 22:10:58 so its just a problem with the return placement? Jun 20 22:11:06 I guess so. Jun 20 22:11:59 but, I'm new to android but have a bit more java background. so my understanding of what your method is supposed to do is limited :) Jun 20 22:12:42 but where should i place it as i said when i remove it it does not show any toast located in the loop Jun 20 22:12:51 hmmm it works one time Jun 20 22:13:12 yes, because with the return placed where it is the loop gets executed only once Jun 20 22:13:26 and it shows the right mode... just no loop Jun 20 22:13:32 yes! Jun 20 22:13:40 that's what I'm saying :) Jun 20 22:13:40 hmmm but where else should i place it Jun 20 22:13:57 remove the ringtone, but then you'r in an infinite loop. Jun 20 22:14:12 when should this method be called and left? that are the question you have to answer. Jun 20 22:14:34 if this method should be running in the background think about a thread where you place your neverendin-loop Jun 20 22:15:09 s/neverendin/neverending Jun 20 22:15:12 it should loop and check constantly if the mode is ringing or normal Jun 20 22:15:21 then remove the return statement Jun 20 22:15:41 ive tested a lot but nothing seems to work Jun 20 22:15:51 what does that mean? Jun 20 22:16:08 i removed the retuns... so on Jun 20 22:16:17 also i placed it in oncreate Jun 20 22:16:29 mechanicFFM: what happens if you remove the return? Jun 20 22:16:29 nothing works Jun 20 22:16:39 and stop saying nothing works. Jun 20 22:17:10 it's better to say what happens than saying 'nothing works' that makes no sense. there's allways something happening. Jun 20 22:17:23 it starts fine but it does not show the current mode Jun 20 22:17:34 does it show anything else? Jun 20 22:17:42 and with the return adden it shows it once Jun 20 22:17:48 yeah Jun 20 22:17:55 and which is what? Jun 20 22:18:29 mode_normal Jun 20 22:18:46 where does this message come from? Jun 20 22:18:54 whithout the return i dont get the current mode Jun 20 22:19:04 its a toast message Jun 20 22:19:28 I have no idea what Toast is, so let's try another approach Jun 20 22:19:43 try placing your loop only around the if/else part Jun 20 22:19:47 it just shoult constantly check the current mode Jun 20 22:19:54 should Jun 20 22:20:41 I guess there's no need to retrieve the AUDIO_SERVICE object everytime you run through the loop, correct me please. Jun 20 22:21:03 toast is that tiny message which shows up Jun 20 22:21:14 yeh that could be right Jun 20 22:21:42 but it does not solve the problem that the loop does not work Jun 20 22:21:55 hmmm Jun 20 22:22:04 i will try again Jun 20 22:22:23 have you rearranged the while() to enclose only the if/else ? Jun 20 22:25:39 what do others think about using a broadcast for mechanicFFMs problem? something that notifies when AUDIO_SERVICE mode changes? Jun 20 22:26:02 should be better than using brute infinite while loops (idle ftw!) Jun 20 22:29:21 hmmm how would i do that... i need to know the current mode Jun 20 22:30:02 thats how i would do it in c Jun 20 22:30:25 and it works just fine then i use it in a listview / oncklicklistener Jun 20 22:31:18 yeah i rearanged the while loop Jun 20 22:32:17 helps anything? Jun 20 22:33:57 no Jun 20 22:34:38 i try something and update the pastebin then Jun 20 22:38:09 I'd like you to test another idea with the loop: http://pastie.org/518881 Jun 20 22:43:26 will try that in a minute Jun 20 22:43:38 :) Jun 20 22:46:56 get a couple of syntax errors Jun 20 22:47:07 but i try to sort that Jun 20 22:48:49 'right...was dirty copy/paste Jun 20 22:49:54 *argh* there's a big error in my paste. you have to set both booleans to 'true' when they are declared. Jun 20 22:50:14 had to remove the private @ bolean Jun 20 22:50:24 ahhh ok Jun 20 22:50:31 lets see what happens Jun 20 22:50:41 yeah, makes no sense when they are declared at this place. Jun 20 22:51:37 not only 'makes no sense', rather 'is wrong' :) Jun 20 22:51:50 ok installing apk Jun 20 22:51:59 lets see what now happens Jun 20 22:52:20 you initialised both booleans with true? Jun 20 22:53:08 yes Jun 20 22:53:50 application does not react when i try to start my service my ui Jun 20 22:53:58 force close Jun 20 22:56:54 can anyone point me to an explanation of ListViews and "@+id/android:list" ? Jun 20 22:57:08 ok. I guess that's a toast question. how these objects work...at least worth the try :) I guess you should stick with an eventlistener (broadcast) to react on a mode-change. Jun 20 22:59:55 when I set my list to @+id/android:list , I get a null pointer from findViewById() on a different activity than the list is on, but when I set the list id to something else, it only crashes when it reaches that activity Jun 20 23:00:45 try google: listview tutorial or take a look at the sdk samples Jun 20 23:01:06 my code isn't much different from the notepad tutorial Jun 20 23:01:11 akkk ok sorry didnt read your last lines Jun 20 23:01:14 and that tute works Jun 20 23:01:41 just thought you need a general listview tutorial Jun 20 23:02:43 i thought of a custom listener too but i have no idea how to grate a listener for the audiomanager like i need it Jun 20 23:03:26 and when I add another ui item to the layout, I start getting the null pointer from different calls to findViewById() Jun 20 23:03:51 i need to find the reason why i get a force close with the latest code Jun 20 23:04:16 when i try to start the service Jun 20 23:04:50 so it must be a service class problem since it worked fine before to start the service Jun 20 23:05:22 will update the pastebin Jun 20 23:05:29 try adding some log messages using the Log class, so you can at least see where your code is. otherwise use breakpoints and debug it :) Jun 20 23:07:49 this makes no sense Jun 20 23:09:54 Skail: it's @android:id/list, not @+id/android:list Jun 20 23:11:03 http://pastie.org/518899 Jun 20 23:11:26 thats the last version which chrashes when i start the service from my ui Jun 20 23:13:32 romainguy: The notepad tutorial uses "@+id/android:list" .. and it works correctly. Jun 20 23:13:59 mechanicFFM: no messages at all? no "Service is started" ? Jun 20 23:15:29 another thing, did you add the return in onCreate() ? (it's not related, just curiosity) Jun 20 23:16:58 yeah its like in the patebin... return in oncreate Jun 20 23:17:09 but it worked fine before like that Jun 20 23:17:14 grr this makes no sense.. its like its creating corrupt resources or something Jun 20 23:17:32 looks like i need a custom listener Jun 20 23:18:18 but i have no idea how to create one for the audiomanager and such a task Jun 20 23:19:16 so if anyone wants to take a look http://pastie.org/518899 Jun 20 23:21:15 how can i attach source to android.jar? Jun 20 23:21:49 i download the android source already Jun 20 23:22:01 but which directory i should point to when attached to my android.jar? Jun 20 23:22:24 mechanicFFM: one more try with a thread solution? Jun 20 23:26:52 gah, I'd be better off coding all my own widgets on a SurfaceView, at this rate Jun 20 23:27:06 just an idea mechanicFFM: http://pastie.org/518915 (maybe the curlybrackets got messed up) Jun 20 23:32:15 hmm..no seems to be useless too..I guess I'm out of this for now. Don't know enough about Services and stuff. Jun 20 23:33:38 thanks for ur effort dude Jun 20 23:33:52 a pleasure Jun 20 23:34:03 will try that Jun 20 23:34:10 i keep u updated Jun 20 23:34:18 looks like a endless story Jun 20 23:36:41 still the same problem Jun 20 23:36:59 app does not respond when i start the service Jun 20 23:37:07 force close Jun 20 23:37:29 will try some more things Jun 20 23:38:11 looks like a custom listener is the best way but i have no glue how to set it up Jun 20 23:38:17 * Skail 's task seems to be "how to make a ListView without using any 'android:' id's" Jun 20 23:39:05 Hello; anyone have a good read on switching activities? The documentation on intent doesn't seem intuitive. I really am just trying to fill a ListView within my TableLayout Jun 20 23:39:40 It seems the process of filling the ListView needs a separate activity, I was hoping to do it in the main activity thread but have yet to find out how, most examples extend ListActivity Jun 20 23:40:24 How can I make a Gallery removes all existing item, and reload it from adapter? Jun 20 23:40:28 chris: you're way ahead of me :) I can't even put a listview in my app without a force close Jun 20 23:40:52 lol, I may be able to help you, then someone can help me, and we will both be a little farther :p Jun 20 23:41:51 Skail, my ListView is some simple xml, it is likely your force closing due to something else I would think, I've yet to get down a solid debug process other then commenting lines of code :p Jun 20 23:42:39 basically, whenever I put in "@+id/android:list", findViewById() starts returning null for completely unrelated ui resources... not even ones in the same activity. Jun 20 23:43:23 Hmm, my listview is embedded in a table layout so I don't need to really look for it. Jun 20 23:43:52 maybe the solution to both our problems is the same - don't use ListActivity, as that seems to be what requires the "android:list" Jun 20 23:44:24 Well, I can't find information on how to populate the listview without a listactivity Jun 20 23:44:40 I was hoping maybe a pure xml style, like listview>Foo Just until I understand how to do it the likely more correct way Jun 20 23:45:20 good night and good luck! Jun 20 23:45:32 there's an attribute for filling a listview with static items, I believe Jun 20 23:46:22 I will eventually need to learn how to properly run subactivities and do things asynchronously Jun 20 23:49:56 well I'm getting nowhere fast. :/ Jun 20 23:55:40 I think I figured it out Jun 20 23:59:36 awesome Jun 20 23:59:45 now fix mine too :P Jun 21 00:01:05 I added the activity to the manifest, and launched the intent Jun 21 00:01:43 now im force closing though after the the data is written.. lol. I am just resorting to entries in @array Jun 21 00:41:42 well this is awesome... my problem is gone Jun 21 00:44:21 i`m envious :D Jun 21 00:44:30 What was the solution? Jun 21 00:44:37 i wish i could say that haha Jun 21 00:46:38 The awesome part is that I have no idea what the solution was Jun 21 00:47:26 lol, can you paste bin your method ? Jun 21 00:48:18 I have no "method" right now, the list does nothing Jun 21 00:48:32 in fact it still crashes Jun 21 00:48:44 but now it does so only when the listview tries to come up. Jun 21 00:49:58 lol Jun 21 00:51:26 but now, you see, I am at least making progress Jun 21 02:06:41 I sorta wish eclipse worked on my box Jun 21 02:06:50 might make learning this platform quicker Jun 21 02:53:24 great, the problem is back. **** ENDING LOGGING AT Sun Jun 21 03:00:04 2009