**** BEGIN LOGGING AT Fri Feb 20 02:59:59 2015 Feb 20 02:59:59 Im trying to get things setup so I can start learning to code for android ... im on OSX I have downloaded and installed Android Studio ... from the SDK manager I am currently downloading the API for everything from android 4.0 to 5.0.1 is there anything else I am going to need to get going ? Feb 20 03:00:23 Isn't it "new MaterialDialog.Builder(...)"? Feb 20 03:00:32 MikeWallaceDev: I just tried that and no luck Feb 20 03:00:34 copy cat :P Feb 20 03:00:47 I mean that you didn't add the 'new'. Feb 20 03:01:01 Ohh.... I had the parentheses Feb 20 03:01:02 d'oh Feb 20 03:01:05 >____< Feb 20 03:01:27 g00s pull out the whip, I'm not trying hard enough Feb 20 03:01:38 donaldepig: yeah, I think I hit the same thing. there seems to be a bug in the current version with reading the xml init rules, if you defined it in a tag in your manifest. Feb 20 03:01:42 donaldepig: http://stackoverflow.com/questions/27533679/google-analytics-blocks-android-app/27542483#27542483 Feb 20 03:02:08 donaldepig: set things up in code, it should work. Feb 20 03:03:24 Ok..Thanks you so much, i will do and keep you posted. Feb 20 03:05:36 I hate that AppCompat doesn't style buttons. My buttons look so out of place. Feb 20 03:05:50 Then again, I'll have to nuke them soon. reddit is requiring us to use OAuth 2 now. Feb 20 03:07:22 Question about Contexts... is there any benefit of using an elements context over an activity context over a baseContext? Right now I've just been doing whatever is easiest/comes to mind, but I'm unsure if there are any problems associated with that. Feb 20 03:11:18 t0astt: Are you asking about a view's context, an activity's context, and an application's context? Feb 20 03:11:26 TacticalJoke: Yes Feb 20 03:11:52 Oh, BaseContext is a thing. I forgot. Feb 20 03:18:53 t0astt: in general you use the closest one possible, in case something in between wraps / modifies it. in practice tho, I don't know if anyone uses anything more specific than the Activity. Maybe the toolbar does, since it has the "theme" as "global styles for sub-views"? to me that implies another level of ContextThemeWrapper. Feb 20 03:19:33 Ok, so it's kind of like jQuery selectors Feb 20 03:20:11 in a strained way, maybe, yeah. Feb 20 03:20:28 And I'm using a CustomView floating action button and I'm trying to attach an onClick event to it, however no function seems to attach. I'm reading through some SO posts and it looks like I need to add an onTouchEvent to it, is that the best way of doing this? Feb 20 03:20:48 but general programming practice says to inject your dependencies - that way it doesn't matter where it came from, you're given it because it's appropriate for you to have it. Feb 20 03:21:13 groxx: Yeah, I'm having to use my Toolbar's context to get correct theming. Feb 20 03:21:41 t0astt: not sure how that applies to contexts...? Feb 20 03:21:58 groxx: It doesn't, it was just another problem I came across Feb 20 03:22:02 t0astt: gotcha Feb 20 03:22:03 Sorry for the topic-switcheroo Feb 20 03:22:53 t0astt: I imagine the click problem depends heavily on the code. is this an open source FAB somewhere? Feb 20 03:23:07 groxx: Yes, I'll get you the source. One sec Feb 20 03:23:34 groxx: https://github.com/navasmdc/MaterialDesignLibrary/blob/master/MaterialDesign/src/com/gc/materialdesign/views/ButtonFloat.java Feb 20 03:24:03 hmm, it extends Button. Shouldn't it work with onClick then? Feb 20 03:24:13 groxx: Wow! i just made the corrections and it works. Thank you so much. Feb 20 03:24:58 No more ANRs!! Feb 20 03:25:08 t0astt: yeah, it looks like it should work to me Feb 20 03:25:47 t0astt: though if you / something else are setting an onTouchListener, it'll override the click handling. Feb 20 03:26:01 (usually) Feb 20 03:26:36 donaldepig: great, glad it's working :) it's certainly an unexpected bug to run into. hopefully you didn't lose too much time to it :) Feb 20 03:27:14 Hmm ok. I've tried attaching a method that doesn't even belong to the fragment OR activity and it didn't even error on that. I don't even see the Log.i() message I put in the onClick. Are you able to use onClick with methods defined in a fragment? Or must they be in an activity? Feb 20 03:28:17 unfortunately I did... But its all good. Feb 20 03:30:15 g00s: It usually comes through via email from what I've seen. Feb 20 03:30:32 luckily, i've never seen. hope i never do Feb 20 03:30:59 Same here, but scared the crap out of me when I got it. Feb 20 03:31:35 i think this is post 66289 on /r/androiddev "How can I improve my Android Programming Skills" Feb 20 03:31:56 i dont think reddit is a good forum for asking questions Feb 20 03:32:02 its also not a wiki Feb 20 03:32:10 the medium works for news, thats about it Feb 20 03:32:36 Huy guys, I am trying to add elevation to a linearlayout which has a custom drawable background (rounded rectangle).. the shadow is cut off on the bottom though.. how to fix? Feb 20 03:33:54 I hate apps that ask me to rate them. Feb 20 03:33:59 lol Feb 20 03:34:14 Re that reddit thread. Feb 20 03:34:17 t0astt: not sure what that means. if you're just _making_ a method named onClick somewhere, it's unlikely to do anything more than a method named `public void iSeeWhatYouDidThere()` Feb 20 03:34:58 groxx: I set the onClick method in the button XML to a method I created in the fragment that contains the button. It's not responding to anything, though, even setting the onClickListener in code Feb 20 03:35:14 I think the method has to be in an Activity. Feb 20 03:35:55 ah guys, the solution to my problem was to adjust the linear layout margins to equal the padding Feb 20 03:35:58 For a Fragment, you'll have to use View.setOnClickListener. Feb 20 03:36:21 TacticalJoke: Ok. Would you recommend moving the method to an activity or using View.setOnClickListener? Feb 20 03:36:44 t0astt: ah. a) you have the method signature right? I think you'll get logcat messages if not. b) dunno :| it might require an activity. seems like hopefully it wouldn't, but that's far from certain. Feb 20 03:36:52 anyone know of good (preferably free) video tutorials on learning to program for android Feb 20 03:37:12 why video? I never got that Feb 20 03:37:17 watch someoen code? Feb 20 03:37:18 t0astt: Not sure. I think it depends on the case. What are the exact details in this case? Feb 20 03:37:41 groxx: Thing is, I'm not getting any logcat messages, irrespective of what method I attach to the onClick Feb 20 03:37:47 t0astt: hackbod has spoken, activities only: https://groups.google.com/forum/#!topic/android-developers/IefVpDmmxZY Feb 20 03:38:01 PS, wtf Google, for not back porting elevation.. Feb 20 03:38:09 tricknology because I learn better from hearing than reading Feb 20 03:38:21 tricknology that seems like it would be pretty hard though Feb 20 03:38:37 donavan01: yep: https://www.coursera.org/course/androidpart1 Feb 20 03:38:49 t0astt: I think in general it makes more sense to use View.setOnClickListener, to localise the handling to the Fragment. Feb 20 03:38:56 thanks groxx Feb 20 03:39:02 I wish you could take my Android Prof’s course.. he was good. Feb 20 03:39:06 donavan01: try this one: https://www.youtube.com/playlist?list=PLE953C0B85B50AB62 Feb 20 03:39:09 he did screen casts as he programmed Feb 20 03:39:15 explaining all along the way Feb 20 03:39:51 t0astt: yeah, personally I avoid xml onClick stuff. it's simpler, but it hides some kinds of errors, such as this :) Feb 20 03:40:14 It's useful to think of a Fragment as a unit that could be moved elsewhere. Feb 20 03:40:16 TacticalJoke, groxx: Is this a valid onClick event? Because I attach it to my button and I don't even see the "Clicked" Logcat message: http://pastebin.com/dg7PpMgA Feb 20 03:40:17 Without error. Feb 20 03:41:04 t0astt: That looks fine as far as my tired eyes can see. Feb 20 03:41:12 t0astt: seems that way. are you getting other logcat messages? Feb 20 03:42:03 TacticalJoke, groxx: I get other Logcat messages fine. I did a Log.i(TAG, createShiftButton.toString()) as well to verify that the button is not null, and it is not null. Feb 20 03:43:12 thank GtN Feb 20 03:43:38 no worries Feb 20 03:43:44 TacticalJoke: I got a 100% and it was awesome! Thank you so much for your help! Feb 20 03:43:51 just noticed - that's not a system Button, it's another file in that project Feb 20 03:44:08 Mittendeep: Nice! Feb 20 03:44:11 even though it extends Button? Feb 20 03:44:14 groxx? Feb 20 03:44:17 Yeah, I googled and it extends Button. Feb 20 03:44:25 And doesn't seem to interfere with the click functionality. Feb 20 03:44:51 TacticalJoke: I raised the class average for the project from a 30% to a 36%. My classmates must have had a lot of trouble as well =) Feb 20 03:44:56 :D Feb 20 03:44:58 I programmatically added a checkbox to a framelayout. I'm trying to change the checkbox's foreground colour... right now it just defaults to black. Is there an easy way to do this without using XML? Feb 20 03:45:02 Are you guys doing more Android stuff after that? Feb 20 03:45:08 t0astt TacticalJoke: there's no import for android.widget.Button (or anything else named Button), so it must be coming from the same package. along side it in the views folder is a Button class, which does indeed override onTouchEvent, and doesn't forward it to the parent. Feb 20 03:45:12 Nice Mittendeep. That's always satisfying Feb 20 03:45:15 forward it to super* Feb 20 03:45:26 t0astt: call setOnClickListener on the button, the xml one won't work. Feb 20 03:45:34 groxx: Ooh, good point. Feb 20 03:45:49 or wait, I guess you did. Feb 20 03:45:53 maybe it's broken. Feb 20 03:45:59 groxx: I am setting the onClicKListener on the button Feb 20 03:46:05 TacitcalJoke: yup, more android stuff. Feb 20 03:46:32 I also didn't see any issue's on his github about this Feb 20 03:46:37 That's cool that you got 100%. Feb 20 03:46:48 I love getting 100% in stuff. haha Feb 20 03:48:31 I know, even though it was 3 days late it was actually working as intended so he was happy to give me a 100%. I need to get this other stuff out of the way so I can go back to working on more android projects. Feb 20 03:49:03 t0astt: eesh. that's a rough class to read. not sure what it's doing or if it's doing it right or wrong. Feb 20 03:49:17 groxx: Should I look into a new FAB library? Feb 20 03:49:17 t0astt: if you tap it, do you see ripples at all? Feb 20 03:49:32 groxx: I saw ripples when I was on Lollipop, but since I went back to KitKat, no Feb 20 03:49:39 I can test in the emulator real quick tho Feb 20 03:51:30 t0astt: it looks like it's doing its own ripple effect for all OS versions... I think? Feb 20 03:51:44 groxx: You know what, I just popped it up in the emulator and no ripple there either (on Lollipop) Feb 20 03:51:54 The clickAfterRipple thing is weird. Feb 20 03:52:01 Why does that have to be false for the click-listener to be called? Feb 20 03:52:13 TacticalJoke: it's called in another place where it has to be true. Feb 20 03:52:38 Oops, totally misread that other place. Yeah. Feb 20 03:52:45 if it's not rippling when you're touching it, seems like it's either busted in a way I don't yet understand, or you need to give it more information before it'll be fully initialized. Feb 20 03:53:05 t0astt: try .setEnabled(true), setting a ripple speed, setting animate = true, and anything else that looks interesting :| Feb 20 03:53:08 Hmm ok. I'll nuke it on my layout and readd it and see what happens Feb 20 03:53:16 I'll try the .setEnabled first Feb 20 03:53:38 Hi Developers.. I am developing app using google example code of BLE gatt device .. it kinda working now. So now i want that this app should run in background (like service). what is the approch for this. ? Feb 20 03:55:44 currently i select BLE device name and then send a text to device.. Now I want is my app should always run in background and keep sending data without any interface Feb 20 03:56:01 it sounds like you've already identified the solution :) Feb 20 03:56:05 hint: use a service Feb 20 03:56:42 groxx: Yeah, nothing is working. I even removed the setBackgroundColor I had on it, no luck. I'm going to nuke it off my layout and readd it and see what happens. Feb 20 03:56:43 t0astt: hm. do you have an edittext in view that could be focused? Feb 20 03:56:55 thanks Jesusfreke .. one question.. Can i convert any code to service ? Feb 20 03:57:11 groxx: Nope. No edittexts, except for in an activity that doesn't even get called currently. Feb 20 03:57:19 t0astt: yeah. tbh I might try something else soon too, the code's a bit odd and not too encouraging. plus that ripple is probably quite slow on older platforms, you probably don't want it. Feb 20 03:57:59 That makeCircle method is horrible. Feb 20 03:58:18 groxx: Ok. I'll look around. But first, check this bit out: "If you are going to use a ScrollView, it is recommended that you use the CustomScrollView provided in this library to avoid problems with the custom components. To use this component:" I AM using it on a ViewPager... I no it's not a scrollView, but would that have something to do with it? Feb 20 03:58:30 t0astt: one last thing to check: it might not work at all unless you set animate=true in xml. Feb 20 03:58:49 Yeah, I suspect it's that. Feb 20 03:58:58 Because the makeCircle thing doesn't get called at the right time. Feb 20 03:59:04 TacticalJoke: the animate=true or the viewpager thing? Feb 20 03:59:07 The former. Feb 20 03:59:26 removed animate=true, still nothing Feb 20 03:59:50 Just for fun, try "animate=false". Feb 20 04:00:16 eh, maybe not. I think I misread something. Feb 20 04:00:23 trying it TacticalJoke Feb 20 04:00:27 (re animate=true) Feb 20 04:00:34 Nothing Feb 20 04:00:36 So what I understand is in mainifest file I should redince my exisiting code to as service and default select BLE device name in code Feb 20 04:00:49 *Redifne Feb 20 04:02:50 Ah, okay. Feb 20 04:05:51 groxx, TacticalJoke: Weird. I nuked it on my layout, readded it, and now it responds just fine. Any ideas? I'm even using the same ID on it Feb 20 04:06:26 t0astt: :S nope, dunno Feb 20 04:06:30 Service are predifined ones or one can create any type of service ? Feb 20 04:06:59 I feel like this is literally one of those situations where you just scratch your head and ask yourself "how the f*** did this work" Feb 20 04:07:01 lol Feb 20 04:07:10 t0astt: I'd have to sit and think about the code I just read for a fair bit of time to have any confidence that I understood it :| I prefer to avoid code like that. Feb 20 04:07:25 Likewise. If I have trouble with this code again I'm pitching it. Feb 20 04:07:38 I mean Like i used notificatinListner service... Can I make custom code service also ? Feb 20 04:07:45 when it will get trigger then Feb 20 04:08:00 I've seen worse code work, so it's possible it's fine, but fwiw I don't plan on using it after seeing that :) Feb 20 04:08:37 Yeah, that parent-child coupling is awful. Feb 20 04:09:10 And the use of 'public' for makeCircle, and the fact that it has side effects, and so on. Feb 20 04:13:07 o/ I think I'm off for the night, or at least mostly. gonna read some state machine code to try to repair my brain damage. wish me luck! http://androidxref.com/5.0.0_r2/xref/frameworks/base/core/java/com/android/internal/util/StateMachine.java Feb 20 04:13:54 groxx: Good luck, although I recommend more reading the description of the state machine than the code for it Feb 20 04:14:03 implementations of state machines can get very hairy real quick Feb 20 04:14:54 deuteros__: yeah. doing both. plus I want to read a decent implementation if I can find one, and I haven't read this one yet. Feb 20 04:15:06 seems relatively full-featured Feb 20 04:15:24 and also relatively well documented :) Feb 20 04:15:40 groxx i use that all the tie Feb 20 04:15:48 *time. it works awsome Feb 20 04:16:23 that's what I'm hoping for. there are a few complex spots at work that would benefit from some strictness, we might use this if it seems good. Feb 20 04:16:46 remember though that being based on handler, it is a queued state machine Feb 20 04:16:55 which has some implications Feb 20 04:17:01 looks that way, yeah. Feb 20 04:17:42 groxx also its used all over the place in android, so lots of good examples Feb 20 04:18:43 any particularly nice ones / know of any that push against limitations? I'll probably be reading them too. Feb 20 04:19:10 hmm, its used in maybe 15 services roughly - i dont remember which are nice. Feb 20 04:19:38 eh, it's a start Feb 20 04:19:49 * groxx afks to curl up with code, beer, and wife Feb 20 04:20:06 Zomg, my app looks hawt in indigo. Feb 20 04:20:08 transitionTo(curlingState) Feb 20 04:20:28 Be cautious with state machines, they are super fast but tough to debug Feb 20 04:22:01 groxx look at the statemachine test cases Feb 20 04:22:09 actually, thats the best documentation Feb 20 04:22:31 groxx come baaaaaack Feb 20 04:23:00 i think he's in the curling state Feb 20 04:23:02 TacticalJoke: That ripple on the FAB I'm using isn't asynchronous and causes the dialog I'm trying to show to only show after the ripple animation is done. GROSS. Feb 20 04:23:11 groxx.getState() Feb 20 04:23:50 g00s: http://media2.giphy.com/media/hbewcRhBwnYvC/200.gif Feb 20 04:24:15 Groxx g = new Groxx(); groxx.setAfk(false); Feb 20 04:24:35 JesusFreke :) Feb 20 04:24:51 You created a new groxx? What have you done?! Feb 20 04:26:32 Nah he's a singleton Feb 20 04:27:36 groxx.obtain() Feb 20 04:27:51 just watch them .recycle calls Feb 20 04:28:10 JesusFreke http://en.wikipedia.org/wiki/Unicycle_hockey Feb 20 04:28:11 In Material Dark, is it "Material" to use a dark-grey background along with my colorPrimary, colorAccent, etc.? Feb 20 04:28:18 Or would the dark-grey thing have to be one of those colours? Feb 20 04:28:22 i wondered if JesusFreke ever tried curling on a unicycle :D Feb 20 04:28:26 JesusFreke: lol, my home town has a decent sized curling club Feb 20 04:28:38 heh. I'd love to try curling sometime Feb 20 04:28:47 I've tried unicycling on ice. It doesn't work, obviously :) Feb 20 04:28:51 need snow tires :) Feb 20 04:28:53 yea Feb 20 04:28:54 spikes ! Feb 20 04:28:58 g00s: the tests are also on my reading list, yeah. Feb 20 04:28:59 chains ? Feb 20 04:29:07 groxx read the tests first :) Feb 20 04:29:16 yeah, I'm sure you could rig up something to make it work Feb 20 04:29:47 groxx the alternative is statemachine with enum or a tool called SMC Feb 20 04:30:00 http://smc.sourceforge.net/ Feb 20 04:30:01 and state is always hard to debug. but yay logs and that's why I'd prefer to have a trustworthy implementation, and understand it thoroughly, rather than building it myself. Feb 20 04:30:28 Implementing the engine of a state machine is trivial. Implementing a specific state machine is where it gets hairy Feb 20 04:30:33 For example, could I have an indigo Toolbar with the typical dark-grey windowBackground and not get hassled by the Material Police? Feb 20 04:30:45 It looks kinda cool. Feb 20 04:30:46 s a -> b -> s b Feb 20 04:31:25 the SMC DSL is easy to read at least ;) Feb 20 04:31:27 deuteros__: yeah, though I gather this one is threadsafe? though use with multiple threads obviously has complexities Feb 20 04:33:00 groxx i have replaced some of my state machine with rx though Feb 20 04:33:20 here you go http://adelnizamutdinov.github.io/blog/2015/01/23/using-rxjavas-observable-semantics-for-greater-good/ Feb 20 04:33:26 good talk about that Feb 20 04:34:06 if you can rx mediaplayer, anything can be rx'd :D Feb 20 04:34:11 anyway. among other locations, we have some fairly complex, thread-heavy camera code, which was written with... a certain level of yolo... that I'd love to rip out and replace with something sane. it's probably the most problematic part of my work's app. Feb 20 04:34:13 jk Feb 20 04:35:12 Anyone know of any libraries that can do Date AND Time selection in one picker dialog? Doesn't even have to be a dialog. Could even be a view or something. Feb 20 04:35:58 t0astt didn't i show you this the other day ? https://github.com/jjobes/SlideDateTimePicker Feb 20 04:46:59 that looks pretty slick Feb 20 04:57:19 hi Feb 20 04:57:41 can i convert a activity into service ? Feb 20 04:58:02 like i have a activity which show list on screen Feb 20 04:58:16 can i convert this code as it is into service Feb 20 04:58:18 ? Feb 20 04:59:15 gaganchd2000: is there something that's preventing you from doing so? Feb 20 05:00:13 I am reading service documentation right now so this doubt came into my mind... Feb 20 05:00:15 The effort required to read the Service doc I presume Feb 20 05:00:25 trying to grasp the concept of it.. Feb 20 05:01:01 well, try it out. experiment. :) Feb 20 05:01:07 learn. :) Feb 20 05:01:32 you'll learn a lot more if you actually try it yourself Feb 20 05:02:14 Yeps .. been doing the same.. and I should say I love android studio.. Feb 20 05:02:30 <_genuser_> if you love android studio, you're not doing it right. Feb 20 05:05:30 yes, everyone must have the same opinion as you :) Feb 20 05:06:05 ah g00s, you must have. I actually show it as bookmarked as well -___-. Sleep deprivation sucks. Feb 20 05:06:37 t0astt: I prescribe coffee Feb 20 05:07:00 something under the LD50, preferably Feb 20 05:07:08 * JesusFreke chews on some coffee beans Feb 20 05:09:20 Can i declare java class as activity and service both ? Feb 20 05:09:53 like i am having an activity screen.. now want to do this in background Feb 20 05:09:54 i guess you'll have to learn java first :( Feb 20 05:10:47 Hello, I have a navigationdrawer activity with a fragment manager swapping out the fragment in the activity depending on the selection the navigation drawer. My question is. how do I make the back button go to the previous fragment select and not the previous activity? Feb 20 05:10:48 gaganchd2000 the docs on services are well done, even if a few readings are required to wrap your head around it Feb 20 05:11:27 gaganchd2000: well.. is there something that's preventing you from declaring a class as an activity and service? Feb 20 05:11:31 * g00s hates the back button Feb 20 05:11:46 try it and see! Feb 20 05:11:48 yeps.. just being over curious Feb 20 05:12:09 you'll get an error message. and then you can search for the error message and find out more information about why what you were trying to do doesn't work. Feb 20 05:12:46 you might notice a trend to my advise ;) Feb 20 05:13:10 so R.id and R.layout aren't the same Feb 20 05:13:12 who knew rite Feb 20 05:13:37 myke: it's a common type. the "id" button is right next to the "layout" button. Feb 20 05:13:39 typo* Feb 20 05:16:45 <_genuser_> JesusFreke: well, I didn't say that. did I? Feb 20 05:17:11 _genuser_: sounded a lot like that to me :) Feb 20 05:17:22 is there maybe a site that just has shell apps with nothing but layout examples for apps? Feb 20 05:17:36 or even single page apps with just different layout examples Feb 20 05:18:11 <_genuser_> JesusFreke: I think it was more of a exagerrated way of stating my own opinion. but never requiring anyone else to share it. Feb 20 05:19:40 I have a loop: for(i = 0; i < 10; i++) and want to use the variable i from an inner class (in this case setOnClickListener). At the moment it works to write final int i2 = i but is there a better way? Feb 20 05:20:41 <_genuser_> using inner class's var in outer class as loop counter? Feb 20 05:20:45 duncannz: Can you post the code? Curious of why you're doing that. Feb 20 05:20:55 pass it in the constructor of a class which implements the listener Feb 20 05:21:07 it's all the same in the bytecode Feb 20 05:25:27 TacticalJoke: along the lines of http://dpaste.com/13YCAF3 Feb 20 05:26:10 Could you set the button's tag or something? Feb 20 05:27:39 <_genuser_> honestly, what's wrong with final int? Feb 20 05:28:22 TacticalJoke: just researched tags, and no I don't think it's the right thing for me. There is one button in the fragment, which needs to do something different in each row Feb 20 05:28:58 I was more thinking maybe there's a quick way that's better than final int i2 = i; but it doesn't seem like it, _genuser_. So I'll just leave it as is Feb 20 05:30:45 Isn't there one ImageButton per row? Feb 20 05:30:51 <_genuser_> but in each iteration you're getting the same button from your view and adding a new onclicklistener with a different number? Feb 20 05:31:10 <_genuser_> just the one button per entire view, won't know how to deal with teh specific row you're talking about. Feb 20 05:31:21 <_genuser_> like TacticalJoke said, shouldn't there be a button per row? Feb 20 05:33:02 yeah there is one button per row, there's one button in the fragment Feb 20 05:33:03 nvm though Feb 20 05:36:14 The tag thing would be this: button.setTag(i); [...] public onClick(View view) { doStuff((int) view.getTag()); } Feb 20 05:36:36 It's not perfect but sometimes the tag system is a lesser-evil thing. Feb 20 05:36:45 <_genuser_> but [...] would never comile... :p Feb 20 05:36:55 Yeah I try to avoid it overall to avoid the cast Feb 20 05:37:37 I would hate casting less if we could say this: doStuff(view.getTag() as int); // though it'd still be kinda horrible Feb 20 05:38:34 Generics would be best, I guess. Feb 20 05:39:28 then you're still casting Feb 20 05:39:34 view.getTag() Feb 20 05:39:34 <_genuser_> I have noticed that a lot of these things work out just fine if done in small amounts. Feb 20 05:39:44 Yeah. Just compile-time-checked. :D Feb 20 05:39:51 <_genuser_> but it pays to be aware of performance penalties when you start doing performance intensive crap. Feb 20 05:40:00 TacticalJoke: Still a cast. Feb 20 05:40:03 it's no more checked than (int) Feb 20 05:40:06 The better way is to have model objects Feb 20 05:40:08 or your "as int" Feb 20 05:40:17 you have the index, you get the model behind it Feb 20 05:40:20 fully typed Feb 20 05:40:22 indeed Feb 20 05:40:29 do what that guy says Feb 20 05:42:48 hello Feb 20 05:43:02 I need to create a custom calendar view/layout/component Feb 20 05:43:08 What is the best way to approach this? Feb 20 05:43:51 i guess you could study https://github.com/prolificinteractive/material-calendarview Feb 20 05:44:49 morning Feb 20 05:45:47 g00s, hmm, interesting Feb 20 05:45:56 thanks, i will take a look at this Feb 20 05:46:07 Which API versions would y'all download, if you were getting ready to develop a game to promote your music project? Feb 20 05:46:31 (It's sort-of a choose-your-own-adventure-ish game, crossed with something like oregon trail) Feb 20 05:46:37 should i use begin beginTransaction, setTransactionSuccessful, endTransaction on every insert, delete, select queries? Feb 20 05:47:09 ondroed no Feb 20 05:47:13 on every single such queries Feb 20 05:47:52 Hi I need help for gcm Feb 20 05:48:06 Please someone tell me how should I work with it Feb 20 05:48:28 i just saw in debug that select query returned just deleted row Feb 20 05:49:18 that made endless loop in my app Feb 20 05:49:39 Seylerius: 21 Feb 20 05:49:54 JakeWharton: Just the latest? Feb 20 05:50:02 always use the latest Feb 20 05:50:09 JakeWharton are you going to wear minSdk=21 shirt at I/O ? Feb 20 05:50:16 i didn't say min Feb 20 05:50:32 JakeWharton: Any additional versions you'd get? Feb 20 05:50:39 no, you only need the latest Feb 20 05:50:40 dipika: Plenty of documentation on this left and right, it's easy to set up, just boiler platey Feb 20 05:50:57 <_genuser_> mindsdk=21 t-shirt. that would be cool! Feb 20 05:51:05 you can support all the older versions but you should always be compiling with the latest Feb 20 05:52:15 I don't know how to start with it gcm Feb 20 05:53:23 <_genuser_> JakeWharton: interesting comment. so you'd have to personally track which items you use lock you into a certain version or higher? Feb 20 05:53:33 lint does that Feb 20 05:53:53 <_genuser_> oh, so if you use somethign that's higher than minSdk in manifest, it will complain then? Feb 20 05:54:04 yes, you have to guard it with a version conditional Feb 20 05:54:17 i kinda miss real-time lint in eclipse Feb 20 05:54:24 <_genuser_> learnt something new today. :) Feb 20 05:54:25 in AS i have to do analyze Feb 20 05:54:28 <_genuser_> thank JakeWharton Feb 20 05:54:33 <_genuser_> *thanks Feb 20 06:10:39 how does lint do api level checking? Feb 20 06:10:53 * pfn ponders Feb 20 06:12:10 I don't think android.jar has version annotations Feb 20 06:13:29 it uses the android-api.txt or whatever it's named Feb 20 06:13:50 Interesting Feb 20 06:13:57 that's useful, thanks Feb 20 06:14:11 Sorry, I was unclear: I meant that the whole type would have the parameter: Button button = new Button<>(...); Crazy, though. Just a thought that popped up. Feb 20 06:18:24 I'll probably reinlement Feb 20 06:18:38 reimplement lint using asm Feb 20 06:19:52 it's how it should have been written to begin with Feb 20 06:21:37 pfn how would it be different. i don't know about asm Feb 20 06:21:52 or how would it be better Feb 20 06:26:40 "Apple Wants to Start Producing Cars as Soon as 2020" Feb 20 06:37:24 pfn: I dare you! Feb 20 06:38:34 i double dog dare you ! Feb 20 06:38:52 what's a good Rx solution for eliminating a particular pattern from a sequence Feb 20 06:39:26 ie (0, 100, 0, 100, 0, 100, 0, 20, 30, 40) -> (0, 20, 30, 40) Feb 20 06:39:44 eliminating known noise Feb 20 06:40:05 knapper_tech i guess you are looking for some kind of filter Feb 20 06:41:21 knapper_tech maybe something like http://stackoverflow.com/questions/14805392/rx-stateful-transform-of-sequence-e-g-exponential-moving-average Feb 20 06:41:33 g00s, the fact that you can run lint against class files and not. java source Feb 20 06:48:07 knapper_tech: That's a tough one to accomplish if you don't know the max number of items you'd consider for extracting a pattern from it Feb 20 06:48:23 if you do, some sliding window might work, but honestly, I'm not sure I'd still use rx for that Feb 20 06:52:04 window seems to divide into chunks rather than always emit a new window Feb 20 06:52:10 I'm getting some done with replay Feb 20 07:00:07 if i have an app and my own server, does it make sense to path oauth thru to the client and use that token on the server, or should i first auth the client to my server and then do oauth entirely on the server? Feb 20 07:00:13 pass Feb 20 07:02:54 if you have a module that depends on X and Y, and Y also depends on X ... do you just declare the dependency on Y , or X & Y ? Feb 20 07:03:28 in other words, let the transitive dependency satisfy? Feb 20 07:03:57 I wouldn't do that, you might pull a dependency with a version number that's not high enough Feb 20 07:04:17 deuteros__ so you would be explicit about X and Y Feb 20 07:04:38 Yes, declare all your first order dependencies explicitly, let the container take care of the rest Feb 20 07:04:45 ok thanks Feb 20 07:05:13 if you use it, be explicit Feb 20 07:05:22 if you don't, let it be transitive Feb 20 07:06:08 sounds good Feb 20 07:08:35 it's good to use all dependencies explicitly Feb 20 07:09:11 at least in java ee Feb 20 07:09:16 <_genuser_> explicit? what if he puts some r-rated language in his app? Feb 20 07:12:31 huh Feb 20 07:12:34 didnt get the joke Feb 20 07:15:15 <_genuser_> oh pfn said "be explicit". joke was about being explicit by using "explicit language" which can be graphic/sexual ... generally undesirable without warning. Feb 20 07:16:06 i am building an app which gets Json data from api and save it to DB with the help of AsyncTask after that i am running a method to get the downloaded data instantly but the problem is i cannot retrieve data instantly. but if i kill app and start again than its working.. any clues Feb 20 07:16:07 ? Feb 20 07:17:35 s9iper1, arent you asking that for days now? Feb 20 07:17:37 there was a onsharedprefchangelistener that updates on run time is there any thing like that in FileInputstream to get updated data instantly bec i am using inputstream to read it Feb 20 07:17:42 na Feb 20 07:17:58 last night i asked but no proper help Feb 20 07:18:19 ah ^^. well was day for me and now its day again :p Feb 20 07:18:31 ha Feb 20 07:18:42 <_genuser_> if you get the data in doInBackground() and save it, in onPostExecute() it should be available for you to use. Feb 20 07:18:47 you wont get help if you cant show any code that cant be fixed ;) Feb 20 07:19:33 <_genuser_> if you're writing new data to a file, .flush() it and close, which should ensure it gets wrtten to disk. Feb 20 07:19:54 exactly i am doing this in Async hang on i will see you both codes. Feb 20 07:19:56 ok Feb 20 07:21:32 this is the main activity danijoo_ , _genuser_ Feb 20 07:21:35 http://paste.ubuntu.com/10320362/ Feb 20 07:21:54 <_genuser_> ugh ubuntu Feb 20 07:22:14 this is Aync class http://paste.ubuntu.com/10320372/ Feb 20 07:22:24 yeah ubuntu : Feb 20 07:22:25 :) Feb 20 07:22:35 <_genuser_> there's no asynctask in there. Feb 20 07:25:01 i cant see you trying to get the data after you receive it Feb 20 07:25:15 you execute this asynctask and then onCreate is done and nothing else will happen Feb 20 07:26:08 <_genuser_> danijoo_: lol, I don't even see the asynctask in the code. Feb 20 07:26:22 _genuser_, he posted two pastebins :p Feb 20 07:26:43 theres the task: http://paste.ubuntu.com/10320372/ Feb 20 07:27:18 <_genuser_> oh, I see. Feb 20 07:27:27 if i understand the code, you try to get the data from the file in onCreate. If no data is stored, you run the async task to get the data and save it Feb 20 07:27:54 but after that, there is no call to gettingDataFromDb(), so how should it be displayed Feb 20 07:28:28 <_genuser_> danijoo_: next, you'll send me to #irc to learn how to read message, lol. Feb 20 07:28:44 :D Feb 20 07:29:47 <_genuser_> yeah, you have to get the notification back to your activity from onPostExecute that the work is done. Feb 20 07:30:14 exactly. there is no callback or sth like that Feb 20 07:31:38 <_genuser_> now, if I can get motivated and start writing my ImageCache object. Feb 20 07:31:57 or you could use a library :p Feb 20 07:32:00 <_genuser_> it's quite simple, I think I have mapped it out in my mind. just need to actually go and write it. Feb 20 07:32:33 <_genuser_> for disk caching, I'd use a lib. For the bit on top of it, that determines whether it's off the web, from db, or parsed out of a file, I need to write that bit. Feb 20 07:32:44 <_genuser_> then I could pass it to a lib to do actual caching. Feb 20 07:49:28 since android studio 1.1.0 is out, unit testing work or it is still in beta ? Feb 20 07:50:11 i'm sure tacticaljoke can give you the full 100 page report Feb 20 08:01:33 haha, thanks g00s ! Feb 20 08:08:32 <_genuser_> ugh verizon!!! Feb 20 08:08:44 <_genuser_> why would you not let people paste in a credit card number when paying. Feb 20 08:09:44 no one lets you do that Feb 20 08:10:28 <_genuser_> every single place I pay online, I can paste in the credit card number, which I copy from the card website. Feb 20 08:10:37 you can paste it here Feb 20 08:10:45 dont forget about expiration date ;) Feb 20 08:10:47 ctrl v pls Feb 20 08:10:58 and code Feb 20 08:11:03 <_genuser_> except for verizon. who cares? what special security will be compromised by "pasting it in" vs. "typing it in". Feb 20 08:11:04 also name on card Feb 20 08:11:18 pifon: I dont need card name I guess Feb 20 08:11:30 <_genuser_> actually, typing it in is less safe. a keylogger could save those. pasting it in, well the keylogger would just get a "ctrl-v" Feb 20 08:11:35 do you need card name to make a transfer ? Feb 20 08:11:57 no Feb 20 08:12:07 here yo do Feb 20 08:12:12 so, i dont need your name Feb 20 08:12:28 i think it depends on where you put it in Feb 20 08:12:32 but usually you dont Feb 20 08:12:34 also never seen a website that lets me past my card number Feb 20 08:12:40 <_genuser_> geez, you guys thanks for hijacking my point! Feb 20 08:12:41 would be unfair to hackers Feb 20 08:12:49 :D Feb 20 08:12:51 <_genuser_> verizon fios website is pretty bad in a many ways. Feb 20 08:13:19 <_genuser_> as to the credit card number that you guys are looking for.... Feb 20 08:14:04 <_genuser_> I use virtual card numbers from citibank. You create a new number, load x dollars on it, and paste it online. it will only work for X dollars. After the first payment, that number will only work for that merchant. Feb 20 08:14:08 <_genuser_> until the card expires. Feb 20 08:14:17 <_genuser_> if you think the website was hacked, just close the virtual acct num. Feb 20 08:14:53 _genuser_, german citibank? Feb 20 08:15:06 or is citibank global? Feb 20 08:15:49 <_genuser_> the german branch was sold to french Credit Mutuel Group on feb 22, 2010 wikipedia says. Feb 20 08:16:11 <_genuser_> but in general the US citibank based in NYC. Feb 20 08:16:19 yeah i just looked it up. weird. I thought citibank is a german bank :D Feb 20 08:16:26 dunno why Feb 20 08:16:39 maybe thinking deutsch bank O.o Feb 20 08:16:51 no. thats something else ;) Feb 20 08:17:23 <_genuser_> sometimes you think something is from a given country due to the initial impression that was guided by whatever situation. Feb 20 08:17:29 <_genuser_> then it just stays in your mind. Feb 20 08:17:51 i thought android came from hell Feb 20 08:18:04 <_genuser_> lol. Feb 20 08:18:05 g00s, and you are right Feb 20 08:19:02 <_genuser_> now that i've paid the bills, maybe I should actually get coding. Feb 20 08:19:16 no matter how many times they say mountainview ... Feb 20 08:19:39 i have to stop and think, no its not from mountainview, its from hell Feb 20 08:19:52 unless mountainview is in hell too Feb 20 08:20:03 <_genuser_> only if android users loved to pay... Feb 20 08:24:57 its kinda funny how apple is poaching tesla employees now ... but jobs and schmidt had a no-poaching agreement Feb 20 08:25:38 oh man, now even samsung is getting into mobile payment Feb 20 08:26:28 what's the preferred oauth library? Feb 20 08:31:01 In https://github.com/astuetz/PagerSlidingTabStrip#customization, what is meant by "adjust these values"? styles.xml? xml attributes on the PagerSlidingTabStrip? if styles.xml, what should be the android:name and android:parent of the