**** BEGIN LOGGING AT Fri Nov 21 02:59:58 2014 Nov 21 03:09:32 hi Nov 21 03:09:40 I've compiled dropbear for 5.0 but it's failing to resolve hostnames. It works when specifying the ip address directly.. Nov 21 03:10:11 I have a small issue with my app I am trying to find help with. Nov 21 03:10:20 any ideas? Could it be SELinux? Nov 21 03:10:54 does getaddrinfo work in 5.0? Nov 21 03:12:14 oh new splash for 1.0.0RC Nov 21 03:12:50 I have a menu system that spans across a couple categories. When I change one entry, it changes on all the categories rather than just the one Nov 21 03:17:37 seems odd that getaddrinfo is restricted differently than wifi Nov 21 03:18:57 isnt SELinux in kitkat too? ;) Nov 21 03:19:05 * isnt selinux enabled Nov 21 03:19:13 I think so Nov 21 03:19:20 but it was added and not enabled as much Nov 21 03:19:56 it was really a stab in the dark Nov 21 03:21:34 looking at ls -Z doesn't really tell me much, but I think selinux isn't an issue Nov 21 03:22:49 "Error resolving" Nov 21 03:23:06 jedix, what the int error returned by getaddrinfo? Nov 21 03:23:10 what is* Nov 21 03:23:24 Name or service not known Nov 21 03:23:34 ..it was set to that string Nov 21 03:23:52 http://linux.die.net/man/3/getaddrinfo try to get the real return value Nov 21 03:24:22 looks like EAI_NONAME Nov 21 03:24:40 in your case, did your forgot internet permission maybe? Nov 21 03:25:34 adq: it can connect when using an ip addr Nov 21 03:26:19 ah so internet permission (in manifest) is not the issue Nov 21 03:26:42 adq: it's a bit of an odd situation. I adb push'ed the binaries into the app dir (rsync for android) and changed the owner to the same as the app Nov 21 03:27:16 yeah, I don't get it Nov 21 03:29:57 sorry I cannot help you more, I'm not physically near to my ndk dev env right now Nov 21 03:30:03 so i cannot test it Nov 21 03:30:11 no problem Nov 21 03:30:20 thanks for looking into it Nov 21 03:30:29 I'd have to send my project file to someone for them to further understand my issue Nov 21 04:14:08 http://www.reddit.com/r/androiddev/comments/2mxe0t/android_studio_10_release_candidate_1_released/ Nov 21 04:14:22 what's the use of ComponentName class? Just trying to understand. Nov 21 04:16:20 Still no JVM unit testing. Nov 21 04:17:43 works fine in IJ Nov 21 04:18:49 With Gradle? Nov 21 04:18:56 yes Nov 21 04:19:05 How? Nov 21 04:22:27 Hello Nov 21 04:25:08 I've just upgraded my Nexus 5 to Android 5 via OTA. So far, I liked it. Nov 21 04:27:42 i'm getting unreachable statement when using break; why is that? Nov 21 04:27:50 Im using it with a switch case Nov 21 04:28:32 prove it Nov 21 04:29:00 lollipop <3 Nov 21 04:29:30 Does anyone here have any experience on writing any BLE enabled app? Is there any proper tutorials about it using android 5? Nov 21 04:30:01 z4rd0z: Depends on the code. Nov 21 04:30:03 are you returning before method, or doing an if condition that is always false Nov 21 04:30:21 hey can anyone help me with some code I made up to see why its spitting errors out? Nov 21 04:30:30 yeah Im using a return before break Nov 21 04:30:39 switch (position) { Nov 21 04:30:39 case 0://Page 1 Nov 21 04:30:39 { Nov 21 04:30:39 return Con_70s.newInstance(position);//return 1970s Nov 21 04:30:39 break; Nov 21 04:30:59 pastebin your code Nov 21 04:31:07 k sry Nov 21 04:31:26 http://pastebin.com/v0Qqcf1F Nov 21 04:31:32 and dont need break if returning Nov 21 04:31:34 The 'break' is of course useless. Nov 21 04:31:43 but maybe post error with code Nov 21 04:31:46 http://pastebin.com/tEvxNC3d Nov 21 04:32:05 it just says Error: unreachable statement Nov 21 04:32:12 remove break Nov 21 04:32:15 it looks fine no errors in code but when I go to debug it on my phone it spits errors Nov 21 04:32:42 You're calling findViewById before onCreate. Nov 21 04:32:45 Seems like a very bad idea. Nov 21 04:32:46 and think about naming things different Nov 21 04:32:50 Put it into onCreate. Nov 21 04:33:04 hm causes a crash Nov 21 04:33:35 tonic: And put it after setContentView. Nov 21 04:33:38 z4 dont need braces with switch case Nov 21 04:34:05 I did TacticalJoke, now complains cannot find variables Nov 21 04:34:15 You need to keep the fields declared. Nov 21 04:34:22 And define them (assign them) in onCreate. Nov 21 04:34:47 whatitis, can you give me an example without braces? not sure which I can remove? Nov 21 04:35:11 TacticalJoke: I'm new to android, I made this app in Java wanted to try my luck in android, I don't know what those do :( Nov 21 04:35:13 your { after case 0: Nov 21 04:35:13 In other words, just move the "= findViewById(...);" stuff to onCreate. Nov 21 04:35:34 public tip(double v) { billAmount = 0; } .... Nov 21 04:35:56 and why the hell class name starts from small letter ? Nov 21 04:36:11 idk Nov 21 04:36:14 android studio is weird Nov 21 04:36:17 complained if I didnt Nov 21 04:36:19 just case 0: return whatever; case 1:..... Nov 21 04:36:30 tonu42: that code is wierd Nov 21 04:36:32 not AS Nov 21 04:36:35 tonu42: The problem is that you're trying to find a view before setContentView (before it's possible to find a view). Nov 21 04:36:35 oh nvm Nov 21 04:36:41 I must have named it incorrectly and it auto did Nov 21 04:36:47 You're trying to do the impossible. Nov 21 04:36:50 this.rate = rate / 100; Nov 21 04:36:53 okay I think I see what you're saying Nov 21 04:37:06 a not this Nov 21 04:37:07 gordon camelCase Nov 21 04:37:38 that isnt a class also, its a method Nov 21 04:37:39 setContentView loads the XML layout files. findViewById can *then* find stuff. But not before. Nov 21 04:37:40 okay gordon_ I will change it, I am used to Java Nov 21 04:37:47 file* Nov 21 04:38:16 public class tip { Nov 21 04:38:17 PascalCase is the convention for Java classes. This is not an Android thing. Nov 21 04:38:20 whatitis: yes ;) Nov 21 04:38:37 I know, it was a weird auto complete, I'm getting used to the new IDE Nov 21 04:38:46 http://pastebin.com/8ygRnvet getting this error when it crashes Nov 21 04:38:54 intellij is the best java IDE ever Nov 21 04:39:03 gordon, my bad thought you were asking question, but you were referencing other dudes code :) Nov 21 04:39:11 yea I'm getting used to it Nov 21 04:39:21 I don't see what's so great about IntelliJ. Nov 21 04:39:24 My Java teacher requires us to use Netbeans Nov 21 04:39:27 I see people rave about how good it supposedly is. Nov 21 04:39:31 TacticalJoke: refactoring Nov 21 04:39:44 But is its refactoring better than Eclipse's? Nov 21 04:39:50 *yes8 Nov 21 04:39:51 okay Nov 21 04:39:53 *yes* Nov 21 04:39:53 still getting errors Nov 21 04:39:58 Can you give an example? Nov 21 04:40:01 tonu42: what errors ? Nov 21 04:40:08 From what I've seen, their refactoring support is very similar. Nov 21 04:40:26 which oncreate am I supposed to put all my code? Nov 21 04:40:32 The Activity's. Nov 21 04:40:34 not in onCreateOptionMenu? Nov 21 04:40:35 onCreate() Nov 21 04:40:41 so I need to move everything up Nov 21 04:40:47 not even sure what its saying. perhaps it doesnt like the return null? Nov 21 04:40:59 Not everything. Nov 21 04:41:25 Only the findViewById calls outside of any method. Nov 21 04:41:42 They are being called in/before the constructor right now (because they use field initializers, or whatever they're called). Nov 21 04:42:06 z4 if getItem wants a fragment, yes returning null would be a problem Nov 21 04:42:41 okay now its complaining can't find my objects Nov 21 04:42:47 why would you return null on a method that expects and wants a fragment object Nov 21 04:42:48 tonu42: Dude. Nov 21 04:43:02 tonu42: http://pastebin.com/jnQuahth Nov 21 04:43:05 It's literally a case of moving those findViewById calls to the bottom of onCreate. Nov 21 04:43:07 It's that simple. Nov 21 04:43:14 it said it expected a return Nov 21 04:43:32 I did that Nov 21 04:43:33 missing return statement Nov 21 04:43:46 getItem is called knowing that position of the fragment wont be null Nov 21 04:43:51 tonu42: show layout activity_main Nov 21 04:44:03 getItem expects the position it knows is legit Nov 21 04:44:20 so what is a legal return? Nov 21 04:45:05 z4, your switch statement is redundant. why have it, just return the position Nov 21 04:45:12 z4rd0z: Are you returning null from ListAdapter.getView? I just saw that code. Nov 21 04:45:19 the fragment in position Nov 21 04:45:19 http://i61.tinypic.com/t0ti8m.png Nov 21 04:45:22 Wait, ignore that. Nov 21 04:45:25 I'm looking at two things at once. Nov 21 04:45:37 tonu42: xml... Nov 21 04:45:44 oh snap my bad lol Nov 21 04:45:47 haha Nov 21 04:46:14 http://pastebin.com/gGp5gpXK Nov 21 04:46:15 that reminds me of this http://stackoverflow.com/questions/5508110/why-is-this-program-erroneously-rejected-by-three-c-compilers Nov 21 04:46:19 "Con_70s". Dat class naming. Nov 21 04:46:20 TacticalJoke, http://pastebin.com/wEHR0qjg thats the .java Nov 21 04:46:32 tonu42, you need more info than that Nov 21 04:46:44 more info than what? Nov 21 04:47:00 As whatitis said, remove the switch statement. Nov 21 04:47:04 say, country - different regions have different gratuity standards Nov 21 04:47:14 z4, look at your switch statement, both 0 and 1 return the same thing, just remove the switch and return the same thing the switch is doing Nov 21 04:47:23 basically trying to get a menu to list something separate with each category Nov 21 04:47:24 say, in albania - it's rude to tip Nov 21 04:47:46 and yes returning null in that adapter is bad, as it doesnt want null as it is a known position Nov 21 04:47:57 they are returning 2 different activities, not the same thing Nov 21 04:48:02 BTW, those comments are so pointless. Nov 21 04:48:14 Comments are usually apologies: "Sorry that I couldn't write good code here." Nov 21 04:48:24 I didnt add those comments there Nov 21 04:48:47 Okay. :D Nov 21 04:49:11 its from a guy who started writing this, and Im trying to finish the mess he left me Nov 21 04:49:20 gordon_: I see why I had to initilize them before onCreate, but when I hit the button the app crashes Nov 21 04:49:22 I see. Nov 21 04:50:06 so what should I use instead of null? Nov 21 04:50:26 z4, no matter position your switch statement code is the same whether 70s or 80s, so no need for switch, the switches call exact same method Nov 21 04:50:49 the comments dont change the fact that they run the exact same method Nov 21 04:51:08 hmm Nov 21 04:51:41 so instead of null just use that newInstance stuff, but that even seems wrong, getItem is called based off known data Nov 21 04:51:56 I'd remove all those comments, personally. Nov 21 04:52:06 All they do is get in the way. Nov 21 04:52:10 Let the code speak. Nov 21 04:52:32 removing comments still doesnt make it work, regardless. Nov 21 04:52:41 Yeah, but they're hindering you. Nov 21 04:52:43 Just saying. Nov 21 04:52:46 this is becoming a pain in my ass im just trying to get this menu working lol Nov 21 04:52:51 And whatitis is telling you what to do. Nov 21 04:53:32 This is the epitome of a bad comment: "// there are 5 titles" :D Nov 21 04:53:42 What happens when there are six? Gotta perform shotgun surgery. Nov 21 04:53:58 okay so once I have it returning all the new pages I need, how do I end it? Nov 21 04:55:01 it is ended by return, that whole getItem method needs one line of code just returning the fragment in the position given from the signature of getItem Nov 21 04:56:52 think you think that getItem method fills the adapter, you need to .add to adapter and getItem is called when scrolling or swiping Nov 21 04:58:20 http://pastebin.com/3dMQbSCp wouldnt work then Nov 21 04:58:38 correct Nov 21 04:58:53 getItem is called off data the adapter already has Nov 21 05:01:29 any adapter is just a way to visualize data. you set your data for your adapter. notify data changed, and when whatever view needs to display data it calls getItem to retrieve known data to create a visual representation of data given size of viewable screen Nov 21 05:01:48 and position Nov 21 05:01:55 so I need to set the adapter each time then? Nov 21 05:03:17 sweeeeeet Nov 21 05:03:24 I made my app work just by messing with it Nov 21 05:03:35 just create adapter, attach it to a view, add data, notify data changes, and adapter takes care of the tracking of what is in view, and creates/reuses views for display Nov 21 05:05:30 hi, what is the correct way to close a db here: http://www.nomorepasting.com/getpaste.php?pasteid=39833 Nov 21 05:05:43 db.close() or c.close() Nov 21 05:05:48 whatitis, sent you a PM Nov 21 05:07:29 z4, you need to add your fragments to your adapter, and getItem should only return the fragment in position that getItem wants Nov 21 05:08:24 yeah I have no idea.. leaning more on the side of just giving up lol Nov 21 05:09:02 dont give up, just look up adapters and fragmentpager or whatever it is called Nov 21 05:09:14 viewpager or whatnot Nov 21 05:10:36 adapters are just mechanisms to visualize list of things. the things they assists in showing should be created and added to adapter Nov 21 05:11:07 adapter shouldnt be creating things, just showing Nov 21 05:11:08 so each of the items Im trying to list should be in their own xml file Nov 21 05:11:52 dunno. they should just be created outside adapter, then added to be viewed in a list Nov 21 05:13:14 you can create an instance list in adapter of fragments that you create fragment then call adapter.add () and add adds fragment to adapter list and notify change so adapter can refrssh Nov 21 05:13:25 just read bout adapters Nov 21 05:14:23 they arent there to create, they are there to manager already created objects to be displayed in a known fashion Nov 21 05:20:42 * z4rd0z kicks android Nov 21 05:22:20 Is there any way that I can get user wishlist data? Nov 21 05:22:49 I get that adapters bridge data to the UI. but nothign is really showing me how to use separate adapters for more than one list Nov 21 05:24:07 so there's some news about google allowing chinese developers to offer paid apps Nov 21 05:24:17 but that is like 1% of all income.. Nov 21 05:26:24 what's the use of ComponentName class? Just trying to understand. Nov 21 05:27:53 z4rd0z look at crac=mergeadapter Nov 21 05:28:00 *cwac Nov 21 05:28:33 cool beans http://spectrum.ieee.org/telecom/internet/lifi-gets-ready-to-compete-with-wifi Nov 21 05:28:58 z4, you dont need a seperate adapter per list if list are similar in content. if the adapter is set for fragments that list is similiar. the subcontent of that fragment is contained in an adapter in that fragment for whatever it is to display in that fragment Nov 21 05:30:19 Here is what it is doing: http://imgur.com/DYhUU38 if I tap the next tab, same thing: http://imgur.com/e3ylX1F or change the category, same thing: http://imgur.com/JawboZJ If this helps better explain Nov 21 05:31:57 it seems if you are swiping fragments based on era, you load that fragment and with given arguments in that fragment list data relevant to it. so you can have a single fragment loaded over and over, but pass data in intent or arguments to specialize the data that fragment shows Nov 21 05:33:06 I dont want it to load over and over, each era should have a completely separate list Nov 21 05:33:48 Definitely reuse code, just move your switch statement to creating your fragment with arguments. so when at parent swiping to another fragment shows that fragment with the correct args Nov 21 05:33:58 may have something to do with this http://pastebin.com/iwBUxtC9 Nov 21 05:34:30 PagerTabStripFragment is the class the lists are specified on Nov 21 05:34:32 but each fragment is similiar, only difference is era. so keep single fragment code, but add args Nov 21 05:36:20 I don't know how to do that :/ Nov 21 05:36:52 I cant go any further without you getting the concept of keeping and reusing a single class that only difference is a single value change. keep one fragment that gets passed a value that shows your era. and the pager just changes fragments preloaded with their era Nov 21 05:37:04 you gotta read Nov 21 05:37:57 apparently I need to go back to android 101 as I am not understanding any of this. all it is doing is just frustrating me. Nov 21 05:38:15 you gotta understand polymorphism, to keep code to a minimum. reuse a class add constructors to change data based on a value but keeps same flow Nov 21 05:38:32 so get rid of the switch or keep it? Nov 21 05:43:36 half these tutorials are some guy from india and I cant even understand him Nov 21 05:46:36 are those tutorials vocal? seems english is pretty prevalent in india, do the type the same as speaking with accent? think you just dont understand the concepts universally Nov 21 05:47:37 z4rd0z 2 points Nov 21 05:47:50 no its just a really thick accent but I found a couple I can understand Nov 21 05:48:01 1) If you're using google.com: Search Tools > change "Any time" to something else Nov 21 05:48:12 2) Stop trying to use video tutorials Nov 21 05:48:14 That is all Nov 21 05:48:36 thanks for the insight... Nov 21 05:48:47 N.P. Nov 21 05:48:54 so yeah this has me totally confused Nov 21 05:49:35 just use Javascript and Crosswalk/Cordova Nov 21 05:49:56 I'm this close to just deleting everything and calling it quits Nov 21 05:50:08 do it ! Nov 21 05:50:33 try windows phone. better docs, & tools Nov 21 05:51:12 ? Nov 21 05:51:19 or ios Nov 21 05:51:57 no thanks Nov 21 05:52:44 just trying to get a menu to work.. its going to be the death of me Nov 21 05:52:53 just use Javascript and Crosswalk/Cordova Nov 21 05:52:57 I was quite serious Nov 21 05:53:00 look into it.. Nov 21 05:53:25 or I just get this damn menu working, and I can finish the rest of the app. Nov 21 05:55:32 but no, apparently thats too much to ask for lol Nov 21 05:55:57 z4, you dont get alot of it. not a problem unless you have a deadline. otherwise, just logcat everything to understand the flow Nov 21 05:56:49 I dont have a deadline, but Ive been trying to figure this out for weeks now. its just bothering me Nov 21 05:57:48 if no one is pressuring you, just know your goal, then test test test to figure out and understand how mobile android works Nov 21 05:58:38 take your issue then add config change. head explodes! Nov 21 06:00:00 just be a person with a goal, and know how to figure things out without giving up if known outcome is feasible. problems happen! understand and figure it out Nov 21 06:00:37 and pretty much, everything is feasible Nov 21 06:06:15 well its not part of the switch in the main activity.. I modified that and it went all to hell Nov 21 06:07:52 whats your background? Nov 21 06:08:32 this is the part where you tell me to go back to learning basic coding haha Nov 21 06:09:00 nope, you just have some preconceived ideas Nov 21 06:09:54 I have some java/C++ and assembly experience but nothing to this degree Nov 21 06:11:18 then you just need to read up on android. its a bit different. this is mobile, there are quite a few restrictions and standards. plus android standards Nov 21 06:11:53 im just trying to make 1 simple stupid app for myself. didnt think Id have to learn so much to accomplish this Nov 21 06:13:00 your getItem method. read up on it. read up on adapters. and fragments. and fragment managers. and making a single class being poly with args. etc etc Nov 21 06:13:39 if you are a coder, its more of understanding and morphing to adapt Nov 21 06:13:51 <-- not a coder Nov 21 06:14:06 id take coding classes but alas I work 12-15 hours a day.. so no time for that Nov 21 06:14:09 you said java/c++ Nov 21 06:15:08 I also said SOME as in, I've messed with it a bit in the past. I can code HTML/CSS/PHP with databases all day long no problem. but this is a different beast Nov 21 06:15:18 ive never taken any classes. im just a problem solver interested in programming. you either get it or dont Nov 21 06:15:59 and I asked background, figuring you for web, you failed to say that Nov 21 06:17:08 My stronger suit is web dev and graphic design Nov 21 06:17:13 w web background may check out cordova or similar Nov 21 06:17:26 I have a degree in graphic design, programming no so much lol Nov 21 06:18:41 this channel is as much for step by step, as much as for ive tried a b c and I didnt get d with my trying of X and error of Y Nov 21 06:18:56 channel isnt Nov 21 06:19:20 I find it more like step a, then figure out XYZ before even attempting step b Nov 21 06:20:07 its more step a, wanted b, but tried xyz. help Nov 21 06:20:20 im never going to get this done Nov 21 06:20:26 you need to read Nov 21 06:20:39 you will. just not tonight Nov 21 06:20:47 ive been reading this whole time Nov 21 06:21:10 every site explains themself as if I was already some professional developer just looking for a refresher. Nov 21 06:21:13 dont expect results immediate. internet has ruined tnat Nov 21 06:21:33 is 3 weeks still considered immediate? Nov 21 06:21:39 Read and understand is what you need Nov 21 06:21:48 yeah well I dont understand it lol Nov 21 06:21:51 3weeks is nothing Nov 21 06:22:11 3 weeks just trying to get a stupid menu to work is a lot Nov 21 06:22:16 it takes time Nov 21 06:22:22 I cant even add the rest of what the app needs until I get this working Nov 21 06:23:02 then if no pressure to finish it. time isnt an object. understanding trumps time Nov 21 06:23:56 after I finish this app, I will probably never make anything else for android, or any app for that matter. So I really don't care how it works, I just need it to work lol Nov 21 06:24:30 also here, a menu doesnt involve adapters. so get more specific, and always, ive tried this wanted that but got bleh. and post codenand errors Nov 21 06:25:14 my menu does involve adapters Nov 21 06:25:22 z4, thats a pretty negative response, meaning join #bearcave, and rant Nov 21 06:26:11 with this frustrating me more and more, all it does is make me more negative about it. If I can get it working, attitude changed. problem solved. Nov 21 06:26:51 to make an android app you have to understand and respect android. so maybe dont even make your app, as no way you have put any thought into it Nov 21 06:27:21 I mean I can make a simple "hello world" app. thats kiddie stuff Nov 21 06:27:54 cmd-e ftw Nov 21 06:28:00 android is way passed hello world. id never trust to run your app Nov 21 06:28:25 never trust it? Nov 21 06:29:08 trust as in trusting your knowledge of it being a true legit app Nov 21 06:29:26 well it will be if I could just get past this stupid menu Nov 21 06:29:55 do you have a question or just here to rant ? Nov 21 06:30:01 the fact that you suggest that confirms it Nov 21 06:30:20 I did have a question but I am faced with answers that dont help lol Nov 21 06:30:43 I understand learn android, learn everything possible just to finish this simple menu. but Im not comprehending what any of the documentation states Nov 21 06:30:56 im not ranting Im just saying I dont get it Nov 21 06:31:03 z4rd0z maybe start with a book from the beginning Nov 21 06:31:18 sounds like you need a gentler systematic introduction Nov 21 06:31:26 a book for a menu Nov 21 06:31:26 dont have to know it all. just have to know and understand what your app does and how it does it Nov 21 06:31:53 z4rd0z oh, you can make the menu work, but then you'll get step a few minutes later Nov 21 06:32:00 *stuck Nov 21 06:32:08 ^ Nov 21 06:32:10 why would I get stuck? Nov 21 06:32:19 g00s: don't bother ... Nov 21 06:32:28 because you aren't approaching this in an intellectually rigorous manner Nov 21 06:32:42 and android demands ... precise thinking Nov 21 06:32:46 the rest of the app doesn't have anything crazy involved. its mainly text and a few images Nov 21 06:33:05 then orientation change Nov 21 06:34:08 I already have the orientation setup complete, that isnt hard at all Nov 21 06:34:24 :) Nov 21 06:34:49 but Im starting with adapters like you said.. trying to figure them out Nov 21 06:34:54 famous last words Nov 21 06:35:20 it is a whole new world. Nov 21 06:35:52 mobile atleast, and android ontop of it Nov 21 06:36:04 even though I believe all the change just needs to be in one simple area of the source code Nov 21 06:36:17 something with the getitem Nov 21 06:36:19 nope Nov 21 06:37:03 nope? that's what you told me Nov 21 06:37:07 learn getitem Nov 21 06:37:15 good getItem is one line, maybe not even overrrided, but one line return given position from data Nov 21 06:37:54 Hmm. With my Reddit client, when the user scrolls down the list, new posts/whatevers download. Should I keep the old stuff in memory or just release it (and re-download it if they scroll back up)? Nov 21 06:37:56 each list is in its own class. I just have to learn how to display those classes Nov 21 06:38:08 getitem is a basic method to return data from position Nov 21 06:38:16 TacticalJoke use an lru cache Nov 21 06:38:43 Thanks; I'll check that out. Nov 21 06:38:46 tactical, keep stuff buffered as needed Nov 21 06:40:15 should I array the data list? Nov 21 06:40:39 like ive said before, if 5000 items in data&only 10 shown at a time, dont waste processing on all 5000 just what is visible and maybe a buffer of 10+- either upper loer Nov 21 06:41:02 Yeah, it seems wasteful to keep everything in memory. Nov 21 06:41:20 The Reddit client I currently use seems to do this. Things get bad when I scroll down lots of times. Nov 21 06:42:03 create a buffer to keep latency down, and lazy load images and such on flinging Nov 21 06:42:19 hm, lru cache might not be right. perhaps some circular buffer Nov 21 06:42:34 Yeah, I'll be lazily loading the images. :) Nov 21 06:42:47 Okay. I'll research this a lot. Nov 21 06:43:06 Can an IME detect what type the ime requester is requesting for? Nov 21 06:45:32 whatitis, you would be proud of me right now Nov 21 06:46:42 that would be funny if they put the masonic square under the compas (for the new AS icon) Nov 21 06:46:53 upon reading up on getItem and switches I figured out the menu system - partially Nov 21 06:47:17 * g00s is skeptical Nov 21 06:47:35 I had to return each fragment using .newInstance(#); and then default a return null Nov 21 06:47:59 I guess reading a bit did pay off =X Nov 21 06:49:31 so annoying you can't initialize an enum with a static final member of that enum Nov 21 06:50:13 getItem should never return null. getItem is wanting a known item Nov 21 06:50:16 TacticalJoke: what are you using to retrieve images? Nov 21 06:50:37 UniversalImageLoader (sp?) will handle retrieving, disk and memory caching for you and you can add it with one line in gradle builds Nov 21 06:50:54 http://pastebin.com/eHKwZH53 seems to work Nov 21 06:51:00 lasserix, I would recommend picasso though Nov 21 06:51:35 lasserix: Oh, I haven't got that far yet. :) Nov 21 06:51:36 the thing about picasso if i remember correctly is it "is" a pain to handle "exceptions" Nov 21 06:51:39 But will soon. Nov 21 06:51:53 So far, my client doesn't even let you view Reddit links. Lol. You can only see comments so far. Nov 21 06:51:56 Though I started one week ago. Nov 21 06:52:05 Comment structuring is kinda complex. Nov 21 06:52:27 I'll keep UniversalImageLoader and Picasso in mind, though. Thanks. Nov 21 06:52:40 definatly use one or the other Nov 21 06:53:29 Hmm. I was considering just using OkHttp for that. But I guess these libraries help out. Nov 21 06:53:37 yeah Nov 21 06:53:37 To be honest, I haven't thought about it much yet. Nov 21 06:53:38 now to figure out how to get a separate adapter to load for each category Nov 21 06:53:41 dont stop at okhttp Nov 21 06:53:45 K. Nov 21 06:53:55 I also wasn't sure whether to use OkHttp's caching in general or an application-level cache. Nov 21 06:54:06 an LRU cache is really easy to implement, but those libraries have it all done for you Nov 21 06:54:17 z4rd0z: seperate adapter? Nov 21 06:54:18 Ya. Nov 21 06:55:07 I have 3 categories. each one has separate tabs, those separate tabs have their own list items. I have the 1st category working. but I have to differentiate between the categories now Nov 21 06:56:06 can't you just swap out data set of the tabs? Nov 21 06:56:46 lasserix: what are "exceptions" Nov 21 06:56:59 like a tab can have a catagory enum the catagory enums can have a presenter, then just throw the view in getWhatever to the presenter and return the result Nov 21 06:57:21 I think the way I have it setup it doesn't let me simply swap it out Nov 21 06:57:57 JakeWharton: i don't remember well enough, but i remember on SO posting showing the callbacks to handle the cases whenever the image fails to load (i think) and i remember picasso not having some callbacks that the others did (eg, onCancel or whatever) Nov 21 06:58:11 http://pastebin.com/iNGgwjnd thats how my categories are defined Nov 21 06:58:14 but i really don't remember in particular, so Nov 21 06:58:41 As you can imagine, people think they need something when really they don't and there's other ways of doing it. Nov 21 06:58:44 tho lookaing at the repo for picasso definatly looks like it has a lot to work with Nov 21 06:58:53 heh figured you would say that Nov 21 06:59:04 Ooh, Square makes Picasso too. :) Nov 21 06:59:10 Some are right Nov 21 06:59:30 But some are wrong and set in their opinions despite the fact we can do the same thing a different way Nov 21 06:59:47 Yeah callbacks seem convient but can actually be a huge pain Nov 21 07:00:05 z4rd0z: umm? Nov 21 07:00:44 Is using OkHttp and Picasso together common? Nov 21 07:00:46 Just curious. Nov 21 07:00:50 JakeWharton: did you ever finish (or maybe you already had) the coding style guidelines project? Nov 21 07:01:09 TacticalJoke: i believe you don'tneed to use both since the latter handles what you'd do with the former (at least for images) Nov 21 07:01:32 I see. Nov 21 07:01:55 I'm glad OkHttp exists. The Android stuff doesn't look good. Nov 21 07:02:06 umm what? Nov 21 07:02:18 The recommended one doesn't support cancelling requests/responses. The non-recommended one does but isn't being maintained anymore. Nov 21 07:02:33 The Android stuff is just based on outdated java APIs Nov 21 07:02:36 TacticalJoke: believe android actually uses okhttp under the hood Nov 21 07:02:39 Yeah. Nov 21 07:02:44 lasserix: Since 4.4, I think. Nov 21 07:02:56 z4rd0z: so you categories are defined in that way and? Nov 21 07:02:58 But it uses a not-so-nice interface that, as far as I know, doesn't support cancelling downloads. Nov 21 07:03:06 And you would need both, okhttp is the networking client that can be plugged into Picasso Nov 21 07:03:17 Cool. Nov 21 07:03:22 Which it is by default Nov 21 07:03:24 Im just trying to figure out how to separate the categories. right now each category lists the same thing Nov 21 07:04:06 hashmap? Nov 21 07:04:32 lasserix: no, it's on my backlog. Nov 21 07:04:37 I'm liking Gson, too. :) Nov 21 07:04:45 Nice libraries make programming way more fun. Nov 21 07:04:56 TacticalJoke: squares wrote most of that too Nov 21 07:05:01 Nice! Nov 21 07:05:03 I did wonder. lol Nov 21 07:05:50 For some reason, I got the impression that Jesse Wilson had contributed a lot. Probably from googling. Nov 21 07:06:01 Just curios JakeWharton, any apps (that you did not develop directly) that you find particularly impressive? Nov 21 07:06:14 lasserix: SeriesGuide Nov 21 07:06:19 I tried Jackson and it seems nice and powerful, but it also seems rather heavy-weight. Nov 21 07:06:39 TacticalJoke: it is. Very useful, but it's a giant implementation Nov 21 07:06:45 why is TintImageView not in the reference, also its inside package "internal" of the support library Nov 21 07:06:54 TacticalJoke: Jesse works with me at sqaure Nov 21 07:07:03 I also like how, with Gson tree-model stuff, I don't have to retain the "creator" or whatever. Nov 21 07:07:05 Cool. :) Nov 21 07:07:10 razzledazzle: it's an implementation detail Nov 21 07:07:20 Like, with Jackson, you should keep the generator/creator/mapper global. Nov 21 07:07:26 Not a huge deal, but makes code a little more entangled. Nov 21 07:07:57 JakeWharton, it means that its under development (not ready for public)? Nov 21 07:08:53 TacticalJoke: you should do that with Gson Nov 21 07:08:54 I guess the only thing I'd love to see in Gson is something like Jackson's "path" method. Helps avoid null-pointer issues. But it's not a huge deal. Gson is so nice and lightweight. Glad I switched to it. Nov 21 07:09:29 JakeWharton: I'm using only JsonParser. Nov 21 07:09:34 Does that still apply? Nov 21 07:09:38 Like, I'm not doing object mapping. Nov 21 07:09:48 razzledazzle: no, it means you use the LayoutInflater support which uses those classes Nov 21 07:09:53 TacticalJoke: then no Nov 21 07:10:10 Basically, to avoid reflection, I'm tolerating a little more code complexity. Nov 21 07:10:15 I might one day switch to object mapping, but I'll see. Nov 21 07:10:43 It's a micro-optimization, but it's not a huge amount of added complexity. Nov 21 07:11:10 I was initially gonna stream it all, but that looks like hell after a certain point (e.g,. Reddit comments with replies). Nov 21 07:11:29 Then you're basically creating a JSON parser manually. Nov 21 07:14:29 Here's an example of the kind of parsing you have to do with Reddit: http://pastebin.com/Sx3Eih2T Nov 21 07:14:39 It's pretty simple so far, but if it gets too much then I'll switch to object mapping. Nov 21 07:16:26 Also, that probably needs to be refactored at some point (e.g., extracting a Listing superclass). Don't know enough yet. Nov 21 07:18:21 JakeWharton, but LayoutInflaters aren't supposed to depend upon Views right? Why should the LayoutInflater care about the TintImageView at all? Nov 21 07:18:49 razzledazzle: because it's a view factory Nov 21 07:19:09 It replaces references to ImageView with TintImageView transparently Nov 21 07:20:28 thank you for explaining that, I might have to check the source to be clear about it completely Nov 21 07:34:40 Google's material design icons are pretty neat: http://google.github.io/material-design-icons/ Nov 21 07:36:28 I might use "Insert Comment" for the Reddit-comments thing. Nov 21 07:36:39 Though it has different semantics. Hmm. Nov 21 07:37:50 shizzle i need a new mouse Nov 21 07:38:01 i just threw it across the room, didn't end well Nov 21 07:38:37 My cat used to bring me mice. Nov 21 07:38:45 the apple ones all suck Nov 21 07:38:58 query builder hmm Nov 21 07:39:28 Hmm, are those icons gonna be the right size for an action bar? Nov 21 07:39:32 I know action bars are so 90s now. Nov 21 07:39:42 But I'm clueless about the whole graphic-size thing. Nov 21 07:40:47 They have web and iOS icons in there. Nov 21 07:40:59 I feel like the web doesn't have to be "material". Nov 21 07:44:16 * g00s does what any sane bird would do, head over to amazon and search for mice Nov 21 07:44:33 They don't have 32x32dp icons in there. :/ Nov 21 07:44:59 Is there a difference in image size between ActionBar icons and Toolbar icons? Nov 21 07:50:30 I am wondering what is the correct implementation of sub activities. I have a main activity that performs basic initializion on its onCreate() method (e.g. starting services). When I start a sub-activity and navigate back to my main activity, by default, the main activity is beeing re-created from scratch: onDestroy() + onCreate(). This is the first part I am wondering? Why does android Nov 21 07:50:31 perform theses steps? To avaoid this I have set the SingleTop attribute in my manifest. But now I have the problem that my main activity UI isn't redraws automatically when returning from a sub-activity? What am I doing wrong. Or what is the best practice to handle sub activities?! Nov 21 07:51:19 To activiate back navigation I have set the parentActivityName attribute in my manifest for all sub activies Nov 21 07:53:05 I think Android can (and sometimes will) destroy activities that have gone into the background, to reclaim memory, for example. Nov 21 07:53:28 I don't see how setting singleTop changes anything in your case (unless you're saying startActivity() or something). Nov 21 07:53:49 (Going back to the main activity with startActivity, I mean.) Nov 21 07:54:22 Your activity should be able to handle being destroyed and recreated. What is the issue with this? Nov 21 07:58:52 Ok so where should I initialize my services then? Nov 21 07:59:49 marteng: that should be handled by return value of onStartCommand Nov 21 07:59:50 According to the activity lifecycle, onDestory should only be called when there is insufficiet resources or the app is completly exited by the user Nov 21 08:00:43 And why is my UI not redrawn automatically when returning from a sub activity Nov 21 08:01:09 * g00s hates activity stacks Nov 21 08:01:25 some dumbass had an idea, to make android UI screens like web pages Nov 21 08:01:36 marteng: if you are in Activity A and you goto Activity B and activity A onDestroy is called, then you called finish or something Nov 21 08:01:49 because normally just onPause onStop would be called, until the os reclaims memory and kills it it Nov 21 08:01:56 (or the user presses backspace out of it) Nov 21 08:02:05 marteng: By default, Activity.onDestroy happens every time the user changes screen orientation. Nov 21 08:02:11 It's not rare at all. Nov 21 08:04:11 Ok. So I do need to keep into account in OnCreate if I already have started services? Nov 21 08:04:19 lasserix: If we go from A to B, couldn't A easily be killed by Android? Nov 21 08:04:24 TacticalJoke, unless it's locked Nov 21 08:04:36 it wouldn't Nov 21 08:04:40 I thought that was a textbook example of the whole "Activity in the background gets destroyed" thing. Nov 21 08:04:43 it just goes to the background Nov 21 08:04:53 that doesn't make any sense Nov 21 08:04:58 if you press home Nov 21 08:05:03 why should it kill it? Nov 21 08:05:09 To reclaim memory. Nov 21 08:05:16 only if it needs to Nov 21 08:05:17 I also do not understand this? Nov 21 08:05:22 it doens't constantly need to Nov 21 08:05:30 try it out Nov 21 08:05:37 marteng: You can just check "savedBundleState == null". Nov 21 08:05:38 I don't think that my phone is goiing out of memory Nov 21 08:05:40 savedInstanceState* Nov 21 08:05:42 see how many apps you have to open before memory is reclaimed Nov 21 08:05:47 lasserix: Not every time. Nov 21 08:05:51 I mean that sometimes it will. Nov 21 08:05:53 it takes like 3 RAM intsneive games Nov 21 08:05:59 that's not typical Nov 21 08:06:07 On my old phone, I can make it happen pretty quickly. Nov 21 08:06:12 and definatly not what is hapenning when going from a->b in your own app Nov 21 08:06:21 again that's an edge case, not the norm. Nov 21 08:06:23 With 512MB RAM (I think). Nov 21 08:06:28 old bloated phone Nov 21 08:06:35 I know. I'm talking about what *can* happen. Nov 21 08:06:37 hmm I am running a Nexus 5 Nov 21 08:06:58 marteng: You need to learn about the whole activity-being-destroyed thing. Nov 21 08:07:09 I want to :-( Nov 21 08:07:12 One sec. Nov 21 08:07:15 easiest way to do it is just override on the life cycle call backs Nov 21 08:07:17 Finding something worth reading. :D Nov 21 08:07:20 and then do all the different things Nov 21 08:07:49 This seems good: http://developer.android.com/reference/android/app/Activity.html#onSaveInstanceState(android.os.Bundle) Nov 21 08:07:51 But I really don't understand why android is calling onDestroy every time I navigate back to my main activitiy Nov 21 08:08:20 This also: http://developer.android.com/training/basics/activity-lifecycle/recreating.html Nov 21 08:08:25 The second one looks better. Nov 21 08:08:27 when you press back Nov 21 08:08:31 it is equivalent to exiting Nov 21 08:08:34 marteng: Look at the second link. Nov 21 08:08:38 In fact onDestroy is called right after pressing back in my sub activity Nov 21 08:08:39 therefore onDestroy is called Nov 21 08:08:43 yed Nov 21 08:08:47 yes that's how it works Nov 21 08:08:54 press back = quit/exit = onDestory Nov 21 08:08:57 marklite: MainActivity.onDestroy is being called when you press back in SecondaryActivity? Nov 21 08:09:11 TacticalJoke: Yes! Nov 21 08:09:18 you using singleTop? Nov 21 08:09:31 not yet Nov 21 08:09:38 If I doe this of course dosn't happen Nov 21 08:09:48 but why is this the default behaviour? Nov 21 08:09:51 marteng: Are you doing something weird such as changing screen orientation in the second activity? Nov 21 08:10:00 that isn't the normal behavior Nov 21 08:10:00 TacticalJoke: no Nov 21 08:10:19 sure you are not confusing your log tags? ;p Nov 21 08:10:24 It shouldn't happen often, though it can happen. Nov 21 08:10:28 So it has to be prepared for. Nov 21 08:10:40 The fact that it's happening every time (?) is weird, though. Nov 21 08:10:48 lasserix: Yes :) Nov 21 08:10:58 well what's weird is if you are going back from the subactivity to the main activity, why is onDestroy being called? Nov 21 08:11:12 lasserix: exactly Nov 21 08:11:20 lasserix: An example of that happening is when you change screen orientation while the sub-activity is showing. Nov 21 08:11:46 he says no orientation change Nov 21 08:11:54 And the second thing I don't understand is that when I set the singleTop attribute, that my main activity UI isn't available anymore when returning from sub activity Nov 21 08:12:13 I don't see why singleTop would change anything. Nov 21 08:12:18 It sounds like you're doing something weird. Nov 21 08:12:31 Are you calling startActivity to get back to the main activity? Nov 21 08:13:09 I just set the ParentActivity attribute in my manifest for the sub activities Nov 21 08:13:21 Why did you set singleTop? Nov 21 08:13:33 To avoid onDestroy beeing called all the time Nov 21 08:13:35 :) Nov 21 08:13:41 lol Nov 21 08:13:45 I don't get why singleTop would help... Nov 21 08:13:47 Maybe I'm missing something. Nov 21 08:14:05 What made you think singleTop would help? That might be vital info here. Nov 21 08:17:03 singleTop causes that onDestoy is not beeing called when returning from sub activities Nov 21 08:17:36 TacticalJoke, "If set, the activity will not be launched if it is already running at the top of the history stack.", you mean by preventing re-creation? Nov 21 08:17:50 sorry, didn't mean to mention TacticalJoke there Nov 21 08:18:08 marteng: Maybe you should post some code or something. Nov 21 08:18:25 marteng: I don't understand why you're having this issue (or why singleTop is changing anything). Nov 21 08:18:27 marteng, in the reference "If set, the activity will not be launched if it is already running at the top of the history stack." Nov 21 08:18:46 android:name=".ActivityMarwisApp" Nov 21 08:18:46 android:configChanges="orientation|keyboardHidden|screenSize" Nov 21 08:18:46 android:label="@string/app_name" Nov 21 08:18:46 android:launchMode="singleTop" > Nov 21 08:18:46 Nov 21 08:18:46 Nov 21 08:18:47 Nov 21 08:18:47 Nov 21 08:18:48 Nov 21 08:18:48 android:name=".ActivityPreferences" Nov 21 08:18:51 not in here... Nov 21 08:18:52 it doesn't mention that it prevents onDestroy Nov 21 08:18:52 Whoa. Nov 21 08:18:53 dude Nov 21 08:19:11 don't EVER paste stuff directly in channel Nov 21 08:19:16 marteng: And maybe post some relevant Java code to pastebin. Nov 21 08:19:19 sorry :) Nov 21 08:19:40 see, you made him quit! Nov 21 08:19:44 We just went from interactive Notepad to interactive Eclipse/Android Studio. Nov 21 08:20:46 my Manifest: http://pastebin.com/AVye97WX Nov 21 08:20:56 Can we see some of your Activity code? Nov 21 08:20:58 Both activities? Nov 21 08:21:34 ahhhh, after hours of strugling with gimp, I made this "feature graphic" for an app I developed (targeting android wear only): http://i.imgur.com/v7dTGnj.png Nov 21 08:21:42 I feel relieved :) Nov 21 08:21:49 main activity http://pastebin.com/sh8a5Ffw Nov 21 08:22:12 hours? huh :p Nov 21 08:22:30 prefrences activity http://pastebin.com/RgDpRXTD Nov 21 08:22:32 yeah :/ a lot Nov 21 08:22:33 Dat font though. Nov 21 08:23:04 i tried with roboto TacticalJoke, but it's too serious Nov 21 08:23:11 the "98%" mode must be the most rad out there Nov 21 08:23:16 So, I don't know anything about services, but I'm pretty sure that you shouldn't be starting them *every* time onCreate is called. Nov 21 08:23:21 adq: I was kidding. It's nice. :) Nov 21 08:23:25 :) Nov 21 08:23:29 I actually like it. Nov 21 08:24:33 marteng: Can I see one of the sub-activities where this issue is occurring? Nov 21 08:24:48 TacticalJoke, it actually doesn't matter, it will just make sure the service is running, it won't start a new one every time. I should know, I have a similar situation in one of my apps :p Nov 21 08:24:59 adq: That image is hypnotic Nov 21 08:24:59 . Nov 21 08:25:00 adq, do they work like Live Wallpapers or something? Tt would be very very neat! Nov 21 08:25:10 ravilov: Ah, okay. Nov 21 08:25:29 it would kill the battery too fast as wallpaper (called watchface on Android Wear) Nov 21 08:25:37 so instead you launch the app when you need it Nov 21 08:26:17 because all wear gadgets are world-famous for awesomely stunning battery life, right :p Nov 21 08:26:29 oh true, I've never tried one so I don't know Nov 21 08:26:31 i've got room to improve battery :) Nov 21 08:26:42 i'm planning to move some stuff in renderscript Nov 21 08:26:50 and reduce de FPS too Nov 21 08:26:52 the Nov 21 08:27:06 ze FPS Nov 21 08:27:10 but the screen on is the main culprit I guess Nov 21 08:27:41 between the screen on and the math-intensive animations, it's a tight match Nov 21 08:27:51 it's not so intensive in fact :) Nov 21 08:28:28 but yeah reducing the cpu usage will definitely help (this is why I'm thinking of moving to RS which is supported) Nov 21 08:34:42 I have posed my preference activity Nov 21 08:34:47 http://pastebin.com/RgDpRXTD Nov 21 08:36:04 Umm, is this right? "getFragmentManager().beginTransaction().replace(android.R.id.content, new Prefs1Fragment()).commit();" Nov 21 08:36:18 I thought you cound't replace a fragment declared in a layout file? Nov 21 08:36:44 Wait, maybe this is a different case. You're doing the preferences thing. Nov 21 08:39:06 The problem not only occures with my prefernce activity Nov 21 08:39:20 I have a second activity that shows the same behaviour Nov 21 08:40:45 TacticalJoke: You said onCreate is the wrong location to start services. So where should I then do this. And how to I differe the case when onCreate is called for "joke" and really the first time the app is beeing created Nov 21 08:41:13 savedInstanceState == null Nov 21 08:41:22 I don't know anything about services. Maybe someone else can answer that. Nov 21 08:41:53 Hmm these are really android basics? Nov 21 08:42:07 I am really wondering why I am the only one having this problems Nov 21 08:42:15 "savedInstanceState - If the activity is being re-initialized after previously being shut down then this Bundle contains the data it most recently supplied in onSaveInstanceState(Bundle). Note: Otherwise it is null." Nov 21 08:43:02 accoding to the activity life cycle onCreate is the correct place to arrange this (in my opinion) Nov 21 08:45:21 hi Nov 21 08:45:47 I would like to change the color of a Switch button, not the background as seen in various tutorial but the switch Nov 21 08:45:59 there doesn't seem to have any attribute to that Nov 21 08:46:13 marteng: I don't know about services, but personally I keep anything not completely tied with my activity away from my activity. Nov 21 08:46:25 Because activities get destroyed and recreated quite often. Nov 21 08:46:40 marteng what are you managing in the service ? Nov 21 08:50:28 g00s: Maybe I could use a SparseArray for this Reddit thing. Nov 21 08:50:33 Then I can just delete the old items or whatever. Nov 21 08:50:41 Re-write them if the user goes back up. Nov 21 08:51:40 In fact, maybe it's simpler than that. Just "list.set(n, null);". Hmm. Nov 21 08:53:22 g00s: I have one servcice that manages a bluetooth conection Nov 21 08:53:39 it should be available the whole time the app is running, even in background Nov 21 08:54:09 marteng when you start a bt operation, start the service. when it disconnects, stop it Nov 21 08:54:48 i have something similar, but the service is managing a number of bt connections Nov 21 08:54:50 It's a little more complicated Nov 21 08:56:35 OK so maybe a last question: Why is my UI gone when returning from sub activity (with singleTop set und onDestory not beeing called)? Nov 21 08:58:18 not sure if its against your requirement, but why not have multiple fragments swapping around instead of activities? Nov 21 09:02:56 hello. Today I upgraded Android Build Tools from 20.0.2 to the last one (21.1.1). I changed in the build gradle the buoldToolsVersion to '21.1.1'. When I sync gradle project, I get this error: Task failed with an exception. Execution failed for task ':afilechooser:preBuild'. failed to find Build Tools revision 20.0.0 . afilechooser is a module I use. Why does it ask still for 20.0.0 ? Nov 21 09:13:30 anyone have experience building for HTC specifically HTC evo 4g LTE? Nov 21 09:15:36 wrong channel Nov 21 09:15:49 device-specific stuff should go to -root Nov 21 09:16:11 ravilov thanks I'm in there as well Nov 21 09:16:17 -root is not for building source Nov 21 09:16:26 this is more for .apk deving right? Nov 21 09:16:49 well which one is it guys? Nov 21 09:17:33 there is no channel with any significant chat or expertise regarding building the Android platform Nov 21 09:17:59 -root seems most suitable though, even though it's still not perfect Nov 21 09:18:08 so what channel would be best for my type of question? Nov 21 09:18:17 there is no appropriate channel Nov 21 09:18:23 :( Nov 21 09:18:23 ax562, the jury is still out on that Nov 21 09:18:35 there just isn't enough chat or expertise on IRC to maintain a channel or conversation Nov 21 09:18:40 that's my problem Nov 21 09:18:51 the appropriate place is the google groups/mailing lists Nov 21 09:18:56 XDA is probably your best bet Nov 21 09:19:00 lol Nov 21 09:19:27 is there any cool website or program (java or OS X) that lets you compare two json strings? showing you how the objects are different (attributes or values..) Nov 21 09:19:29 https://groups.google.com/forum/#!forum/android-building Nov 21 09:19:32 I've had more luck in irc because it's live Nov 21 09:19:49 there are a few, but i didn't find the real deal yet D Nov 21 09:19:49 maybe so but looks like you're out of luck on this one Nov 21 09:19:51 :D Nov 21 09:20:12 fancy42, never too late to make your own Nov 21 09:20:36 ravilov, yes, that's what i'm currently thinking about :D Nov 21 09:20:46 (I don't see comparing entire JSON strings as something that is highly sought after though) Nov 21 09:21:57 @Leeds thank you for that link. Any/all resources help! Nov 21 09:22:14 btw. this is the one i found best yet: http://tlrobinson.net/projects/javascript-fun/jsondiff/ Nov 21 09:23:32 I feel if you have a need to compare whole entire JSON strings, you're doing something wrong Nov 21 09:23:36 conceptually it'd be like comparing two whole entire databases (sqlite or any other) Nov 21 09:23:48 it's just not what you do Nov 21 09:23:52 Good Morning folks! Nov 21 09:26:18 ravilov, yes this is not a day to day use case Nov 21 09:27:25 i'm accessing a rest service and i have one json object that works (got it as an example) and one that doesn't (created by my own code). and i'm very curious how they're different. Nov 21 09:27:56 this is so bizarre, i dont know what happened - but i did a fresh install of AS 1.0-rc, and maybe pointed it to dl the SDK in the wrong spot, but around that tim e a bunch of dot files in my ~ got clobbered Nov 21 09:28:17 fancy42, sounds like a one-time use, wouldn't it be easier to just compare them by hand? Nov 21 09:28:25 missing .bash_profile, .gitconfig, but not others, so weird Nov 21 09:28:42 g00s, o.O Nov 21 09:29:32 ravilov, yes. but it is the third time i'm having this one time use now :D admittedly it's not the most urgent thing, but i just feel i'm doing something manually where there must be something out there helping me doing it automated Nov 21 09:29:42 g00s, seems more like a bizarre coincidence Nov 21 09:30:14 after I installed AS, and it got fucked up - btw it fucks up with the startup wizard Nov 21 09:30:24 a bunch of pograms lost their defaults Nov 21 09:30:30 fancy42, if you're comparing JSONs, doing it in javascript sounds like the most obvious choice Nov 21 09:30:48 and that shouldn't be too hard to implement from scratch Nov 21 09:30:48 just those that had stuff in home directory dot files Nov 21 09:31:17 yeah.. maybe i have time over the weekend or something Nov 21 09:31:19 g00s, did you hear about my efforts to upgrade my AS and how it all failed utterly miserably? Nov 21 09:31:32 no Nov 21 09:32:41 ugh, AS is such a piece of crud. have 0.8.9, wants to update to 0.8.14. first it complains how the SDK can no longer be in the AS folder and I need to move it elsewhere. ok, fine, whatever. then it fails because it can't delete a file? I try and I can delete it just fine. rerun the upgrade, now it fails because it can't *find* that same file?? I just gave up on it after that. (the file w Nov 21 09:32:47 as svn4idea.jar or some such.) Nov 21 09:32:49 that was a week ago Nov 21 09:35:14 ravilov i just installed a fresh 1.0-rc and the setup wizard was bugged Nov 21 09:35:41 now, its ritual for me to do fresh AS installs. i dont use the patch thing that much Nov 21 09:35:54 and i have to say, that google does not do installation testing Nov 21 09:36:07 because often, right off the bat, things are fucked up Nov 21 09:36:27 no so much lately, but there were a bunch of times, you couldn't even import a new project, etc Nov 21 09:36:33 I'm just saying, if their upgrade process fails so miserably, I have no reason to think any other way of installing will be flawless Nov 21 09:38:57 s/flawless/any better/ Nov 21 09:39:22 also, I have no intention of doing a fresh install every time they decide to do a new release Nov 21 09:39:33 hey guys Nov 21 09:39:45 hope you are fine Nov 21 09:40:34 I have a fragment and a viewpager in it . how can i call onpause method of the nested fragments Nov 21 09:40:40 ? Nov 21 09:41:39 you don't ever call the callback methods, the system does Nov 21 09:43:50 ravilov i just do fresh installs when they say you need to Nov 21 09:43:59 and sometimes other times Nov 21 09:46:04 hey guys, anyone know how to change the divider color for TimePicker? Nov 21 09:46:18 ravilov: but it doesn't call it self . it just call onpause of the main fargment but not the fragments in viewpager Nov 21 09:47:50 g00s, yeah, not something I want to do... so yeah, no thanks Nov 21 09:48:16 mojtaba, dunno, try proxying the call from the main fragment then? Nov 21 09:53:05 Child fragments should be paused along with the parent fragment Nov 21 09:53:13 Assuming you're using the child fragmentmanager Nov 21 09:55:19 I upgraded to 5.0 last night, and suddenly I cannot see the custom font I've used in my app Nov 21 09:56:17 hi. Did you add .iml files to git in android studio projects? Nov 21 09:58:27 i found some .gitignore for android here https://gist.github.com/iainconnor/8605514 . It has line for *.iml, so i confused Nov 21 09:59:17 https://github.com/github/gitignore/blob/master/Global/JetBrains.gitignore is what i use Nov 21 10:00:36 I want to create a layout for my list adapter that has two TextViews: one on the left and one on the right. The one on the right has a fixed width and the one on the left should grow to fill the remaining space. Nov 21 10:00:46 Can I do this with a RelativeLayout or do I have to use LinearLayout? Nov 21 10:01:05 why would you prefer relativelayout? Nov 21 10:01:29 I guess I've bought into the stuff about avoiding nesting using RelativeLayouts. Nov 21 10:01:38 TacticalJoke: you can use LinearLayout Nov 21 10:02:02 Okay. Nov 21 10:02:13 in the words of StingRay, "relativelayout is by far the most complex built-in viewgroup on android, its overhead should be avoided if at all possible" Nov 21 10:02:24 (avoided by using a different layout) Nov 21 10:02:33 TacticalJoke: the left TextView, set layout_width="0dp", layout_weight="1" Nov 21 10:02:34 It's FrameLayouts all the way down Nov 21 10:03:13 TacticalJoke: set the right TextView to fixed dimensions, the left one will grow to occupy remainder space Nov 21 10:03:33 just checked, I had a similar situation (except spinner instead of listview), I used linearlayout Nov 21 10:03:44 K. Thanks. Nov 21 10:04:18 * ravilov tends to generally start off with linearlayout which tends to work in most cases Nov 21 10:05:54 I see. Nov 21 10:05:56 StingRays words suck, there's no reason to avoid any layout Nov 21 10:06:24 Just don't be stupid and use RelativeLayout to position views linearly Nov 21 10:06:27 And the other way around Nov 21 10:07:21 SimonVT, his words were based on the size of the source of relativelayout compared to other layouts, as well as looking at just how many checks relativelayout does everywhere Nov 21 10:08:13 If your view hierarchy is becoming too complex (i.e. nested, large, whatever), then it's time to avoid framework viewgroups altogether and write your own Nov 21 10:08:20 there were even mentions of performance gain when replacing relativelayout with some other layout in some (simpler) cases, but I agree that is kind of arguable Nov 21 10:08:35 It's neglible for 99% of cases Nov 21 10:08:47 For the 1% where it matters, don't use framework viewgroup at all Nov 21 10:09:31 I guess. I think the context was something like a seemingly simple relativelayout with only a few children, but inflated many times over (eg. for a listview) Nov 21 10:09:55 Has anyone got a stock version of idea.vmoptions so that I can install the AS patch? Nov 21 10:10:03 ravilov, the contrary, there were performance gain in replacing linearlayout and few sub views with relativelayout Nov 21 10:10:09 SimonVT are you the developer of android-numberpicker? Nov 21 10:10:11 For your average listview item, it hardly matters Nov 21 10:10:13 just check hierarchyviewer Nov 21 10:10:39 shipit: Sure Nov 21 10:10:52 I just stumbled across it on github :) Nov 21 10:10:54 adq: You can't say that as a general rule Nov 21 10:10:58 shipit: Don't use it Nov 21 10:11:00 ravilov, c.f. http://www.curious-creature.org/2009/02/22/android-layout-tricks-1/ Nov 21 10:11:02 ok Nov 21 10:11:03 SimonVT, I agree, listview lazily creates views on demand anyway Nov 21 10:11:19 SimonVT, of course it's not a general rule Nov 21 10:11:44 I've got the text color changed in TimePicker, I can't change the selectionDivider color Nov 21 10:11:49 for API level 14 Nov 21 10:11:52 adq, I had a case where I had a custom viewgroup that extended relativelayout, I changed it to extend framelayout instead, nothing changed visually so I just left it Nov 21 10:12:32 i think it mainly depends on the depth of the tree of views and the number of views too Nov 21 10:12:35 admittedly nothing changed performance-wise either, for better or for worse Nov 21 10:12:54 on few specific project, i ended up drawing myself inside a canvas (with dirtyrect & co) in order to avoid "too many views" Nov 21 10:13:12 (the only reason I had a custom viewgroup to begin with was to be able to intercept touch events across the entire "inner" layout) Nov 21 10:13:21 at the end, I had only 1 big views, instead of many many (more than 60 iirc) Nov 21 10:13:54 adq, that is horrible, what in the world were you doing with 60+ views in a single layout?! Nov 21 10:13:54 and the performance gain was really there, no overdraw too Nov 21 10:14:01 ravilov, many buttons :) Nov 21 10:14:23 any more and each would be only a few pixels big :p Nov 21 10:14:49 ravilov, https://lh4.ggpht.com/ReixtVF0h-bWMPRR3lKEid0rQw1gZ_pDGYdR9CFmK0_ei396GZOzdMdGXuqvkcTMtA=h900-rw Nov 21 10:14:59 I could not remove buttons and text Nov 21 10:15:17 if it would even be possible I would add more (but screen are often tiny and a finger is big on a touch screen compared to a mouse input) Nov 21 10:15:57 next step is to draw everything in opengl maybe ;) Nov 21 10:16:07 no idea what was this you just sent me, but I'm not opening random binary .webp files Nov 21 10:16:42 uh, it's a picutre Nov 21 10:16:57 picture* http://files.gandi.ws/gandi6566/image/device-2014-08-18-022640.png see this one Nov 21 10:16:59 your link disagrees Nov 21 10:17:11 ah I see Nov 21 10:17:13 it comes from playstore but anyway Nov 21 10:17:28 no wonder your layout was overcrowded :p Nov 21 10:17:34 i think your browser failed to interpret the webp Nov 21 10:17:46 use opengl to paint decals (textures) Nov 21 10:17:47 yeah clearly overcrowed Nov 21 10:17:48 I'm okay with that Nov 21 10:17:49 is the way to do it Nov 21 10:18:05 and there are other heavy views Nov 21 10:18:40 what is this "too many views" think you mentioned? is it something that the framework complains about or something? if so, would grouping the views help any? Nov 21 10:18:55 thing* Nov 21 10:18:56 yeap there is a lint check on around 61 views iirc Nov 21 10:19:06 but it's arbitrary i guess Nov 21 10:19:29 it can slutter on less or more depending on their size, overdraw and other factors Nov 21 10:19:38 and the device of course Nov 21 10:19:51 yeah but I'm wondering, is it 60 flat views (within the same parent), or 60 views per layout in total Nov 21 10:19:54 ? Nov 21 10:19:59 in total iirc Nov 21 10:20:09 and the probability that it will be flat is really low Nov 21 10:20:19 true Nov 21 10:20:26 so I guess grouping wouldn't help Nov 21 10:20:40 use hieararchyviewer, it really gives good hints Nov 21 10:20:51 will do Nov 21 10:21:01 you have 3 colored circle and the time it took for each views on the tree Nov 21 10:21:14 or viewgroup (sum of all the views inside it) Nov 21 10:21:32 you can quickly knows where is the bottleneck Nov 21 10:21:35 know* Nov 21 10:22:02 righ Nov 21 10:22:02 t Nov 21 10:22:13 and also check the overdraw, if many views are layered on top of each other Nov 21 10:22:41 this is related to depth of the tree view and if repaint is needed Nov 21 10:23:33 another example: http://www.curious-creature.org/docs/android-performance-case-study-1.html Nov 21 10:23:57 it's the blog of a goog engineer who was reponsible of all the UI stuff Nov 21 10:24:36 cool, thanks Nov 21 10:25:16 hey, RomainGuy Nov 21 10:25:20 I've heard of him plenty Nov 21 10:26:26 yup Nov 21 10:33:55 Does the Play store do anything like the iTunesConnect Holiday Shutdown Nov 21 10:35:14 lol Nov 21 10:37:28 I have a custom adapter showing two TextViews. I want to do stuff in onClick for each of these. But I want the onClick code to be in the Activity class. What's the best way to do this? Nov 21 10:37:48 I started off defining a View.OnClickListener and passing that to my adapter, but of course that doesn't work because then we don't have the list position. Nov 21 10:38:48 I guess the only solution is something such as making my adapter call a listener when those things are clicked? Nov 21 10:38:59 And the activity is the listener. Nov 21 10:39:30 probably create an interface for the textview onclick Nov 21 10:39:33 implement it on the activity Nov 21 10:39:38 Yeah. Nov 21 10:39:39 K. Nov 21 10:39:40 assign it all the way down Nov 21 10:39:40 ;( Nov 21 10:39:45 y u do dis Nov 21 10:40:21 how do you have textviews in a listview which arent contextual to the listview data item? Nov 21 10:40:32 surely theres a better mechanic for that Nov 21 10:40:38 and ui pattern ... Nov 21 10:40:59 is there a repository of layouts? im looking for inspiration on how to lay out some data Nov 21 10:41:24 They are contextual to it. Nov 21 10:41:29 It's just that I want my activity to handle stuff. Nov 21 10:41:36 Basically, when one of the TextViews is clicked another activity opens. Nov 21 10:41:43 And I don't like the idea of my adapter opening an activity. Nov 21 10:42:09 I like this listener pattern here, I think. It seems the most sensible. :) Nov 21 10:43:59 well you pass the context of the activity to the adapter Nov 21 10:44:06 and the adapter handles the list item Nov 21 10:44:14 if the adapter were to open an activity Nov 21 10:44:26 it would be through the context, which is a reference to your activity Nov 21 10:45:16 hmmm don’t upcast Context to activity though, that seems dangerous Nov 21 10:45:40 samskiter, you dont need to cast context to create a new activity? Nov 21 10:45:47 TacticalJoke: you are introducing a dependency relation Nov 21 10:45:51 do you really need too? Nov 21 10:45:57 ah sorry i thought you meant grab the context, cast it to the activity and then send the message Nov 21 10:46:52 samskiter, what difference would upcasting make? It is necessary if he needs to call home right? Nov 21 10:46:53 TacticalJoke: the listener idea seems good :) Nov 21 10:46:57 *what's Nov 21 10:47:07 *what Nov 21 10:47:12 razzledazzle: code reuse. maybe another activity get’s passed in Nov 21 10:47:24 maybe the adapter is maintained across a rotation but the activity is destroyed Nov 21 10:47:38 interface would be good in that case samskiter Nov 21 10:47:40 so you start using the applicationContext rather than the acitivity Nov 21 10:47:43 listener is overkill since adapter is extension of activity and already contains the context to start an activity Nov 21 10:47:44 infinite reasons Nov 21 10:48:05 wait, =_= Nov 21 10:48:43 upcast = code smell :) Nov 21 10:48:43 I'm casting the Context passed to my adapter to MyAdapter.Listener. Nov 21 10:48:45 how can it be made sure that the implementation for the interface is an activity/context? Nov 21 10:48:57 I really dislike the idea of my adapter starting an activity. Nov 21 10:48:58 TacticalJoke: thats actually not the best idea Nov 21 10:49:02 That just seems yucky to me. Nov 21 10:49:17 razzledazzle: you don’t need to right. your adapter just cares that someone cares when one of its items are clicked Nov 21 10:49:25 your adapter lives in your activity, is essentially part of the activity, already has the context Nov 21 10:49:40 True. Nov 21 10:49:43 do you really want to create an unnecessary interface binding? Nov 21 10:49:53 what if you want to swap out the activity, or the adapter at some point later? Nov 21 10:50:01 my point is you are just adding code bondage Nov 21 10:50:20 since you already have the context in the adapter, and the adapter is essentially a piece of the activity Nov 21 10:50:20 i agree it could be desirable to have the flow coe in teh activity and the display code in the adapter. use a listener… Nov 21 10:50:35 True, I couldn't swap out the adapter. Nov 21 10:50:47 its a mistake you're just tieing your code up with useless interfaces Nov 21 10:50:58 I think you may be right. Nov 21 10:51:29 basically you want to 'decouple' your activity from the adapter Nov 21 10:51:33 i would do the same thing previousily, but after doing listener pattern enough "within the domain of an activity" to do things like this, it's really just a mistake--your adding code that will make it hard to change things later Nov 21 10:51:43 the activity and adapter need not know too much about each other Nov 21 10:51:54 samskiter, it should be fine if prefixed by "if (context instanceof Activity)" though :p Nov 21 10:52:00 your list item should be able to do what its required Nov 21 10:52:08 for whatever u tap on Nov 21 10:52:21 ravilov: that’s just reflection which is bad too Nov 21 10:52:22 if it needs to do different things depending on the activity Nov 21 10:52:27 then perhaps create another adapter for that case Nov 21 10:53:07 samskiter, I wouldn't call that reflection, the runtime is perfectly aware of the class inheritance at all times Nov 21 10:53:15 it's certainly not as bad as *active* reflection :p Nov 21 10:53:16 TacticalJoke: did you say you passed an onItemClickListener to the adapter already? Nov 21 10:54:01 the adapter should be or contain the onItemClickListener since adapter is a controller anyways Nov 21 10:54:03 TacticalJoke: because tthat has an ID passed to it and you could expose the ID of the views you care about publically somewhere Nov 21 10:54:22 ravilov: http://programmers.stackexchange.com/questions/106362/is-java-instanceof-operator-considered-reflection-and-what-defines-reflection Nov 21 10:55:17 samskiter: Oh, that was before I'd thought about the position thing. Nov 21 10:55:21 does anyone want to work on a steam-chat app for android? Nov 21 10:55:27 ive lost my dedication to the project Nov 21 10:55:37 https://www.github.com/kevelbreh/steamchat Nov 21 10:55:38 its a personal project? Nov 21 10:55:41 TacticalJoke: you mean the position of the items may change? but the ID wouldn’t ? Nov 21 10:55:43 ye Nov 21 10:56:08 samskiter, while it technically might fall into the category of "reflection", I doubt it's anywhere near as performance-costly as *true* reflection Nov 21 10:56:10 lasserix, i just lost interest because ive been too occupied at work Nov 21 10:56:40 ravilov: performance is not the only reason to dislike reflection Nov 21 10:56:54 steam has some api or somehing? Nov 21 10:57:13 What I meant was that I tried creating a View.OnClickListener in MainActivity and passing this to the adapter. Then the adapter was calling the View.OnClickListener. But it turned out to be a dumb idea because the View.OnClickListener.onClick method needed the position. :D Nov 21 10:57:22 lasserix, no, its steams protocol reverse engineered Nov 21 10:57:26 And of course it couldn't have it. Nov 21 10:57:45 TacticalJoke: doesn’t i also pass an ID? Nov 21 10:57:47 lasserix, it establishes a tcp connection to steam for conversation Nov 21 10:58:09 lasserix, this becomes a problem when devices want to deep sleep - steam closes the socket Nov 21 10:58:20 TacticalJoke: I’m taking a guess here :P Nov 21 10:58:32 samskiter, I thought that's its biggest offense, what else is bad about it? Nov 21 10:58:50 (to the point of disliking it) Nov 21 10:58:52 It passes a View. Nov 21 11:01:01 Okay, I think I now prefer the idea of the adapter starting the secondary activity. Nov 21 11:01:02 ravilov: because bug hunting becomes a nightmare. it defeats the point of polymorphism. all that compile time type checking, thrown away :( Nov 21 11:01:03 It's so simple Nov 21 11:01:04 . Nov 21 11:01:37 TacticalJoke: onItemClick (AdapterView parent, View view, int position, long id) <- Is this not the callback you got. i was wondering about that ‘id’ argument, but I may be barking mad Nov 21 11:01:40 In the adapter, should I store the "LayoutInflater.from(context)" result in the constructor, or is it okay to redo that in getView every time convertView is null? Nov 21 11:01:54 samskiter: Yeah, I think that 'id' is the getItemId one. Not sure, though. Nov 21 11:02:17 TacticalJoke, I grab a hold of it in the constructor Nov 21 11:02:20 never had a problem before Nov 21 11:02:21 K. Nov 21 11:02:22 just converted a few of my sqlite tables into fts - SOOO much faster! at least 50-80% Nov 21 11:02:30 Only reason I ask is that I'm storing both the layout inflater and the context now. Nov 21 11:02:34 When I could be storing only one. Hmm. Nov 21 11:02:36 fts? Nov 21 11:02:44 TacticalJoke: do it once Nov 21 11:02:53 doesn't matter Nov 21 11:02:57 small optimization Nov 21 11:03:13 no reason to instantiate it multiple times Nov 21 11:03:14 fts = "full text search" Nov 21 11:03:19 ah Nov 21 11:03:30 True. Nov 21 11:03:33 TacticalJoke: Nov 21 11:03:39 im trying to drawing an outline of a circle, so just using style.stroke. i need to animation the "drawing" of it. Nov 21 11:03:39 TacticalJoke: you don't need to store context Nov 21 11:03:56 MartialLaw: use path Nov 21 11:04:01 maybe draw a path and then animate that? Nov 21 11:04:23 Wow, my code is way simpler now that I'm calling startIntent in the adapter. Nov 21 11:04:24 TacticalJoke: you can get the context from the parent Nov 21 11:04:36 samskiter, but sometimes it seems necessary in order to have smart enough code ;) example: a hypothetical findViewById or similar implementation might need to check if a certain view in the hierarchy is a descendant of ViewGroup in order to know if it should walk through it's children or not, ie. to decide if a certain View is a node or a leaf Nov 21 11:04:37 lasserix: Which parent? Nov 21 11:04:39 Ooh. Nov 21 11:04:39 I see. Nov 21 11:04:39 parent.getContext.startActivity(new Intent( Nov 21 11:04:45 TacticalJoke: jut for academic purposes, it seems it would be possible to tie the ID in there: http://stackoverflow.com/questions/14972359/android-onitemclicklistener-long-id-parameter-is-not-giving-field-id Nov 21 11:06:05 cool project kevel1 Nov 21 11:06:06 The only thing with the onItemClickListener thing is then I have to determine which view was clicked. Nov 21 11:06:13 And it seems slightly complicated. Nov 21 11:06:30 explain? Nov 21 11:06:31 I also wonder whether I then get the highlighted background on clicking the ListView (which isn't desirable in this case0. Nov 21 11:06:32 ravilov: you should only need it for bad design. you should use it sparignly and you should encapsulate. e.g. you can sometimes pass a ‘Object userInfo’ to some methods and receive a callback with the same information later. Then you cast it back to what it was. (as per onSaveInstanceState). But you normally encapsulate the down and upcast in the same source file. Nov 21 11:06:32 )* Nov 21 11:06:55 drawing the circle is no problem... i want to animate the "creation" of the circle Nov 21 11:06:59 TacticalJoke: a nice trick is to use tags of views to store the datastructure Nov 21 11:07:22 True. Nov 21 11:07:29 for instance, you can make click functors, set them as a tag, then in on click grab it and call the click functors function Nov 21 11:07:40 lasserix: So, in your experience, the adapter doing all this stuff (e.g., starting the activity) is the best way, right? Nov 21 11:07:47 its the simplest way Nov 21 11:07:56 K. Nov 21 11:07:57 and typically the simpler you code is the better? Nov 21 11:08:08 Yeah. Nov 21 11:08:17 It's about dat simplicity. Nov 21 11:08:19 KISS :) Nov 21 11:08:22 all ^ Nov 21 11:08:27 samskiter: Exactly. lol Nov 21 11:08:49 samskiter, what about my findViewById example? would that be an example of bad design then? Nov 21 11:08:57 lasserix, thanks, feel free to contribute :) Nov 21 11:10:48 ravilov: findViewByID doesn’t use reflection Nov 21 11:11:02 it uses inheritance Nov 21 11:11:03 I said a hypothetical implementation of it Nov 21 11:11:05 hi guys, do you know of any ways to use cards UI in api level 9+ ? Nov 21 11:11:14 implement it better? Nov 21 11:11:20 as in, if it were implemented that way, would that be bad? Nov 21 11:11:52 reflection is usually bad Nov 21 11:11:53 probably. ViewGroup is a prime example for subclassing View. so you cna override findViewById Nov 21 11:11:53 reflection is typically much slower? Nov 21 11:12:00 performance overhead Nov 21 11:12:04 yep lasserix Nov 21 11:12:54 do you know of any ways to use new card ui in gingerbread? Nov 21 11:12:55 ravilov: it is especially bad if you have the superclass aware of it’s subclasses. just a code smell that you are encapsulating badly Nov 21 11:13:09 Yeah, reflection is best to avoid as much as possible, really. Nov 21 11:14:33 samskiter, I tend to agree that would be a suboptimal design and would leave plenty enough room for improvements. I don't always act on it, but I do agree with it. ;) Nov 21 11:15:28 just checked, my largest project has 16 "instanceof"s across 6 source files, out of a total of 70 Nov 21 11:15:37 might go through it and reimplement it in a better way Nov 21 11:15:57 mObject.getClass() == Object.class ? Nov 21 11:16:08 sure :p Nov 21 11:16:30 lasserix, oh I would, but I don't know if that's supported on 1.6, see Nov 21 11:16:41 umm Nov 21 11:16:47 that's like java basics? Nov 21 11:16:49 (jk) Nov 21 11:17:00 lasserix: Thanks for the suggestion about this pattern, BTW. I was totally closed off to it at first. Nov 21 11:17:08 Thought it would've been a n00b move. But now I think it's best. Nov 21 11:17:18 TacticalJoke: yeah i learned the hard way Nov 21 11:17:19 Why the fuck does this specification want Instagram social sign on? D: Nov 21 11:17:24 consequently, lasserix is the best :p Nov 21 11:17:41 since his suggested pattern is the best Nov 21 11:17:41 interfaces are cool, but really only use the listener pattern when its needed, otherwise it becomes tangled inertia for your code Nov 21 11:17:50 woot woot Nov 21 11:19:31 kinda wish I paid more attention to that convo now, as I have no idea what was this suggested pattern, tldr anyone? Nov 21 11:19:34 Yeah. Nov 21 11:19:38 lasserix: tht’s a good point. i’m far too reliant onit Nov 21 11:19:59 i think it’s a habbit from iOS - using delegates for everything Nov 21 11:20:09 ravilov: My custom adapter has two text views. When one is clicked, it opens a new activity. This code is all in my adapter class thanks to lasserix. Nov 21 11:20:12 what is it like high composition low coupling or something Nov 21 11:20:21 At first, I thought that'd be a bad solution, but now it seems to be the simplest. Nov 21 11:20:52 I thought the activity should deal with this, but in a way the adapter is like a sub-part of the activity anyway. Nov 21 11:20:57 I see, but not through using listener interfaces obviously? Nov 21 11:20:58 thing it lasserix what if the Activity also contains a checkbox for “disable moving to activity” do you then have to make the adapter aware of that? Nov 21 11:21:01 Yeah. Nov 21 11:21:05 Listeners was my suggestion. :D Nov 21 11:21:23 so what was his then? Nov 21 11:21:29 I'm interested in the actual pattern Nov 21 11:21:31 Allowing my adapter to do all the work. Nov 21 11:21:31 TacticalJoke: what I actually like to do is, seperate off the click listener and then make a class with a single function (can be abstracted and subclassed) that i make some static instances of somewhere, then set them as tags in the views so i can just grab them out of the tag, then do the appropiate click function (you can throw it in an enum set too) Nov 21 11:21:56 lasserix: So you don't do this thing I'm talking about? Nov 21 11:22:05 TacticalJoke, so then the adapter uses the given context to launch an activity all on its own? Nov 21 11:22:06 no i do i just take it a step further Nov 21 11:22:13 ravilov: Yeah. Nov 21 11:22:17 I see Nov 21 11:22:20 ravilov: Is that what you'd do? Nov 21 11:22:38 It uses the parent given to getView to launch an activity. Nov 21 11:22:40 I'd probably do an interface I guess... it depends really Nov 21 11:23:25 do you know of any ways to use the new card ui in gingerbread? Nov 21 11:23:27 could be because I felt that was more correct, or could be because I'm used to that pattern :p Nov 21 11:23:42 farzeen, appcompat lib if anything Nov 21 11:23:48 hmm i think i prefer listeners to setting functions in the tag of the view. Nov 21 11:23:57 farzeen: maybe here http://android-developers.blogspot.jp/2014/10/appcompat-v21-material-design-for-pre.html Nov 21 11:24:15 thanks lasserix Nov 21 11:24:28 samskiter: that works well when you have one type, but if you have like 8 different type of rows Nov 21 11:24:30 does appcompat lib contain card ui? Nov 21 11:24:40 farzeen: not sure but i believe that is the latest one Nov 21 11:24:55 farzeen, it is what's most likely to contain it Nov 21 11:25:03 ie. if that doesn't, dunno what does Nov 21 11:25:17 besides tags are nice because they are using composition, not coupling. coupling code is usually undesirable Nov 21 11:25:53 what if your tag is already taken for, say, the ViewHolder pattern? Nov 21 11:26:04 ravilov: settag has an overload Nov 21 11:26:09 setTag(int, object) Nov 21 11:26:13 where int is R.id.whatever Nov 21 11:26:18 ok.. is there any way to backport libraries compiled for higher api levels to lower ones? Nov 21 11:26:19 you can have as many tags as you want Nov 21 11:26:29 I see Nov 21 11:26:31 farzeen: yeah: manually ;p Nov 21 11:26:34 lasserix: you presumably still end up with a switch in your ‘getView()’ method that puts the right functor on the tags? you can just move that switch to the onclicklistener. Nov 21 11:26:41 or the listener Nov 21 11:26:59 for some reason I always thought there can only ever be one tag per view Nov 21 11:27:08 samskiter: no usually i put them in enums that are final part of the constructors of whatever Nov 21 11:27:12 Hmm, I'm not sure about the tag thing. Nov 21 11:27:16 I guess it depends on the context. Nov 21 11:27:21 possibly because this is actually true when, say, setting tags through XML Nov 21 11:27:22 Like, it sounds complex. Nov 21 11:27:31 it's not Nov 21 11:27:49 I mean lasserix's idea. Nov 21 11:28:02 its really easy. you define an R.id.whatever, you do View v.settag(R.id.whatever, tagObject) then later, like in onClick (View v) you can do v.getTag(R.id.whatever) and cast it and now you have whatever you set Nov 21 11:28:11 oh wait Nov 21 11:28:24 now admittedly I never used tags before, never had much need for them Nov 21 11:28:40 im just bring it up, its very useful construct, an easy to pass around references without having to pass them manually Nov 21 11:28:51 but I thought it only accepts an arbitrary object as a tag, never realized it has a key too (the R.id.xxx part) Nov 21 11:29:03 Hello. Is there any good resource how can I make HTTPS client? Nov 21 11:29:12 slani, yes, google Nov 21 11:29:38 not sure why though, there are plenty enough http/https client libs available for java/android Nov 21 11:29:54 bleugh. at the end of the day your adapter is dealing with one very specific kind of list. so just enumerate that. you can even have the listener totally optional and have it do default actions for some items and let your listener do others. Nov 21 11:30:42 ravilov: hm Nov 21 11:30:45 i am not trying to say one is better or not (though coupling is bad) im just saying if you haven't used tags before they can be very nice way to do a lot of different things Nov 21 11:31:10 Here is the code (note that this is new and really horrible code that needs to be refactored; I also haven't implemented the ViewHolder thing yet): http://pastebin.com/J9va22Fp Nov 21 11:31:42 CommentCountViewOnClickListener.onClick is the code in question. Nov 21 11:31:46 Lol at that name length. Nov 21 11:31:48 and you should only use listener pattern if you really need to, not because you think it gives your code more form--it doesn't it gives it more coding debt cause later you'll have to untangle all your listener dependencies if you want to change anything. composition ftw Nov 21 11:32:11 lasserix, so while there is indeed View.setTag(int, Object) at your disposal, I'm guessing using android:tag="@whatever" from XML is actually using the View.setTag(Object) variant, correct? Nov 21 11:32:21 TacticalJoke: before you do viewholder pattern you should read: http://blog.xebia.com/2013/07/22/viewholder-considered-harmful/ Nov 21 11:32:32 indeed Nov 21 11:32:46 I mentioned ViewHolder as an example, I don't actually think it's good Nov 21 11:32:56 Ah, yeah. I was thinking of trying that. Nov 21 11:33:00 Thanks for reminding. :D Nov 21 11:33:16 Note that the code I posted is horrible. Nov 21 11:33:18 It's just-written. Nov 21 11:33:26 TacticalJoke: btw you should avoid doing like foo() { bar(); bar2(); bar3(); bar4(); } it's actually much slower Nov 21 11:33:27 I make my code really neat before rebasing with upstream. Nov 21 11:33:43 I know it's less fast, but I think it's insignificant here. Nov 21 11:33:43 oh Nov 21 11:33:45 Has anybody used and successfully customised the TwitterLoginButton in Fabric? :/ Nov 21 11:33:53 I'm a huge fan of Clean Code by Robert Martin. Nov 21 11:33:56 So I extract methods so much. :D Nov 21 11:34:01 It looks like you have OCD here Nov 21 11:34:01 ;p Nov 21 11:34:04 lol Nov 21 11:34:13 OCD runs my life. Especially programming. Nov 21 11:34:34 TacticalJoke: why not have the adapter implment View.OnClickListener? Nov 21 11:34:51 You mean as an anonymous class? Nov 21 11:34:55 no Nov 21 11:34:59 Ooh. Nov 21 11:34:59 I see. Nov 21 11:35:00 have the adapter implement Nov 21 11:35:07 and HERE is what i meant about tags Nov 21 11:35:08 But I need to do it twice in future. Nov 21 11:35:12 Then there'd be ambiguity. Nov 21 11:35:15 if you do Nov 21 11:35:24 Both text views will, eventually, need a click listener. Nov 21 11:35:35 View view in getView view.setTag(R.id.postURL, post.getPermalink()) Nov 21 11:35:44 then in the onClick listener Nov 21 11:35:45 you can do Nov 21 11:35:59 v.getTag(R.id.postURL) and have your permalink Nov 21 11:36:02 lasserix: i think the intention is for it to store information specifically related to the view and what it needs to show. Nov 21 11:36:04 without having to pass it around Nov 21 11:36:10 I will probably rename "getPermalink", BTW. Nov 21 11:36:15 That's Reddit terminology, but I don't like it. Nov 21 11:36:20 samskiter: well whatever the reason this is the perfect use case for it Nov 21 11:36:21 getUrl is much nicer. Nov 21 11:36:26 "OCD runs my life." <-- hardly ever a good thing IMO, even when it ends up producing good results Nov 21 11:36:33 i think i agree that maybe the flow logic should belong in your adapter. therefore you tie it less to the activity Nov 21 11:36:34 Yeah, it's not fun Nov 21 11:36:34 . Nov 21 11:36:38 use it to pass around references to your data structures that are needed onclick and stuff Nov 21 11:36:46 I can't even type a sentence without a period at the end. Grr. Nov 21 11:36:47 but it depends on whether you think of the adapter as part of the view layer or part of the controller layer Nov 21 11:36:53 I noticed Nov 21 11:36:55 adapter is controller Nov 21 11:36:57 lol Nov 21 11:37:01 by definition Nov 21 11:37:07 hi Nov 21 11:37:20 why when i try use Build.VERSION_CODES.JELLY_BEAN, it is not reconized? Nov 21 11:37:28 lasserix: Sorry, who does v.getTag? Nov 21 11:37:30 I got lost. Nov 21 11:37:31 Android Studio doesn't offer me to import android.util.Log anymore when I simply enter Log.i and use the auto-complete function. I have to fully qualify it manually. Any idea what's causing that? Nov 21 11:37:42 TacticalJoke, you do realize a missing period that's later added as the next line doesn't actually count as "a period at the end", right? :p Nov 21 11:37:47 TacticalJoke: i think the onclicklistener in the adapter does the v.gettag Nov 21 11:37:48 Yes. Nov 21 11:37:54 ok then Nov 21 11:37:54 . Nov 21 11:37:55 But it's an appendage. lol Nov 21 11:38:07 samskiter: Ah, okay. Nov 21 11:38:20 I have had so little sleep lately. Can barely process stuff today. Nov 21 11:38:25 so you could just as easily call the function directly at that point Nov 21 11:38:35 TacticalJoke, apparently you're also into double spaces for some reason Nov 21 11:38:38 rather than storing it in the tag. Nov 21 11:38:39 just yet another quirk I guess :p Nov 21 11:38:44 Yeah, when using monospace fonts. Nov 21 11:38:47 TacticalJoke: hey look http://pastebin.com/VKf7VTmJ Nov 21 11:39:15 Ooh. I see what you mean. Nov 21 11:39:25 see how much simpler, cleaner the code is? Nov 21 11:39:49 Is that what you were talking about earlier with the other-class thing? Nov 21 11:39:55 umm Nov 21 11:39:56 well Nov 21 11:39:58 arrrrgh, it burns my eyes! too much bleach, too much clean! Nov 21 11:39:59 so basically Nov 21 11:39:59 :p Nov 21 11:40:07 lol ravilov Nov 21 11:40:16 lasserix: what is permalink? Nov 21 11:40:26 i dont know a url of somesort or something? Nov 21 11:40:32 I just realised that I forgot to edit "View v" as "View view". ;o Nov 21 11:40:40 It's the link to a Reddit post. Nov 21 11:40:46 I hate that term 'permalink'. I need to change that. Nov 21 11:40:46 pretty sure the runtime doesn't care, TacticalJoke :p Nov 21 11:40:48 Reddit uses that. Nov 21 11:40:54 My brain cares. :D Nov 21 11:41:02 tell it to go to bed Nov 21 11:41:04 You should see most of my code. Nov 21 11:41:07 It's like a painting. Nov 21 11:41:12 Every little thing in its place. Nov 21 11:41:22 The only time I tolerate untidiness is when implementing something totally new. Nov 21 11:41:53 lasserix: sorry, i thought you were placing functions in the tag and then executing them in the onclick. this make more sense. Nov 21 11:42:04 TacticalJoke, no, your code is not like a painting... now THIS code is like a painting: http://www.ioccc.org/2006/night/night.c Nov 21 11:42:05 ravilov: this is a good example of encapsulating up/down casting Nov 21 11:42:23 haha Nov 21 11:42:24 why when i try use Build.VERSION_CODES.JELLY_BEAN, it is not reconized? Nov 21 11:42:32 The only thing I dislike about the tag idea is the cast. Nov 21 11:42:35 I hate casts. ;| Nov 21 11:43:01 lasserix: How does your paste have 92 views? Nov 21 11:43:03 Are you a deity or something? Nov 21 11:43:09 lasserix: you could also have the onclicklistener store the URL and actually define the dependency more strongly Nov 21 11:43:19 Maybe because it's public. Hmm. Nov 21 11:43:25 lasserix just open-sourced my app. :D Nov 21 11:43:30 TacticalJoke, why are you surprised? you just admitted yourself his suggestion was the best Nov 21 11:43:36 lol Nov 21 11:43:46 samskiter: Yeah, that's what I'm doing. Nov 21 11:43:58 But the issue is that I'm having to pass two parameters to the constructor. Nov 21 11:44:01 http://pastebin.com/J9va22Fp Nov 21 11:44:07 Deity overlord = (Deity)laserix; Nov 21 11:44:31 ClassCastException! Nov 21 11:44:32 *bam*, force-close Nov 21 11:44:36 lol Nov 21 11:44:58 probably wouldn't even compile, I lost an "s" there Nov 21 11:45:07 God dammit, lasserix. The whole world is now looking at (your modification of) my code. Nov 21 11:45:12 114 views. Nov 21 11:45:22 TacticalJoke: here's what i mean http://pastebin.com/3VckgFKi Nov 21 11:45:27 * ravilov writes a script to refresh that page repeatedly Nov 21 11:45:35 this works really well when you have a lot of convertview types Nov 21 11:45:56 since you have minimal allocations of classes (the click functors) and no listeners (no coupling) etc etc Nov 21 11:46:18 samskiter, I see Nov 21 11:46:19 lasserix: http://pastebin.com/tTpEfk4S Nov 21 11:46:24 samskiter: that's not something i'd like to do since it doesn't promote coupling Nov 21 11:46:28 err composition Nov 21 11:46:38 it promotes compiling, like hardcoding in your code Nov 21 11:46:49 coupling, jeez i am tired Nov 21 11:46:53 My code is like a virus. Nov 21 11:46:53 lasserix: your listener needs a URL to work. so put it in the code.. Nov 21 11:46:56 Replicating. Nov 21 11:47:05 Natural selection will shape it into something amazing. Nov 21 11:47:08 anyone good with Gson? Nov 21 11:47:10 samskiter: did you look at my link? Nov 21 11:47:18 why construct the commentcount view on click listener? Nov 21 11:47:18 c03: Might as well just ask. Nov 21 11:47:28 just shove it in the view and pull it out when it gets clicked Nov 21 11:47:28 Is it possible to map something that is called abstract to mAbstract with Gson? Nov 21 11:47:36 in your construct you need 2n objects Nov 21 11:47:38 TacticalJoke, natural selection will weed out all the people whose life is run by OCD :p Nov 21 11:47:43 in mine you only need n + 1 objects Nov 21 11:47:45 as I can't have variables named abstract in java Nov 21 11:47:50 as far as click listeners go Nov 21 11:47:51 Omg, I'm dumb. I didn't need to pass the context! Nov 21 11:47:53 What is wrong with me tonight. Nov 21 11:47:58 bed-- Nov 21 11:48:03 I can just use 'v.getContext'. Nov 21 11:48:04 Ya. Nov 21 11:48:21 sleep.time--; Nov 21 11:48:38 TacticalJoke: here's what i meant about the other class http://pastebin.com/3VckgFKi Nov 21 11:48:57 notice the static object, so you are only ever instancing two objects to do click functions, not 2n (n = row count) Nov 21 11:48:57 lasserix: didn;t see your second link Nov 21 11:49:36 Okay. I think I get it. Nov 21 11:49:45 I kinda hate statics, though. :/ Nov 21 11:49:56 it's technically a functor i believe Nov 21 11:50:02 it holds no references Nov 21 11:50:04 lasserix: did your last link get a bit messed up? the functor has a getView method Nov 21 11:50:11 think of as stateless programming Nov 21 11:50:32 umm Nov 21 11:50:38 CommentClickListener would be like toplevel class Nov 21 11:50:39 or enum Nov 21 11:50:48 figured it out. Nov 21 11:50:58 lasserix: i can’t follow your last link Nov 21 11:51:11 lasserix: You have so many interesting ideas. lol Nov 21 11:51:25 I think I'm gonna run various queries by you in future. Nov 21 11:51:55 while (project.stillGoing()) { lasserix.query(currentIssue); } Nov 21 11:52:18 project.isRunning() Nov 21 11:52:22 samskiter: http://pastebin.com/sxjGcysf Nov 21 11:52:24 True. lol Nov 21 11:52:29 your wording scares me Nov 21 11:53:18 sometimes the ideas come out clean othertimes they blow up in my face and i learn the hard way ;p Nov 21 11:53:45 Hmm. Using View.getContext does feel a little hacky here. Nov 21 11:53:46 Not sure why. Nov 21 11:53:49 Maybe it shouldn't. Nov 21 11:53:53 but yeah shoot me any questions you know a lot yourself and always have good suggestions for people Nov 21 11:54:08 think of it as contextual dependency injection (no pun intended) Nov 21 11:54:09 TacticalJoke, so you hate statics, you hate casts, you hate who knows what else... and then *I* am the one who's technically limited :p Nov 21 11:54:42 Well, I use statics and casting where necessary. But it always hurts a little. Nov 21 11:54:56 I try to hide code using casting by extracting methods. Nov 21 11:55:08 I do the same with version control systems, I never said I don't use them when necessary Nov 21 11:55:20 lasserix: Ah. i see what you’re doing. Imo this is a tradeoff between optimisation and tighter code. for me this would be a premature optimisation. especially when i could just do all this in the adapter’s onclicklistener Nov 21 11:55:42 ravilov: With revision-control systems, it's always necessary! Nov 21 11:55:47 also TacticalJoke’s problem is more about a handful of distinct items, yours is about many of the same type of item (posts) Nov 21 11:56:20 TacticalJoke, try instead hiding the code in separate source files that have a huge comment on top that says "DANGER, DO NOT READ THIS, THIS CODE IS NOT PG-13" a few thousand times Nov 21 11:56:24 samskiter: it came out of having to figure out the best way to do a 10 row view type adapter once--and actually its not so much about optomization for me as about modularity, this makes it very easy to swap out functionality Nov 21 11:56:32 I hate comments too. :/ Nov 21 11:56:37 Comments are mess, IMO. Nov 21 11:56:42 ... I'm sorry, there's no helping you Nov 21 11:56:43 But occasionally the mess is justified. Nov 21 11:57:22 COMMENTS ARE A MESS Nov 21 11:57:23 wut Nov 21 11:57:24 my eyes Nov 21 11:57:28 what am i reading? Nov 21 11:57:40 Comments are almost always bad, IMO. Nov 21 11:57:46 comments are where you hide snarky or otherwise smart ass comments about life and your coworkers Nov 21 11:57:49 not sure if trolling or ... Nov 21 11:57:52 lasserix: adapterview.onclicklistener passes a position to the onclick. at which point you could do getContext().startActivity(CommentListingActivity.createIntent(context, posts.get(position).getPermalink())); Nov 21 11:57:52 Unless we're talking something such as Javadoc. Nov 21 11:57:58 I'm talking about internal documentation. Nov 21 11:58:23 TacticalJoke: so you leave your regex uncommented? Nov 21 11:58:28 Oh, regexes are a good example. Nov 21 11:58:32 /me ususally does Nov 21 11:58:35 er Nov 21 11:58:36 fail Nov 21 11:58:36 Comments are needed because regexes suck. Nov 21 11:58:44 Note that comments are needed because something sucks. Nov 21 11:58:45 regexes are totally readable Nov 21 11:58:47 That's almost always the case. Nov 21 11:58:47 TacticalJoke, https://github.com/kevelbreh/steamchat/blob/master/steamchat/src/main/java/com/kevelbreh/steamchat/steam2/handler/ConnectionHandler.java Nov 21 11:58:52 A comment states "I apologise". Nov 21 11:58:57 Would you know whats happening without the comments? Nov 21 11:59:03 samskiter: that is pretty clean :) Nov 21 11:59:05 could always wrap your regex in a method with a descriptive name? Nov 21 11:59:12 lol shruubi Nov 21 11:59:32 The "this is a dirty hack" comment is good. Nov 21 11:59:38 TacticalJoke: comments state intention. you might intend one thing and implement it one specific way. regexs are the purest example of this. Nov 21 11:59:40 public void uglyCrappyRegexRunner(Pattern nevermind); Nov 21 11:59:50 oh got to transfer adios Nov 21 11:59:51 but i agree, we have a lot of //hack comments in our codebase Nov 21 11:59:58 lasserix: not sure if sarcastic ;) Nov 21 12:00:02 although, given the assumption that comments are an "i apologize", maybe they are necessary on regex's? Nov 21 12:00:15 kevel1: As far as I can see, those comments are justified. Nov 21 12:00:20 "i'm sorry i used a regex" Nov 21 12:00:24 Because you're explaining something that the programming language cannot. Nov 21 12:00:29 The programming language failed you; you had to resort to comments. Nov 21 12:00:34 I don't understand why everybody keeps hating regexes, I think they are totally readable Nov 21 12:00:38 The apology is "I'm sorry that Java sucks so much". Nov 21 12:00:47 But most people don't comment like that. Nov 21 12:00:48 TacticalJoke, the language didnt fail me Nov 21 12:00:52 it worked exactly as intended Nov 21 12:00:53 lol Nov 21 12:00:57 They do stuff such as "int i = 10; // the number of items". Nov 21 12:00:57 TacticalJoke, if that's how you feel about java, you should have comments on every other line of your code Nov 21 12:00:59 ravilov: they may be readable but they do not convey your intention. yes you could wrap it in a method. and then javadoc it Nov 21 12:01:16 this comes to mind: http://www.commitstrip.com/en/2014/02/24/coder-on-the-verge-of-extinction/ Nov 21 12:01:29 samskiter, in that sense they are no worse or better than many other kinds of code Nov 21 12:01:31 (That should be "int itemCount = INITIAL_ITEM_COUNT;" or some such.) Nov 21 12:01:52 kevel1: But it did. Nov 21 12:01:59 A better language would give us more expressive power. Nov 21 12:02:17 TacticalJoke, INITIAL_ITEM_COUNT_THAT_MIGHT_CHANGE_LATER_BUT_WE_START_OFF_WITH_THIS_VALUE Nov 21 12:02:17 I'm not hatin' on Java here. Nov 21 12:02:19 I quite like it. Nov 21 12:02:24 ravilov: hence my previous message about intention. Nov 21 12:02:32 samskiter, fair enough Nov 21 12:02:50 TacticalJoke, really? Nov 21 12:02:53 The apology is "I'm sorry that Java sucks so much". Nov 21 12:02:53 kevel1: I disagree with this comment, though: "Unzip the data received from Steam." Nov 21 12:02:57 I'd extract a method. Nov 21 12:03:01 but regexs are a purer version. you need more comment per line with regex (i.e. the ratio is 1:1) Nov 21 12:03:04 But that's just my opinion. I'm sure you disagree. :) Nov 21 12:03:23 Okay, I was exaggerating about it sucking so much. Nov 21 12:03:35 TacticalJoke, for what reason, its used in 1 place and 1 place only Nov 21 12:03:39 its needed nowhere else Nov 21 12:03:43 If we're referring to the github url above, I'd suggest removing the SupressWarnings annotations Nov 21 12:03:43 ("it sucks even more", he says next) Nov 21 12:03:44 :p Nov 21 12:04:09 Even if some code is used only once, extracting methods can greatly improve readability. Nov 21 12:04:28 that's only because you use over-elaborate code as a replacement for comments ;) Nov 21 12:05:08 right. i need to do some work lol. back to obj-c (aka the compiled scripting language) Nov 21 12:05:20 have fun Nov 21 12:05:29 Nov 21 12:07:07 if you ever feeling hatey about Java, go look up objective-c’s Category feature. and it’s total lack of generics, namespacing or access control (private,public,protected) Nov 21 12:07:43 http://www.quickmeme.com/img/67/67e27d18294210d1bea66d302ab775c226584d4172461e646352dce7f6fe981a.jpg Nov 21 12:07:51 well... Obj-C does technically have private Nov 21 12:07:54 God, Objective-C looks awful. Nov 21 12:07:55 I feel for you. Nov 21 12:08:06 If Satan designed a programming language... Nov 21 12:08:09 Just the look of it. Nov 21 12:08:30 shruubi: yes, you can put stuff in the implementation file :P Nov 21 12:08:36 I think it was the winner of the Ugliest Programming Language 1983 competition. Nov 21 12:08:51 objc historically inherits from smalltalk, c and c++ and it's not a "bad" prog language, and indeed it has private, the object concept is a bit different than java Nov 21 12:08:52 maybe i'm weird, but i don't overly mind it Nov 21 12:08:54 And that whole NSString thing? Nov 21 12:09:04 also everything is practcally called by strings (aka selectors) Nov 21 12:09:07 so why is it called objc? it has very little to do with C... Nov 21 12:09:14 I am so obsessive about how code looks. I would have a hard time. ;| Nov 21 12:09:22 it has a lot to do with c lol Nov 21 12:09:26 - (void)importDocumentWithName:(NSString *)name withSpecifiedPreferences: Nov 21 12:09:43 if you drill down with obj-c then selectors kind of make sense Nov 21 12:09:47 my eyes, my eyes!!! Nov 21 12:09:48 That hyphen looks like a typo. Nov 21 12:09:59 thing is, the way methods names are structured arent actually that bad once you get used to them. and that went with swift :P Nov 21 12:10:02 Or someone copy-pasted it from a diff. Nov 21 12:10:04 if you understand the object model Nov 21 12:10:05 why not rant about := in turbo pascal :) Nov 21 12:10:14 I loved ':='. :) Nov 21 12:10:15 So clear. Nov 21 12:10:15 while at it, and every prog language specificity Nov 21 12:10:19 then selectors etc make a lot of sense Nov 21 12:10:19 I used to use Delphi / Object Pascal. Nov 21 12:10:29 I didn't like the 'begin'..'end' thing. Nov 21 12:10:41 ahh i did a bit of delphi too, stopped at version 6 iirc Nov 21 12:10:47 it was still owned by Borland Nov 21 12:11:07 now you can do Android with delphi lol, but i have not tried Nov 21 12:11:11 - (void)importDocumentWithName:(NSString *)name withSpecifiedPreferences: i immediately know what the different params are for. Nov 21 12:11:31 Yeah. I have loads of memories of Delphi. Nov 21 12:11:45 Rust is hype nowadays :) Nov 21 12:12:03 I wrote a Yahoo! Chat client in Delphi. Loved doing that. Nov 21 12:12:04 It was a battle against Yahoo!. They kept changing the protocol. Nov 21 12:12:09 In android studio, in the preview, can I have fake items or something, just for the purpose of preview? Nov 21 12:12:14 But they were clueless. Nov 21 12:12:14 :)) Nov 21 12:12:43 I have a linearlayout which gets populated in code. But in the preview it's thus empty Nov 21 12:12:46 MS is making build tools for Android. Nov 21 12:12:48 C# is quite nice. Nov 21 12:12:50 it would be nice to put in an image, or something..? Nov 21 12:13:18 johnflux, of course you can, just insert some fake items in your layout Nov 21 12:13:20 just populate the android:background with a color maybe johnflux Nov 21 12:13:45 ravilov: but those will be compiled into the app, right? even if I make them invisible Nov 21 12:13:50 ravilov: so will use up resources etc Nov 21 12:14:09 adq: hmm, tools:background="dummyimage" maybe - that's a good idea Nov 21 12:14:17 there is a way programmatically too Nov 21 12:14:28 with isEditsomething, i don't recall, let me search Nov 21 12:14:37 johnflux: if you are meaning things like listviews then no, you can populate with dummy data and override it on initialization Nov 21 12:15:01 and by that i mean things like textviews etc Nov 21 12:15:04 if (isInEditMode()) Nov 21 12:15:07 shruubi: I have two usecases: A linear layout with it populated, and a customview Nov 21 12:15:08 you can use that programmatically Nov 21 12:15:32 adq: yeah, that work work for the custom view, but not for the linearlayout Nov 21 12:15:35 indeed Nov 21 12:15:41 I think I might use the tools:background trick for the linearlayout Nov 21 12:16:20 would be useful to have what you ask (a preview mode) which does not embed any code after being built Nov 21 12:16:36 but that is also prone to error :/ Nov 21 12:16:56 like forgot to add the real attribute, and wondering why on the preview it's ok and not in code Nov 21 12:17:01 s/code/build/ Nov 21 12:17:33 or maybe you can use a theme switch to do that on every view Nov 21 12:17:49 the problem with preview mode is that it can only do so much because a lot is computed view wise at run time Nov 21 12:18:05 things like listview cell heights etc, just to be painful Nov 21 12:18:19 ah true, you can populate a listview with an xml array Nov 21 12:18:30 in this case it will work on preview, but that's often far from a real case with adapter Nov 21 12:20:53 hi guys, Nov 21 12:21:12 johnflux, correct Nov 21 12:23:03 hi guys, what is the difference here, im trying to understand it https://gist.github.com/pangelovski/01fdb3af6ee71657e648 Nov 21 12:23:34 what do you mean? Nov 21 12:23:40 two different resource types there Nov 21 12:24:16 one is a reference to a color in the system the other is an rgb value Nov 21 12:24:44 asfdd: which ones whic Nov 21 12:24:58 top one will give you a rgb value Nov 21 12:25:02 ugh, can't you tell? Nov 21 12:25:14 ravilov, i started learning yesterday Nov 21 12:25:20 I see Nov 21 12:25:29 in that case, read as much as you possibly can on android resources Nov 21 12:25:35 and how to handle them Nov 21 12:25:38 thanks Nov 21 12:25:54 are you good with sql/databases maybe? Nov 21 12:26:50 i'm trying to change float[] values in an objectanimator.. i have the setter method in my View class but when i try to start the animation it does nothing Nov 21 12:31:45 hi Nov 21 12:31:49 anybody can help me with UNEXPECTED TOP-LEVEL EXCEPTION: ? Nov 21 12:31:53 in AS Nov 21 12:34:52 johnflux: not sure if you worked this out, but the tools namespace is ideal for what i think you are asking Nov 21 12:35:18 johnflux: http://tools.android.com/tips/layout-designtime-attributes Nov 21 12:36:17 samskiter: yep, it gets me 90% there. I just wish I could make entire elements as "tools". E.g. put in a that is only visible in tools, and not compiled in at all Nov 21 12:36:42 ahhh i see. you might be able to do some kind of reference view or something Nov 21 12:36:43 samskiter: and also be able to override the class. E.g. i have a custom class, but tell tools to treat it as an img or something Nov 21 12:37:25 johnflux: for custom classes you can use the ‘isInEditMode’ in the layout to spoof stuff Nov 21 12:37:42 (if that;s appropriate) Nov 21 12:39:15 * johnflux nods Nov 21 12:39:17 samskiter: thanks Nov 21 12:39:32 :) Nov 21 12:45:55 anybody can help me with UNEXPECTED TOP-LEVEL EXCEPTION: ? Nov 21 12:47:32 t0th_-_: You need to properly explain your issue before anyone can help you Nov 21 12:47:39 ok Nov 21 13:00:53 i am running my project in android studio, but i have this error, i googled but cant search anything to help me... Nov 21 13:01:46 stack trace? Nov 21 13:02:22 lol Nov 21 13:02:25 tell us the error Nov 21 13:02:25 Does basically everyone agree that custom views are better than ViewHolders? Nov 21 13:02:43 TacticalJoke, holders i use for temp shit and doing stuff in a hurry Nov 21 13:02:54 TacticalJoke, refactoring i always make custom views Nov 21 13:03:02 I don’t even know what a wiewholder is Nov 21 13:03:29 Okay. Nov 21 13:03:53 samskiter: It's a suggested approach for preventing multiple findViewById calls in a list adapter. Nov 21 13:03:56 TacticalJoke, a custom view can be seen as a view holder in some reguard Nov 21 13:03:56 uhm something that holds a view Nov 21 13:03:58 But there are problems with it (coupling). Nov 21 13:04:05 except a bit more controlling and neater Nov 21 13:04:07 True. Nov 21 13:04:20 yea, just reading the blurb now - it’s used for caching Nov 21 13:04:33 but surely it’s something you implement as and when you have a specifric performance problem ? Nov 21 13:04:53 Some Android people have said that even in the simplest of cases you'll get a framerate drop without ViewHolder (or similar). Nov 21 13:05:01 normally not caching stuff is a performance problem Nov 21 13:05:09 frame-rate* Nov 21 13:05:19 getView is called so often when the list is scrolled. Nov 21 13:05:50 TacticalJoke, well lets think about this Nov 21 13:05:51 oh as views are reused they end up using getViewById alot? Nov 21 13:05:57 A view holder holds references to views Nov 21 13:06:08 custom views also hold a reference to the views within Nov 21 13:06:35 TacticalJoke: are you seeing poor frame rate on your device? Nov 21 13:06:37 both perform on N(1) when assigning data to a single item Nov 21 13:06:44 O(1) sorry Nov 21 13:06:49 samskiter: No, but key Android devs have said we should use it. Nov 21 13:07:05 My ListView will also contain a *lot* of data. Nov 21 13:07:29 TacticalJoke, key android devs also somehow managed to single handedly fuck up MediaPlayer Nov 21 13:07:30 And potentially a lot of views. Nov 21 13:07:36 with a hard coded buffer size Nov 21 13:07:40 TacticalJoke: it doesn’t sounds like it’s about the amount of data, but more about the complexity of each view for those datapoints Nov 21 13:07:45 so be careful what you read Nov 21 13:08:01 I think it's well established that using ViewHolder is good practice. Nov 21 13:08:02 hi, this is the error: http://pastebin.com/Ly0fVmg2 Nov 21 13:08:05 I saw data on this. I don't have the link now. Nov 21 13:08:13 (Or something like ViewHolder.) Nov 21 13:08:42 t0th_-_, you have the same dex files being added Nov 21 13:08:47 like 2 support libraries or something Nov 21 13:08:56 in this case Nov 21 13:08:59 google ads Nov 21 13:09:18 im assuming that 1 library you are using has included ads library within it Nov 21 13:09:30 if you are using gradle, exclude the module Nov 21 13:09:33 i am new on AS, this project i imported from eclipse Nov 21 13:09:34 and fix dependancies Nov 21 13:10:04 TacticalJoke: fair enough. i suppose it’s suggested on the android dev pages so i’d use it Nov 21 13:10:05 ok, kevel1 Nov 21 13:11:08 The new thing is RecyclerView, of course. Nov 21 13:11:12 But I'm afraid to touch that new stuff. Nov 21 13:12:59 TacticalJoke: why? Nov 21 13:13:40 The lack of documentation worries me. As do the bug reports I've seen. Nov 21 13:13:59 ListView is mature and it works well. Nov 21 13:14:30 RecyclerView works better Nov 21 13:14:48 Finally proper support for animations Nov 21 13:15:23 kevel1: working... thanks Nov 21 13:15:57 how can i change float[] values via object animator? Nov 21 13:18:29 I think it's well established that using ViewHolder is good practice. Nov 21 13:18:32 um, really? Nov 21 13:18:45 even after lasserix posted that link? Nov 21 13:19:02 yes Nov 21 13:20:19 ravilov: I meant "caching the results of findViewById is good practice". Nov 21 13:20:36 But, yeah, I prefer the look of the code in the link. Nov 21 13:21:04 yes, caching the lookup is a good idea Nov 21 13:21:25 ravilov: Do you always use the code in that link over ViewHolder? Just curious. Nov 21 13:22:15 honestly, I've never been in a situation so far to need to use the ViewHolder pattern, so I dunno Nov 21 13:22:31 K. Nov 21 13:22:35 but I can see the advantages of that code Nov 21 13:22:45 (linked, not the standard viewholder) Nov 21 13:23:01 With that custom-view code, my onClickListener stuff would be in the custom view. Hmm. Nov 21 13:23:08 If I went with lasserix's idea. Nov 21 13:23:20 wouldn't that be neat Nov 21 13:23:35 it would listen on itself :p Nov 21 13:24:50 ravilov: can you repost that link? curious about context of this conversation Nov 21 13:25:06 I've got it here: http://blog.xebia.com/2013/07/22/viewholder-considered-harmful/ Nov 21 13:25:13 TacticalJoke: thanks Nov 21 13:28:40 yeah, that's what I've done when I have ridiculously complex list item views Nov 21 13:29:58 though the onFinishInflate() is new to me Nov 21 13:33:52 anyone update android studio today? 1.0rc1? Nov 21 13:34:28 all my configs in app/build.gradle are grayed out as 'cannot resolve' Nov 21 13:34:35 A glance at the component structure reveals that it doesn't matter to the developer how complex it is, viewholders are still a simple approach to caching views Nov 21 13:34:44 Shitty blog post Nov 21 13:34:47 they still seem to work Nov 21 13:34:59 AS just doesn't seem to understand them Nov 21 13:38:44 Hi, I'm running a webapp (game) inside of a webview and it is hella slow on my samsung s5 but fast on older phones. It runs smoothly in chrome, kinda slow in the stock browser and hella slow in the webview inside my app. Are there any hardware accel-flags to set in the webview or similar? Nov 21 13:39:14 SimonVT, looks like today you disagree with just about anything :p Nov 21 13:39:57 I disagreed with that blog post the last time it was posted as well Nov 21 13:40:19 I'd rather handle binding data in my viewholder Nov 21 13:40:33 Especially now with RecyclerView Nov 21 13:40:46 are you disagreeing with the idea that viewholders are harmful or that the custom viewgroup is a good idea for complex views? Nov 21 13:41:11 Both Nov 21 13:41:17 If the sole purpose of the custom viewgroup is to bind data Nov 21 13:41:45 I think in that post the point was to also format the data, ie. manage childviews Nov 21 13:41:51 although I could be wrong Nov 21 13:41:54 Same thing Nov 21 13:43:24 With a custom viewgroup you often end up having to make it a framelayout to accomodate different layouts for orientation, device size, etc, and then you're just adding an extra layer to the view hierarchy Nov 21 13:43:30 RecyclerView crash with 0 items, how do I fix that? Nov 21 13:44:42 SimonVT, shouldn't make that much difference if I plan to have item layout inside a viewgroup anyway, right? Nov 21 13:44:45 Check your stacktrace, fix the issue Nov 21 13:45:01 yoavst: what SimonVT said Nov 21 13:45:02 :) Nov 21 13:45:10 yoavst, what johnflux said Nov 21 13:45:11 :p Nov 21 13:45:26 SimonVT: I mean Nov 21 13:45:32 users can delete items Nov 21 13:45:49 so 0 items is fine. but RecyclerView crash when I get to 0 items... Nov 21 13:46:03 It doesn't crash when I have 0 items, so you must be doing something wrong Nov 21 13:46:04 there must be another reason Nov 21 13:46:07 The stacktrace will tell you what Nov 21 13:46:29 ravilov: I don't understand Nov 21 13:46:29 SimonVT: If you were using ListView, would you ever use the custom-view pattern? Or would you always use ViewHolder? Just curious. Nov 21 13:46:37 java.lang.NullPointerException: Attempt to invoke virtual method 'void android.support.v7.widget.RecyclerView$LayoutManager.onMeasure(android.support.v7.widget.RecyclerView$Recycler, android.support.v7.widget.RecyclerView$State, int, int)' on a null object reference Nov 21 13:46:56 TacticalJoke: I'd always use a viewholder Nov 21 13:47:00 K. Nov 21 13:47:08 yoavst: You haven't set a LayoutManager Nov 21 13:47:10 hello, is there something unique to Samsung devices? All the time 90% of bugs I get is from some kind of Samsung device. Nov 21 13:47:11 Set a LayoutManager Nov 21 13:47:23 vegetablesalad19: There was that v7 bug recently Nov 21 13:47:24 . Nov 21 13:47:27 Are you using v7? Nov 21 13:47:37 since yesterday Nov 21 13:47:53 SimonVT, if I have a bunch of views that compose a single item and I want to have them inside a viewgroup (say a linearlayout), then it shouldn't matter much if I use my custom viewgroup (that also happens to bind data) instead of some stock one Nov 21 13:48:00 hi guys, why do certain themes for appcompat v7 not work when updating to appcompat support versions 21+??? Nov 21 13:48:15 so there should be no penalty or increased complexity there Nov 21 13:48:21 https://code.google.com/p/android/issues/detail?id=78377 Nov 21 13:48:23 That's the issue. Nov 21 13:48:50 Don't know much about it. Nov 21 13:49:23 TacticalJoke, thanks Nov 21 13:49:48 but even before this, i get more problems with Samsung than any other device Nov 21 13:50:09 perhaps there are more Samsung phones compared to other devices Nov 21 13:50:18 Yeah, there are many. Nov 21 13:50:32 hi have created a custom framelayout with the name of custom_layout.xml. Now in my main activity i would like to add this frame layout. how would i go about doing this? Nov 21 13:50:38 does #pragma pack work on Android? Nov 21 13:51:07 Tomaz^W: In java? Nov 21 13:51:11 huh Nov 21 13:51:18 pangelovski, set it as contentView ? Nov 21 13:51:40 ravilov: You achieve the same, sure. But arguing against viewholder is stupid imo. It is not a complex way to cache views. Nov 21 13:51:50 pangelovski, or create View class for your layout and attach it ? Nov 21 13:52:19 johnflux: no in native Nov 21 13:52:29 SimonVT, I think the argument in the post was not that it's complex, rather that it's inefficient Nov 21 13:52:39 It is not inefficient either Nov 21 13:53:27 vegetablesalad19: thanks Nov 21 13:53:33 If I want to create custom viewgroup, can I add the Viewgroup attrs from the merge tag? Nov 21 13:53:39 I tried the viewgroup approach, I didn't like it. I ended up having it be a framelayout, so it wouldn't matter whether I used linearlayout or relativelayout on my phone/tablet layouts Nov 21 13:53:50 Compared to a viewholder, that's inefficient Nov 21 13:54:52 I see Nov 21 13:55:04 with my layout, the toolbar is visible/slightly transparent and under the tab strip. how do i get the tab strip starting at the bottom of the toolbar https://gist.github.com/anonymous/ccfee5c1d04783fb236e Nov 21 13:55:06 It's much simpler to have viewgroup layout views, and have adapters bind the data Nov 21 13:55:23 why theirs lots of android libraries under BSD? (afai seen) [im trying to choose a license for my library] Nov 21 13:56:40 kuldeepdhaka: for freedoms sake Nov 21 13:56:48 choose by reading and understanding the terms of each license instead of going with what appears to be popular. Nov 21 13:57:33 bsd licence gives permission to do anything , including close it ans sell it Nov 21 13:57:52 I'd imagine apache is more popular for android libraries Nov 21 13:57:57 blah the answer is android:layout_below="@id/toolbar" Nov 21 14:01:07 Apache looks more interesting to me. Nov 21 14:01:35 and what's the difference ? Nov 21 14:02:04 https://tldrlegal.com/licenses/tags/Open%20Source Nov 21 14:03:54 afai noticed, "State Changes" and "Include Notice" Nov 21 14:07:35 hi, im trying to run the android virtual device from the SDK but I'm running into issues with libGL.... For whatever reason despite only having the 64-bit version of libGL, I get the following error: libGL error: dlopen /usr/lib/i386-linux-gnu/dri/swrast_dri.so failed (/usr/lib/i386-linux-gnu/dri/swrast_dri.so: cannot open shared object file: No such file or directory) Nov 21 14:08:24 and if I were to install libmesa-dri:i386 (to apparently solve that), it complains about "wrong elfclass ELFCLASS32"... so my hunch it's NOT supposed to use the 32 bit version.... Nov 21 14:12:34 Regarding the ViewHolder thing -- what do you folks think of something such as this? Seems simple to me: http://pastebin.com/mYgmaWdU Nov 21 14:13:17 Oops, my findViewById statements are the wrong way around. But it doesn't matter for the sake of this example. :) Nov 21 14:21:25 Hello people. Im willing to learn android development. I am already very familiar with java and mobile app development(iOS). I usually use netbeans to code my java projects, so I installed NBAndroid to support android. I immediately rejected it because it has no gui builder and I feel very comfortable with them. I then passed to official eclipse distribuited with sdk. Now I am surfing and reading that google is Nov 21 14:21:26 going to use intelliJ idea as new ide Nov 21 14:21:54 hi guys, i have created a FrameLayout that contains imageview. now both the framelayout and the imagevies have ids. How do i Reference the children from a class? Nov 21 14:21:54 The official Eclipse distribution with ADT sucks. Nov 21 14:21:56 otisZart: android studio is nearly at version 1 Nov 21 14:21:57 use that Nov 21 14:22:01 But the latest Eclipse doesn't suck so much. Nov 21 14:22:22 android studio and gradle build system is great Nov 21 14:22:24 samskiter that's what I was thinking. I am downloading that. I seriously hope it has a gui builder Nov 21 14:22:49 It does. Nov 21 14:22:52 So does Eclipse with ADT. Nov 21 14:22:57 Though I haven't used it much. Nov 21 14:23:03 yes it does. there are screenshots of it on the download page. all android-dedicated ides have a GUI editor Nov 21 14:23:08 what about android development in general? I read many controversy ...they say now you can develop android apps with html/php/java and others Nov 21 14:23:12 TacticalJoke: it’s very good and worth using Nov 21 14:23:17 otisZart you'll find the gui builder is pretty useless except for previewing the layouts you create in xml Nov 21 14:23:35 JacobTabak yes I love that part though, its just me :-) Nov 21 14:23:41 otisZart: You can use meteor-js and cordova Nov 21 14:23:44 otisZart: native is always going to produce the best results vs using some cross platform thing Nov 21 14:23:52 otisZart: or xamarin Nov 21 14:24:03 JacobTabak: what else would you want to use it for? Nov 21 14:24:05 Mrdarknezz I dont even know what you are talking aobut, I am going to surf and learn Nov 21 14:24:18 samskiter: You can probably get some good results if you use famous for gui interactions Nov 21 14:24:40 i've yet to see a good non-native app, so take that for what its worth Nov 21 14:24:41 Mrdarknezz: native is leagues above anything else i have seen Nov 21 14:25:02 I am really confused about developing for android. Can anyone simplify to me the situation? it seems you can build apps with js/php/html/java ? Nov 21 14:25:13 and you get a better experience as you use standardised system UI components Nov 21 14:25:24 otisZart: you use XML for layout and java for everything else Nov 21 14:25:24 but they provide a java ide afaik Nov 21 14:25:39 samskiter: Well yes ofcourse Nov 21 14:25:52 otisZart any non-java solution is garbage Nov 21 14:26:05 JacobTabak that's exactly what I thought Nov 21 14:26:19 I want to make a java app and I wanted to know if its the best place where to start Nov 21 14:26:21 JacobTabak: what about NDK or xamarin? Nov 21 14:27:18 Mrdarknezz: surely if you are *JUST* starting out with android, the place to start is Android Studio and Java Nov 21 14:27:27 not the NDK Nov 21 14:28:12 Sure, I was just interested in JacobTabak opinions Nov 21 14:28:38 Hi guysn I have an android app that is on the play store, im asked by my client tu put it on the amazon store too, are there things to do to sign and upload the app ? Nov 21 14:28:59 ah sorry. i agree with JacobTabak thought. Nov 21 14:29:17 Thanks for the opinions guys :-) I am reading many things about what you said Nov 21 14:30:05 even though non-java is avoidable, those solutions look pretty fine to me as well. I will stick with java to stay on the 'main road' anyway. How is support/documentation about the new beta ide? Nov 21 14:30:14 Mrdarknezz ndk is used for native libraries, not apps Nov 21 14:30:30 Oh right Nov 21 14:31:01 otisZart: pretty good. i’ve been developing with it for nearly a year now. the only gaps i’ve found were NDK/JNI integration. i doubt you’ll be touching that Nov 21 14:31:22 samskiter I am reading about NDK as well, and I think its not somethjing I will use soon Nov 21 14:31:24 JacobTabak: you can technically dev a whole app in the NDK. you’d have to be a sadist though Nov 21 14:31:33 otisZart: yes, forget about it Nov 21 14:31:46 probably a masochist :P Nov 21 14:31:54 :p Nov 21 14:31:59 ./wave kevingrant Nov 21 14:32:10 ok so, I can see activities in Nova Launcher can let you get a shortcut to choose playlist. I'm wondering if you wrote an app, can you make it open google Play Music to a certain playlist? and what the proper terms are for this to be able to google it Nov 21 14:32:40 So. I am willing to start with this sweet new ide. Any good resource for starters? I am not interestedi n java as I usually code java, but I totally ignore ANY code-rule in android environemnt, how things are done and how to wire them Nov 21 14:32:56 jeffers: you can do an “ok google, play some metallica” so presumably there is some intent to get it to do stuff. decompile the apk? Nov 21 14:33:14 otisZart: download it, press new project. Nov 21 14:33:14 yeah true. Nov 21 14:35:20 samskiter Ok ill trust you Nov 21 14:35:28 otisZart: go read about activities, specifically the activity lifecycle Nov 21 14:35:36 any one using android-x86 on vmware or virtualbox. i just installed android 4.4 r1. the settings screen is not like tablets. is their any thing else i need to do ? Nov 21 14:35:52 but yea, if you hit new project, the ide will write a load of boilerplate code for you and that should be pretty enlightening Nov 21 14:36:13 t2mkn i'm using genymotion Nov 21 14:36:18 Any ways to have setElevation() on pre-lolipop? Nov 21 14:36:31 which is x86 on virtualbox Nov 21 14:37:51 ya JacobTabak you had told me about genymotion couple of weeks ago. but m not using that right now, its from android-x86.org and installed in vmware fusion Nov 21 14:38:18 anyone here have experience with launching apps using voice commands? I'm having trouble with my activity meta data not showing up when using a voice command. Nov 21 14:39:07 looking around these distros, so want to confirm if it looks like installed in tablet or like on a mobile device with a bigger screen size Nov 21 14:40:08 Unfortunately 'android.support.v7.widget.Toolbar' doesn't have an elevation attribute. Yuck! :( Nov 21 14:41:03 If I call View.setTag, is there any chance the framework will erase my tag? Nov 21 14:41:06 napster: so it looks like you’ll need to have API level switching code? Nov 21 14:41:07 Why does my Action Bar have a shadow on Android Lollipop? I’ve set android:windowContentOverlay to null. Nov 21 14:41:08 On Lollipop, the action bar shadow is provided using the new elevation API. To remove it, either call getSupportActionBar().setElevation(0), or set the elevation attribute in your Action Bar style. Nov 21 14:42:05 samskiter Yes. Applying a shadow manually seems the only possible way Nov 21 14:42:27 support.v7.widget.CardView does have an elevation though Nov 21 14:42:29 strange. Nov 21 14:42:33 hmmm, no i managed to get one before Nov 21 14:42:35 it was related to themse Nov 21 14:42:41 try switching through a few of the common themse Nov 21 14:42:48 themes** Nov 21 14:42:55 samskiter You sure about this? Nov 21 14:43:03 (are you specifically talking about the actionbar btw?) Nov 21 14:43:20 i’ve definitely added a shadow to the actionbar via a theme in the past Nov 21 14:43:22 no, in general. Any views Nov 21 14:43:32 ah, then no. i don’t know Nov 21 14:43:56 I use a Toolbar as the actionbar since it is how Material design made available on pre-lollipop Nov 21 14:44:12 through AppCompat themes. Nov 21 14:44:26 oooh. interesting. citation? I’d like to have a read Nov 21 14:44:41 samskiter https://chris.banes.me/2014/10/17/appcompat-v21/ Nov 21 14:44:46 I use a LinearLayout as my action bar ;) Nov 21 14:45:59 shmooz: does trhat work with context menu stuff? Nov 21 14:46:17 yes Nov 21 14:46:24 Not one tester or designer on this project has ever used an Android app before :'( :'( Nov 21 14:46:25 even from fragments? Nov 21 14:46:45 and does ti work with the up/back buttons? Nov 21 14:46:52 and the nav drawer? Nov 21 14:46:59 I don't use actionbars or fragments Nov 21 14:47:09 samskiter He must be emulating and actionbar. per se. Nov 21 14:47:12 I'm using a path to create a line, I specify the width, height and radius. but the circle always "starts" from 3:00, I want it to start from 12:00... meaning i need to rotate it Nov 21 14:47:14 i just don’t understand why people need to reinvent the wheel. Nov 21 14:47:15 s/and/an Nov 21 14:47:27 like all the APIs are there and people have to reinvent them. Nov 21 14:47:45 yes and emulating fragments too Nov 21 14:47:52 samskiter Well, if things are not done flexible enough, some reinvention is required. :) Nov 21 14:48:07 yes, but so often i see like people jump to that WAY too early Nov 21 14:48:17 in both iOS and android Nov 21 14:48:24 right Nov 21 14:48:57 and if my designer tries to do something that’s totally iOS and not easy in android, i tell him and he changes it and it still looks good Nov 21 14:49:44 Since you have the option to ask your designer for another revision. Nov 21 14:50:10 i’m tired of working on and using poor iOS ports Nov 21 14:50:20 samskiter: custom is more lightweight and because you wrote it you understand and control and modify it better Nov 21 14:50:49 shmooz: no. custom looks worse, has higher maintainability, and doesn’t feel natural to users Nov 21 14:51:08 are you really saying you’re going to do a better job o an actionbar than the android team Nov 21 14:51:20 of course Nov 21 14:51:32 he must be. Nov 21 14:51:52 * samskiter despairs Nov 21 14:52:05 See in my case, "elevation" is out of question for pre-lollipop for now. The material design just became irrelevant. 85%+ runs on pre-lollipop. Nov 21 14:52:19 napster: are you the original napster? Nov 21 14:52:28 or someone else :) Nov 21 14:52:30 No, I got no mp3 Nov 21 14:52:36 I used to chat with the original napster on efnet Nov 21 14:52:38 come on napster , you can tell us Nov 21 14:52:44 when he was doing his program Nov 21 14:52:49 i just came off a project that literally reinvented, tabs, actionbars, navigation controllers (an iOS class) and a whole load of other stuff. it was a total night mare. it never ends well. do it like they meant it to be done. Nov 21 14:53:14 and only if you are really sure, make a custom control. Nov 21 14:53:15 * napster just lucky enough to get the nick all over the IRC Nov 21 14:53:27 Nov 21 14:53:40 is there a place I can find a list of common mistakes when making an android app? Nov 21 14:53:57 * otisZart cigarette while downloading sdk.. Nov 21 14:54:15 ChrisUK: apparently here :P i could enumerate a few for you now lol Nov 21 14:54:30 great Nov 21 14:54:33 go for it Nov 21 14:54:38 ChrisUK look at futurice best practice document Nov 21 14:54:42 just google it Nov 21 14:54:48 ignore the fragment stuff though Nov 21 14:55:04 otisZart: get ready to lose a lot of hair Nov 21 14:55:04 turning off config changes. i.e. not dealing with activity recreation when the phone is reorientated properly Nov 21 14:55:22 reinventing the wheel. Nov 21 14:55:28 misunderstanding the acitivty lifecycle in general Nov 21 14:55:32 misunderstanding intents Nov 21 14:55:33 shmooz cant wait :-) Nov 21 14:55:42 using the datastoreincorrectly (esp for images) Nov 21 14:55:47 I lost already like 20% because of java Nov 21 14:55:51 samskiter Talking about actionbar, I made one for one project as well. I just used Theme.NoActionBar and used one of my own. Nov 21 14:55:53 basically RTFM. Nov 21 14:56:16 napster: i’ve never seen the need. Nov 21 14:56:43 ActionBar was in that case not very customisable Nov 21 14:56:58 hmm, design smell Nov 21 14:57:54 so what about material design? is it a good choice? Nov 21 14:58:11 we got shown one design for an app with the nav drawer on the right and all the action buttons on the left (including a back button). tried to tell the designer he’d dont it all wrong and he got all defensive. basically hadnt read the manual. had no idea android devices had a physical back button. no idea the nav drawer is almost always on the left. no idea action buttons are top right. Nov 21 14:58:11 otisZart If your targetSDK is 21 :D Nov 21 14:58:19 otisZart: do it. Nov 21 14:59:01 samskiter He must be a left handed person. Nov 21 14:59:14 napster: lol Nov 21 14:59:34 hi guys, please have a look at this pic:http://pbrd.co/1vvZKux Nov 21 14:59:40 mm ... your opinions are not clear :D Nov 21 14:59:45 navdrawer on the right is a good idea actually Nov 21 14:59:54 using material design means breaking compatibility for older devices ? Nov 21 14:59:57 shmooz: maybe. Nov 21 15:00:14 but the level of “i have no idea about any android design standard” was too damn high Nov 21 15:00:38 otisZart kind of, (atleast for now) Nov 21 15:00:44 if I hard code strings into the UI Nov 21 15:00:49 because most people are right handed and have to first lift their thumb to the opposite edge of the screen and drag it out Nov 21 15:00:51 how to resize the button drawable of a checkbox irrespective of the png file I use as drawable? Nov 21 15:00:54 is that very bad Nov 21 15:01:01 so funny on the conf call enumerating the problems, mentioned the back button and he’s like “but without a button in the top left, how do users go back”. queue massive facepalming Nov 21 15:01:11 samskiter why then you believe it is as of now a good choice? Nov 21 15:01:16 it's easier to flick the drawer from the right side with your thumb Nov 21 15:01:19 http://pbrd.co/1vvZKux describes my problem well Nov 21 15:01:28 otisZart: when will you release your app? Nov 21 15:01:37 samskiter probably few months? Nov 21 15:01:40 bearing in mind a huge proportion of our app downloads right now are 4.4 Nov 21 15:01:44 you actually won’t be losing much Nov 21 15:01:54 and you’ll have a snazzy looking app Nov 21 15:02:12 with no “if api is this then do this” code Nov 21 15:02:22 really? my friends still have older than 4.4 .. but they are just ignorants Nov 21 15:02:26 shmooz If you have your navdrawer on right, and if you are right handed person, you will probably drop the device. :) Nov 21 15:02:31 yes but they don’t download apps Nov 21 15:02:57 what % would you approx give to material support ? Nov 21 15:03:01 napster: that too , that's why navdrawers will die, or already dying Nov 21 15:03:07 napster: i’m left handed and i have no problem with the nav drawer. the point is its a standard. breaking from standards is fine, but with careful consideration and good reason Nov 21 15:03:19 it's just a partial listview Nov 21 15:03:31 because, samskiter, I think its always better to provide the most updated way of doing these things Nov 21 15:03:37 otisZart Worth looking at : https://developer.android.com/about/dashboards/index.html Nov 21 15:04:10 exactly from which version is material design supported? Nov 21 15:04:18 otis lollipop Nov 21 15:04:30 napster: im not sure that is actually that informative Nov 21 15:05:09 samskiter you mean 5.0? it has not even come out? Nov 21 15:05:14 Do we have something better? Nov 21 15:05:42 otisZart 5.0 is released last month. Nov 21 15:05:51 otisZart: yes Nov 21 15:06:01 napster: our personal app install stats Nov 21 15:06:06 I own a nexus 7 2013 with 4.4 currently Nov 21 15:06:17 and i see far more uptake from 4.4 users than any other Nov 21 15:07:10 one my apps have 60% from 4.3 and 4.4 Nov 21 15:07:29 napster: that’s current installs Nov 21 15:07:38 but look at new installs Nov 21 15:07:48 this is a new release. Nov 21 15:08:04 when did your release? Nov 21 15:08:10 October Nov 21 15:08:31 why is turning off config changes a bad thing Nov 21 15:09:01 ciree: because it prevent you from using different layout resources in different configs Nov 21 15:09:14 i’ll got get a citation for you from romain guy Nov 21 15:09:41 Makes sense...but if you didn't care for changing the layout on config change, it would be okay right? Nov 21 15:10:24 ciree: i can’t find the ciations, but here is a good post http://stackoverflow.com/questions/7818717/why-not-use-always-androidconfigchanges-keyboardhiddenorientation Nov 21 15:10:33 basically there are far better ways of doing it Nov 21 15:11:46 thnkx Nov 21 15:11:49 i like you samskiter Nov 21 15:12:08 http://stackoverflow.com/questions/2620917/how-to-handle-an-asynctask-during-screen-rotation Nov 21 15:12:17 we will all die before sdk will be downloaded... Nov 21 15:12:19 see romain’s massively upvoted comment on the accepted answer Nov 21 15:12:27 our children will use our sdk Nov 21 15:12:44 ciree: also, go read about retained fragments. they are awesome Nov 21 15:13:06 otisZart thats right Nov 21 15:13:23 otisZart: I don't even think TacticalJoke started whining that early! Nov 21 15:13:45 time travel needs to be investigated very seriously Nov 21 15:14:14 I have a textview and a check box in my activity. the labelfor of textview is set to the id of checkbox. will clicking(or tapping) on the textview trigger the checkbox? Nov 21 15:14:47 how the label is set to id Nov 21 15:14:53 Hey guys Nov 21 15:15:25 checkbox has its own text. clicking on separate textview doesnt affect it Nov 21 15:15:37 unless youll do it in textview's onClick Nov 21 15:16:05 my adapters have this abstract method getItemId, why would I implement it? Nov 21 15:16:09 So I have a question regarding the facebook sdk. So I set up the login facebook button, and it worked at first (no crash-erino). now the thing is I deleted the cache of my app on my phone, and for some reason, after that, the facebook login wouldnt work anymore Nov 21 15:16:17 it would give the error that there is no key hash Nov 21 15:18:06 ciree: so when you egt an onClick you can identify the thing that got clicked? Nov 21 15:18:26 Nov 21 15:21:25 ciree: i never implemented that Nov 21 15:22:36 Ashiren: thnkx Nov 21 15:22:53 kot09: I had the same issue...for some reason it works the first time Nov 21 15:23:19 Basically, make sure you're using the right hash. I eventually had to put it into the my facebook settings Nov 21 15:23:38 The quickstart development hashes didn't work for me, so I have it in the android app settings Nov 21 15:23:53 ciree: how did you solve it? my hash key is still in the development key hash, and im pretty sure its not because I need a release key hash Nov 21 15:24:45 ciree: i created a test app, and it works fine now. but i want to understand how to make it work on my original app. where did you add the key hash? i only added it to the development key hash on the facebook page Nov 21 15:26:06 kot09: sec Nov 21 15:26:15 okay Nov 21 15:28:26 how the fuck do I censor stuff in osx? Nov 21 15:28:28 like a paint program Nov 21 15:28:53 MS was the shit Nov 21 15:29:00 brb going back to windows Nov 21 15:31:46 kot09: Nov 21 15:31:48 http://i.imgur.com/g4gB9df.png Nov 21 15:31:54 I had to add it on that page Nov 21 15:32:33 ^but that would be a release hash, right? Nov 21 15:32:36 not the development one Nov 21 15:32:42 or i can add both in that one? Nov 21 15:33:05 Thats my plan. No one here would tell me different Nov 21 15:33:17 I think the development hashes in the quick start are for the facebook sample apps Nov 21 15:34:07 ciree: isee i see... okay thanks! Nov 21 15:34:35 any idea how i could increase the accuracy of googles voice recognition? Nov 21 15:34:51 ciree: last question, to create a key hash, you need this: keytool -exportcert -alias YOUR_RELEASE_KEY_ALIAS -keystore YOUR_RELEASE_KEY_PATH | openssl sha1 -binary | openssl base64 Nov 21 15:35:14 your release key path, is im assuming, your ~/.android/debug.keystore path Nov 21 15:35:22 what about your release key alias? what's that Nov 21 15:37:03 Haven't gotten that far ;) Nov 21 15:39:06 nice, I have created my first project with android studio -> paged app -> ClassNotFoundException in GUI and the pager is not printed (i havent even added a single line of ocde yet) Nov 21 15:39:41 java.lang.ClassNotFoundException: android.support.v4.view.ViewConfigurationCompatFroyo Nov 21 15:39:59 Why am I getting an exception with a boiler project? Nov 21 15:40:24 ciree: okay thanks again :) Nov 21 15:49:24 fatal error, project can't be deleted. There are unsaved objects xxxD best error Nov 21 15:50:44 how to listen for button events in android? whether use onclick listener or ontouch listener? Nov 21 15:54:25 iLoveJava, normally you would want to use an onClick listener Nov 21 15:54:36 if you want to check for swipe events and similar use on touch instead Nov 21 15:54:40 hey guys, how to layout_alignBottom a child view with an external view, http://pastebin.com/LfJ8GG6z Nov 21 15:54:54 *? Nov 21 15:55:05 i thought onclick would only be called in the presence of an external mouse Nov 21 15:56:10 I haven't tried but can a PagerTabStrip enclose a ViewPager? Nov 21 15:56:21 thats typically what you'd do with it Nov 21 15:57:33 really JacobTabak? but http://developer.android.com/reference/android/support/v4/view/PagerTabStrip.html says otherwise. Nov 21 16:00:39 oh i misread what you said Nov 21 16:00:41 why would you do that Nov 21 16:01:48 I want the PagerTabStrip to show above the header but aligned at its bottom. You know for the header to appear behind the PagerTabStrip. Nov 21 16:03:18 hmm.. it throws an exception, says that the PagerTabStrip must be a direct child of a ViewPager. Nov 21 16:04:19 you can probably do what you want with gravity, margin, and padding Nov 21 16:04:36 Hello Nov 21 16:04:44 negative margin? >_> Nov 21 16:04:52 yeah Nov 21 16:05:03 is that a valid thing to do? Nov 21 16:05:07 yeah Nov 21 16:05:27 but if i were you i'd think very hard about if this is something you really want to do Nov 21 16:05:27 Is there a way to invoke a navigation drawer without swiping, from code ? Nov 21 16:05:39 if you just set the gravity to TOP, it will show the tab strip above the viewpager content Nov 21 16:05:53 I think the method is showNavigationDrawer() Nov 21 16:05:56 yes it does Nov 21 16:06:54 but I want the tabstrip to end where the header ends, guess I'll try applying negative margins. Nov 21 16:06:56 * Unknown0BC blinks Nov 21 16:08:21 Unknown0BC: openDrawer() and closeDrawer() methods on DrawerLayout? Nov 21 16:10:31 * Unknown0BC checks Nov 21 16:14:40 I just realized the approach is wrong and PagerTabStrip shouldn't be used, instead it OnPageChangeListener should be used for synchronization with a view in the header itself. Nov 21 16:15:47 arebelongtous haha Nov 21 16:27:36 razzledazzle, cool. Nov 21 16:28:25 Unknown0BC: =D Nov 21 16:30:18 Hi, I'm writing an app and I need to use the database. Is there any good database libraries available? Nov 21 16:30:50 I've looked into ORMLite, but I'd like to check some alternatives before settling on it. Nov 21 16:31:19 +patrisk: http://realm.io/ Nov 21 16:35:23 Hello ! Nov 21 16:35:34 stenosis: thanks. I'll check it out. Nov 21 16:35:36 good evening Nov 21 16:36:08 just searching for someone that can tell me why my chrome on android crash with no error Nov 21 16:36:12 patrisk: you’re welcome (-: Nov 21 16:36:13 and how i can get an error Nov 21 16:36:31 my chrome on desktop does not fails. Nov 21 16:37:04 I can understand the treatment I do is complex, but no browser crash. Chrome on android is the only one... Nov 21 16:39:35 <_Auron_> logcat tells you many things Nov 21 16:39:50 https://developer.chrome.com/devtools/docs/remote-debugging Nov 21 16:42:22 thanks ciree but the only thing the debugger tell me is Nov 21 16:42:29 "the remote crashed" Nov 21 16:42:43 And i'm like... OHHH You don't say! Nov 21 16:47:56 I have a background process and want to know if it is running for the currently logged-in user, of if the device has switched to a guest account or different user. I'm digging through the docs and can't find anything on this. Any ideas? Nov 21 17:02:02 hello, i am learning android dev and i need help understanding this code. it involves the super function. Nov 21 17:02:02 http://forum.xda-developers.com/coding/java-android/help-explanation-code-super-function-t2948497/post56939015#post56939015 Nov 21 17:02:40 an answer on irc will be great and i will be grateful :) Nov 21 17:03:00 saliceman: What is your question? Nov 21 17:03:46 one moment Nov 21 17:04:16 tylerea: for the code @ http://pastebin.com/8jUPRRWy doesn't the default case create an infinite loop if item is not action search or action settings? Nov 21 17:05:46 saliceman: No, because the code calls the super class method Nov 21 17:06:33 This code would be placed in a child class, and overwrites the parent class method. calling super... calls the parent class's version of the function. Nov 21 17:06:50 you are overriding a method, therefore you can change its behavior. calling super calls to the original method to run its code for method Nov 21 17:07:08 tylerea: this is the rest of the code: http://pastebin.com/XhVMsHyA can you explain what would be executed @ "return super.onOptionsItemSelected(item);" Nov 21 17:07:58 whatitis: i don't understand. could you explain what you're saying with my code? http://pastebin.com/XhVMsHyA Nov 21 17:08:04 please, and thanks for your help so far guys Nov 21 17:08:36 this is a common java question. you can google what super does Nov 21 17:08:53 i understand what super does, wait let me link what i read. one moment Nov 21 17:09:26 whatitis: i understood super from the the 3rd answer @ http://stackoverflow.com/questions/3767365/super-in-java Nov 21 17:12:03 saliceman: right, but your calling super.onOptionsSelectedItem, which is the parent classes onOptionsSelectedItem method, not its constructor Nov 21 17:13:24 return super.on... just calls parent method and that method returns a bool, so that return in your code is just returning true/false based on the return of parent method Nov 21 17:13:57 OHHH i see. i was missing the point all a long Nov 21 17:14:30 so in your overriden code, if conditions arent met with your switch, it defaults to the return of parent with same params Nov 21 17:15:40 http://arstechnica.com/information-technology/2014/11/how-google-inbox-shares-70-of-its-code-across-android-ios-and-the-web/ Nov 21 17:16:15 whatitis: i am still a little confused let me think of the question that i want to ask lol. thanks for your help so far. Nov 21 17:20:36 whatitis, ciree, tylerea: thanks for all your help. @whatitis i answered the question i wanted to ask by reading this in eclipse http://pastebin.com/RH3yt8Li specifically, Returns: boolean Return false to allow normal menu processing to proceed, true to consume it here. again, thanks for all your help! Nov 21 17:22:01 cool Nov 21 17:27:47 Here is my code to get oauth2 token (http://paste.ubuntu.com/9152462/) . But fetchToken always return null. What could be wrong? I add all permissions in manifest and I'm using google+ signin and scope is "oauth2:https://www.googleapis.com/auth/plus.me" Nov 21 17:32:23 oh, I like big complete books, but commonsware one is infinite :P Nov 21 17:32:53 hm, i is there something like rxjava blockingObservable mostRecent ... but just return the most recent item, not an iterable ? Nov 21 17:33:21 looked into rxjava today, seems nice the observable thingy Nov 21 17:33:29 g00s, .single()? Nov 21 17:34:06 Mavrik no thats quite different https://github.com/ReactiveX/RxJava/wiki/Blocking-Observable-Operators#single-and-singleordefault Nov 21 17:34:34 in that case the observable has to emit only one item or an exception is thrown :) Nov 21 17:34:38 oh, yeah Nov 21 17:35:07 only thing I haven't solved with RxJava yet is how to control sequences Nov 21 17:35:25 e.g. if I need only items 5-10, I don't want to trigger all emitters at the start Nov 21 17:35:45 that would be take() / skip() right ? Nov 21 17:35:57 heh, probably not :D Nov 21 17:36:15 g00s, yeah, I want that Nov 21 17:36:30 but I want it like if I say skip(5), I don't want it to actually get 5 items and throw them away Nov 21 17:36:41 (imagine stuff like CPU/IO intensive operations) Nov 21 17:37:25 Mavrik: then you do not want to use RxJava Nov 21 17:37:34 hmm yeah thats the thing, all these little operators in isolation are pretty easy but composing them gets tricky Nov 21 17:37:43 Mavrik: the nature of streaming operations is that you would discard the first 5 if you want to skip them Nov 21 17:38:05 g00s: you should check out Java 8 Stream API Nov 21 17:38:19 heh, i'm not using java 8 :D Nov 21 17:38:40 Napalm, uh Nov 21 17:38:44 you mean you dont have it installed? Nov 21 17:38:45 I disagree :) Nov 21 17:38:46 but ok. Nov 21 17:38:53 Mavrik: disgree to what? Nov 21 17:39:06 I find that limitation to be the most annoying in RxJava, that it is incredibly wasteful with CPU and network resources Nov 21 17:39:09 at least on Android Nov 21 17:39:39 Napalm, with the basic assumption that streaming operations have to be wasteful Nov 21 17:39:53 no they are not Nov 21 17:39:54 think again Nov 21 17:39:59 https://github.com/pfn/android-common/blob/master/src/main/scala/AndroidConversions.scala#L175 Nov 21 17:40:01 Mavrik: can you explain a situation where you think it is wasteful Nov 21 17:40:01 mmmm, yummy macros Nov 21 17:40:22 Napalm, anything that's CPU or IO intensive as I said Nov 21 17:40:36 Napalm, document page rendering, thumbnail generation, detail fetch from network, etc. Nov 21 17:40:51 ANYTHING that 1.) takes time (which makes RxJava perfect API) 2.) Does not always use all data Nov 21 17:41:53 Mavrik: I think you miss my point or I am not explaining myself well. What do you think the difference is with using RxJava and another method? Why do you think RxJava is CPU/IO wasteful Nov 21 17:44:14 P.S: I dont like RxJava per-se.. But the I think the ideal of a Stream API over the more conventional 'Halt and process' versions. Nov 21 17:44:25 considering you're composing N jobs, you can't just skip M without processing M, as the latter jobs depend on the prior... Nov 21 17:44:44 porting apps to the Nexus Player: do I really need to set every single view to android:focusable=false? Seems like there must be some better way... why would I want a basic TextView to focusable and editable anyway? Nov 21 17:44:48 then again, rxjava *shrug*; I don't use Nov 21 17:45:13 Chainfire: erm.. why not modify the textViewStyle in your theme? Nov 21 17:45:47 Hi. How I can setup Android Support Library from command-line ? Nov 21 17:46:09 pfn, but mine doesn't and that what annoys me Nov 21 17:46:30 I need to find a way to hack that in RxJava so I won't do those overblown workarounds for that Nov 21 17:46:35 Mavrik, then don't compose jobs that aren't related? Nov 21 17:46:56 pfn, uh. Nov 21 17:47:21 * pfn goes back to ignoring rxjava Nov 21 17:47:24 they probably do it all weird Nov 21 17:47:25 Just because something is not dependent on each other it doesn't mean they're not meaningfully related Nov 21 17:47:50 think functional programming - functions are not dependent but may still be composited meaningfully right? Nov 21 17:48:01 they do it all nice Nov 21 17:48:33 being able to do Thumbnails.skip(10).take(5).subscribeOn(computation).observeOn(mainThread).subscribe(draw) is awesome Nov 21 17:48:46 Mavrik, in FP you don't compose stuff that's not dependent... Nov 21 17:49:09 Does anyone else have a problem with the emulator where it will work fine for the first minute or two of use, but then the emulator screen will go completely black, and the only thing to do is close the emulator, and open up a new instance? Nov 21 17:49:15 I am having that issue Nov 21 17:49:37 pfn, I have a feeling you're deliberitely trying to misunderstand my point so you can argue. Nov 21 17:49:57 carczar, hmm, which host OS, which emulator? Nov 21 17:50:24 Mavrik: Windows 7 - android studio, how can i tell which emulator? Nov 21 17:51:03 running Lollipop Nov 21 17:51:36 carczar, check if you're running Atom image with HAXM Nov 21 17:51:41 that is, install HAXM from extras Nov 21 17:51:57 ugh, stupid macro bug Nov 21 17:51:58 carczar, also enable/disable OpenGL, there might be an issue there Nov 21 17:52:12 carczar: did you turn off the display timeout in the Android settings? if not tapping the power button on the emulator skin should wake it back up Nov 21 17:52:34 Mavrik: let me explain.. lets say you download an array of objects.. so you parse the stream. wait for all data. parse data and create model objects. then process said objects by looping through them for(int i = Math.min(length, 5); i < length; i++) and skip the first 5 that way.. or some such idea.. and in Rx Java you could have your input stream being read, parse, create-objects in one Nov 21 17:52:34 stream without waiting for the previous step to complete. Nov 21 17:52:40 Napalm: haha if it is display timeout..... >_< Nov 21 17:52:54 I am updating HAXM now and looking into the display timeout Nov 21 17:53:39 Mavrik: The fact is you can skip the first five before you even create objects for them. But its the nature of a stream of data that you cannot just skip. Nov 21 17:54:18 Napalm, yes, in theory Nov 21 17:54:28 in practice I'd rather not pay cost for creation of objects I don't need Nov 21 17:54:59 we're still on rather crappy mobile devices after all and RxJava really has an annoying tendency to create alot of work for GC Nov 21 17:55:12 Mavrik: agreed Nov 21 17:55:19 Mavrik: thats why I use my own stream api Nov 21 17:55:20 :D Nov 21 17:56:47 Napalm what do you think about the reactive-stream project? i took a quick looksy but still confused ;) Nov 21 17:56:52 I need to show loading icon in action bar and some tima in middle of screen in loolipop and appcompat v7: 21, give me some link or keyword Nov 21 17:57:49 g00s: it is confusing concept if you've not been working with FP before.. I think its their naming of things that messes me up Nov 21 17:58:13 g00s: anyway, conceptually its a neat idea.. but i dont like their implementation Nov 21 17:58:31 just trying to figure out how it relates to rxjava. how its the same, how its different Nov 21 17:58:51 what uses cases one is prferred over the other Nov 21 17:58:58 the usual 'domain discovery' :) Nov 21 17:59:17 Napalm, *grumble* :D Nov 21 18:00:44 farhad2161: add https://developer.android.com/reference/android/support/v4/widget/SwipeRefreshLayout.html and then setRefreshing(boolean) on the layout when you want to show and hide the progress indicator Nov 21 18:03:39 Napalm: is this a optimum solution? adding SwipeRefreshLayout just for using it's loading method Nov 21 18:03:57 why not use it for swipe refreshing aswell? Nov 21 18:04:34 farhad2161: example https://developer.android.com/samples/SwipeRefreshLayoutBasic/src/com.example.android.swiperefreshlayoutbasic/SwipeRefreshLayoutBasicFragment.html Nov 21 18:04:54 Napalm: i have only a button and i want to show loading when user click on it Nov 21 18:05:15 g00s Nov 21 18:05:25 i had something i wanted to tell you Nov 21 18:05:40 * Napalm waits for the declaration of love Nov 21 18:05:40 lol Nov 21 18:05:42 but now i can't remember it Nov 21 18:05:47 i love you napalm Nov 21 18:06:48 haha Nov 21 18:06:51 * Napalm blushes Nov 21 18:06:53 we all love Napalm Nov 21 18:07:01 * Napalm goes purple Nov 21 18:07:58 g00s: here is not #love channel Nov 21 18:08:53 this is the hate channel ! Nov 21 18:09:25 hello, can we use string-arrays in the name of buttons? Nov 21 18:10:15 for example, i need to make buttons of 0-9 Nov 21 18:10:42 and want to reference them with @string/ in buttons under a single name num Nov 21 18:10:52 Just an update.... it was the screen timeout.... jsut had to press the escape key to bring it back up. :/ Nov 21 18:12:20 teehee Nov 21 18:12:47 anyone? Can i do it or not? Nov 21 18:12:51 sippin on haterade Nov 21 18:13:30 theperfectpunk not sure.. but you can do it programmatically Nov 21 18:13:34 can it be done dynamically? referencing it with R.array.string-array in the program? Nov 21 18:14:31 trickonology: how to set button set in program/dynamically? Nov 21 18:14:34 *text Nov 21 18:14:39 set =text Nov 21 18:15:47 org.json.JSONException: Value -----BEGIN of type java.lang.String cannot be converted to JSONObject Nov 21 18:15:53 oops Nov 21 18:18:13 hey guys, I'm drawing a blank, what is the menu called that works with the menu/options button on the phone? Nov 21 18:18:36 not action bar menu, the one that appears on the bottom is what Im looking for Nov 21 18:19:32 KeyEvent.MENU or whatever? Nov 21 18:20:09 z4rd0z: you mean the Options menu? Nov 21 18:20:22 g00s pfn Nov 21 18:20:23 https://gigaom.com/2014/11/20/apple-ends-patent-war-on-android-deal-suggests/ Nov 21 18:20:25 :P Nov 21 18:20:26 :O Nov 21 18:20:31 yeah Nov 21 18:20:32 Here is my code to get oauth2 token (http://paste.ubuntu.com/9152462/) . But fetchToken always return null. What could be wrong? I add all permissions in manifest and I'm using google+ signin and scope is "oauth2:https://www.googleapis.com/auth/plus.me" Nov 21 18:20:48 On ics+ the menu button opens the action bar menu Nov 21 18:21:30 yeah I dont want it to open on the action bar Nov 21 18:21:43 SimonVT: doesnt it also do that on Honeycomb? Nov 21 18:21:58 Napalm i'll bet google paid a lot of money :) Nov 21 18:22:11 Are the honeycomb devices with a menu button? Nov 21 18:22:22 if (keyCode = KeyCode.MENU) return true; from onKeyEvent I think Nov 21 18:22:25 But yeah, probably Nov 21 18:22:30 z4rd0z: ^ Nov 21 18:22:48 I know some has to go in the menu.xml Nov 21 18:23:06 z4rd0z: explain what you are trying to do.. and perhaps we can help Nov 21 18:23:26 SimonVT: http://developer.android.com/reference/android/view/ViewConfiguration.html#hasPermanentMenuKey%28%29 Nov 21 18:23:45 SimonVT: docs say Android 3.0 but API to detect it only in ICS+ lol Nov 21 18:24:16 on the device it has an options button, app close and back button. The menu that opens when you press the options button Nov 21 18:24:29 basically trying to set an "about" menu item Nov 21 18:24:34 There's only the action bar menu. Pre-kitkat it was at the bottom, post-kitkat it's the action bar(/toolbar) Nov 21 18:24:36 hello everyone, if I want to make a delayed multiplayer game (like wordfeud or whatever) over TCP, I'm gonna have to restart the TCP connection every time I want to send a move, right? Nov 21 18:24:44 Assuming the device has a menu button Nov 21 18:25:23 hmm some dont .. that could be a compatibility issue Nov 21 18:25:32 perhaps Ill keep it in the actionbar menu Nov 21 18:26:43 2nd question. Can android studio be used for OUYA development? Nov 21 18:27:06 Jinxit: Not if you pool connections and set the keep alive timeout long enough Nov 21 18:27:29 what's the limit for the keep-alive? Nov 21 18:32:30 Jinxit: iirc its a system property so you can't depend on it, but if you use your own http stack you can set it yourself on a per-request (connection?) basis Nov 21 18:32:46 /s/depend on it/depend on it being constant Nov 21 18:34:19 tricky business Nov 21 18:35:05 Can anyone help me compiling with command line including support library ? I get unbound prefix here: " is it possible to pass parameters in events like onClick? Nov 21 18:35:55 theperfectpunk1: I use v.getId() method on a specified View to do this Nov 21 18:36:28 Maybe someone could help me with retrieving all contacts in my app described here: http://pastie.org/private/6j3j7pshp6owwnvgw8wkng Nov 21 18:37:49 I'm not understanding how to do this from tutorials. Nov 21 18:39:07 theperfectpunk1: yes remember onClick is just an interface Nov 21 18:39:18 theperfectpunk1: want an example? Nov 21 18:41:17 Does anyone know if I can access the applicationId from other parts of the gradle script? Nov 21 18:41:33 I want to append it to a string, just not sure how to get hold of a reference to it outside of the android block Nov 21 18:46:05 The tutorial teaches how to load Contacts into UI, but I don't want to display them in UI, only work with the data. Nov 21 18:46:25 skinux: so just work with the data? Nov 21 18:46:46 I'm trying to figure out how to load Contacts data without loading it into UI. Nov 21 18:46:50 skinux: just access them via the contacts content provider Nov 21 18:47:04 http://developer.android.com/guide/topics/providers/content-provider-basics.html Nov 21 18:47:19 Which would be ContactsContract? Nov 21 18:47:22 skinux: how does the Tutorial you are looking at get the data Nov 21 18:48:10 also: http://developer.android.com/guide/topics/providers/contacts-provider.html Nov 21 18:48:39 Clockworkant: define it externally — ext.myAppId = "blah" then you can reference it with ext.myAppId anywhere within script Nov 21 18:48:47 (define it outside android block of course) Nov 21 18:49:45 I'm not exactly sure how the example is doing it. I'm not understanding it. Nov 21 18:49:46 thanks hwrdprkns thats a bit of a pain as I'm using a different package name for different flavours, so I guess I'll have to just externalise the different flavours Nov 21 18:49:51 I sorta wanted to look it up Nov 21 18:50:11 There is an applicationIdSuffix for each build type... Nov 21 18:50:17 (and probably flavor) Nov 21 18:50:39 there is but then how do I access that from outside of the android block? Nov 21 18:51:41 android.buildTypes.yourBuildType.applicationIdSuffix Nov 21 18:53:04 hwrdprkns: how did you discover that? Nov 21 18:54:56 Clockworkant: Didn't really discover... more intuition than anything else Nov 21 18:55:09 I could be hella wrong tho Nov 21 18:55:29 I'll be reading those links. Thanks. Nov 21 18:55:37 ha! oh okie, I was hoping there was some secret docs I'd missed Nov 21 18:56:51 Hey, say i have this function https://dpaste.de/fURx#L and i want to change the contact photo once i get it, how do i do that ? Nov 21 18:58:43 Anyone know if getResources().getDimensionPixelSize(myReosurce) is slow/not cached? e.g. slow enough that I shouldn't be doing it in onDraw Nov 21 18:58:57 the photo is stored on the device memory (for example /sdcard/photo.jpg) Nov 21 19:01:09 onDraw shouldnt do any calculations or logic as much as possible. get dimensions in methods related to size. load as much outside ondraw in respective locations, and have onDraw just draw what is known Nov 21 19:03:53 theperfectpunk1: https://gist.github.com/slightfoot/ec93c09f7db39bc3414a Nov 21 19:04:35 so I built the .apk of my project and attempted to run it on my phone with apk installer. It says "App Not Installed" and won't completely install. any ideas? Nov 21 19:05:05 z4rd0z: why are you using an apk installer? Nov 21 19:05:19 how else would I install an APK? Nov 21 19:05:22 z4rd0z: just open the command line and do: adb install your.apk Nov 21 19:05:48 well if I want to give the apk to someone to test on their device theyd have to use an apk installer Nov 21 19:05:49 anyone ? Nov 21 19:05:52 should you initialise all variables in OnCreate rather than in declaration? Nov 21 19:06:02 hello Nov 21 19:06:08 easy question Nov 21 19:06:18 z4rd0z: yes, and "unknown sources" needs to be ticked in settings Nov 21 19:06:28 it is checked Nov 21 19:06:33 i have a db holding integers for money, where say 7.99 is represented as 799 Nov 21 19:06:56 whats the easiest way to get that to a string of 7.99 Nov 21 19:07:44 ChrisUK: well that depends really.. I assume you mean an Activity.. and if you have your own constructors on your Activity then you'll probably want to do it there so you get the right order. But most people do it in onCreate because the object creation is then bound to the life-cycle of the activity and not the java object Nov 21 19:08:04 it still says app not installed Nov 21 19:08:04 Napalm: that is what I thought Nov 21 19:08:20 How do you bring up the Regex checker in AS? Nov 21 19:08:28 I've used it before and now I can't find it Nov 21 19:08:31 if you do it in declaration like java allows then you might be fckd if the object is recreated Nov 21 19:08:37 does it have to be a signed release for this to work? Nov 21 19:09:34 gobl: Cursor c = /* from database */; String value = String.valueOf(c.getInt(c.getColumnIndex("money_col")) / 100.0); Nov 21 19:09:54 Napalm: I mean like int criticalMember = 0; Nov 21 19:09:55 z4rd0z: well its not installed.. so install it? Nov 21 19:09:59 in the declaration Nov 21 19:10:05 it wont install Nov 21 19:11:05 ChrisUK: well yes, if its static or volatile a good idea would be to initalize the variable up front.. but if your initialzing with the default value such as 0 for an int... theirs not much point. Nov 21 19:11:11 thank you Nov 21 19:11:41 hi is there a rule against naming an app similar to an already existing app? Nov 21 19:12:01 like "cat pictures" when there already exists "cat picture extravaganza" ? Nov 21 19:12:04 just dont infringe trademarks Nov 21 19:12:07 z4rd0z: no but it cant be unsigned. normally the apk is signed with your local debug keystore Nov 21 19:12:45 so I should give them the app-debug.apk? Nov 21 19:13:04 yes Nov 21 19:13:09 whatitis, can someone name an app exactly like mine? Nov 21 19:13:16 yes Nov 21 19:13:21 that sucks Nov 21 19:13:25 only package names need unique Nov 21 19:14:06 madprops: but if you trademark your name.. then no.. because they are infringing on your intellectual copyright Nov 21 19:14:08 quality and positive reviews win with same named apps Nov 21 19:14:26 madprops: here in the uk to get a trademark its £300.00 GBP Nov 21 19:14:33 Napalm, what if i publish my app first and then someone gets a trademark Nov 21 19:15:19 thats trademark law.. and its about previous works. you can invaldate their trademark because your 'work' came first Nov 21 19:15:59 create your name as a brand for your app. make it less vague as cat pictures, give it meaning and brand your app. just be creative Nov 21 19:16:13 thanks Napalm it worked Nov 21 19:16:20 hello guys Nov 21 19:17:09 I have two points in the map using the google maps, someone know how set automaticly a zoom to fit those two points Nov 21 19:17:39 two points is my location, and the target location, where I want to go Nov 21 19:17:44 some idea? Nov 21 19:18:11 is java 8u25 ok for android dev ? Nov 21 19:18:29 madprops: I think it is...I'm already using Nov 21 19:18:30 I think thats what my system is using Nov 21 19:18:34 PsciCOdeliXHAt: You can do it with one of their apis.. but I forget which Nov 21 19:18:40 yosemite? Nov 21 19:18:42 psci,have you read api docs&checked stackoverflow? seems like itd be a common question Nov 21 19:19:16 whatitis: Yes... Nov 21 19:19:16 PsciCOdeliXHAt: if i remember correctly you can make a lat/long rect and ask it to fit it Nov 21 19:19:25 godamn flash player Nov 21 19:19:35 every week it is out of date Nov 21 19:19:38 gobl: your still using it? Nov 21 19:20:06 youtube still uses it no? Nov 21 19:20:16 gobl I thought you could use HTML5 for youtube Nov 21 19:20:22 gobl maybe have to opt-in or something? Nov 21 19:20:44 psci, so what have you attempted and how did it go wrong or not work? Nov 21 19:20:59 Napalm: that what i dunno how to do...to fit! Nov 21 19:21:15 yeah probably... what a piece of junk... Nov 21 19:21:26 Hey, say i have this function https://dpaste.de/fURx#L and i want to change the contact photo once i get it, how do i do that ? Nov 21 19:21:30 the photo is stored on the device memory (for example /sdcard/photo.jpg) Nov 21 19:21:39 deja vu Nov 21 19:21:46 deja vu Nov 21 19:21:47 rsrs Nov 21 19:22:18 anyone ? Nov 21 19:22:25 mustafa666: its stored in the contacts provider as a stream Nov 21 19:23:02 Napalm: whats that mean Nov 21 19:23:11 Napalm: im kinda new to android developing.. and java .. Nov 21 19:24:11 mustafa666: http://developer.android.com/reference/android/provider/ContactsContract.ContactsColumns.html#PHOTO_URI or even PHOTO_THUMBNAIL_URI Nov 21 19:25:27 Napalm: how do i access this property Nov 21 19:25:43 mustafa666: one moment, example en-route Nov 21 19:32:06 Hi. Is it possible to cache file and images without having to request WRITE_EXTERNAL_STORAGE? Nov 21 19:34:14 Wulong, that's a strange question Nov 21 19:34:28 those two aren't really connected :) Nov 21 19:34:43 you have internal and external storage that can be used for anything Nov 21 19:35:59 suppose i have a relative layout containing 20 buttons and i want to add android:textSize="@dimen/abc_action_bar_stacked_max_height" property to each of them Nov 21 19:36:40 can i add a propert in Relative layout that can apply to all of the buttons? Nov 21 19:36:44 property Nov 21 19:37:12 theperfectpunk, no, you define a style for that Nov 21 19:37:44 Mavrik: can i apply the style to whole Relative layout? Nov 21 19:37:58 styles aren't inherited. Nov 21 19:38:22 as in, you can't apply a style to a viewgroup and expect it's properties to appear on children Nov 21 19:38:39 Mavrik: kk thank you anyways :-) Nov 21 19:39:31 Mavrik: I write file to /tmp and for that I believe I must request WRITE_EXTERNAL_STORAGE in the manifest. Nov 21 19:39:47 uh Nov 21 19:40:03 I'd like my app to need less permissions - if possible. Nov 21 19:40:13 If you have a hardcoded "/tmp" you're doing something VERY VERY wrong Nov 21 19:40:41 Wulong, http://developer.android.com/training/basics/data-storage/files.html Nov 21 19:40:49 Its for my generic .jar Nov 21 19:41:02 you have no business hardcoding paths into Android software Nov 21 19:41:16 use Environment.getCacheDir or Environment.getExternalCacheDir for temporary storage Nov 21 19:42:11 Ok thank you very much. Nov 21 19:42:16 none of those need permissions on new devices Nov 21 19:42:24 getCacheDir is on internal flash and never requires permissions Nov 21 19:42:36 getExternalCacheDir requires permission on some older Android versions Nov 21 19:43:28 I'll give it as parameters to my .jar Nov 21 19:43:43 hey, how can I partially override the back button Nov 21 19:43:50 Wulong, mhm Nov 21 19:44:08 basically I've got inner state which i don't want to just back all the way out of Nov 21 19:44:29 JakeWharton: do @OnClick annotations automatically work in fragments, even if i'm not injecting any vies? Nov 21 19:44:45 gobl, override onBackPressed(), do your stuff and then call super.onBackPressed() Nov 21 19:45:09 gobl, note that your question probably means that you're doing something wrong Nov 21 19:45:09 ok, so super.onBackPressed() will do default? Nov 21 19:45:22 gobl, since there are SEVERAL ways for user to exit your app withotu back button Nov 21 19:45:26 and you can't capture them all Nov 21 19:45:28 yes. Nov 21 19:45:31 achuinard: you have to call Butterknife.inject if you want things to work. Nov 21 19:45:39 i don't mind if they exit the app, Nov 21 19:45:41 jaynewstrom: thanks Nov 21 19:45:57 i just have an interior menu to a fragment Nov 21 19:45:59 probably this in onCreateView: Nov 21 19:46:00 ButterKnife.inject(this, inflate); Nov 21 19:46:06 and i just can't toss it out the window Nov 21 19:46:31 mhm, as long as you keep that in mind :) Nov 21 19:46:53 if anyone here does back-end, it seems like the newest chrome update broke Advanced Rest Client Nov 21 19:46:57 achuinard: i have no idea what "inflate" is, but it could be right. Nov 21 19:47:46 hey, just tested it Nov 21 19:47:53 it does the business thanks Nov 21 19:49:18 Napalm: hey :), do you have anything ? Nov 21 19:50:02 While I'm on the subject- how do i find out which activity I'm going back to? Nov 21 19:51:06 i want to throw a confirmation dialog on certain events Nov 21 19:57:45 What are some reasons why a GridView's emptyView would not show? isEmpty() in my adapter returns true, and the layout files heights are set to match_parent Nov 21 19:58:12 MarkyC: did you call setEmptyView Nov 21 19:58:26 achuinard: yep, and my empty view is not null Nov 21 19:58:34 are there adjacent in a linearlayout Nov 21 19:58:37 with the empty view starting as GONE Nov 21 19:58:40 are they* Nov 21 20:01:35 achuinard: I will check it's visibility now Nov 21 20:05:50 any idea when nice buttons are coming into AppCompat? Nov 21 20:06:00 nice buttons? Nov 21 20:06:04 material buttons Nov 21 20:06:07 how are the existing buttons not nice Nov 21 20:06:14 they're no material buttons Nov 21 20:06:18 those are some nice buttons Nov 21 20:06:20 mmm mmm good Nov 21 20:06:22 looks material enough for me Nov 21 20:07:31 just make them transparent and call it a day Nov 21 20:09:17 u crazy bro Nov 21 20:11:43 Napalm: ? Nov 21 20:11:50 sec Nov 21 20:19:33 material theme is just 200dp Nov 21 20:20:52 Napalm: if you dont have enough time to finish it or something, can u send me what u have so far ? Nov 21 20:25:23 mustafa666: https://gist.github.com/slightfoot/7023eeb3d92fc8ede341 Nov 21 20:28:30 Napalm: it looks too complicated right now Nov 21 20:28:31 lol Nov 21 20:28:50 mustafa666: let me simplify http://developer.android.com/reference/android/provider/ContactsContract.Contacts.html#openContactPhotoInputStream%28android.content.ContentResolver,%20android.net.Uri,%20boolean%29 Nov 21 20:30:44 there's this style="?android:attr/buttonBarButtonStyle" Nov 21 20:30:58 theperfectpunk: and? Nov 21 20:31:00 i want to include this in the style i'm defining Nov 21 20:31:15 along with some other items Nov 21 20:31:25 I'm not sure I follow Nov 21 20:31:25 how to do it? Nov 21 20:31:33 so extend it Nov 21 20:32:07 theperfectpunk: did you see I left you this earlier.. https://gist.github.com/slightfoot/ec93c09f7db39bc3414a Nov 21 20:32:08 or create new style with parent of whatever you want Nov 21 20:33:45 Napalm: regarding passing parameters in onClickListeners? Nov 21 20:33:52 yes Nov 21 20:34:01 read the title of the gisty Nov 21 20:34:22 Napalm: thank you Nov 21 20:35:40 whatitis: i tried putting this parent="?android:attr/buttonBarButtonStyle" in the newly created style but didn't work Nov 21 20:35:53 i used the statement style="?android:attr/buttonBarButtonStyle" in my button Nov 21 20:38:27 Question. I have a layout that I want to resize itself by a certain factor given its measured width Nov 21 20:38:52 does setting setMeasuredDimensions have any effect on the layout's values? Nov 21 20:38:57 theperfectpunk: you cant parent to an attribute Nov 21 20:39:43 matt_j: it should.. but that depends on the layout Nov 21 20:39:53 actually m a bit confused in style="?android:attr/buttonBarButtonStyle", in quotes isn't the style name? Nov 21 20:40:07 matt_j: simplest way is to extend ViewGroup and implement onMeasure and onLayout Nov 21 20:40:26 Yeah, but I'm not sure what to do exactly Nov 21 20:40:30 Napalm: how do i incorporate style="?android:attr/buttonBarButtonStyle" in the new stye? Nov 21 20:40:32 I want the view to resize itself to fac * width Nov 21 20:40:59 matt_j: can you explain exactly what you are trying to do and why.. making a ViewGroup might not be the best way Nov 21 20:41:37 basically I have a view that needs a height that is fac*measured width Nov 21 20:41:49 once it knows its width, I want to set the height Nov 21 20:43:18 I want the view to be taller on wider devices etc Nov 21 20:44:39 I'll keep playing with it Nov 21 20:44:45 matt_j: ok.. you want the view to maintain its aspect ratio? Nov 21 20:45:42 something like that, yeah Nov 21 20:46:35 well if you cant explain what you want.. how you going to write it Nov 21 20:46:47 Question Nov 21 20:46:54 you want the height to be a factor of the width Nov 21 20:47:11 if I call setMeasuredDimensions, will that apply to any fill_parent layouts contained in the view? Nov 21 20:47:17 no Nov 21 20:47:23 Okay, this is what I need to solve. Nov 21 20:47:35 no it doesnt sound like it does Nov 21 20:47:40 or would Nov 21 20:47:41 so, I can't call setLayoutParams from onMeasure, right? Nov 21 20:47:53 you could? but why? Nov 21 20:47:59 this all sounds totally fucked up Nov 21 20:48:00 lol Nov 21 20:48:06 That's why I'm asking Nov 21 20:48:10 just wait Nov 21 20:48:25 is this a layout your trying to size or a view Nov 21 20:48:42 ie) your trying to apply this behaviour to a framelayout? or an imageview or what? Nov 21 20:49:11 matt_j: ^ Nov 21 20:49:12 RelativeLayout. It needs to maintain a certain height, given its width. Nov 21 20:49:17 Question: according to the android dev docs: Activity.onTouchEvent(MotionEvent event) „Returns true if you have consumed the event, false if you haven't. The default implementation always returns false. ”…..So HOW can i determine whether the event is consumed??? Nov 21 20:50:00 Strat: i think you mis undestand the docs.. its saying YOU should return that value if you consumed the event Nov 21 20:50:28 so, how should i interpret ‚consumed the event’ Nov 21 20:51:01 Strat: what are you trying to do? Nov 21 20:51:01 Napalm: it didnt help Nov 21 20:51:09 mustafa666: what didnt? Nov 21 20:51:17 the link u gave me Nov 21 20:51:46 matt_j: RelativeLayout.. hmm.. yea, best to extend your own ViewGroup and wrap it Nov 21 20:51:54 matt_j: one sec Nov 21 20:52:04 Strat, "consume event" means no views on activities will receive it Nov 21 20:52:11 Napalm: Well nothing really, i’m trying to do an exercise about touch gestures, i want to delegate the event from onTouchEvent to a GestureDetector…but i don’t actually understand what ‚consuming ‚the event means Nov 21 20:52:12 mustafa666: well I cant help more if you dont elaborate on it Nov 21 20:52:15 Strat, touch event travels down and back up over view hiearchy Nov 21 20:52:22 and when first view handles it / consumes it it stops Nov 21 20:52:41 Napalm: i was hoping that there would be a function for it.. Nov 21 20:52:54 Strat: watch this https://www.youtube.com/watch?v=EZAoJU-nUyI Nov 21 20:52:56 Mavrik: oooh, so then why does the onTouchEvent method give me the option to return false? Nov 21 20:53:07 mustafa666: function for what? Nov 21 20:53:09 fff Nov 21 20:53:18 Strat, I don't understand the question Nov 21 20:53:29 for changing the contact photo Nov 21 20:53:35 Strat, you return true when you did an action connected to the event and don't want other views to do their thing Nov 21 20:53:42 that just gets the contact id and photo path Nov 21 20:53:44 * Napalm nudges Mavrik.. sometimes it feels like we talk to brick walls Nov 21 20:53:56 Mavrik: so then, in which situation should I return true from the onTouchEvent? Nov 21 20:54:02 i mean false, sorry Nov 21 20:54:10 Strat, then the touch event doesn't concern you Nov 21 20:54:19 Napalm: thank you for the link! I will definately check it out ASAP! Nov 21 20:54:23 Strat, e.g. you have a half-transparent view and only want to process touch events for non-transparent area Nov 21 20:54:53 Strat, or think of the ViewPager case... it looks trhough all touch events and passes them through... until it detects you're actually dragging. Then it stops passing them through and starts moving pages Nov 21 20:55:15 Strat, if you'll return true in Activity onTouchEvent no views (including buttons, links, etc.) will get that one Nov 21 20:55:29 Mavrik: incorrect Nov 21 20:55:32 (IIRC, don't remember if Activity is first or last) Nov 21 20:55:36 (probably last) Nov 21 20:55:37 Mavrik: its last Nov 21 20:55:51 yeah, it's first in onInterceptTouchEvent and alst in onTouchEvent right? Nov 21 20:56:03 first is the dispatch method itself Nov 21 20:56:06 but yea Nov 21 20:56:13 it travels the views first Nov 21 20:56:13 Mavrik: I see, iactually still don’t understand it fully…. Nov 21 20:56:17 and then lands in the activity Nov 21 20:56:37 Strat: watch that video.. it will all be clear after Nov 21 20:57:10 hmm, yeah, I avoid dispatchTouchEvent because that's a fast track to a mess Nov 21 20:57:35 Mavrik: perhaps, I've done some neato tricks with it Nov 21 20:57:51 mhm Nov 21 20:57:53 is there a book with app examples you would recommend? Nov 21 20:57:57 I learn better that way Nov 21 20:58:01 I'd like someone sane to look at that API and refactor it a bit though -_- Nov 21 20:58:13 Napalm: I will, hopefully tonight (it’s a long watch after all!), i’m sure it will help me understand using touch gestures better. For now, i assume in most cases i have to return true from Activity.onTouchEvent….do you agree? Nov 21 20:58:49 Mavrik: i think there should just be better documentation Nov 21 20:58:59 Foxandxss: -> Return true if you have consumed the event, false if you haven't. The default implementation always returns false. Nov 21 20:59:04 sh*t sorry Nov 21 20:59:08 I meant: Nov 21 20:59:08 Strat: no Nov 21 20:59:10 mhm, I'd like a little bit of reduced boilerplate around tracking touches Nov 21 20:59:20 Foxandxss: http://www.amazon.com/Android-Programming-Ranch-Guide-Guides/dp/0321804333 Nov 21 20:59:32 always makes a total mess inside my view classes Nov 21 20:59:53 (e.g. maybe add start touch X/Y to MotionEvent class and stuff like that) Nov 21 20:59:54 Mavrik: sounds like your doing it wrong Nov 21 21:00:03 hrmf Nov 21 21:00:07 Napalm: okay not in most cases, but in the cases where the touch gesture does concern me, as Mavrik explained earlier Nov 21 21:00:08 Ah, read that, it was good, maybe I have to read it again (did it one year ago or so) Nov 21 21:00:08 I doubt it Nov 21 21:00:15 unless Google is also doing it wrong in all their views :) Nov 21 21:00:48 Foxandxss: then the best thing to do is build on your knowledge…make an app, and add more features to it. Think of anything Nov 21 21:01:11 Foxandxss: by the way, how long did it take you to finish that book and did you read it from cover to cover? Nov 21 21:02:14 Uhm I don't recall, I barely remember some of the apps on it (criminal intent for example, which I think I still have on the AS apps directory) Nov 21 21:02:35 Oh, I do Nov 21 21:02:47 out of curiosity, updated_at 22 nov 2013 Nov 21 21:02:51 one year ago more or less Nov 21 21:03:47 Yeah, making an app is the best way. I just forgot some pieces. I like android but I always end leaving at aside to continue in my other projects :P Nov 21 21:05:02 is not recommended to use parcelable and serializable for the same class? Nov 21 21:05:42 what is not Nov 21 21:05:58 i need an object that is parcelable, but when i store it using json some few phone produce an Parcelable encountered IOException writing serializable objec Nov 21 21:06:55 follow guidelines of whatever library you are using Nov 21 21:07:56 its all mine using gson Nov 21 21:08:12 then quit conflicting your design Nov 21 21:09:02 parcelable is mandatory, it usually works but some LG phone produces the serializable exception Nov 21 21:09:14 1 error withhin 200 users Nov 21 21:09:56 based off others code. so you have to conform to what you are using. if anything maybe post some code and the trace of error Nov 21 21:13:41 Strat: oh, read it from cover to cover yes Nov 21 21:14:00 Foxandxss: how long did that take you? Nov 21 21:14:15 I don't really recall but.. a wekk? Nov 21 21:14:17 week* Nov 21 21:14:24 lol that’s fast Nov 21 21:14:54 I know how to program :P Nov 21 21:17:01 http://www.algorist.com/ Nov 21 21:17:09 The Algorithm Design Manual, 2nd Edition Nov 21 21:17:17 there are a lot of android books, but meh, some are bad. If I write one, I will put hell of examples :P Nov 21 21:17:47 well, thanks god it is algorithms and not css :P Nov 21 21:17:55 Hi, anyone here using Android Studio with SVN? I cannot figure out how to get the repository to delete files that I've deleted on my working copy. Nov 21 21:18:04 jokes aside, it is a good subject Nov 21 21:20:04 most books should just be references. if needing a chapter by chapter read itd be for complete beginners to get a concept but not fully understand everything. as most android books just seem to jump to catergories based on their ideas of an app. doesnt help much to follow page by page unless building exact same app Nov 21 21:20:33 yeah, that doesn't mean that any of those kind of books are wrong Nov 21 21:21:06 yea, just no need cover to cover unless complete beginner needing a concept Nov 21 21:21:28 otherwise there are chapters to use for reference based off your needs Nov 21 21:22:00 or mix both like commonsware's one in 3k pages :P Nov 21 21:22:27 commonsware was a lot of fluff last i looked at it. like 20 words / page, huge margins, etc Nov 21 21:22:39 once have grasp of concepts, no need for books. just google, unless need some bathroom reading :) Nov 21 21:22:52 If I have Fragment A inside Activity A, and Fragment A launches Activity B (which doesn't use fragments), can I have activity B communicate with Fragment A when someone does something in Activity B? Nov 21 21:23:12 there are topics were books serve well. I don't think any hard core c++ programmer hasn't read 'effective c++' or modern c++ Nov 21 21:23:13 Right now, I'm using startActivityForResult from Fragment A, and then returning a result from Activity B, but it sucks code-wise Nov 21 21:23:29 Is it OK to use an event bus on a background activity with a child fragment? Nov 21 21:23:37 who wants to scrap together knowledge of DSP from the web? thats stupid too :) Nov 21 21:23:41 g00s: they are mostly there: http://puu.sh/d06sN/2ec65d2d07.png Nov 21 21:23:43 g00s yes exactly for reference, not page 1 to X Nov 21 21:23:53 depend on the topic Nov 21 21:23:57 I am a book author myself Nov 21 21:24:08 achuinard, start activity for result Nov 21 21:24:12 and out of curiosity, I am writing a "reference" one this time Nov 21 21:24:16 good subject for that Nov 21 21:24:25 whatitis: but the code ends up being so clunky Nov 21 21:24:32 damn, the other one was reference as well, damn me Nov 21 21:24:35 reference yeah, that can be a web site :P Nov 21 21:24:37 I'd rather just have my list inside Fragment A be modifiable from Activity B Nov 21 21:25:04 reference books are great. dont need a book showing how to build one app. just show references of use of common api Nov 21 21:25:41 whatitis: g00s but all ends on the kind of reader, some prefers to read one concrete topic, others prefer full examples from A to Z Nov 21 21:27:12 anyone have any tips for learning java and android dev? seems daunting to think about creating a program that isn't efficient. any suggestions on how to write better quality code? Nov 21 21:27:37 achuinard, todo that you just need actvity b to talk to activity a, then act a talks to fragment Nov 21 21:27:41 okay, I will try to ask my quesiton in a different way Nov 21 21:27:43 saliceman: practice and failing Nov 21 21:27:57 whatitis: which is only possible through startActivityForResult and not reliable through an event bus, correct? Nov 21 21:27:58 I have a view in an adapter Nov 21 21:28:02 saliceman: good judgement comes with experience, experience comes with bad judgement Nov 21 21:28:13 I want it to be a certain height given the width of the table view itself Nov 21 21:28:34 achuinard, why even need activity b, cant it be a fragment in activity a? Nov 21 21:28:51 which image i need to run the emulator? Nov 21 21:28:58 the manager is trying to install all the images Nov 21 21:29:08 the image you want to test Nov 21 21:29:22 i don't know what to choose Nov 21 21:29:25 whatitis: well I have a two pane layout for activity a and id prefer this specific screen to always be 1 pane Nov 21 21:29:44 i suppose i could replace and hide Nov 21 21:29:48 but what does activity b do so special? Nov 21 21:29:51 yes Nov 21 21:29:51 Foxandxss: but say if you write something inefficiently how do you improve it? it's not like i can get someone to look over what i'm doing. only thing i can think of is googling and seeing if anyone has done anything similar and copying but that is limited. Nov 21 21:30:09 ok Nov 21 21:30:11 you can hkde show replace is what im getting at Nov 21 21:30:16 hide Nov 21 21:30:18 so i have activity a and fragment a starting b Nov 21 21:30:38 if I have fragment b replace fragment a, won't fragment a no longer be subscribed to event bus? Nov 21 21:30:42 saliceman: reading others code, doing more stuff apart from android (learning more languages and kind of applications always help), and just programming Nov 21 21:30:44 if b affects a, keep it part of a Nov 21 21:30:55 like a child fragment of a? Nov 21 21:30:57 even if you do web dev other day, you will learn how to do things which can be applied to java & android as well Nov 21 21:31:28 just a fragment of a, that has affect on what a shows when it displays whatever Nov 21 21:32:25 saliceman: how long have you been programming? Nov 21 21:32:42 a year Nov 21 21:32:56 not knocking multiple activities, but keep similar stuff grouped and in scope of a single activity. different activities used to be away to get results, but with fragments you can contain flow in a single activity if it is all related Nov 21 21:33:03 well i started a year ago, altogether i've actively programmed for maybe a few weeks Nov 21 21:33:35 saliceman: a piece of advice I would love to get 10 years ago: Don't worry THAT much for now, just DO, move on, keep doing things. That stuff you seek will come to you eventually Nov 21 21:33:37 Honestly there needs to be a good open source navigation manager that does all of this work for you in a single activity Nov 21 21:34:10 i'm a bsc student doing some programming on the holiday. i was planning to make a RSVP (speed reading application) because most of them on the google play store are bad but there's so much to go through lol Nov 21 21:34:25 Foxandxss: yeah, I think they key is to try to always improve -- not to try and get everything perfect Nov 21 21:34:34 the key* Nov 21 21:34:51 JesusFreke: Yeah, I am hell of perfectionist and that is hurting more that doing any good Nov 21 21:35:56 JesusFreke: what's freke btw? (curiosity) Nov 21 21:36:01 lastname? Nov 21 21:36:08 intentional mis-spelling of freak :) Nov 21 21:36:37 It's an old old nickname. see: http://en.wikipedia.org/wiki/DC_Talk#Jesus_Freak_.281995.E2.80.931997.29 :) Nov 21 21:36:37 I am Jesus, but not freak, or maybe I am? I guess so Nov 21 21:36:59 had no idea, heh Nov 21 21:37:07 I chose the nick back when that was popular Nov 21 21:38:13 Admit it, you just can't spell Nov 21 21:41:51 no gringos allowed! Nov 21 21:44:34 so I think I solved my problem Nov 21 21:44:37 but I don't like it Nov 21 21:44:48 bandaided it? Nov 21 21:44:54 I set the layout params in the adapter Nov 21 21:45:01 but it's using displaymetrics Nov 21 21:45:22 yea sounds bad Nov 21 21:45:29 I should set it to the width of the ListView Nov 21 21:45:41 I'm sure a better solution will come to you later after you move on. Whatever the issue is Nov 21 21:46:09 just provide multiple view types Nov 21 21:47:59 are you using a custom adapter? what was/is your issue with the views that get populated? Nov 21 21:49:56 just scrolled up, if wanting a a height based on width of list, that seems iffy. why does the containers width affect your datas width? Nov 21 21:50:10 height* Nov 21 21:51:32 height should be set to wrap content or match parent that the listview gives for height Nov 21 21:53:21 Hi I'm having some issues with http://pastebin.com/TNRL6AUq , I'm trying to fetch the hour/minutes from a timepicker and put them in a calendar instance, it should post a toast message if todays hour has already passed the current time Nov 21 21:55:12 and I believe its needed that I need a calendar, since I later use it to instantiate an Alarm Nov 21 21:55:28 seems you maybe comparing objects and not the times Nov 21 21:55:32 whatitis: The cell needs to be taller on wider screens, etc. Nov 21 21:55:56 actually it won't even be part of the adapter soon anyway since we want some parallaxing thing going on Nov 21 21:57:16 well disregard that last part Nov 21 21:57:43 essentially the cell is a big image pulled in from the server. It has to be centered and a certain amount of it needs to be visible Nov 21 21:57:54 on wider devices, it is visually cropped to much Nov 21 21:57:58 too* Nov 21 21:58:31 whatitis: compareTo takes to Calendat objects as parameters and returns -1 if the first is before the second one Nov 21 21:59:59 Quitta, this is what you're setting as the year in cal: https://developer.android.com/reference/java/util/Calendar.html#YEAR Nov 21 22:00:22 Constant Value: 1 (0x00000001) Nov 21 22:00:39 lol Nov 21 22:01:16 I thought those resembled the current year/month and day of the device Nov 21 22:01:28 how can I fill in the current year/month and day then? Nov 21 22:01:38 CONSTANTS never change Nov 21 22:02:14 can someone help me with this problem? Im trying to use picasso to fill a gridview with pictures. I can do it with strings, but i cant figure out how to do it with pictures. http://dpaste.com/06VK5TY Nov 21 22:02:44 oh man Nov 21 22:03:42 SimonVT: I didn't notice they were ocnstants. Thanks! Still I'm kinda stuck on how I should update my 'cal' object's hour and minutes :/ Nov 21 22:03:51 day: Picasso.with(context).load(blah).into(imageView) Nov 21 22:04:02 I didn't find a single setHour, setMinutes method for Calendars Nov 21 22:04:08 not iv.setImage(Picasso...) Nov 21 22:04:24 Thats why I'm doing it in such a nasty way Nov 21 22:04:30 hwrdprkns: hm but can i do it there? I thought i have to pass the iv further Nov 21 22:05:00 You use set(int, int) to set a single field Nov 21 22:05:11 quitta what methods does calendar have for setting a time. just follow those Nov 21 22:05:22 Should be easily googled Nov 21 22:05:24 day:http://dpaste.com/0CK3ZW0 Nov 21 22:05:49 hwrdprkns: it shouldnt really use getBaseContext Nov 21 22:05:58 if anything it should be parent.getContext() Nov 21 22:06:15 SimonVT: aha and thats why you need the constants for? Like set(YEAR,2014) Nov 21 22:06:20 it should be probs be ctx Nov 21 22:06:29 Yep :) Nov 21 22:06:48 Setting it to 2014 is kind of shortsighted Nov 21 22:06:53 hwrdprkns: it would be better if it doesnt even store the context Nov 21 22:07:00 hwrdprkns: i think i tried that already. the problem is that getBaseContext creates an error saying: The method getBaseContext() is undefined for the type CustomGridAdapter Nov 21 22:07:01 yah, it was just an example ;) Nov 21 22:07:09 lol Nov 21 22:07:11 i really need to understand this context thing :/ Nov 21 22:07:21 I didn't know that I should use the set function like that, thanks! Nov 21 22:07:22 day: use parent.getContext() Nov 21 22:07:24 as i said Nov 21 22:08:10 java is crazy....and people claim pointers were difficult to understand~ Nov 21 22:08:22 ASM is crazy Nov 21 22:08:28 no Nov 21 22:08:41 every line makes sense after reading the manual Nov 21 22:08:53 but this here...is madness Nov 21 22:09:33 day: its just your newbness to new concepts.. give it time Nov 21 22:10:08 i usually learn languages by copying stuff together...but i dont think this is working with java~ Nov 21 22:10:37 day: it wont really work with any OOP language Nov 21 22:11:01 yes. thats probably the reason why i dont know any oop :/ Nov 21 22:12:38 if you think asm is easy to understand, disassembly any complex application, and I challenge you to understand the full app from start to finish Nov 21 22:12:42 disassemble Nov 21 22:12:53 it ain't gonna happen Nov 21 22:13:20 pfn: theres a adifference between understanding things line by line and understanding the whole function Nov 21 22:13:25 so I tell my buddy about how I am taking the plunge into learning iOS this weekend while my gf is out of town. he is like, RUN AWAY. and I say, well, at least I am learning Swift and not ObjC. he says, "it's like ... when you're buried up to your head in sand in the desert", you can be like, "at least it's scorpions and not ants" Nov 21 22:13:42 day, then the same is true of java Nov 21 22:14:40 pfn: well i see things like. context() @Override Context declarations...and all i think is...yes yes i know some of these words :p Nov 21 22:14:50 I need to learn how to implement certificate pinning in android, but I'm having a hard time finding a clear example or tutorial. Anyone done this and could recommend a resource for it? Nov 21 22:15:00 day, same thing, learn the words Nov 21 22:15:02 and it's obvious Nov 21 22:15:09 asm is the same way Nov 21 22:15:10 learn the words Nov 21 22:15:30 Greenranger: the links from https://github.com/square/okhttp/issues/173 may help with that Nov 21 22:16:06 also, http://square.github.io/okhttp/javadoc/com/squareup/okhttp/CertificatePinner.html Nov 21 22:16:17 Greenranger: https://developer.android.com/training/articles/security-ssl.html Nov 21 22:17:03 Thanks all, I'll check those out. Nov 21 22:17:25 Greenranger also https://github.com/moxie0/AndroidPinning Nov 21 22:18:02 (and see the the blog) in the description Nov 21 22:18:26 you don't need a library to do pinning Nov 21 22:25:39 If one of my app's processes crashes (let's say OoM) that does not affect the others? Nov 21 22:25:43 correct? Nov 21 22:26:04 if multiple apps seperate, sure Nov 21 22:26:15 I mean one app, several processes Nov 21 22:26:19 of the same app Nov 21 22:26:36 separated with android:process="..." Nov 21 22:26:40 howd you get the seperate processes? services? Nov 21 22:26:53 oh man, how many proccesses can you have per app? Nov 21 22:27:01 is there a limit? Nov 21 22:27:41 if I kill -9 pid, it shouldnt affect other pids, except that if those other processes are linked and depend on another Nov 21 22:28:14 Anyone know any complex android apps that has a tutorial? Not really looking for open source app more so tut on how to make a complex or popular app Nov 21 22:28:24 youd crash from any exceptions you dont handle calling methods that talk to others Nov 21 22:28:31 IDK but I would guess for each activity/service you can have one hwrdprkns Nov 21 22:28:38 I don't get, I created a new project and when i try to run it I get "java.lang.NoClassDefFoundError: Failed resolution of: Landroid/support/v7/appcompat/R$styleable; Nov 21 22:28:38 " Nov 21 22:28:41 saliceman: if you find a tutorial on how to make a popular app lmk Nov 21 22:29:30 Lol :) Nov 21 22:29:42 whatitis: hwrdprkns; ok, I've made a test and crash my activity while wallpaperservice stays running. so good Nov 21 22:30:20 :) Nov 21 22:33:29 does anyone have experience with ads and memory leaks? http://stackoverflow.com/questions/27052601/interstitial-ad-memory-leak Nov 21 22:45:20 can i just say, how remarkably easy it is to program android Nov 21 22:45:26 is iOs this easy? Nov 21 22:46:23 gobl: you'll probably regret those words at a later date :) Nov 21 22:46:35 gobl: iOS is a different type of easy Nov 21 22:46:36 lol Nov 21 22:46:47 oh yeah, managing data is a bit of anuissance Nov 21 22:46:58 i decided to build my own orm Nov 21 22:47:07 oi Nov 21 22:47:24 but... do you use singletons to hold app data? Nov 21 22:47:37 or pass keys and write to db? Nov 21 22:47:52 g00s: it probably doesnt realise yet what problems he is getting into Nov 21 22:48:25 ah, bless, ignorance is bliss Nov 21 22:48:46 one of the biggest headaches of android programming is really just java on constrained devices with gc Nov 21 22:48:57 but my app is data centric so i have to go through many hoops Nov 21 22:49:10 ideally i'd be allocating 0 objects per event in places Nov 21 22:49:43 what amount of data do you push around? Nov 21 22:50:14 the other headaches, in no particular order, are bugs across android versions, weird lifecycles of things like fragments, etc Nov 21 22:50:26 gobl sensor data Nov 21 22:50:58 yeah thats probably quite bit of data Nov 21 22:51:22 once you use object pools, etc the things being pooled need to be mutable (so they can be reused) and then you have one tool less for concurrency safety Nov 21 22:52:47 well, considering i have no real java background Nov 21 22:52:54 i just hate null pointers at this point Nov 21 22:53:18 i still don't have a reasonable mechanism for dealing with them Nov 21 22:53:25 other than writing a billion checks Nov 21 22:53:27 the surround all with try and catch them al! Nov 21 22:53:51 ... and remembers all random subclasses and methods Nov 21 22:56:10 gobl: Optionals? Nov 21 22:56:10 If anyone uses the Gmail app, what's the new interface called? I've noticed many apps with the same theme and would like to apply it to my app Nov 21 22:56:21 Material Nov 21 22:56:43 yeah, its all over 5.0 Nov 21 22:56:51 zylum: http://www.google.com/design/spec/material-design/introduction.html Nov 21 22:57:07 but i don't think you can really apply it as a theme to sub 5 devices? Nov 21 22:57:17 can you? Nov 21 22:57:24 Yes Nov 21 22:57:40 whats the them you call? Nov 21 22:57:44 theme? Nov 21 22:57:45 pieces029: just what I was looking for, thanks Nov 21 22:59:29 sorry had a timeout Nov 21 22:59:52 gobl: I don't think there is a theme you implmenet, you use pieces for the support libs http://android-developers.blogspot.com/2014/10/implementing-material-design-in-your.html Nov 21 23:00:02 I'm gonna repeat my question since perhaps it might not be send the first time :D Nov 21 23:00:07 random question, is it me or is it possible that when you set an alarm and a while later you set another alarm with the same noification id, that only the last one will arrive? Nov 21 23:00:49 Napalm do you think its possible to put a tab widget in toolbar ? Nov 21 23:00:58 i guess i'll have to try Nov 21 23:01:13 g00s: yes, ive done it Nov 21 23:01:37 if alarms are set by id, then seems reasonable that the latter would be called Nov 21 23:02:04 Napalm ok, so i should be able to put SlidingTabs in there Nov 21 23:02:12 yes Nov 21 23:03:59 whatitis: I thought it would nternally keep it in some queue or something :) Nov 21 23:05:26 why use same id if different? Nov 21 23:09:13 ok, having toolbar woes, how do I set it to display my logo rather than a title? Nov 21 23:10:10 can't do it programmatically? :\ Nov 21 23:10:26 Toolbar.setLogo(); Nov 21 23:10:50 that's lame Nov 21 23:10:59 btw, i meant "have to do it programmatically? :\" Nov 21 23:11:04 no Nov 21 23:11:08 you can do it with styles Nov 21 23:11:13 i tried, couldn't get it to work! Nov 21 23:11:26 prove it Nov 21 23:11:54 are you talking to me? Nov 21 23:11:58 whatitis: ^ Nov 21 23:12:08 no him saying he tried Nov 21 23:12:08 i had something like this: http://pastebin.com/AQMeg8TB Nov 21 23:12:18 i also tried it without "android:" Nov 21 23:12:30 and then i tried setting the theme on the toolbar, but that didn't work Nov 21 23:13:00 JacobTabak: erm.. you have showTitle Nov 21 23:13:29 yeah, i also have useLogo Nov 21 23:14:00 (that worked before I switched to appcompat) Nov 21 23:14:04 so if remove showTitle... Nov 21 23:14:12 and you have no @drawable/blah Nov 21 23:14:22 that's declared in the manifest Nov 21 23:14:42 i can try adding it there Nov 21 23:14:48 do I need to set actionBarStyle still? Nov 21 23:14:53 or is setting the theme on the toolbar enough Nov 21 23:15:06 it depends on what your trying to do Nov 21 23:15:25 some customer just gave me an awful android project without gradle. what the hell Nov 21 23:15:52 AS project Nov 21 23:16:24 i'm just trying to get this to work the way it did before appcompat Nov 21 23:16:31 using the same styles Nov 21 23:19:29 building for a min sdk lower than 21? Nov 21 23:21:34 should bew easy to generate a gradle project from AS Nov 21 23:23:24 heyyyyyy Nov 21 23:23:29 left field question Nov 21 23:23:45 anyone know of the technology by which i could send a text from my server? Nov 21 23:23:57 gobl: Twilio comes to mind Nov 21 23:24:24 unless you're talking about running an SMS gateway? Nov 21 23:24:36 nah, small operation here Nov 21 23:24:52 twilio is practically trivial, very recommended Nov 21 23:24:57 i think that sounds decent Nov 21 23:26:28 * otisZart thought he was going to have a pleasant java-coding-time when thought 'why not learning android development' Nov 21 23:26:50 JacobTabak useLogo|showHome|showTitle Nov 21 23:27:08 i tried that Nov 21 23:27:21 mmmm this looks deliciously easy Nov 21 23:27:23 mmmmmm Nov 21 23:27:56 It’s funny when you have to e-mail developers in other countries. Google translate everything. Nov 21 23:28:15 Well I e-mail in English and I get what I believe is Korean to English Nov 21 23:28:23 JacobTabak is that your actionbar style? are you using Toolbaar or regular actionbar Nov 21 23:28:24 uh Nov 21 23:28:38 toolbar Nov 21 23:28:38 English is really needed for programming, not learning it is a bad idea Nov 21 23:29:27 tricknology: yeah... working at samsung was interesting in that respect Nov 21 23:29:34 hard! i won't use toolbar til the 4.2.2 samsung issue is solved. Also toolbar styles gave me headaches and i had to setup every style directly... it didn't take my style attrs Nov 21 23:29:42 lots of koreafied english emails Nov 21 23:29:49 so guys. My computer crashed. Now android studio gives me 30 runtime errors and mainActivity.java is filled by red exceptions Nov 21 23:30:06 like logo and some other attrs Nov 21 23:30:12 Well I mean they can use it but it’s all mangled. The idea comes across fine but it’s mechanically fucked. I think it’s hillarious and laugh for a second and then really try to get what they mean. Nov 21 23:30:19 what to do? I started today android development and now all the ide is stuck .. tried creating also a new project.. Nov 21 23:30:28 haha JesusFreke, I think it’s awesome Nov 21 23:30:38 Koreafied lol Nov 21 23:32:47 otisZart: that sounds pretty awful. honestly, probably delete & reinstall? Nov 21 23:33:34 otisZart: maybe try file->invalidate caches and restart Nov 21 23:34:00 ^ or that. I keep forgetting that exists. Nov 21 23:34:25 ill check all that toolbar issue later but last time it didn't work Nov 21 23:37:55 invalidating cache worked Nov 21 23:38:50 is there a resource that can explain well how things are 'done' and 'wired' in android development? I thought this was the hard part and in fact I am having troubles. My goal is to have a tabbed app with 4 tabs that each hold a list of articles cycled from a JSON file, and I'd like to put them in a tableview(or maybe not? I am coming from iOS development, do you think it should be done this way?) and clicking a Nov 21 23:38:50 row lets you read the whole article .. i'd like to build this simple app to start Nov 21 23:41:58 read up on fragments Nov 21 23:43:03 hi all I'm "a bit" new to this :) Managed to install apktools and figured out how to decompile, rebuild and sign an APK and it installs. Now, rebuilding only works if I decompile the apk without resources (apktool d -r ). When I try decompiling with just "apktool d", the later "apktool b" throws an error "cannot execute aapt". But "aapt" in a terminal actually works =? Nov 21 23:43:37 is there any other way to decompile/recompile resources, other/complement to apktool? Nov 21 23:44:03 yes, create the app yourself with your resources Nov 21 23:44:16 hey gordon_, thanks for your help yesterday Nov 21 23:44:54 i've got a json file I want to use in my app Nov 21 23:44:55 can someone explain to me what an activity is? Nov 21 23:45:03 is that whats on screen? Nov 21 23:45:03 I forget where static data goes? somewhere in assets Nov 21 23:45:09 gordon is unavailable, ill accept it, so yw Nov 21 23:45:11 tonu42: yeah, a screen you can say Nov 21 23:45:40 so like I have an app in design that I want new activities to show up when I select a tab or swipe Nov 21 23:45:50 with new content on each tab obviously Nov 21 23:45:57 sounds horrible Nov 21 23:46:05 but I'm lost and don't even know where to start Nov 21 23:46:11 whatitis: ok so the "cannot execute aapt" is misleading then, the actual error is there are no resources? Nov 21 23:46:12 to swipe or tab a new activity Nov 21 23:46:16 I would suggest reading some beginners book :P Nov 21 23:46:20 looks like I want is somewhere in app/src/main/res Nov 21 23:46:41 raw Nov 21 23:46:42 I'm not sure what I want is an activity Nov 21 23:46:48 assets Nov 21 23:48:54 http://i62.tinypic.com/289c5ko.png Nov 21 23:48:56 this is what I got Nov 21 23:49:24 But when I swipe or click a tab, its the same content Nov 21 23:50:14 Can someone tell me what the concept of making new content on a seperate page sort of so I can look it up? Nov 21 23:51:01 ahhhh Nov 21 23:51:04 fragments Nov 21 23:54:17 Does anyone know how to monitor the traffic of your own app? Nov 21 23:54:39 I'd also like to see some of the api calls SDKs are making. Nov 21 23:56:28 traffic as in network? Nov 21 23:56:37 Do I need API 20 (sdk platform stuff) along with API 21 to develop for wear things? Nov 21 23:56:46 whatitis, yes. Nov 21 23:57:27 monitor in what sense? you are the developer, how arent you able to monitor your calls? Nov 21 23:58:08 there is also TrafficStats class, gets restarted on boot Nov 22 00:01:09 whatitis, not if it's an SDK I'm using like Twitter SDK. Nov 22 00:01:25 Muchoz: DDMS has something you are looking for I think Nov 22 00:03:20 tonu42, it looks like it only shows when a connection is happening. I need more information than that like the url, headers, content... Nov 22 00:03:48 there is no app/src/main/res/raw folder (i'm using gradle btw) Nov 22 00:04:00 do I just create one and drop my json file in there? Nov 22 00:04:10 point is, I want to be able to open that file in my app Nov 22 00:04:23 yap Nov 22 00:08:56 yup Nov 22 00:09:35 Question: let’s say I have a Bitmap that I draw with a canvas.The bitmap consists of a Baskbetball bitmap resource file. How can I detect whether I have tapped anywhere on that Baskbetball, after it was drawn on screen? Nov 22 00:10:17 getResources().openRawResource(R.raw.resourceName) Nov 22 00:10:26 Strat: implement onTouchEvent in your View Nov 22 00:12:09 yes, i have that, but then what? Nov 22 00:12:32 check to see if the x,y of the event in in your basketball's drawable bounds Nov 22 00:15:56 Strat do watnt o listen to any event on the ball or a click? Nov 22 00:16:01 (down and up) Nov 22 00:16:48 http://www.java2s.com/Code/Android/UI/AddingTouchListenertoImageView.htm Nov 22 00:16:51 Strat^ Nov 22 00:16:56 Napalm: exactly that, how do i check the basketballs’s drawable bounds? Nov 22 00:17:45 tricknology: thnx for the help, but i’m actually trying to get to know the bounds of the baskbetball. I already have got the x, y coordinates of the tap Nov 22 00:18:13 is the image a circle? Nov 22 00:18:17 I need to see whether the x, y coordinates of the tap are withing the bounds of the basketball on screen (the basketball is anywhere) Nov 22 00:18:22 tricknology: yes Nov 22 00:18:38 do you have the location and radius of the basketball? Nov 22 00:18:48 i do have the radius Nov 22 00:19:09 you can get a range of x and y coordinates that the basketball occupies Nov 22 00:19:26 I know i need to do something with the radius and the location (of the center of?) the baskbetball, but not what exactly or how Nov 22 00:19:41 I’d just be guessing from here Nov 22 00:19:53 becuase I havent acutally done that but you can apply some math Nov 22 00:20:26 oh hey,,, look at that Nov 22 00:20:27 http://stackoverflow.com/questions/6896173/detecting-if-a-mouseevent-from-ontouch-is-inside-a-circle-drawn-to-the-canvas-of Nov 22 00:21:47 so you are getting the distance of your touch from the center of the circle and comparing that with the radius Nov 22 00:22:02 are you drawing a 3D basketball?! Nov 22 00:22:20 good question.. Nov 22 00:22:30 no 2d hwrdprkns, sorry for not specifying Nov 22 00:22:42 that would have blown my mind Nov 22 00:22:43 and thank you tricknology, i think that way should solve my problem Nov 22 00:22:53 :) np Nov 22 00:23:20 I’ll try do ipmplement it like the link you provided!! Nov 22 00:23:26 implement* Nov 22 00:24:34 woah man android is so beautiful to work with! Nov 22 00:28:36 Strat: drawable.getBounds(); Nov 22 00:30:17 Napalm: thnxxx!!! Will try both methods! (using getBounds() and as the way is suggested in the link provided by tricknology) Nov 22 00:31:46 I've added some new IAPs in the Play console... approximately 12 hours later, they're still not showing up with getSkuDetails ... any ideas? other IAPs are showing up. Have cleared caches. Nov 22 00:45:40 Hi, I was wondering I have a ListActivity that has a onCreateContextMenu() to create a context menu(long click) for each view in the list and has a onListItemClick() for fast single click, however the fast click doesn't work anymore with these 2 enabled Nov 22 00:45:50 is there a fast way to fix this issue Nov 22 00:45:57 I believe i has to be common :/ Nov 22 01:11:27 Wow weird, my onListItemClick() worked as a charm before, and since I tried to add onCreateContext and removed it emmiately again, my onListItemClick doesn't work anymore. Nov 22 01:11:43 I have exact the same code as before where it worked. Nov 22 01:12:08 does the onCreateContext and registering for contextmenu's change something persistent? Nov 22 01:41:03 adq: getaddrinfo returns -2 Nov 22 01:59:09 This android app relies on a JSON document. This document is mostly static, and should not change very often Nov 22 01:59:44 but also, I have to process it. So right now, I pull it from a website, and process it with a python script Nov 22 02:00:11 I'm wondering, should I write my app so that it checks for updates and processes it all on the android device? Nov 22 02:01:51 or I could include the json file as a raw resource, and update this file myself and recompile when it's updated Nov 22 02:05:04 you can just compare size or something like a kind of checksum to compare, if not equal then download a new one Nov 22 02:05:08 include it as an asset and update it from the Internet Nov 22 02:11:20 hmm Nov 22 02:11:36 Is there a place i can browse the code without downloading the entire thing? Nov 22 02:11:43 I want to find the implementation of getaddrinfo Nov 22 02:15:45 jedix: if it's java, grepcode works pretty well Nov 22 02:16:15 well in case this wasn't clear, I'm going to restate it Nov 22 02:16:55 I have an activity that loads multiple fragments. When I press back while viewing the first fragment, it takes me to the blank screen from when the activity first loaded. How can I remove that from the backstack? Nov 22 02:16:58 I'm not sure if a) the app should handle updates itself, or b) update the data by including a new resource file with the apk Nov 22 02:17:15 the data changes probably a few times a year, if that Nov 22 02:17:35 Groxx: it's native Nov 22 02:17:45 getaddrinfo fails Nov 22 02:18:12 (-2) Name or service not known Nov 22 02:18:44 jedix: probably here? https://android.googlesource.com/platform/bionic/+/e919b11/libc/netbsd/net/getaddrinfo.c Nov 22 02:19:15 android.googlesource.com isn't a great browsing interface, but it does have everything on it. I typically google for the file / method name, and follow links to there. Nov 22 02:19:52 RustyShackleford: it is probably considerably easy to repackage the app with the data than develop an entire API for syncing data. However, will it cause problems if people don't update their apps? Nov 22 02:20:30 Groxx: thanks Nov 22 02:21:04 cobar: well somewhat I guess. I've never put an app in the app store, so I'm not familiar with the update process Nov 22 02:21:15 seems like they would have to willfully avoid updates, right? Nov 22 02:21:41 i know that most of my apps auto update Nov 22 02:22:04 pretty much, it would only be an issue if they specifically opt out of updates or you upgrade the app so it no longer works on older devices Nov 22 02:23:19 you can always add in-app updating later Nov 22 02:30:23 alright then I'll proceed with strategy B then Nov 22 02:30:52 and maybe I can write a cron job that will email me when my app needs an update Nov 22 02:31:21 having to update your app because some. data changed is pretty lame Nov 22 02:31:43 can the data for v1 is easy though Nov 22 02:33:33 pfn: well thats the best solution I can come up with Nov 22 02:33:55 programming would be alot easier if data sources were better Nov 22 02:34:20 working around a unorganized or otherwise bad source of data is no fun Nov 22 02:38:41 I don't understand why qicr has some weird crashes on 2.3,its like they use some custom launchers that run my non-main activities Nov 22 02:39:43 like I had activities that only ran on api11 and up, but they still ran and crashed on gb Nov 22 02:40:01 finally went and disabled it for gb Nov 22 02:40:09 * pfn shrugs Nov 22 02:58:08 what the.. Nov 22 02:58:10 EAI_AGAIN Nov 22 02:58:18 what is that about?! **** ENDING LOGGING AT Sat Nov 22 03:00:00 2014