**** BEGIN LOGGING AT Sun Feb 01 02:59:59 2015 Feb 01 03:11:25 yiati: If I invoke Gradle from the command line and pass 'clean build', the only errors I get are lint ones. Feb 01 03:11:31 The module in question builds fine. Feb 01 03:15:54 TacticalJoke: Well that confirms it's an AS build config problem, and not a gradle problem at least Feb 01 03:15:56 Okay, can't reproduce this with a fresh project. Weird. Feb 01 03:16:12 #thumbsup Feb 01 03:30:57 Hi all. I'm new to android development, getting started with android studio. Feb 01 03:31:15 Is there any concept of grouping UI items together with xml layouts? Feb 01 03:31:49 fullstop: Yep, with ViewGroup classes Feb 01 03:32:08 that sounds like not in the xml file, yes? Feb 01 03:32:38 fullstop: You can use ViewGroups in xml files or java Feb 01 03:32:50 let me look, thanks Feb 01 03:33:45 g00s: there is no reflection for function reference, as far as I can tell Feb 01 03:36:50 When downloading a large json string, would a good method for storing each object be to store each object as a json string into a local db? Feb 01 03:38:29 depends what you'll be doing with it Feb 01 03:38:34 ah, a LinearLayout is a ViewGroup.. not exactly what I was expecting, but it works. Feb 01 03:38:49 Anthaas: but most likely, no Feb 01 03:40:56 JakeWharton: Ahh could you offer a better alternative? Feb 01 03:41:02 fullstop: yep, LinearLayout, RelativeLayout, and FrameLayout are good general ViewGroups to use Feb 01 03:41:40 Anthaas: Depends on what you're trying to cache, and for how long Feb 01 03:41:44 Is it better to pull out what I want, and store it in a tradition RDB manner? Feb 01 03:42:12 probably Feb 01 03:42:13 Err, itll update as often as the user requests AND data set updates (could be very often) Feb 01 03:42:13 JakeWharton ok thanks Feb 01 03:43:10 (Im making YET ANOTHER Reddit reader. Yes, yes I know how people in here are bored of them etc, but its just a tool for learning for me before moving onto something else - plus its something I'd use and continuously learn from Feb 01 03:43:11 ) Feb 01 03:44:07 Why are you wanting to store reddit's JSON responses? Feb 01 03:44:43 Actually Feb 01 03:44:45 Now I think about it Feb 01 03:44:48 I dont. Feb 01 03:45:07 Yep, that's why the "why" is important :) Feb 01 03:45:16 Well, the idea was to reduce the number of networking processes Feb 01 03:45:17 My app just stream-parses the JSON and pulls out what it wants. Feb 01 03:45:23 * shmooz slaps Anthaas on the back of the head Feb 01 03:45:23 reddit's JSON is *huge*. Feb 01 03:45:36 Don't think! Feeeel! Feb 01 03:45:47 i.e. if I move to a new activity, and come back, I personally wouldnt want what I had to change from what it was before because if I planned on reading another one after, it could have moved. Feb 01 03:47:48 Yeah. I'm guessing you'll also want to save the collapsed state of comments in WhateverCommentActivity.onPause. Feb 01 03:48:37 What do you mean? Feb 01 03:48:39 A huge problem I've had with reddit apps is that some of them don't bother to reconstruct the visible comment tree correctly when their process gets killed. Feb 01 03:48:57 s/when/after/ Feb 01 03:49:35 Oh, so when Im viewing the comments, and I pause to send a text to someone for example, and then reopen? Feb 01 03:49:40 Yeah. Feb 01 03:50:08 Oh right, yeah of course. Again, it would seem adding a String containing the comments as a json would be an easy way of doing this... Feb 01 03:50:56 Then again, I dont know... hah Feb 01 03:52:58 Note that creating a good reddit client takes a huge amount of time. It's not something that'll just take a few weeks. Feb 01 03:53:21 and it may actually be impossible Feb 01 03:54:03 Oh I know that its not quick. Its just something Im using to learn different things. Feb 01 03:57:35 I hope to convince you, JakeWharton. :) Feb 01 03:57:40 please do Feb 01 03:57:47 i'm a tough customer Feb 01 03:58:03 I bet you say that to all the girls. Feb 01 04:00:28 A reddit client is a good challenge to learn about efficient network processing Feb 01 04:01:50 Ehhh Feb 01 04:01:57 Not when you have a good library to do it for you Feb 01 04:02:18 A library is not going to help you write a responsive client when its payload is huge for each API call Feb 01 04:02:51 You need to be creative, JSON streamin, structure the UI to hide things that take long to load, etc... Feb 01 04:02:55 i definitely see that in other clients Feb 01 04:03:04 the time to data seems very high vs. others Feb 01 04:03:09 Ill add snake whenever the app is loading Feb 01 04:03:22 Anthaas: credit for creativity Feb 01 04:03:23 Who doesnt love snake Feb 01 04:03:25 :P Feb 01 04:08:14 But for now, I sleep. Feb 01 04:08:18 Night all Feb 01 04:10:53 JakeWharton: Still a fan of Rx? Feb 01 04:10:58 yes Feb 01 04:11:11 Did it completely replace event buses for you? Feb 01 04:11:34 yeah I haven't used an event bus in like 18 months Feb 01 04:12:01 Ok. I want to like Rx, I see the power but I'm not convinced it's something that's going to last. Going to introduce it slowly in our apps Feb 01 04:12:27 rx + retrolambda Feb 01 04:12:46 or just say fuck it and port everything to scala :p Feb 01 04:12:55 Yes, I like retrolambda too but a bit more cautious there, not sure the teams will be able to embrace it easily Feb 01 04:13:05 Nah, scala on android is crazy, as we already discussed Feb 01 04:13:15 I think Rx will be an easier sell Feb 01 04:13:16 not at all crazy, but ok Feb 01 04:13:18 scala and retrolambda are toxic Feb 01 04:13:27 for android Feb 01 04:13:29 crazy for acceptance, but bsuuppose Feb 01 04:13:42 Not just acceptance, just plain dangerous to ship code Feb 01 04:14:25 AS does a nice job folding the code to look like lambdas, I'm okay with this compromise Feb 01 04:14:43 toxic, then so is every non java jvm language Feb 01 04:14:59 No, just Scala and dynamically typed languages Feb 01 04:15:05 maybe, but scala is clearly the worst in that regard Feb 01 04:15:08 that leaves Kotlin (the Ceylon team is not really eager to support Android) Feb 01 04:15:51 Scala would be a huge step backward for all our teams in productivity considering how crappy the IDE support still is (and that's just one of dozens of reasons to avoid it) Feb 01 04:17:36 clearly the worst? it's the best jvm language that runs on android Feb 01 04:18:06 yep Feb 01 04:18:11 you win Feb 01 04:18:39 When downloading AVD images which generally fast? x86 ones or armeabi ones? Feb 01 04:18:52 x86 Feb 01 04:18:57 thank you Feb 01 04:19:19 napster: meh x86 if those are your choices, actual device is best. Genymotion is a decent second option Feb 01 04:19:49 yiati I do have multiple devices, but need a 4.0.3 avd for min sdk testing Feb 01 04:20:06 napster: Checkout Genymotion Feb 01 04:20:27 x86 is even terribly slow compared to it Feb 01 04:20:30 Is it normal to edit your AndroidManifest.xml manually? I'm using Android Studio. Feb 01 04:20:33 yiati its heavy download for a relatively small task. + some features are paid. Feb 01 04:20:42 pw3 yes Feb 01 04:20:49 It never ceases to amaze me how quickly people fall in love with languages and lose all objectivity about their applicability Feb 01 04:20:56 napster: Do you need any of the paid features? Feb 01 04:21:24 deuteros__, considering I've been doing scala on Android for 4 years now, applicability has never been a concern Feb 01 04:21:37 he didn't mean technical applicability Feb 01 04:21:39 yiati not much IIRC, but still its heavy for this task. I would rely on fastest among AVD images. Feb 01 04:21:46 writing bytecode from hand has amazing applicability Feb 01 04:21:50 What JakeWharton said. You're still missing the forest for the trees Feb 01 04:21:50 napster: Plus if you care about speed the boost from armeabi to x86 is neglibable, and the speed boost of Genymotion is actually something worthwhile Feb 01 04:22:02 and it's clearly the best jvm langauge that runs on android Feb 01 04:22:07 I can see the forest instead of a 10p l Feb 01 04:22:14 ... swiftkey Feb 01 04:22:35 Falling in love with technology is a path to terrible engineering Feb 01 04:22:35 use the stock keyboard, it's writing in java. works perfectly. Feb 01 04:22:58 yiati righ, thanks m8 Feb 01 04:23:49 np, avd can work too. It would be nice to see Google come out with a simulator, or maybe even just buy Genymotion Feb 01 04:24:56 JakeWharton, SwiftKey is presumably written in Java as well Feb 01 04:25:44 I love the "Don't keep activities" thing. Feb 01 04:25:48 deuteros__, resistance to technology is a path to stagnation Feb 01 04:25:58 yiati: Bah, developing on real devices is really easy Feb 01 04:26:07 pfn: Totally agree Feb 01 04:26:25 that's also not an argument Feb 01 04:26:30 Resistance to bad technology is quite healthy, though Feb 01 04:26:39 does android:animateLayoutChanges="true" get inherited by child layouts? Feb 01 04:26:49 the problem here is we disagree on the meaning of bad here Feb 01 04:27:12 deuteros__: Yes I agre testing on real devices is the most preferable, but sometimes you don't have the device/osversion laying around that you need Feb 01 04:27:12 Yup Feb 01 04:27:18 interestingly, running AVD on linux with kvm means it’s just as fast as native code. Everything just works, instantly Feb 01 04:27:36 yiati: True, but stock Android devices will get you 90% of the way Feb 01 04:28:13 That other 10% can suprisingly take a lot of your time up :P Feb 01 04:28:44 get every Nexus device as they become available, best way to test on all versions Feb 01 04:28:55 just flash old and new versions as necessary Feb 01 04:29:06 justJanne: Yeah that's basically what Genymotion does Feb 01 04:29:19 yiati: But the AVD does the same on Linux as well. Feb 01 04:29:45 justJanne: Yeah Genymotion runs the AVD on a VirtualBox linux instance Feb 01 04:29:49 it does just user-space emulation, keeping the kernel. Feb 01 04:29:55 yep Feb 01 04:30:10 yeah, the normal Google AVD does exactly the same. Feb 01 04:30:52 It only emulates on Windows Feb 01 04:31:20 It emulates on x86 Feb 01 04:32:01 nope, try it. Per default on linux x86 it uses the kernel as hypervisor for android, running it directly without the regular overhead Feb 01 04:32:29 Oh you're talking about the x86 version of the avd? Feb 01 04:33:03 Yeah genymotion actually allows you to emulate the ARM avd on an ARM Android Linux Virtualbox instance Feb 01 04:34:02 i'd still be using geny if I had some free ram :( Feb 01 04:34:10 AS + gradle took it all Feb 01 04:34:14 Jeez, the AOSP issue tracker is flooded with spam: https://code.google.com/p/android/issues/list Feb 01 04:34:49 I wonder whether a CAPTCHA thing would help. Feb 01 04:34:49 i'm surprised they don't use captcha Feb 01 04:34:52 haha Feb 01 04:34:58 heh Feb 01 04:38:48 deuteros__ adopting rxjava on android is pretty low risk; others have gone before and figured out what needs to be done. you wouldn't be am early adoptner now in geof moore's taxonomy of the chasm ;) Feb 01 04:39:20 its not something you have to go all in either; you just do a few pieces here or there on the periphery Feb 01 04:40:38 especially now at 1.0 its pretty mature Feb 01 04:41:00 not like you're using the early 0.10 release XD Feb 01 04:41:53 where it would get risky is if you decide to rx all the things without much experience Feb 01 04:42:12 rx java is no risk Feb 01 04:42:21 just people being afraid of retrolambda Feb 01 04:42:52 that's the only moderate risk Feb 01 04:43:18 g00s: My thought exactly. I think Rx is a safe "adopt" move. Retrolambad is more risky, scala is a no-go. Kotlin has inched up on my "adopt" list Feb 01 04:44:06 the value proposition of retrolambda is too low to even consider Feb 01 04:44:15 * deuteros__ nods Feb 01 04:45:02 * pfn shrugs, retrolambda is gonna be forced on next clients java project Feb 01 04:45:29 Really depends on the team Feb 01 04:45:39 If they're bleeding edge and very familiar with java 8, it's a safe move Feb 01 04:45:58 I run a lot of teams with a very varying level in Java, retrolambda is just not worth it Feb 01 04:46:12 the only thing i worry about is breaking builds Feb 01 04:46:21 * pfn added a functional futures port to his last java project Feb 01 04:46:28 Oh god that was painful in java Feb 01 04:46:37 what do you expect from futures? Feb 01 04:46:43 awful, awful things Feb 01 04:46:52 futures work similarly to rxjava Feb 01 04:47:03 thanks for the lesson Feb 01 04:47:11 minus the observable and subscription business Feb 01 04:47:43 on and by painful, I would say the same of rx java without lambdas Feb 01 04:48:01 here's let me respond in a manner that you can understand Feb 01 04:48:04 * JakeWharton shrugs Feb 01 04:48:13 Like I said, I think the Android Studio folding does a good job at concealing the lambda boilerplate Feb 01 04:48:32 i couldn't get that to work well, maybe i screwed up Feb 01 04:48:44 it autofolds Feb 01 04:48:53 ctrl + and - Feb 01 04:51:44 deuteros__ maybe its just my limited intellect, but when you are writing rx its hard to get past all the boilerplate at a certain # of levels. yeah you can collapse afters it done. if you can get it done :) Feb 01 04:52:19 boilerplate of AICs Feb 01 04:53:41 getting it done is easy Feb 01 04:53:46 No argument, it gets indenty very fast Feb 01 04:54:21 having worked on a java 8 service for about a year now (with others), most still write the class form for type safety and let the ide auto-collapse to a lambda proper Feb 01 04:56:13 proper? actually converts? Feb 01 04:57:09 questions? Feb 01 04:57:37 you called it a lambda proper, the ide converts the code then? Feb 01 04:57:45 and lambda are type safe Feb 01 04:57:50 JakeWharton so if you use lambdas, is there some type inferencing that is a bit weaker then specifying it yourself ? Feb 01 04:58:01 there is zero inference when you specify it yourself Feb 01 04:58:34 people always show the most simple shit like filtering a list by odds which of course you can just write out as a lambda Feb 01 04:59:18 but when i'm sitting between two complex domain types doing a transformation of some kind it's nice to get the type inference from the IDE and then a quick alt+enter to convert it to the lambda or method reference that I'm looking for Feb 01 05:05:23 good evening android-dev Feb 01 05:08:05 m3chanical https://www.youtube.com/watch?v=fRamB30E9mU Feb 01 05:09:01 that's a fabulous guffaw he's got Feb 01 05:16:23 He was famous for it Feb 01 05:16:49 Oh? Feb 01 05:17:13 I admit - The only bit of Vincent Price I know of is from Edward Scissorhands and all the goth kids in high school... Feb 01 05:17:30 He features in pretty much every single horror movie from way back then. One of the reasons why Michael Jackson asked him to record on Thriller Feb 01 05:17:44 ah neat Feb 01 05:20:06 (that laugh is from Thriller in case you didn't know) Feb 01 05:21:15 huh. i did not know lol Feb 01 05:23:10 I'm hopeful you at least know what Thriller is, regardless of your age? Feb 01 05:25:07 It's that popular flashmob song from 2004 Feb 01 05:25:14 soooo 2004 Feb 01 05:25:24 http://youtu.be/izS67QTVAjk?t=7m16s Feb 01 05:25:39 (should be just half a minute before the laugh) Feb 01 05:25:44 Haha yeah I know Thriller Feb 01 05:26:09 I'm nearly 27, but my parents are weird and listened to country music while i was growing up Feb 01 05:26:13 oh wait, in the video it isn’t there :/ Feb 01 05:26:49 most of my peers get upset that i don't know led zeppelin/pink floyd/etc Feb 01 05:27:11 ^ which is obviously false Feb 01 05:27:15 but i at least have heard Thriller a few times Feb 01 05:27:16 lol Feb 01 05:27:24 https://www.youtube.com/watch?v=sOnqjkJTMaA#t=385 Feb 01 05:27:53 I suppose it would be more accurate to say that they get upset about my lack of nostalgia Feb 01 05:28:06 It's actually a whole album but good enough Feb 01 05:28:27 ahh Feb 01 05:28:38 http://i.imgur.com/vqD8jZh.gif Feb 01 05:29:23 tell that to the people who get upset any time their software (or facebook) gets updated Feb 01 05:29:49 ah so is this Vincent Price narrating this part of the video? Feb 01 05:30:00 Facebook is not newer Feb 01 05:30:04 yup Feb 01 05:31:14 this zombie dance is neat Feb 01 05:56:17 Hmm, the reddit server responses way more slowly if the user sends a (valid) authentication cookie. Feb 01 05:56:32 I thought reddit had just slowed down lately. Turns out it's that I'd implemented logins. Feb 01 05:56:52 Response times go from around 20ms to around 500ms. Weird. Feb 01 05:57:15 I guess their database lookups are slow, or something. Feb 01 05:57:38 20ms is a cache hit Feb 01 05:57:52 500ms is a cache miss, you're forcing them to hit the DB to validate the auth header Feb 01 05:57:57 (speculating, of course) Feb 01 05:58:02 Okay, makes sense. Feb 01 05:58:55 20ms is ridiculous though. absolutely a memcache hit or something Feb 01 05:59:10 For a network call, it's pretty good yes Feb 01 05:59:12 Yeah, I just can't explain the fast ones. It's just instant. Feb 01 05:59:32 Caching at the phone level? Or a very close by CDN Feb 01 05:59:36 it could also be a 304 not modified response Feb 01 05:59:42 and served from the local cache Feb 01 05:59:47 hmm? Feb 01 05:59:48 I checked and it's a 200. Feb 01 05:59:58 20ms is kinda normal for such data amounts Feb 01 06:00:06 200 at the application layer? or across the network? Feb 01 06:00:12 Across the network. Feb 01 06:00:41 how did you check, out of curiosity? Feb 01 06:01:42 it's not that i don't believe you, it's just, well, i don't believe you because OkHttp doesn't make it super easy Feb 01 06:02:18 I guess I'm assuming that it's across the network because, in this branch, I don't have caching enabled in OkHttp or in my app. I can't see how a network response could be avoided here. Feb 01 06:02:27 800ms would be something I expect for getting the 200 OK from a HTTP server over mobile network... Feb 01 06:02:49 This is via my broadband connection (ADSL). Feb 01 06:03:56 I'm also asking on #reddit-dev. I'll post here if they answer. :) Feb 01 06:04:03 I get via 3G, in a rural area, on the cheapest provider I could find, 64ms to get a 200 OK from my own webserver Feb 01 06:04:03 aaaargh Feb 01 06:04:09 so, 20ms isn’t that far fetched Feb 01 06:04:13 Silicon Valley is crap for getting food :| Feb 01 06:04:48 I should really set up Charles or something, so that I can 100% snoop on the connection. Feb 01 06:05:29 does Charles do SPDY? i've only used it with plain 'ol HTTP Feb 01 06:06:44 Not sure. Funny thing is that the exchange doesn't seem to be using SPDY tonight. I was seeing "SPDY" in the "OkHttp-Selected-Protocol" thing before, I think. Feb 01 06:06:53 Or somewhere in the headers. Feb 01 06:07:04 yep. we add those synthetic headers Feb 01 06:07:09 Hello android people Feb 01 06:07:11 there's also a method on the response object to get the protocol Feb 01 06:08:17 Okay, I'm getting "http/1.1" right now. I was getting SPDY once before. Wonder what's going on. Feb 01 06:22:33 public void onSaveInstanceState(Bundle) <——— is it perished? Feb 01 06:23:48 hi, i'm following https://developer.android.com/training/basics/firstapp/index.html Feb 01 06:24:03 is there an easy way i can use gnu make instead of ant? Feb 01 06:25:23 also my goal is to use ndk eventually, what do i need to learn on the java side first? Feb 01 06:27:38 no, must use an android build tool Feb 01 06:27:51 you need to learn the whole framework Feb 01 06:28:03 unless you use native libraries only Feb 01 06:28:06 (gradle is the preferred build tool nowadays) Feb 01 06:28:22 p_l, crap for getting food? Feb 01 06:30:36 you can use make but it will be awful Feb 01 06:31:43 well, i guess i don't really want to use make Feb 01 06:31:45 for the java stuff Feb 01 06:31:53 but, i would like to use as little java as possible Feb 01 06:32:00 this is porting an opengl game Feb 01 06:32:21 it's only three commands: aapt, javac, dx Feb 01 06:32:39 and then zip, zipalign, and jarsigner Feb 01 06:33:36 ok thx Feb 01 06:33:45 i probably just need to read more Feb 01 06:33:46 about jni Feb 01 06:34:27 what does an android project look like in git? Feb 01 06:34:42 like what do i need copies of vs what i can have the sdk generate for me Feb 01 06:34:58 is there an example of that somewhere? Feb 01 06:35:47 there's a java source tree, a resource folder (with a bunch of children), and an AndroidManifest.xml Feb 01 06:39:08 AirStar: What do you mean? Feb 01 06:39:32 TacticalJoke: no, my mistake, i solved it Feb 01 06:39:34 :) Feb 01 06:39:59 raleigh, android create project Feb 01 06:40:02 raleigh, from cli Feb 01 06:50:46 To making game app is easy? or not? Feb 01 06:52:22 depends Feb 01 06:52:24 on everything Feb 01 06:52:53 i want learn making game app, then how can i do? i must go to school? Feb 01 06:53:27 just start with a good book Feb 01 06:53:39 should i be using gradle instead of ant? Feb 01 06:53:41 give me good book of game app. Feb 01 06:53:42 forget the game, read the book and build the examples, then maybe make the game Feb 01 06:53:46 i don’t know Feb 01 06:54:22 :( Feb 01 06:54:40 AirStar, i would start with corona or moai or unity or something like that Feb 01 06:54:51 raleigh: Are you using Ivy with Ant? Feb 01 06:55:11 corona? moai? unity? what is it? Feb 01 06:55:26 I don't know much about Gradle, but I am told it's way better than Ant and others. Feb 01 06:55:43 in ways Feb 01 06:55:45 i don't know much about either Feb 01 06:55:47 http://www.corona.com/home/index.jsp Feb 01 06:55:50 beer? Feb 01 06:55:58 beer is good Feb 01 06:56:03 http://coronalabs.com/ Feb 01 06:56:08 oh Feb 01 06:56:11 thanks Feb 01 06:56:16 raleigh: If you switch to Android Studio you get Gradle for free, basically. Feb 01 06:56:32 well, i noticed there is also a -g switch on `android` Feb 01 06:56:48 so, just starting out, i didn't know if i should use it Feb 01 06:56:58 i'd rather not have to use their ide if i can help it Feb 01 06:57:13 i know beer Feb 01 06:57:19 If you're just starting out, use Android Studio. Feb 01 06:57:22 and high life is the best Feb 01 06:57:24 (Also if you're not just starting out.) Feb 01 06:57:34 If you don't use an IDE, you just waste your time. Feb 01 06:57:35 ultra-: contradictory statements Feb 01 06:57:36 well i'm porting Feb 01 06:57:41 just starting out on android Feb 01 06:57:44 good beer sucks Feb 01 06:57:57 oxymoron Feb 01 06:57:59 but i'm comfortable in c++ Feb 01 06:58:03 Yeah, but why waste time by not using an IDE? Feb 01 06:58:05 no Feb 01 06:58:10 Not only will your progress be slower, but your learning will be slower. Feb 01 06:58:16 Everything will be slower and harder. Feb 01 06:58:32 all the new glarus and newcastle drinkers call that “good beer”, and i hate it, so good beer sucks Feb 01 07:00:18 your sweeping statements invalidate any shred of rational argument you might have Feb 01 07:00:29 nope Feb 01 07:00:37 i’m from wisconsin, everything i say about beer is lore Feb 01 07:00:42 :) Feb 01 07:02:10 Wisconsin, land of beer Feb 01 07:02:16 beer and cheese. Feb 01 07:02:23 and sausages. Feb 01 07:02:26 mmm brats. Feb 01 07:02:47 oh, Americans... you're so cute Feb 01 07:03:07 i guess the sweeping generalizations aren't over Feb 01 07:03:24 not when they’re correct! Feb 01 07:03:38 we are a cute race Feb 01 07:04:15 mmm cheese Feb 01 07:04:37 we the people Feb 01 07:04:51 ultra didn't take offense at any of my generalizations, note ;) Feb 01 07:05:14 it's kinda cute to go into mcdonald's and they ask if you want cheese for your fries. Feb 01 07:05:42 it's better when the guy in front of you responds "nah. i got curds in the truck." Feb 01 07:06:37 hahaha Feb 01 07:06:56 Hello. Feb 01 07:07:02 cheese for you fries? never heard that at Mcdo Feb 01 07:07:02 Has anyone here tried Chartboost? Feb 01 07:07:10 i tend to think these generalizations are funny, even if they’re not always true Feb 01 07:07:39 ultra-: those aren't too far off the mark though. ;) Feb 01 07:08:16 Hmm, when Android Studio collapses my anonymous classes, I'm left with indentation that's too deep (eight spaces instead of four) for the body: Feb 01 07:08:17 http://pastebin.com/uw7YN3XQ Feb 01 07:08:24 Is everyone else having that? Feb 01 07:08:39 yes Feb 01 07:08:46 Unfold them Feb 01 07:08:47 except i don't have ginormous 4-space indents Feb 01 07:08:55 If it's still ike that, it's because they are continuation lines Feb 01 07:09:21 You can configure that, but the IDEA formatter is god awful compared to eclipse's Feb 01 07:09:26 I used to use two-space indents in Delphi. Only time I've broken the four-space commandment. Feb 01 07:09:54 lewellyn: they exist for a reason :) Feb 01 07:09:55 Try 1-space indents. Feb 01 07:09:59 it's just because it doesn't alter the horizontal alignment at all. the folding simply collapses the method Feb 01 07:10:47 ultra-: i'm quite aware. i have family in that neck of the woods. the summer i turned 15, i visited and my task for the summer was "mow the lawn". all however many acres. took all summer. found a car... an amc. hilarity ensued. "who's car is this?" "ain't my car!" :P Feb 01 07:11:17 I see. Feb 01 07:11:32 amc? Feb 01 07:11:45 it's a car manufacturer Feb 01 07:11:46 When did two-space indents become big, BTW? I just suddenly noticed them after moving to Java (seldom saw them in C# and C++). Feb 01 07:11:57 ok Feb 01 07:12:02 ultra-: http://en.wikipedia.org/wiki/American_Motors Feb 01 07:12:22 TacticalJoke: seems to be more a webdev thing, JavaScript and such. Feb 01 07:12:47 dunno, but i can't go back from them Feb 01 07:12:56 First we had 8 space indents, then 4, now 2, next year we’ll get 0 space indents Feb 01 07:13:08 The funny thing is that the Kotlin code-style guide says to use four spaces, and from what I've seen all the sample code uses two spaces. Feb 01 07:13:09 if anyone ever moves to 1-space indents, you will know God Feb 01 07:13:18 does it? Feb 01 07:13:24 oh i remember those gremlins Feb 01 07:13:26 Yeah (though this is an older page): https://confluence.jetbrains.com/display/Kotlin/Coding+Conventions Feb 01 07:13:33 when people complain about two-space i just point them at Google's style guide Feb 01 07:13:40 reminds me of the 70’s datsuns and i want one Feb 01 07:14:03 70s datsuns are badass Feb 01 07:14:08 I used to code with 0-space indentation but then realized 1-space was slightly better. Feb 01 07:14:24 i agree Feb 01 07:14:27 lasserix: i want a yugo to soup up :) Feb 01 07:14:31 justJanne: I don't think I've seen code using eight spaces on purpose. Feb 01 07:14:32 it’s like they combine a little dork with a lot of bad ass Feb 01 07:14:41 Actually, I take that back. Feb 01 07:14:45 The Linux source. ;o Feb 01 07:14:56 my 72' 280 was just like a protoporshce Feb 01 07:15:05 Eight-space indents are monsters. Feb 01 07:15:28 Does not help for code sharing Feb 01 07:15:43 This varies from project to project, 4 spaces and 100 columns is pretty common Feb 01 07:16:12 280? Feb 01 07:16:20 280zx i think Feb 01 07:16:25 nissan? Feb 01 07:16:30 i suppose datsun back then Feb 01 07:16:41 man that gremlin is like an old version of what i drive right now Feb 01 07:16:46 it’s the same, just old Feb 01 07:16:52 like this: http://www.whiteheadperformance.com/wp-content/uploads/2012/05/72-Datsun-240Z-Restoration-After.jpg Feb 01 07:17:05 that’s awesome Feb 01 07:17:10 yeah Feb 01 07:17:13 fun to have sex in too ;p Feb 01 07:17:21 that gremlin is a v8??? Feb 01 07:17:51 http://en.wikipedia.org/wiki/American_Motors#mediaviewer/File:1972_AMC_Gremlin_X_green_5-litre_V8_Nashville.jpg Feb 01 07:17:56 TacticalJoke: two space is great because it is uniform across all systems Feb 01 07:18:15 Isn't that the case for any number of spaces? Feb 01 07:18:16 ahh hatchback Feb 01 07:18:19 http://www.roadfly.com/new-cars/wp-content/uploads/gallery/2006-audi-a3-s-line/2007-audi-a3-s-line.jpg Feb 01 07:18:29 TacticalJoke: and easy to do : ) Feb 01 07:18:31 that’s what i drive, it’s almost just like that gremlin Feb 01 07:18:39 I'd consider two spaces for Kotlin, I think. Feb 01 07:18:46 except i have a 2006, not 2007 Feb 01 07:18:52 consider it everywhere! Feb 01 07:18:52 i got to figure out what car to get Feb 01 07:19:09 :D Feb 01 07:19:14 well, i can tell you i love my a3 and i only paid $8000 Feb 01 07:19:24 oh nice Feb 01 07:19:59 it’s small, but i was able to take two other people snowboarding with me last weekend, with all our gear Feb 01 07:20:06 TacticalJoke: hows teh reddit app coming? Feb 01 07:20:09 and no roof rack, 3 snowboards with the fold down seat Feb 01 07:20:17 ultra-: ahh damn nice Feb 01 07:20:26 Pretty well, thanks. Feb 01 07:20:52 Waiting to hit a serious road block. Everything just works. It's weird. Feb 01 07:21:16 nice Feb 01 07:21:22 got a sample app to play with? Feb 01 07:21:37 For me to send to you, you mean? Feb 01 07:21:44 aye' Feb 01 07:22:02 Could you wait for, like, seven days? Because I'm about to switch to Material (and the current UI is fugly). Feb 01 07:22:05 You've seen the current UI, though. Feb 01 07:22:28 yeah no worries Feb 01 07:22:34 I would love your feedback on the actual UI. :) Feb 01 07:22:36 could you send me a link with some of your http code? Feb 01 07:22:42 okhttp Feb 01 07:22:43 What you've seen so far is basically zero UI effort. Feb 01 07:22:52 think the new job will require me to use either retrofit or okhttp Feb 01 07:23:18 Ah. My interation with OkHttp is really basic. It's just about what the recipes on their site show. Feb 01 07:23:22 So far, anyway. Feb 01 07:23:28 ahh ok Feb 01 07:23:29 i think you mean retrofit+okhttp or okhttp Feb 01 07:23:50 retrofit uses okhttp? Feb 01 07:24:04 c'nest pas? Feb 01 07:24:11 it can Feb 01 07:24:12 and you should Feb 01 07:24:17 ohh Feb 01 07:24:18 i see Feb 01 07:24:24 it needs a backend Feb 01 07:24:31 What would we do if we didn't have OkHttp? I guess we'd have to use HttpURLConnection or roll our own. Feb 01 07:24:34 i thought it just used it natively Feb 01 07:24:40 That async HTTP thing looks okay, but not quite enough. Feb 01 07:24:58 TacticalJoke: HttpURLConnection works just fine. It's just annoying to work with. Feb 01 07:24:58 TacticalJoke: dunno pintireset and some pretty big names use async http Feb 01 07:25:10 a bigger name uses OkHttp though Feb 01 07:25:12 yeah i used httpurlconnection on my intervew test Feb 01 07:25:21 Why, lasserix? Feb 01 07:25:41 i was told by the recruiter i wouldn't be able to finish the app in the 1.5 hours i had Feb 01 07:25:58 and instead of fucking around--i didn't know okhttp well enough yet--i just used okttp to make sure i finished it Feb 01 07:26:02 You should learn OkHttp just because. Feb 01 07:26:06 and did with time to spare, with git ;p Feb 01 07:26:08 yeah Feb 01 07:26:09 i will Feb 01 07:26:18 i think the first project will require a bunch of rest stuff soo.. Feb 01 07:26:19 The API feels very natural. Feb 01 07:27:00 lasserix: I'm gonna try out RecyclerView at some point. Feb 01 07:27:19 See whether Napalm's prediction (about performance) is true. Feb 01 07:27:27 ? Feb 01 07:27:35 He once told me not to use ListView for this app. Feb 01 07:27:56 Saying that RecyclerView is way faster. Feb 01 07:27:58 I'm skeptical, though. Feb 01 07:29:00 can't imagine recyclerview would really be faster Feb 01 07:29:00 after you ship Feb 01 07:29:11 Yeah, I'll ship first. :) Feb 01 07:29:22 if both implemented properly, would be the same at the end of the day Feb 01 07:29:32 Users will be like "Wow, 1.1 is *so* much faster than 1.0. What did he do?" Feb 01 07:29:36 Or maybe not. :D Feb 01 07:29:51 Yeah, I'd suspect pretty much that, lasserix. Feb 01 07:30:28 This app is really fast so far, though. There is no actual problem. It's just trying to make things as good as possible. Feb 01 07:30:34 for the content you are showing there shouldn't be any reason to switch Feb 01 07:30:54 if anything, it might needlessly complicate an otherwise simple adapterview/adapter mechanism Feb 01 07:30:59 Yeah. Feb 01 07:32:59 TacticalJoke: why didn't you go a step further and use retrofit too? Feb 01 07:33:28 Well, I'm now stream-parsing the JSON. I'm guessing I couldn't do that with Retrofit. Feb 01 07:33:45 I could be wrong, since I'm pretty clueless about it. Feb 01 07:34:10 stream parsing into what? Feb 01 07:34:13 objects? db? Feb 01 07:34:31 Objects, effectively. Looking at stuff one token at a time and building objects manually. Feb 01 07:34:43 so you re-implemented Gson Feb 01 07:34:56 It gets slightly complicated in one cases, where I have to use the builder pattern because I don't know the full type of the data yet. Feb 01 07:34:59 case* Feb 01 07:35:11 Gson can do that with type adapters Feb 01 07:35:13 Well, kind of, but building an in-memory tree was just too much. Feb 01 07:35:35 The difference between then and now, in regard to memory use, is enormous. Feb 01 07:35:46 pfn: yes. Everything closes so early, and takeaways are rare. Feb 01 07:35:56 Comment listings are taking something like 0.3MB on average now. Then, they were taking around 1.9MB. Feb 01 07:36:00 Because reddit's JSON is huge. Feb 01 07:36:30 Also because I can simply skip over a lot of it. Feb 01 07:36:38 I don't need, for example, "body_html". Feb 01 07:36:39 I don't quite understand what they mean by top level views, category views, detail/edit views here - https://developer.android.com/design/patterns/app-structure.html ? Feb 01 07:36:55 TacticalJoke: i'm just giving you a hard time. but seriously, ship ship ship Feb 01 07:36:55 anyone would like to give it a shot? :D Feb 01 07:37:07 :) Feb 01 07:38:09 shmoon kind of think of it like navigating a windows folder: top level views are like big icons for each thing a folder, category is like show details instead of icons, detail/edit is like preview window for one of those items Feb 01 07:38:16 p_l, SF is better in that regard Feb 01 07:38:26 In general, you’ll always have some kind of navigation in your app Feb 01 07:39:15 List of Playlists -> Single Playlist -> Video, or Folder -> Subfolder -> File, or Interpret -> Album -> Song, or IrcNetwork -> Channel Feb 01 07:39:51 Top level views are the root views, those that allow you to navigate to everywhere, while each of the others is a bit more specialized Feb 01 07:42:02 top level views: buildings on a street. category views: directory near the elevator in a particular building. detail/edit the actual office / room Feb 01 07:42:29 hmm I see Feb 01 07:43:38 If someone here is behind this website : http://www.materialpalette.com/ I will get send you a christmas gift this year if you give me your address. :) Thanks mate, whoever it is. Feb 01 07:44:13 or if going into a bookstore, top level: the stuff you see in the windows/front display cases. category: different sections where you can see book titles from side. detail/edit picking up an individual book Feb 01 07:44:39 nice page! Feb 01 07:45:07 But now I’ve already spent the time and implemented a parser for my layouts in JavaScript so I can test them in the browser xD Feb 01 07:45:19 got it lasserix thanks :) Feb 01 07:46:00 Can I trust that site (to be accurate regarding colour schemes)? Looks great Feb 01 07:46:37 I guess I could compare the results with the Google page. Feb 01 07:46:47 don't know, but really nice. Feb 01 07:49:25 I would click on a couple of ads if I couldn't do anything else in such case. But the page doesn't have ads.! Feb 01 07:49:27 :) Feb 01 07:50:01 hi Feb 01 07:50:32 can you develop opengl es 2 apps on android using cygwin adk and eclipse Feb 01 07:50:39 please help Feb 01 07:52:09 if you have a paid game to publish on play market, are you allowed to send out free APKs of it to people for marketing purposes? eg game websites who can write about it Feb 01 07:52:42 can someone lead me on how should I use dialog boxes for taking input for a RecyclerView ?? Feb 01 07:52:44 sure Feb 01 07:53:02 linuxuz3r: by adk you mean ndk? if so yes Feb 01 07:53:07 agaurav77: How do you mean? Feb 01 07:53:26 njcomsec: If you are the dev of the app, you can do with it whatever you want. You can even hand out free APKs for everyone (even if that would be pointless then) Feb 01 07:53:31 hes askign if it is against dev contract to give your app away free Feb 01 07:53:32 TacticalJoke: ?? Feb 01 07:53:45 oh Feb 01 07:53:53 agaurav77: Exactly. Feb 01 07:53:54 that was @ njcomsec Feb 01 07:53:56 yes im the sole developer :) thanks Feb 01 07:54:51 Google Play isn’t YouTube (yet), they don’t force you into comcast-like contracts Feb 01 07:56:31 how do you mean? Feb 01 07:56:51 http://zoekeating.tumblr.com/post/108898194009/what-should-i-do-about-youtube Feb 01 07:57:30 TacticalJoke: i have made 2 ArrayList(s) combined with an Adapter to make a RecyclerView. The DialogBox (in my case) should take inputs for both the ArrayList(s). There's an add button to which I want to attach this DialogBox. How should I go about it? Feb 01 07:59:33 if i want to put videos of my game/app on youtube do i need some kind of special contract? Feb 01 07:59:38 I guess step one is to show the dialog (probably by use of a DialogFragment). Feb 01 07:59:51 agaurav77: You’d want to set an onclicklistener to the button, which creates and shows the dialog. Then you’d want to set a listener to the dialog again, which adds the input from the dialog to both lists. Feb 01 08:00:27 I’d suggest using an AlertDialog with a custom View and then using Positive/Negative button with listener (Save/Cancel) Feb 01 08:02:12 my RecyclerView is within a RelativeLayout. Will it be a problem if I use a DialogFragment? Feb 01 08:02:36 I’ll create an example. Feb 01 08:02:57 agaurav77: The DialogFragment will be entirely separate from the RecyclerView. Feb 01 08:03:44 TacticalJoke : thanks a lot.... i ll try that :) Feb 01 08:04:19 justJanne: an example would be nice... thanks Feb 01 08:13:17 In OkHttp, is it okay to call Call.cancel on the main thread? Feb 01 08:13:20 yes Feb 01 08:13:26 K, thanks. Feb 01 08:13:36 * JakeWharton runs to check Feb 01 08:13:58 Haha. I was just looking at the source. It seems okay, as far as I can tell. But just wanted to make sure. Feb 01 08:14:22 hmm Feb 01 08:15:33 I wonder if the default navigation drawer can be made to behave like facebook app's navigation drawer Feb 01 08:15:33 interrupt JakeWharton before its too late ! Feb 01 08:15:48 maybe not Feb 01 08:15:57 it has the potential to do expensive things Feb 01 08:16:12 wow Feb 01 08:16:15 no, don't Feb 01 08:16:19 Okay. Feb 01 08:16:56 lots of synchronized. http1 might close the socket synchornously. spdy and http2 might write a close frame synchronously and flush! Feb 01 08:17:20 Ah. Feb 01 08:23:17 TacticalJoke this was at the top today http://www.reddit.com/r/androiddev/comments/2uavp8/ive_been_creating_android_apps_without_services/ Feb 01 08:23:27 and the most upvoted answer is ... wrong Feb 01 08:23:29 lol Feb 01 08:24:14 no it isn't Feb 01 08:24:47 i wrote Android for 5 years without ever knowing how to write a service Feb 01 08:26:01 you might be able to go another 5 years ! Feb 01 08:26:16 i’ll go forever i think Feb 01 08:26:21 i can't remember the last service i touched Feb 01 08:26:29 easily over a year Feb 01 08:26:43 maybe two Feb 01 08:26:55 Hi, I'm trying to play youtube audio in the background by making the app myself (I know there are apps like this, I'm just interested in learning how to make it not release it). Could someone point me in the right dierction as to how to do this please Feb 01 08:27:23 I'd love an app that did that. I hate having to have the screen to listen. Feb 01 08:27:33 (Though I usually download the video and play it in MX Player.) Feb 01 08:27:40 screen on* Feb 01 08:28:05 Quite a few already do exist Feb 01 08:28:30 Just curious as how to develop something like that. Feb 01 08:29:12 That's a very broad question.. Feb 01 08:32:25 it is, I have been looking online but haven't come across anything very fruil Feb 01 08:32:39 trying to find an library that can fetch the youtube stream from a URL then Feb 01 08:32:44 playing it through some sort ofm edia player Feb 01 08:34:44 use Jsoup and string parsing, you will be good to go dvass Feb 01 08:35:18 You should probably split the project up into multiple parts.. First find a way to get an audio stream of some sort, then worry about playing it Feb 01 08:35:50 Speaking of Youtube, it seems that if I leave Youtube as an active background program, it makes my game crawl. Feb 01 08:37:37 Looney: is that to extract the url from the youtube page? Feb 01 08:38:19 seems virtualbox developement is slowing down - only a team of 4 paid devs Feb 01 08:41:29 i wish they would fix the apk expansion bug Feb 01 08:41:31 crashes Feb 01 08:41:46 might not be virtualbox, maybe genymotion, not sure Feb 01 08:45:22 yup, it would help you Feb 01 08:46:21 I wonder if the default navigation drawer can be made to behave like facebook app's navigation drawer Feb 01 08:56:26 shmoon_: It can't Feb 01 08:57:48 SimonVT: Alright :) Feb 01 08:58:33 My menudrawer library can. I'm no longer maintaining it, but it should work Feb 01 08:58:39 I've this in my app's gradle file - http://pastie.org/9877862 - now when I try to use DrawerLayout, it works fine which is from the v4 support lib. Os does v7 package also downloads/installs v4 ? Feb 01 08:58:47 SimonVT: link? Feb 01 08:59:03 I found this https://github.com/jfeinstein10/SlidingMenu Feb 01 08:59:27 https://github.com/SimonVT/android-menudrawer Feb 01 08:59:35 SlidingMenu is another, yeah Feb 01 09:02:26 v7 is not the name of anything Feb 01 09:02:47 that is appcompat and Google idiotically put the minimum API level it supports in the name Feb 01 09:02:51 SimonVT: you have written deprecated because of drawerlayout? Feb 01 09:03:03 so no, appcompat does not include the support library Feb 01 09:03:12 however, it has a dependency on it Feb 01 09:03:20 JakeWharton: from what I'd understood the support library v7 contains various packages like appcompat and other Feb 01 09:03:25 so you'll end up including it anyway Feb 01 09:03:29 I see Feb 01 09:03:32 there is no v7 support library Feb 01 09:03:33 got it :) Feb 01 09:03:45 that is a conflation of two things Feb 01 09:03:57 https://developer.android.com/tools/support-library/features.html#v7 Feb 01 09:04:05 shmoon_: Yeah, I saw no point in maintaining a copy of DrawerLayout Feb 01 09:04:13 SimonVT: alright Feb 01 09:04:19 that link proves my point Feb 01 09:04:42 both that there is no v7 support library and that Google is idiotic in this naming scheme Feb 01 09:06:16 Yeah, worst naming ever Feb 01 09:06:43 ok I'm still a little confused. You mena there is v4 support library but v7 appcompat, cardview, gridlayout, etc. libraries? Feb 01 09:06:50 mean* Feb 01 09:07:12 not a v7 support library per se Feb 01 09:07:26 there is a support library for API 4+ called support-v4. There are multiple support libraries for API 7+ named appcompat-v7, gridlayout-v7, etc. Feb 01 09:07:38 but saying "v7 support library" means nothing Feb 01 09:07:49 ok I see Feb 01 09:07:55 it's like me asking what kind make of car you drive and you answering "2008 sedan" Feb 01 09:08:34 got it Feb 01 09:08:49 Hmm, this site doesn't seem quite right (in accordance with Google's colour guidelines): http://www.materialpalette.com/blue/blue-grey Feb 01 09:08:52 so appcmopat-v7 has a dependency on support-v4 that gets downloaded and included automatically Feb 01 09:08:56 it's stupid and pedantic, but Google continues to use this naming scheme which serves to only make these conversations awful because they become ambiguous Feb 01 09:08:59 It doesn't use alpha channels for text colours. Feb 01 09:09:04 shmoon_: yep Feb 01 09:10:07 ok :D Feb 01 09:13:18 I just want to make sure that when we answer that you fully understand what's what. Not trying to be perceived as rude. Feb 01 09:22:17 thoughts on how to fix this without wiping or flashing ? http://logcat.scheffsblend.com/view?id=10769001 my display is fine by the way. cwm and hboot work fine Feb 01 09:23:32 ouch ide internal error, don't see those too often any more Feb 01 09:23:56 I keep getting one. I forget the message. Feb 01 09:24:25 JakeWharton: I get you, really appreciate you made it super clear tbh :) Feb 01 09:24:50 TacticalJoke invalid range specified (8163, 8163) Feb 01 09:25:05 I've not had that one. Feb 01 09:45:48 g00s: possible physical hardware irregularity ? >me< ? Feb 01 09:46:38 ps: sorry for the late reply Feb 01 09:47:11 XDS2010_ i have no idea what you are referring to Feb 01 09:47:40 were you commenting earlier on my issue or someone elses ? Feb 01 09:48:32 dont think it was me Feb 01 09:52:02 4:23:32 AM ouch ide internal error, don't see those too often any more Feb 01 09:57:53 How to simulate material style raised button on pre lollipop? Feb 01 09:59:52 some solutions even uses a CardView for this! too heavy! :) Feb 01 10:01:11 9-patch shadow Feb 01 10:01:57 How about the ripple? Feb 01 10:03:45 don't bother Feb 01 10:05:15 okey, thanks jake Feb 01 10:48:34 the appcompat theme doesn't show up the icon in the actionbar, not even with getSupportActionBar().setIcon(R.drawable.ic_launcher); I wonder how to do this Feb 01 10:50:05 nvm i got it Feb 01 10:50:37 I think showing an icon is deprecated. Feb 01 10:52:45 As a concept. Feb 01 10:53:42 Hello, using linux and android studio Feb 01 10:53:50 also virtualization enabled from bios Feb 01 10:53:54 how can I set up kvm Feb 01 10:54:02 as it says /dev/kvm is missing Feb 01 11:39:08 hey guys, can someone tell me if there is a way to drawline with 100,255,255,255 over another line of the same without it making it bolder??? Feb 01 11:39:16 this is with canvas of course ? Feb 01 12:36:13 hi Feb 01 12:37:18 what’s up people :) Feb 01 12:40:06 bluecup : Going good, nothing much interesting :) Feb 01 12:46:15 well it is a sunday, sundays are always slow Feb 01 12:59:44 Excuse me, but what is the best book to learn Android programming from scratch, I have read afew but all seem to have errors in coding somewhere in between the book. Anyone please assist Feb 01 13:00:36 borw3: you can’t really learn Android development from a book. they mostly contain errors because of old/deprecated stuff Feb 01 13:00:57 bluecup: So what do you suggest? Feb 01 13:01:02 here is an awesome list: Feb 01 13:01:03 https://www.infinum.co/the-capsized-eight/articles/becoming-an-android-developer Feb 01 13:01:27 i suggest courses and articles. deciding to make a pet project and then learning through it Feb 01 13:01:51 that’s how I learned about it, even tho books were up to date then Feb 01 13:02:26 Wow, why the errors? Feb 01 13:04:30 if i have a basic canvas 2d game in pixels and i want to scale everything up to a screen size/aspect ratio, do i need to use opengl? Feb 01 13:04:45 \o/ Feb 01 13:05:25 =>\o/ :D:D:D:D:D Feb 01 13:12:48 Hey peeps Feb 01 13:12:53 sup Feb 01 13:16:41 has anyone seen React.js Feb 01 13:16:46 seems damn good Feb 01 13:18:12 Hi :) Anyone want to help me with Sockets? Feb 01 13:20:44 Sockets for? Feb 01 13:20:55 plugs Feb 01 13:21:40 Well i wanna establish a connection between my phone and my PC Feb 01 13:23:50 But it doesnt really work...Here is Source of Android-App (Client): http://pastebin.com/JwX2nE8x and here the source of the Server (Java): http://pastebin.com/YciVadZ8 Maybe you could give me a hint...the Android-App doesnt switch to Connected but stays at Connecting Feb 01 13:24:08 Ah and I am using Android 5.0.2 on OnePlus One Feb 01 13:30:16 Guys guys, how to make android app read data from internet? Feb 01 13:30:30 Particularly a website Feb 01 13:31:10 borw3 - Define what you mean by that. Feb 01 13:32:15 For example take particular phrase information from a website, for example a stock listings website that broadcasts current stock prices Feb 01 13:32:59 borw3 - In that case, have a look at JSoup. Feb 01 13:33:41 flan3002:For example take particular phrase information from a website, for example a stock listings website that broadcasts current stock prices Feb 01 13:33:45 O.o Feb 01 13:33:58 You should prbably check if the site has an API first. Feb 01 13:34:19 borw3 - That depends on your particular website. Ideally, they'd have a (e.g. JSON) API, because HTML scraping/parsing is fragile. Feb 01 13:36:44 borw3: use retrofit, connect to API, deserialize with JSON, show data Feb 01 13:38:22 flan? Could you take a look at my issue mentioned above? :) Feb 01 13:40:40 beatbrot - I'm afraid, I'm unable to view the pastes. My phone's still blocking port 80... Feb 01 13:41:02 Oo such a crazy phone :P Feb 01 13:41:21 I think I know what's wrong, but I can't fix that with a data cap. Feb 01 13:41:33 Okay, i understand :) Is it rooted? Feb 01 13:41:41 (And throttling to 5kb/s. Yes, it is) Feb 01 13:49:32 http://developer.android.com/training/implementing-navigation/nav-drawer.html#ActionBarIcon - how can i use custom app icons given v4 actionbardrawertoggle is deprecated and v7 wont accept a n image resource file? Feb 01 13:50:06 hey guys, would you be intersted in another android newsletter besides android weekly? or a blog/feed posting the latest good stuff? Feb 01 13:53:09 wewhy not Feb 01 13:54:08 is android weekly the only blog/newsletter? Feb 01 13:58:19 I'm going to unzip an APK expansion/OBB file. Before that I'm going to check that there is enough space available on external storage. Would the unzipping require more free space than just the space of the extracted content in the OBB file, for temporary files during unzipping, and if so how do I find out how much extra space would be needed for that. Feb 01 14:15:21 Leeds: I haven’t found any other newsletter that tracks articles/libraries/videos and stuff like that Feb 01 14:17:00 maybe there is no extra space needed for temporary files while unzipping to external storage? Feb 01 14:17:06 (done in RAM) Feb 01 14:21:59 i want to build a login/registration system with phone number verification like whatsapp, any advice/links/resources/plugins? Feb 01 14:22:46 You'll need a server that is able to send SMS Oo Feb 01 14:26:55 true Feb 01 14:37:44 beatbrot, shmoon_ the "server" could be a phone, no? Feb 01 14:38:33 Well maybe :) Feb 01 14:44:17 ya, so first I'll need some library to send http requests that would store details server side and send an sms for verification Feb 01 14:46:44 http://square.github.io/okhttp/ - anyone used this ? can I do file uploads with this too? Feb 01 14:47:29 shmoon_, you don't really sound competent enough to build what you are up to. Feb 01 14:47:47 Maybe something more simple for start? Feb 01 14:49:34 frain: simpler than this ? I know the flow, the reason to ask here is if someone has alreayd done such a thing he can point me to libraries/articles Feb 01 14:50:09 Google. Feb 01 14:50:40 so you'll just send sms to whatever number your users send your server? that would probably get really expensive really fast Feb 01 14:52:37 wonder if there's an alternative if I want to do phone nuber based registrations Feb 01 14:52:57 you'll have to use a service like https://www.twilio.com/ Feb 01 14:53:29 shmoon, you could simply read the phone number...but there are apps like PDroid who would easily be able to emulate another phone number Feb 01 14:53:30 ya I am planing to use that only :) Feb 01 14:55:08 beatbrot: what does that mean? how will that be harmful? Feb 01 14:55:42 Well if you could emulate a phone number...you would only need the phone number of another guy to bypass your system Feb 01 14:56:23 I see, so you mean then the SMS sent will not go to the guy but to the person with PDroid? Feb 01 14:56:29 i wonder how that can hapen Feb 01 14:56:59 With root, this is possible :) Already had this installed Feb 01 14:57:17 only works on android 4.3, though...but still, jellybean is still used a lot Feb 01 14:57:39 really? then you could start receiving SMS's on behalf of anyone Feb 01 14:57:50 people would have started doing this by now Feb 01 14:57:57 someone getting my SMSs Feb 01 14:58:54 no that doesn't work, but a user could fake his number so your server sends sms to whatever number the user sent you Feb 01 14:59:28 true that could happen, I wonder what would whatsapp be doing to bypass this problem Feb 01 15:00:38 they probably have some kind of spam protection so the don't send more than one sms a day or something like that Feb 01 15:06:01 hey guys, maybe the wrong channel but i have multiple dependencies in my gradle file that apparently use nineoldandroids so i get the multiple dex files define etc... how can i solve this because i do need all those libraries Feb 01 15:09:00 But it doesnt really work...Here is Source of Android-App (Client): http://pastebin.com/JwX2nE8x and here the source of the Server (Java): http://pastebin.com/YciVadZ8 Maybe you could give me a hint...the Android-App doesnt switch to Connected but stays at Connecting (Android 5.0.1 on OnePlus One) Feb 01 15:11:34 is retrofit sort of strictly for REST web services? Feb 01 15:11:55 seems like I should go with okhttp for http get/post requests and also file uploads since I'll need that Feb 01 15:12:15 shmoon_ I use Android Ion for REST Feb 01 15:13:42 https://github.com/koush/ion ? Feb 01 15:14:05 yeah Feb 01 15:14:15 it's easy and simple to use, not messy Feb 01 15:28:43 hey guys anyone here with experience for gstreamer on android? Feb 01 15:49:02 I was playing around with my VCS nd git option in android studio.. but now when I restarted my android studiin.. It doesnt show me my project files.. Also says build gradle failed to sync.. And cannot connect to github repository.. It mention about http configuration fr gradle.. Feb 01 15:49:18 Anyone has any idea of whats going on ? Feb 01 15:54:23 (regex1) I was playing around with my VCS nd git option in android studio.. but now when I restarted my android studiin.. It doesnt show me my project files.. Also says build gradle failed to sync.. And cannot connect to github repository.. It mention about http configuration fr gradle.. Feb 01 15:54:27 (regex1) Anyone has any idea of whats going on ? Feb 01 16:07:58 At what point in the activity lifecycle do you set arguments for a fragment that gets loaded by default? Feb 01 16:08:32 Phlow: it's loaded by default means its created by xml? Feb 01 16:08:39 yeah Feb 01 16:09:37 I think you can't, but not sure always add them programatically Feb 01 16:10:14 (regex1) I was playing around with my VCS nd git option in android studio.. but now when I restarted my android studiin.. It doesnt show me my project files.. Also says build gradle failed to sync.. And cannot connect to github repository.. It mention about http configuration fr gradle.. Feb 01 16:10:15 yah, you can't Feb 01 16:10:27 Please could someone help Feb 01 16:10:30 Phlow, I strongly advise you avoid instantiating fragments in XML, it's better for your sanity Feb 01 16:11:19 is there a way I can make gradle take something from a .property file and put into the BuildConfig patrick style? I'm trying to figure out how to add api keys into an open source project Feb 01 16:12:11 hmm Feb 01 16:13:21 LambdaDusk, yes. Feb 01 16:13:44 LambdaDusk, inside buildTypes object you can use "buildConfigField" to set a field inside BuildConfig.java Feb 01 16:13:52 LambdaDusk, and you can read local.properties file as part of build.gradle script Feb 01 16:13:55 see http://stackoverflow.com/questions/17197636/is-it-possible-to-declare-a-variable-in-gradle-usable-in-java Feb 01 16:14:36 Properties properties = new Properties() Feb 01 16:14:36 properties.load(project.rootProject.file('local.properties').newDataInputStream()) Feb 01 16:14:38 that works just fine :) Feb 01 16:14:46 mavrik, wow thanks, that's quite easy Feb 01 16:15:38 mavrik, Do I have to re-sync the project when I change the properties field? Feb 01 16:15:46 um Feb 01 16:15:49 well yes Feb 01 16:16:04 since "re-sync" means that AS rereads the build.gradle file Feb 01 16:16:34 even though, it'll probably get refreshed on each build anyway Feb 01 16:16:40 at least I didn't have any issues with caching Feb 01 16:16:54 mavrik I mean, AS just executed "gradle build", right? Feb 01 16:17:04 yeah Feb 01 16:20:56 Man... writing all that needs to be done for downloading and extracting an APK expansion file, with all the checks for space and what can go wrong etc takes almost as much work as half the rest of the app, and I thought I was about done when I realized I had to use APK expansion files heh Feb 01 16:21:24 someone should make a lib for that, then. Feb 01 16:22:04 but I guess it's a one time learning experience. I can reuse all that in future apps Feb 01 16:39:19 what libraries do you guys use for a stickyheader listview? Feb 01 16:48:52 buttonTint has no effect for a CheckBox https://gist.github.com/anonymous/7841d9a71d3d1c3edc92 strange. currentMin is 15. Feb 01 16:50:25 apparently, Checkbox has widgetTinting through appcompat Feb 01 16:56:19 a never mind. style had a different colorAccent - perfect now. Feb 01 17:01:14 Hey, I am having trouble with these lines of code: http://pastebin.com/bsH7Fv9f and they are giving me this error: http://pastebin.com/dQMHSZwq Feb 01 17:01:43 I am not sure what I'm doing wrong, but those lines of code are called from a different thread from the main thread Feb 01 17:02:28 I know they are the problem because if I comment them out, the app doesn't give me that error. So, switching views is causing outofmemory, which is wierd because each view only has about one or two images Feb 01 17:07:57 Mad3ngineer__: You are allocating a 53 Megabytes Stringbuffer? Feb 01 17:08:21 no, wait, that is the errorhandler :o Feb 01 17:08:25 Those two lines in themselves are not the issue.. You're doing something else that's causing it Feb 01 17:08:42 somehow you get a 53 MiB stacktrace. Wow. Feb 01 17:08:47 Which ultimately ends up in an exception handler trying to log 53 MB Feb 01 17:09:19 Probably something with layouting, the layout exceptions usually end up being several kB large. Feb 01 17:09:53 I'm guessing something with large bitmaps Feb 01 17:10:15 I have no idea what I'm doing to cause this Feb 01 17:10:35 large bitmaps? no... I tried smallest ones in android Feb 01 17:10:42 like the little 16x16 bit ones Feb 01 17:10:46 no difference Feb 01 17:11:10 Esseentially I have two RelativeLayouts, I am trying to hide one and show the other. Feb 01 17:11:27 Anyway, how can I go about handling it? Feb 01 17:11:33 ooh. Feb 01 17:12:01 Mad3ngineer__: First, try to catch the original exception and print just the first few lines of the stacktrace Feb 01 17:12:28 ah, so the stacktrace was overflowed? Feb 01 17:12:54 so your UI works by just setting all views you don't need anymore invisible? wouldn't they still be in memory then? Feb 01 17:13:18 Also, don't touch the ui from anything but the main thread Feb 01 17:13:27 Mad3ngineer__: Exactly. Feb 01 17:13:36 Memorion, is this a bad thing to do? Feb 01 17:13:42 So, if you try to do it that way, you can get the original stacktrace, and try to understand it. Feb 01 17:13:57 all right, but how can I have other threads change it then? Feb 01 17:14:09 And I don't understand why this would mess it up? Feb 01 17:14:24 Mad3ngineer__: there is a runOnUiThread or so. Feb 01 17:15:11 https://paste.kde.org/pspg1ilo9 Feb 01 17:15:39 ok, and that won't mess it up? Feb 01 17:15:49 even if it is called from another thread than main? Feb 01 17:16:06 it can still mess up. Feb 01 17:16:13 but what causes it? Feb 01 17:16:23 more specifically? Feb 01 17:16:35 Mad3ngineer__: That’s why I told you to try get the original stacktrace, so we actually know the problem Feb 01 17:16:51 ok, my bad... Going back to that Feb 01 17:17:02 until then we can just try random things Feb 01 17:18:10 Uh, I have never encountered a stackexchange this big... Confused about how to get the first few lines Feb 01 17:18:42 I have the Exception object, but IDK what to do other than printStackTrace Feb 01 17:21:24 you could try this: https://paste.kde.org/plqqmshms Feb 01 17:21:26 (untested) Feb 01 17:21:39 (not for long) Feb 01 17:23:07 btw, minor revision: https://paste.kde.org/prlrhsfun Feb 01 17:24:11 just a few bugs. nothing I couldnt fix. Trying to fix it now Feb 01 17:24:21 err, get errors Feb 01 17:25:00 sorry, try https://paste.kde.org/p6ewqradt Feb 01 17:25:15 (this is what happens when you write code without an ide or even testing it) Feb 01 17:25:39 naw, I debugged it fine, but IDK why i am not getting the lines Feb 01 17:26:34 thanks Feb 01 17:28:49 for some reason, it isn't showing up in logcat at all Feb 01 17:28:55 I even changed it to log.e instead Feb 01 17:30:53 Set log to verbose, but it still doesn't show up.... I even used search Feb 01 17:33:22 This error... it is so wierd Feb 01 17:33:38 The lines of code in onCreate are repeating themselves over and over again... Feb 01 17:34:59 Now I am even calling this from main thread, but I am still getting the error Feb 01 17:35:27 the try-catch loop isn't even runing the first line in the catch, which is a log.e Feb 01 17:36:23 then your error is somewhere else Feb 01 17:37:05 I have narrowed it to the two lines I have shown Feb 01 17:37:23 findViewByID().setVisibility()... Feb 01 17:37:35 commenting them out is causing error Feb 01 17:38:01 even called in main class... I am lost Feb 01 17:39:44 Show more code and the actual stacktrace Feb 01 17:40:12 Sure, more code incoming. Stacktrace is acting super wierd... I can't even get it Feb 01 17:40:48 here is my main class http://pastebin.com/FwRUa4Hk Feb 01 17:41:10 http://pastebin.com/FxjrA913 Feb 01 17:41:19 GUI.java ^ Feb 01 17:41:37 those are only two classes involved in the error Feb 01 17:41:40 static? Feb 01 17:41:46 baaaad idea. Feb 01 17:41:46 yes, GUI is static Feb 01 17:41:51 no, the activity Feb 01 17:42:10 you have the context static. Feb 01 17:42:24 right, I couldn't find a way to get the activity from other classes Feb 01 17:42:29 static Context context; […] context = this; Feb 01 17:43:07 Mad3ngineer__: You can pass a reference to GUI. for example using new GUI(this), and then let GUI have a constructor that takes a context. Feb 01 17:43:29 The problem is that the way GUI is going to be used, it needs to be static Feb 01 17:43:51 making Context static is a bad idea Feb 01 17:44:06 IDK how to integrate non-static context into my code Feb 01 17:44:16 is there an Android.getActivity.getContext or somethign? Feb 01 17:44:26 no. Feb 01 17:44:30 You should be able to avoid statics Feb 01 17:44:30 and there can’t be. Feb 01 17:44:52 because for example on systems with multiwindow, or in other cases, two instances of your activity might run at the same time Feb 01 17:44:55 contexts can change, make one static and it can survive a value change. Next thing you know, you're using a wrong context Feb 01 17:45:10 Pass your contexts around, ideally with Dagger Feb 01 17:45:24 ok. Feb 01 17:45:44 Mad3ngineer__: Your findViewByID method calls itself Feb 01 17:45:46 Infinitely Feb 01 17:46:02 that’s the next point. Feb 01 17:46:09 god what an idiot I am Feb 01 17:46:22 Busy looking at GUI.java Feb 01 17:46:26 ignorign that error Feb 01 17:46:36 (but still, making it static will just result in funny errors later on) Feb 01 17:46:51 * deuteros__ nods Feb 01 17:46:59 as for the static context.... I have no idea how to fix this.... I already have my system working with being able to call Starborn.getContext Feb 01 17:47:07 how can I still keep that method but avoid static context Feb 01 17:48:58 You can’t. Feb 01 17:49:16 ;_; Feb 01 17:49:29 I guess ill rebuild my project *eye twitch* Feb 01 17:50:09 what prevents you from passing this Context or retrieving it from the App instance? Feb 01 17:50:11 Hi. New android dev here. I am becoming seriously frustrated. It's not only the vast amount of abstractions that the platform have... Whenever I am implementing one of the thousand options available on Internet... it's deprecated! Feb 01 17:51:44 I have been days just trying to make a simple tabbed interface involving fragments which gives me no errors Feb 01 17:52:49 fcanela: That’s sadly how things are, it’s possible to work with it, though, and you get used to it. Also there are nice libraries for most stuff Feb 01 17:53:10 Mobile moves fast Feb 01 17:53:17 Now, with that done, i'm trying to create a ActionBar with a spin... and... surprise! the way I found to do that requires MainActivity to extend ActionBarActivity... but it-s already extending FragmentActivity! Feb 01 17:53:43 fcanela: A lot of this has changed recently, with AppCompat. Feb 01 17:53:45 Sorry for the rant, but i'm a "little" frustrated right now Feb 01 17:53:45 Surprise! ActionBarActivity extends FragmentActivity Feb 01 17:53:48 ^ Feb 01 17:54:03 https://developer.android.com/reference/android/support/v7/app/ActionBarActivity.html Feb 01 17:54:08 justJanne: I'm going to search about AppCompat Feb 01 17:54:33 Aha, thx for saying, SimonVT Feb 01 17:54:33 SimonVT just linked to a class of it. Feb 01 17:54:59 Hi guys, just saw this channel in the motd for #android and thought I'd ask my question here too. Feb 01 17:55:12 AppCompat is the support library? It's what I am using right now Feb 01 17:55:14 I just had my first successful build of Paranoid Android for my Nexus 9, but there are a few extras zip files in my out directory that I am unsure about. Feb 01 17:55:19 add a gradle dependency like Feb 01 17:55:19 fcanela yup. Feb 01 17:55:28 I have pa_flounder-5.0-ALPHA-20150201.zip, pa_flounder-apps-eng.jay.zip, pa_flounder-img-eng.jay.zip and pa_flounder-symbols-eng.jay.zip Feb 01 17:55:28 if you have compile 'com.android.support:appcompat-v7:21.0.3' Feb 01 17:55:31 Thanks both, i'm going to continue fighting with it Feb 01 17:55:48 yes, I've that on my build.grade Feb 01 17:55:55 s/grade/gradle Feb 01 17:56:39 jaimbo: Try #android-root, this channel is for app dev Feb 01 17:56:59 Ah right, thanks SimonVT Feb 01 18:26:26 Ok so im trying to setID of an element in java Feb 01 18:26:34 its asking for an int id Feb 01 18:26:42 Ive tried @+id/ Feb 01 18:26:46 and R.id. Feb 01 18:26:48 And neither work Feb 01 18:27:29 Do I need to pre-define the ID Feb 01 18:30:17 @+id/ is for xml, and R.id. is for referencing indexed ids created, if doing in java, yes predefine a value, put it in xml value or make it a final int in scope of caller Feb 01 18:30:44 How can I pre-define it in the java? Feb 01 18:31:25 final int thisIsMyId = #; just create an int with a value to use as your ID Feb 01 18:31:49 why final? Feb 01 18:31:56 Don't do that, just use @+id Feb 01 18:31:59 it isn't gonna change Feb 01 18:32:18 deuteros__ but where would I put the @+id? Feb 01 18:32:20 he's not doing it in xml layout Feb 01 18:32:25 Im defining this entire layout in java Feb 01 18:32:28 If R.id doesn't find your id, something is wrong with your environment (e.g. no R.java compiled or found by your IDE) Feb 01 18:32:33 Ah Feb 01 18:32:36 Dynamically creating/assigning id's ... "why" is my first question Feb 01 18:32:38 :p Feb 01 18:32:46 Its for an AlertDialog Feb 01 18:32:51 drose379: Any good reason for this? Feb 01 18:33:06 Its for an AlertDialog. I guess I could just make a XML layout for it Feb 01 18:33:20 You should unless you have a good reason not to (there are valid use cases) Feb 01 18:33:21 Only an EditText and RadioGroup though so doing it in java wasent bad Feb 01 18:34:21 R is generated from your resources. You can not add to it from java. You can define id's in values/ with or something and use that. Or just keep int variables in code. Feb 01 18:34:34 If defining the object in Java, then why would one need an Id? Feb 01 18:34:48 I need to get the ID of which radio button is being selected Feb 01 18:34:50 State saving Feb 01 18:34:53 I think of the Id value as a wait to locate something that was XML defined. Feb 01 18:35:16 Otherwise, a ref to the object is available Feb 01 18:35:17 ?? Feb 01 18:35:22 If I do int id = 22 Feb 01 18:35:25 s /wait/way/ Feb 01 18:35:32 then setID(id) Feb 01 18:35:34 it wont work Feb 01 18:35:41 The framework does not save state for views without an id Feb 01 18:35:52 drose379: Yes, that will work Feb 01 18:36:28 setId is saying its expecting resource of type id\ Feb 01 18:37:11 That's a lint check, disable it or make it not an error Feb 01 18:37:21 Or define id's in values/ Feb 01 18:37:23 So the IDE is wront? Feb 01 18:37:29 wrong* Feb 01 18:37:36 And yeah, I think im gonna define them in values Feb 01 18:37:52 Do I need to make a new file in values/ Feb 01 18:37:53 ? Feb 01 18:38:07 No, it's not wrong. There's just a lint check that wants you to pass R.id resources to setId Feb 01 18:38:40 Often that's what you want Feb 01 18:38:57 Oh ok Feb 01 18:39:15 So can I add the items to the strings file? Feb 01 18:39:27 drose379: http://stackoverflow.com/a/22876880 , here's an example Feb 01 18:39:58 ah sweet, thanks Feb 01 18:39:59 file name sin values/ doesn't matter.. If you want to put id resources in strings.xml, that's your choice Feb 01 18:40:05 It makes more sense to make an ids.xml file tho Feb 01 18:40:14 Yeah, ill do that Feb 01 18:41:01 Inside the resource tags right? Feb 01 18:41:58 yep Feb 01 18:42:25 Thanks alot guys Feb 01 18:43:03 Hey, another question Feb 01 18:43:08 Something I should probably know Feb 01 18:43:16 But say I have an interface Feb 01 18:43:25 RadioGroup.OnCheckedChanged Feb 01 18:43:39 In order to use the method inside that interface I have to have my class implement that interface? Feb 01 18:46:47 to implement an interface, you must implement its methods. Code example assuming RadioGroup.OnCheckedChanged has a method onCheckedChange(): class RadioChecker implements RadioGroup.OnCheckChanged { public void onCheckChanged() { /* example implementation method */ } } Feb 01 18:48:24 Right, and you have to @Override it Feb 01 18:48:34 But what if a class needs to use more then one interface Feb 01 18:48:37 ? Feb 01 18:49:41 comma separate Feb 01 18:49:58 so class Foo implements IBar, IBaz { ... } Feb 01 18:50:12 Ok, and the only way to use an interface is to implament it in the class Feb 01 18:51:12 it's not really "using" the interface, so much as "providing" it. Feb 01 18:51:52 Yes. Think of interfaces as a promise. If I say I'm (for example) Searchable, I must implement everything that is expected of Searchable objects. Feb 01 18:52:14 By coding the implements keyword, the compiler enforces the requirement of providing certain methods expected by code that might use the class. Feb 01 18:52:27 Got it Feb 01 18:53:18 so the method onCheckedChanged is supposed to get called whenever a radiobutton in a group changes Feb 01 18:53:32 actually, nevermind Feb 01 18:54:27 I have a UI question: I want to add 2 tabs halfway down the screen (login, sign up buttons). When the tab is clicked, I want a specific Fragment to load. Should I be using a TabHost/TabWidget with a FrameLayout here? Feb 01 19:31:47 tab host sucks do not use Feb 01 19:34:01 pfn you need a sign like this http://i.imgur.com/50gv11V.jpg Feb 01 19:34:09 'tab host sucks, do not use' Feb 01 19:42:41 what’s the goto solution for tabs nowadays, btw? Feb 01 19:44:16 pager strip in support lib Feb 01 19:44:25 or roll your own in a radio group Feb 01 19:44:36 ok guys, hard question time Feb 01 19:44:39 and then a viewpager below? Feb 01 19:44:46 how do you render GMaps into Bitmap for display in notification? :) Feb 01 19:45:45 draw a view into bitmap Feb 01 19:45:52 from On draw or something Feb 01 19:45:56 Mavrik assuming you know how to put a bitmap in a notification, maybe you can use the gmap lite feature to create the bitmap Feb 01 19:46:22 g00s, that's what I'm looking at Feb 01 19:46:27 and it seems I'm a moron Feb 01 19:46:33 since I can't figure out how Feb 01 19:47:05 pfn, so inflate a view in service, set layout params, wait for render, ondraw to bitmap, then set it up? Feb 01 19:47:47 I forget exactly, I don't think you need to use ondraw Feb 01 19:48:01 google draw view bitmap Feb 01 19:48:19 basically screen shot Feb 01 19:49:01 mhm Feb 01 19:49:08 my basic concern is just if I can do that in service without showing anything Feb 01 19:49:21 but yeah, lite mode seems like it could work Feb 01 20:01:57 fake rendering in a service could suck, yeah Feb 01 20:21:22 what's the reference of the map shown, is it tracking and have to slide to see it, or what's the desired affect of keeping a map in the notification Feb 01 20:34:10 there's lots of reasons to see a map in a notification Feb 01 20:38:57 hey, I know that you can only perform operations on Views from the thread that they were instanced from... This is all fine and dandy, but how exactly do I get past this? I have an app with two threads, and I need to run setVisibility(View.GONE) on a view that was instanced in my app's main activity's onCreate. How exactly do I make this happen? Feb 01 20:39:49 pfn, exactly, that's why i'm asking for a deeper question Feb 01 20:39:51 To clarify, the setVisibility() needs to be run from a different thread than onCreate Feb 01 20:39:58 Mad3ngineer__: you have to marshal the call to the main thread Feb 01 20:40:03 oh Feb 01 20:40:20 ill read up... I am lost Feb 01 20:40:22 Mad3ngineer__, Look at Handler Feb 01 20:40:26 then marshal it to the other thread. If it's a looper thread, then create a handler associated with it Feb 01 20:40:38 What JesusFreke said Feb 01 20:40:44 and send a message (or Runnable) to that handler, which will get executed on the associated Looper thread Feb 01 20:40:50 the onCreate thread is not a looper, obviously it is called from the android system Feb 01 20:41:00 so, create a looper thread to manage the GUI's? Feb 01 20:41:16 The main thread (i.e. the thread onCreate is called on) *is* a looper thread Feb 01 20:41:27 *isconfused* Feb 01 20:41:31 where do I put the handler? Feb 01 20:41:35 If it is an Activity, you are good to go. Juast create a Handler and queue something to it that makes it happen Feb 01 20:41:51 ok, I think I misunderstood your statement "To clarify, the setVisibility() needs to be run from a different thread than onCreate" Feb 01 20:41:53 ah ok, but what method gets called on the loop Feb 01 20:42:05 like is there an onUpdate() function? Feb 01 20:42:10 that gets called every loop? Feb 01 20:42:23 Mad3ngineer__: no, the looper part of it is "hidden" from you Feb 01 20:42:33 Mad3ngineer__: your main interaction with the looper will be via a Handler Feb 01 20:42:37 yes, part of the android libraries, right? Feb 01 20:42:42 Wait, so I am getting confused... Feb 01 20:42:50 Think of the looper as having a queue Feb 01 20:43:04 the Looper is baked in for you Feb 01 20:43:16 and the looper's implementation is basically while (true) { somethingToDo = queue.waitForSomethingToDo(); somethingtoDo.Do(); } Feb 01 20:43:34 each somethingtoDo is an activity, right? Feb 01 20:43:35 and then a Handler is an interface for adding something to the queue Feb 01 20:43:38 no Feb 01 20:43:42 OHH i get it Feb 01 20:43:51 each somethingToDo is whatever you send to it, via a Handler Feb 01 20:43:51 now, what do I read up on for handlers Feb 01 20:43:58 Handler Feb 01 20:43:59 :) Feb 01 20:44:04 haha easy enough x{ Feb 01 20:44:05 xP Feb 01 20:44:11 http://developer.android.com/reference/android/os/Handler.html Feb 01 20:44:35 thx, does it have a training page for it also? Feb 01 20:44:44 on developer.android.com? Feb 01 20:44:50 but to be honest, there's probably an even easier way :) Feb 01 20:44:51 http://developer.android.com/reference/android/app/Activity.html#runOnUiThread(java.lang.Runnable) Feb 01 20:45:11 but if you look at the implementation, it's going to be using a handler :) Feb 01 20:45:12 oh wow, that sounds even better Feb 01 20:45:26 but yeah, I want to read up on handlers Feb 01 20:45:26 I use a Handler. It's not complicated. Feb 01 20:45:32 the more I know the better Feb 01 20:45:38 that's my attitude, whatever way is easier Feb 01 20:46:08 I have an internal class in my Activity that extends Handler. Override the handleMessage() method Feb 01 20:46:21 ok Feb 01 20:46:29 Then your other Thread puts stuff on the queue it wants done. Feb 01 20:46:34 https://android.googlesource.com/platform/frameworks/base/+/refs/heads/master/core/java/android/app/Activity.java#5243 :) Feb 01 20:46:34 whatitis-, what does it matter the reason in this case? Feb 01 20:46:42 You to it in the handleMessage() method. Feb 01 20:46:55 That's it. Feb 01 20:47:03 ok Feb 01 20:47:14 thx FlipBill, thanks JesusFreke :) Feb 01 20:47:14 Or just post Runnables to the Handler.. That's often easier Feb 01 20:47:44 Yeah, for Handlers, you can either provide a custom implementation that overrides handMessage, or you can use a base Handler, and send Runnables to it Feb 01 20:48:09 as SimonVT says, you can actually send the code to run on the queue by posting Runnables. Feb 01 20:48:18 oh, yeah. like SimonVT just said :) Feb 01 20:48:25 Hmm... I'll look into that. Thanks SimonVT :) Feb 01 20:48:41 hi guys Feb 01 20:48:45 Or devies some scheme in handleMessage to identify what needs to be done for various message types. Feb 01 20:48:52 devise* Feb 01 20:49:46 im pretty new to android and web services.I should send / get data from our database via REST web service Feb 01 20:49:59 what is the key words of sending and getting data ? Feb 01 20:50:15 i read some get and post method etc. im so confused Feb 01 20:50:34 and someone suggest me to use volley Feb 01 20:50:50 Wow, so handler is essentially Androids version of thread? Is it fair in saying that? Feb 01 20:51:00 not exactly Feb 01 20:51:29 it's a.. threading tool? A looper is a.. specific type of thread? Feb 01 20:51:37 Mad3ngineer__, more like a hook in your UI Thread that you hang things on Feb 01 20:51:44 ok Feb 01 20:52:04 but you can still create a plain ol' java.lang.Thread Feb 01 20:52:14 which isn't a looper Feb 01 20:52:17 I have been using Thread, like for my second thread Feb 01 20:52:31 I am extremely confused by threads and handlers still, so I gotta read up on it Feb 01 20:52:39 but you guys have given me the base Feb 01 20:52:41 thanks :) Feb 01 20:52:56 Mad3ngineer__: the Looper/Handler implementation isn't too crazy. It's sometimes useful to look at how they're implemented Feb 01 20:53:00 As a general Java rule, don't create threads: use executors and let them create thread pools for you Feb 01 20:53:08 yeah, so rendering gmaps offscreen doesn't work Feb 01 20:53:10 maybe step through the Looper/Handler code in the emulator? :) Feb 01 20:53:56 emulator? I feel like this is somethign I should know as a java developer Feb 01 20:54:06 the android emulator Feb 01 20:54:24 I suggest the emulator because you know you'll have the exact android source used for it Feb 01 20:54:25 Don't worry about emulators, they don't work very well, are very slow and very limited. Get used to developing with a real device Feb 01 20:54:25 oh, right. i use USB debugging Feb 01 20:54:34 yes ^^ Feb 01 20:54:44 if you're developing on a device, you might not have the exact frameworks source for the code that's running on the device (unless it's a nexus device) Feb 01 20:54:56 which it is :) Feb 01 20:55:02 ah, ok :) Feb 01 20:55:11 android developing was one of the things in mind when I got my phoe Feb 01 20:55:13 phone Feb 01 20:55:36 Phriend or phoe? Feb 01 20:55:47 stepping into the framework code can be handy sometimes :) Feb 01 20:55:54 lol bill Feb 01 20:56:20 and yeah, ill probably have to do that. Before I step into the framework code, i will probably wanna know how exactly you use Handler, which means looking at examples. Feb 01 20:56:30 which i am doing Feb 01 20:56:51 Handler is in Java, you have the source, regardless of how you're developing Feb 01 20:57:15 oh, I thought it was part of android Feb 01 20:57:26 It is, but that part is open source Feb 01 20:57:33 ok Feb 01 20:58:40 but for oem-customzied devices, the source you have available may not match the source of the code that's running on the device. So if you tried to step into it in a debugger, the lines may not match up. Feb 01 20:59:47 Mad3ngineer__, here is how I do it. Not exemplary code, I'm sure, but it works.. http://pastebin.com/8ifN50H0 Feb 01 21:00:55 ill keep that in mind JesusFreke, and thank you flipbill Feb 01 21:01:11 this helps me out a lot Feb 01 21:02:01 pretty much though, I am making my app intended for everyone who uses android anyway, so if their version of android doesn't handle it, I am doing something wrong, right? Feb 01 21:02:15 assuming it is past a certain version Feb 01 21:02:29 Mad3ngineer__: it's not an issue when running the code. only when debugging Feb 01 21:02:51 you're guaranteed that the Handler/Looper functionality will work the same way on other Android (tm) devices Feb 01 21:03:00 ahh, i get it all now. my device is essentially vanilla android 5.0.1 Feb 01 21:03:14 that's what the CTS (compatibility test suite) tests are for :) Feb 01 21:03:23 and every Android (tm) device has to pass those tests Feb 01 21:03:32 makes sense :) Feb 01 21:05:20 Mad3ngineer__: You can't realistically target all Android devices. These days, I shoot for minApi 15 Feb 01 21:05:33 Having said that, yes, the Handler logic has been there pretty much since 1.0 Feb 01 21:06:00 yeah, I am using minApi 19 or 21 I think, because my app will use OpenGLES Feb 01 21:06:18 Safe choice Feb 01 21:06:59 Also, I plan on using Crashlytics (nabbed a free copy a while ago... it lasts forever) to figure out what users are having happen wrong on their device Feb 01 21:07:18 this should help me figure out what lines of code are messing up on different versions and fix those lines of code, right? Feb 01 21:07:30 have you used it? Feb 01 21:18:46 Ok, I think I understand it... But looper.... Does Handler extend it? Feb 01 21:19:17 in the class overview example code here http://developer.android.com/reference/android/os/Looper.html Feb 01 21:19:28 it shows that you run Looper.prepare() and looper.run Feb 01 21:19:37 where does Looper get defined? Feb 01 21:19:41 I don't understand this Feb 01 21:19:56 You can pass Looper as a constructer param for Handler Feb 01 21:20:34 I don't bother thinking about looper. Feb 01 21:20:57 I can see it in some of the stack traces I look at, but it's little concern to me. Feb 01 21:21:01 Mad3ngineer__: if you don't provide a Looper in the constructor, it will use the current thread (if it's a Looper thread, like the UI thread) Feb 01 21:21:06 As I wrote, it's baked into Activity. Feb 01 21:21:16 so to use handler, all I have to do is create a handler, overwrite its handleMessage methods, and then send messages from outside? Feb 01 21:21:20 otherwise, if you want to associate the Handler with a looper other than the thread you're on, you can specify your own Feb 01 21:21:27 Mad3ngineer__, yes Feb 01 21:21:31 Does anyone know where AndroidStudio stores the adb binary on osX? Feb 01 21:21:31 My bad bill. That flew over my head Feb 01 21:21:41 just make sure you create the handler on the thread you want it to run on Feb 01 21:21:53 Mad3ngineer__, no prob. I didn't give you any context in the code snippets. Feb 01 21:21:59 Or pass the looper. Thanks guys! It makes sense now :) Feb 01 21:22:08 right :) Feb 01 21:23:49 Man Handler is awesome... In the end, now that I understand it there are lots of places I will use it in my app, but in this case I think I will use runOnUIThread() Feb 01 21:24:02 yeah, I love Handler Feb 01 21:24:15 Mad3ngineer__, haha! Feb 01 21:24:17 Haha all these tricks I have been completely missing in java Feb 01 21:24:31 right now, there are all those projects in the past Feb 01 21:24:37 where I could have used handler.... Feb 01 21:24:41 *beats head* Feb 01 21:24:53 * FlipBill tosses pillow Feb 01 21:25:00 * Mad3ngineer__ takes pillow to face Feb 01 21:43:37 WOO! Thanks guys, you helped me get my game's GUI system working! :D Time to move on to work more on the rendering system! Feb 01 21:44:31 Render away... Feb 01 21:44:52 rendering is going to be the hard part. But I have used LWJGL before, so I am used to the system Feb 01 21:45:12 There's always a hard part. Feb 01 21:45:24 every single time Feb 01 21:52:21 Please, don’t use the old glBegin/glEnd Feb 01 21:52:23 pleaaase. Feb 01 22:14:53 I don't know why, but this subreddit is so satisfying: http://www.reddit.com/r/punchablefaces Feb 01 22:32:02 Hi, http://pastie.org/9879115 why does this happen? Feb 01 22:32:41 Location could be null Feb 01 22:33:24 Find out what the value of locationManager.getLastKnownLocation(provider) is. It could be that there is no value there, therefore will return null. Feb 01 22:33:55 Could also be that locationManager is null. Check them. Feb 01 22:34:22 Locationmanager can’t be null, otherwise it would break earlier. Feb 01 22:34:42 Oh, you have a point. Feb 01 22:34:51 Yeah, so it is likely to be location then. Feb 01 22:35:11 Well, it would be, because that is what you are invoking the method on. Feb 01 22:40:37 Hmm, when would getLastKnownLocation return null? Feb 01 22:41:30 If the provider given is disabled. Feb 01 22:41:40 az0xff: Did you google? I know nothing about it and can answer that question just from googling. Feb 01 22:41:57 az0xff: TacticalJoke: http://developer.android.com/reference/android/location/LocationManager.html#getLastKnownLocation(java.lang.String) Feb 01 22:42:06 I went to the most obvious place. Feb 01 22:42:33 m Feb 01 22:42:34 thanks Feb 01 23:03:31 Hi, is there any documentation in aosp for the Settings application? Feb 01 23:09:23 Hi, is there any documentation in aosp for the Settings application? Feb 01 23:10:12 echo Feb 01 23:49:14 hi, i want to reset my fragment manager backstack... and the only suggestion i found online was to use "fragmentManager.popBackStackImmediate(null, FragmentManager.POP_BACK_STACK_INCLUSIVE);", however that causes every async in each fragment to be called until it rechecks the the main fragment... anyone any other suggestion? Feb 01 23:50:08 I considered finishing the activity and starting a new one... but that isn't ideal Feb 01 23:50:45 Makalak i did this: http://stackoverflow.com/questions/6186433/clear-back-stack-using-fragments Feb 01 23:50:51 assuming that is what you are asking Feb 01 23:51:53 sabton: that will lead to the same result.. as you're calling every fragment in the middle as you make it back to main 1 Feb 02 00:04:02 How does one change the color of the text in the ActionBar? I'm using AppCompat v21, but I can't seem to get the color to change: https://gist.github.com/MarkyC/0ecdd1f67f93b0e1d57e Feb 02 00:06:03 MarkyC: i think it was @color/accent Feb 02 00:07:12 Makalak: no dice :/ Feb 02 00:07:53 The color in line 10 is a light purple, but my text still comes out black: https://gist.github.com/MarkyC/0ecdd1f67f93b0e1d57e#file-styles-xml-L10 Feb 02 00:12:10 MarkyC: i cant remember which one was it... but make sure to apply it to v19/style.xml if you have 1 Feb 02 00:14:41 Makalak: I don't have one of those. I've gotten it to work for now by setting the parent of my main theme to `parent="@style/Theme.AppCompat.Light.DarkActionBar"`, which gives me white text Feb 02 00:31:02 Is anyone else unable to access the Billing or Payments sections of AdMob? It just loads forever, and the error in the browser console is "Load denied by X-Frame-Options: https://accounts.google.com/ServiceLogin?blablabla" Feb 02 00:48:01 For android, what wired alternatives ar there? USB only? Feb 02 00:48:03 so can anyone suggest a way to reset backstack without having to popback every single fragment? Feb 02 00:51:08 torkien: For what purpose? Feb 02 00:51:49 If you want to connect an MCU (Micro Controller) to an Android phone, what are the alternatives? USB, Bluetooth, Wifi, NFC. Basically I want the Android phone to log data sent by a sensor. Feb 02 01:24:13 I can never decide how to format long 'implements' clauses. Feb 02 01:24:23 They're such a pain. Feb 02 01:50:48 Does KitKat ListViews have onItemClick animations by default? Feb 02 01:51:02 TigerWolf no Feb 02 01:51:28 just a highlight color that varies on if there's a skin installed Feb 02 01:52:01 Ok, is there code to backport similar to lollipop animations to KitKat? Feb 02 01:52:33 no Feb 02 01:52:57 Thanks Feb 02 01:53:27 TigerWolf: add android:background="?android:attr/selectableItemBackground" to your list view items layout Feb 02 01:55:15 you won't get the animation Feb 02 01:55:23 you just get the state list Feb 02 02:03:57 hello ladies and gentlemen Feb 02 02:11:42 I went with android:listSelector="@color/gray" - I think the default one was being squashed. Better than nothing. Feb 02 02:16:37 hello, I'm having a little trouble getting my adb to connect to my nexus5. It has been working in the past, but I pulled up android studio for the first time in a while, and now I cannot get my computer to recognize my phone. Feb 02 02:16:41 Developer options is enabled on my phone. when I plug the phone it does charge through the usb. I have tried adb stop-server / start-server. I have also reinstalled the Google USB drivers. Feb 02 02:16:58 I am running out of ideas to try. Anyone have any other suggestion? Feb 02 02:17:08 have you tried disabling and reenabling USB debugging? sometimes I have to do that Feb 02 02:17:26 acksun: is android studio still running? Try closing it, and see if you can connect to adb manually Feb 02 02:17:52 Levite: do you mean developer options? Feb 02 02:17:53 It might be running an adb server itself, which is conflicting with the adb server that the command line adb tries to start (or something) Feb 02 02:17:55 yes I have tried that Feb 02 02:18:03 ok, yeah Feb 02 02:18:05 closing AS now Feb 02 02:19:34 closed AS, killed and restarted adb server. re plugged in my phone. adb devices still shows nothing Feb 02 02:19:59 at this point, I would say go into the device manager and see if windows is detecting it Feb 02 02:20:08 it is not Feb 02 02:20:09 is the phone charging so you know the cable works? Feb 02 02:20:13 i have already checked Feb 02 02:20:22 the phone is charging yes Feb 02 02:20:29 phone charging != cable works, though :) Feb 02 02:20:46 e.g. there could be something wrong only with the data pins Feb 02 02:21:00 JesusFreke: yes i am starting to think that this may be the cause Feb 02 02:21:22 yeah, try a different cord, and/or a different port on the computer Feb 02 02:21:32 is there a way to get wireless adb going without a usb cable or root? Feb 02 02:21:42 unfortunately I dont have another cord on me Feb 02 02:21:44 nope, you have to start it from adb over usb Feb 02 02:22:00 lame :P Feb 02 02:22:15 ok well thanks for the help. if anyone else has any ideas, do let me know Feb 02 02:35:02 how much does android differ from java? is that the program lanuage to replace java's swing component? is it just called 'android' ?? Feb 02 02:37:10 are you talking about just the application development part of android? Feb 02 02:37:46 ya if i know java swing well, how hard is it to transfer to android studio? whats the language called that android studio usues? Feb 02 02:37:58 it's java Feb 02 02:38:33 it's basically a bunch of Java API/Libraries that you use Feb 02 02:39:08 it's java... with android classes, methods, etc. at least, that's how i think of it. Feb 02 02:47:33 kuyo: The basic Android UI component is 'View'. This gives something of an overview: http://developer.android.com/guide/topics/ui/overview.html Feb 02 02:48:01 acksun: make sure you have drivers, if that dont work try toggling USB connection mode picture MTP and photo Feb 02 02:48:37 kuyo it's an sdk like any other SDK plus the fact its built for an OS Feb 02 02:52:42 acksun: also not all wires are made equal, Feb 02 02:52:43 lasserix: I have tried this with no success. Thanks though. Feb 02 02:52:59 yes. at this point I think it is probably the cord, Feb 02 02:53:06 when I get home i will test a new one Feb 02 02:58:50 try different ports? **** ENDING LOGGING AT Mon Feb 02 02:59:58 2015