**** BEGIN LOGGING AT Sun Nov 23 03:00:00 2014 Nov 23 03:00:18 finally got it working Nov 23 03:00:22 that took longer than it should have Nov 23 03:00:38 oh well, smooth sailing from here \o/ Nov 23 03:26:33 bankai_au, so when are you gonna jump on roboscala? Nov 23 03:26:52 when i get time to learn scala :P Nov 23 03:26:59 I'd consider looking at it if I ever want to write for ios Nov 23 03:27:05 which is basically never Nov 23 03:28:06 scala is easy, step #1 use it as a better java Nov 23 03:28:20 Intellij 14 makes scala on Android easier too Nov 23 03:29:06 my sbt plugin is effectively standardized now due to native support for it in intellij Nov 23 04:09:03 anyway I can have the logo in my action bar overflow into the content? Nov 23 04:09:15 think the tail of a y going below the bottom border Nov 23 04:13:44 g00s: ! Nov 23 04:13:53 anyway I can have the logo in my action bar overflow into the content? Nov 23 04:14:13 hello Nov 23 04:33:02 use a custom view and turn off clip to parent bounds Nov 23 04:33:46 thanks, didn't know about clip bounds Nov 23 04:34:36 How can I reuse fragment instances? Nov 23 04:58:31 " A Boston man faces a laundry list of charges he allegedly stripped naked, climbed into the ceiling of a woman’s bathroom, fell onto the floor and assaulted an elderly man at Logan Airport." Nov 23 04:58:49 fucking east coast Nov 23 05:01:07 hmm Nov 23 05:05:56 why was elderly man in womans restroom.. Nov 23 05:06:25 fell through in the mens side Nov 23 05:06:31 and how did he fell out of the ceiling into an airport ? Nov 23 05:07:54 east coast problems, more like mentally disturbed without help Nov 23 05:11:22 g00s: get off the TMZ and get back to coding! Nov 23 05:14:47 Wasn't there some crazy west coast lady stacking her boyfriend climbed down his chimney got stuck and was rescued hours later when a passerby heard her crying? Nov 23 05:14:54 *stalking Nov 23 05:15:28 yah, not an East/vs West thing ... just stupid people tricks :p Nov 23 05:17:18 capella i'm east atm :) Nov 23 05:17:22 * g00s hates it here Nov 23 05:17:44 Do my homework for me? Nov 23 05:19:04 i think everyone hates it here actually Nov 23 05:19:22 * capella wants to move to MountainView Nov 23 05:20:03 what's wrong with east? snow? ;) Nov 23 05:20:17 Heh , chuh Nov 23 05:20:24 east coast rap is cooler Nov 23 05:21:54 I like nyc Nov 23 05:22:08 shmooz they have more depressing things to write about Nov 23 05:22:17 = substance maybe ;) Nov 23 05:22:29 nyc is a shithole Nov 23 05:22:39 New York New York big city of dreams, and everything in New York ain't always what it seems ... Nov 23 05:24:35 Don't push me cause I'm close to the edge, I'm trying not to lose my head! Nov 23 05:25:14 g00s, doesn't like anything unless it's the middle of nowhere, Nov 23 05:25:20 nyc always reminded me of gotham Nov 23 05:25:54 if there's a possibility of being spotted by another person, g00s don't like it, afraid for that privacy Nov 23 05:26:25 man i was bummed that wu and teachout lost against cuomo Nov 23 05:27:33 I know my way around in NYC thanks to Grand Theft Auto 4 Nov 23 05:27:42 ha Nov 23 05:27:58 yeah dont break down, car stripped < 1 hr ! Nov 23 05:28:58 trying to figure out how to get on those bridges so you can cross is a big rat puzzle Nov 23 05:29:40 during heavy rains main roads turn into rivers, you're expected to just drive thorugh it lest you hold up traffic, nm it might destroy your car Nov 23 05:30:05 "alligators" Nov 23 05:30:08 some of those dips on the parkways turn into little ponds Nov 23 05:30:32 who you callin a dip? Nov 23 05:31:45 in AZ they tell you not to go in the washes, long island distressway its like faster, you're holding up traffic Nov 23 05:31:52 (when flowing) Nov 23 05:56:46 erm. using android icons fo rmenu, where would i put the icons pack? in android studio? Nov 23 06:20:01 ahah. figured it out. Nov 23 06:34:46 I have a credential manager class that needs to be accessed across multiple activities. I use a static method getInstance(Context c) to initialize a singleton credential manager. The credential manager use shared preference as the backing storage. to initialize the shareprefs, i need a context. I'm not sure in which activity the credential manager will get initialized. Is there any better solution than initializing it in all activities? which may lead Nov 23 06:38:34 i dont understand. it initializes itself on getInstance, so it shouldn't matter which activity initializes it Nov 23 06:39:07 if you pass in a context, and want to make sure you're not leaking it, you can say context.getApplicationContext() .... Nov 23 06:39:24 dont we need a context to pass in? Nov 23 06:39:25 and use that one for initialization Nov 23 06:39:45 yeah, pass in context, and then just use context.getApplicationContext() Nov 23 06:40:26 I get it that it does not depend on activity. but.. Nov 23 06:40:45 If i use a utility class to store the instance of sharedpreference.. Nov 23 06:41:27 thats fine Nov 23 06:41:32 let me pastebin an example please hold on.. thanks in advance g00s Nov 23 06:45:05 is there any reason why the right hand and lower edges of a 9 patch would disappear almsot immediately after drawing it? Nov 23 06:45:12 just the border part Nov 23 06:45:21 the entier text contents is still drawn Nov 23 06:50:51 g00s, I think I found it. thanks for your help Nov 23 07:08:48 I still gotta figure out this nine patch crap as well Nov 23 07:10:21 I tried modifying one with the 9 patch tool and the results were not what I expected Nov 23 07:10:31 this used to work and 9 patch is really simple as long as your patch is sane Nov 23 07:10:57 i just creatd my patches by hand using gimp Nov 23 07:11:22 I couldn't even mess with an already working one Nov 23 07:11:24 this is code that ive not touched in a while because it works Nov 23 07:11:44 the patch is displayed just fine but a half a second later the right and lower borders disappear Nov 23 07:12:21 maybe there's some visual 9 patch tutorials on youtube Nov 23 07:13:53 found one, I should have this mastered in 3 minutes now Nov 23 07:13:59 http://www.youtube.com/watch?v=MQRA9nwxU7g Nov 23 07:16:41 that vid is good Nov 23 07:16:54 the marker lines show android which parts of the png it is allowed to scale Nov 23 07:17:19 the horizontal and vertical marker lines intersect in the middle of the png Nov 23 07:17:50 the png can be stretched vertically but the corners of the png that do not have marker lines next to them will not be scaled Nov 23 07:17:57 9 patch isnt difficult Nov 23 07:18:32 my pathces are fine. its after they are drawn something is buggering them up Nov 23 07:20:18 How do I achieve this layout without nesting? http://developer.android.com/images/training/layout-listitem.png Nov 23 07:20:35 I realise it'd be easy with two LinearLayouts, but I want to avoid nesting as much as possible. Nov 23 07:20:42 The article talks about doing it but never shows how to do it. Nov 23 07:21:20 I can't see how to get the views on the right to expand as much as possible (without going over/under the view on the left). Nov 23 07:21:37 TacticalJoke: I think you could do it with RelativeLayout without nesting Nov 23 07:22:07 i was going to say relative layout Nov 23 07:22:16 Yeah. Trying to figure out how. Nov 23 07:22:16 i dont use anything but relative layout any more Nov 23 07:22:39 How does one basically say "fill the remaining space" in a RelativeLayout? Nov 23 07:24:40 "layout_toRightOf" doesn't do the trick. Nov 23 07:24:55 HowWhat you want to achieve Nov 23 07:25:52 u can also use weight Nov 23 07:25:54 Let's simply it. Let's say that I want a view on the left with a fixed width. Then a view on the right whose width is the remaining space. How do I achieve that with RelativeLayout? Nov 23 07:26:00 simplify* Nov 23 07:26:16 yes Nov 23 07:26:17 Both have a height of 'match_parent'. Nov 23 07:26:21 user weight Nov 23 07:26:45 both will have match_parent Nov 23 07:27:07 set weight of left one 1 Nov 23 07:27:34 weight and gravity Nov 23 07:29:48 I forgot is match_parent what replaced fill_parent ? Nov 23 07:30:41 FILL_PARENT (renamed MATCH_PARENT in API Level 8 and higher), Nov 23 07:30:55 right Nov 23 07:31:08 I still use fill_parent :P Nov 23 07:31:44 thats great just, this constant is deprecated starting from API Level 8 Nov 23 07:31:58 u can use deprecated keywords or mwthods Nov 23 07:31:59 deprecated works Nov 23 07:32:03 methods Nov 23 07:32:20 I'm reading that RelativeLayout doesn't support weight. Nov 23 07:32:24 Your suggestions aren't working. Nov 23 07:33:07 with RelativeLayout you can achieve directly Nov 23 07:33:30 specify the width size of relative layout Nov 23 07:33:52 So I want this with a RelativeLayout: [fixed-width view] [view that takes up remaining width] Nov 23 07:34:00 and match parent the width of relative layout at right Nov 23 07:34:28 TacticalJoke: have you tried putting the variable-width view to the right of the fixed-width one, and also aligning to parent right? Nov 23 07:35:51 http://www.perfectapk.com/android-relative-layout-example.html Nov 23 07:36:38 * g00s can never get relativelayout to do what he wants Nov 23 07:37:17 its the only layout i can get to do what i want lol Nov 23 07:37:23 but it takes me a long time Nov 23 07:37:24 min2: Doesn't work here. Nov 23 07:37:29 tm604: Didn't work. Nov 23 07:37:41 TacticalJoke: you would layout_alignParentRight on the childview of the layout Nov 23 07:37:53 ohh god Nov 23 07:37:57 or so I'm guessing ;) Nov 23 07:38:00 TacticalJoke: can you pastebin the XML layout you're using? Nov 23 07:38:02 wait let me design for you Nov 23 07:38:24 When I use the code in that link, I see only one view. Nov 23 07:38:32 The other is (I guess) behind. Nov 23 07:38:52 IIRC something like should be enough, but it depends on what else is in the layout. Nov 23 07:40:26 Okay, here it is with just "match_parent" on the left. Basically, the left one should fill to expand the remaining space and the right one should have a fixed width. http://pastebin.com/PRdYcGZX Nov 23 07:40:26 http://pastebin.com/ZWMKgz8d Nov 23 07:40:47 min2: Yeah, but I want to avoid nesting. :) Nov 23 07:40:53 Just one RelativeLayout if I can. Nov 23 07:41:13 okies Nov 23 07:41:14 TacticalJoke: far as I can see, you're not applying layout_toRightOf or alignParentRight there? Nov 23 07:41:18 I know that using sp for the width is weird. Nov 23 07:41:31 Yeah, not in that code. I removed the testing stuff. Nov 23 07:41:34 TacticalJoke: layout_alignParentRight becomes a child view property Nov 23 07:41:35 Gave you a blank slate. :D Nov 23 07:41:55 so you'd have views in there at least Nov 23 07:42:20 I could try that again. Nov 23 07:42:37 Just layout_toRightOf or both layout_toRightOf and alignParentRight? Nov 23 07:43:03 toLeftOf Nov 23 07:43:05 On a side note, it's weird how pastebin converted my four-space indents to three-space indents. Nov 23 07:43:39 So I set [android:layout_toLeftOf="@id/post_comment_count_text_view"] on the left one. No worky. Nov 23 07:44:15 I'd suggest alignParentRight on the fixed-width one, and variable-width would then need alignParentLeft and toLeftOf="fixed-width-id" Nov 23 07:44:15 Note that the width is still "match_parent". Is that right? Nov 23 07:44:21 yeah, take out the width Nov 23 07:44:28 Remove it totally? Or set it to 0dp? Nov 23 07:44:40 http://pastebin.com/8wA8bWV6 Nov 23 07:44:56 Should be able to leave out the width entirely for the variable one. Nov 23 07:46:40 Okay, using "parentLeft" and "parentRight" and "toLeftOf" fixed it. :) Nov 23 07:46:45 Though I can't leave out the width; it complains. Nov 23 07:46:55 I left the width as "match_parent" for the variable-width one. Nov 23 07:47:02 Seems to work. Nov 23 07:47:19 cool Nov 23 07:47:25 I hate how it wants me to use both 'left' and 'start' (and 'right' and 'end'). Nov 23 07:47:35 Makes stuff less clear. Nov 23 07:47:49 I find the trick with relativelayout is to take away any options the android layout system has for getting it wrong =) Nov 23 07:47:57 :D Nov 23 07:48:00 Thanks for the help. Nov 23 07:48:27 :) Nov 23 07:50:48 I was looking at someone's code. They were nesting at like six levels. Nov 23 07:50:49 That can't be fast. Nov 23 07:50:57 It was a fairly simply ListView row, too. Nov 23 07:51:30 simple* Nov 23 07:51:48 are u designing list item row Nov 23 07:51:49 So do you guys specify both "toLeftOf" and "toStartOf" to avoid that annoying warning? Nov 23 07:51:50 Yeah. Nov 23 07:52:08 what kind of layout you want to design Nov 23 07:53:05 do you have wireframe of your listitem Nov 23 07:53:08 ? Nov 23 07:53:11 I'm keeping it simple for now, but eventually it'll be like this: [image] [two TextViews, one on top of the other] [a fixed-width TextView] Nov 23 07:53:32 I have one in my head. :D Nov 23 07:53:46 this still your reddit thing ? Nov 23 07:53:47 I certainly want to keep things fast, so I'm gonna try to completely avoid nesting. Nov 23 07:53:48 Yeah. Nov 23 07:54:06 Some parts of the app have evolved somewhat; other parts are extremely fundamental. Nov 23 07:54:10 Though it's only a week old so far. Nov 23 07:54:18 let me give you google design for this kind of alyout Nov 23 07:54:20 so nearly finished then? Nov 23 07:54:23 layout Nov 23 07:54:31 It can view comments so far. lol Nov 23 07:54:33 And see posts. Nov 23 07:54:36 But only the first 25 posts. Nov 23 07:54:44 And only the first N comments, where N is decided by Reddit so far. Nov 23 07:54:50 TacticalJoke: write a test that compares two nested linearlayouts to relativelayout with benchmarks Nov 23 07:54:52 Can't view links yet. Nov 23 07:55:11 I like doing everything in baby steps. Nov 23 07:55:20 And creating a clean changeset for every baby step. Nov 23 07:55:29 i was just yanking your chain :P that's pretty impressive for a week Nov 23 07:55:40 http://pastebin.com/P8gnXXn5 Nov 23 07:55:40 I guess I owe it to Gson and OkHttp. Nov 23 07:56:14 using rxjava too? ;) Nov 23 07:56:15 just check this out how android design his conatct screen for list_item Nov 23 07:56:20 I haven't tried RxJava yet. Nov 23 07:58:12 I think the Reddit client might be finished fairly quickly. I have the motivation to do it. Nov 23 07:58:17 I think motivation is a key factor here. Nov 23 07:58:19 you should jump on the Xamarin bandwagon too Nov 23 07:58:34 Hmm, I've heard that it's kinda buggy. Nov 23 07:58:39 I also dislike "unofficial" stuff in general. Nov 23 07:58:42 huh, would've thought retrofit would work quite well for dealing with reddit API, rather than needing to do manual okhttp/gson handling. Nov 23 07:58:57 Hmm, haven't tried Retrofit. Nov 23 07:59:11 tm604: it would. very well. Nov 23 07:59:42 Would I take a performance penalty compared to Gson/OkHttp? Nov 23 08:00:03 not of measure Nov 23 08:00:11 and it uses both of those things under the hood Nov 23 08:00:23 I see. Nov 23 08:00:59 if you have working gson/okhttp code, that's fair enough, but especially for new projects I find retrofit is great for getting things up and running with minimal code. Nov 23 08:01:03 besides, abstraction bounded by network I/O is usually rendered moot and it is so in this case Nov 23 08:01:24 I'll research Retrofit. I guess it wouldn't be so difficult to switch to that. Nov 23 08:01:29 I don't have a huge codebase so far. Nov 23 08:01:58 I feel like Square is making most of my app for me. lol Nov 23 08:02:14 the goal is to make the boring parts so that you can actually make your app Nov 23 08:02:15 nice stuff Nov 23 08:02:16 hmmm retrofit shmetrofit! Nov 23 08:02:24 "Created by TacticalJoke and Square[tm]." Nov 23 08:02:53 really Nov 23 08:03:00 you created this Nov 23 08:03:24 just screenscrape it Nov 23 08:04:02 Screen-scrape the JSON? Nov 23 08:04:11 jk ;) Nov 23 08:04:38 I remember doing HTML screen-scraping for stuff such as this when I was a dumb kid. Nov 23 08:04:47 And every time they changed the HTML I had to update. lol Nov 23 08:04:58 but yeah that's how my first attempt would be, you are pretty good at evolving fast Nov 23 08:05:10 it's not screen-scraping if it's already data Nov 23 08:09:42 details are very less Nov 23 08:13:04 I'm thinking of using this style: android:layout_alignParentLeft="true" android:layout_alignParentStart="true" Nov 23 08:13:09 i.e., saying it in one line. Nov 23 08:13:17 Seems neat enough. Do you folks do that? Nov 23 08:17:42 the difference between left and start is for right to left language and orientation support I think Nov 23 08:18:05 Yeah. Nov 23 08:18:16 My mindSdkVersion is low enough that I get a warning. Nov 23 08:18:19 mind* Nov 23 08:18:19 so you'd use start only to support right to left Nov 23 08:18:20 min* Nov 23 08:18:22 Dammit. lol Nov 23 08:19:36 ignore it Nov 23 08:19:58 I can suppress it by declaring both 'left' and 'start'. Nov 23 08:20:02 ignorance is bliss Nov 23 08:20:03 I hate warnings. :/ Nov 23 08:21:50 So, if I want to display [variable width][fixed width], for the left one I'm using alignParentLeft and toLeftOf, and I'm declaring a layout_width of 0dp. Nov 23 08:22:18 But if I want two on the left, one above the other, I can't specify 0dp and both 'above' and 'below', as it complains about circular references. Nov 23 08:22:21 What's the best way to handle this? Nov 23 08:22:42 start top right, then bottom right, the left Nov 23 08:24:47 or just nest layouts and move on Nov 23 08:28:14 or try using alignParent as a hint to set the layout engine on the right track - for example alignParentTop on one, below on the other. or alignParentBottom + above. Nov 23 08:29:05 Yeah, I tried that. Nov 23 08:29:08 Here's what I'm trying: http://pastebin.com/zyJAQPr4 Nov 23 08:29:19 Not sure why this isn't working. lol Nov 23 08:29:22 Seems like it should be easy. Nov 23 08:29:53 post title text view Nov 23 08:29:55 should not be left of Nov 23 08:30:04 but post comment count text view should be right of Nov 23 08:30:42 err i may have that backwords ;p Nov 23 08:30:43 But the comment-count thing has to be to the right of both. Nov 23 08:30:50 Two to the left; one to the right. Nov 23 08:31:08 I have an android apk (for android tv) and wish to change the icon - how would I go about doing this? Nov 23 08:31:15 yeah so TL is top and left, BL is below TL and TR is right of TL and top Nov 23 08:31:57 why 0 dp for width and height? Nov 23 08:32:50 For the top-left element, I thought that the width could be determined by alignParentLeft and toLeftOf, and that the height could be determined by alignParentTop and above. Nov 23 08:33:01 no i dont think so Nov 23 08:33:03 I guessed that using 0dp made more sense and was fasted. Nov 23 08:33:03 Oh. Nov 23 08:33:06 not like this Nov 23 08:33:06 faster* Nov 23 08:33:10 it'll pass onMeasure 0 Nov 23 08:33:14 Note that I'm a complete noob here. Nov 23 08:33:17 I'm going by on guesswork alone. Nov 23 08:33:21 Surprised I even got this far. :D Nov 23 08:33:25 I see. Nov 23 08:33:34 So should I specify "match_parent"? Nov 23 08:33:36 onMeasure will get 0 and 0 and will give it no dimensions i believe Nov 23 08:33:37 That doesn't feel right, though. Nov 23 08:33:43 Oh, it's giving it dimensions. Nov 23 08:33:44 probably wrap content Nov 23 08:33:49 The top-left and the right are both showing. Nov 23 08:33:52 Just not the bottom-left. Nov 23 08:33:52 oh Nov 23 08:33:53 nm Nov 23 08:34:15 you've tried setting BL to layout_below, and removing layout_above from TL? Nov 23 08:35:39 Just tried. That makes TL disappear (I see only BL and R). Nov 23 08:36:10 If I set TL and BL to "wrap_content" for width and height, I see all three views, but TL is huge and BL is small. Nov 23 08:36:25 I'd like TL and BL to have 50% height each. Nov 23 08:36:33 R should get 100% height. Nov 23 08:36:41 wrap_content sounds more appropriate than 0dp, is gravity affecting things there? Nov 23 08:37:49 'gravity' doesn't appear to be making any difference. Nov 23 08:38:06 Doesn't "wrap_content" mean "be only big enough to hold the content", though? Nov 23 08:38:10 I really want TL and BL to stretch. Nov 23 08:38:39 Ideally, I could say "layout_width='stretch'" and layout_height="50%" for TL and BL. Nov 23 08:38:58 yeah you want match parent Nov 23 08:43:04 It's weird that there's no "stretch" option. Nov 23 08:43:08 Seems so basic. Nov 23 08:43:34 that's what match_parent does! Nov 23 08:43:35 stretch-> match parent Nov 23 08:45:22 just use nested LinearLayouts Nov 23 08:45:56 Hmm. I feel like it should be possible without neseting. Nov 23 08:45:57 nesting* Nov 23 08:46:01 it is Nov 23 08:46:19 the point is that you are wasting your time on something that can be optimized later Nov 23 08:48:48 hi Nov 23 08:49:27 so the basic structure for an activity is activity.xml & activity.java Nov 23 08:49:37 should the java part only contain stuff related to design? Nov 23 08:49:46 as in some MVC pattern? Nov 23 08:49:55 no Nov 23 08:49:57 Do you mean "related to the problem domain"? Nov 23 08:50:04 The model, I guess. Nov 23 08:50:09 the xml part is the initial design Nov 23 08:50:37 the java is for the dynamic parts and everything else Nov 23 08:50:37 so putting logic inside the activity.java is not bad practice? Nov 23 08:50:59 I'm not sure where else you'd put logic? Nov 23 08:51:07 in other classes Nov 23 08:51:14 and connect them to the activity Nov 23 08:51:26 s1k3s look at the samples Nov 23 08:52:01 Well, yeah, it's good practice to modularise. Nov 23 08:52:21 s1k3s: the answer to your question there does not exist single solution, will ultimaly boil down to how complex the activity is Nov 23 08:52:24 s1k3s: what previous programming have you done ? Nov 23 08:52:29 s1k3s google 'android mvc mvp mvvm' Nov 23 08:52:36 you have many options :) Nov 23 08:52:44 you aren't forced either way Nov 23 08:53:11 shmooz i've been learning & practicing programming in the past 6 years Nov 23 08:53:22 g00s thanks, that's great Nov 23 08:53:57 which languages? Nov 23 08:54:33 shmooz, c, webdev(js,css,html) and recently java Nov 23 08:54:53 ok yeah you probably need to learn some OO concepts then Nov 23 08:55:14 how do i create a bitmap that exactly matches the size of a view? if i put the bitmap creation in the onMeasure my code falls over. Nov 23 08:55:29 s1k3s try to find the original paper on MVP by Taligent Nov 23 08:55:45 shmooz, i think my oo concepts are fine. I'm just trying to get used to android and do it the right way Nov 23 08:55:46 if i put it in the constructor it falls over then too because the onMeasure does not seem to have happened yet Nov 23 08:56:06 ah http://www.wildcrest.com/Potel/Portfolio/mvp.pdf Nov 23 08:56:21 knowing java helps Nov 23 08:56:44 with recently, i meant about one year :D Nov 23 08:57:02 thanks g00s, will read that Nov 23 08:57:10 ? Nov 23 08:57:27 I'm learning Java right now after being a front end web developer (ie javascript) and the biggest problem is being used to passing functions around. Java doesn't quite do it that way. Nov 23 08:57:48 yeah first class functions are nice Nov 23 08:57:48 Java 7 doesn't have lambdas. Nov 23 08:58:08 even with an onClickListener you have to create a new object and pass that in Nov 23 08:58:12 Right. Nov 23 08:58:13 for the callback Nov 23 08:58:38 I440r: match_parent ? Nov 23 08:58:44 also I have one more question. I'm looking over the android classes for android.net and it says "Classes that help with network access, beyond the normal java.net.* APIs." Nov 23 08:58:54 how is android.net better than java.net Nov 23 08:58:54 shmooz, no. programatically, not in the xml Nov 23 08:59:12 oddalot: This is solved in Java 8. Unfortunately, we can't (officially) use Java 8 for Android stuff. Nov 23 08:59:32 although I've also seen this 'implements' thing for onClickListener as well Nov 23 08:59:37 we can also only use a specific version of java 7 to build android from sources Nov 23 08:59:41 which is also stupid Nov 23 08:59:42 I'm not sure what that's all about, but I'm looking into it Nov 23 08:59:51 s1k3s its not better, its totally different stuff Nov 23 08:59:57 oddalot: Some people use anonymous classes to emulate (the look of) first-class functions. But I don't like them, personally. Nov 23 09:00:04 g00s, how so? Nov 23 09:00:23 how do i create a bitmap that matches a view size? not in xml but in code Nov 23 09:00:36 i cant do it in the onMeasure and i cannot seem to do it in the contstructor either Nov 23 09:00:42 I'm so used to javascript i could see that, but I know it's probably smarter to learn the java way and do it that way. Nov 23 09:00:50 I440r: view.setLayoutParams( new LinearLayout.LayoutParams(LayoutParams.MATCH_PARENT, LayoutParams.MATCH_PARENT, 0.0f)); Nov 23 09:01:15 shmoon, NO thats not what i mean Nov 23 09:01:17 I just bought a 1,000 page book on Java for Android...i'm like 100 pages in and making progress pretty quickly Nov 23 09:01:54 Being an android dev seems like a pretty safe bet for a job right now I would guess. Nov 23 09:01:59 Bitmap foo = Bitmp.createBitmap(WIDTH, HEIOGHT, Bitmap.Config.xxxx); Nov 23 09:02:05 i need to set widht and height equal to the view size Nov 23 09:02:12 I440r: the number at the end is the weight, 1.0f would be full weight Nov 23 09:02:27 shmooz, that doesnt help me Nov 23 09:03:30 I made an irc client for android as my first app. I took me about 1 day. Is that a good start? Nov 23 09:03:43 I440r: to what view size ? Nov 23 09:03:44 oddalot i've noticed in the us android job postings have been going down Nov 23 09:03:56 i wonder if things are getting saturated or what Nov 23 09:04:07 the size of the view that the constructor is in. the size depends on the device Nov 23 09:04:30 screen size ? Nov 23 09:04:33 oh, well. I live near San Francisco, so maybe my viewpoint is skewed Nov 23 09:04:43 oh yeah, mountainview :) Nov 23 09:04:53 if you can make an irc client at all I would say you are doing good. Nov 23 09:04:58 let alone in a day. Nov 23 09:04:59 shmooz, no. the view is not the entire screen Nov 23 09:05:15 it would take me months if not years to make an irc client I'm sure. Nov 23 09:05:28 well it's very basic Nov 23 09:05:35 connect to channel get message send messages Nov 23 09:05:40 and it has a lame design Nov 23 09:05:49 but it works Nov 23 09:05:49 i have an onMeasure() that gives me the width and height of the view Nov 23 09:05:49 I440r: You can get the measured size in onMeasure, and its laid out size in onLayout Nov 23 09:05:51 san mateo here ;) Nov 23 09:05:56 but the constructor for the view seems to happen first Nov 23 09:06:05 and if i create the bitmaps within the onMeasure the code falls over Nov 23 09:06:21 with some runtime exception Nov 23 09:06:52 mountain view if freaking weird, I went there once to a google event. That place reminds me of like some weird high school or something, where everyone is on ecstasy all the time. Nov 23 09:06:55 SimonVT, they can be different? Nov 23 09:07:04 Sure, but rarely Nov 23 09:07:14 how can they be different? Nov 23 09:07:51 If the viewgroup ignores the measured size Nov 23 09:08:18 Anyway, debug your exception Nov 23 09:08:35 Whether you do it in onMeasure or onLayout doesn't matter Nov 23 09:09:16 if i create the bitmap in onMeasure after getting the vWidth and vHeight i get an exception during inflation Nov 23 09:09:47 Okay, here's a simplification of my issue. Let's say that I have a RelativeLayout and I want two views to show: one on top of the other. I can specify alignParentTop for the top and alignParentBottom for the bottom. And above="bottom" for the top. What should the layout_heights be? Nov 23 09:09:55 Ask smarter questions Nov 23 09:10:00 "an exception" is not a good error report Nov 23 09:10:25 We can't help you with "an exception" Nov 23 09:11:47 ive never been able to call Bitmap.createBitmap() inside a onMeasure Nov 23 09:11:55 i didnt think it was legal to do so Nov 23 09:12:02 it is, don't do it Nov 23 09:12:31 then why do i need to expand on "an exception" when its an illegal operation anyway Nov 23 09:12:58 so again. how do i create a bitmap equal in size to my view Nov 23 09:13:10 For android tv apps where is the icon stored ]\ Nov 23 09:13:16 could not find it in res Nov 23 09:15:19 I440r: i said it was legal Nov 23 09:15:34 you also said "dont do it" Nov 23 09:15:56 Both are true statements Nov 23 09:16:00 right. large allocations on the main thread during performance-critical sections of code yield not fun results Nov 23 09:16:16 Anyway, good luck Nov 23 09:16:27 you can do it. it will work. you might lose a frame or two or trigger a stop-the-world GC Nov 23 09:21:25 wait: onMeasure happens every frame? Nov 23 09:21:31 variant.registerJavaGeneratingTask is flaky as hell Nov 23 09:22:10 i guess it could be AS Nov 23 09:23:31 Whoa. Nov 23 09:23:33 I got it working. Nov 23 09:23:40 I added a 0x0 view in between the two. Nov 23 09:23:55 And positioned stuff above and below that. Nov 23 09:24:06 Seems like a hack, but seems to work. Nov 23 09:24:33 I'm guessing there's no better way to get have 50%/50% height in a RelativeLayout? Nov 23 09:24:38 -get Nov 23 09:25:38 sounds like you are linearly laying out the children of this viewgroup Nov 23 09:26:00 which according to the wisdom of both jack wharton and simon vt would suggest you use _linear_ layout ;p Nov 23 09:26:01 It's basically top-left and bottom-left (50% height each), and right (100% height). Nov 23 09:26:12 But I want no nesting. lol Nov 23 09:26:30 The Android-documentation page shows an example of doing exactly what I want, and they talk about not nesting. Nov 23 09:26:31 then make a custom view Nov 23 09:26:38 Only issue is that they don't tell you how to do it. Nov 23 09:26:38 well Nov 23 09:26:43 use a compound/custom view then Nov 23 09:26:53 this is going inside a listview right? Nov 23 09:27:00 Why would that be needed, though? Surely this is stuff done entirely in XML. Nov 23 09:27:01 Yeah. Nov 23 09:27:07 yeah Nov 23 09:27:10 then do a compound view Nov 23 09:27:29 http://blog.xebia.com/2013/07/22/viewholder-considered-harmful/ Nov 23 09:27:41 Oh, I didn't end up going with that. Nov 23 09:27:46 well Nov 23 09:27:51 essentially that's what you are making Nov 23 09:27:53 I created a ViewHolder with a constructor and a showPost method. Nov 23 09:28:06 yeah it would be much better with a compound view but to each their own Nov 23 09:29:11 Here's what I ended up with: http://pastebin.com/9Vvaaary Nov 23 09:29:13 I think that's simpler. Nov 23 09:29:34 ahh yeah i tried to look the other day but the post expired Nov 23 09:29:35 nice Nov 23 09:29:42 that blog post is an awful sensationalization Nov 23 09:29:51 hehe JakeWharton yeah Nov 23 09:29:54 I'm not sure that the term "ViewHolder" is best for that class. Nov 23 09:29:58 Though I have no idea what to name it. Nov 23 09:30:02 It's like a holder and a presenter. Nov 23 09:30:20 Yeah, all my posts expire. They're ticking timebombs. Sorry. lol Nov 23 09:30:33 in the conclusion he states that it is a sensationalization too Nov 23 09:30:37 stupid click-bait title Nov 23 09:30:58 works, there's like 4 clones of it already Nov 23 09:31:16 i just thought it was a nice intro to using compound views ;p Nov 23 09:33:06 hello Nov 23 09:33:36 click bait makes the world go round Nov 23 09:33:50 thats how google stays in business Nov 23 09:34:03 thats how android exists, and why it exists :) Nov 23 09:34:06 God. It's suddenly stopped working. Nov 23 09:34:10 I swear it was working a moment ago. Nov 23 09:34:23 You only have to *think* things for Android stuff to break. Nov 23 09:35:28 Use nested layouts Nov 23 09:35:50 lol Nov 23 09:36:07 The problem with me is that I obsess over stuff until I perfect them. Nov 23 09:36:15 your app will never ship then Nov 23 09:36:27 this sucks. i'm just typing along and then all of a sudden, AS turns all the appcompat stuff red with error markers Nov 23 09:36:46 But isn't it possible to achieve this with a RelativeLayout with no nesting? Nov 23 09:36:50 its like every once in a while, it totoally loses its shit and forgets what libraries i'm using Nov 23 09:36:55 TacticalJoke: probably, but who cares? Nov 23 09:37:02 you have 1000 other things to get done Nov 23 09:37:06 what can i copy a bitmap of type ARGB_8888 into a bitmap of type RGB_565 and let android do the conversion? Nov 23 09:37:18 or do i need to do the conversion myself Nov 23 09:39:45 Okay, I figured it out. I'd renamed the XML element and not updated the references. Doh! Nov 23 09:39:50 I wish it'd show an error when I do that. Nov 23 09:39:58 I agree, JakeWharton. This is a problem of mind. Nov 23 09:39:59 mine* Nov 23 09:40:07 Obsessing over tiny details. Nov 23 09:40:26 me too Nov 23 09:40:33 you can still obsess, just do it in multiple waves Nov 23 09:40:45 build a pyramid Nov 23 09:40:48 Yeah. Nov 23 09:40:48 go wide and fast Nov 23 09:40:52 :) Nov 23 09:40:57 slowly build up to a point over time Nov 23 09:41:07 nvm i got it :) Nov 23 09:41:14 are we exchanging quotes from movies? Nov 23 09:41:28 Stay hungry, stay foolish Nov 23 09:41:34 Be the next best thing Nov 23 09:41:43 amidoinitright? Nov 23 09:42:00 I guess I'm trying to delay the inevitable obsessing over minutiae until I have released 1.0. Nov 23 09:42:03 But now and then it comes up. Nov 23 09:42:26 + Nov 23 09:42:39 put all the things you want to do in a list, man Nov 23 09:42:48 even the tiny things, and do them all, then release 1.0 Nov 23 09:42:53 I'm using Bitbucket's issue tracker. Nov 23 09:43:04 no such thing as minutiae, they all matter Nov 23 09:43:06 I'm basically having a conversation with myself on there. Q&A format. Nov 23 09:43:20 the trap is not doing the big things :) Nov 23 09:43:43 not the small things; the small things are easy to do, but the big things are difficult and sometimes you say yea whatever let's wait till next release Nov 23 09:44:07 People with OCD get carried away with bike-shedding, though. Nov 23 09:44:13 Too much focus on tiny details. Nov 23 09:44:25 guys, could someone explain what a is? the tutorial isn't really clear Nov 23 09:44:26 The mind must be directed to what's important. Nov 23 09:44:31 The pyramid thing. :) Nov 23 09:44:32 just tells me it has to be there Nov 23 09:44:40 you ought to probably stop labeling yourself as some 3-letter acronym and prioritise like a responsible person Nov 23 09:45:24 CDO* Nov 23 09:45:25 s1k3s: Did you try googling? Nov 23 09:45:31 then its in alphabetical order Nov 23 09:45:31 Odaym: OCD can be pretty bad. Nov 23 09:45:36 Pretending it's not there doesn't really help. Nov 23 09:45:45 I feel it's just a buzzword Nov 23 09:45:47 :P Nov 23 09:45:49 And personal responsibility is a whole other topic. Nov 23 09:45:50 TacticalJoke, I'm reading the tutorial. It just says it has to be there Nov 23 09:45:58 as opposed to all the medical proof of it that's out there (maybe) Nov 23 09:46:11 s1k3s: it's just a wrapper element, unless you mean the concept of a selector itself Nov 23 09:46:11 but I do know that I have the tendency to go into many details, I choose not to Nov 23 09:46:11 s1k3s: What exactly are you doing? Nov 23 09:46:49 trying to understand this selector thing Nov 23 09:47:13 a selector is a switch statement for a resource based on states Nov 23 09:47:25 so you can change a button background based on the when it's pressed, for example Nov 23 09:47:39 the background is a selector, and pressed is a state Nov 23 09:47:59 pressed being enabled or disabled causes a different to be used Nov 23 09:48:17 great. thank you. Was it really that hard to put that in the damn tutorial? I hate that thing.. Nov 23 09:48:55 I'm not a huge fan of much of the Android documentation. Nov 23 09:49:08 Simple stuff often gets long, complex documentation. Nov 23 09:49:09 it's open source. send them patches. Nov 23 09:49:31 last time, I wanted to do some small thing and I headed over to the documentation with a link directly to the thing I wanted to do Nov 23 09:49:37 first thing I saw was "Concepts" Nov 23 09:49:42 haha! "GOOGLEEEEEEE!!!!!!!!!!!" Nov 23 09:49:47 I just want my THING! Nov 23 09:50:13 so Selector = changing stuff. Transition = changing stuff by fading Nov 23 09:50:26 I dont want to understand the historical context within which my question falls, and how some philosopher in Greece also wondered about using the Camera! Nov 23 09:50:44 yeah but if you did you'd be complaining it wasn't there Nov 23 09:50:53 true Nov 23 09:51:13 that's why there ought to be 3 sections; 1 conceptual/theory, 1 strictly practical and the final being the API reference as raw methods Nov 23 09:51:13 everyone wants something different and most want the exact answer to their problem spelled out Nov 23 09:51:54 trying to figure out this FadingActionBar, I can't even clone because the internet is so crappy, it has parallax, does the header underneath get tucked behind the ListView/ScrollView? Nov 23 09:51:56 the middle part would probably be a copy paste of the middle of the pages from the 1st part :P Nov 23 09:52:38 If I'm saying something such as "android:layout_toLeftOf='foo'", does 'foo' need to be above the current element? Nov 23 09:52:48 I ask because I'm getting errors on/off if it's not above. Nov 23 09:52:50 Can't tell if needed. Nov 23 09:52:54 I'm trying to do mine, the header shows up below, which looks ugly.. The ListView doesn't cover up completely. Nov 23 09:53:08 nah honestly I wouldn't badmouth the documentation, I'd quicker question myself for being too lazy or not reading enough of it to get the hang of where the good stuff usually is; I just go there with a time limit of 1 min before moving to the next google query Nov 23 09:53:36 it was written by people who would make me more intelligent if they sneazed at me Nov 23 09:53:40 lel Nov 23 09:54:12 1 min that's a long time Nov 23 09:54:16 I think that criticising the documentation isn't really devaluing the people who wrote it. The problem is that some of it isn't great, and that causes hours of time and frustration. Nov 23 09:54:33 lost time* Nov 23 09:54:33 think you should probably just stfu and keep coding ;p Nov 23 09:54:33 when I was trying to implement Accounts/Authentication, the documentation for it was so scarce, thankfully there were a couple of guides out in the wild Nov 23 09:54:54 it's because you want the answer spot on, you dont WANT to understand WHY you should do this instead of that, you are always in a state of MVP :P Nov 23 09:55:03 just give me what I need to get this off the ground, I dont care if it's best practice Nov 23 09:55:09 and that's a certain type of coder :) Nov 23 09:55:29 there are other types like simon and others here who dont do things like that, and still manage to be even faster than the MVP coder Nov 23 09:56:20 people like that dont end up writing software that is solid and used by millions Nov 23 09:56:40 like nine-old-androids, how much do you think he had to know to apply all of that Nov 23 09:56:50 or the other lib he has, used by millions Nov 23 09:57:28 it's 1 in every 500 coders Nov 23 09:58:00 hence less complaining more coding Nov 23 09:58:15 my plan is to brute force excellence Nov 23 09:58:16 hahaha Nov 23 09:59:41 Sigh. Got it working in the Graphical Layout but not on my phone. Nov 23 09:59:53 you use the Designer? Nov 23 09:59:57 Y u do this to me. Nov 23 10:00:00 Only for previews. Nov 23 10:00:14 I feel like im wasting its potential :P Nov 23 10:07:32 I have a pretty primitive question that I've always sort of worked around but don't want to work around anymore Nov 23 10:08:09 if I've fed my base adapter some objects, an array of objects. And in my ListActivity I'm overriding onItemClickListener, how would I gain access to those objects? Nov 23 10:08:33 I dont want the copy that went out to the adapter when setting it on the listview, I want the list that is right now sitting inside the list Nov 23 10:08:50 the array of objects that is right now sitting inside the list* Nov 23 10:09:14 listview.getAdapter().getItem(position) doesn't give me access to those objects of type Whatever Nov 23 10:10:02 Are you using ArrayAdapter? Nov 23 10:10:05 base Nov 23 10:10:06 normally you would want to keep reference to adapter Nov 23 10:10:16 you override getItem Nov 23 10:10:30 riiiiiight Nov 23 10:10:37 you could write there return some_array[position] Nov 23 10:10:37 :s Nov 23 10:10:43 yea yea yea Nov 23 10:10:57 I dont even look at those overriden methods in the adapter, I just fix getCount to be array.size Nov 23 10:11:02 thanks Nov 23 10:12:05 I would have to cast it back to the original type when I get it, though Nov 23 10:12:14 eeyup Nov 23 10:13:03 Or change the return type of getItem to your class Nov 23 10:13:11 impossibru Nov 23 10:13:23 he overrides superclass Nov 23 10:13:40 no you can change its type Nov 23 10:13:44 that's great Nov 23 10:15:04 uh, no Nov 23 10:15:50 the overriding doesnt break when I change the type to my class, but I still cannot .getMyMethods() from the getItem() back in the activity Nov 23 10:17:06 casting is fine Nov 23 10:21:16 Aww, man. Can't get "match_parent" to work in a simple RelativeLayout now. :[ Nov 23 10:21:22 Does "match_parent" simply not work? Nov 23 10:21:35 Looks find in the Graphical Layout. Acting like "wrap_content" on my phone. Nov 23 10:21:39 fine* Nov 23 10:22:57 Is there something wrong with this? http://pastebin.com/ZtRpETTh Nov 23 10:23:06 The TextView on the right is displaying as if it has a height of "wrap_content". Nov 23 10:23:23 The equivalent code works fine in a LinearLayout. Nov 23 10:25:02 why 'sp' in width? Nov 23 10:25:18 why static width even Nov 23 10:25:28 use dimens Nov 23 10:26:00 I know. That's temporary code. Nov 23 10:26:23 just say alignparentleft on the first one, and alignToRightOf="@+id/firstOne" Nov 23 10:26:24 temporary codes are very persistent Nov 23 10:26:30 ++ Nov 23 10:26:54 unless yea you maybe want it to the very far right Nov 23 10:27:01 Ashiren: Not if you have a policy of not checking it into the repository. Nov 23 10:27:20 show what you want to achieve? Nov 23 10:27:22 I don't see why that code doesn't work. It's simply acting as if "match_parent" is "wrap_content". Nov 23 10:27:41 Odaym: I want the text view on the right to have the full height of the parent. Nov 23 10:27:44 It's wrapping to its content. Nov 23 10:27:55 well first of all the textview is not going to have any height if there is no content Nov 23 10:28:10 how're you even going to see if it did get all the height or not, if there is no text Nov 23 10:28:17 ... Nov 23 10:28:23 if there was text, you wouldn't be asking here and it would show up Nov 23 10:28:31 its not going to squash the words Nov 23 10:28:57 what if this layout's parent is wrap_content? Nov 23 10:29:03 and everywhere you have match_parent Nov 23 10:29:14 Uhh. Nov 23 10:29:19 so many things that can go wrong Nov 23 10:30:27 why alignParentLeft and also toLeftOf post_comment Nov 23 10:30:29 TacticalJoke: more of a workaround than answer to your question, but if you set alignParentTop + Bottom on both, they should end up full height? Nov 23 10:31:12 Odaym: to get left edge aligned to parent left, right edge aligned to "Right" textview Nov 23 10:31:40 I set alignParentTop and alignParentBottom on both. No difference. Nov 23 10:31:41 as to how you'd see it, that's presumably what the backgrounds are for Nov 23 10:31:44 but the first one has static width man Nov 23 10:32:04 and the second width 0 Nov 23 10:32:20 its not going going to extend out to be able to reach the second first one Nov 23 10:32:33 Odaym: That's false and not at all what's going on here. Nov 23 10:32:43 The width is 0 because it has a left and a right. Nov 23 10:32:56 impossible to work like that Nov 23 10:33:02 I guarantee you 100% Nov 23 10:33:02 Nope. Works fine. Nov 23 10:33:09 The issue is completely different from what you're talking about. Nov 23 10:33:20 I know, but those are mistakes before the main one Nov 23 10:33:41 Relativelayout much simpler Nov 23 10:34:14 I might have to use nested LinearLayouts. That sucks. Nov 23 10:34:17 Wanted top performance. Nov 23 10:34:21 if you show me the graphical pic Nov 23 10:34:24 I don't get why this stuff doesn't just work. Nov 23 10:34:25 I can do it Nov 23 10:34:37 just to see Nov 23 10:35:08 TacticalJoke: just tried copy+paste to the Android Studio preview, looks full-height here - you just seeing this on the device? Nov 23 10:35:55 Yeah. Nov 23 10:36:00 Works fine in the IDE thing. Nov 23 10:36:09 Doesn't work on my 4.1 phone or 4.4 tablet. Nov 23 10:36:53 fun times Nov 23 10:38:13 odd - looks okay on 4.4 phone (HTC Sensation XE) for me. Maybe try an activity with just that layout, nothing else? Nov 23 10:38:50 Hmm. This is in a ListView. Nov 23 10:39:53 ListView items are wrap_content Nov 23 10:40:11 Okay, works fine for an activity. Nov 23 10:40:24 SimonVT: But this works with LinearLayout. Hmm. Nov 23 10:40:44 * Odaym does the dance Nov 23 10:41:13 If the relativelayout is wrap_content, and the child textview is match_parent, then the textview is wrap_content Nov 23 10:41:27 The RelativeLayout is match_parent. Nov 23 10:42:34 that was an example Nov 23 10:43:36 Can you used a fixed height for items, or are you after something that extends to accommodate both left + right content? Presumably the latter if titles are going to wrap? Nov 23 10:44:17 Yeah, the latter. Nov 23 10:44:23 The largest TextView should determine the height of the other one. Nov 23 10:44:31 Effectively. Nov 23 10:44:55 ListView child views are not match_parent Nov 23 10:45:00 They're wrap_content, or a fixed size Nov 23 10:45:10 Then why does this work fine with LinearLayout? Nov 23 10:45:33 Anyone know if whatever unicode is supported will typically be supported across all android devices? Nov 23 10:46:15 lasserix, for example the musical Flat symbol is not supported the same way on all devices. on Samsung it appears in dark gray and different shape Nov 23 10:46:26 dont know if that's still considered as supported Nov 23 10:46:27 argh Nov 23 10:46:46 I had to get a font that has that symbol and others, and use it when I need that symbol and also the Sharp symbol # Nov 23 10:47:21 but that flat is a known bug on samsung forums Nov 23 10:47:28 Odaym: Is that really a Unicode issue? Nov 23 10:47:34 Not a typeface one? Nov 23 10:47:55 the character is still there Nov 23 10:48:08 so I dont know if its like lasserix is asking Nov 23 10:48:14 it looks garbled and just wrong, though Nov 23 10:48:24 because it grabs from the device Nov 23 10:48:34 If it shows a sharp symbol, it's not a Unicode issue. Nov 23 10:48:35 I just say \u266DF Nov 23 10:48:39 If you had to change font, it's a font issue. Nov 23 10:48:50 yea that's what I ended up doing Nov 23 10:51:05 Okay, I found a solution to my problem, but it feels horrible. Nov 23 10:51:28 I referred "layout_alignTop" and "layout_alignBottom" to the top and bottom of the biggest TextView. Nov 23 10:51:38 I guess LinearLayout is my only (sane) option. Nov 23 10:51:49 4 hours later... Nov 23 10:52:00 RelativeLayout feels like one of those women you meet who are great looking, but after getting to know them they start getting violent or something. Nov 23 10:52:31 Yeah, lasserix. At least I learned that RelativeLayout would've led me to doom. Nov 23 10:52:34 Relative made me a better person Nov 23 10:52:53 my life was enhanced Nov 23 10:53:06 every time I think Linear now, I think..could be Relative Nov 23 10:53:14 RELATIVITY bro...RELATIVITY Nov 23 10:53:52 I guess if I don't nest too much it won't hurt. Nov 23 10:54:02 Just trying to keep everything as light and fast as possible. Nov 23 10:54:05 and I got to the point where I no longer say alignParentRight, I say alignParentEnd Nov 23 10:54:12 to support LTR. Nov 23 10:54:15 so pro Nov 23 10:54:17 Odaym: Can you troll a little better? Nov 23 10:54:24 no im serious Nov 23 10:54:25 Just a little feedback. :) Nov 23 10:55:04 Yeah, but trolling is way more tolerable when it's of high quality. Nov 23 11:02:46 So, I switched to LinearLayout. The world is now a happy place. Nov 23 11:07:07 The layout part of android seems pretty simple if you ask me Nov 23 11:07:19 "Seems". Nov 23 11:07:31 i don't understand it all yet, but compared to html/css it seems more logical Nov 23 11:07:59 the way layout works in the DOM is so ridiculous and quirky Nov 23 11:08:17 A lot of stuff in Android seems really simple. Then you try it. Nov 23 11:08:55 I don't mean to discourage. A lot seems simple and is simple. You just get bitten sometimes. Nov 23 11:09:14 Well, the part I'm struggling with right now is how to go about syncing the view with some data that might change Nov 23 11:09:14 On the plus side, you learn not to be bitten (so badly) again. Nov 23 11:09:51 i'm use to angular, where they have 'two-way data binding' Nov 23 11:10:00 stil no binding here Nov 23 11:10:31 yeah, so if i make an asychronous call to a server, i'm trying to figure out the best way to update the view Nov 23 11:10:45 like, where should i put that code, especially to keep it all organized Nov 23 11:10:53 you use asynctask Nov 23 11:11:33 i've read a little about that Nov 23 11:11:39 you must use it Nov 23 11:11:58 so what does that entail? would I have a callback on success? Nov 23 11:12:12 or some kind of future/promise? Nov 23 11:12:16 read it Nov 23 11:12:35 I did, guess I'll read it again. I'm still learning java as I go too. Nov 23 11:12:53 you have several callbacks, 2 of which can be used to mess wit hthe view Nov 23 11:12:54 oddalot: you might find it easier to start with something like RxJava or an event bus for the view update. Nov 23 11:13:06 there's no onSuccess though..I dont think so, you just have to check for 200 or something Nov 23 11:13:17 cause AsyncTask is not JUST for web calls, you can do anything Nov 23 11:13:21 its just a long running task Nov 23 11:14:16 Sure, I just wanted to keep all the nasty details hidden, and in my one activy i can just make the calls I need to update the view. Like getUser('Ron') Nov 23 11:14:34 and that returns what I need, but maybe with a callback Nov 23 11:14:51 arrgg Nov 23 11:14:55 so used to javascript Nov 23 11:15:14 oddalot: what's the server call? just REST / HTTP? Nov 23 11:15:36 well, it's actually another Android package Nov 23 11:15:41 err Nov 23 11:15:48 Java package Nov 23 11:16:13 Jackage Nov 23 11:16:20 they have some kind of Service callback for their calls Nov 23 11:16:59 so it's basically what i want already, but you have to connect to an Account and then pass in like 2 other objects etc...just to make one call Nov 23 11:17:50 so I figure I can abstract all that away into my own api, which also gives me the added benefit of being able to plug in another outside api besides theirs with my views later on Nov 23 11:18:43 So I guess I have all that figured out, I just didn't want to start coding some giant library if it wasn't the Java way. Nov 23 11:19:00 probably paint myself into a corner pretty fast Nov 23 11:25:06 hmm..what is this AIDL Nov 23 11:25:16 geeze, it's like a billion things i gotta read Nov 23 11:27:32 well yea you're off to recreate the universe Nov 23 11:27:36 start with 1 thing Nov 23 11:28:28 yeah, guess i should learn what this whole 'implements' thing is Nov 23 11:29:39 if you dont know what implements means Nov 23 11:29:40 oh Nov 23 11:29:43 i would definatly Nov 23 11:29:44 no you need to learn Java first Nov 23 11:29:46 not try and do AIDL Nov 23 11:29:48 for a long time Nov 23 11:30:06 i just said that Nov 23 11:30:13 not Android even Nov 23 11:30:21 implements, extends, etc. Nov 23 11:30:38 yeah, probably why i just said that Nov 23 11:30:51 yeah, guess i should learn what this whole 'implements' thing is Nov 23 11:30:55 oddalot: you could probably just use volley Nov 23 11:31:02 to do your network -> view update stuff Nov 23 11:31:10 dunno why you think AIDL will help you with that Nov 23 11:31:30 oh, I'm reading the source code for the api i'm using Nov 23 11:31:33 and they use one Nov 23 11:31:53 I didn't think i was going to have to write one or anything Nov 23 11:31:53 aidl is a way to do interfaces across processes Nov 23 11:32:27 yeah, sounds like something I'm not going to have to understand until i get the fundamentals of the language down Nov 23 11:32:39 well its not even really in the language Nov 23 11:32:42 its something on top Nov 23 11:32:46 exactly Nov 23 11:32:49 or way, way deep in android Nov 23 11:33:13 i'm just glad i learned javascript first, java actually makes a lot of sense, things work the way you would think they work Nov 23 11:33:39 javascript is like the wild west, it's like anything can do anything, it makes no sense Nov 23 11:34:02 'this' for instance - makes complete sense in java Nov 23 11:34:26 in javascript 'this' depends on how you call the function, it's like wtf Nov 23 11:46:36 Anyone know if calling drawLines with only one line doesn't work? Nov 23 11:56:52 lasserix, don't read the javadoc? Nov 23 11:57:05 "Thus to draw 1 line, the array must contain at least 4 Nov 23 11:57:05 values" Nov 23 11:57:33 didnt know if it was bugged or something Nov 23 11:59:12 stuff from api 1 is rarely bugged :) Nov 23 12:00:08 https://www.youtube.com/watch?v=H6Ixqw1yyr4 <- fun with drawPath (more efficient than drawLines when many) Nov 23 12:00:19 <- canvas lover :D Nov 23 12:03:25 TacticalJoke: are you gonna give up that easy ? heh! Nov 23 12:12:35 ok, so I'm extending the ImageButton class and providing the 1, 2 and 3 parameter constructors. I have a bit of extra setup to do in the 2- and 3-parameter constructors (checking if an XML attribute is present) so I currently have the code duplicated. I want to simplify things using a this() call in the first two constructors resulting in all constructors finally calling the 3-parameter constructor. Only issue is that the default values for the Nov 23 12:12:35 last two paramters are not null by default. I can see the correct default values by looking at the source, but should I hard code these into my new class? What if the base changes? I'm just wondering the best practice in these cases... duplicate code, or assumptions about the inner workings of the superclass... both sound wrong to me Nov 23 12:23:32 I think I am suffering from exhaustion but uhh i initialize a float array in the class scope, then later reassign it with some values, i can see with the debugger it is being reassigned, but at the same time a later function only sees the initialized array (of size 0), anyone know what i am fucking up on? Nov 23 12:26:12 Hey peeps Nov 23 12:26:23 It somehow has a reference to the old array Nov 23 12:28:01 yeah, so I have like CustomView() { determineSomeStuff(); } the determine some stuff reassigns the array, though it is a subclass and determineSomeStuff is overriden so Nov 23 12:28:26 lasserix are you creating a new array that you see in the debugger, instead of updating the existing array? maybe a typo? Nov 23 12:28:31 you ahve some code you could pastebin> Nov 23 12:28:59 im drawing a 565 bitmap and when i display it the drawing looks dithered Nov 23 12:29:14 how do i make the bitmap not dither as i write pixles into it? Nov 23 12:29:35 or maybe its being dithered as its being scaled? Nov 23 12:32:41 http://pastebin.com/xDQnsY0f Nov 23 12:32:54 nah its the same array Nov 23 12:33:29 Anyone using this intel KVM thing to improve performance of emulators? Nov 23 12:33:53 Ankhwatcher: I've had better luck with http://www.genymotion.com/ Nov 23 12:34:31 so i createa bunch of these customrects, then draw them later, i know for a fact indicatorline is getting assigned (via stepping through with debugger) --that is determineCenterPosition is called, and called before draw is called, but when draw is called indicatorline is of 0 length Nov 23 12:34:48 so i am drawing into a bitmap. i then draw this bitmap into a view and it is being dithered Nov 23 12:34:53 badly Nov 23 12:35:26 when drawing this bitmap into the view i used a paint that i had setDither(false) on Nov 23 12:35:39 how can i stop this bitmap from being dithered when i draw it? Nov 23 12:35:48 tm604: yeah, I've heard that but I'm following a Udacity course that the Android Dev team put together and it wants me to use the built in Virtual Device Manager Nov 23 12:35:57 in the debugger i do get "Array Reference Expected" for the value in the stack Nov 23 12:36:15 I'm wondering if there is a way to set up a virtual device to use KVM from within Android Studio Nov 23 12:36:38 I440r, are you using a bitmap config with ARGB8888 ? Nov 23 12:36:54 no the bitmap confi is rgb_565 Nov 23 12:37:02 so that's the cause Nov 23 12:37:14 lasserix: is SpecialCustomRect being instantiated on the UI thread? (put another way, does "volatile" help at all?) Nov 23 12:37:28 umm yeah its all on the ui thread Nov 23 12:38:03 the bitmap im drawing is 565. i want it to be 565. is NOT dithering not an option? Nov 23 12:38:21 stranger still added a boolean test = true; in class, set it to false at end of determineCenter, then the debugger shoes its false before i set it to false then shows it as true in draw Nov 23 12:38:28 ah, i thought the source bitmap was not 565 Nov 23 12:38:43 no, it IS Nov 23 12:39:18 maybe the view is 8888? Nov 23 12:39:41 is it even possible to have one part of your scene drawn as 8888 and another part as 565? Nov 23 12:39:55 it should not be problematic if the view is 8888 and you draw something in 565, there is no lost of information in this case Nov 23 12:40:13 well a loss of information is not the problem Nov 23 12:40:24 the dithering is Nov 23 12:40:26 the loss of info is what creates the dithering i think Nov 23 12:40:38 how can i prevent that Nov 23 12:41:15 guess i have to waste memory and make the bitmap 8888 Nov 23 12:41:32 and its a 512x256 bitmap :/ Nov 23 12:42:22 ahh Nov 23 12:42:26 didn't realize Nov 23 12:42:36 class scope initialization happens after constructor Nov 23 12:43:01 I440r, are you sure you understand what "dither" is? Nov 23 12:43:10 yes Nov 23 12:43:21 ok cause it's a rare case you ask, to not have dither Nov 23 12:43:40 most of ppl complain about their gradient not "beautiful" because dithering does not work or is not enabled Nov 23 12:43:41 the dithering is making the 565 image look pixlated Nov 23 12:43:42 not the contrary Nov 23 12:43:54 pixles that i know to be the same color are NOT the same color when drawn Nov 23 12:44:03 the pixelated look might comes from scaling maybe? Nov 23 12:44:09 did you try to set antialias to true? Nov 23 12:44:10 no Nov 23 12:44:24 if i have this as 8888 the scaling does not cause this effect Nov 23 12:44:36 let me try that Nov 23 12:44:40 on the Paint ? Nov 23 12:44:47 yes on the paint Nov 23 12:44:55 but also when you create your bitmap Nov 23 12:44:59 there is a boolean flag, iirc Nov 23 12:45:22 if you create it from a scaled version via createScaledBitmap Nov 23 12:45:35 the last param is a boolean which does aa Nov 23 12:45:51 (they call that filter) Nov 23 12:46:04 aha Nov 23 12:46:14 how do i set a filter for no anti alias and no dither? Nov 23 12:46:32 false on createScaledBitmap and do not pass any paint to your drawBitmap Nov 23 12:47:08 also look params in here: http://developer.android.com/reference/android/graphics/BitmapFactory.Options.html Nov 23 12:47:20 there is indither but not only Nov 23 12:48:03 i generally find androids api documentation to be the closest to pure suckage ive ever seen Nov 23 12:48:16 because you did not see worst :) Nov 23 12:48:17 they have all the information there for someone who already knows 100% of what they are documenting Nov 23 12:48:29 you need to learn how to search dude Nov 23 12:48:35 i.e. completely and utterly FUCKING useless to use to learn it Nov 23 12:48:39 it's the best tool ever, knowing how to search Nov 23 12:48:46 awesopme as a reference to someone who already knows Nov 23 12:48:49 oh lol, they only wanted you to set up an emulator for about 5 seconds Nov 23 12:49:24 knowing how to search == increase your probability to find a pertinent answer Nov 23 12:49:41 many ppl will search, but not very efficiently, imho Nov 23 12:50:07 that page is only useful for when you use he bitmap factory to create a bitmap Nov 23 12:50:16 there is no inDither or whatever when you dont Nov 23 12:50:26 what are you using??? Nov 23 12:50:31 do you read pixels array from a file lol? Nov 23 12:51:25 Bitmap.createBitmap(w, h, config); Nov 23 12:51:55 i told you im writing pixles into this bitmap. ONE at a time Nov 23 12:52:04 its a mini map with fog of war Nov 23 12:52:14 as you see a location that location gets added to the mini map Nov 23 12:53:19 ok so it might comes from how you draw in your canvas if so Nov 23 12:53:36 Is there any documentation out there that nails down a naming convetion for Android? Nov 23 12:53:39 you should not really draw in the bitmap (except in specific case) Nov 23 12:53:48 but more in a canvas associated to your bitmap Nov 23 12:54:20 I don't know more anyway, so good luck Nov 23 12:57:32 there is no draw pixle associated with canvas Nov 23 12:57:52 line yes. oval yes. rectangle yes. POINT NO Nov 23 12:58:30 there is Nov 23 12:58:36 drawPoint and drawPoints too Nov 23 12:58:51 but they are both not really efficient if you plan to redraw the entire points of a canvas Nov 23 12:59:21 err yea. that wants floats Nov 23 12:59:36 im only drawing ONE point into the bitmap at a time Nov 23 12:59:39 ONE point Nov 23 12:59:55 it will work too Nov 23 13:00:03 you have to set the stroke in hairline mode of your paint Nov 23 13:00:12 how do i draw a point of color c into a canvas at coordinat x, y Nov 23 13:00:12 via passing the value "0" to setStrokesize Nov 23 13:00:21 where c x and y ware integers not floating point Nov 23 13:00:22 so it will be one pixel only Nov 23 13:00:31 you can cast any integer into float... Nov 23 13:00:59 it will work, i'm sure of it, i'm using it for a oldchool 3D raycasting engine Nov 23 13:01:01 and why the hell would i want to use floating point values to represent pixle coordinates anyway Nov 23 13:01:11 where I draw individually each point, which is really heavy ;( Nov 23 13:01:13 its not like you can draw a pixle at x = 1.23 and y = 2.34 Nov 23 13:01:20 because it's dpi related Nov 23 13:01:28 not in this case Nov 23 13:01:31 omg Nov 23 13:01:48 this bitmap is exactly one pixle per map location Nov 23 13:02:05 i told you what to do, try something else if you're not satisfied instead of complaining lol Nov 23 13:02:07 i dont display the entire bitmap. i display a WINDOW within it Nov 23 13:02:13 im CONFUSED Nov 23 13:02:20 this doesnt make one freeking iota of sense Nov 23 13:02:30 that what she said Nov 23 13:03:08 myBitmap.setPixle(x, y, c); <-- THis makes sense Nov 23 13:10:29 man talking tom cat 500000 1$ downloads, not to mention in-app purchases Nov 23 13:20:14 that's humanity for you Nov 23 13:20:34 I440r: the only reason the function takes a float is because it CAN be dpi related. The fact that your application doesn't require it to be is irrelevant. If you just want to use integer values - just use integer values. Nov 23 13:21:08 If you go into McDonalds to order a cheeseburger, does it confuse you that you can ask for no onions, or no sauce? No, you just ignore the extras you don't require and use what you want Nov 23 13:21:35 you only want to use integer values, just use integer values, ignore the fact that you can pass non-integer values Nov 23 13:23:48 later Nov 23 14:19:41 as i scroll down my listview, views that i have programatically set settext using inf from a cursor are disappearing. where should i look first? Nov 23 14:23:18 http://pastebin.com/4Z8QpeNW setCurrentEvent is where the textview that is disappearing is set Nov 23 14:26:49 I am writing p2p stuff for my computer and I want to include my phone on the work. Is it easy to make the phone act as a server? Nov 23 14:32:09 Hi all. Nov 23 14:32:31 I have a question about Google Analytics for iOS, where should I ask? Nov 23 15:45:06 Hmm. Has anyone else noticed that ListViews show more padding above an item than below? Nov 23 15:45:19 If I set padding to be 20dp, the gap above looks bigger than that below. Nov 23 15:51:43 TacticalJoke: is the text view (or whatever you have as the list item) taller than the text it shows? Nov 23 15:52:25 e.g. if you have a 20dp text box, but the text inside only displays at 15dp and is aligned to the bottom, you'll have an apparent 5dp more padding at the top, but 5dp of taht is actuall in the text viwe Nov 23 15:57:21 I'm following this tutorial http://developer.android.com/training/camera/photobasics.html#TaskPath Nov 23 15:58:17 the very last step seems so unsafe around the normal flow of an activity, I have to place it inside onWindowFocusChanged() to be able to have it not crash because of a divide by zero (view not being ready yet) Nov 23 15:59:13 Hmm. It doesn't seem to be the case that the TextView is higher than it needs to be. Nov 23 15:59:28 It has a layout_height of match_parent. Nov 23 15:59:39 The TextView just seems to have an extra few pixels on top. Weird. Nov 23 15:59:56 Maybe on extra dp. Nov 23 16:01:18 hi guys Nov 23 16:01:19 :) Nov 23 16:01:21 good morning Nov 23 16:01:42 People on SO are talking about this. Nov 23 16:01:45 Seems to be a TextView thing. Nov 23 16:02:07 set a solid color bg for textview and check it visually Nov 23 16:03:14 Using [android:includeFontPadding="false"] fixes it. Nov 23 16:03:26 Yeah, I drew a line around the TextView. The above is the fix. Nov 23 16:03:56 users can use different system fonts, how will that affect it Nov 23 16:04:15 Yeah, I'm not sure that it's a good idea to set this attribute. Nov 23 16:04:24 It seems to relate to accents and so on. Nov 23 16:30:33 Hi people. How can I take screenshots in nexus 4 with lollipop ? power + volume down doesn't work any more! Nov 23 16:31:21 Should a fragment ever perform fragment transactions inside of said fragment? Like I have a listFragment, then onListItemClick I want to show the detail fragment. Do I do that in the listFragment or the Activity hosting it? Nov 23 16:31:38 can you hook up to pc and take shot with ddms Nov 23 16:32:39 can create interface that activity implements to say to show display Nov 23 16:32:56 detail* Nov 23 16:33:00 thankss whatitis- ! Nov 23 16:33:23 I have this strange bug in my app: https://dl.dropboxusercontent.com/u/25202446/corruption.png Nov 23 16:33:37 when I push the back button the listview shows old and new data overlayed Nov 23 16:33:54 doesn't happen always, although I always clear my adapater before adding new items Nov 23 16:34:08 Has anyone ever seen something like that? Nov 23 16:34:09 whatitis-: Yeah, but is that the convention...? Or can I just do it both ways? Because lets say I don't use a list Fragement... I just have a regular fragment and the fragment has 5 different buttons... and they all start a different fragment... would I create an interface for all 5 buttons? Nov 23 16:34:21 Beket, reboot it, and try again (power + volume down = hold for 2 secs) Nov 23 16:34:54 eghdk, you define your interface any way you want Nov 23 16:35:07 if similiar actions use on method put pass an arg Nov 23 16:35:28 one method* Nov 23 16:35:37 Sculptor, thanks. Indeed rebooting made it work again. Weird. Nov 23 16:35:49 Understood. But should I just do this in a fragment? getActivity().getFragmentManager().blah.blah? Or is that "bad"? Nov 23 16:36:10 your activity should load the fragments, a fragment shouldnt load anything. it should just provide info Nov 23 16:36:19 o/ Nov 23 16:36:42 keep em seperate, dont give your fragment control of activity, just pass data Nov 23 16:37:12 I found how do you send file on wifi direct when you are connected on both device. But is there a way to connect programatically without need to user to connect? Nov 23 16:37:36 keeps it modular and reusable Nov 23 16:38:37 whatitis-: got it. thanks! Nov 23 16:38:41 yoavst, you just have the devices discover, connect and send Nov 23 16:38:55 whatitis-: http://developer.android.com/training/connect-devices-wirelessly/nsd-wifi-direct.html this? Nov 23 16:39:46 wifi direct doesnt need user input, just needs wifi enabled and that the device can scan or host a connection Nov 23 16:40:09 the link I've send is how to do that? Nov 23 16:41:01 maybe, im not gonna look as, your question has been answered. there is a wifi direct tutorial on google, plus think sample in sdk Nov 23 16:41:43 so try things out, then come back after trying Nov 23 16:42:44 Has anyone looked at my screenshot ? :P Nov 23 16:44:04 yes, reminds me of using gridview and having height set to wrap content, that just didnt work. but if using listview can you say that screenshot is of different list data overlapping? Nov 23 16:44:20 I dont understand the language Nov 23 16:44:34 I want to get the current time in UTC, compare it to an arbitrary time in UTC, and figure out the difference in hours, minutes, seconds, etc. Should I be using Joda-Time? Nov 23 16:44:47 I show some data in the listview, I switch fragment, show some other data (everything fine till now), back to 1st fragment, data overlayed Nov 23 16:45:12 so those list are in two seperate fragments? Nov 23 16:45:34 if so then your fragment management is off Nov 23 16:45:40 it's 1 fragment with 1 listview Nov 23 16:45:58 1 fragment loaded twice? Nov 23 16:46:07 you said you switch fragments Nov 23 16:46:24 yes, I think 1 fragment loaded twice. Nov 23 16:46:39 I add it to backstack and then I return to it Nov 23 16:47:11 I just don't know how to debug it Nov 23 16:47:13 Beket: Can you show the code for the Activity that's adding and replacing? Nov 23 16:47:22 then start with checking you are removing or not readding same fragment with new data. try to discern how many fragments are visible Nov 23 16:47:26 Yeh TacticalJoke -- hold on a sec Nov 23 16:47:55 man this code has a line wrong, http://developer.android.com/training/camera/photobasics.html Nov 23 16:48:03 / Save a file: path for use with ACTION_VIEW intents Nov 23 16:48:03 mCurrentPhotoPath = "file:" + image.getAbsolutePath(); Nov 23 16:48:09 it should be without "file:" Nov 23 16:48:44 https://dl.dropboxusercontent.com/u/25202446/fragment.png Nov 23 16:49:01 that...font Nov 23 16:49:03 that IDE! Nov 23 16:49:04 An image... lol. Nov 23 16:49:07 what're you using? Nov 23 16:49:21 you TOOK A SCREENSHOT OF THE CODE?! Nov 23 16:49:22 haha! Nov 23 16:49:32 I thought it would be more appealing to the eye Nov 23 16:49:33 I just realized! Nov 23 16:49:35 due to code highlighting Nov 23 16:49:44 You can post on pastebin.com, BTW. Nov 23 16:49:49 pasties all have code highlighting Nov 23 16:49:53 What about the code that's calling FragmentTransation.add? Nov 23 16:50:06 http://pastebin.com/ ;D Nov 23 16:50:43 I don't think I have any add() calls Nov 23 16:50:54 You have a fragment defined in a layout XML file? Nov 23 16:51:25 yes Nov 23 16:51:31 should I post it ? Nov 23 16:51:31 I think you have to dynamically add() if you're using replace(). Nov 23 16:51:36 Else you get the problem you're seeing. Nov 23 16:51:37 ah Nov 23 16:51:39 Oh, no need. Nov 23 16:52:34 Maybe in onCreate, say "if (savedInstanceState == null) { getFragmentManager().beginTransaction().add(new WhateverFragment()); }". Nov 23 16:52:40 Maybe, * Nov 23 16:53:00 .commit(); Nov 23 16:53:12 After I inflate my layout ? Nov 23 16:53:25 Yeah. Nov 23 16:53:29 Is there any expert here for "retrofit"? Nov 23 16:53:52 SimonVT, really, here is a question from http://developer.android.com/training/camera/photobasics.html . Look at SetPic(). What if I want to use that method inside an adapter and I want (upon loading the activity) to populate its listview with text and image (images already have been taken and I have the path) Nov 23 16:53:54 but if fragment is defined in xml, it is automatically added to manager Nov 23 16:54:15 it will throw arithmetic exception because of divide by zero, cause in getView() the views havent been measured yet, what do you do Nov 23 16:54:20 whatitis-: Yeah, but you can't replace() it dynamically without issues. Nov 23 16:54:31 At least from what I've seen. Nov 23 16:54:36 there is no adding or replacing Nov 23 16:54:42 it is static Nov 23 16:54:46 Right. Nov 23 16:54:52 He's trying to replace it dynamically. Nov 23 16:54:58 Which causes the kind of issue he sees. Nov 23 16:55:06 then yes he will fail :) Nov 23 16:55:29 whatitis- knows what it is Nov 23 16:55:34 fosho Nov 23 16:55:41 :) Nov 23 16:55:56 look at my question then Nov 23 16:56:02 haha Nov 23 16:56:04 :D Nov 23 16:56:33 cause I just got around to following the docs like a bible, I dont want vogella or some other shit Nov 23 16:57:08 if upon loading activity and you are calling a method in adapter, wait til listview has adapter set til you call a method that depends on adapter having data Nov 23 16:57:45 part of the whole setting of data into a listview from the adapter, is setting this image Nov 23 16:57:52 so it's like waiting for waiting Nov 23 16:57:59 I added() in onCreateView(). It didn't really help http://dl.dropbox.com/u/25202446/worse.png Nov 23 16:58:10 Are many fragments shown simultaneously ? Nov 23 16:58:11 I had to place that method in onWindowFocusChanged() to get it to work in the activity Nov 23 16:58:18 I mean, is it a fragment issue or a listview issue?? Nov 23 16:58:21 sorry for the double '?' Nov 23 16:58:30 then make that image part of data, if you are relying on the view for adapter having a size, if size=0 ignore Nov 23 16:58:40 the getview gets called often Nov 23 16:58:45 true Nov 23 16:58:47 good Nov 23 16:59:17 or have a task spawn off to lazy load, or post runnable with delay Nov 23 16:59:33 In onCreateView? Nov 23 16:59:40 yep Nov 23 16:59:49 How does that make sense? Nov 23 16:59:54 Activity doesn't have onCreateView. Nov 23 17:00:03 Add in Activity.onCreate. Nov 23 17:00:27 http://pastebin.com/QvGNE7EJ Nov 23 17:00:34 oh Nov 23 17:00:45 sorry Nov 23 17:03:05 ok I added it in the activity's on create. Still happens Nov 23 17:03:21 Is it that I end up with 2 fragments in the same activity ? Nov 23 17:03:25 Can you show the code of the whole Activity? Nov 23 17:03:28 Yes. Nov 23 17:03:40 You've ended up with one (or more) Fragment on top of another. Nov 23 17:03:55 The code is embarassing and I don't have a minimal working example Nov 23 17:03:57 Fragment(s)* Nov 23 17:04:07 ok, then I'll try to read more on fragment management Nov 23 17:04:09 thanks! Nov 23 17:04:09 Working code is less embarrassing. ;D Nov 23 17:04:21 beket if defining fragment in xml you dont have to add. it is automatically added, you just need to find it in fragmentmanager Nov 23 17:04:33 If defining in XML, you can't replace. Nov 23 17:04:44 Beket: Are you sure you removed it from the XML file? Nov 23 17:04:50 I'm guessing you didn't. Nov 23 17:04:55 Hence the problem actually getting worse. Nov 23 17:05:08 Oh, I define it in XML Nov 23 17:05:12 duh Nov 23 17:05:34 as I expected, getView only gets called when you scroll and items get out of view Nov 23 17:05:38 so until that happens, you have no image Nov 23 17:05:51 only time to use add and replace is if you define a container in xml to add replace to Nov 23 17:06:07 oh, so I have to programmatically build my fragment ? Nov 23 17:06:20 Just add a new Fragment. Nov 23 17:06:22 Like how you replace. Nov 23 17:06:52 if (savedInstanceState == null) { getFragmentManager().beginTransaction().add(new WhateverFragment()).commit(); } Nov 23 17:07:07 0daym, just lazy load, or simply call a postDelayed on imageview, but add a tag to the imageview so upon scrolling if tag isnt equal to what is loading then ignore Nov 23 17:07:17 I also have override onBackPressed() to popBackStack() when user hits the back button, because if I didn't the back button would exit my app Nov 23 17:07:23 TacticalJoke, ah hold on, perhaps I forgot .commit Nov 23 17:07:24 sounds pretty but I dont know how to do that Nov 23 17:07:36 You shouldn't need to override onBackPressed. Nov 23 17:07:44 Im probably going to iterate over the listview after setting its adapter, and for every imageview setPic() on it Nov 23 17:07:50 there are a few libraries, but just google lazy loading Nov 23 17:08:15 The fact that the Back button would exit your app is just a symptom of the problem. Nov 23 17:08:59 ok, I nucked the onBackPressed() override and I added the creation of a new fragment when the activity is created Nov 23 17:09:18 Are you add()ing only when savedInstanceState is null? Nov 23 17:09:24 yes Nov 23 17:10:04 I sent you a pm TacticalJoke :D Nov 23 17:10:11 I found this http://stackoverflow.com/questions/541966/lazy-load-of-images-in-listview Nov 23 17:10:32 I think if I disregard the getting from Internet part and just simply get from sdcard, it will work Nov 23 17:10:58 That's really cool, adq. :) Nov 23 17:11:08 :)) Nov 23 17:11:08 0daym depending on the amount of images and size, you can also create a cache Nov 23 17:11:13 I wish I were artistic. Nov 23 17:11:27 I love the look. Nov 23 17:11:29 either do I ;) Nov 23 17:11:30 there are many options depending on your detailed needs Nov 23 17:13:09 TacticalJoke, thanks, it's still is buggy, but at least something changed :) Nov 23 17:13:36 perhaps I shouldn't add fragments in the backstack? Nov 23 17:13:45 and just add() them ? Nov 23 17:14:10 if i want to fill a grid view with pictures from the internet, for which i have to first parse the urls, how would i approach that? The parsing cant be done in the main thread. That means i have to do it in an asyncTask. But that would mean my main program would start to create the gridview without having access to the pictures(missing urls). I also cant stop the main thread, because that would freeze the ui :/ Nov 23 17:14:18 it's Odaym by the way, not 0daym, everybody wants me to change to 0daym Nov 23 17:14:49 Beket: You shouldn't be calling addToBackStack when calling add, I think. Nov 23 17:15:12 i am also not allowed to fill the gridview in the asyncTask, because someone told me UI interaction is not allowed outside the main thread Nov 23 17:15:14 beket if fragment is defined in xml, you shouldnt be adding at all Nov 23 17:15:29 whatitis-: He removed it from there. He can't have it there. Nov 23 17:15:30 He's replacing. Nov 23 17:15:38 The idea of having it in XML is a no-go. Nov 23 17:15:44 k Nov 23 17:17:09 day sure you can, you get your data in doInBackround then on post set your data for adapter from results Nov 23 17:17:33 hi, i'm having some issues getting my app to compile for android-tv. is anybody farmilliar with the process? i'm following the guide on developer.android.com, and now teh build is spitting an error at me Nov 23 17:17:45 Error:(18) No resource identifier found for attribute 'banner' in package 'android' Nov 23 17:17:47 whatitis-: what does 'on post set' mean? Nov 23 17:18:04 whatitis-: does it queue the task behind the asynctask? Nov 23 17:19:22 He means AsyncTask.onPostExecute. Nov 23 17:19:30 That runs on the main thread. You can do UI stuff there. Nov 23 17:19:55 AsyncTask.doInBackground runs on a background thread. Nov 23 17:19:58 oh, derp. i had to change build.gradle to "compileSdkVersion 21", in case anybody else comes across this. Nov 23 17:20:39 day: It's really simple. Just do slow stuff in doInBackground. Nov 23 17:22:13 After doInBackground finishes, AsyncTask posts a message to the UI even loop to run a particular method. Nov 23 17:22:18 event* Nov 23 17:22:35 ah i see. so the onpostexecute is in the doInBackground but it does run in the mainthread? Nov 23 17:22:58 whatitis-, this is not very simple. if I don't scale, I run out of memory quickly Nov 23 17:23:14 AsyncTask.doInBackground runs in a background thread; AsyncTask.onPostExecute runs in the main thread. Nov 23 17:23:24 The latter happens after the former has completed. Nov 23 17:23:25 and if I want to scale, I have to avoid the zero and if I want to do that, I have to wait for getView to be called again, so you have to wait until you scroll at least once Nov 23 17:23:36 TacticalJoke: yes i figured. Nov 23 17:25:29 bbl anyways, thanks Nov 23 17:31:20 I removed all the add to back stack() calls and the onBackPressed() override. All my bugs are gone, and I'm left with the annoyance that since I replace frags and I don't add them, when the user hits the back button in central activity the app exits Nov 23 17:31:28 instead of navigating back to the replaced fragments Nov 23 17:31:49 It shouldn't exit. Nov 23 17:32:16 Are you calling addToBackStack when (and only when) replacing? Nov 23 17:32:29 yes, since I'm adding it in onCreate() it shouldn't but it does:D Nov 23 17:32:42 Now I'm not calling addToBackStack() at all Nov 23 17:32:46 That's why. Nov 23 17:33:02 but addToBackStack() is that caused me the bug at the first place Nov 23 17:33:12 I don't think it was. Nov 23 17:33:19 Use addToBackStack when replacing. See what happens. Nov 23 17:33:30 ok, I'll try it .. Nov 23 17:33:31 The problem was that you were trying to dynamically replace a static fragment. Nov 23 17:33:55 BTW, you don't have to state "addToBackStack" four times in that code. Only once. Nov 23 17:34:06 Wait, ignore that. You were specifying a tag. Nov 23 17:34:11 I guess you do have to do it four times. Nov 23 17:34:39 Though you probably don't need to specify anything there. Nov 23 17:37:15 this is my code http://pastebin.com/1etS3zXD Nov 23 17:37:45 The indentation is a bit messed up, sorry Nov 23 17:39:15 You're now adding to the container. Nov 23 17:39:30 .add(R.id.container, whatever) Nov 23 17:39:33 not* Nov 23 17:40:36 ugh, acra and art don't play well together Nov 23 17:42:31 oops, added it. But back button still messes everything up Nov 23 17:43:14 let me addtobackstack Nov 23 17:43:17 The thing is, you're not *always* calling addToBackStack. Nov 23 17:43:22 ah no, I already do Nov 23 17:43:31 hm, ok, I'll take care of that Nov 23 17:43:39 When the user selects "Log In", for example. Nov 23 17:43:53 Or "Settings". Nov 23 17:44:07 Or when your activity gets a callback. Nov 23 17:44:10 And so on. Nov 23 17:45:24 Or maybe you're not wanting to add to the backstack in those places. Hmm. Nov 23 17:45:28 back stack* Nov 23 17:46:37 all I wanted to is to have a central activity with 1 fragment. And that fragment is "replaced" by w/e the user selects in the navigation drawer menu Nov 23 17:46:55 that works pretty well if I just replace() without adding to back stack Nov 23 17:47:34 but then I wanted to allow the user to navigate 'back', but I realized that I was replacing fragments and not adding them anywhere so there was not 'history' of them Nov 23 17:48:39 replace removes and adds, its just a wrapper method Nov 23 17:49:07 but there has tobe an in Nov 23 17:49:14 intial add Nov 23 17:52:49 I wonder what's the purpose of displayView() there (the code is auto generated by android studio) Nov 23 17:53:39 it does't seem to get called Nov 23 17:57:42 I used to be a good programmer. I can't adapt to new technologies Nov 23 17:59:49 Hello. I use am android-studio and pushing code to bitucket. I want my APK to be downloadable by others without needing to be compiled first. what is the correct way to do this Nov 23 18:00:37 Android isn't really that easy, Beket. Nov 23 18:01:47 It's just... weird. Nov 23 18:10:15 https://gist.github.com/pfn/fe413aea7bfe94fb3403 Nov 23 18:10:18 Also it doesn't help that I google + try random things. I need to read the docs from A to Z Nov 23 18:10:20 ugh, damnit proguard, why you screw me like that Nov 23 18:10:43 For how long have you been doing Android programming, Beket? Nov 23 18:11:37 TacticalJoke, I wrote 1 app for 2.x in 3-4 months, then I did other things for a year, and now decided to upgrade the app to 4.x (convert activities to fragments). So basically ~6months Nov 23 18:12:00 That's not a huge amount of time. Nov 23 18:16:51 ok, I think I fixed it, thanks for the patience Nov 23 18:16:55 oh, sweet, proguard 5.1 fixed that bug Nov 23 18:17:10 It must be depressing to hang around here and listen to every random people rants Nov 23 18:17:48 pfn, if you don't use ACRA don't you get crash reports automatically from google to developer's console ? Nov 23 18:19:36 I find it validating to listen to some of the rants. Nov 23 18:19:51 Android can be such a pain. It's reassuring knowing that others feel the same pain. lol Nov 23 18:20:02 That group-psychology thing. Nov 23 18:20:38 Beket, no Nov 23 18:20:38 can using Android Studio with JDK 8 on a mac cause any problems? Nov 23 18:20:38 Beket, you only get people explicitly reporting bugs Nov 23 18:21:26 pfn, don;'t you ask for user permission with ACRA as well? Or just send the report without user knowning ? Nov 23 18:21:33 TacticalJoke :) Nov 23 18:21:44 Beket, currently just send, future versions will include an opt-out checkbox Nov 23 18:21:56 Beket, and this is not limited to acra Nov 23 18:22:05 but all crashreporting, most don't notify the user or ask for permission Nov 23 18:22:12 crashlytics, crittercisms, etc. Nov 23 18:22:25 ok, so how does it differ from google's report the ACRA+checkbox combo ? Nov 23 18:22:37 automatic vs. manual Nov 23 18:22:45 all reports, not just those installed from play store Nov 23 18:22:50 ah ok Nov 23 18:23:16 I used ACRA in my old version, but now I just removed it. Less code, less bugs :P Nov 23 18:23:19 Hmm. System.currentTimeMilis() is giving me stuff like "1,416,766,895,142", while Reddit is giving me stuff like "1,416,755,371". Nov 23 18:23:25 Millis* Nov 23 18:24:46 eeyup Nov 23 18:24:59 tutorial gives other Math.random() number than my Math.random() Nov 23 18:25:02 what do i do wrong Nov 23 18:25:22 They should be very similar numbers. Nov 23 18:25:41 Not sure why one is 1,000 times the other. Nov 23 18:25:56 one gives millis, the other seconds Nov 23 18:26:06 Duh. lol Nov 23 18:26:09 I just figured that out as you typed it. Nov 23 18:26:12 My brain isn't functioning. Nov 23 18:26:15 good for you Nov 23 18:26:23 Good for me? Nov 23 18:26:33 you figured it out Nov 23 18:26:59 Only because you're so helpful, Ashiren. Nov 23 18:27:56 or you could try rubber duck debugging Nov 23 18:28:13 What would this channel do without Ashiren? He's a shining star. Nov 23 18:28:16 Or she. Nov 23 18:28:29 joke of the day: Nov 23 18:28:31 * xnomar (~xnomar@cpe-75-82-208-16.socal.res.rr.com) Quit (Read error: Operation timed out) Nov 23 18:28:32 he Nov 23 18:28:32 :s Nov 23 18:28:38 quick, fire the surgeon! Nov 23 18:28:41 :D Nov 23 18:29:22 Beket, there's no real advantage to removing it Nov 23 18:39:55 hello Nov 23 18:40:29 anyone around? Nov 23 18:40:43 I'm arond Nov 23 18:40:45 around* Nov 23 18:40:52 ok Nov 23 18:40:55 I need some help Nov 23 18:41:06 it's tangentially related to android in that it's going in an app Nov 23 18:41:07 What's wrong ? Nov 23 18:41:27 So I made a system where a user can invite another user Nov 23 18:41:49 it's all shit by the way, I hate that you can't have special coupon codes in Google Play Nov 23 18:42:00 Anyway here's the way it works: Nov 23 18:42:28 User signs in, user sends a request to my server, my server generates an access code and sends an email to the friend Nov 23 18:42:59 then the friend goes and downloads the game, and has an option to input the access code Nov 23 18:43:11 so right now it's a 5 character alphanumeric code Nov 23 18:43:44 But I'm thinking maybe I could, instead of characters, use images or symbols Nov 23 18:44:06 simplest way would be to have maybe 20 symbols, and then you choose 4 out of them in any order Nov 23 18:44:51 that provides 4845 combos Nov 23 18:44:59 probably needs more Nov 23 18:45:29 maybe something like 24, should be enough Nov 23 18:45:39 or another way is to have them go in a specific order Nov 23 18:46:33 what do you think about this Nov 23 18:46:38 should i make my code graphical? Nov 23 18:47:19 any opinion? Nov 23 18:47:21 none? Nov 23 18:49:50 Why? Nov 23 18:49:59 why what? Nov 23 18:50:03 What benefit would using images give? Nov 23 18:50:21 Oh, it makes the experience more classy and less cumbersome Nov 23 18:50:38 for example, less of a chance to accidentally do an autocomplete Nov 23 18:50:58 You find remembering a 4-digit number more cumbersome than remembering the order of 4 images. Nov 23 18:51:07 I didn't say they were numbers Nov 23 18:51:16 alphanumeric Nov 23 18:51:16 but Nov 23 18:51:21 And if you use the correct keyboard, there shouldn't be any chance of autocomplete Nov 23 18:51:21 maybe a number is better Nov 23 18:51:28 it's not up to me Nov 23 18:51:32 I'm using Swype Nov 23 18:51:37 well, 4 length alphanumeric upper and lower is probably more secure. Nov 23 18:51:42 in that there are more combinations Nov 23 18:51:54 But I honestly dont see the appeal of using 4 images. Nov 23 18:51:54 I'm on the note4 Nov 23 18:52:02 I'd actually prefer alphanumeric. Nov 23 18:52:04 and it just feels sluggish when doing it Nov 23 18:52:09 I'd find images more cumbersome. Nov 23 18:52:15 I see Nov 23 18:52:48 Im so used to remembering letters and numbers Nov 23 18:52:51 Less so with images. Nov 23 18:53:09 You are biased. Nov 23 18:53:12 Then you'd also have to deal with colourblindness. Some images might appear very similar to other people. Nov 23 18:53:23 Yes, but so would 99% of your user base be. Nov 23 18:53:33 Nah I am not so sure Nov 23 18:53:34 They would also be more familiar with remembering letters and numbers than images. Nov 23 18:53:50 i just have a very high incidence of accidental autocomplete Nov 23 18:53:56 Then perhaps you are biased? Nov 23 18:54:05 I see Nov 23 18:55:50 vassup its me bruno Nov 23 19:01:11 Hmm. I'm guessing that calling System.currentTimeMillis over and over in a loop is gonna be slow. Nov 23 19:01:31 not really, but calling it for no reason is kinda pointless Nov 23 19:01:54 I'm writing a custom on-click listener. It is used to animate a menu to slide in on the screen. However, I need to access the different Views in the listener. Is it bad form to add a reference to the activity in the custom listener (as a private field)? Nov 23 19:02:13 So I can use findViewById. Nov 23 19:02:17 I need to figure out the current epoch time every time I display a Reddit post/comment. Do you think I should do it once per listing? Or is it fast enough to do it once per post/comment? Nov 23 19:03:04 There might be 500 comments. Nov 23 19:03:22 Why do you need to call it so many times? Nov 23 19:03:23 The choice is 500 System.currentTimeMillis calls or one. Nov 23 19:03:48 The Reddit server just gives me the epoch time of the post/comment. I have to compare it to the current time. Nov 23 19:04:13 patrisk: Couldn't you use a nested class for that? Nov 23 19:04:23 Nested classes can access outer instances. Nov 23 19:04:27 As long as they're non-static, of course. Nov 23 19:04:38 I could, but I plan on re-using the listener for other views. Nov 23 19:05:02 And I figured it would be better to not copy&paste the same listener in multiple activities. Nov 23 19:05:12 Wouldn't one call to get epoch-time suffice? Nov 23 19:05:25 Yeah. It'd make code more complex, though. Not sure which approach is best. Nov 23 19:05:44 If I call it once, I might have to create some kind of "time cache" object to avoid annoying parameter passing. Nov 23 19:05:58 And say something like "timeCache.cacheTimeNow();". Nov 23 19:06:26 (Which sounds weird. lol) Nov 23 19:06:27 I figure my approach is wrong because I use it to animate the menu, which could be done somewhere else. Nov 23 19:06:44 patrisk: I think your use case is *not* reusable. Nov 23 19:06:49 It's tied to each activity. Nov 23 19:07:22 I was thinking of writing an animate class that handled the menu animation and then dropping the custom on-click listener and just reuse that class. Nov 23 19:07:23 Maybe I'm wrong about that. It just seems like one of those cases. Nov 23 19:08:24 Well you might be right. It's written to handle two resource ids. One is the button and the other is a wrapper for the menu. I figured if I pass those values when it is created I could re-use it. Nov 23 19:08:57 Could you pass the Views? Nov 23 19:08:59 I suppose I could just pass the views directly. Nov 23 19:09:08 Hehe, yeah. I think I could. Nov 23 19:09:16 Maybe you could create some kind of "View holder". Nov 23 19:09:26 Not sure, though. Nov 23 19:09:50 Something like "public class AnimatableViews { private View foo; private View bar; [...] }". Nov 23 19:09:53 And pass that. Nov 23 19:10:17 AS studio has started using 80% CPU when idle :( Nov 23 19:10:42 Since that's in the plural, that's bad naming, though. Nov 23 19:10:42 I'm going to give it a shot, TacticalJoke. Nov 23 19:10:56 AnimatableViewHolder. Nov 23 19:11:28 What I might do for my issue is have a "lastListingTime" global variable. Nov 23 19:11:39 And any listing-item class (e.g., post/comment) consults that. Nov 23 19:11:49 The contract is that it has to be set at the start of a listing. Nov 23 19:11:51 Kinda ugly, though. Nov 23 19:12:28 Or it could be a field in the adapter. Nov 23 19:12:39 hrm Nov 23 19:13:09 one would think that they could write the tutorials a little better, but eh... Nov 23 19:14:02 ability to think is why android devs get the big bucks Nov 23 19:14:29 yeah. i figured a couple things out on my own in my tutoriali project Nov 23 19:15:08 now, im not quite understanding how to use R (as in, resource) in the app, android studio doesnt know what it is yet Nov 23 19:15:10 Android is difficult, IMO. Nov 23 19:15:18 Largely because of the not-so-amazing documentation. Nov 23 19:15:36 Android Studio doesn't know what it is? Nov 23 19:15:44 well, i mean Nov 23 19:15:46 It's some auto-generated thing relating to resources. Nov 23 19:15:55 cannot resolve symbol R Nov 23 19:16:11 Did you create a new package? Nov 23 19:16:21 AC-130U, fix your compile errors and R will appear Nov 23 19:16:44 if R isn't generated it's probably because it cannot be due to resource errors Nov 23 19:16:54 ah Nov 23 19:16:55 I'm really pissed off by 2 things right now Nov 23 19:17:01 i think i know where the error is Nov 23 19:17:05 PlaceHolderFragment Nov 23 19:17:28 First, that I can't get a simple Google Play ID without asking the user for their email address, full name, and where they have that tatoo on their body. Nov 23 19:18:12 Second, that I can't make google play downloads have a Nov 23 19:18:17 coupon code Nov 23 19:18:38 I read that iOS got them this year Nov 23 19:18:43 after years... Nov 23 19:18:52 wonder why Google Play doesn't. Nov 23 19:19:08 Becuase banana yield was low this year. Nov 23 19:19:13 although I did get a "free" gravity download a few days ago Nov 23 19:19:21 so really, they have the capability Nov 23 19:19:26 they just don't want to give it to us Nov 23 19:20:03 what could possibly be the reason? Nov 23 19:20:45 if you offer the download outside of google play Nov 23 19:21:02 the download won't get counted, right? Nov 23 19:21:18 so it's all FUBAR Nov 23 19:21:44 in other words Nov 23 19:21:53 Google Play: SNAFU Nov 23 19:26:26 https://twitter.com/agamemnus_dev/status/536601573259235329 Nov 23 19:35:01 whatitis-, PICASSO Nov 23 19:35:03 http://square.github.io/picasso/ Nov 23 19:37:55 what an amazing library Nov 23 19:40:32 Ok Nov 23 19:40:58 I see Nov 23 19:53:03 im trying to use the onPostExecute but I'm having trouble understanding how the asynctask result is passed into onPostExecute http://dpaste.com/0ECNVPM Nov 23 19:55:33 day: return "hello"; or sth? Nov 23 19:55:43 try using some ide Nov 23 19:56:42 squirrel: well yes return result; is pretty much that Nov 23 19:57:30 the onPostExecute(String result) cant be correct. Im never actively calling that function/ nor passing the string to it. It just expects a string, but where does it come from? Nov 23 19:58:15 day, the string you get as a parameter is the string you return in doInBackground. Nov 23 19:59:23 Mavrik: that is handled automatically then? the onPostExecute is automatically called? and receives the return result from doInBackground? Nov 23 19:59:46 yes. Nov 23 20:00:26 i see. ty Nov 23 20:06:16 I am writing p2p stuff for my computer and I want to include my phone on the work. Is it easy to make the phone act as a server? Nov 23 20:13:13 ,0\ Nov 23 20:19:48 mobile piratebay Nov 23 20:19:49 fun Nov 23 20:22:15 hey, how can i have multiple alignments in a horizontal layour Nov 23 20:22:24 i want one item to alight left, another right Nov 23 20:22:36 inside of a horizontal layout Nov 23 20:23:04 ? Nov 23 20:23:12 just add a spacer between them Nov 23 20:23:40 and make the horizontal layout take up the entire width of its container Nov 23 20:23:59 though depending on what you're doing you may want to switch to a single RelativeLayout, idk Nov 23 20:24:11 well, im doing it programmatically Nov 23 20:24:23 you do it the same way programmatically that you do it in xml :/ Nov 23 20:25:26 can a spacer tkae up the whole row but leave room for the item to be displayed? Nov 23 20:25:54 How do I (A) locate what sounds come standard with Android (4.4) (B) play the sound? - I need short sounds for (X) errors (Y) timeouts (Y) success Nov 23 20:25:57 gobl: you can also use android:layout_gravity Nov 23 20:26:01 gobl: yes, via 'weight' Nov 23 20:26:11 i dont understand how async tasks and threading goes well with oop. The waiting for data forces me to basically program procedual, because i have to do my tasks viaa runOnPostExecute. :/ Nov 23 20:26:17 alright ill play around with it Nov 23 20:26:19 thanks Nov 23 20:26:36 * Nivag dosen'tknow his alphabet! :-( :-) Nov 23 20:26:41 Hi, anyone there was successful setting up the roboletric plugin? Tried to set it up, but now when i run tests they don't seem to find my source classes. I believe it's a problem with my gradle file Nov 23 20:26:57 a, b, 3 Nov 23 20:27:07 the result is a main object blob, that has sub object blobs, i dont think thats how it is supposed to be?!? Nov 23 20:27:26 Has anyone gotten scala + android studio to work? Nov 23 20:27:28 well Nov 23 20:27:39 Nivag: you can scan the device with MediaStore for non-music type sound files Nov 23 20:27:44 i think ideally you create ythe blob object inside the thread Nov 23 20:27:50 not the other way around Nov 23 20:28:16 well but then comes the UI which is only allowed to be modified in the main thread :D Nov 23 20:28:30 yeah, thats just how id do it in python.... Nov 23 20:28:40 android is not very clean code Nov 23 20:28:40 me as well Nov 23 20:29:00 just look at how you pass objects between activities Nov 23 20:29:03 its a mess Nov 23 20:29:07 so... idk Nov 23 20:29:18 in fact Nov 23 20:29:26 the whole of java is a mess Nov 23 20:29:31 o ha..if i stumble across that after a few days...i dont wanna know what else is going to come :X Nov 23 20:29:37 To be fair, multithreading being messy is not an Android issue. Nov 23 20:29:44 Multithreaded code is messy everywhere. Nov 23 20:29:47 Android is actually good here. Nov 23 20:29:57 Try multithreading in C. Horrible. Nov 23 20:31:03 never tried... Nov 23 20:31:11 if it wasn't for C nothing would exist ;) Nov 23 20:31:27 yeah, only used c in embedded stuff Nov 23 20:31:39 Wouldn't the universe exist? Nov 23 20:31:41 so, normally that stuff is handled by the rtos Nov 23 20:31:53 multithreading in C is fine :/ Nov 23 20:32:11 and if you don't understand how to do it in C, you're going to do even worse stuff in languages that handle that stuff for you Nov 23 20:32:30 Yeah, multithreading in C is really fun. Nov 23 20:33:45 Okay, I'm being sarcastic. While C is good at what it does, writing a multithreaded C program is hardly anyone's idea of a good time. lol Nov 23 20:33:53 I remember writing something using native sockets and threads. Ugh. Nov 23 20:37:50 Hmm. If a post is one hour and 59 minutes old, Reddit states that it was posted "1 hour ago". Nov 23 20:38:52 create a more accurate external observer to keep track of it Nov 23 20:39:10 I guess it needs t be older than 1:59:59.999 to qualify for being 2 hours or more? :-) Nov 23 20:41:34 we're gonna find out there are no good reddit clients not because the programmers suck, but because reddit sucks Nov 23 20:41:37 At what point past one hour should a post be considered two hours old? Nov 23 20:41:50 1 hour and 50 minutes? Nov 23 20:42:18 sounds good Nov 23 20:42:20 This is one of those legal-drinking-age questions. Nov 23 20:42:31 20 years and 364 days. Nov 23 20:42:50 The thing is, it's so arbitrary. Nov 23 20:42:58 Then again, picking "1 hour" is also arbitrary. Nov 23 20:43:47 I could show "x hours, y minutes", but does anyone really care about minutes? Nov 23 20:43:51 Hmm. Maybe they do. Nov 23 20:44:12 But if you have at least an hour, you probably don't care much. Nov 23 20:44:21 I dont know Nov 23 20:44:29 I know I'd prefer if Reddit showed minutes. Nov 23 20:44:37 Can I ask why? Nov 23 20:44:40 Just curious. Nov 23 20:44:52 it should have minute accuracy Nov 23 20:44:53 I can build a timeline of who said what when in comparison to another commenter Nov 23 20:45:06 In my mind Nov 23 20:45:19 Like who said what first Nov 23 20:45:24 particularly in response to another comment. Nov 23 20:45:35 Yeah. Nov 23 20:45:54 Or, particularly if I know I viewed some comments , and then looked 1hr and 20 mins later Nov 23 20:46:01 How do I know what was posted within that 20 min period? Nov 23 20:46:08 What I have and havent read before? Nov 23 20:46:24 True. That has annoyed me before. Nov 23 20:46:28 On Reddit proper. Nov 23 20:47:04 I think minutes should be given - no deeper though Nov 23 20:47:04 When it comes to days, though, we don't care about hours, do we? Nov 23 20:47:16 Yeah. Though if it's less than a minute I show seconds. Nov 23 20:47:19 What I'd say Nov 23 20:47:28 Is for every extra level up you provide, drop a level lower Nov 23 20:47:31 Give hrs and mins Nov 23 20:47:39 then when you add days just give days and hrs Nov 23 20:47:41 True. Could do that. Nov 23 20:47:45 then with weeks, just weeks and days Nov 23 20:47:48 haha Nov 23 20:47:51 ;-) Nov 23 20:47:53 Forget weeks. :D Nov 23 20:48:05 Haha :P emphasis of point Nov 23 20:48:08 Wait, maybe I do need to care about weeks/years. Nov 23 20:48:15 I think so Nov 23 20:48:20 Well Nov 23 20:48:30 If you think about really old posts Nov 23 20:48:34 years / months Nov 23 20:48:34 makes sense Nov 23 20:48:48 you could probably skip weeks though Nov 23 20:48:52 posts can be minutes, chat should be seconds Nov 23 20:48:53 so months/days Nov 23 20:48:54 Yeah, especially if people are looking at top posts. Nov 23 20:49:24 Yeah, the site shows years and months. I should support at least what the site supports. Nov 23 20:49:35 You writing a reddit client? Nov 23 20:49:41 Yeah. Nov 23 20:49:52 Can I ask how you are pulling the comments etc off? Nov 23 20:49:54 Curl? Nov 23 20:49:54 does anyone even care about post age accuracy <1h? Nov 23 20:50:00 I do. Nov 23 20:50:02 Just with OkHttp. Nov 23 20:50:09 Ahhh cool Nov 23 20:50:11 its just noise Nov 23 20:50:12 e.g., http://www.reddit.com/.json Nov 23 20:50:23 Just append ".json" to almost any Reddit URL. Nov 23 20:50:44 lol, DreamInCode Nov 23 20:50:47 day: Usually I don't. I think I sometimes care about comments, though. Nov 23 20:50:49 blast from the past Nov 23 20:50:54 Oh wow, I never knew that existed! Nov 23 20:51:06 Same here, till recently. :D Nov 23 20:51:06 To be honest, and with the greatest respect. Nov 23 20:51:10 It doesnt really matter what you care about. Nov 23 20:51:11 You can also try .xml. Nov 23 20:51:31 Its a matter of "is there going to be a significant number of users on my app who might care about it..." Nov 23 20:51:34 ?* Nov 23 20:51:36 of course it matters Nov 23 20:51:45 what you care about is what you're going to work on the most! Nov 23 20:51:47 I care about seconds Nov 23 20:51:48 If you are making the app only for you, of course. Nov 23 20:51:49 Show seconds Nov 23 20:51:54 Should I show nanoseconds? Nov 23 20:52:00 :D Nov 23 20:52:01 Anthaas: true. But what meaning does the post time have? I cant think of any Nov 23 20:52:02 Absolutely Nov 23 20:52:03 not my apps, only I'm allowed to use my apps! Nov 23 20:52:16 Odaym: So, if you are in a workplace, and your boss says "please develop this." you are going to say "No, because I dont care about it and Im working on it..."? Nov 23 20:52:24 Skip milliseconds though, aint nobody got time for that Nov 23 20:52:34 wrong logic Nov 23 20:52:40 I can run multiple async tasks at once right? Nov 23 20:52:41 TacticalJoke: Personally, I'd show seconds for anything under 1 hr but thats me. Nov 23 20:52:42 you care about some things more than others Nov 23 20:52:45 Yes, madprops. Nov 23 20:53:11 madprops: It creates a threadpool under the hood. Nov 23 20:53:11 people who make brilliant software do not "care about X but put it aside so that they can care about Y because users want Y" Nov 23 20:53:19 they simply care about users, they want whatever they want Nov 23 20:53:22 The size is, I think, related to the number of processor cores (in some way). Nov 23 20:53:24 I forget the details. Nov 23 20:53:38 if they didn't care about it themselves too, they wouldn't put so much care into it Nov 23 20:53:51 Right - you make your software, but if it doesnt do what I want, Im not oging to use it. Nov 23 20:53:54 I'll care a lot about users. Nov 23 20:53:56 Thats a poor attitude. Nov 23 20:54:00 exactly, so the person fails Nov 23 20:54:03 You should care about all your work. Nov 23 20:54:07 until they find something to work on that they truly care about Nov 23 20:54:14 why have pride in your work when you can make money! >_< Nov 23 20:54:14 I'll add features I hate if loads of people want them. Nov 23 20:54:19 I care about my work output, not what it is I am making. Nov 23 20:54:22 ahh Nov 23 20:54:24 I'm not gonna make money from it, zinx. Nov 23 20:54:27 well, I have met people like that Nov 23 20:54:30 I care about completeing tasks successfully and accurately, not the task itself. Nov 23 20:54:40 like we're both hackers and whatever, and he works on some ecommerce app Nov 23 20:54:46 and I think "how can you....it's so silly" Nov 23 20:54:46 a good developer needs to first be a good user and be able to see what's missing or what's next Nov 23 20:54:51 and he says "when you grow up.." Nov 23 20:54:55 lol Nov 23 20:55:02 "you'll be devoid of a soul too" Nov 23 20:55:07 maybe when I have responsibilities and mouths to feed I will think different Nov 23 20:55:32 It's all about your goal. Nov 23 20:55:36 true Nov 23 20:55:42 the goal says what you work and not work on Nov 23 20:55:46 I see a problem, and try and provide a solution. I don't have feelings for the problem, whether or not I want to do it isn't relevant. The problem is there and my job is to make it not there., Nov 23 20:55:47 If your goal is to make the first good Foo app, you gotta take into account the masses. Nov 23 20:55:52 The first good Android Foo. Nov 23 20:55:56 exactly, Anthaas, yea I dont have that yet Nov 23 20:56:29 but what about people who say "you have to care about htis problem to be successful" Nov 23 20:56:32 like startups and whatnot Nov 23 20:56:53 if they were all brute force solvers......and there are many brute force solvers..why dont they pick things and start solving them Nov 23 20:57:05 Anthaas: I really like your idea of hours:minutes/years:months/whatever. Nov 23 20:57:11 it's the days where you "dont feel like it" when you start to feel that you need this genuine caring for the problem to keep pushing on it Nov 23 20:57:13 TacticalJoke: Thanks :-) Nov 23 20:57:23 Gives perspective with a good level of detail :-) Nov 23 20:57:26 I think I'll have to do months:weeks and weeks:days to keep things looking nice. Nov 23 20:57:41 Hmm, how would you tackle the fact that only Feb has 4 weeks in it? Nov 23 20:57:43 Also solves the issue of rounding. Nov 23 20:57:48 Odaym: what makes you care ? Nov 23 20:57:48 March has 4 weeks and a bit etc Nov 23 20:57:52 I dont know.. Nov 23 20:57:59 Hmm, fair point. Nov 23 20:58:06 looking cool, looking good at what I do.. Nov 23 20:58:28 I dont *have* a problem in my life, like all those startups say that "I saw there was a problem here and I was like.....OMG!" Nov 23 20:58:32 that shit doesnt happen.. Nov 23 20:58:49 You havent come across the problem yet. Nov 23 20:58:56 yes, I heard that too Nov 23 20:58:56 You dont just sit down and think "Im going to make X" Nov 23 20:58:59 yea yea Nov 23 20:59:04 You make it because there is a lack of it for you. Nov 23 20:59:10 hey what's your age? Nov 23 20:59:12 I'm currently studying for my PhD Nov 23 20:59:19 Which subject? Nov 23 20:59:26 And last week was the first time I'd ever needed to make a CLI program Nov 23 20:59:27 AI Nov 23 20:59:29 yea someone about your age told me these things too when they heard my view of it Nov 23 20:59:30 Nice. Nov 23 20:59:55 How old are you? Nov 23 20:59:59 27 Nov 23 21:00:08 I thought you were gonna say 60 or something. Nov 23 21:00:15 rekt Nov 23 21:00:16 I live the furthest away from that whole startup scene and success stories and whatnot, but its all around you Nov 23 21:00:19 Work/Worked in industry? Nov 23 21:00:22 and you know how to code......so...... Nov 23 21:00:32 yea I work with roadie tuner Nov 23 21:00:45 and they are a startup that got big Nov 23 21:00:50 I wonder what kind of ages we have in here. I bet the mean is around 30-something. Nov 23 21:00:54 kinds* Nov 23 21:01:05 most of these startups are finding problems where there are none. "i need coffee delivered to me at work at a moment's notice!" in spite of the office having an espresso machine 40 feet from the person who's thinking it's desk. Nov 23 21:01:07 I'm 87 Nov 23 21:01:11 :D Nov 23 21:01:14 the trick is seeing the obstacle as a part of the puzzle game no matter how bad the obstacle is and then take on the challenge Nov 23 21:01:15 no you're not Nov 23 21:01:30 i dunno Nov 23 21:01:31 Why can't I be 87 if I want to Nov 23 21:01:33 ~~ shmooz ++ Nov 23 21:01:35 we all have shit thats annoying Nov 23 21:01:35 hmm Nov 23 21:01:38 well there are two sides of it. There's still the one side where you dont believe you're good enough yet Nov 23 21:01:48 things that just are ill conceived Nov 23 21:01:48 so you go "OK I get these books and I become pro. THEN I make millions" Nov 23 21:01:59 Rarely happens. Nov 23 21:02:01 so pathetic Nov 23 21:02:05 Why is it? Nov 23 21:02:07 "... make millions of users unhappy" Nov 23 21:02:10 Why is ambition pathetic? Nov 23 21:02:21 and well, as a creator you just look at the issue and say Nov 23 21:02:27 I dont know cause the person maybe in a rush, and doesnt value anything but the thing he is perceiving as valuable Nov 23 21:02:29 well, i can sort that out Nov 23 21:02:42 grass is greener and whatnot Nov 23 21:02:45 I still don't think that is pathetic. Nov 23 21:02:50 Still ambition. Nov 23 21:03:02 yeah, ambition is what makes the world turn Nov 23 21:03:04 A lot of people who could be considered successful are never happy with the status quo. Nov 23 21:03:05 cause you look at those behind you and say "yea whatever, im cooler than you but I want to be cooler than HIM not you" Nov 23 21:03:08 Which looks better: "5 months, 21 days" or "5 months, 3 weeks"? Nov 23 21:03:09 kinda ayn randian Nov 23 21:03:10 but Nov 23 21:03:11 .... Nov 23 21:03:16 3 weeks Nov 23 21:03:17 its just children's talk I guess Nov 23 21:03:27 TacticalJoke: Seeing as you put it that way, I'd say 3 weeks Nov 23 21:03:34 unless one needs to be precise Nov 23 21:03:39 TacticalJoke: But then you have 5 months, 2 weeks and 6 days Nov 23 21:03:40 You defected! :) Nov 23 21:03:47 Oh, I'll just do it in twos. Nov 23 21:03:49 I did I know haha Im sorry. Nov 23 21:03:52 this is because of being too self-aware I think Nov 23 21:04:01 meta Nov 23 21:04:04 metameta Nov 23 21:04:07 "2 weeks, 6 days" Nov 23 21:04:09 inspecting at every step what is happening "am I there yet?" Nov 23 21:04:13 just drop the days Nov 23 21:04:14 Wait. That's assuming I'm using weeks. Nov 23 21:04:18 If I miss weeks, I can simplify. Nov 23 21:04:21 15 hours, 12 seconds, 20 milliseconds Nov 23 21:04:24 I think days are somewhat important. Nov 23 21:04:35 whats the stat though Nov 23 21:04:38 i didnt get that Nov 23 21:04:39 TacticalJoke: I would go with weeks, and have months as calendar months rather than a number of weeks Nov 23 21:04:43 Reddit posts/comments. Nov 23 21:04:47 nanoseconds are what users care about TacticalJoke Nov 23 21:04:51 hmm Nov 23 21:04:54 Fuck everything else Nov 23 21:04:55 lol Nov 23 21:05:04 I should just print the epoch time. Nov 23 21:05:06 all up to you Nov 23 21:05:10 either is nice Nov 23 21:05:18 That'll trip them up Nov 23 21:05:22 that would be uber nerdy cool Nov 23 21:05:27 but adding days when you get to months is a bit anal Nov 23 21:05:42 Not really, you just go by calendar month Nov 23 21:05:45 What if it's "1 month, 30 days"? Nov 23 21:05:45 My crap phone seems to think i'm within seconds of the epoch at boot time Nov 23 21:05:49 >1970 Nov 23 21:05:53 So if Feb, and days = 28, then Mar Nov 23 21:05:53 Reddit displays "1 month" in that case, I think. Nov 23 21:05:55 then you say 1 month 3 weeks Nov 23 21:05:58 oh man, how you look at things is..really everything Nov 23 21:06:00 or you round Nov 23 21:06:01 hah! Nov 23 21:06:31 Ah, damn. Just realised that TimeUnit doesn't go past days. I'll have to write this stuff. (Though it's simple.) Nov 23 21:06:40 TacticalJoke: Haha this won't be an easy thing to decide, but you should go for one. Nov 23 21:07:21 Anthaas: Im still thinking Months and Days would be the easier way. Nov 23 21:07:24 do you have to destroy Texture2Ds manually? Nov 23 21:07:25 hey whats the easiest way of rounding a number to a 2 decimal string (money) in java Nov 23 21:07:26 Yeah, the hardest part is the decision. Nov 23 21:07:31 speaking of 1970, have you noticed how all pictures in Photos if you pull up the drawer from the bottom it's empty and says "Jan 1, 1970" at the top? Lollipop Nov 23 21:07:37 Anthaas: But to look at, months and weeks looks better Nov 23 21:07:50 Yeah. Nov 23 21:08:05 yeah, im not sure if precision is required Nov 23 21:08:07 I guess I could use Joda-Time to get properly calculated weeks and such. Nov 23 21:08:14 Not sure how important that is, though. Nov 23 21:08:16 thats why id say just stick to weeks Nov 23 21:08:25 use the horse luke! Nov 23 21:10:02 lol Nov 23 21:13:24 everytime you want to imitate some Google app with some feature or look, you start doing it and run into something for example, so you open up their app thinking "well how'd they fix that!" and you see that it was avoided by some larger context altogether haha Nov 23 21:14:18 :| Nov 23 21:14:29 odaym Nov 23 21:14:33 what are you talking about Nov 23 21:14:39 give us some...context Nov 23 21:14:45 can you manually call garbage collection in unity? Nov 23 21:14:53 like you want to aline the edit text's cursors together in a small form Nov 23 21:15:12 WHAT Nov 23 21:15:15 why?? Nov 23 21:15:25 you open Gmail to see how they did it in Compose, you see that it isn't really a form, the stuff you thought was a textview ("Subject") was just a hint for the edittext Nov 23 21:15:35 ChrisUK: I'm not sure, but why would you want to do that? Nov 23 21:15:37 I mean ontop of each other you want to align them Nov 23 21:15:57 tactical: very low on memory on a mobile device Nov 23 21:17:15 how do you check the layouts for this stuff anyways Nov 23 21:17:27 can you just break open another persons app? Nov 23 21:17:40 nah you look Nov 23 21:17:45 well you can yes Nov 23 21:17:51 apktool and others can give you back the source Nov 23 21:18:02 tactical: you can with System.GC.Collect (); Nov 23 21:18:14 thats not very good from a coding perspective Nov 23 21:18:16 :\ Nov 23 21:18:33 nah you just look at the layout to see it cause its nice and you want similar Nov 23 21:18:34 that's it Nov 23 21:19:00 i should start a blog dagnabbit Nov 23 21:19:17 what about Nov 23 21:19:19 who reads them?> Nov 23 21:19:29 i only hit blogs when i google x Nov 23 21:19:48 but otherwise, nah Nov 23 21:20:03 I only read codinghorror blog Nov 23 21:20:13 and PG Nov 23 21:20:17 yea Nov 23 21:20:18 i would just rip off this other blog: http://www.timelesssky.com/blog/develop-app-on-android-with-android-sdk Nov 23 21:20:34 re-post the article as my own Nov 23 21:20:52 but its crap Nov 23 21:21:21 it seems a very immature blog :P Nov 23 21:21:58 oh Nov 23 21:22:09 its just littered Nov 23 21:22:17 look at paul graham blog for example Nov 23 21:22:25 so neat and nice Nov 23 21:22:39 looking... Nov 23 21:22:50 will the onPause() (on an asynctask) be executed when i change change activity and when i exit the application? Nov 23 21:23:45 0asynctask desnt have an onPause method.. Nov 23 21:23:48 hey guys, what are your opinions about the apps with embedded webview ? Nov 23 21:24:09 A90: it's just at the point of where it's usable right now. Nov 23 21:24:14 0daym: your right Nov 23 21:24:18 I'm using Cordova and Crosswalk. Nov 23 21:24:26 yea it doesnt look so flashy and "beautiful" as the other one Nov 23 21:24:29 They're updating Crosswalk soon to make a minimal version Nov 23 21:24:31 the other is not beautiful anyways Nov 23 21:24:31 8-10MB Nov 23 21:24:42 but you can use posthaven Nov 23 21:24:44 like the pros Nov 23 21:25:14 is it free Nov 23 21:25:19 no Nov 23 21:25:24 i am super cheap dagnabbit Nov 23 21:25:26 $5 per month Nov 23 21:25:32 well, you wanna go pro...you gotta pay Nov 23 21:25:57 why cant i just rip off someone who has a posthaven blog Nov 23 21:26:03 the whole of Android was given to you for free Nov 23 21:26:07 steal their layout and shit Nov 23 21:26:07 give back to SOMEONE Nov 23 21:26:08 lol Nov 23 21:26:32 yes i was going to add extra info to the blog post Nov 23 21:26:40 about how to get ALSA app working Nov 23 21:26:46 alsa..? Nov 23 21:26:48 that would redeem me Nov 23 21:26:51 the soundmixer from linux?? Nov 23 21:26:55 ewww Nov 23 21:26:59 yea doggie Nov 23 21:27:06 i HATED alsamixer Nov 23 21:27:11 and the other one too Nov 23 21:27:14 I HATE linux haha Nov 23 21:27:59 android is linux? Nov 23 21:28:09 WHAT!! Nov 23 21:28:11 haha Nov 23 21:28:14 you run mac? Nov 23 21:28:16 yea man but linux for desktop Nov 23 21:28:20 its terrible Nov 23 21:28:20 kinda linuxy Nov 23 21:28:23 Agamemnus: im referring to complete mobile web apps embeded in android Nov 23 21:28:42 everything is linux after all, but I dont want to see it and work with it everyday Nov 23 21:28:49 yeah, but it helps to appreciate what it is good for Nov 23 21:28:51 just keep it embedded and running on servers Nov 23 21:28:56 great server stuff Nov 23 21:29:02 yea I was huge linux fanatic some years ago Nov 23 21:29:05 and if i could app-get on os x Nov 23 21:29:09 id be set Nov 23 21:29:20 (i know of brew... but still) Nov 23 21:29:35 apt-get is a mediocre package manager; some of the more mature package managers out there are really amazing Nov 23 21:29:44 pacman and rpm Nov 23 21:29:45 like what? Nov 23 21:30:07 as for pacman, use pacaur instead Nov 23 21:30:09 the one for Gentoo is the top, community likes to brag about it a lot Nov 23 21:30:48 ...gentoo Nov 23 21:30:51 well winter is coming Nov 23 21:30:53 time to install gentoo Nov 23 21:30:54 the black art of gentoo Nov 23 21:31:00 who the hell wants that Nov 23 21:31:07 any time ive wanted linux Nov 23 21:31:09 its ubuntu Nov 23 21:31:13 :s Nov 23 21:31:17 you aint pro, bro Nov 23 21:31:25 daft punk uses ubuntu Nov 23 21:31:31 unless you have Arch running under 24 hrs, you aint pro Nov 23 21:31:34 listen, i dont want to figure out why graphic drivers are just fucked Nov 23 21:31:38 #android-dev has been reduced to this, has it? sad times ... Nov 23 21:31:40 in some dimension Nov 23 21:31:48 bankai_au is right Nov 23 21:31:55 buy Macs! Nov 23 21:31:57 haha Nov 23 21:31:59 yea Nov 23 21:32:03 mac ++ Nov 23 21:32:09 never going back. Nov 23 21:32:32 A90: me too Nov 23 21:32:39 i love these moromns that think that windows is for power users Nov 23 21:33:26 though, tbh i wish these would be a decent pcb layout program in os x Nov 23 21:33:39 yea what dummies, but they can have multiple wives tho Nov 23 21:33:44 sometime i wish i was moromns Nov 23 21:34:00 snap Nov 23 21:34:04 :) Nov 23 21:34:50 yeah, I was trying to explain to the gf how mormons are more akin to muslims that christians Nov 23 21:35:14 Agamemnus: well, i want to use webview for some app but im not sure if the performance is good Nov 23 21:35:20 as they take new testament to be true, but have a whole other book Nov 23 21:35:45 A90: just test it Nov 23 21:35:49 kinda weird way to start a religion Nov 23 21:35:54 the performance is good Nov 23 21:35:58 but Nov 23 21:36:15 there are pitfalls just like for anything Nov 23 21:36:18 how does one simulate oom kill? Nov 23 21:36:47 a lot of information is hard to find Nov 23 21:36:56 shmooz: i can test it in a couple of devices Nov 23 21:37:51 squirrel: are you concerned this is going to happen a lot ? Nov 23 21:37:57 shmooz: but i think that is not enough Nov 23 21:38:04 bankai_au: it's android Nov 23 21:38:09 it happens always in android Nov 23 21:38:16 for example... if you are going to use css scaling to size your content, make sure that you aren't scaling down Nov 23 21:38:46 on many samsung phones for example... all the content is too big that would normally be okay Nov 23 21:38:52 shmooz: that is why i'm asking for your opinions Nov 23 21:38:55 a pixel is not a pixel... Nov 23 21:39:59 A90: if you can avoid webview and make the app directly load data to it's widgets it will be faster Nov 23 21:41:25 it's all about how you use it man Nov 23 21:41:42 Agamemnus: a pixel is not a pixel ? Nov 23 21:42:02 yes Nov 23 21:42:38 for example.... you make a div of 2560 pixels in width Nov 23 21:42:48 on a note 4 with this: Nov 23 21:43:00 Nov 23 21:43:19 hey, where how do you save passwords for applications on the phone Nov 23 21:43:21 Your 2560 pixels will be actually 4 times bigger Nov 23 21:43:29 as i need to auth at the server Nov 23 21:43:39 because the pixel density is different Nov 23 21:43:42 shmooz: yeah it could be, but i want to port the app to ios to Nov 23 21:43:45 but i dontr want to hold the password in plaintext on the phone Nov 23 21:43:54 so you have to approximate it or generate a meta tag that might not work Nov 23 21:44:03 like ... Nov 23 21:44:15 A90: robovm! Nov 23 21:44:42 or even width=device-width .... also a fail Nov 23 21:45:23 as today (target as api 21) rotating a screen still recreates an activity, right? Nov 23 21:45:27 Agamemnus: ah, the pixel density Nov 23 21:45:51 Agamemnus: that is new for me Nov 23 21:46:21 https://code.google.com/p/chromium/issues/detail?id=433760 Nov 23 21:46:24 see last comment Nov 23 21:46:25 There are only around 30 million seconds in a year. Nov 23 21:46:29 i could use some more stars Nov 23 21:46:29 Doesn't sound like much. Nov 23 21:46:46 Though imagine if that's a boring year. 30 million seconds of boredom. Nov 23 21:47:35 it does, not in the emulator, weird Nov 23 21:47:51 bankai_au: mmm... currently im a full web developer but, maybe i can switch to java Nov 23 21:48:19 is it ok to fetch data in a while loop inside an asynctask? im getting errors Nov 23 21:49:21 What errors? Nov 23 21:49:27 I don't see why that'd be a problem. Nov 23 21:49:45 aynctasks are supposed to be for quick tasks -- short lived. Perhaps a service would be better if there's a need for looping Nov 23 21:49:52 at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:355) Nov 23 21:50:52 hey, how do you guyes store passwords? Nov 23 21:50:56 guys* Nov 23 21:52:21 ok it has nothing to do with the networking, i tihnk im doing something wrong somewhere Nov 23 21:54:41 hey u make a text file password.txt ,and put in "/" folder Nov 23 21:54:45 the problem seems to be my trying to update a TextView Nov 23 21:54:59 im a joker Nov 23 21:55:09 ... Nov 23 21:55:10 ... Nov 23 21:55:19 i suppose i could write it to a db Nov 23 21:55:27 but then the db isnt really secure Nov 23 21:55:31 not on rooted phones Nov 23 21:55:38 madprops: keep us upto date with your adventures Nov 23 21:55:44 sure Nov 23 21:56:30 eh? Nov 23 21:56:39 do people just store it in their apps db? Nov 23 21:56:43 gobl: http://www.scmagazine.com/chrome-saved-passwords-in-plain-text-not-a-flaw-according-to-google/article/306470/ Nov 23 21:57:05 monkey see, monkey do Nov 23 21:57:28 .... Nov 23 21:57:31 alright Nov 23 21:57:42 well i suppose i should just take out https Nov 23 21:57:46 noone needs that right? Nov 23 21:57:57 ...wrf Nov 23 21:58:05 wtf.... Nov 23 21:58:16 that.is.terrible Nov 23 21:58:23 wrf Nov 23 21:58:39 what rf Nov 23 21:58:45 what radio frequency? Nov 23 21:59:35 what's your favourite kind of modulation Nov 23 22:00:07 AM Nov 23 22:00:09 oh baby Nov 23 22:00:12 modulate me Nov 23 22:00:18 pulse code Nov 23 22:01:27 pcm isnt RF Nov 23 22:01:29 ! Nov 23 22:01:52 anyone delpoyed apps to heroku? Nov 23 22:03:37 heroku to you too Nov 23 22:05:12 anyone here worked on styling cardviews yet? Nov 23 22:05:37 Im looking for a way to define a default cardview style in the App theme Nov 23 22:05:44 so this is interesting Nov 23 22:05:51 String scope = "oauth2:" + Scopes.PROFILE + " " + "email"; Nov 23 22:05:55 something like @style/CardViewStyle, but no luck yet. Nov 23 22:06:56 this is totally insane Nov 23 22:07:20 So if you have Nov 23 22:07:25 'String scope = "oauth2:" + Scopes.PROFILE' ... right? Nov 23 22:07:31 It has a HUGE permissions list Nov 23 22:07:37 ..in the popup. Nov 23 22:07:41 If you do it like this: Nov 23 22:07:43 String scope = "oauth2:" + Scopes.PROFILE + " " + "email"; ... Nov 23 22:07:52 It's tiny. It just says "view your basic account info" Nov 23 22:07:54 WTF? Nov 23 22:14:55 http://code.metager.de/source/xref/android/4.4/device/lge/mako/mixer_paths.xml Nov 23 22:15:22 i would link to this from blog baby Nov 23 22:16:43 best blog bro Nov 23 22:30:46 Hello everyone Nov 23 22:31:08 XS = extra small ? Nov 23 22:31:24 wow I see that bullying is definetly everywhere Nov 23 22:31:32 how about welcome to the chat instead? Nov 23 22:31:54 anyway I didn't come here to waste my time arguing with you Nov 23 22:32:20 easy winston Nov 23 22:32:25 whassup xs Nov 23 22:32:32 I have a question about translation services, I see that Google Translate is not free anymore, is it legal to call Google Translate via HTTP from within an app or is that considered abuse? Nov 23 22:32:39 what's up globl Nov 23 22:33:19 isnt therea number of hits that are acceptable? Nov 23 22:33:35 it's free for the first million characters I think Nov 23 22:33:39 after that they charge Nov 23 22:33:45 the same with Yandex and other services Nov 23 22:33:58 that's via the api Nov 23 22:34:05 i really don't know, Nov 23 22:34:14 AndroidDevXS: why dont you translate the app ONCE to build a translation for the app? Nov 23 22:34:15 but I don't know if there is a problem if I include an http get request in the code Nov 23 22:34:32 I want to create a free translation app Nov 23 22:34:39 lol Nov 23 22:34:54 that sounds like you are reinventing googles work Nov 23 22:35:02 so i bet they wouldnt be pleased Nov 23 22:35:06 sounds like you'll get a perm account ban too Nov 23 22:35:08 so you want to use google translate (that already have a google translate app), and show their translation in yours Nov 23 22:35:11 it will have some other functionality as well Nov 23 22:35:23 not just translation Nov 23 22:35:28 translation will be a part of it Nov 23 22:35:38 is the other part a search enigne? ^^ Nov 23 22:35:39 i suppose if you toss it in a webview Nov 23 22:36:06 Ok Nov 23 22:36:22 something around those lines globl Nov 23 22:36:44 but i cant imagine they'd let you just play off their data as yours Nov 23 22:37:06 its the sorta thing you might have to try to find out Nov 23 22:37:09 yeah im pretty sure there is something in their TOS saying that youll get a ban for that Nov 23 22:37:21 and if they see value in the sum package Nov 23 22:37:33 so I am thinking around these lines Nov 23 22:37:36 they might let you fly by Nov 23 22:37:48 say a reminder app that allows you to translate the text you type Nov 23 22:37:55 the main purpose isn't translation Nov 23 22:38:02 it's just an extra feature Nov 23 22:38:21 however once the million characters gap is reached translation would stop working for all users Nov 23 22:38:22 why would you need that- so i could set a reminder for someone else? Nov 23 22:38:30 that's why I think about embedding that in an HTTP cal Nov 23 22:38:37 call Nov 23 22:38:40 for whatever reason Nov 23 22:38:52 maybe you want to know what your reminder looks like in chinese Nov 23 22:39:06 yeah i think the use case has to be pretty convincing Nov 23 22:39:06 the point is adding non web service apis to an android app Nov 23 22:39:23 or like you said web views Nov 23 22:39:30 raw get calls from within the app Nov 23 22:39:53 is that a known issue for google or other service hosts? Nov 23 22:40:04 cant say. Nov 23 22:40:29 AndroidDevXS: do you plan on putting ads in the app or selling it? Nov 23 22:40:30 I guess I have to ask Google themselves Nov 23 22:40:41 yeah Nov 23 22:40:45 that's definetly an idea Nov 23 22:41:03 AndroidDevXS: why dont you pay google after that million calls then? Nov 23 22:41:39 many different scenarios, say one user downloaded the app and consumed all the translations, it wouldn't make a lot of sense Nov 23 22:42:26 then that would be you that manages how many translations a user could hit Nov 23 22:42:35 in fact you are asking for a way to scam google Nov 23 22:42:48 not really Nov 23 22:43:01 yes. Nov 23 22:43:07 limiting users would seem frustrating if they'd paid for an app Nov 23 22:43:13 they offer you million calls without charge and more calls with a fee Nov 23 22:43:23 and you want to have more without paying Nov 23 22:43:23 not really Nov 23 22:43:25 thats all Nov 23 22:43:48 my question is if it is legal to use get calls for free web services Nov 23 22:44:12 you'd be screen scraping copyrighted material. the answer is most likely no Nov 23 22:44:18 I saw something regarding that in stack overflow Nov 23 22:44:26 but it wasn't clear and didn't have any sources Nov 23 22:44:27 but in all likely-hood, hu's gonna sue you Nov 23 22:44:41 nick9998: who is? Nov 23 22:44:42 my chinese grandmother; her name is hu, she is very litigious Nov 23 22:44:51 well, you ruined that joke. Nov 23 22:44:57 :D Nov 23 22:45:14 bad-joke-eel.png Nov 23 22:45:20 haha Nov 23 22:45:57 well I'll ask Google then Nov 23 22:45:59 what about bad joke fish? Nov 23 22:46:19 thanks for your input Nov 23 22:49:05 I'm trying a "hello world" equivalent of a broadcast receiver. I want to receive an android.intent.action.SEND intent, and have my broadcast receiver log "Hello" to the log file in onReceive. I have an intent filter set up in my manifest, and a broadcastReceiver in my app, but NOTHING else (no activity). Nov 23 22:49:34 When I fire "android.intent.action.SEND" (e.g. from Chrome--> Share), I see a list of apps, but my app is not listed. Nov 23 22:50:39 http://pastebin.com/VPTeWb5N Nov 23 22:50:55 ^^ There's my broadcast receiver and manifest on PasteBin. Nov 23 22:51:20 Nov 23 22:51:26 Share actions start activities, they don't send broadcasts Nov 23 22:51:43 Oh! Okay. Nov 23 22:52:18 So yeah, you need an intent filter on an activity Nov 23 22:52:25 I want to have my share just send an email and then drop my user right back where they were, maybe with a toast message or something. Nov 23 22:52:40 But I HAVE to start an activity you're saying? Nov 23 22:53:15 That's what they do Nov 23 22:53:46 When you share from chrome it starts an Activity. You can't change that Nov 23 22:53:49 But I dont' want the user to see anything - just do something in the background and the user should stay right where they are - no GUI. Nov 23 22:54:15 Okay. So maybe start an activity, and then just do my work and close the activity immediately? Nov 23 22:54:48 Sure Nov 23 22:55:00 Cool - thanks SimonVT! Nov 23 23:08:02 fuck u agamemnon Nov 23 23:08:41 google docs is multiplayer notepad Nov 23 23:08:48 im i the only who's applications fail to start sometimes on the emulator? Nov 23 23:09:04 please dont kill anyone Nov 23 23:19:21 api21 crashes all the time for me Nov 23 23:19:40 so, im still developing for emu api 19 Nov 23 23:21:07 gobl: heard that before. I think a lot of users still have issues with the 21 emu Nov 23 23:22:55 yeah, my hardwares fine... every 3 tests of my app it fucks up Nov 23 23:23:02 and i dont hvae time for that shite Nov 23 23:24:16 real devices .. :) Nov 23 23:26:38 yeah, ive got a nexus5... but ive had to submit a rma Nov 23 23:26:48 its also crashing all the time Nov 23 23:26:58 emu 21 for me is breakish too Nov 23 23:27:02 I prefer genymotion Nov 23 23:27:21 Foxandxss: is there already a way to get working gapps on genymotion 5.0? Nov 23 23:27:23 but no real usage yet to see if it is brokish too Nov 23 23:27:44 oh, no idea, but it is the first 5.0 version, so if it didn't work before, it won't work yet Nov 23 23:28:21 they did work before. but not sure it its so easy to setup with 5.0 Nov 23 23:28:34 (should try it tomorrow) Nov 23 23:32:10 How can I reuse the same intance of a fragment over and over? Nov 23 23:33:15 ciree: getFragmentManager().findFragmentByTag(yourTag) Nov 23 23:34:12 where the tag is what I set in addToBackStack? Nov 23 23:35:48 FragmentTransaction.add(fragment, tag) Nov 23 23:35:53 thats where you set the tag Nov 23 23:36:03 Okay, I can also do it in the replace method yes? Nov 23 23:36:11 sure Nov 23 23:36:15 awesome thanks! Nov 23 23:36:23 yw Nov 23 23:48:33 I have a spinner with timezones in it, the currently selected timezone is stored in a preference, so when I go back to the spinner the current value is selected in the dropdown Nov 23 23:48:54 I also need to set an active color for the currently selected timezone in the drop down list Nov 23 23:49:43 I've tried using a style such as Nov 23 23:49:48 but nothing works Nov 23 23:50:05 is there a way to do this purely in xml or do I need to build a custom adaptor? Nov 23 23:53:22 lexton: you have to build a custom adapter Nov 23 23:56:59 So after reusing my fragment with get fragmentId, I don't want that fragment to be added to the back stack. When I don't include addToBackStack, I see a bunch of old fragments overlapping each other on the screen Nov 23 23:57:31 So fragment A, B(The fragment I dont want to be backable), C Nov 23 23:57:44 you'll see overlappping fragments when you 'add' instead of 'replace' Nov 23 23:57:45 When I hit back from C, it pops A, but theres a bunch of weird overlapping Nov 23 23:57:46 did you call add or replace? Nov 23 23:57:54 replace Nov 23 23:58:15 transaction.replace(R.id.frame_container, fragment, SearchFragment.TAG).commit(); Nov 23 23:58:25 And when I hit back, I see weird overlapping Nov 23 23:58:46 all other transactions are also replace Nov 23 23:59:40 show us your code Nov 24 00:00:52 http://pastebin.com/bzChgPBd Nov 24 00:00:54 main activity Nov 24 00:01:09 Then I replace the main content with fragments throughout Nov 24 00:01:11 only 1 activity Nov 24 00:01:52 line 143 Nov 24 00:01:57 Is where I am doing the fragment replacing Nov 24 00:02:58 So I click around the app, click a button in the actionbar, and search fragment replaces Nov 24 00:07:30 hm Nov 24 00:07:36 looks valid for me... Nov 24 00:07:43 Basically, when the last fragment in the stack is the search fragment...double pop the back stack Nov 24 00:07:49 Should I do that in my onBackButton pressed override? Nov 24 00:07:55 I can check for the last fragment in the stack no? Nov 24 00:09:18 i do believe it is she who said 'double pop the back stack' Nov 24 00:10:50 i tend to know my sexual innuendos and I'm not familiar with that one Nov 24 00:10:54 Is like it twerking? Nov 24 00:11:44 oh my god. time to go Nov 24 00:15:10 I'm attempting to make a pie slice (an arc) pivot a full 360 degrees around the center of a circle on the canvas but the canvas doesn't seem to be updating -- http://pastebin.com/xpudamV1 Nov 24 00:22:37 what would 'ActivityManager Process has died' mean when there is no call stack showing up? (Native Activity) Nov 24 00:34:03 I Have a timeout mechanism and multiple fragments - is there a simply way I can detect some meaningful user activity, and restart the timeout in a simple way (or at least in one place)? Nov 24 00:34:58 Put your timout in a service, detect user activity, restart timeout within service? Nov 24 00:36:20 it is the 'detect user activity' bit I'd like help with Nov 24 00:37:08 neither vagina Nov 24 00:37:28 srsly nick, whats wrong with you? ^^ Nov 24 00:38:13 hmm seems the Tegra doesn't like that my app takes up more than 1 gb of memory... Nov 24 00:38:26 Nivag: what means detect user activity? Nov 24 00:39:23 haha i got probs, i'm like the guy who sits near the copy machine and makes fun of people's names Nov 24 00:39:43 SimonVT you around ? Nov 24 00:39:44 Hmm.. difficult questions... :-) Any key press should be sufficient (and/or any screen touch ?) Nov 24 00:40:02 Nivag: in your app or everywhere? Nov 24 00:41:04 Spynxic: currently you seem to be calling the tryDrawing method on the UI thread. instead, I believe you should call that function from another thread using a Runnable Nov 24 00:41:16 My Ap 'SHOULD" be the only one running, or at least it should be the one occupying the screen - tablet is dedicated to this application of recording children's test results Nov 24 00:42:13 Spynxic: also, I believe you should start that thread in onSurfaceCreated instead of onSurfaceCHanged. Finally, I would put the "division"-drawing for-loop between lock and unlockCanvas instead of locking the canvas on each iteration of the for-loop Nov 24 00:42:56 Spynxic: other than that, looks like you are on the right path Nov 24 00:42:57 Nivag: you can register a touchlistener on the main content view as well as a listener to keyboard Nov 24 00:43:48 will do some of the dreaded RTFM ... :-) Nov 24 00:43:59 : > Nov 24 00:44:42 yeah, I know that I should wash my hands afterwards! :-) Nov 24 00:46:31 some things cant be washed off.. Nov 24 00:49:05 virgilivs: If the "division"-drawing for-loop is between lock and unlockCanvas, would the canvas still update behind-the-scenes (to allow me to store each division in a list of bitmaps) without updating the canvas for the user? Nov 24 00:54:21 So Nov 24 00:54:23 I think it's great Nov 24 00:54:42 that google is catching up to Apple when it comes to releasing buggy, ugly OSs for mobile Nov 24 00:54:44 Spynxic: yes. you should lock the canvas for the duration of your draw method Nov 24 00:55:09 matt_j: hahaha Nov 24 00:55:15 my phone has never run so slowly Nov 24 00:55:26 the home screen has lag when I return to it from an app now Nov 24 00:55:41 Spynxic: try to obtain a reference to the canvas outside a try/catch loop; do the drawing in the try clause and then do if(canvas!=null){holder.unlockAndPost(canvas);} in the finally clause Nov 24 00:56:02 matt_j: updated to 5.0? Nov 24 00:56:06 yep :( :( Nov 24 00:56:10 I wanna downgrade Nov 24 00:56:22 i have no probs at all on my n5 Nov 24 00:56:29 I have a nexus 5 as well Nov 24 00:56:55 hm maybe because I did a clean install and not the OTA Nov 24 00:57:02 heh Nov 24 00:57:04 could be. Nov 24 01:10:48 matt_j using encryption ? Nov 24 01:11:07 g00s: ?? Nov 24 01:11:18 http://betanews.com/2014/11/21/android-5-0-lollipop-encryption-severely-impacts-performance/ Nov 24 01:11:30 i just grabbed the first link, you can get a better story Nov 24 01:11:53 http://www.anandtech.com/show/8725/encryption-and-storage-performance-in-android-50-lollipop Nov 24 01:15:41 Whats the proper way to save instance state on a fragment? Nov 24 01:15:45 I always get it as null Nov 24 01:15:55 I've tried doing it in onPause, and onSaveInstanceState Nov 24 01:18:11 maybe you "get it" at the wrong time? Nov 24 01:18:28 onCreateView Nov 24 01:18:43 thats not what i mean. Nov 24 01:18:56 its always null when you create the fragment Nov 24 01:19:18 not null would occur for example after a screen rotation Nov 24 01:19:20 Right, basically I'm popping the back stack Nov 24 01:19:55 it can be on the backstack without needing to be recreated i think Nov 24 01:20:10 setRetainInstance? Nov 24 01:20:31 has to be true obviously Nov 24 01:22:42 That worked. Nov 24 01:22:58 I setRetainInstance when creating the fragment Nov 24 01:23:17 Then checked if my variable was not null, otherwise hit the API Nov 24 01:23:23 thanks Nov 24 01:27:22 Hello! I implemented Notification with Buttons via .addAction(...) The PendingIntent for the actions are generated with getBroadcast because I am using broadcast receiver on the other side. My problem is that the Notification Drawer won't close on it's own after clicking a button - and also won't close with solutions on StackOverflow - Please help! Nov 24 01:34:28 Anthaas they probably aren't going to answer my question in #java now that you mentioned affiliation with android :( Nov 24 01:34:40 Oh they will! :-) Nov 24 01:34:51 I used to spend time in both - talking about both in each. Nov 24 01:35:23 Your question is Java related, thats all they care about :-) if it was Android specific, or God forbid Minecraft specific, maybe not hehe. Im just booting up an IDE to see if I can help! Nov 24 01:43:19 stay classy Nov 24 01:49:18 when i export my application through eclipse will the appcompat_v7 be included? Nov 24 01:49:31 i ask since it is in a different folder Nov 24 01:52:41 hey guys Nov 24 01:53:33 so I'm trying to lay out my widgets. I'd like to define a grid and assign percentages for the height of each row and the width of each column Nov 24 01:53:43 for example, first row takes 10% of the screen Nov 24 01:53:50 second row takes 20% of the screen Nov 24 01:53:51 etc... Nov 24 01:54:03 is that possible? Nov 24 02:13:34 figured it out Nov 24 02:13:36 tablelayout Nov 24 02:17:33 JakeWharton if a Subscriber (inner class to fragment, activity) is unsubscribed - does the pipeline keep a reference to that until onCompleted() is called ? Nov 24 02:17:37 virgilivs: Thanks Nov 24 02:19:44 hi, is it wise to use viewpager in a fragment (handling stuff with getChildFragmentManager())? or should i try keeping the viewpager in an activity? Nov 24 02:23:29 I'm reading an android dev book and I'm up to the part about asynctasks vs creating your own threads.... When creating your own threads it says "Then, when the Thread is instantiated and started, the post() method of the Handler is used to communicate with the main UI thread." Since mHandler is a member of Activity how do I access it to call the post() method? Nov 24 02:27:47 eghdk_ skip that part of the book Nov 24 02:28:27 g00s: Ouch. Nov 24 02:28:41 eghdk_ take detour, learn rxjava Nov 24 02:28:50 +1 on that idea! Nov 24 02:28:53 You know I'm not gonna leave quietly on that one. Hahaha SO why should I skip it? Nov 24 02:29:07 Is this going back to why AsyncTasks are bad? Nov 24 02:29:14 Should I ever use asyncTasks? Nov 24 02:31:21 there are some places its still fine. but rx is a much more general and powerful idea, you probably never will once you know it Nov 24 02:32:33 Okay, so my last question will be again about AsyncTasks. I've heard the discussions and debates online... but when the hell would it be fine to use it? Nov 24 02:32:49 when you know rx its fine to use it Nov 24 02:32:50 "there are some places its still fine." Nov 24 02:33:14 because then, you can make a better decision :) Nov 24 02:34:03 Hmm... interesting. I won't be skipping this part in the book but I will be learning RxJava. hahah. Thanks. I still would appreciate if anyone could clear up how to access a Handler Nov 24 02:34:27 you may decide to use it when using the loader framework, if you extend the AsyncTaskLoader Nov 24 02:36:13 Gotcha. Loaders are in the next chapter. Nov 24 02:36:30 Any idea what the proper way to access an Activitys Handler anyone? Nov 24 02:37:55 any idea about this http://stackoverflow.com/questions/27096641/only-1-phone-shows-parcelable-encountered-ioexception-writing-serializable-objec Nov 24 02:38:08 and one more for you g00s Do you think Google uses AsyncTasks or RxJava? Nov 24 02:38:14 in its own apps? Nov 24 02:40:55 eghdk_ kinda hard to know these days, since gapps aren't aosp :) Nov 24 02:41:00 cliffreich_: if you can re-produce set some breakpoints and drill down into the object Nov 24 02:41:01 maybe JakeWharton would know Nov 24 02:41:25 eghdk_ one good tool to know is Handler / HandlerThread Nov 24 02:41:40 i still use those Nov 24 02:42:28 Yeah, well I'm trying to wrap my head around Handler because I have come across it in crash logs... but this is the first book I have talking about Handlers. Nov 24 02:42:54 But I'm stuck on how it says Handler is a member of activity... but I can't access the Handler in my activity. I don't know what gives Nov 24 02:43:16 Handler h = new Handler() Nov 24 02:44:19 https://developer.android.com/training/multiple-threads/communicate-ui.html there's some samples there to look at Nov 24 02:45:05 so how do you guys validate edit texts? Nov 24 02:46:09 but g00s in the Activity source there is mHandler? Don't I have to access that one? Nov 24 02:46:09 * capella meh ... 40 mins tracking down a class var accidentally marked static Nov 24 02:46:31 eghdk_ what is its visibility ? Nov 24 02:47:41 final Handler mHandler = new Handler(); Nov 24 02:47:47 so default? Nov 24 02:49:10 you aren't in the same package , so no Nov 24 02:49:46 Gotcha. Okay Hrm. Nov 24 02:50:22 So really quick back to my first question... how do I access the post() method of Handler? Just Handler handler = new Handler(); handler.post()? Nov 24 02:50:31 look at that link i posted it tells you Nov 24 02:51:23 lol Nov 24 02:53:08 Oh bankai_au I didn't see that. Nov 24 02:55:25 bankai_au i don't have a Nexus 4, those are reports from one of my users Nov 24 02:56:41 damn, i don't want to push an apk making custom objects both parcelable and serializable, sounds like a messy idea Nov 24 02:57:45 is com.myapp.models.customobject serializable? Nov 24 02:58:02 no, its parcelable and it cointain parcelable objects Nov 24 02:58:46 and it works for most users Nov 24 02:59:07 well, all but nexus 4 with 5.0, apparently Nov 24 02:59:49 son of a bitch **** ENDING LOGGING AT Mon Nov 24 03:00:31 2014