**** BEGIN LOGGING AT Sun Aug 10 02:59:59 2014 Aug 10 03:47:17 Hello I am struggling to learn how to write opengl apps and have a question. So in my game I'm probably going to have a lot of graphics objects e.g. circle square sprite etc should I try to create classes for each of these things? The official android open gl tutorial created classes for each object. Also, should I use different shaders/programs for each object like the Aug 10 03:47:32 tutorial does? I am just totally confused on some of the best practices here Aug 10 03:55:25 What's the best way to handle logging when publishing an App? Should I set a global application wide variable to 0 or 1 depending on environemnt? Aug 10 03:58:24 g00s_: Will the real g00s please stand up? Aug 10 03:58:41 this jackwharton has a library for logger Aug 10 03:58:58 detachyo but yeah thats what i do, just use an enum with a boolean that wraps log.d Aug 10 04:11:11 who? Aug 10 04:11:19 my evil twin Aug 10 04:11:19 Thanks lasserix Aug 10 04:11:21 must kill Aug 10 04:11:27 JakeWharton: do we have a Stan here? 0.o Aug 10 04:11:32 I believe the phrase is "Turn down for whom?" Aug 10 04:11:51 Anthaas: "Turn down for why?" Aug 10 04:12:02 Did anyone attend The Monster Tour? Aug 10 04:12:13 Not a single person. Aug 10 04:12:21 Umm, a single person Aug 10 04:12:24 If you count me. Aug 10 04:12:31 Did you see anyone else there? :P Aug 10 04:12:48 I meant in this chatroom. LOL Aug 10 04:12:51 ;-) Aug 10 04:13:00 Yes, 50k other people :) Aug 10 04:14:03 sarbs|away: Ahh you're away :( Aug 10 04:14:28 Is it better to store radius in float or double? Aug 10 04:14:35 I don't need that much precision. Aug 10 04:14:44 But everyone is saying that we should always use double. Aug 10 04:19:07 hehe oops, JakeWhaton; you mentioned you dont use fragments instead manage your own views, have any example online of your view-state-manager? Aug 10 04:19:44 you'll probably be fine with a float Aug 10 04:19:49 radius of what? Aug 10 04:20:46 location radius. Aug 10 04:20:49 geofence Aug 10 04:22:05 as long as youre not iterating a lot of calcualtions with this value a float should be fine Aug 10 04:22:35 at the same time its not like using a double is going to tax your app Aug 10 04:23:09 Hi. I'm trying to install my app onto my nexus 5, but I'm getting an error that reads as follows: ERROR: Failed to launch application on device: ERROR: Failed to install apk to device: ERROR: Failed to deploy to device, no devices found. Aug 10 04:24:07 lasserix: gotcha. Aug 10 04:24:45 thank you, i'll stick with flaot for now, unless 5(max) is a lot of calculations, I should be fine. Aug 10 04:24:45 MicronXD make sure you have driver installed, if no work, try switching from Media Mode to MTP (Picture mode) for the USB connection setting Aug 10 04:25:15 detachYo: yeah the whole point is if you are going to accumulate round off errors then you want to use a double Aug 10 04:25:41 but since you are probably just drawing some stuff or checking a bounding box or something float suffices Aug 10 04:29:21 lasserix: It's plugged in, I have "USB debugging" checked in "Developer options", I downloaded the OEM drivers using the SDK Manager. Aug 10 04:29:29 Hey all Aug 10 04:29:57 yeah so switch from MTP to Picture or whatever in the usb connection Aug 10 04:30:13 on one of my machines my nexus only works if i am in picture connection mode Aug 10 04:30:21 not media download ro whatever Aug 10 04:30:41 lasserix: makes sense. Aug 10 04:31:13 I have a general question. How does native mms handle scheduling of the message? Is it like fire AlarmManager instance and forget unless the user cancels? Aug 10 04:37:05 lasserix: I'd do that if I could find an option to do that, but I don't have USB options as a category in my top level settings view, and in my "Developer options" view, the only options related to USB are whether or not to enable "USB Debugging" and whether or not to verify apps over USB. Aug 10 04:37:23 lasserix: are you using a nexus 5? Aug 10 04:39:11 can I have an app which is always running, and displays the activity when you swipe from the edge? Aug 10 04:39:11 Sorry in advance if this sounds like a dumb question; i am pretty new to android dev. I am using github with eclipse + adt plugin. but the working directory seems to always mess up when i pull the repo off github. errors like appcompat_v7 not found and etc.. i found that using android dev studio seem to get rid of that problem , but the software is still in beta so i don't really want to use it. So is there anyone to resolve this p Aug 10 04:39:12 roblem in eclipse or do I have to link the support library each time? Aug 10 04:39:55 lifosuck: I know it doesn't answer your question, but I've been using android studio and absolutely love it. I haven't had any problems with it Aug 10 04:41:02 MicronXD: what are you trying to do? put it in usb mass storage mode? Aug 10 04:42:16 yea i totally understand you. but my teammates are a bit skeptical about the word "beta" Aug 10 04:42:37 lifosuck: isn't gmail still in beta? Aug 10 04:43:35 lifosuck: also fwiw, I switch git branches all the time, and arduino studio just works correctly Aug 10 04:43:44 lifosuck: which is the first editor that I've personally used that has done so Aug 10 04:44:57 arduino studio u mean android? Aug 10 04:45:48 yes he does lifosuck :) Aug 10 04:45:59 also, I was using eclipse first, then switched to android studio, haven't had problems since Aug 10 04:46:34 lifosuck: sorry, I'm constantly doing both arduino and android development :-) Aug 10 04:46:36 anyone know what "I/dalvikvm-heap﹕ Grow heap (frag case) to 14.422MB for 301172-byte allocation" means? Aug 10 04:46:40 lifosuck: it really messes with my brain Aug 10 04:46:54 interseting, may I know what you're doing with arduino? I am kinda interested Aug 10 04:47:02 detachYo: Making a quadcopter Aug 10 04:47:06 nice Aug 10 04:47:12 you're awesome :) Aug 10 04:47:17 is it capstone project? Aug 10 04:47:20 detachYo: I wrote my own controller for it using two arduinos Aug 10 04:47:23 what's capstone? Aug 10 04:47:45 well i am an engineering student, before we graduate we have to do a capstone project Aug 10 04:47:53 like a quadcopter Aug 10 04:47:56 controller Aug 10 04:48:15 detachYo: dalvik is the java virtual machine Aug 10 04:48:32 i think one group of students did a quadcopter with arduino last year, but the processing power wasn't good enough for them, so it did not fly. at all Aug 10 04:48:54 detachYo: it uses a pool of memory to allocate memory from, rather than using malloc for each allocation Aug 10 04:48:59 MicronXD: when you plug in the device to the usb port, you should see like an icon "USB Connection Mode" or something Aug 10 04:49:12 not developer options, nothing to do with developer options, its USB connection state Aug 10 04:49:14 detachYo: since keeping a big chunk of memory is faster than continually asking the os to allocate pages for you Aug 10 04:49:26 lasserix: hmm, don't you need to enable that first though? Aug 10 04:49:34 yeah but he already has done that Aug 10 04:49:39 lifosuck: hmm, sounds like the group of students suck :-) Aug 10 04:49:59 lifosuck: arduino has more than plenty of power Aug 10 04:50:09 they were going for fuzzy logic and stuff, it was very complicated Aug 10 04:50:25 lasserix: oh! it's in the notification bar! Thanks, man :D Aug 10 04:50:55 lifosuck: ah fair enough. yeah you can get real complicated pretty fast, if you want to simulate all the physics on the fly etc Aug 10 04:51:15 yea, i think that's what they were trying to do, instead of building something that just works. Aug 10 04:51:19 lifosuck: which is needed for all those really fancy flight manuovers Aug 10 04:51:22 lasserix: that worked! thanks again! Aug 10 04:51:34 johnflux: so is there a problem you think or just a message? Aug 10 04:51:51 lifosuck: you should do thing like this: https://www.youtube.com/watch?v=mODqQvlrgIQ&list=UUeQEKFH31vvD-InkTGSvCrA where you can modulte the sound produced to modulate the water based on like touch screen interaction or something Aug 10 04:52:09 MicronXD: cool yeah, only necessary on some of my computers, the others doesn't matter whichi mode its in for some reason Aug 10 04:52:22 lifosuck: also to be fair, I have many years of experience, and I have a dedicated electrical engineer for the electronics side, and a team to do the carbon fibre shell etc Aug 10 04:52:33 lifosuck: :-) Aug 10 04:52:45 detachYo: it's just a message Aug 10 04:52:54 johnflux: alrighty, thanks for that info :) Aug 10 04:52:57 haha, i am doing a capstone project on patient monitoring, with four components, positiong system via wifi ; posture recognition, efficinet pedometer and ecg monitor Aug 10 04:53:10 detachYo: you can keep an eye on it just to see how much memory is being allocated. if it keeps growing when you're not doing anything, your app might be leaking memory Aug 10 04:53:24 ah Aug 10 04:53:27 makes sense Aug 10 04:53:44 detachYo: what kind of position accuracy do you get via wifi? how do you that? Aug 10 04:53:58 2~3 meters at best Aug 10 04:54:07 we use fingering printing method Aug 10 04:54:10 with kalman filter Aug 10 04:54:29 lifosuck: how does that "fingering printing method" work? Aug 10 04:54:40 lifosuck: you have a list of known positions of the wifi spots? Aug 10 04:55:37 well for triangulation, yes you need a list of wifi spots. for finger printing, you actually don't. how it works is that you divide the floor into small grid, and in each grid location you measure the wifi information Aug 10 04:56:06 then after that you create a large database, then by using user's wifi signal strength to each router, compared to the data base Aug 10 04:56:34 you get an estimate of which grid location is closest to the user Aug 10 04:56:40 lifosuck: that's pretty cool Aug 10 04:57:04 lifosuck: when I use wifi in a fixed spot, the strength seems to vary quite a lot during the day Aug 10 04:57:21 but it is fairly inaccurate because the wifi signal strength is dependent on the orientation, noise, wifi transmitter fluctuation and such Aug 10 04:57:30 yea it does Aug 10 04:58:07 totally, that's why i see in the paper they say 2~3 meter accuracy, i can only get to about 5~6 meter accuracy Aug 10 04:58:13 lifosuck: I was trying to create a differential gps system, by just having a fixed system and a moving system, and then just subtracting their coordinates Aug 10 04:58:29 lifosuck: but I couldn't get any accuracy above normal gps Aug 10 04:58:33 but then they did it in a fix setting with dedicated router just for that function, i experimented in my university Aug 10 04:58:59 hmm interesting. like the moving system being the accelerometer? Aug 10 04:59:15 lifosuck: well being the quadcopter Aug 10 04:59:21 lifosuck: and the fixed being my laptop Aug 10 04:59:44 ohhh i see Aug 10 05:00:19 how do you track the quadcopter ? Aug 10 05:00:19 lifosuck: I thought that if I simply subtracted the coordinates, I'd compensate for all the atmospheric changes etc Aug 10 05:00:26 lifosuck: the quadcopter has a GPS Aug 10 05:00:53 google fonts is a pain inthe ass Aug 10 05:01:30 but it didn't work? Aug 10 05:01:51 I don't get it through wifi only. Aug 10 05:02:22 Is there a difference between Double.valueOf(string) and Double.parseValue(str) ? Aug 10 05:02:31 lifosuck: no. There was no decrease in error. I think the problem is that even with two gps's next to each other, maybe they lock onto different gps satellites or use different weighting etc, so that their errors don't just subtract from each other Aug 10 05:03:15 lifosuck: the electrical engineer guy was always skeptical of it - saying that thermal errors on the gps chips will swamp atmospheric errors Aug 10 05:03:24 hahah Aug 10 05:03:36 lifosuck: so it's possible that by trying to subtract the two coordinates, I'm just adding the thermal errors, cancelling out any gains Aug 10 05:03:45 pretty much Aug 10 05:03:53 I'll answer my question: valueOf(String) returns a new object Aug 10 05:04:40 oh, speaking of such things, am I right in thinking that: new Integer(4) != new Integer(4) ? Aug 10 05:05:06 you can get more accurate relative position, but more accurate absolute (well, relative to earth) requires a better GPS :P Aug 10 05:05:15 since they are different objects, and == would compares whether the objects are the same object? Aug 10 05:05:30 zinx: I would have been happy with an accurate relative position Aug 10 05:05:39 johnflux: it drifts.. Aug 10 05:05:57 zinx: since I can leave the "laptop stationary for weeks at a time, and average the position to get a strong known position Aug 10 05:05:59 accelerometer + gyro at minimum Aug 10 05:06:21 zinx: accel + gyro don't give you lateral drift information Aug 10 05:06:35 lateral drift? o_O Aug 10 05:06:52 zinx: moving with a constant velocity sideways Aug 10 05:07:06 zinx: the accelerometer and gyro wouldn't be able to detect that Aug 10 05:07:06 yes they do Aug 10 05:07:14 3-axis ones can Aug 10 05:07:26 zinx: if you have constant velocity, then you aren't accelerating Aug 10 05:07:28 with constant speed? Aug 10 05:07:37 not with constant speed, no Aug 10 05:07:46 but that's for any constant speed Aug 10 05:07:50 not just sideways Aug 10 05:08:14 zinx: well vertical speed you can determine using a pressure sensor etc Aug 10 05:08:27 zinx: not with accel+gyro of course Aug 10 05:08:35 zinx: but generally vertical speed isn't such a problem Aug 10 05:08:37 if you start from 0, you have a better chance Aug 10 05:08:42 oh yea, how accurate is a pressure sensor interms of determination of height Aug 10 05:08:59 but yes, it has drift problems Aug 10 05:09:10 incorporating gps in to the mix is helpful :P Aug 10 05:09:28 lifosuck: I'm not entirely sure yet - we're playing with combining it with sonar too Aug 10 05:09:49 to the ground? Aug 10 05:09:54 lifosuck: yeah Aug 10 05:10:01 lifosuck: works well indoors, but fails on grass :-) Aug 10 05:10:42 onCreate Aug 10 05:11:05 you can focus an optical mouse sensor on the ground and get fairly accurate speed, assuming you compensate for angular speed Aug 10 05:11:22 (no joke) Aug 10 05:11:45 one more thing, what's the benefit about quadcopter compared to .. let's say a hot air balloon? Aug 10 05:12:07 zinx: I've tried this: http://pixhawk.org/modules/px4flow Aug 10 05:12:09 lifosuck: quadcopter's cooler, obviously Aug 10 05:12:27 well, practically speaking Aug 10 05:12:40 zinx: but found it difficult to get great results from it. Possibly my fault. I didn't get to play with it enough. Aug 10 05:12:45 johnflux: not sure 400fps is enough Aug 10 05:12:56 johnflux: mouse sensors operate at 2000fps and beyond Aug 10 05:13:10 zinx: interesting - that could explain the problems that I was having Aug 10 05:13:23 Hey, I am a bit new to Android ,in "protected Dialog onCreateDialog method " What is the Dialog in it Aug 10 05:13:27 they are also much much lower resolution, though - like 10x10 to 30x30 range Aug 10 05:15:01 android question.. Aug 10 05:15:21 can I have my app always running, and listening for a swipe from the left Aug 10 05:15:32 so that I can launch my activity when the user does that? Aug 10 05:15:41 no matter what app is currently focused? Aug 10 05:16:00 you can create a service that runs in the background Aug 10 05:16:29 Carbonflux: can it listen to all mouse events or something? Aug 10 05:16:36 http://developer.android.com/guide/components/services.html Aug 10 05:16:38 Carbonflux: or get a swide event or something Aug 10 05:16:51 I am not sure what the limitations of that might be Aug 10 05:17:11 fex if another app has focus Aug 10 05:17:19 and it trapping those events Aug 10 05:17:25 I am just not sure :) Aug 10 05:17:35 interrupt routine. Aug 10 05:20:42 How can I let a user resize a widget? Aug 10 05:22:34 I'm thinking some sort of gripper.. Aug 10 05:27:37 johnflux: i dont think you can do that Aug 10 05:28:00 you have to register for the callbacks on a touch event, say, and how can you hook your service into another app? they're processes are sandboxed Aug 10 05:28:08 youd have to fork the android os... Aug 10 05:34:12 Anyone know if setting View.GONE on a visible surface view will cause it to be destroyed? Aug 10 05:37:10 is that not really easy to test ? Aug 10 05:37:12 :) Aug 10 05:46:57 Yeah but it would save me some trouble Aug 10 05:47:05 got more important things to do like make it work ;p Aug 10 05:58:43 hello i want to write an app that has a finer volume control than the android system currently provides.. Is it possible for me to alter the volume of audio coming from other apps?? Aug 10 06:06:52 How do I inflate an xml layout for a custom viewgroup? Aug 10 06:07:26 ie, instead of inflating a view and adding it to the custom view group in the constructor function, is it possible to inflate that xml as the custom view group? Aug 10 06:10:49 yes Aug 10 06:11:05 use a tag as the root Aug 10 06:11:14 of the xml? Aug 10 06:12:20 if i do that what's the code I use? Aug 10 06:12:40 err, which overload of the inflate method do i use and with which options? Aug 10 06:12:44 sorry i have never used merge before Aug 10 06:16:56 why are there only 15 volume levels? is there any way i can make the volume control finer? Aug 10 06:19:21 with the Mediaplayer class i can make the music play really softly but i can only set the music stream volume between 0-15, it’s so frustrating!! Aug 10 06:19:41 can anyone help please? Aug 10 06:25:18 gao if you want to manipulate system volume levels you probably have to do it on rooted device Aug 10 06:27:33 guess i am wrong: https://play.google.com/store/apps/details?id=opotech.finevolumev2&hl=en Aug 10 06:27:42 you could decompile their app and see how they do it Aug 10 06:28:50 JakeWharton: is this what you meant? Aug 10 06:28:52 http://stackoverflow.com/questions/5535454/custom-view-with-xml-layout-in-android Aug 10 06:29:00 yes Aug 10 06:29:06 cool thanks! Aug 10 06:32:52 lasserix: how do i decompile their app?? Aug 10 06:33:05 way beyond scope of what i want to explain Aug 10 06:33:07 but google it? Aug 10 06:35:51 there are many apps that can boost the volume beyond the maximum android allows… But there’s only 1 app that can lower the volume.. Anyone know how the volume booster apps work? Aug 10 07:07:02 when I do Object variable = new Object(arguments); then do that again, does it create new object without removing the old one? Aug 10 07:28:54 grigor that is basic java , but yeah Aug 10 07:31:06 ok, so its better to wrap it around a function and set it to null if the arguments change the object? Aug 10 07:49:15 detachYo: if you're curious what's going on, set some breakpoints and have a look at the addresses, content etc. Aug 10 08:09:46 any users of AS/Intellij : when you press alt-7 to go to the structure pane, are you getting focus there too? I'm having to click with the mouse which is a bit of "pane".. Aug 10 08:23:46 okay got two or three stupid questions Aug 10 08:24:54 can i have regular androicd sdk 4.4 kind and the new android L dev on a computer together Aug 10 08:25:18 will either of them work with the new java 8 Aug 10 08:26:35 the SDK can handle multiple Android/API versions just fine, sure Aug 10 08:27:21 and wat about having both regular and android L on a computer Aug 10 08:27:52 you just install them both into the same SDK Aug 10 08:28:04 ah okay cool Aug 10 08:34:06 stupid android studio Aug 10 08:40:14 I'm trying to set my app to fullscreen AND floating, like: true Aug 10 08:40:25 but when I make it floating, it's no longer full screen Aug 10 08:40:27 any ideas why? Aug 10 08:59:30 out of curiosity why would you make your app fullscreen and floating? Aug 10 09:07:02 wonderful studio crashed with this msg: http://i62.tinypic.com/2cysaah.png . What i should do to add a numeric field ? Aug 10 09:08:15 i dragged the numeric field next to the text and dead end... studio crashed Aug 10 09:08:48 it hasn't crashed. thats a handled exception in the pretty "beta" layout editor. not good but not terminal either. add it by hand in the xml view of your layout. Aug 10 09:09:15 layout editor falls over quite a bit at times. Aug 10 09:11:40 ok, i already had doubts about the studio. layout editor falls over a lot actually it never stopped falling over. now i have no choice, i will have to type in xml. Aug 10 09:12:30 well, its fallen over one or twice for me but nothing major and adding it in the xml is trivial. Aug 10 09:13:06 having doubts about the studio (it IS beta) for this is pretty extreme. How is the layout editor in Eclipse? Aug 10 09:13:36 ty rgr, your response was still encouraging Aug 10 09:14:08 it was never good in eclipse too Aug 10 09:15:06 doubt was about those unknown unseen errors without any clue and help Aug 10 09:15:41 i dont want to spend time looking for reasons Aug 10 09:16:24 in other words , looking for problems in studio is not my job, but unfortunately it was assigned to me through the beta versions Aug 10 09:16:31 how would you find any reasons without debugging the editor code? Its beta. They'll sort it out. Aug 10 09:16:47 ah. So it is your job. Aug 10 09:17:31 i have to,take it, do i have any options? Aug 10 09:18:12 yes, i guess eclipse is the last option, but really the eclipse bundle was mesed up on purpose Aug 10 09:18:53 i did try to use the eclipse bundle but i could not run it on my 64bit linux Aug 10 09:19:01 You've lost me. Options for what? I told you your options : add it in the xml view. Aug 10 09:19:24 And moving to eclipse because of some slightly annoying layout editor bug is pretty extreme and foolhardy. Aug 10 09:19:59 And why couldnt you run eclipse on 64 but Linux? Aug 10 09:20:04 s/but/bit Aug 10 09:20:47 rgr: because openjdk is no kore suported and the only option is oraclejdk. Aug 10 09:20:54 more*** Aug 10 09:21:01 nonsense. Im using openjdk on 64 bit linux. Aug 10 09:21:09 oh sorry! Aug 10 09:21:13 hmm, really Aug 10 09:21:18 ? Aug 10 09:21:20 eclipse. I use intellij. But still. Aug 10 09:21:43 but I would be surprised if it doesnt work. Still. Who knows. Aug 10 09:21:58 eclipse works as expected on my 64bit installation Aug 10 09:22:05 with openjdk? Aug 10 09:22:09 (I use intellij, too, but I have a possibility to run it) Aug 10 09:22:22 not sure, let me check if I can run it with openjdk.. Aug 10 09:22:51 abator: and whats your issue, if it really is an issue, with using oraclejdk? Easy enough to install. Aug 10 09:24:11 hm,actually debian is happy with openjdk and using oraclejdk means debian support easily avoid further help,in any issue Aug 10 09:24:55 ? Aug 10 09:25:22 i dont know if two different jdks can be used at the same time Aug 10 09:25:38 Why is there no legacy-toolchains tarball for the ndk r10? Or am I supposed to use r10 with the last legacy-toolchains tarball from r9b? Aug 10 09:26:34 What do you mean "at the same time". Of course you can have multiple JDKs installe in Debian. You select the one you want with update-alternatives. Both openjdk and oraclejdk. You dont need any debian support : and you really dont want to deal with people who wont help yuor because you use the oraclejdk anyway. Aug 10 09:26:38 simple, debain support will avoid answering any questions related to oraclejdk Aug 10 09:26:55 how much are you paying for your debian support? Aug 10 09:27:00 what questions? Aug 10 09:27:25 Install it , use it. Any Qs regarding it go to oraclejdk support. Aug 10 09:27:28 do you want me to pay for open source? Aug 10 09:27:35 Huh? Aug 10 09:27:43 hmm Aug 10 09:27:46 never mind Aug 10 09:27:47 abator: you pay one way or another. in this case, it seems to be with your time. ;) Aug 10 09:27:51 imhave to edit xml Aug 10 09:28:10 yes, its my time on beta Aug 10 09:28:13 my point was that if you're not paying for support, 1) you're getting your money's worth; 2) they're not obligated to help you with anything. Aug 10 09:28:13 with an smart autocompelting editor. You could have added that field by now... its easy. Aug 10 09:28:25 damn beta, why we have to deal with beta Aug 10 09:28:47 lewellyn: and my point is he doesnt need any support. I think he's conjuring up issues to delay actually having to write the app ;)) Aug 10 09:28:55 ok, got your point Aug 10 09:29:06 abator: because its a beta. And its free. Stop whining and get stuck in! Have fun! ;) Aug 10 09:29:10 no further question on this topic Aug 10 09:29:19 thanks a lot Aug 10 09:30:44 I wonder where all these 1% completed "apps" go to die when the people who have app ideas then "start coding" only to realise you actually need to be a programmer and understand a multithreaded, multi level API Java system and do some spadework. Aug 10 09:31:04 rgr: they're reaped. Aug 10 09:31:19 except for the ones which actually make it to the play store. Aug 10 09:32:04 ah yes, and used for compost for new fly by night "visionaries"... ;) Aug 10 09:34:19 * Zooklubba wtf2 Aug 10 09:34:20 * Zooklubba wtf3 Aug 10 09:35:12 * Zooklubba wtf2 Aug 10 09:35:14 * Zooklubba wtf3 Aug 10 09:40:58 any receommended way to flip a bitmap through the vertical axis at the draw stage without needing to create a new bitmap? eg char going from left to right and then flipping to right to left. There doesnt seems to be a drawbitmap that allows me to use a matrix while specifying a dest Rect. Aug 10 10:03:18 I have a pretty simple question, how can I know whether the numberpicker I'm working with has moved forward in values or backwards? Aug 10 10:03:42 comparison with the set I'm working with is not possible, as the order of items differs from the representation of their actual worth Aug 10 10:04:29 so 1 value appears at the beginning because of its order according to a rule, but its value is lower than the one before it, for example. So I cant be like "if (oldVal < newVal)" to know if I've moved forward in the picker Aug 10 10:12:49 ah ok. I can use a setScale on a matrix and then a postTranslate to move it for the drawBitMap call. Aug 10 10:13:05 Sicp: #java Aug 10 10:13:15 no Aug 10 10:14:07 Apologies. With a numberpicker. But I mist admit I didnt understand your "simple question" ;) Aug 10 10:15:10 it's simple to me Aug 10 10:15:15 just need the correct listener Aug 10 10:15:48 a means of figuring out whether you're now further down in the picker or further up Aug 10 10:16:06 surely your update listener knows the source range and can deduce the backward/forward nature of the pick? I mean the picker still picks a number from an ordered range. Aug 10 10:16:12 it should be with onValueChanged, but the values I have in the picker are not comparable to figure out who is smaller Aug 10 10:16:42 then keep an ordered set of the real values and map back. Aug 10 10:17:06 I thought of that Aug 10 10:19:08 Why isn't there a way to preview the app description before publishing? or am I just blind? Aug 10 10:22:49 he just wants them for two of those notes Aug 10 10:22:50 lol.. Aug 10 10:22:52 not the whole picker Aug 10 10:23:48 so if note is 0 and old one was 6, do something Aug 10 10:23:59 #music #howdoesitwork Aug 10 10:26:03 thanks though rgr Aug 10 10:26:18 Since you "do something" on a pick it really couldnt be easier. store the last one and compare in the source set. I dont see the complication : and thats assuming numberpicker doesnt have some form of comparable built in. Aug 10 10:29:01 my manifest is 1000 lines Aug 10 10:29:02 wow Aug 10 10:29:32 nah it has onValueChanged Aug 10 10:29:46 and oldVal and newVal, so its just a matter of detecting when old was X and new is Y, do something Aug 10 10:29:50 that's it Aug 10 10:29:58 its stupid, I thought it was needed for the whole picker Aug 10 10:30:49 whats stupid? Aug 10 10:33:42 is there a hot key I cant see for "navigate to next compile error" in AS/Intellij? Aug 10 10:34:14 ah C-M-down Aug 10 11:02:16 hi, is there a way to call getStartedActivityIntent from a class that extends ActivityInstrumentationTestCase2? Aug 10 11:02:42 What techniques exist in AS/Intellij or another tool to determine where the memory is being allocated which contributes to constant "D/dalvikvm﹕ GC_FOR_ALLOC freed XXYY" logCat entries? Aug 10 11:11:39 * rgr has just discovered the monitor tool which encapsulates ddms. Aug 10 11:21:06 hi guys. i am in the process of porting my Java application to Android. if i use a PrintWriter in a method. like so: PrintWriter pw = new PrintWriter("transfer.dat"); Aug 10 11:21:06 where should i place the transfer.dat file in the structure? Aug 10 11:21:35 in Java i placed it in the main root folder, but that doesnt seem to work for me in Android Aug 10 11:23:34 probably assets. I dont know as havent used that. Aug 10 11:24:34 http://stackoverflow.com/questions/4789325/android-path-to-asset-txt-file Aug 10 11:38:35 but.... Get Allocations doesnt work. Aargh. Aug 10 11:59:39 is possible to get rid of cwm recovery.img & boot.img and get the original ones after falshing cwm? Aug 10 12:00:21 you should have backed up first. #android-root. Aug 10 12:11:14 rgr: -root is sleeping .. I didn't back them up BUT .. I have another the same phone model Aug 10 12:11:47 how to choose which partitions should be imaged with dd? Aug 10 12:12:51 sure. But just to let you know that generally people wont help here with questions about screwed up flashes and buggy roms. It's for developing android apps : not helping someone who hosed their firmware :) XDA forums and the like are more likely to help you. Good luck. Aug 10 12:12:52 please look at this http://pastebin.com/VKQWjLne Aug 10 12:15:08 Running debian testing with openjdk 7. DDMS is not working when I try to "Get Allocations". Any ideas as to why? logcat etc work and I can see my app process and threads just fine. Aug 10 12:18:00 i constantly see "context" used in examples. What are these "context" ? Aug 10 12:19:24 uhlm: a super secret thing you can only learn about by RTFM Aug 10 12:20:59 Leeds: i knew it ! Aug 10 12:21:49 If you didnt think to google that then I'd give up if I were you.... ;) Aug 10 12:24:24 i will then Aug 10 12:25:25 That's the spirit. Aug 10 12:26:45 There you go : http://lmgtfy.com/?q=android+context+explained Aug 10 12:35:09 Anyone dealt with needing to persist cookies? Aug 10 12:43:37 jonc: http://developer.android.com/reference/android/webkit/CookieManager.html Aug 10 12:44:30 are they the same type of "cookies"? Since by "default" web cookies persist anyway. Aug 10 12:45:18 MrMaffen, yeah, I am using the java.net.CookieManager currently, because I am not using a webview Aug 10 12:45:47 rgr, not using a webview. Using cookies for sessions Aug 10 12:48:40 and retrofit. Although I can subclass java.net.CookieManager and set it to my own Aug 10 12:49:17 http://loopj.com/android-async-http/doc/com/loopj/android/http/PersistentCookieStore.html seems to be what I am looking for Aug 10 12:57:25 I've never done any android development but I'd like to write a game for android that I can eventually port to other platforms- as someone who knows C better than Java is it a bad idea to just start with the NDK and never delve into anything in the java APIs beyond "give me a window and scede control to the native code"? Aug 10 13:11:49 miyako, most game engines / cross platform games are written using C. You'll probably be fine Aug 10 13:12:17 and if you know C well enough to do a game, then you'd be able to pick up on any of the android specific things you'd need fairly quickly Aug 10 13:14:13 jonc: yeah, I mean I've used java a bit here and there, I'm not worried about not being able to learn it, I just wasn't sure if doing something entirely in C or C++ was a reasonable idea, or if the platform really pushing you away from it Aug 10 13:15:14 miyako, for games you should be reasonably fine Aug 10 13:15:30 I'd really perfer to just use Unity or something honestly, but they only support osx and windows as development platforms, and the entire purpose of this project is to try to make enough on the app store to buy a MBP lol Aug 10 13:15:38 miyako, but you do need to be aware that vast majority of OS API's are only available to Java Aug 10 13:16:23 as long as you only need OpenGL, audio playing and some sensors you're fine with C, for everything else you'll have to do bridging Aug 10 13:16:50 Mavrik: well I suppose I can just start with some native code rendering to an OpenGL context, and try to keep it as portable as is reasonably possible (I'd like to port to iOS eventually), and just keep the Java code in a separate module so I can write equivalent Swift code for iOS later Aug 10 13:17:12 it... doesn't really work that way :) Aug 10 13:18:05 You can't separate Java code in a different module because there is no such thing as "native" executable on Android where apps are concerned Aug 10 13:18:20 your app will have a Java wrapper which will then call out to a native C file Aug 10 13:18:48 Mavrik: sorry, I'm kind of out of the loop on terminology; NDK code was what I meant by native code Aug 10 13:19:04 and I realize the Java wrapper has to exist, I was thinking modularity in terms of the build system and code structure Aug 10 13:19:14 NDK is just a package of preconfigured gcc for cross-compiling Aug 10 13:19:25 Hello, How could I change the whole background of the application to an image that comes with the server ? I've tried to use getWindow().setBackgroundDrawable(new BitmapDrawable(getResources(), loadedImage)); but it is not working. I've searched the internet but all the answers points out to use styles and themes, and the problem with that approach is that they need static images Aug 10 13:19:26 don't make a (common) mistake of thinking NDK compiled code is special ;) Aug 10 13:19:46 miyako, hmm, point there, yes you can do that... look up on NativeActivity Aug 10 13:19:47 Mavrik: well isn't it basically just JNI calling to a C shared library running in a sandbox? Aug 10 13:19:54 yes Aug 10 13:20:00 NDK will build a native C library Aug 10 13:20:05 and you call to it using JNI Aug 10 13:20:32 NativeActivity is preconfigured bridge that just gives all control to chosen C library Aug 10 13:20:51 I think I should be able to manage that, I think the biggest hurdle I'm going to have now is just getting an environment setup to develop and push code Aug 10 13:21:24 hrmpf, yes, developing native stuff on Android isn't really easy on the nerves Aug 10 13:21:25 I know there are some guides on that, my friend uses eclim for development and then I think just deploys stuff through eclipse Aug 10 13:21:36 I suggest you start with Eclipse/ADT Aug 10 13:21:40 (and CDT for C) Aug 10 13:21:53 and remove fucking with 3rd pary toolchain from the equation for starter Aug 10 13:22:14 Mavrik: is there any way to build and deploy directly from the command line Aug 10 13:22:32 yes. Aug 10 13:22:34 I mean, can I just write some scripts and have a CMake target that pushes the app to my phone? Aug 10 13:22:41 But I suggest against it until you get a firm grasp on how stuff works. Aug 10 13:23:04 miyako, Unity does support android and iOS Aug 10 13:23:05 Mavrik: won't messing with it that way give me a firm grasp on how it works by the time I get it working? Aug 10 13:23:17 jonc: yeah, but the unity development environment doesn't support Linux Aug 10 13:23:21 gotcha Aug 10 13:23:33 miyako, if you don't even know how a basic Android app is structured and where goes what Aug 10 13:23:39 you'll have a hellova time getting a hello world to run Aug 10 13:23:53 much less properly configure CMake + ndk + Ant combo needed for such deployments Aug 10 13:24:00 Mavrik: don't be a stubborn masochist and just use eclipse at first, got it lol Aug 10 13:24:16 ;) Aug 10 13:24:23 just get a helloworld with OpenGL cube deployed first Aug 10 13:24:28 then look into Ant and stuff :) Aug 10 13:24:39 the thing is, IIRC, Eclipse is preconfigured for remote GDB debugging with NDK Aug 10 13:24:44 which DOES help alot :) Aug 10 13:25:11 Every time I do anything that even touches Java I'm just in awe of how it seems to always turn into this overly complicated mess of higherarchies and xml everywhere Aug 10 13:25:35 Mavrik: yeah, getting remote debugging setup with GDB can be a bit painful the first few times Aug 10 13:25:54 we use remote debugging quite a bit with gdb at work so I'm used to it, but I'm not sure how you'd set it up on an unrooted phone Aug 10 13:25:57 *shrug* Aug 10 13:26:02 Java can be nice and new tooling is gerat Aug 10 13:26:13 Sadly, Android is... overengineered on some parts Aug 10 13:26:18 and "Beta" in others :P Aug 10 13:26:34 I think that, much like when I complain about ruby, the problem is a cultural one Aug 10 13:26:47 miyako, IIRC the app itself opens remote gdb port when compiled with debug flags using ndk-build Aug 10 13:26:49 Java has a very specific culture that I find foreign and discomforting Aug 10 13:27:02 but it's been awhile since I did full native dev on Android Aug 10 13:27:14 I usually just develop libraries in full on desktop and then just cross-compile them Aug 10 13:27:39 I guess my other option is to just go full-on Java development for android and then re-use assets by write new code for iOS if a port ever happens Aug 10 13:28:17 but that just seems like a waste of time that could be spent working on a second and hopefully better game Aug 10 13:28:23 that's a waste of time Aug 10 13:28:28 especially if you're doing OGL stuff Aug 10 13:28:43 I heard alot of good stuff said about libGDX tho Aug 10 13:28:48 check it out Aug 10 13:28:48 It might make sense if I knew Java and didn't know C Aug 10 13:29:09 oh wait, GDX is java framework Aug 10 13:30:33 stick with C if you are doing opengl Aug 10 13:31:00 the android docs even state that you should use C if you are doing heavy opengl work Aug 10 13:31:30 The java wrappers they have around it are very C like and you still have to worry about the memory management yourself Aug 10 13:47:24 anyone worth their salt doing game SW wants to take care of memory management themselves. Never rely on GC unless you want stutter... I heard good things about libgdx though. Aug 10 13:49:03 rgr, I understand that, and I'm just stating that you lose all the benefits of java and add some overhead for going java -> c if you do the opengl in java Aug 10 13:51:09 sure but the main waste is not using opengl : the java overhead pales in significance for all but the most intense games I would hazard. I must admit except for the unpredictabiltiy of GC I've come to like java. Actually with a 3 plane parallax scroller and a new Drawables animating on a surface I'm still getting 60 fps on a nexus 4 - so all good. Aug 10 13:52:14 Yeah, I wasn't a fan of java before, but after using it quite a bit I've learned to love it. Especially with all the easy to access 3rd party libraries Aug 10 13:52:27 rgr: a big problem with GC is I think that people are not taught what GC does and all they recall from learning a language is that it's "magic" and handles memory for them :( Aug 10 13:52:45 Whats really gnawing at me atm though is ddms not being able to Get Allocations. Sits there ignoring me. So I m stuck wondering whats releasing 9 megs every 50 seconds or rather why. Aug 10 13:53:01 p_l: yeah agreed. Aug 10 13:53:50 9 megs every 50 seconds? images? Aug 10 13:54:05 But its one of the things I'm "old school" about. I keep hearing how people dont need to "waste time thinking about memory release". Coming from an assembler/C/C++ background it wasnt any extra effort at all and encouraged more thought about optimisation etc. A good skill to have despite HW getting crazy. Aug 10 13:54:36 rgr: well, GC requires more thinking about allocations rather than release, IMO :) Aug 10 13:54:44 jonc: yes images, but I cache them and the only thing I can think is the system and a matrix operation. But 9 megs seems a tad high for the bitmaps going through a matrix transform during DrawBitmap Aug 10 13:55:03 (small bitmaps) Aug 10 13:55:19 rgr: wasn't there a memory profiler? Aug 10 13:56:10 rgr, are you storing the images in a drawable folder? Aug 10 13:56:16 ddms allows you to track allocations. I just got it to grab its first snapshot. Very hit and miss unfortunately. Aug 10 13:56:47 drawable/ images when loaded on the nexus 4 will actually be loaded at 3x the size and they are stored uncompressed in memory Aug 10 13:57:05 yes. But they are only loaded once then scaled and then released and recycled when the surface is created. The scalde bitmaps are then used all the time and not released. So its something else dynamic. Aug 10 13:57:25 jonc: no they're not since I set inScale. Aug 10 13:57:40 but that wouldnt accuont for the repeated "dealloc" since I load once at surface creation. Aug 10 14:02:00 yup. it seems I can forget getting allocations using ddms if I have my draw thread belting away. I'll sleep it just to see if that makes a difference for the sake of tracking down the culprit. Aug 10 14:32:28 I have a ListActivity and want to listen for LongClicks. Do I need to implement View.OnLongClickListener or am I missing the long click method of ListActivity (I found none)? Aug 10 14:34:25 (AdapterView.OnItemLongClickListener instead of OnLongClickListener) Aug 10 14:59:50 Does anyone know when "M2" of Android Studio will happen? Aug 10 14:59:56 I see some bugs with "M2" as their milestone. Aug 10 15:13:04 I don't have a microphone, I was wondering if I could somehow pipe in the sounds from windows as the microphone for my emulator Aug 10 15:23:24 javnut, I'm not sure if windows 7 allows it anymore, but yes, you could do that before Aug 10 15:23:40 it's windows xp Aug 10 15:23:40 set the input device as your output device, I used it to record things before Aug 10 15:23:50 ok, thanks Aug 10 15:24:16 reverse that Aug 10 15:24:21 nevermind Aug 10 15:25:10 another way is to use a cable that is fed from speaker out to line in or microphone in Aug 10 15:25:45 not sure if I have a cable for that either Aug 10 15:26:12 recording seems to work on windows though, let's see if the emulator can pick it up Aug 10 15:28:05 Hi Guys. I want to implement transparent action bar like - https://developer.android.com/training/basics/actionbar/overlaying.html Aug 10 15:28:24 but I am using custom action bar which has linear layout Aug 10 15:28:55 I tried setting android:background="@android:color/transparent" Aug 10 15:28:58 to linear layout Aug 10 15:29:14 also i tried using android:alpha="5" for linear layout Aug 10 15:29:24 which forms actionbar Aug 10 15:29:34 any suggestions to do it ? Aug 10 15:30:13 change the alpha to your color, transparent is gonna be complete transparent, and i think android:aplpha only accepts 0-1 value Aug 10 15:30:43 try color #22000000 and go from that, where you adjust the first 2 #'s Aug 10 15:33:54 I tried this Aug 10 15:33:56 android:background="#22000000" Aug 10 15:33:56 android:alpha="0.5" Aug 10 15:34:06 take away android:alpha Aug 10 15:34:09 just use the color Aug 10 15:34:19 the 22 is your alpha value Aug 10 15:34:20 for black Aug 10 15:34:42 #FF000000 is opaque black, #00000000 is transparent Aug 10 15:35:36 #88000000, #66000000 etc, or #88FF0000(alpha'd red) etc... Aug 10 15:37:36 neo3: it's #AARRGGBB for your colors Aug 10 15:38:12 http://codetidy.com/4841/ Aug 10 15:38:16 see this Aug 10 15:38:30 yea what about it Aug 10 15:38:49 android alpha does work. 0.8 Aug 10 15:39:03 but he shouldn't do a color and still have the android:alpha="0.5" Aug 10 15:39:05 in styles ? Aug 10 15:40:20 yes. in manifest : android:theme="@style/CustomActionBarTheme" , in CustomActionBarTheme : @style/MyActionBar, and then in MyActionBar: 0.8 Aug 10 15:41:07 (in the custom also parent="@android:style/Theme.Holo.Light.DarkActionBar" of course Aug 10 15:41:15 or whatever theme you're using Aug 10 15:41:37 neo3, try setting android:background of all the children views of your linearlayout to #00000000 Aug 10 15:42:36 he only has one child view of linearlayout, the others are children of his relativelayout Aug 10 15:42:52 I meant *all* the children, not just first-level ;) Aug 10 15:43:05 :) i just see him getting confused easily Aug 10 15:43:23 possibly, I just want to make sure no other view is the culprit Aug 10 15:44:06 he could also try (temporarily) removing all the children and leaving just an empty linearlayout Aug 10 15:44:18 hmm trying that Aug 10 15:45:20 nope doesnt work Aug 10 15:45:26 I tried setting all tranparent Aug 10 15:45:31 all childres Aug 10 16:00:37 maybe whichever higher level view is holding your custom layout is the one that needs to be adjusted? just guessing Aug 10 16:05:13 I have a ListView - how do I set it to "disabled" ? Aug 10 16:05:23 I just want to style it differently in such a case Aug 10 16:05:46 I can't find any "setDisable" or "setStyle" type call Aug 10 16:05:52 every view has the .sedEnabled() method Aug 10 16:06:16 oh, heh. and is it easy to set the style in the xml for disabled? Aug 10 16:06:25 wouldn't know Aug 10 16:06:28 is it like css with #disabled or something? Aug 10 16:06:30 okay thanks Aug 10 16:06:50 yeah if you expect CSS-like behavior, you are in for quite a lot of disappointment Aug 10 16:06:56 * ravilov went through the same process Aug 10 16:08:06 put simply, android styles are just a set of semi-arbitrary attributes - what is done with them is up to the view itself, but mostly the style is used only upon view creation Aug 10 16:11:44 ravilov: if I disable a listview, will the items inside it also be disabled ? Aug 10 16:12:51 yes or disabling it would be pretty useless. ditto for visibility. Aug 10 16:19:11 ravilov - yes Aug 10 16:19:38 I have relative layout in linear one Aug 10 16:19:46 um Aug 10 16:19:47 okay? Aug 10 16:19:48 Hi, what would you call a user who uses a library? A client programmer? Aug 10 16:19:52 I dont know which one is causing problems Aug 10 16:19:54 that was clearly visible from your paste, neo3 Aug 10 16:20:04 hmm cool Aug 10 16:20:15 I'm not talking about your layout, I'm talking about the HIGHER LEVEL view Aug 10 16:20:22 the one containig your entire custom layout Aug 10 16:20:47 Guys, I'm trying to find it out, but I don't really know if someone posted information about it. It's said that Android manages priorities for the processes and threads. But when using the Java Api for threads, does it really make the change I make when calling setPriority()? Aug 10 16:21:16 Ohh Aug 10 16:21:25 you mean View mCustomView = mInflater.inflate(R.layout.custom_action_layout, null); Aug 10 16:21:30 you mean mCustomView Aug 10 16:21:33 no... Aug 10 16:21:49 HIGHER LEVEL view Aug 10 16:22:23 Adyrhan, working with threads is quite tricky no matter what you do, and from what I've been reading, thread priorities are very platform and situation dependant and not to be considered reliable Aug 10 16:22:27 it's more like a hint Aug 10 16:24:11 joel135: in Qt we call them application developers Aug 10 16:26:26 ravilov, thanks!. Hmm, that's also similar to what I've read, that Java APIs after all, depends on the jvm implementation for the platform, and the threads api is very dependant on this. But i'm trying to find out how does it work this call under the hood for Android specifically. If it really works or if it takes it into account someway, or ignores it completely :/ Aug 10 16:26:55 I'm seeing myself taking a bath of code e.e Aug 10 16:27:41 And let's hope I get to the parts that have to do with it xD I'm not always successful when surfing big code bases Aug 10 16:28:13 pretty sure it is taken into account in some way, or else the docs would clearly state "unimplemented", "ignored", "deprecated" or something similar Aug 10 16:29:13 if you really want to dig into the code that manages threads, you will most likely cross the boundaries from java/dalvik into native libs and probably into the kernel itself Aug 10 16:29:52 Hi, anyone know if it's possible for an Android app to act as a virtual file system for a host. I.e. a PC would see it as a USB memory stick? I don't want to connect it as the normal filesystem browser, but have the app emulate a file system. Aug 10 16:30:36 thanks johnflux ! Aug 10 16:31:31 Smashcat, that sounds like quite out of scope for a mere user app, but good luck, and definitely report back if you make it :) Aug 10 16:32:22 ravilov: Cheers, yeah I've worked on projects where the Android device is the host, which works ok, but I'm not sure if it's possible to emulate a different client, or if the OS will prevent it. Aug 10 16:32:49 honestly, I don't even know how would I go about doing this, where would I start Aug 10 16:33:02 possibly because I've never had this idea before so never gave it any thought Aug 10 16:34:02 Smashcat: I would look at how linux determines the filesystem folder for the usb mass storage Aug 10 16:34:09 In my case it's so that images can be composited as they're requested by a PC, by the Android app. It's a bit of an edge case, but I'm unsure to even start on it. Aug 10 16:34:14 Smashcat: and then fusemount the custom filesystem there Aug 10 16:34:44 Smashcat: it would require a rooted system of course though Aug 10 16:35:01 johnflux, from what I've seen so far, you just 'echo' the device node name (such as /dev/block/mmcblk0p12) into a certain special file (something like '/sys/usb/host/dev0/shared') Aug 10 16:35:02 johnflux: Yeah I was just thinking it'd require rooting the phone. Aug 10 16:35:12 oh yeah, definitely root Aug 10 16:36:02 Hmm, I'd like to avoid that, but it's probably not possible. Will keep investigating! Aug 10 16:36:11 again, good luck! Aug 10 16:36:15 cheers :) Aug 10 16:36:27 ravilov: okay, then you'd need fuse to create a block device Aug 10 16:36:36 ravilov: dunno if it can or not Aug 10 16:36:38 I dont undersstand what do you mean by higher level Aug 10 16:36:44 yeah exactly, johnflux Aug 10 16:36:53 neo3, I just told you in PM... read it all again Aug 10 16:37:00 I don't know how else to explain it Aug 10 16:38:00 alright Aug 10 16:38:08 ravilov: Smashcat: if the usb mass storage really is operating at a block level, then you wouldn't even be able to do anything like monitor for the requests Aug 10 16:38:40 he could... from a custom-made kernel module :) Aug 10 16:38:49 or Aug 10 16:38:52 :-) Aug 10 16:39:10 if it's not *fully* virtual but like a filesystem image, he could bind it to /dev/loop* Aug 10 16:39:11 johnflux: Yes, that's my worry. If there's an event that can be captured when the USB port is connected though (as we do with USB hosting via Android) I could maybe intercept that Aug 10 16:39:25 ravilov: Do you have starting material to build kernel modules? Aug 10 16:39:34 Smashcat: hmm, that's a very interesting approach. I don't know Aug 10 16:39:41 Smashcat: it would be easier over bluetooth Aug 10 16:39:52 Smashcat: that's an easily readable stream :-) Aug 10 16:39:56 nope, and personally I wouldn't even venture there, kernel modules are highly kernel version dependant and nearly every device runs its own kernel, so... Aug 10 16:40:08 flan3002, ^ Aug 10 16:40:10 johnflux: Yes, but in this case I'm trying to keep it as simple as possible so a PC can just plug into the USB Aug 10 16:40:31 Smashcat: I would give up on the idea and try another approach Aug 10 16:40:40 (I have done something similar with Bluetooth, but if the PC doesn't have it, it's a bit of a pain :) ) Aug 10 16:40:58 ravilov: It's not about Android for me, so I'd still like any good material you can link to. ^^ Aug 10 16:41:10 Smashcat, in that case just redirect the user to a local tech store, bluetooth dongle section :p Aug 10 16:41:27 flan3002, ah I see, but sorry I still have nothing really Aug 10 16:41:29 flan3002: you want generic material on how to build a kernel module? Aug 10 16:41:42 flan3002, try going through existing kernel modules? Aug 10 16:41:43 Heh. I'm going to check this USB method out - might not work, but I'm interested in seeing if it is possible Aug 10 16:42:16 johnflux: Basically, yes, though I have not yet searched extensively yet, that'd be my next step. :/ Aug 10 16:42:23 flan3002: try this: http://eudyptula-challenge.org/ Aug 10 16:42:42 flan3002: it's a bot where you it teaches you the ropes for making kernel modules Aug 10 16:42:52 That looks really cool! Thank you! :) Aug 10 16:43:27 flan3002: the first few exercises are about setting up your email client etc ready for linux kernel mailing list, so you do need the patience of a saint when getting started.. Aug 10 16:43:42 Oh... Aug 10 16:43:44 Really? Aug 10 16:44:20 "All communication goes through email, just like the Linux kernel is developed." Aug 10 16:44:23 flan3002: it starts off with the basics. Challenge one is download the kernel and email proof that you did it. Challenge two is make a hello world module.. Aug 10 16:44:50 flan3002: that challenge one can be really annoying though. The email system doesn't like gmail, for example Aug 10 16:44:57 Don't ever join the linux kernel mailing list and expect to contribute unless you've very thick skin... Linus and co, and rightly so, dont kind kindly to over eager noobs asking what the different between a char and an int are on 16 bit systems.... Aug 10 16:45:00 Interesting. I tried to do the Matasano thingy earlier, but something went wrong... Aug 10 16:45:37 flan3002: You could also read the Developing Linux Drivers book. It's "opensource" and free Aug 10 16:45:41 rgr: Of course. I've read some of Linus comments on gcc... D: Aug 10 16:45:56 flan3002: or you can buy a copy. I went through it a while ago, and it is pretty easy to read Aug 10 16:47:58 Seriously right there flan3002 . it can be tough there. . My bg is in C : and its amazing how many people wont do the basics to understand it before thinking they can "hack the kernel". You know it or you dont. And flowery "elegant" code that doesnt use the features of C is strongly frowned upon. The type of people who think "v=a?b:c;" is "unreadable" need not apply. If you dont know things like that then you're not a C programmer. (yes Aug 10 16:47:58 it exists in many languages including java too I know). Aug 10 16:49:38 rgr: I don't want to contribute to the Kernel right now... I don't know what you mean by 'flowery' and 'elegant' here, but the understanding differs by person, so... Aug 10 16:51:03 rgr: What do you mean by "flowery elegant code that doesn't use the features of C" ? Aug 10 16:51:12 It has very defined meanings with regard to the kernel : the kernel has a very consistent and terse style from variable naming and layout. Aug 10 16:52:55 "flowery and elegant" in my terminology means overly expanded and laid out as if for a presentation : using three lines when a single one would do. e.g while(*d++=*s++); over a more "flowery" for loop with intermediates. Aug 10 16:53:01 if you can't read v=a?b:c then you suck Aug 10 16:53:05 agrede Aug 10 16:53:29 agreed. But youd be amazed how many "C programmers" that I worked with didnt like it. Mind you they'd never read K&R. :) Aug 10 16:53:31 nice buffer overflow Aug 10 16:53:47 waiting to happen there Aug 10 16:54:08 I guess then I'm a "flowery and elegant" programmer Aug 10 16:54:30 And my full time job is programming graphics kernel drivers :-) Aug 10 16:54:52 Im not damning it in other places _ : Im saying that the *kernel* has a terse style and one that must be kept to. Thats all. Aug 10 16:55:28 I like this quote: Aug 10 16:55:31 " Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it." Aug 10 16:55:40 pfn: obviously if you use something like that without knowing the limitations of the memory regions d & s are set up with. But in C you tend to. Or you (not you personally) suck as a C programmer. Aug 10 16:55:48 (The Elements of Programming Style.) Aug 10 16:55:52 while the kernel source code might have its own "coding style", personally I wouldn't care much about it, so long as my code runs just as efficiently as the "compressed" code. if I was to submit it and they want it some other way, they are free to rewrite it Aug 10 16:55:55 johnflux: yeah. One of the most stupid quotes ever. Aug 10 16:56:15 rgr: heh. It's always seemed pretty accurate to me. Aug 10 16:56:24 famous last words of every buffer overflow issue Aug 10 16:56:29 ravilov: yes. Dont bother then because it would be thrown back to you if you're not willing to apply to the common courtesy of coding to a standard hundreds of others agree to. Aug 10 16:57:02 johnflux: no. its rubbish. This was said years ago. Try writing a multithreaded system with an API that spans millions of lines without an debugging. its plain and utter nonsense. Aug 10 16:57:05 ravilov: he's right that they wouldn't bother to rewrite it Aug 10 16:57:21 and he'd get a kick up the arse from Torwalds or someone. Aug 10 16:57:39 rgr: what do you mean "without an debugging" ? Aug 10 16:57:52 A debugger is also very useful for stepping through a an existing code base and learning the ropes. Aug 10 16:57:52 rgr: I'm guessing you mean "without debugging", but I don't understand your point Aug 10 16:58:02 rgr: hmm, did you misread the quote? Aug 10 16:58:09 yes I know, so either they will accept it as is, or they would reject it, in which case I would publish it some other way, if I still want it published at all. or else, I could rewrite it so it adheres to their own "coding style" but then don't expect maintenance and/or patches and updates from me anymore Aug 10 16:58:12 rgr: it seems like you're thinking of another quote Aug 10 16:58:16 oh hang on! Aug 10 16:58:33 rgr: I know what quote you're thinking of, and wasn't it said by Linus? Aug 10 16:58:41 johnflux: oh yeah! sorry. No it was by Kernighan. Aug 10 16:59:10 rgr: "The most effective debugging tool is still careful thought, coupled with judiciously placed print statements." - Kerninghan maybe :-) Aug 10 16:59:14 Hangon. The quite Im thinking of is simply "debugging is twice as hard as doing it right in the first place". Which is again nonsense. Aug 10 16:59:21 rgr: ah Aug 10 16:59:33 rgr: but linus was also strongly against debuggers for ages Aug 10 16:59:36 And the print statements thing is also total toss these days. Written in days gone by. Aug 10 16:59:50 rgr: hence him refusing to add a kernel debugger for many many years Aug 10 16:59:57 Heisenbugs. Linus has his ways. Aug 10 17:00:18 Mind you he probably hated gdb because Stallman wrote it.... Aug 10 17:00:39 the print/echo debugging method is still the most efficient for me, by far, for any language/platform/os Aug 10 17:01:14 ravilov: I also heavily rely on that too, but there are of course exceptions Aug 10 17:01:22 linus quote: “I'm an idiot.. At least this one [bug] took about 5 minutes to find..” Aug 10 17:01:28 obviously not the pretties one, not by any means, but definitely most efficient Aug 10 17:01:52 Its ancient and bad practice when you can set dynamic break points without needing to recompile and deploy. Add/changing *any code* is very poor show. Logging has its place of course. But adding and removing printfs is frowned upon in many many if not all big projects. Aug 10 17:02:28 also has the least impact on the code, the debugger always hogs the code down a lot, so sometimes it's not even usable (when you're debugging code that relies on timing) Aug 10 17:02:38 rgr: you're talking about debugging directly on deployed systems? Aug 10 17:02:47 rgr, that doesn't really apply to kernel programming Aug 10 17:02:58 rgr: otherwise, why would anyone care if you add printf's to your local system? Aug 10 17:02:59 no. Any system. Aug 10 17:03:11 It has its place though. It can also be much more convenient if you output lots of data and can easily scan/search through it... Aug 10 17:03:13 youre kinda mixing arguments here Aug 10 17:03:36 it isn't quite so easy to attach a debugger to any arbitrary kernel Aug 10 17:03:37 why add code and recompile when you can examine vars? Yes I did. I was merely thinking deploy as in "new version" tbh. Sorry. Aug 10 17:03:51 But Im talking in general terms not just kernel. Aug 10 17:04:24 the argument so far seemed centered around kernel dev to me Aug 10 17:04:38 even then gdb is a god send. Aug 10 17:04:40 come to think of it, I believe I used this method pretty much exclusively when doing all my web apps (most of which are commercial, albeit inhouse) Aug 10 17:05:02 ("this method" being echo/print) Aug 10 17:05:10 when I do graphics driver development, I pretty much rely solely on printk :_) Aug 10 17:05:29 printf debugging is the lazy man's approach when better tools exist Aug 10 17:05:50 johnflux, yeah, only real option in kernel space Aug 10 17:06:03 point is, all debugging methods have their place and none of them can be deemed "ancient", "useless", "bad" etc Aug 10 17:06:10 Lazy? The opposite. its a lot more error prone and time consuming IMO. This article touches on some of the issues but there is a better one somewhere http://heather.cs.ucdavis.edu/~matloff/UnixAndC/CLanguage/Debug.html#tth_sEc3.1 Aug 10 17:06:26 it depends Aug 10 17:07:45 hm, so the main counterpoint of echo/print method is that it's... inconvenient Aug 10 17:07:54 ravilov: in the norm using printf when you have a proper debugger with hw breakpoints and conditional watches/breaks would rarely have its place IMO. before you know it you have accidentlly changed a var in your logging code or forget to remove it etc etc. Yes I do use the odd "printf" equivalent but very rarely. I simply cant see the point. Its what we used to do before good debuggers. Aug 10 17:08:27 inconvenient as in "slow, bad practice and inefficient and needs recompiling and is error prone". Yeah. Aug 10 17:08:49 But you knew that from the article which defines what he meant very clearly. Aug 10 17:08:51 rgr, that's perfectly fine if *you* can't see the point. I for one can and it works fabulously for me, or else I wouldn't rely on it so mucj Aug 10 17:08:54 much* Aug 10 17:09:30 Of course you can use it and it works. Thats obvious. But some would say very old fashioned and inefficient and inconvenient. Still if it works for you then good luck. Aug 10 17:10:25 The main reason I don use that is the concept of test code added causing additional issues whether inadvertently or not. Aug 10 17:10:36 When I do android development, I like using a fancy editor, with code completion, debuggers, and so on Aug 10 17:10:51 when I do kernel development, I use just vim and printks Aug 10 17:11:02 not entirely sure why. I think at a certain complexity I want to simplify everything else Aug 10 17:11:11 When I dabbled I used emacs with cscope. Quite nice. Aug 10 17:11:15 even if it could possibly help me Aug 10 17:11:23 IMO, the echo/print method can be a good mental training too - yes it can be considerably more error-prone and definitely has its caveats, but at least it makes you think instead of relying on the "fencing" provided by a full-featured debugger Aug 10 17:11:46 for example, by now I can hardly ever assign a var "by accident" anymore Aug 10 17:11:59 This article nails why its plain silly to use printf when you have a proper debugger *in most cases*. Not all the time. In most cases. http://www.dirac.org/linux/gdb/01-Introduction.php Aug 10 17:12:38 Makes you think? The opposite, It makes you think "do I need to recompile or do I need to remove old test code or does this printf cause a state change which causes other bugs". Aug 10 17:13:17 But as the article says printf has its moments. Generally when you dont have a decent debugger handy. Aug 10 17:13:47 oh yes its sunday, have i come to the church of gdb ? Aug 10 17:14:07 LOL no. Aug 10 17:14:14 no, there are heretics here too Aug 10 17:14:16 gdb is pretty old hat these days. Aug 10 17:14:17 all hail printf! Aug 10 17:14:23 down with stdio! Aug 10 17:14:33 rgr: and it could use a good UI and a book ;P Aug 10 17:14:48 gdb has *cough* ddd. What a horrible system ;) Aug 10 17:15:04 I used to use the emacs gdb interface. Froze as often as not... Aug 10 17:15:33 how come you didn't debug emacs while running a gdb instance? :p Aug 10 17:15:55 all hail the future of clang Aug 10 17:16:19 You should know we are all *always* debugging emacs : extending and learning emacs takes up 90% of your day ;)) Aug 10 17:19:54 The intellij debugger, while on the subject, never ceases to amaze me. very nicely designed. Aug 10 17:21:21 johnflux, admittedly I'm not exactly the one to know my memes too well, but that doesn't seem like a real thing Aug 10 17:22:00 hm, must be the reason I never even wanted to use emacs Aug 10 17:22:08 when it comes to vim, I just simply... use it Aug 10 17:22:11 don't even think about it Aug 10 17:23:12 Hm... Talking about debuggers: https://github.com/wuntee/android_debug Aug 10 17:23:29 in xml, android:color="" how do I set the color, say, blue ? Aug 10 17:30:53 i'm trying to get some assistance with accessing rawcontact data, having a hard time figuring out how to perform a query. Aug 10 17:32:28 I keep getting this error when launching my app through Eclipse: AudioManagerAndroid BLUETOOTH permission is missing! Aug 10 17:32:45 the weird part is that the app doesn't have any audio references Aug 10 17:34:04 any ideas? Aug 10 17:34:07 more specifically, i want to perform the equivalent to a sql self inner join on the data table. Aug 10 17:35:37 I'm trying to use an audiorecord object, and I for loop through all the configurations so it's initialized correctly, but I don't know how to open the raw data to see if everything works Aug 10 17:36:39 I pulled it using the ddms, and have audacity, I just don't know what to put for the byte order and encoding Aug 10 17:37:52 Let me see... Aug 10 17:39:15 see? Aug 10 17:39:26 Why is there no legacy-toolchains tarball for the ndk r10? Or am I supposed to use r10 with the last legacy-toolchains tarball from r9b? Aug 10 17:40:30 johnflux, #FF0000FF maybe? Aug 10 17:40:42 Yeah... File › Import › Raw Data with Signed 16 bit PCM, big-endian 44100 Hz should work for my setup. How did you setup yours, javnut? Aug 10 17:41:34 javnut: You can also write a wave file: http://stackoverflow.com/questions/9179536/writing-pcm-recorded-data-into-a-wav-file-java-android Aug 10 17:41:35 16 bit PCM, big endian but 8000 for the sample rate (because that's what it chose for me) Aug 10 17:41:49 Well, what rate are you recording? Aug 10 17:42:13 it says 8000 in the log when I initialize the audiorecorder Aug 10 17:42:41 sample rate is irrelevant, if wrong it will only play faster/slower, other parameters are much more important Aug 10 17:42:55 ravilov: aah, I see Aug 10 17:43:09 Weird, 8000 is low... Aug 10 17:43:20 not for voice recordings Aug 10 17:43:25 Sure, ravilov, but we want the right speed, no? Aug 10 17:43:32 iam using another project in my app and i referenced it through build path and while running i am getting a error cant find calander.apk which is the project i am using in my app Aug 10 17:43:54 noobandroid_: I told you. Aug 10 17:43:55 flan3002, well if you want to get it all right then yeah, I thought you only wanted to check if the recording is valid at all Aug 10 17:44:00 im using eclipse with adt in windows 8 Aug 10 17:44:10 flan3002: actually, speed can come later Aug 10 17:44:20 because right now I'm not hearing anything but static Aug 10 17:44:21 Okay, try that then? Aug 10 17:44:38 ravilov: yeah, I only want to check if it's valid for now Aug 10 17:45:11 javnut: Can't be that hard. Output all parameters and choose the equivalent when importing, no? Aug 10 17:45:13 flan3002: i read in some post i can be done like using it as library project Aug 10 17:45:45 Yeah, but not every project is a library project. What project are you trying to use? Aug 10 17:45:49 like i am also using another library project appcombat ...i am not having any problem with it Aug 10 17:45:50 flan3002: that's what I'm doing Aug 10 17:46:04 appcompat you mean Aug 10 17:46:11 and yeah the compat lib is an actual lib Aug 10 17:46:17 but i guess u can make it a custom library project ..isnt it Aug 10 17:47:06 yeah sorry appcompat Aug 10 17:47:16 hmmm, maybe it's just not valid Aug 10 17:48:05 let me do another recording, brb in 5 minutes Aug 10 17:48:12 hmm ..actually i got a apk which actually running ..i got source code from the same guy ...and basically its hardcode Aug 10 17:48:38 and i am wrtitng backend for the application Aug 10 17:48:43 I have a TextView and I'm setting the color with a selector - so that the textColor is gray if it's disabled Aug 10 17:48:59 if I do: android:enabled = "false" in the xml, then I do correctly get a gray color Aug 10 17:49:03 u there flan3002 Aug 10 17:49:21 but if in code I do: mTextView.setEnabled(false); then the color doesn't change Aug 10 17:49:49 it's like it isn't updating the color style information Aug 10 17:49:59 and the guy somehow able to include the calander project as a library Aug 10 17:50:33 johnflux, very strange Aug 10 17:51:39 also i am having with the emulator...it just doesnot load the home ...just a wallpaper and clock ...no menus Aug 10 17:51:43 noobandroid_, not quite sure what's your problem, if you have the source code of a working project that uses calendar, then just use that as a template Aug 10 17:52:00 as an example* Aug 10 17:52:15 I'm trying to set the color of my listview when it's disabled.. how should I be doing this? I'd like to take the normal theme color normally Aug 10 17:52:44 the source code has some missing librarys .... Aug 10 17:52:45 the apk file is working Aug 10 17:53:00 like appcompat ....i had to reference it in eclipse Aug 10 17:53:22 johnflux, that's weird, I would think managing default colors would be done by android itself already Aug 10 17:53:31 noobandroid_, well I guess you are expected to do some footwork yourself Aug 10 17:55:37 ur not the guy used a calender app developed by someone .....i didnt find it source code ...i googled the import packages which are missing and found the calender source code.....i checked the properties of the project and found that appcompat and clander are referenced aas libraray projects Aug 10 17:56:03 noobandroid_, also, try to use proper english this "u" and "ur" stuff is hard to read Aug 10 17:56:05 now iam unable to reference it as library project and need help with it Aug 10 17:56:19 sorry will do Aug 10 17:57:05 any ideas Aug 10 17:57:30 or any help with the emulator Aug 10 17:57:49 ravilov Aug 10 17:57:49 ok, it's completely possible that my audio just recorded static Aug 10 17:57:59 I'm going to have to install it on my phone to see Aug 10 17:58:04 no idea noobandroid_, try recreating the AVD maybe? Aug 10 17:58:29 did that no help Aug 10 17:59:14 then no idea Aug 10 18:05:14 boo yah Aug 10 18:08:23 ravilov: the problem seems to be that disabling a listview isn't disabling all the items inside of it Aug 10 18:08:36 ravilov: or at least isn't for styling purposes Aug 10 18:11:39 are the items still clickable, and does clicking them launch whatever action is attached? Aug 10 18:13:26 back to work back to work! Aug 10 18:13:35 no thanks Aug 10 18:20:47 Hey, I'm creating an app which has like 8 different "windows". Which would be layouts. They need to pass data around and so forth. Should I create per "layout" an activity? My idea was to use the Main Activity and just create per Layout (Functionality) a class which handles the things. Thanks a lot for your help. Aug 10 18:20:50 and advice =) Aug 10 18:21:42 I'm having some issues with my app on 4.1.2 only. I keep getting the error "java.lang.UnsupportedOperationException: Can't convert to dimension: type=0x12" on startup. I've looked and can't find any obviously wrong margins or whatnots in my layouts. Thoughts? Aug 10 18:22:19 Full trace is http://pastie.org/9460248 Aug 10 18:22:57 I keep getting this error when launching my app through Eclipse: AudioManagerAndroid BLUETOOTH permission is missing! Aug 10 18:23:03 the weird part is that the app doesn't have any audio references. Any ideas? Aug 10 18:25:54 hey flan3002, I found this http://stackoverflow.com/questions/4440015/java-pcm-to-wav Aug 10 18:26:14 Yeah... Aug 10 18:26:34 Can someone explain to me, why do all my settings that are link to image resources get mixed up when I add new image resources? Aug 10 18:26:37 How to solve this? Aug 10 18:26:45 which I think is a better example of what you previously posted, but I have a question, do the constant values in the AudioRecord class match up to the values I should input Aug 10 18:27:25 like if the channel is mono, should the value for the channel parameter be "16" like AudioRecord.CHANNEL_IN_MONO? Aug 10 18:29:37 to ask in another way- why do existing image resources in project get new ID's after adding new images resource? Aug 10 18:30:09 nvm, I found some documentation Aug 10 18:36:34 http://i.imgur.com/wR3ZxfB.jpg Aug 10 18:38:22 lordgreg, clean the project and rebuild Aug 10 18:38:47 lordgreg, no idea why they get new resources though Aug 10 18:38:51 it's just what it is Aug 10 18:41:50 hi again ravilov:) just found the stackexchange info: You shouldnt rely on the actual values of the R.drawable.* attributes. Aug 10 18:41:50 Create your own ids instead (for example 1 correspond to R.drawable.icon_home and 2 correspond to R.drawable.icon_home2) Aug 10 18:42:07 where are those ID's stored anyways? o_O Aug 10 18:44:34 so it looks like i should rather store identifier aka string like "R.drawable.ic_launcher" and then use getIdentifier(string) to store icons rather than storing actual ID's Aug 10 18:45:11 lordgreg, R.class inside gen/ Aug 10 18:45:16 nothing you should ever touch Aug 10 18:45:20 er Aug 10 18:45:22 R.java * Aug 10 18:46:06 lordgreg, yes, they are completely right - don't EVER rely on any auto-generated content to be consistent Aug 10 18:52:51 aapt just iterates through your resources and generates a new id every time it encounters a new type and name combination Aug 10 18:55:48 johnflux, I just created a test app, seems like .setEnabled() on a listview doesn't really do all that much Aug 10 18:56:25 it most certainly doesn't prevent calling .onItemSelected() Aug 10 18:56:34 er, .onItemClick() Aug 10 18:57:22 ravilov: thanks :-) I'm wondering how I can do this. Basically all I want to do is change the color of the text of all my TextView's inside a ListView while the user is typing something Aug 10 18:57:24 thats mostly handled by the adapter AND the child view's enabled status Aug 10 18:57:41 (clickable or not) Aug 10 18:58:20 moreover, listadapter has methods such as isEnabled() and areAllItemsEnabled() Aug 10 18:58:59 johnflux, yeah I understand, not quite sure, and to be honest don't feel like digging into this right now ;) Aug 10 18:59:10 Hey, I'm creating an app which has like 8 different "windows". Which would be layouts. They need to pass data around and so forth. Should I create per "layout" an activity? My idea was to use the Main Activity and just create per Layout (Functionality) a class which handles the things. Thanks a lot for your advice. Aug 10 18:59:31 ravilov: no worries - thank you very much for going as far as to make a test app! Aug 10 18:59:47 ravilov: seriously appreciated - thanks Aug 10 19:00:19 Zerg_Rush: I can't advise at all, but do you know about fragments? Aug 10 19:00:26 no prob, the app is really simple anyway, ~80 lines in Main.java plus ~10 lines in XML :) Aug 10 19:00:42 er, ~70 in java Aug 10 19:00:47 darn I can't type today Aug 10 19:01:08 johnflux, no I dont... can I just paint an entire new window using the fragments Aug 10 19:01:09 ? Aug 10 19:01:29 never used fragments before, but from what I hear, yes you can Aug 10 19:01:43 fragments are kind of "subactivities" within your activity Aug 10 19:01:48 kind of like* Aug 10 19:02:05 ravilov, ok thanks. I just think creating 8 activities for 8 windows is kind of stupid... especially if you have to pass around custom objects Aug 10 19:02:29 (but i might be wrong) Aug 10 19:02:41 it is not necessarily stupid, but it might be inefficient, depending on your specific case Aug 10 19:02:46 fragments sure sound better Aug 10 19:03:14 I used fragments to display a "confirm" box (dont know how its called in android lingo) so I thought its for these kind of things only ;-) Aug 10 19:04:25 nah Aug 10 19:04:29 also, alertdialog Aug 10 19:04:58 hey g00s_ https://www.dropbox.com/s/wc50fv7jicoaatw/Screenshot%202014-08-10%2015.04.38.png :P Aug 10 19:05:26 Afzal nice, is that ST ? Aug 10 19:05:36 g00s_, no, that's Github :) Aug 10 19:05:42 oh yeah that :) Aug 10 19:05:50 should have noticed raw / blame / history Aug 10 19:06:08 yeah lol, gonna fix a few things in the userscript then release it Aug 10 19:06:40 nice Afzal ;) Aug 10 19:12:59 can anyone show me how to make the camera activity in my app save to a special folder just for the app? Aug 10 19:13:41 kabkacaana: have you searched google? Aug 10 19:13:48 I am pretty sure there are tons of scripts on this Aug 10 19:14:38 ya but the ones im seeing on stackoverflow are more complex with mine and deal with bitmaps. this it the first thing ive ever done on android so im just using action_image_capture Aug 10 19:16:29 you will eventually have to deal with bitmaps Aug 10 19:16:37 so I say its better to learn them from early on Aug 10 19:17:05 AAA Aug 10 19:18:42 shouldnt i learn one thing at a time xD Aug 10 19:19:47 kabkacaana, this sounds like not exactly the best thing to do as your first app Aug 10 19:23:12 kabkacaana, what you have going on is, you have the camera app doing all the hard work for you Aug 10 19:23:20 ravilov: exactly Aug 10 19:23:31 however the camera app is not meant to be used as an API, so it's not configurable as you'd want it to be Aug 10 19:23:59 ravilov: i suspected that. so i cant change the path at all? Aug 10 19:24:32 no idea, but I wouldn't be surprised if you can't Aug 10 19:26:58 BTW, I figured out my problem. Setting windowTranslucentNavigation and windowTranslucentStatus borked things for 4.1.2 with this error. Aug 10 19:33:54 kabkacaana: You can change the path. Aug 10 19:33:57 I've done it before. Aug 10 19:34:34 detachYo: that's good. is it a big workaround? Aug 10 19:34:43 No: here you go http://stackoverflow.com/a/7266616/854698 Aug 10 19:34:53 that was 1 google search Aug 10 19:34:55 :) Aug 10 19:35:18 ah i tried that before. :/ i'll tinker with it some more though. thanks Aug 10 19:35:36 no prob Aug 10 19:38:10 It pains me to admit that dp sclaing for different devices is turning my brain inside out. Aug 10 19:38:30 scaling Aug 10 19:39:58 detchYo: i just find this part weird new File("/sdcard/flashCropped.png" Aug 10 19:40:16 I'd say that's just an example Aug 10 19:40:16 it doesn't ever make a call to create a new directory Aug 10 19:40:32 yeah you probably need to make the directory yourself prior to calling the cam Aug 10 19:41:09 i see Aug 10 19:41:26 are "this" and "getApplicationContext()" the same in activity? Aug 10 19:41:46 kabkacaana: yes, that's why I was telling you, you can't expect easy coding for everything. You have to create the directory if it doens't exist. Aug 10 19:41:49 :) Aug 10 19:42:04 Have a function that returns a dynamic file name with a path, and in that function check if path exists, if not create it Aug 10 19:42:04 kabkacaana, http://developer.android.com/reference/java/io/File.html#mkdirs%28%29 Aug 10 19:42:32 detachYo, no, this is the activity context, while getApplicationContext() is (obviously) the application context Aug 10 19:42:43 I think it has to do with several activities being part of the same task stack Aug 10 19:42:57 like you have your main activity that calls your preference activity Aug 10 19:43:11 "this" would be different but getApplicationContext() would be the same for the two Aug 10 19:44:09 now, I'm not quite sure when should you should use which Aug 10 19:44:12 ravilov: makes sense, thank you for explaining Aug 10 19:44:22 probably depends on the situation Aug 10 19:44:24 no prob Aug 10 19:47:32 ravilov: for this case, it was for a Toast Aug 10 19:49:37 then you should be good with just "this" Aug 10 19:50:37 nope, actually I had to do getApplicationContext() for some reason Aug 10 19:51:02 hm, weird Aug 10 19:51:31 yup Aug 10 19:52:25 did you by any chance try to call it from a broadcastreceiver? Aug 10 20:20:46 my app has three five star ratings! and i got email! woo Aug 10 20:32:08 what's your app? Aug 10 20:33:14 lasserix: https://play.google.com/store/apps/details?id=email.crappy.zippyplayer Aug 10 20:33:17 its illegalities Aug 10 20:33:39 oh great Aug 10 20:33:51 now i can pirate from my cellphone!~ ;p Aug 10 20:34:27 did i say pirate? i meant preview music i normally buy! Aug 10 20:34:34 how are you going to market? Aug 10 20:34:43 nice icon/logo Aug 10 20:36:01 did you follow some tutorial for the intro "how to use" overlay stuff? Aug 10 20:36:06 is that standard somewhere? Aug 10 20:36:21 lasserix: thanks :D the tutorial is made with ShowcaseView Aug 10 20:36:25 for that part, i'd also colorize the icons that are focused Aug 10 20:36:37 https://github.com/amlcurran/ShowcaseView Aug 10 20:36:47 lasserix: care to give a quick example of what you mean? Aug 10 20:37:10 so when it says like press here and the circle is around the magnifying glass Aug 10 20:37:20 can you make the magnifying glass logo itself colorize organe? Aug 10 20:38:05 just a minor detail, not necessary, just to make it clearer -- it looks good enough Aug 10 20:38:31 lasserix: I can take a look, but it may be a bit too much effort to do such a change, it should guide the user well enough :D Aug 10 20:39:26 yeah Aug 10 20:39:45 can you make it download through the app, or do you reroute to the page for avoiding "legal" difficulties? Aug 10 20:39:53 I tried to make it DL directly Aug 10 20:40:04 but Zippyshare uses some weird id's in the dl url so anything I come up with wont work Aug 10 20:40:09 and it ends up downloading the file page Aug 10 20:40:26 that's what I hate about it right now, if you set the default app on zippyshare to my app, download wont work Aug 10 20:40:35 hmm Aug 10 20:40:39 you'll figure it out Aug 10 20:40:46 you should do prefix searching Aug 10 20:41:00 use an async loader Aug 10 20:41:21 i tried using a hidden webview to load the page so the dl link is generated for the user but its still invalid if i programmagically use that dl url Aug 10 20:41:21 :/ Aug 10 20:41:25 lasserix: what do you mean? Aug 10 20:41:36 i should not have to press the search Aug 10 20:41:39 for it to do search Aug 10 20:41:48 every character you should catch, and do another search automatically Aug 10 20:41:53 like google instant search Aug 10 20:42:00 you can use an async task to do it Aug 10 20:42:06 async loader i mean Aug 10 20:43:08 but if you don't you shoul dhave the IME option on the soft keyboard set to search so instead of saying "go" the enter button says "Search" or has the magnifying glass Aug 10 20:43:36 also make the results sortable by alphabet, by file type, Aug 10 20:43:37 etc Aug 10 20:44:05 great app though! Aug 10 20:46:01 lasserix: I'm limited to a hundred queries a day Aug 10 20:46:03 on searches Aug 10 20:46:15 ohh Aug 10 20:46:16 i see Aug 10 20:46:21 why is that? Aug 10 20:46:25 are you using some sort of api? Aug 10 20:46:26 Google custom search API Aug 10 20:46:33 hmm Aug 10 20:46:41 why not use a webview, then parse the results? Aug 10 20:46:48 a hidden webview Aug 10 20:46:50 thats what im planning on doing Aug 10 20:46:55 ahh Aug 10 20:46:55 okay Aug 10 20:47:01 custom search on a website -> unlimited queries Aug 10 20:47:04 its fucking weird imo Aug 10 20:47:30 iffa: Reroute it through your own site? :P Aug 10 20:47:43 flan3002: going to do something like that Aug 10 20:47:53 i'll have to see Aug 10 20:49:23 hello, have anyone used google maps v2 and cluster markers? Aug 10 20:53:23 https://www.google.com/cse/publicurl?cx=018314400463527779086:iffpyw29ts0 im sure i could abuse this site (generously generated by google for me!) for my app Aug 10 20:59:03 so for your next app are you going to make a port of tubeplus.me? ;p Aug 10 20:59:17 o.0? Aug 10 21:01:32 is it really possible to interact with a webview that much to route search through that? Aug 10 21:02:21 sure Aug 10 21:02:35 the hard part is parsing it Aug 10 21:02:52 hmm Aug 10 21:07:02 requires android: 4.0 and up Aug 10 21:07:08 * ravilov closes tab Aug 10 21:07:31 ravilov: too bad Aug 10 21:07:44 nah it's okay, I don't use zippyshare anyway Aug 10 21:07:48 haha Aug 10 21:08:12 I didn't want to support older versions because the quality of the users isn't that great Aug 10 21:08:19 but congrats on your app Aug 10 21:08:19 and they'd have slow and buggy devices Aug 10 21:08:33 are you calling my device slow and buggy?! Aug 10 21:08:40 no :P Aug 10 21:09:01 some older devices are great Aug 10 21:09:03 but most of it is just meh Aug 10 21:09:17 mine was way ahead of time when it was released Aug 10 21:09:26 what device have you got? Aug 10 21:09:54 http://bit.ly/1sDaaDm Aug 10 21:10:29 that isn't bad Aug 10 21:11:27 it's pretty awesome Aug 10 21:11:33 mine broke actually Aug 10 21:11:39 so then it was time to get a new phone Aug 10 21:11:47 guess which one I got as a replacement? Aug 10 21:12:14 ive no clue Aug 10 21:12:21 same one? Aug 10 21:12:22 :P Aug 10 21:12:25 yes Aug 10 21:12:37 i guess it is pretty good then Aug 10 21:12:40 yep Aug 10 21:12:48 you dont want a newer device? Aug 10 21:13:20 ew tegra 2 Aug 10 21:13:23 kill it with fire Aug 10 21:13:35 haha Aug 10 21:13:52 yeah tegra2 is a bit too closed and stuff Aug 10 21:13:53 shame really Aug 10 21:14:08 but other aspects of the phone totally make up for it, at least for me Aug 10 21:14:23 iffa, when my first one broke, I could totally get any phone I wanted Aug 10 21:14:25 and I looked at them Aug 10 21:14:33 and no other was quite as appealing Aug 10 21:14:43 tegra2 has ... very narrow memory pipeline :) Aug 10 21:14:54 oh the nerds Aug 10 21:14:55 :p Aug 10 21:14:58 the greatest fuckup is really in the fact that it's the only ARMv7 chip without NEON Aug 10 21:14:59 WORKS FINE! Aug 10 21:15:09 pretty much fucking up fast C acceleration for whole generation until now Aug 10 21:15:14 or, at least until ARM64 Aug 10 21:15:18 ravilov: would you still pick the same phone today or a newer one? :P Aug 10 21:15:29 since there's no way to filter out Tegra2 in a say way when publishing the app :/ Aug 10 21:16:01 iffa, wife is getting a new phone so we looked at phones again, we both decided Moto X would work best for her, and I like it too but I don't know if I'd prefer it over this Aug 10 21:16:34 Mavrik, that would be mean anyway Aug 10 21:17:02 O.o Aug 10 21:18:07 filter devices out just because they have tegra2? Aug 10 21:18:24 Why would that be "mean"? Aug 10 21:18:50 well why would you filter such devices out? Aug 10 21:18:59 Because NEON code won't run on them. Aug 10 21:19:15 and your app really needs NEON? Aug 10 21:19:20 Yes. Aug 10 21:19:25 hm Aug 10 21:19:30 (go look up what NEON does.) Aug 10 21:20:08 I read about it before but I forgot, all I remember right now is that it's a pretty cool thing and my phone doesn't have it, but oh well Aug 10 21:20:19 will look it up later Aug 10 21:20:21 Right now we just have to deal with those few people whining about the app crashing on their phones Aug 10 21:21:02 But then again, that's mostly the Play Store issue of not really giving good tools for filtering installations depending on device hardware Aug 10 21:28:07 Mavrik, "Neon is an ARM co-processor, meant for vector processing" - correct? Aug 10 21:28:19 it's a vector instruction set Aug 10 21:28:42 similar to MMX/SSE/S...SE on x86 Aug 10 21:30:26 holy shit Aug 10 21:30:35 i figured a quick and easy way to fix my search Aug 10 21:34:41 ? Aug 10 21:35:15 lasserix: http://crappy.email/zippy/search.html?q=swag&filter=0 Aug 10 21:35:39 parsing info from that will be easy enough Aug 10 21:36:32 cool Aug 10 21:56:03 So i have a custom viewgroup, i add two views from xml from it. (this is a menu system). when i call setInvisibility on either of those two views, does not work. instead i have to find the root view in those views layout, and call setvisibility on those, for it to toggle the visibility. why should it be so? Aug 10 22:21:32 how do I hide a suggestion in an adapter? Aug 10 22:22:14 lets try that again, how do I hide a suggestion when pre-filling autocomplete? Aug 10 22:41:38 JakeWharton, merging all my fixes Aug 10 22:45:49 good evening canadiancow Aug 10 22:46:01 hey g00s_ Aug 10 22:51:02 Anyone has an idea how to hide dropdown for autocompletetextview? Aug 10 22:58:05 hey guys... Does anyone have any experience with Picasso library for Android? If I have the Bitmap data in byte[] in memory, what's the easiest way to display it using Picasso? Save it to a file? Aug 10 23:01:02 so lets say i want to maintain a cache of Views. is a good time to evict it View.onDetachedFromWindow() ? Aug 10 23:02:46 hm, seems like it ... lets try XD Aug 10 23:04:00 come crawling back to android, huh? Aug 10 23:06:21 g00s_: a view cache while it's still attached to window ? Aug 10 23:06:53 I just got up but I think I'm missing the point on that one :) Aug 10 23:07:53 StingRay_ yeah Aug 10 23:08:35 i want to tag a bunch of views in XML so I can visit those. Aug 10 23:09:50 for (View v : viewsWithTag("sometag") { do something } Aug 10 23:10:15 ah ok, not lots of views though right ? Aug 10 23:10:20 of course, viewsWithTag should momoize results for further invocations on the same tag Aug 10 23:10:34 cause I would imagine (depending on structure) that it would be quite heavy Aug 10 23:12:17 i can't see how, its just a BFS search like findViewById Aug 10 23:12:30 don't want to keep doing it over and over though :) Aug 10 23:12:42 think it's worse Aug 10 23:13:00 findView int ref, findTag (object) (String) (Map) Aug 10 23:13:23 that only finds the first one Aug 10 23:13:40 yeah I mean a View.TAG Aug 10 23:13:42 i want all of the views that match a tag criteria Aug 10 23:13:54 is also a map ref too Aug 10 23:14:09 like myView.SetTag(someID,SomeVal) Aug 10 23:14:52 i XML i'm going to set a tag like android:tag="GROUP1 | GROUP2 | GROUP3" Aug 10 23:16:11 bankai_au gotta get something released before thanksgiving :) Aug 10 23:16:26 Alright guys, bear with me, because I'm just barely learning Android here. In my main activity, I create an ArrayList. I want that array list to only be created when I first start the app. How do I initialize the list so that it creates a new one when there's nothing in it, but uses the same one when it already has data in it? Aug 10 23:17:34 so your question is rather "how do I store/persist data in android?" ? Aug 10 23:17:48 http://developer.android.com/guide/topics/data/data-storage.html Aug 10 23:18:03 that should give you an idea Aug 10 23:18:24 variables attached to an activity die along with that activity, so have a read of that link Aug 10 23:20:05 Well right now, I start with "ArrayList list = new ArrayList();", which means it makes a new one every time. Is the only way to avoid doing that to store it to a file? Aug 10 23:20:35 well yes, write it to a file, but that should be also linked on that page Aug 10 23:20:49 and read it in on start, if it exists Aug 10 23:21:29 Yeah, it's on the page, I was just hoping there was another way. Well thanks for being patient, I'll figure it out Aug 10 23:25:12 g00s_: did you say you were doing AI stuff ? Aug 10 23:25:35 bankai_au trying to teach myself stats Aug 10 23:25:39 then ML later on Aug 11 01:07:59 how would I run this code from the command line? http://pastebin.com/raw.php?i=t28tYC0J Aug 11 01:10:14 garyserj: that looks like a windows dir command Aug 11 01:10:36 what are you trying to run? gradle? Aug 11 01:10:40 your android app? Aug 11 01:11:47 the android app Aug 11 01:12:12 I think I have gradle installed.. I tried it once Aug 11 01:12:40 hmm, it says build successful Aug 11 01:12:41 are you trying to build your project (apk)? or run your app on your computer Aug 11 01:12:43 ? Aug 11 01:12:51 i'd like to deploy it to an emulator Aug 11 01:13:09 and eventually, to my phone Aug 11 01:13:49 see the section "Run on an Emulator" here http://developer.android.com/training/basics/firstapp/running-app.html Aug 11 01:14:11 I think I went through that.. they showed for ant Aug 11 01:14:18 and for eclipse Aug 11 01:15:18 I have managed to create a project with ant, and get ant to deploy the app I wrote to an emulator Aug 11 01:15:24 but this app isn't one that was made with ant Aug 11 01:15:28 I guess it was made with gradle Aug 11 01:15:58 garyserj, why aren't you using an ide? Aug 11 01:16:15 because SATA is better obviously Aug 11 01:16:18 (gradle install is the command to install an apk after building it) Aug 11 01:16:22 zinx, SATA? Aug 11 01:16:26 eclipse is crashing Aug 11 01:16:26 sorry, bad joke Aug 11 01:16:38 garyserj, Android Studio? Aug 11 01:16:51 I might give it a try though I like to be able to operate from command line Aug 11 01:17:30 i didn't realise that app was done in gradle, i'll look into it Aug 11 01:17:34 garyserj Android Studio has a terminal instance built into the sessoin Aug 11 01:17:35 oh okay. yeah I just meant that you might wanna spend time making the app instead of battling with the command line stuff :) Aug 11 01:17:55 session* Aug 11 01:19:55 garyserj: though I've not tried it myself, it looks like if you run adb install bin/MyFirstApp-debug.apk while your emulator is running and unlocked, it should open up on the emulator (you would have to change the path of the apk obviously) Aug 11 01:27:10 out of interest, what gives away that it's made to be built with gradle? Aug 11 01:28:43 There should be a handful of gradle files in the directory Aug 11 01:29:35 are there ? http://pastebin.com/raw.php?i=t28tYC0J Aug 11 01:30:18 I see no .gradle Aug 11 01:30:30 in which case maybe it wasn't built with gradle and isn't meant to be run with gradle Aug 11 01:30:40 I wonder then how it can be run from the command line Aug 11 01:30:57 It doesn't look like it's got any gradle files Aug 11 01:31:20 Is it a full app? Because the name ButtonListener sounds like it's just an example of a part of an app Aug 11 01:31:37 It is definitely a full app Aug 11 01:31:40 strange name I know Aug 11 01:32:03 it's a cat and when you tap it it makes a souns Aug 11 01:32:12 s/souns/sound Aug 11 01:32:28 I got it running a very long way around Aug 11 01:32:54 by creating a fresh project with ant, and getting that running and adding to it from the source files of that program, then making it right.. Aug 11 01:32:56 Ah, I see. It doesn't look like a gradle project to me, but see if there's any gradle files in src Aug 11 01:34:01 just import into AS and will create files right ? Aug 11 01:34:37 He prefers to do things from the command line rather than an IDE Aug 11 01:34:38 http://pastebin.com/raw.php?i=vb61ZUed Aug 11 01:34:50 I don't see any gradle files in src Aug 11 01:34:59 though i'm not aware that gradle would put files in src anyway! Aug 11 01:35:18 not that familiar with gradle though so can't say for sure Aug 11 01:35:29 no thats ANT Aug 11 01:35:34 if it puts things in src or not but no .gradle dir anywhere. Aug 11 01:35:37 There is no build.xml file Aug 11 01:35:42 Yeah, looks like it was made in eclipse Aug 11 01:35:56 and you must have compiled it cause there is an apk in bin/ Aug 11 01:36:12 he did Aug 11 01:36:20 it's source code I downloaded Aug 11 01:36:39 But i'd like to be able to deploy it like I have with programs i've written.. ant debug install Aug 11 01:36:43 not just from the apk Aug 11 01:36:54 that said.. I haven't tried installing from the apk Aug 11 01:38:14 are there any disadvantages to using a higher language level in your android projects? aka using level 7 (diamonds/arm/multicache)? I dont see why choosing a lower version and having less features would be desireable Aug 11 01:40:00 getting this message with adb install bin\blah.apk http://pastebin.com/raw.php?i=NCV2AVYz And, I don't see it appear in my emulator Aug 11 01:53:50 garyserj: google is your friend http://stackoverflow.com/questions/4449540/failure-install-failed-already-exists-when-i-tried-to-update-my-application Aug 11 01:54:53 oh wow there is a android-dev Aug 11 01:55:09 first of all im new to this like today new .. second of all do i have to use a github for my device ? Aug 11 01:55:30 i have the kernel souce and i have my device tree Aug 11 01:56:28 jcbjoe__: wrong place Aug 11 01:56:33 this is app dev Aug 11 01:56:34 oh Aug 11 01:56:36 read title Aug 11 01:56:38 my bad Aug 11 01:56:50 true where would i go then do you know ? Aug 11 01:56:56 read title Aug 11 01:56:57 :) Aug 11 01:57:07 ugh android-root is always dead Aug 11 01:57:34 Hey, I'm using umano's AndroidSlidingUpPanel and whenever I use a ListView as my Main Layout, its items only appear after collapsing the Sliding Layout once. Does anyone have an idea why this is happening? Aug 11 01:58:03 jcbjoe__ are you looking to build a ROM? Aug 11 01:58:41 jabza, yes from my stock device Aug 11 01:58:59 PM me, I can help if you'd like Aug 11 02:00:59 No one knows umano's AndroidSlidingUpPanel and thus can't help me? Aug 11 02:02:03 kk Aug 11 02:02:19 I'm gonna try their issue tracker :-) Aug 11 02:15:27 I am trying to add this module to my application but can't figure out how to add the dependency in gradle: http://loopj.com/android-async-http/ Aug 11 02:15:58 this is what my build.gradle looks like http://pastebin.com/q0eDGeuW Aug 11 02:16:27 but I get an error saying compile() is an unsupported gradle dsl method Aug 11 02:16:40 anyone know how to do this correctly? Aug 11 02:17:30 says on the github page Aug 11 02:17:31 https://github.com/loopj/android-async-http Aug 11 02:18:18 StingRay_, I don't see any reference to the build.gradle file Aug 11 02:19:31 erm no you add the dep Aug 11 02:19:35 like it says Aug 11 02:19:48 Gradle: com.loopj.android:android-async-http:1.4.6-SNAPSHOT <---- Aug 11 02:20:00 on that page :) Aug 11 02:20:28 well thats for the dev snapshot Aug 11 02:20:33 the one previous is release Aug 11 02:20:46 just search for the word "gradle" on that page ;) Aug 11 02:21:35 StingRay_, I am sorry but I am not exactly sure what you are trying to say Aug 11 02:21:44 I dont see a SNAPSHOT page Aug 11 02:22:30 I am just confused how to add the dependency in android studio Aug 11 02:24:20 ok add it from maven Aug 11 02:24:24 easiest Aug 11 02:25:05 StingRay_, can you look at the pastebin link I added of my build.gradle and tell me what needs to be different? Aug 11 02:25:47 well just do it thought UI Aug 11 02:25:54 project structure Aug 11 02:26:06 deps > + maven Aug 11 02:26:29 AS will sync your gradle for you then Aug 11 02:26:56 through* Aug 11 02:27:23 and then you can look at it later and see how it should have been :) Aug 11 02:28:15 I dont see the android-async-http module listed Aug 11 02:29:00 nvm i think i got it **** ENDING LOGGING AT Mon Aug 11 02:59:58 2014