**** BEGIN LOGGING AT Tue Mar 08 02:59:59 2016 Mar 08 03:03:07 django_: You have to add a listView xml element. In that bpaste code, it only shows a FrameLayout and textView. Mar 08 03:26:07 rxjava makes my brain hurt Mar 08 03:26:46 lol Mar 08 03:27:53 why Mar 08 03:28:14 Observable getPain() :D Mar 08 03:28:40 RustyShackleford it has a steep learning curve for most people Mar 08 03:29:21 the coursera functional reactive course makes the learning curve next to nil Mar 08 03:30:29 "We assume you know the fundamentals of functional programming and the Scala language." Mar 08 03:30:41 oh well Mar 08 03:30:47 eh, the functional programming course is good, too Mar 08 03:30:55 coursera progfun course Mar 08 03:31:05 but the functional reactive c ourse isn't hard Mar 08 03:32:27 they link to this https://www.manning.com/books/reactive-design-patterns Mar 08 03:32:37 "Although most of the book's examples use the Scala language, no prior experience with Scala or Akka is required." Mar 08 03:32:42 i wonder how they do that then Mar 08 03:33:06 they use words to describe what's going on Mar 08 03:33:08 I suppose Mar 08 03:34:43 I've done a little functional programming... no scala Mar 08 03:34:55 the simple examples are easy. I'm struggling with how to elaborate on them Mar 08 03:36:32 i'm kinda wondering why erik meijer has been quiet on the Rx front for a while now ... last year he was always talking about it. Mar 08 03:36:57 once ben c left netflix / rxjava project everything wound down Mar 08 03:37:48 I don't even know what functional programming really means Mar 08 03:37:50 does anyone? Mar 08 03:37:51 what does netflix have to do with rx? Mar 08 03:38:06 wabz: it definitely seems a little gimmicky Mar 08 03:38:10 RustyShackleford ben started rxjava working at netflix Mar 08 03:38:16 I think it means passing around void * Mar 08 03:38:31 but i guess there were some guys there from MS that cross pollinated Mar 08 03:38:56 I don't believe how many languages it supports. What is it written in? C? Mar 08 03:39:14 what supports ? Mar 08 03:39:41 reactivex Mar 08 03:39:52 aren't they all the same project? Mar 08 03:39:54 each impl is standalone Mar 08 03:40:14 i'm suprised. I figured they had one impl and bindings Mar 08 03:40:41 for jvm yeah, but the JS is another one, cocoa another, c# another, etc Mar 08 03:42:03 One of the reasons it's hard to learn functional languages I think Mar 08 03:42:11 Is because it's non-Algol Mar 08 03:42:38 I'm used to moving from C to Java to C++ to Perl to Python to Javascript...but all of it is Algol-like....Scheme isn't Mar 08 03:45:07 the functional programming in scala book is really good, and doesn't require any scala knowledge, either Mar 08 03:45:18 but it's much more advanced than rx Mar 08 03:47:39 Ologn, eh, that's not really the reason Mar 08 03:47:49 functional programming is sorta hard to wrap your head arounde Mar 08 03:47:56 Ologn, functional programming concepts are very different from typical imperative programming Mar 08 03:48:11 but the idea of writing your functions to be stateless is great Mar 08 03:48:42 RustyShackleford, it's natural once you start doing it Mar 08 03:49:02 I messed around with Haskell for a few months. It was pretty cool definitely Mar 08 03:51:34 if you can grok haskell, rx should be trivial Mar 08 03:55:08 wabz, it means programming with functions, duh Mar 08 03:56:14 pfn: I did not really know haskell Mar 08 03:56:24 g00s: becasue scala is not scary ? Mar 08 03:56:33 I wrote it somehow by reading lots of docs. If I looked back at that code I would not understand it Mar 08 03:57:08 g00s: been walking on my foot finally. Crutches to take some of the weight. Its the oddest thing learning how to walk again Mar 08 03:59:34 actually rx might be easier if I brush up on the Haskell Mar 08 03:59:42 ha. such a nice annotation - @Size Mar 08 04:02:30 i was trying to get sign in using google to work and now the emulator has got stuck requiring the "google apps device policy" app... which constantly crashes Mar 08 04:02:50 anyone know how to fix this thing (google was unhelpful)? Mar 08 04:39:29 I want on Observable that makes network calls, writes to db, and then tells the subscriber when its done Mar 08 04:39:35 I don't want to return anything Mar 08 04:40:17 I'd just return the data ignore it Mar 08 04:40:34 or you could have an observable of ? Mar 08 04:43:41 RustyShackleford: so you want to have 2 subscribes Mar 08 04:45:02 can I do that? multiple subscribers? Mar 08 04:45:07 never ocurred to me Mar 08 04:45:27 my coworkers in India just wished me a happy Women's Day Mar 08 04:45:30 how nice Mar 08 04:48:08 ha Mar 08 04:48:22 international women's day is my birthday Mar 08 04:48:26 today! Mar 08 04:48:53 I always found it weird how IWD is such a big deal in some places, no one in england could tell you when it is Mar 08 04:49:06 it's a notional holiday in cambodia Mar 08 04:49:33 I never heard of it before Mar 08 04:49:59 I don't think its a thing in the US Mar 08 04:50:50 *national Mar 08 04:55:57 is there a decent way to check if the app is coming from background or not? Mar 08 04:56:14 a lot of answers I see are kind of self managing a counter variale or a boolean Mar 08 04:56:19 variable Mar 08 05:03:24 RustyShackleford: I never had problem with rxjava :P Mar 08 05:03:35 would say that more problem with dagger Mar 08 05:12:20 gordon_: I got it wired up Mar 08 05:12:43 dagger sorta makes sense, and makes no sense at all. same as rx honestly Mar 08 05:13:06 so wait, are marble diagrams supposed to make sense too? Mar 08 05:21:05 lol Mar 08 05:23:06 examples with lamdas are also really messing with my head. Is that supported on android yet? Mar 08 05:24:02 looks great for someone that really knows the framework Mar 08 05:27:01 RustyShackleford kinda with retrolambda - never used it Mar 08 05:30:24 if you're going to use rxjava you should definitely use retrolamdba and learn to use them Mar 08 05:30:25 Also IDEA (well AS) will fold your source code to look like lambdas Mar 08 05:33:51 "4chan Founder Chris Poole Will Try To Fix Social At Google" heh Mar 08 05:35:06 CedricBeust is it true that lambdas in kotlin are implemented better than java ? Mar 08 05:38:57 g00s: yes Mar 08 05:39:07 They have proper closures Mar 08 05:39:31 and when declared inline, they will won't even incus an object allocation overhead Mar 08 05:39:33 "Unlike Java, the variables captured in the closure can be modified:" well thats nice Mar 08 05:39:49 RustyShackleford: lambdas are great Mar 08 05:39:51 Bytecode wise, both languages are about on par Mar 08 05:39:53 thanks loke Mar 08 05:40:54 I find it incredible that Java 8 didn't bother to implement closures. There is no reasonable explanation other than sheer stupidity. Mar 08 05:41:20 loke: What do you mean? Mar 08 05:41:24 There are plenty of things to be annoyed at with Kotlin, but they sure fixed a lot of Java crazyness. Mar 08 05:41:37 CedricBeust: Mean by what? Mar 08 05:41:48 That Java 8 doesn't implement closures Mar 08 05:41:57 CedricBeust: I mean exactly that. Mar 08 05:42:17 Java 8 has both syntactic and bytecode support for closures, I don't understand what you mean Mar 08 05:43:03 CedricBeust: You must be using an incredibly strained definition of the word "closure". Mar 08 05:43:14 I'm curious about your definition Mar 08 05:43:59 The ability to close over free variables from outer scope. (the Java 8 model is no more than a shorthand for passing arguments to the inner scope) Mar 08 05:44:21 Right. Java has supported its current style of closures for almost 20 years, not sure what's so surprising. Mar 08 05:44:50 CedricBeust: Calling that a closure is the problem. Mar 08 05:45:28 I see being able to modify over closed variables as dangerous (as is mutability overall). I like the approach of disallowin git. Mar 08 05:47:30 CedricBeust: I could see that argument as having some validity if Java was otherwise a language which promoted immutability. But when the damn thing doesn't even support try/catch forms returning values, forcing immutability of variables in this one case only serves absolutely no point. Mar 08 05:48:09 The more immutability, the better. Just because Java doesn't enforce it in other areas doesn't mean it's useless to enforce it in others. Mar 08 05:48:19 CedricBeust: And I believe that we have discussed the virtues of static typing in the past :-) Mar 08 05:48:34 This current discussion is completely unrelated to static typing. Mar 08 05:49:22 What defines a true closure is completely uninteresting to me, I care more about the practical implications of adopting certain semantics. Mar 08 05:49:23 CedricBeust: We both know that the reason for Java 8's forced final have nothing to do with the higher ideal of promoting immutability. Mar 08 05:50:12 (an ideal I don't disagree with, mind you) Mar 08 05:50:51 also, I sloppily used the expression "static typing" when I was actually referring the ideals of Haskell (which includes both static typing as well as immutability) Mar 08 06:07:19 is it ever possible for Fragment#getTarget() to return null? (if target has been set, even through screen rotations, etc) Mar 08 06:11:58 meh, closing over free variables for the lose Mar 08 06:11:59 :P Mar 08 06:19:49 But it's a more proper definition! Mar 08 06:24:34 " Prior to JELLY_BEAN you must not modify the insets or else you and Android will be unhappy." Mar 08 06:26:06 is there anything on d.android.com that just talks about insets? they are mentioned everywhere but i can't find any place thet describes wtf they are Mar 08 06:28:52 i need pictures damn it :) Mar 08 06:29:04 why do the android doc people hate diagrams so much Mar 08 06:35:26 out of curiosity what's the difference between onStart() and onResume()? I use onResume() a lot but almost never touch onStart Mar 08 06:35:38 insets are like padding Mar 08 06:35:39 that is all Mar 08 06:39:49 g00s: SOA people like diagrams, you should try ;) Mar 08 06:40:08 maybe you will also get into some meeting with no sense Mar 08 06:41:46 gordon_ uh what ? Mar 08 06:42:05 you are not making sense :) Mar 08 06:42:07 see you havent been in big corporation :D Mar 08 06:42:29 irrelevant Mar 08 06:42:39 it is Mar 08 06:42:44 if you associated diagram with boring meetings in big corpo, you have serious issue Mar 08 06:42:54 or I'm just joking Mar 08 06:42:55 bigger than Android Studio! Mar 08 06:43:06 guess which one was that ? Mar 08 06:44:13 AS was partially frozen this morning, so I decided to "invalidate cache & restart"... It even fails at "invalidate cache & restart" Mar 08 06:44:45 did keyboard stopped working for you ? Mar 08 06:45:04 my keyboard has no issue Mar 08 06:45:16 so only I have this bug.. Mar 08 06:55:24 Is there a goto Parcelable annotation library? Mar 08 06:56:01 I've always made my objects parcelable manually and it's an annoying amount of overhead Mar 08 06:56:46 konk3r yeah there are some libs, but your google is as good as mine Mar 08 06:57:31 g00s: Yeah, I've seen libraries for it so I'm going to check them out, thought I'd see if there was a consensus on which one to use Mar 08 07:16:25 damn, when'd gordon_ get so good at trolling them fools Mar 08 07:19:30 i guess he can learn about trolling whenever scala comes up Mar 08 07:19:48 lots of opportunity there Mar 08 07:22:48 konk3r: google through github, there are one or two Mar 08 07:23:09 I'm checking out https://github.com/johncarl81/parceler right now Mar 08 07:23:11 looks promising Mar 08 07:23:59 yeah, I was thinking about that one. but it works like wrapper. meh.. imo Mar 08 07:24:16 Hello.. I just started to use Android SDK. Rendering problems were relentless, but somehow i got them through by tweakind sdk version. But now problem is that layout manager or whatever it is called is gray and I can't add any components there.. Mar 08 07:24:29 Any advice?? screen cap http://snag.gy/DyvC5.jpg Mar 08 07:25:49 Luihu: screens are mostly useless. use pastebin to illustrate questions Mar 08 07:27:12 Is there a simple way to build a list of items that scroll item by item? For example, showing three items at once, then scrolling one by one, always showing only three of N items. Mar 08 07:28:11 I am currently using HorizontalScrollView > LinearLayout, but the scroll is "continuous", not "discrete" Mar 08 07:28:31 vigilancer I am very new to this, so can you tell me how to illustrate the problem in pastebin? I haven't added any code, I am following a tutorial that uses a scaffold and it begins by adding GUI objects but my layout manager seems totally different than the videos.. Mar 08 07:29:45 xrash, viewpager Mar 08 07:31:43 I think this is how the layout manager should look like.. http://snag.gy/nrjHN.jpg Mar 08 07:32:09 https://github.com/Taig/Soap Mar 08 07:32:20 that is such an awesome parcelable library Mar 08 07:32:38 Luihu: open pastebin site, copypaste code that you have problem with, publish it, paste link to code with question. If you feeling lucky somebody will pick it up Mar 08 07:34:42 everithing better in scala ;P Mar 08 07:36:03 Luihu: it this case code = content of xml file, describing your view Mar 08 07:37:13 vigilancer: I'll do it, will take a minute though Mar 08 07:37:40 vigilancer, everything is Mar 08 07:38:29 literary, can't argue :) Mar 08 07:56:51 http://pastebin.com/FW69UCD2 Mar 08 07:57:10 maybe i should try reinstalling the sdk? Mar 08 07:57:57 it just crashed (again) Mar 08 07:58:19 Luihu: pastebin stacktrace Mar 08 07:59:09 vigilancer: sorry? I don't understand.. Mar 08 08:00:11 Luihu: google stacktrace than :) Mar 08 08:00:44 vigilancer: I will do it, sorry i am very new to this.. Mar 08 08:01:43 nothing to be sorry about, it's learning process Mar 08 08:12:58 How to make dynamic graphs like http://javadocmd.com/blog/content/images/2014/Sep/interstellar_inc.png with clickable nodes Mar 08 08:22:10 Good morning dear developers! Let's rock 'n roll :P Mar 08 08:25:35 Lately I use Fragments a lot instead of Activities. I just have one Activity and there I host all Fragments I want. But now I wonder when to create another Activity instead of a Fragment? What do you think? Mar 08 08:27:30 Depends on the application flow Mar 08 09:04:09 In the SDK manager I have 'Android Support Library' version 23.2 installed. But when I compile, it looks for ../android/support/support-v4/23.0.0/support-v4-23.0.0.pom Mar 08 09:04:43 is there a way to install version 23.0.0 of the android support library, or else tell gradle to use version 23.2 instead or something? Mar 08 09:07:55 johnflux, are you in Android Studio? Mar 08 09:08:26 ktwo: no, but I have that installed and run that just to run the sdk manager Mar 08 09:08:54 i usually just update the build.gradle file to use the latest version in AS Mar 08 09:08:58 "compile 'com.android.support:appcompat-v7:23.2.0'" Mar 08 09:09:14 ktwo: thanks Mar 08 09:11:49 I have an activity with only Fragments and all of them only in portrait mode, but for one Fragment, I want to replace it with an Activity. The reason for that is, in the Activity I want to show video streaming in portrait mode as well as landscape mode, hence an Activity instead of Fragment. What do you think about this solution? Mar 08 09:13:52 I was checking how to enable landscape mode in a fragment and found the solution by overriding setUserVisibleHint(). But I don't like it so much, because going back to previous fragment I have to override the same method again to lock it back to portrait. Mar 08 10:00:49 hey all Mar 08 10:01:00 im researching the OTG capability of android devices Mar 08 10:01:25 i need to know if a cable exists which would allow for the android device to charge as well as be a host to a usb flash drive Mar 08 10:12:43 I'm fairly sure that's impossible with a regular cable Mar 08 10:46:59 Afternoon all. Mar 08 11:30:42 hi does list entries have onclick listener Mar 08 11:32:25 Hi all, is it practice to cast an Activity to getActivity to change a primitive (in this case a boolean)? i.e. ((MyActivity)getActivity).setExampleBoolean(true); Mar 08 11:32:41 would it be better to use an interface in this case? Mar 08 11:51:56 Hey all, im working on a udacity course and im getting an error from android studio for this snippet of code: line 83 https://bpaste.net/show/2e1421dd781d Mar 08 11:55:01 That seems fair, given that there's no declaration for "mForecastAdapter" anywhere. Mar 08 11:55:20 Hey yall ... Mar 08 11:57:35 could someone tell why i am not able to create a new user on firebase with this code : Mar 08 11:57:50 http://pastie.org/10751996 Mar 08 11:58:32 http://postimg.org/image/dno8neml3/ Mar 08 11:58:33 fizzie, ty! Mar 08 12:45:56 Hi all! I am looking for the command line documentation of the new emulator - unfortunately, `emulator —help` no longer works („PANIC: HOME is defined but could not find (null).ini file“) Mar 08 12:45:59 Any hints? Mar 08 12:53:39 Hi all, does anyone know if it's possible to change the size of my toolbar navigation icon? I'm currently using toolbar.setNavigationIcon(R.drawable.menu_icon); which works well, but the image is much larger than i'd like. Mar 08 12:53:59 I'd like to avoid resizing the image itself if i can Mar 08 12:56:47 rmrrn, already thoughout about using a vector ? Then resizing is easier Mar 08 12:59:06 ktwo: I haven't no but will consider. I can't actually see anyway to specify the size here though! Mar 08 13:00:01 height/width inside ktwo: ahh I see. if i'm unable to use a vector, is there anyway to do this? I tried defining another drawable with an imageview which didnt work unfortuantely Mar 08 13:12:16 for this: https://github.com/udacity/Sunshine-Version-2/blob/2.01_add_network_code/app/src/main/java/com/example/android/sunshine/app/MainActivity.java#L130 I get an error: "CANNOT RESOLVE SYMBOL" Mar 08 13:27:29 rmrrn, just resize the image (imho). Why can't you use vector? Image too complex? Mar 08 13:46:44 Is it possible to use the design support library (i.e Snackbar) in android TV (Leaseback Theme). I get an error about "You need to use a Theme.AppCompat theme (or descendant) with the design library." Mar 08 13:47:07 Leanback* Mar 08 13:53:14 hey could someone tell me the proper syntax for creating new user on firebase through android studio Mar 08 13:53:46 mFirebaseRef.createUser() Mar 08 13:54:03 i cant get the code that goes between () right ? Mar 08 13:54:07 no documentation for iit? Mar 08 13:54:32 there is i've been reading and searching online for it but i cant fix my code ? Mar 08 13:54:52 http://postimg.org/image/dno8neml3/ Mar 08 13:55:13 what are you overriding Mar 08 13:55:18 http://pastie.org/10751996 Mar 08 13:55:19 are you sure that method needs overiding? Mar 08 13:55:43 elyess, use an appcompat theme :) Mar 08 13:56:45 am not sure, am just trying to learn how it works, thus i pasted this code shown in the pic but it is not working Mar 08 13:57:37 remove the @override above onclckingbutton Mar 08 13:58:10 you mean : @Override public void onSuccess Mar 08 13:58:22 Hi.. How can I send array bytes with httpUrlConnection? Mar 08 13:58:22 nope Mar 08 13:58:26 onClickingButton Mar 08 13:59:02 no @Override above that other than the @Override above @Override protected void onCreate Mar 08 13:59:30 oh that one is removed already Mar 08 13:59:37 still the same error Mar 08 13:59:54 I can see it in the screenshot Mar 08 13:59:59 it's there mate. Mar 08 14:00:47 http://postimg.org/image/4n6ovymq1/ Mar 08 14:01:34 you need to close createUser Mar 08 14:01:48 missing ) at the end of the anonymous callback metho Mar 08 14:02:26 hmmm ... let me see ... just a sec Mar 08 14:05:34 great, but now there is problem :http://postimg.org/image/o84bs1btp/ Mar 08 14:06:07 which i never got before, can not be instantiated ? Mar 08 14:19:53 I'm looking for a way to get *a* view within an activity. it doesn't matter which view, i just need one. (for snackbar) Mar 08 14:20:44 I tried to do it with activity.getCurrentFocus(), but it seems like there's a chance that nothing is focused. Mar 08 14:30:23 okay Mar 08 14:30:30 back to seeing how to do MTP/PTP over OTG Mar 08 14:30:44 Hello guys, what's the best method to have a continuous video streaming on orientation change? At the moment I use a VideoView object and use that to stream in portrait mode, which works well. I was thinking of saving the stream url and progress position and than after activity is recreated, I than restart the streaming setting the last progress position. What do you think? Mar 08 14:31:35 Number5: does youtube pause when you rotate? Mar 08 14:31:56 I am pretty sure they buffer the video somewhere else and just cut the showing of said buffer to the screen Mar 08 14:32:11 then resume once it's rotated Mar 08 14:32:21 tx, well, I don't have the feeling it pauses, but it could pause for a very short time, not noticeable by me. Mar 08 14:33:15 tx, ok, but now I use a VideoView object doing the streaming, I don't know what technique is used by Youtube. Mar 08 14:33:23 imho, just save the state of the video Mar 08 14:33:27 position, quality etc Mar 08 14:33:37 reload on rotate Mar 08 14:34:30 To my surprise I could also play video from a MediaPlayer, which is more like a player without a video. Mar 08 14:35:08 dayum Mar 08 14:35:15 these MTP tutorials are so old! (honeycomb) Mar 08 14:35:19 nothing for newer APIs Mar 08 14:35:55 So I was thinking to save the mediaplayer in a singleton and reattach the view after orientation change, but that takes me longer to code and I have to think of a good pattern. Mar 08 14:36:04 tx, there are MTP tutorials? :) Mar 08 14:37:07 Mavrik: well, code samples ;) Mar 08 14:37:39 Huh, didn't know that support existed :P Mar 08 14:40:11 Mavrik: how do you think gallery apps open up when you plug a camera in via otg Mar 08 14:41:04 ktwo, i am already using the Leaseback theme for TV, hoe to use AppCompat with it? Mar 08 14:42:33 I'm adding radio buttons dynamically to a radiogroup. how do I make the radio button labels fill the width? Mar 08 14:42:51 tx, never did that :P Mar 08 14:44:00 Number5, you'll likely leak the activity Mar 08 14:44:40 hot Mar 08 14:44:41 Zharf, because I have to pass a context? Mar 08 14:47:50 If I make an AsyncTask static, how can I update the UI based on the result of the AsyncTask if I cannot reference the UI from onPostExecute? Mar 08 14:48:48 you need a reference to the ui, or use something like eventbus to tell the activity/whatever to update Mar 08 14:49:22 Khaytsus: none Mar 08 14:49:32 whoops, wrong #android channel ;) Mar 08 14:50:28 And what if I want to use the same method from within the Task as well as outside the Task? Mar 08 14:54:03 hmm Mar 08 14:54:12 trying to get the class of a usb device attached Mar 08 14:54:18 get 0 back, so no class? Mar 08 14:55:17 is this a good book if i want examples on how to create an app for my site? Mar 08 14:55:19 http://shop.oreilly.com/product/9781785883262.do Mar 08 14:55:45 my site uses mysql db but the book has examples for sq lite Mar 08 14:55:46 is it ok? Mar 08 14:55:52 sql slite Mar 08 14:56:58 Number5, yes, you can use application context probably, but it's still a bit dodgy... can you retain a fragment? Mar 08 14:59:29 The problem will be attaching the player to the new surface :) Mar 08 14:59:30 does sql lite interface the same way as mysql from my app in android-studio ? Mar 08 15:00:05 Zharf, I can, but I want to try first by setting the progress position after recreating Activity and see what the result looks like. I secretly fingercross that VideoView caches the buffered data so the the whole process goes much smoother. Mar 08 15:00:12 why XML instead of HTML :/ Mar 08 15:00:20 Mavrik, I'm now using straight forward VideoView. Mar 08 15:02:02 Is it possible to do chrome webview debugging from inside the emulator? Is there a place I can read how to get USB debugging working through the emulator? Mar 08 15:02:09 Mavrik, is it a problem? I haven't used MediaPlayer in years :p Mar 08 15:02:49 Zharf, yep, accelerated surface tends to be destroyed Mar 08 15:02:52 we have a custom video player in our current project and in our previous project I wrote my own player using MediaCodec Mar 08 15:02:55 and that annoys MediaPlayer Mar 08 15:03:05 Since you can't reattach on some devices. Mar 08 15:03:21 Which means you need to recreate / reload video which makes a noticable flicker + delay. Mar 08 15:04:01 Mavrik, ok, so any other options isn't available with standard Android components? Mar 08 15:04:05 im getting "cannot resolve symbol R" Mar 08 15:04:26 django_, rebuild project? Mar 08 15:04:35 Number5, how? Mar 08 15:04:43 'Rebuild' Mar 08 15:04:51 Zharf, hence MediaCodec is usually a better idea when it works Mar 08 15:04:54 Number5, still Mar 08 15:05:00 YouTube uses ExoPlayer which renderes via MediaCodec Mar 08 15:05:05 In 'Build' menu Mar 08 15:05:08 also restarted android studio Mar 08 15:05:15 Number5, yeah i found it, didnt work Mar 08 15:05:49 django_, 'File' -> 'Invalidate cache, restart' Mar 08 15:06:57 Number5, didnt work :/ Mar 08 15:07:02 Mavrik, MediaCodec is terrible before api 18 or 19 though Mar 08 15:07:06 If that doen't work, check whether a library is added correctly or something like that. My experience is AS gives weird error that makes you search in the wrong place. Mar 08 15:07:06 wait Mar 08 15:07:10 i think it worked on one file Mar 08 15:07:11 Zharf, yeah, they do fallback :) Mar 08 15:07:13 it's sad how bad android media apis are Mar 08 15:07:21 Hence the reason I'd use ExoPlayer over anything manual :P Mar 08 15:07:33 Zharf, on API 23 we got the API to tell us how many HW decoders there are \o/ :P Mar 08 15:07:55 we have a proprietary player in the app I'm currently working on Mar 08 15:08:34 Does anyone here knows if it's possible to get an Android emulator connect to Chrome debugging environment? Mar 08 15:09:13 Mavrik, maybe we can use google provided media apis in the next 20 years then Mar 08 15:09:24 minSdk 23. Mar 08 15:11:25 last year i bought a book called learning php,mysql & javascript and built a website around it, now im looking to build an app based on my website (my website accesses a mysql database), which book from o'reilly do you guys recommend for this? they have like 4 pages of books listed for android developement Mar 08 15:12:20 I recommend the texts of the bible known as Mar 08 15:12:25 "StackOverflow" Mar 08 15:15:23 Can anyone explain why when you start a new activity the transition from the old to the new seems jerky? Mar 08 15:18:06 it doesn't Mar 08 15:18:14 stop hogging the main thread Mar 08 15:19:27 "sb_device_claim_interface failed" Mar 08 15:19:37 great, looks like the internal USB library doesn't want to play nice Mar 08 15:22:35 pfn: The application may be doing too much work on its main thread. Mar 08 15:22:42 How can I avoid this? Mar 08 15:24:10 Offloading heavy tasks to a background thread Mar 08 15:24:59 use a service! Mar 08 15:25:20 (or an asynctask) Mar 08 15:25:28 depends on what you want to do really Mar 08 15:26:01 I guess this is partly due the me not using Fragments / Views and having everything within the activity class? Mar 08 15:26:11 not really Mar 08 15:26:16 that all runs in the UI thread Mar 08 15:26:23 you're just doing a lot of other non UI things Mar 08 15:26:29 fetching data? processing data? Mar 08 15:26:35 doing lots of calculations? Mar 08 15:26:36 Fetching data from Firebase Mar 08 15:26:42 bingo Mar 08 15:26:42 That will be it. Mar 08 15:27:00 throw that in an asynctask Mar 08 15:27:01 but I have a lot of logic before I fetch the data, would that cause it to be even worse? Mar 08 15:27:10 like what? Mar 08 15:27:56 For example, I've got logic to ensure that the user is authenticated, logic to check what role the user has and the depending on the results different items are added to the navigation drawer Mar 08 15:28:38 I got MTP working! Mar 08 15:28:44 It's just really slow Mar 08 15:28:48 but that's because MTP is slow. Mar 08 15:30:19 tx pduin what you reckon? Mar 08 15:30:59 how do you know a user is authenticated Mar 08 15:31:22 Sounds like all of those things except for the nav drawer could be handled in the background Mar 08 15:31:38 any idea how to get a global snackbar? I have the issue that I can not consistently get a view out of my activity without changing every single activity. Mar 08 15:31:38 ^^should* Mar 08 15:31:59 iirc doesn't android throw an exception if you attempt to use a data connection on the UI thread these days Mar 08 15:32:03 because it's silly :) Mar 08 15:32:08 (doing it) Mar 08 15:32:09 .getCurrentFocus() sometimes returns null, so it won't work. Mar 08 15:32:43 Syzygy: You need to bind the snackbar to something though Mar 08 15:32:53 and there's no view id that is common to all activities so that i could do findViewById(R.id.rootView). Mar 08 15:33:22 tx: I'm binding it to the current activity Mar 08 15:33:31 Syzygy: http://stackoverflow.com/questions/15995297/how-is-facebook-chat-heads-implemented Mar 08 15:33:38 you could do something like what FB does with chat heads? Mar 08 15:35:53 I've done that before (not with snackbars) but I feat that it might lead to issues. Mar 08 15:35:56 I can try though Mar 08 15:36:30 tx checking if getAuth() returns null from Firebase Mar 08 15:38:32 pduin would you have all those tasks in an AsyncTask or would you have multiple AysncTasks? I don't understand why having AsyncTasks is better, Android runs the application on a single thread, if I add AsyncTask would it not have the exact same load because I carry out everything within onCreate()? Mar 08 15:38:52 Syzygy: All activities have android.R.id.content Mar 08 15:39:13 markyosullivan: nawh Mar 08 15:39:19 asynctask makes a new thread in the background Mar 08 15:39:24 hey all Mar 08 15:39:37 there are callbacks that you can hook in to before the task runs Mar 08 15:39:44 on "progress" (defined by you) Mar 08 15:39:46 for this: https://bpaste.net/show/5177ad32d128 and another XML im getting: cannot resolve symbol @string/action_refresh Mar 08 15:39:46 and when it's done Mar 08 15:40:19 django_: the string doesn't exist Mar 08 15:40:25 :\ Mar 08 15:40:32 tx, what? Mar 08 15:40:41 SimonVT: i'll try that, thanks. tx: the windowmanager also does not provide me with a view, just something to attach a view to, but still thanks Mar 08 15:41:22 that seems to work, thanks SimonVT Mar 08 15:41:31 Syzygy: isn't that good enough? Mar 08 15:41:37 attach the snackbar to the window manager Mar 08 15:41:50 tx I take it something like AsyncTasks would be used for displaying a loading animation to indicate to the user that the app is retrieving data? Mar 08 15:41:53 snackbar is similar to a toast, it's not a view Mar 08 15:42:08 (at least not exposed as a view) Mar 08 15:42:08 markyosullivan: you could certainly use it to do that Mar 08 15:42:14 ah okay Mar 08 15:42:30 I quickly searched on GitHub and found NanoTasks which are more lightweight apparently: https://github.com/fabiendevos/nanotasks Mar 08 15:42:32 Syzygy: do if you displayed a snackbar and finished the activity Mar 08 15:42:38 would it stay there? Mar 08 15:42:38 tx ever had any experience with it? Mar 08 15:42:40 (for a moment) Mar 08 15:42:44 so** Mar 08 15:42:47 let me check Mar 08 15:42:52 toasts too (obviously) Mar 08 15:42:54 do* Mar 08 15:44:10 well, no. I guess more like a dialog then. those are usually attached to an activity, but don't simply have their view exposed. Mar 08 15:44:59 Well I have performance issues if I don't use Fragments in my application and just stick using activities? Mar 08 15:46:55 tx would using RxJava be a good idea to help me with my issue? Mar 08 15:46:57 Hi everybody, I'm glad the android dev community is still live and well :) Mar 08 15:47:36 Does anybody knows if we can integrate new GCM service with an eclipse environment ? Mar 08 15:48:40 Any GCM experts ? Mar 08 15:49:37 I'm stuck on the problem for two days now :( Mar 08 15:51:09 using fragments or not does not impact performance Mar 08 15:51:17 and stop using eclipse Mar 08 15:52:27 I second pfn, eclipse should never be mentioned for Android development :D Mar 08 15:52:38 only when referring to what was used in the past Mar 08 15:53:21 and yes, RxJava can be used to solve your issue Mar 08 15:56:08 The only answer i have is "stop using eclipse" without asking me how many time frame i have or any infos about my needs. It looks really like a troll, I know eclipse is not supported but is got take a shit loads of time to migrate to android studio as the app is HUUUUGE. Mar 08 15:56:26 but thank you guys, you can't help me, now I know that. Mar 08 15:56:55 using intellij idea would be easier to migrate to ;) Mar 08 15:57:13 https://developers.google.com/cloud-messaging/gcm is too hard to follow though?= Mar 08 15:57:36 Already did Mar 08 15:57:45 is too hard to ask for some question before trolling ? Mar 08 15:57:51 @Zharf Mar 08 15:58:24 well, you still haven't explained your problem Mar 08 15:58:30 GcmReceiver is not found in my project when I receive the message and I don't know why, even tho the lib is already in the project Mar 08 15:58:48 03-08 16:40:32.850: E/AndroidRuntime(8697): java.lang.RuntimeException: Unable to instantiate receiver com.google.android.gms.gcm.GcmReceiver: java.lang.ClassNotFoundException: com.google.android.gms.gcm.GcmReceiver Mar 08 15:59:07 pfn, Android Studio still looks ugly on hidpi screens on linux, ;) Mar 08 15:59:18 gaminglib, pastebin your anndroidmanifest Mar 08 15:59:27 http://stackoverflow.com/questions/35843278/link-of-class-lcom-google-android-gms-gcm-gcmreceiver-failed Mar 08 15:59:39 This should give you a good overlook Zharf Mar 08 15:59:55 is it your post? Mar 08 16:00:03 yes Mar 08 16:00:05 ok Mar 08 16:00:11 And still looking for the answer Mar 08 16:00:36 the 's android:name should be the name of the class in your project Mar 08 16:01:04 maybe... hold on Mar 08 16:01:11 I don't think so .. Mar 08 16:01:47 the receiver is exactly like in the android gcm documentation Mar 08 16:01:58 thebishop, simple answer, stop using linux Mar 08 16:02:11 pfn, oh boy Mar 08 16:02:25 pfn, maybe i'll switch to ChromeOS Mar 08 16:02:25 Zharf, Mavrik orientation change works with VideoView, but as Mavrik said, there's some delay. Apparently it takes too much time restart the VideoView. Although it works, I'm not satisfied with the result, there's like a delay of 1.5 sec. Any recommendations, tips...? Mar 08 16:03:40 thebishop: using Elementary OS and Android Studio looks fine to me, darkcula looking nice like always :) Mar 08 16:04:41 markyosullivan, cool. still holding out on Ubuntu for now. Keeping an eye on Wayland progress on Fedora. Keeping an open mind on ElementaryOS Mar 08 16:05:08 gaminglib, I need to go, I can take a look in an hour Mar 08 16:05:14 markyosullivan, i'll probably stick with ubuntu at least until another distro moves to stable Wayland (with Nvidia support) Mar 08 16:05:45 ok thank you zharf Mar 08 16:10:26 how cna I find the arm version of my android device? Mar 08 16:11:42 I'll hit you up Zharf in an hour Mar 08 16:13:36 anyone have favorite tools for profiling NDK code? I tried this like 6 months ago with mixed success. Any new developments? Mar 08 16:13:59 nVidia profiler is the only one that worked semi decently for us Mar 08 16:15:12 How do I go about building a navigation drawer once instead of having to build it with every new activity created? I take it this is where Fragments should be used because I could create the navigation drawer once in the MainActivity and then have Fragments for displaying each of the different sections within my app? Mar 08 16:15:41 I'm basically copying code from one activity to another for creating the navigation drawer, which is really bad practice. Mar 08 16:17:00 Mavrik, is this Tegra/OpenGL only? Mar 08 16:17:19 Yeah, you need a tegra device for it to work properly. Mar 08 16:17:24 Both CPU and OGL Mar 08 16:17:28 Mavrik, wuh wuh Mar 08 16:17:29 Nexus 9 works well Mar 08 16:17:33 :sadtrombone: Mar 08 16:17:36 nexus6 (shamu) here Mar 08 16:17:48 Well, the Qualcomm profiler is shit :P Mar 08 16:17:52 haha Mar 08 16:18:31 markyosullivan use one activity, switch fragments O.o Mar 08 16:18:55 Mavrik, but it says it's "extensive" Mar 08 16:19:04 i guess i'll give it a shot anyway Mar 08 16:19:04 ^^ Mar 08 16:19:14 Try it, last time it was Windows only and didn't show anything important Mar 08 16:19:28 nVidia's was only one that actually did something useful with NDK code (especially since we use clang) Mar 08 16:20:32 g00s: that's what I thought though earlier I was thinking I could avoid using Fragments Mar 08 16:21:19 markyosullivan, why avoid fragment? Mar 08 16:23:02 markyosullivan there is a story on /r/androiddev about the new Google Photos UI change Mar 08 16:23:45 in this case, seems they split top level navigation between (1) things that jump to other activities (nav drawer) and thumbable frequently used things (tabs on bottom) Mar 08 16:24:12 but none of those sub-activities have nav drawers, you only can navigate back Mar 08 16:25:15 so in that case, nav drawer is not fragment switcher, but more like 'catch-all' for less frequently used activities Mar 08 16:26:42 oh nice, a book on rust http://shop.oreilly.com/product/0636920040385.do Mar 08 16:30:21 g00s: that sounds cool, is there a write up on how exactly they did it? Might be easier to implement that restructuring my app to use Fragments lol Mar 08 16:30:50 they still use fragments to switch between tabs ... Mar 08 16:31:07 nav drawer is basically just doing startActivity() for each item though Mar 08 16:31:11 not much to write about Mar 08 16:33:20 is it normal to have two instances of the adb process running in the background? Mar 08 16:33:28 can i just kill one of them? Mar 08 16:33:29 the thing i like about tabs on bottom - they are thumbable ... Mar 08 16:33:48 i think i restarted X server with one of them running and now there's two of em Mar 08 16:33:56 i dont like tabs on bottom because their 'auto dissapearing' is distracting when the action bar also dissapears Mar 08 16:34:11 seems more tidy when the whole appBar has one behavior Mar 08 16:34:54 seems google keeps experimenting with trivial things rather than coming out with new navigation ideas though Mar 08 16:34:59 hello, I have a question about CollapsingToolbarLayout + NestedScrollView using layout_anchor with CardView. My NestedScrollView has a CardView inside of it, and when add stuff to the cardview the NestedScrollView is pushed up, instead of respecting the anchor point. Any ideas? Mar 08 16:35:11 but i guess if you have 10M users, then trivial things aren't so trivial at that scale Mar 08 16:35:41 Does anyone has experience with ExoPlayer? I so, does it work well with screen orientation. I mean by that, that the streaming keeps playing so the user doesn't notice interruption? Mar 08 16:39:08 g00s: Okay dude, thanks for the info. Currently in the process of implementing fragments, will be a miracle if I get it working first time Mar 08 16:39:55 Some how it worked first time for the main activity, now to get the navigation drawer to work Mar 08 16:40:58 markyosullivan only thing about nav drawer - which is quirky .... Mar 08 16:41:29 https://code.google.com/p/android/issues/detail?id=183376#c61 lol the last comments Mar 08 16:41:35 and so true... Mar 08 16:41:41 if you select an item, and want to jump to another activity ... i recommend waiting for the drawer to finish closing, and then do the startActivity() Mar 08 16:41:51 g00s: Within the main layout file, do you include all the fragments which you wish to swich between? Mar 08 16:42:01 they've got two fragments in the example but that's for tablets Mar 08 16:42:08 if you startActiviy immediately (1) animations get messed up and (2) state isn't changed , so when you come back to root activity drawer will be open Mar 08 16:42:39 markyosullivan main layout usually just has a ViewPager or FrameLayout that is container for switched fragments Mar 08 16:42:44 g00s: Hopefully shouldn't be an issue with me implementing fragments instead Mar 08 16:42:49 markyosullivan look at the cheese square app Mar 08 16:44:34 adq #16 worked for me ... Mar 08 16:44:57 i have @style/PreferenceThemeOverlay.v14.Material.NoDivider Mar 08 16:45:15 oh NoDivider is my style which nukes ... divider .. :) Mar 08 16:45:39 is it me or dividers in L+ Prefs just look like crap ? Mar 08 16:45:50 g00s: Had a look their activity_main.xml looks very strange Mar 08 16:45:59 markyosullivan lol Mar 08 16:46:11 markyosullivan thats chris banes :) Mar 08 16:46:29 he might have a collapsing toolbar or something in there, don't get too distracted Mar 08 16:46:38 + coordinatorlayout Mar 08 16:47:06 adq coming very close to just saying minSdk=21 Mar 08 16:47:37 https://github.com/chrisbanes/cheesesquare/blob/master/app/src/main/res/layout/activity_main.xml Mar 08 16:47:46 but i have noticed, that some of the design support lib assumes you are using appcompat :/ Mar 08 16:47:49 where the flip does the fragments go? I'm confused looking at his layout Mar 08 16:47:53 even though technically it should stand alone Mar 08 16:48:09 (they assume certain attributes defined in appcompat) Mar 08 16:48:36 markyosullivan https://guides.codepath.com/android/Fragment-Navigation-Drawer Mar 08 16:48:40 best i can do Mar 08 16:48:43 g00s could you not implement fragments by having their visibility=false when they're not being used? Mar 08 16:49:24 adq this looks interesting http://research.microsoft.com/pubs/171498/HintonDengYuEtAl-SPM2012.pdf Mar 08 16:49:26 So you'd have references to all the fragments in one layout and then whenever an item is clicked in the menu you just update the visibility of the fragments? Mar 08 16:49:45 markyosullivan please read the tut. plenty of stuff on this Mar 08 16:50:22 markyosullivan also read https://github.com/codepath/android_guides/wiki/Creating-and-Using-Fragments Mar 08 16:50:42 might take a day to sink in, but its not too hard Mar 08 16:51:10 deep g00s, deep Mar 08 16:51:34 g00s: I've used Fragments briefly before but I try to avoid it when I can because I've had some bad experiences where I couldn't get it working (shame on me) Mar 08 16:51:54 That tutorial you linked is refreshing my memory Mar 08 16:52:02 Thanks g00s Mar 08 16:54:13 hithere, I am using PreferenceFragment, to manage sharedPreferences, if user switch to another app while being in Preferences and than back, changes are not being updated in summaries, until user re-enters settings Mar 08 17:03:10 markyosullivan, You really should play with fragments for a while. I was used to Activities too, but once I worked with Fragments for some time, I don't want to go back anymore :) Mar 08 17:06:29 Number5: I think my bad experience a couple of years ago has really affected my confidence in using them and being under a time constraint I'm reluctant to try things which I think could slow me down. Mar 08 17:07:00 That being said I did manage to update Roman Nurik's Wizard library which used Fragments after I spent a while looking over how it was done Mar 08 17:07:20 but I didn't create fragments fresh, I was simply following his examples Mar 08 17:07:28 and then adjusting it to what I wanted to do Mar 08 17:07:32 which somehow worked :D Mar 08 17:08:50 markyosullivan, just try with a demo application, a simple empty hello world template and play with it. Just in your free time so no one can disturb you. You just try some code out and run on your device. Put Log.d() on every moethod Mar 08 17:08:55 or callbacks Mar 08 17:09:15 and see what exactly happens. Mar 08 17:09:59 Like a list detail pattern, or just a bunch of buttons that opens a fragment in a framelayout (that's what I'm doing a lot). Mar 08 17:10:45 Understand the difference between fragments and activities learn its limitations so you can understand when to use in what circumstances. Mar 08 17:12:10 i/o registration open ... Mar 08 17:12:16 probably closing soon too :D Mar 08 17:13:43 Number5: Trying to implement it into my existing app atm, if I run into issues I'll definitely do a demo app. Thankfully I'm using Git so if there's any problems I'll just remove the testing branch Mar 08 17:14:04 g00s: That's on my bucket list. I'm aiming to go Google I/O at least once before I'm 30 Mar 08 17:14:10 markyosullivan, good luck friend :) Mar 08 17:14:18 Thank you Number5! :D Mar 08 17:14:27 "onSharedPreferenceChanged" is not being calld in such case Mar 08 17:15:12 I have a file with country code and and language, I want to use this in my android project, what is the best way to include this? Mar 08 17:16:09 markyosullivan, apply then! :) Mar 08 17:16:16 as a properties file? Mar 08 17:16:31 this solution does not work http://stackoverflow.com/questions/3799038/onsharedpreferencechanged-not-fired-if-change-occurs-in-separate-activity Mar 08 17:17:23 Mavrik: Do you not have to pay for it? Mar 08 17:17:36 Yes. Mar 08 17:17:41 Plus I live in Northern Ireland and I'm a student :P Mar 08 17:17:45 Pricey trip for a student Mar 08 17:17:47 markyosullivan, a lot of companies will pay for that :) Mar 08 17:17:49 Oh that it is. Mar 08 17:17:57 Like 2000eur or so :) Mar 08 17:18:20 Probably! Though I'm wanting to move to west coast before I'm 30 too! Mar 08 17:18:26 Either Canada or US :) Mar 08 17:18:52 Well, time to start applying to those juicy startups :P Mar 08 17:18:59 People are rather desperate for Android engineers. Mar 08 17:20:48 I've applied for a mobile dev role in Edinburgh (my gf lives there) with a startup, so fingers crossed they'll get me in. I'd love to work with a startup where I'd be given lots to do so I could rapidly improve my skillset :) Mar 08 17:22:40 That being said if I get offered a mobile dev role by other tech companies I'd love the chance to work full-time on mobile dev :) Mar 08 17:23:21 Well good news! I got the main activity fragment working again Mar 08 17:24:02 It's working dynamically, replacing the frameLayout which is good. g00s that second link you sent me has been quite useful as well! Mar 08 17:24:15 markyosullivan nice ;) Mar 08 17:24:39 Fingers crossed I'll get the rest of the app working the same way!! :D Mar 08 17:39:03 i think this guy probably want to go to I/O too .. http://i.imgur.com/Gzf0J5j.png Mar 08 17:45:55 Zharf ? Mar 08 17:46:15 yo Mar 08 17:47:58 Is it possible to user myString.matches(otherString) in a Switch statement? Mar 08 17:53:02 lexton, but that returns a boolean... Mar 08 17:53:13 or was it a Matcher Mar 08 17:53:36 boolean yep Mar 08 17:53:43 why would you put that in a switch statement Mar 08 17:55:08 the Switch statement uses .equals to compare strings right? Mar 08 17:56:32 switch statements are a basic hash table lookup Mar 08 17:56:34 Hey guys. I just got a warning message from Google Play saying "WebViewClient.onReceivedSslError" is causing a security leak basically. I was recommended to remove "onReceivedSslError" methods, but I don't have such a method..? Mar 08 17:56:35 that is all Mar 08 17:57:25 can you explain how the hash table works when comparing strings? Mar 08 17:58:45 where do I place .properties file? Mar 08 17:59:12 lexton, learn to Google Mar 08 17:59:32 SuperTyp, properties files for what? Mar 08 17:59:56 for custom needs Mar 08 18:02:23 markyosullivan: yes, mobile dev is nice... at first one month :P Mar 08 18:12:29 ok Mar 08 18:12:32 got mtp and usb all working nicely Mar 08 18:12:46 now I just want my app / android to remember my USB permission so it doesn't keep asking again and again Mar 08 18:12:50 I can do it with root if required somehow Mar 08 18:14:47 I have a FragmentPagerAdapter Mar 08 18:15:02 How do I get the current Fragment? Mar 08 18:15:18 Or the better, the id in the view pager or something Mar 08 18:15:31 lol Mar 08 18:15:39 you can get it by "position" Mar 08 18:15:44 not really Mar 08 18:15:45 view pager stores fragments in an arraylist / vector Mar 08 18:16:16 and? Mar 08 18:16:17 :| Mar 08 18:16:21 * OverCoder is confused Mar 08 18:16:36 I have TabLayout with ViewPager, they both work together, I want to get the title of the current tab Mar 08 18:16:56 OverCoder, http://stackoverflow.com/a/15261142/857853 Mar 08 18:17:00 mmm, thanks Mar 08 18:17:11 and the tablayout is in a fragment, in the viewpager? :p Mar 08 18:19:00 no, it's TabLayout, then ViewPager, the FragmentPagerAdapter maintains the Fragments in the ViewPager (right? :|) Mar 08 18:19:19 Oh right, sorry, it's ~5:15am here :P Mar 08 18:19:19 I feel so bad, I coded a lot and now I feel like having a headache Mar 08 18:20:13 Join the club. MTP and USB are fun. Mar 08 18:35:28 Hey everybody. Does anyone know offhand of an app that plays video and continues to play audio when the app loses focus? Mar 08 18:35:38 I’m ironing this out in my own app and want some others to compare it to. Mar 08 18:37:47 ghostmoth: I haven't tried it myself but have you tried google music? they have music videos too Mar 08 18:37:58 hello guys: is it possible to turn off google's auto translate of the short description on the play store? Mar 08 18:40:15 it sounds like you'd need to keep playing the audio in a service or something? Mar 08 18:40:32 No one is familiar with this error being sent out by Google Play "WebViewClient.onReceivedSslError" = Mar 08 18:41:00 Oh interesting grekkos Mar 08 19:03:48 Anyone know if it is possible to pickup a window in ui automator that was added to the screen via the window manager ? Mar 08 19:03:51 How do I receive the enter event? Mar 08 19:04:01 i.e. when the user presses enter on the keyboard, while typing in an EditText Mar 08 19:05:01 All the apps I’ve found that play video’s audio in the background skip back a second or two when switching between foreground and background. Kinda stinky but also inspiring, since that’s where I’m at with my solution and it seems like others haven’t figured it out either. Mar 08 19:05:54 google music and youtube don't Mar 08 19:07:26 YouTube can play music videos in the background? o.o Mar 08 19:07:44 if you have youtube red it does i think Mar 08 19:12:19 yo google keeps bugging me to install youtube red Mar 08 19:12:25 it's evil Mar 08 19:12:44 should I join the dark side Mar 08 19:26:04 does youtube red cost money, have in app purchases? Mar 08 19:26:07 how does it work? Mar 08 19:31:19 I think red is a subscription service Mar 08 19:31:25 And the app can play vids in the background Mar 08 19:31:35 Not about to sign up to see if their audio skips Mar 08 19:31:37 isn't red like netflix Mar 08 19:31:43 O.o Mar 08 19:31:51 The most popular podcast app on the market skips audio Mar 08 19:31:54 I think I’m fine Mar 08 19:31:55 /shoo non-dev questions. Mar 08 19:38:02 I need to mocke JSONObject to use in JUnit. How could I do it ? I'm just beggining Mar 08 19:38:17 I'm just beginning with tests Mar 08 19:40:27 it has always annoyed me that libraries like org.json are considered "part of the framework - must mock!!!11!" Mar 08 19:41:25 missingno: Yeah, this is no usual. JSONObject don't seems to be part of Andriod framework Mar 08 19:43:44 rxjava Mar 08 19:44:29 your choices are: use some other json library, use Robolectric, use unitTests.returnDefaultValues in gradle, or (oh god) mock out an entire JSONObject impl Mar 08 19:44:30 I dunno, I get youtube red as part of music Mar 08 19:44:53 you don't need to mock it, just get the org.json library Mar 08 19:47:14 so not only do you need to check for permission for LocationManager#requestLocationUpdates, but you also need it for removeUpdates. Since the permission check is pretty long, I wanted to wrap it in a boolean method. But doing that makes Android Studio complain since it doesn't see the permission check right before those calls Mar 08 19:47:32 where in my gradle should I add this `testCompile 'org.json:json:20140107'` Mar 08 19:48:03 denpendencies right ? Mar 08 19:48:14 pfn: Do you know if the YouTube Red app skips the audio a bit if you background the app while a vid is playing? Mar 08 19:48:25 Or is it seamless Mar 08 19:48:48 it doesn't skip Mar 08 19:48:49 it's seamless Mar 08 19:48:51 I said so Mar 08 19:49:35 Oh I didn’t see that Mar 08 19:49:43 I wonder how they achieved that Mar 08 19:50:19 Yay! :D I got my navigation drawer working with fragments Mar 08 19:50:30 (didn't take me all that time, had dinner lol) Mar 08 19:54:38 I have a gradle dependency that depends on a dependency that I am using myself Mar 08 19:55:05 Upon compilation, it complains about dexed files already existing Mar 08 19:55:07 what do? Mar 08 19:55:37 I could exclude in my build.gradle, but that's a lot of files! Mar 08 19:56:29 does that work wviana? adding the same json library that is included in android as a separate jar? Mar 08 19:57:42 missingno: I added testCompile 'org.json:json:20140107' into my Gradle, But it didn't work too. So I using JsonObject from com.google.gson Mar 08 19:58:11 missingno: it would be simpler if it works on JSONObject Mar 08 20:00:33 tbh that brokeness is doing you a favor by pushing you away from org.json Mar 08 20:01:40 tx: what's the lib with the dependency, and what's the dependency? Mar 08 20:02:45 missingno: tbh ? Mar 08 20:03:21 indooratlas sdk Mar 08 20:03:36 the dep is SquareUp's OKIO Mar 08 20:06:37 How do you use to map a list in android. I'll have to go thought each item and set an atribute in each one of them. So I have some Funcional Programming midset to solve it. I'm lazy about going into each one thought a for and changing value. Mar 08 20:07:18 Actually to each item I'll have to find in other list to find the same id and push a property into it. Mar 08 20:14:47 tx: is the lib a jar or something? not really wanting to sign up for their dev account Mar 08 20:15:16 wviana "each one thought a for and changing value." :) Mar 08 20:16:02 g00s: so boring. :( I can't wait for Java 8 in android. Mar 08 20:16:32 wviana do you still think you'll be doing android dev in half decade :) Mar 08 20:17:02 i mean, probably come before then, but probably years before you can say minSdk=X where X brought java 8 Mar 08 20:17:15 could someone help me with a issue i am having with sending a jsonobject to a rest service, if i send the request thru postman, works fine, what is the issue with my android code?http://pastebin.com/YbPZH7av Mar 08 20:22:20 huh, you have to dismiss you dialogs in onPause? Mar 08 20:29:22 i keep getting bad request ,any ideas? Mar 08 20:35:08 Hi guys Mar 08 20:35:53 im dealing with a java.lang.outofmemoryerror Failed to allocate a 145020 byte allocation with 139584 free bytes and 136KB until OOM Mar 08 20:36:14 i know what it means but can identify wheres the problem Mar 08 20:36:18 this is my code Mar 08 20:38:19 for(int i = values.size()-1; i >= 2;i--) Mar 08 20:38:19 { Mar 08 20:38:19 if(i%2==0) Mar 08 20:38:19 { Mar 08 20:38:19 for (int b=1; b >= values.get(i);b++){ Mar 08 20:38:20 EditText edi = (EditText) findViewById(x); Mar 08 20:38:21 resistance = resistance + Double.parseDouble(edi.getText().toString()); Mar 08 20:38:23 x--; Mar 08 20:38:25 } Mar 08 20:38:27 } Mar 08 20:38:29 else Mar 08 20:38:30 return; Mar 08 20:38:31 { Mar 08 20:38:33 double paralel=0; Mar 08 20:38:34 } Mar 08 20:38:35 for (int b=1; b >= values.get(i);b++){ Mar 08 20:38:37 { Mar 08 20:38:37 EditText edi = (EditText) findViewById(x); Mar 08 20:38:41 paralel = paralel + (1/Double.parseDouble(edi.getText().toString())); Mar 08 20:38:43 { while Mar 08 20:38:43 x--; Mar 08 20:38:45 } Mar 08 20:38:47 resistance = resistance + (1/paralel); Mar 08 20:38:49 int i = 100/0; Mar 08 20:38:49 } Mar 08 20:38:51 } Mar 08 20:38:53 Toast.makeText(mixtoresults.this, "resistance = "+resistance, Toast.LENGTH_SHORT).show(); Mar 08 20:38:58 printf ("lololol") Mar 08 20:39:11 g00s: Hahahaha Mar 08 20:39:18 ah canvs2321 beat me to it :D Mar 08 20:39:25 :) Mar 08 20:39:38 Hey josh--spartan please use pastebin or something to show your code Mar 08 20:39:59 pastebin? Mar 08 20:40:25 josh--spartan: http://pastebin.com Mar 08 20:41:19 lol Mar 08 20:42:14 josh--spartan, gist.github.com or bpaste.net or pastebin Mar 08 20:42:27 josh--spartan, if you paste code you will annoy people and they wont help ;/ Mar 08 20:42:27 on it Mar 08 20:42:51 django_ and josh--spartan gist is my favorite too. Mar 08 20:42:52 josh--spartan, theres also repl.it Mar 08 20:43:32 django_: This one I didn't know. Mar 08 20:43:39 http://pastebin.com/3VMeKSg3 Mar 08 20:44:00 wviana, :) Mar 08 20:44:07 josh--spartan: What's the problem ? Mar 08 20:44:29 java.lang.outofmemoryerror Failed to allocate a 145020 byte allocation with 139584 free bytes and 136KB until OOM Mar 08 20:44:37 thats my problem :( Mar 08 20:46:07 x is a variable wich is the total amount of EditTexts i have Mar 08 20:46:36 josh--spartan: Which line ? Mar 08 20:47:21 does volley have known issues with creating a jsonobject or is it just my code lol? Mar 08 20:47:23 josh--spartan: Would you matter to post entire activity code. It would give more context. Mar 08 20:47:24 is a static variable before the onCreate here: public static int x; Mar 08 20:47:33 ok Mar 08 20:51:18 http://pastebin.com/FPrDVpMQ Mar 08 20:51:21 here everything Mar 08 20:52:57 josh--spartan: Why are you skipping the two first values from values list ? Mar 08 20:53:34 those two values are voltage and paralel lines i will handle later those to get the Amperes and Wattage Mar 08 20:54:25 everything was working till the second for inside the if and else inside the first for Mar 08 20:55:55 josh--spartan: You are trying to apply some formula when pressing the ok button aren't you ? Mar 08 20:56:50 yes , in the first if is just the sum of all resistances, in the else is the 1/first resistancen and so on Mar 08 20:57:15 and after this sum wich is paralel divide everything for 1 Mar 08 20:57:35 Hi everyone.. I have this error when I build.. it came up when I added these lines to my Gradle -> compile 'com.clevertap.android:clevertap-android-sdk:2.0.5' : compile 'com.google.android.gms:play-services:8.4.0' : compile 'com.android.support:support-v4:23.1.1' Mar 08 20:57:51 My error is Error:Execution failed for task ':app:compileDebugAidl'. > Executor Singleton not started Mar 08 20:58:38 this code gave me a headache to do it and now it doesnt work Mar 08 20:58:41 :( Mar 08 21:01:17 do i need to add headers to my code for jsonobject? Mar 08 21:02:15 what do you think wviana, maybe the problem is the static x Mar 08 21:02:18 http://pastebin.com/FPrDVpMQ Mar 08 21:02:35 krippykripkrip: are the headers supposed to be in the JSON itself or on the request Mar 08 21:02:52 josh--spartan: I think you are making a infinity loop Mar 08 21:03:20 josh--spartan: your for won’t end until you wrap your int, if it ever executes once. Mar 08 21:03:46 the second for? Mar 08 21:03:51 I don’t know what you’re doing, but you’re incrementing b and testing whether it’s greater than some value. if it ever is greater than that value, it’s going to keep being greater. Mar 08 21:03:58 you may want <= Mar 08 21:04:25 josh--spartan: IN line 37 you just increases the value of `b` and keep checking if it's greater than valus.get(i); when will it get out of it if b never decreases ? Mar 08 21:05:08 true Mar 08 21:05:10 josh--spartan: I have to go home. I suggest you to put some Log.d() just after the for statements Mar 08 21:05:23 you are right wviana and duboisj Mar 08 21:05:33 thanks :) Mar 08 21:07:16 josh--spartan: I'm glad for helping. Mar 08 21:07:24 bye folks Mar 08 21:07:31 bye Mar 08 21:07:32 good day Mar 08 21:09:16 https://vid.me/ss0q still building a companion app for a wear app (same stuff is running on the watch) Mar 08 21:10:38 should i use wireshark to see my request? Mar 08 21:26:25 Is there any solution for using IDEA to access an SQLite DB as datasource on an Android device, Mar 08 21:26:25 except for rooting? Mar 08 21:26:53 justJanne there are a few tools that do that, like Stetho, SqliteStudio ... Mar 08 21:27:02 g00s: IDEA can do it natively. Mar 08 21:27:05 but IDEA itself, you need the paid version and it will have that plugin Mar 08 21:27:08 I do. Mar 08 21:27:28 the issue is that Android L gives me a "permission denied", Mar 08 21:27:37 and the directory is only readable by uid 0 (root) Mar 08 21:27:37 no idea then :( Mar 08 21:28:05 the other tools don't require root, so there much be some way. never used it tho Mar 08 21:28:15 anyone done the udacity course here Mar 08 21:28:22 well, idea didn’t require it either. Mar 08 21:28:28 focus on "did" Mar 08 21:30:23 speaking of AS ... goog was pumping out updates every few days and then it all went very quiet ;) Mar 08 21:30:59 justJanne: you can fix that Mar 08 21:31:14 Napalm: how? Mar 08 21:31:14 justJanne: theres a run-as command if i remember correctly Mar 08 21:31:23 I’m running on-device Mar 08 21:31:32 https://stackoverflow.com/questions/18471780/android-adb-retrieve-database-using-run-as Mar 08 21:31:54 well, part of what makes the tool nice is that it reads db in-place ;) Mar 08 21:32:00 justinmrkva: the example here "chown" changes the ownership of the db file Mar 08 21:32:04 as soon as you're pulling it yourself, kinda sucks Mar 08 21:32:07 justJanne: ^ Mar 08 21:32:26 justJanne: then you can open it in your tool/plugin or something Mar 08 21:32:50 Napalm: the idea is that the tool shows you the databases (and allows you to edit them, and view changes) *while the app is running* Mar 08 21:32:55 so you can live see things change Mar 08 21:33:34 you can do that if you so place Mar 08 21:33:35 please Mar 08 21:34:00 make it so ! Mar 08 21:34:54 How? Mar 08 21:35:29 IDEA Ultimate 15 doesn’t have a way to do so Mar 08 21:37:09 MS joined the eclipse foundation :O Mar 08 21:37:17 justJanne: you miss my point, you can do it.. if you want to make it yourself. its possible Mar 08 21:37:20 ;) Mar 08 21:37:59 Napalm: yeah, because I rewrite something that already exists for just 140€ a year... Mar 08 21:38:07 justJanne: i use this..http://www.idescout.com/ Mar 08 21:38:11 justJanne: i use this.. http://www.idescout.com/ Mar 08 21:38:57 Napalm: that’s another 50€. Mar 08 21:39:06 Just for something that’s already in IDEA anyway Mar 08 21:39:20 so, you dont want to make it yourself.. and you dont want to pay for it Mar 08 21:39:22 And that’s even 50€ a year Mar 08 21:39:22 hmm Mar 08 21:39:24 No, Mar 08 21:39:27 I already pay for it. Mar 08 21:39:32 so what was your point? Mar 08 21:39:46 I was asking if there is a way to get it working with the paid tool from JetBrains Mar 08 21:40:08 Because I can’t pay for one util for H2, one for SQLite, one for Postgres, one for Oracle DB, etc. Mar 08 21:40:49 (Also, Napalm, idescout only supports credit cards - which literally no one has, so I couldn’t even buy it if I wanted) Mar 08 21:41:23 erm.. nobody has credit cards? Mar 08 21:41:35 Yup, no one where I live has them. Mar 08 21:41:46 so email them and ask to pay on paypal Mar 08 21:41:46 justJanne why still using H2 O.o Mar 08 21:42:08 g00s: well, cause it’s nice for testing Java EE apps in a dev environment? Mar 08 21:42:17 Anything else takes more time to set up Mar 08 21:42:23 lol Java EE Mar 08 21:42:41 anyhow, why not a docker container having the db ? Mar 08 21:43:07 Because that’d slow testing on dev systems down by a few times? Mar 08 21:43:09 H2 isn't going to behave like oracle or anything else, don't understand why it would be used at all Mar 08 21:43:17 on the staging server? okay. Mar 08 21:43:32 on a dev system, launching a docker container, and a full DB every time you want to run a single test? Mar 08 21:43:36 nope. Mar 08 21:44:20 uh, docker container with postgresql is not a big deal. whatever :) Mar 08 21:44:35 justJanne: depends on if you want a clean environment for tests Mar 08 21:44:58 g00s: well, if you want to be able to run a test with a startup time of < 10sec, it is ;P Mar 08 21:45:02 hey, can I use the new instant run feature with just gradle or is it a feature of the IDE? Mar 08 21:45:14 justJanne why would you start the docker container for one test ? leave it running Mar 08 21:45:34 g00s: so, you’d have a full DB running on each dev’s personal laptop, 24/7? o.O Mar 08 21:45:40 Darkwater, hot code swap needs to have an aware build system Mar 08 21:45:47 So yeah, gradle is required. Mar 08 21:45:55 There are some other solutions out there tho Mar 08 21:45:58 Mavrik: i think he means just gradle and not the ide itself Mar 08 21:46:01 I'm talking about android studio Mar 08 21:46:03 justJanne yeah ? not like its filled with terabytes of data ? Mar 08 21:46:05 I use vim Mar 08 21:46:12 and gradle to build Mar 08 21:46:14 Ah. Mar 08 21:46:17 You need both. Mar 08 21:46:21 damn Mar 08 21:47:32 anyone work on the udacity android course Mar 08 21:47:44 django_ is this a survey ? Mar 08 21:47:51 g00s, no Mar 08 21:49:40 Guys quick question: say im building a small app for a client, how would signing the release apk work? Would I create a seperate keystore for them and then deliver the keystore with the apk? Mar 08 21:50:03 so i have found my issue with my jsonrequest by using wireshark, from what I can i need to put my json object within an object, is that possible ? http://pastebin.com/Z9pXAGBb Mar 08 21:50:10 orbyt_, yes Mar 08 21:50:13 orbyt_ yeah, don't give them your keystore :D Mar 08 21:50:44 So I would just put all their information when creating the key and keystore, use their requested passwords, and shit it with the apk correct? Mar 08 21:50:52 ship it* Mar 08 21:50:54 lol Mar 08 21:52:29 krippykripkrip: http://hastebin.com/eruzuzayij.java Mar 08 21:53:05 krippykripkrip: sorry i mean http://hastebin.com/pawimekudu.java Mar 08 21:56:04 Napalm, that is awesome, i’ve been working on this for days, thank you so much :) Mar 08 21:56:18 your welcome Mar 08 21:56:41 Good old wireshark lol, i’d never figured that out without using that Mar 08 21:56:59 is wireshark using Qt yet ? Mar 08 21:57:28 yeah its pretty awesome, i used the MQ , http, and a few other disectors Mar 08 21:57:49 also seems to have a lot of sec vulns tho haha Mar 08 21:57:50 thx again, bye Mar 08 22:00:14 test Mar 08 22:00:20 bzzt Mar 08 22:00:32 anyone had any luck with JNI debugging? Mar 08 22:00:51 I can't seem to get past the model.application plugin configuration. Mar 08 22:03:29 guys, I have an adb logcat question which I cant seem to find the answer. I do a log dump to terminal and my app crashes on line: (GameRestartScreen::removeWatchButtonAndResize()+48) ... what does the +48 mean? That function only has 24 lines so it cant be line number Mar 08 22:03:58 stacks don't look like that Mar 08 22:03:59 offset IIRC Mar 08 22:04:02 unless c++ Mar 08 22:04:08 sorry, c++ yeah Mar 08 22:04:12 sirchopsalot, use ndk-stack to remap it back to symbols Mar 08 22:04:41 this is the command im running: adb logcat | $NDK_ROOT/ndk-stack -sym $PROJECT_PATH/obj/local/armeabi Mar 08 22:04:52 it remaps it back to the functions Mar 08 22:04:59 but im unable to see which line number is the issue Mar 08 22:05:20 if you're not getting line numbers you're either poiting it to wrong symbols or your binaries lack enough debug info Mar 08 22:05:50 so ordinarily +48 should infer line number yes? Mar 08 22:07:28 I leave an activity to take a photo with the camera and after the photo is taken the onActivityResult gets called where I set a boolean to true, but for some reason when onStart() gets called after onActivityResult the boolean is false again. Mar 08 22:09:18 Is this normal behavior? The only place I set the boolean to false is when i declare the private member variable Mar 08 22:14:57 eemgr, your activity may or may not be recreated according to devices resources Mar 08 22:15:22 eemgr, do you properly handle storing of state and recreation_ Mar 08 22:15:22 ? Mar 08 22:15:46 sirchopsalot, no, it's address offset Mar 08 22:15:50 well i was under the impression that onActivityResult the activity had already been recreated Mar 08 22:16:06 pfn: ahhhha! Mar 08 22:16:14 pfn: any idea how to translate that ? Mar 08 22:16:18 nope Mar 08 22:16:20 Mavrik: now that you mention it - onCreate is being called after onActivityResult Mar 08 22:16:21 ok Mar 08 22:17:05 this just seems so bizarre - if onActivityResult is within the Activity, shouldn't the activity be created already? Mar 08 22:17:06 sirchopsalot, again, ndk-stack does exactly that. Mar 08 22:17:15 You're probably pointing it to the wrong dir. Mar 08 22:17:16 how is it calling a function within the activity if it still has yet to be recreated Mar 08 22:20:07 Mavrik: hmmm, i know the functions in the stack are correct at least though... have you ever seen it able to identify the functions but not internal address offset? Mar 08 22:21:09 eemgr lots of surprises around onActivityResult timing ! Mar 08 22:21:59 Does anyone know if Lombok somehow supports static delegate Mar 08 22:32:56 eemgr: it's known quirk. as workaround one can set some flag in onActivityResult and than in onCreate or later check this flag and do what was suppose do be happening in onActivityResult Mar 08 22:33:27 yeah, i'm just going to use shared prefs to solve it for now Mar 08 22:33:33 thanks for the confirmation Mar 08 22:34:18 eemgr android needs 'the book of quirks' Mar 08 22:34:22 oops vigilancer :) Mar 08 22:34:23 flag if more suitable imo, since you need to invalidate prefs. but ok Mar 08 22:34:59 'Android the Good Parts' 50 pages, 'Android the Book of Quicks" 500 pages :D Mar 08 22:35:46 50 pages of google logos? =) Mar 08 22:37:43 I would like to create a new language keyboard. is there some tutorial for that? Mar 08 22:38:57 I thought because is open source I could just put somewhere the words to be completed and change the name of the existing language keyboard Mar 08 22:39:12 but it is not so easy to find informations Mar 08 22:39:31 perhaps someone could give some hints Mar 08 22:39:36 thanks in advance Mar 08 22:45:26 Hey anybody else having problems with uploading a new APK to the developers console? Mar 08 22:45:37 g00s: actually not that bad idea. surprised nobody doing it already Mar 08 22:45:42 It seems like this bug is here again.. Mine gets stuck at 99% Mar 08 22:46:06 maybe community driven github based book Mar 08 22:46:45 cart_man: I uploaded my first android app yesterday and now when trying to update metadata, getting unexpected error 310000 or something Mar 08 22:47:12 is this kind of glitching common there? Mar 08 22:47:23 I'm only used for cursing apple previously :P Mar 08 22:47:24 Gwl: First time ive ever had a problem Mar 08 22:47:45 Hi everybody! I have faced a problem with CalendarView and after 5 min. I will shoot in my head if I do not find any solution (I tried almost whole day)... Mar 08 22:47:58 Gwl: but This sort of error happened before though.. 2014 or something Mar 08 22:48:03 Anybody to prevent blood on the floor? Mar 08 22:48:06 :) Mar 08 22:48:21 android-dev788: I usually just resort to shooting really. Mar 08 22:48:45 android-dev788: have you seen Dexter? really liked it personally Mar 08 22:49:05 Thanks guys :) Mar 08 22:49:10 I described my problem on android forum https://groups.google.com/forum/#!topic/android-developers/4JGvwI7V7N4 Mar 08 22:49:26 android-dev788: After fighting a deadline and a client on my back fighting me the entire day... 20 hours + coding in 1 session ... Developers Console refuses to take the new APK .. YAAAAAAY SOO FML Mar 08 22:49:52 But no reply so I am really getting crazy. I will be so thankful if somebody direct me to the right place/idea whatever Mar 08 22:51:32 so perhaps someone could help me find the right keywords to search on google Mar 08 22:51:33 hello. I'd like to know something about shared object dependencies in an Android app. does bionic resolve all dynamic symbols at startup? Mar 08 22:51:34 cart_man: hmmmm :) take cold beer Mar 08 22:52:10 cart_man: it is the only idea I could get you Mar 08 22:53:23 android-dev788: try changing root viewgroup, check if background and calendar elements colors not the same Mar 08 22:53:24 android-dev788: Lol thanks dude! Mar 08 22:54:05 vigilancer: checking Mar 08 22:54:35 endiruna: "android custom keyboard" ? Mar 08 22:54:38 endiruna: http://code.tutsplus.com/tutorials/create-a-custom-keyboard-on-android--cms-22615 Mar 08 22:56:02 android-dev788: may it need to be init-ed with some values, like 'setDate' or something Mar 08 22:56:21 *maybe Mar 08 22:57:06 vigilancer: Yep, I will check it. That is more probable than the background version. Mar 08 22:57:54 vigilancer: it looks that is the keyboard layout. I am bothered by the completitions Mar 08 22:58:46 vigilancer: But on the other hand if you take a look at any tutorial with CalendarView they do nothing with that - just add the calendar view to the layout and go Mar 08 22:58:51 vigilancer: I would like to add support for a language that is not in the list of languages. Each time I write messages in my mother tongue I have to disable the dictionary Mar 08 23:00:21 perhaps the right words are input language Mar 08 23:17:20 hi everyone Mar 08 23:18:33 Android studio does not work for a long time for me , I am in iran and i think ISP block my request and this is my error : Mar 08 23:19:14 Error:Connection timed out: connect. If you are behind an HTTP proxy, please configure the proxy settings either in IDE or Gradle. Mar 08 23:21:38 sounds like it told you what to do mmc Mar 08 23:22:24 missingno : yes , i did what it told me but it does not solve Mar 08 23:33:36 Please help me to solve this problem Mar 08 23:36:58 Error:Connection timed out: connect. If you are behind an HTTP proxy, please configure the proxy settings either in IDE or Gradle. Mar 08 23:41:44 interesting nick change Mar 08 23:42:14 Hi , What is the best possible way to create this view : http://imgur.com/mf8nu6Z The Red circled part , it is like a grid view with headings above it, Do i need to create multiple Gridviews or is it a custom view ? Mar 08 23:43:13 Currently what i am thinking is to make 3 recycler view with gridlayoutmanager , as my app has three categories as popular, trending & live , Mar 08 23:43:34 but wrap content is giving me a hard time with recycler view Mar 08 23:43:58 So i dont think my approach is closer to good approach Mar 09 00:02:30 Android studio is only shit shit google is shit Mar 09 00:43:37 hi DLSteve Mar 09 00:43:54 hi Mar 09 00:43:58 how u been Mar 09 00:46:53 alright Mar 09 00:47:23 DLSteve: can you recommend a book for beginner on writting an app that uses mysql? with examples Mar 09 00:47:31 there's so many books on android Mar 09 00:47:56 android apps shouldn't use mysql at all Mar 09 00:48:06 Leeds: my existing website uses mysql Mar 09 00:48:15 great, so your website uses mysql... Mar 09 00:48:34 i see most books use sql lite, can i connect to mysql with sql lite interface? Mar 09 00:48:53 sql is sql Mar 09 00:49:28 you don't use a server-side database from an app at all - you use an API Mar 09 00:49:56 Leeds: I use API function calls to access my remote mysql database? Mar 09 00:50:04 sqlite or even Realm would be for a local db on the device. Mar 09 00:50:10 ok Mar 09 00:50:16 cnnx: you make your own API for your own data Mar 09 00:50:31 Leeds: which book would get me started on this Mar 09 00:50:37 i realize its complicate dto write an app Mar 09 00:50:42 complicated Mar 09 00:50:59 i like oreilly books Mar 09 00:51:08 it's not that complicated... you make callable endpoints on your server, you call them from your app over HTTPS Mar 09 00:51:38 Leeds: the sql code is on my app instead of remote .php file on the server then? Mar 09 00:52:01 no! the SQL code is on the server, if you really must use PHP in 2016 Mar 09 00:52:32 Leeds: by doing it your way the sql statements would be inside the api? Mar 09 00:52:52 that question doesn't make sense Mar 09 00:52:56 sorry Mar 09 00:53:10 like mysql_query("select users from members"); Mar 09 00:53:13 something like that Mar 09 00:53:23 from my android-studio Mar 09 00:53:35 if you want a list of... let's say, the last 10 messages for a particular user... you call /messages.php?userid=XXXX&count=10 Mar 09 00:53:51 what you do on the server to get those 10 messages... that's nothing to do with your app Mar 09 00:54:07 so its php Mar 09 00:54:39 if you really must do PHP in 2016, yes Mar 09 00:54:42 there are better choices Mar 09 00:54:57 anyways i still would like a recommendation on a book that talks about UI,databases, and putting sample apps together with code Mar 09 00:55:09 MySQL does not work on Android/iOS you would need to make a web service API to query a remote DB. Mar 09 00:55:30 Might look into how to build a RESTful API. Mar 09 00:55:32 DLSteve: i ran a small app from a tutuiral online and it uses mysql Mar 09 00:55:36 it logs in and works Mar 09 00:55:41 just a login/regiser app Mar 09 00:55:45 argh Mar 09 00:55:46 MYSql does not exist in Android Mar 09 00:55:50 Only SQLite Mar 09 00:56:34 Hi , What is the best possible way to create this view : http://imgur.com/mf8nu6Z The Red circled part , it is like a grid view with headings above it, Do i need to create multiple Gridviews or is it a custom view ? Mar 09 00:57:06 i guess i'll choose a book myself Mar 09 00:57:12 I feel like you can do that a number of different ways chinu Mar 09 00:57:20 cnnx you dont need a book Mar 09 00:57:40 Plenty of online resources out there Mar 09 00:57:45 drose379 : Can i do this with recycler view , I want to use GridLayoutManager Mar 09 00:57:59 For just the text and button? Mar 09 00:58:16 its overhwealming all the classes and stuff, its not like html or php where you can follow a program logic, everything is just there on the left i dont know where it starts and what calls what Mar 09 00:58:17 Ohh Mar 09 00:58:25 I need like a heading , and below that the content as a grid Mar 09 00:58:30 sorry not sure chinu Mar 09 00:58:40 cnnx do you know OOP/ Mar 09 00:58:51 drose379: not much.. i always liked c instead of c++ Mar 09 00:58:59 For android you need to know OOP first Mar 09 00:59:02 drose379 : But you said there are many ways ? Mar 09 00:59:04 ok Mar 09 00:59:15 chinu, I thought you were talking about just the heading Mar 09 00:59:21 i remember classes, inheritances from college Mar 09 00:59:24 children, parents etc Mar 09 00:59:28 that stuff exists? Mar 09 00:59:34 Yeah Mar 09 00:59:37 Its java Mar 09 00:59:41 no, it's real coding, unlike php and html Mar 09 00:59:56 10 PRINT "HELLO WORLD" Mar 09 00:59:59 20 GOTO 10 Mar 09 01:00:00 thats coding Mar 09 01:00:19 or MOV AH,5H Mar 09 01:00:21 INT 21H Mar 09 01:00:23 thats coding Mar 09 01:00:25 funny, I was about to say that using PHP in 2016 is like using Basic Mar 09 01:00:38 there's logic Mar 09 01:00:47 i dont understand where it starts .. where's main() Mar 09 01:00:56 meh Mar 09 01:00:57 go RTFM Mar 09 01:01:03 give me a book Mar 09 01:01:04 i will Mar 09 01:01:22 http://developer.android.com/intl/pt-br/training/basics/firstapp/index.html Mar 09 01:01:29 ty Mar 09 01:01:37 Yep Mar 09 01:02:39 oh, please tell me that's actually in Portuguese? :) Mar 09 01:02:59 Not for me Mar 09 01:04:03 ah well, could have been quite funny Mar 09 01:04:20 Why? Mar 09 01:04:22 I'm going back to bed, y'all have fun Mar 09 01:05:29 drose379: because I think cnnx would have enough trouble with docs in English, that adding in a foreign language would completely flummox him Mar 09 01:06:06 Hahaha Mar 09 01:06:07 True Mar 09 01:06:12 See ya Leeds Mar 09 01:16:18 I am trying to downgrade my project from 6.0 to 5.1.1. Based on my reading in Android Studio you can change compileSdkVersion from 23 to 22 directly in editor or using Project Structure. But when I change compileSdkVersion to 22 I get errors related to dependency. I see there is dependencies section that I am not sure how to modify or find out what version I should update existing modules. Any one can help? Mar 09 01:16:57 I would imaging that Synch option would do this. But it is not. I have 6.0 and 5.1.1 SDK installed Mar 09 01:17:38 i suck at this :( Mar 09 01:17:40 lol Mar 09 01:19:10 Guma: open your file browser on your computer and go to SDK\extras\android\m2repository\com\android\support Mar 09 01:19:17 SDK being the directory where you have the sdk files Mar 09 01:19:25 you can find that from within AS Mar 09 01:20:44 Guma: open File > Settings. Then search for SDK. Select 'Android SDK' and the SDK location is in the box. Mar 09 01:22:13 maybe it's about using compileSdk 22 and support lib 23 Mar 09 01:22:33 ^ Mar 09 01:22:53 don't downgrade compileSdk Guma, downgrade targetSdk Mar 09 01:23:07 vigilancer: correct, he's worked that one out.. he's looking for the actual version numbers to use. Mar 09 01:23:33 missingno: good point Mar 09 01:25:55 actual version number for targetSdk is 22 :) Mar 09 01:26:15 Hello, how does one turn power on and off to a device powered via USB OTG? Mar 09 01:26:50 use case: I have a USB HID device (barcode scanner) that I would like to turn on when I am about to use it, and turn it off after I have used it. Mar 09 01:27:21 why Mar 09 01:27:50 missingno: save battery Mar 09 01:27:58 the scanner's battery? Mar 09 01:28:06 the android phones battery Mar 09 01:28:18 the scanner is connect to the android device and draws its power from the android device Mar 09 01:28:18 I don't think you can do this over usb hid, but most scanners have a serial mode with more commands available Mar 09 01:28:35 but that is a pain in the ass to use in Android and plus you probably won't find a power down command Mar 09 01:28:39 wyoung, there is no standard way to do it. You could cobble something together w/ a powered hub and a switch you also talk to over otg or something Mar 09 01:28:47 This scann does have a serial mode however I thought you required root to access it Mar 09 01:29:00 dragorn: needs to be portal Mar 09 01:29:03 portable* Mar 09 01:29:05 there's a way to access it wyoung Mar 09 01:29:08 you won't be able to issue raw hubctl commands even if you have a powerable hub Mar 09 01:29:14 wyoung, yeah, not going to work Mar 09 01:29:33 dragorn: so there is no USB OTG standard for Android? Mar 09 01:29:46 wyoung, there's no otg standard for controlling power afaik Mar 09 01:29:54 :( Mar 09 01:30:12 and you can't access raw bus commands from non-root android even if you used a power-control enabled hub (of which there are very few) Mar 09 01:30:19 dragorn: ok, what about sending commands over a serial link? Mar 09 01:30:30 hmmmm ok Mar 09 01:30:31 if it's grabbed by a kernel driver you won't be able toa ccess it Mar 09 01:30:45 if it isn't, then you could implement a userspace driver for whatever the serial chip in the reader is Mar 09 01:30:49 I would need to roll my own Android? Mar 09 01:31:14 implementing a userspace drive requires root? Mar 09 01:31:18 driver* Mar 09 01:31:19 I don't think it gets grabbed by the kernel Mar 09 01:31:24 no Mar 09 01:31:29 so userspace driver without root is feasible Mar 09 01:31:42 It is picked up as a HID device atm (a keyboard) but I can change the mode of it Mar 09 01:31:42 userspace driver does not require root. Which is why I said "if it isn't grabbed by root, then you could implement a userspace driver" Mar 09 01:31:57 dragorn: I see Mar 09 01:32:05 I would like more details about this :) you have a link? Mar 09 01:32:26 how to setup userspace drivers on Android, in particular, for a barcode scanner Mar 09 01:33:17 there's no "how to set up". You'll have to get the chipset docs and write it. Or port it from something like the BSD kernel. Mar 09 01:33:45 there may be public cdc-acm drivers but you'd have to check the license, and determine what serial chipset is inside the device in the first place Mar 09 01:36:31 ^ pain in the ass Mar 09 01:41:28 Hey, I want to store some data in a SQLite DB, and the data needs to be put in a ListView on application initialization. I know how to do those two, but when I try and grab the data from the SQL database in my main activity's onStart method, no data is returned, however when I fetch the data on a button press, it gets returned, presumably because the SQL database has to load. What am I doing wrong? Mar 09 01:41:45 does rx java have anything to do with react native? Mar 09 01:43:28 no Mar 09 01:47:32 thomasross: you need to use a CursorLoader and CursorAdapter (or your own implementations thereof) to use the database with a ListView Mar 09 01:48:38 RustyShackleford: rxjava is from Microsoft, sorta, and react-native is from facebook Mar 09 01:48:50 rager: Right now I'm just trying to log each row that gets returned Mar 09 01:49:36 the weird part in this story thomasross is that you sound like you are querying on the main thread Mar 09 01:49:53 not that it would solve your direct issue, but your app will be faster if you don't Mar 09 01:50:02 yeah, I am. Mar 09 01:50:22 alright, should I do that _now_ or after I fix this issue? Mar 09 01:50:58 actually, would using a cursorloader do that for me? Mar 09 01:51:09 that's what I think from looking at the docs... Mar 09 01:51:44 you have to open your db somewhere, and I assume it is somehow happening after your activity onstart Mar 09 01:52:13 oh wait... Mar 09 01:52:28 cursorloaders require creating your own ContentProvider Mar 09 01:52:38 gotta just make a Loader instead of a CursorLoader Mar 09 01:52:47 missingno: right now I am creating my SQLiteOpenHelper derivative in onCreate, and querying the database in onResume (with getReadableDatabase()) Mar 09 01:53:00 or if you please, a Loader> Mar 09 01:53:19 who puts rows in the database Mar 09 01:53:26 thomasross: in either case, you should be doing all the actual DB stuff inside a Loader, not in your Activity directly Mar 09 01:53:37 db on main thread is doubleplus ungood Mar 09 01:54:32 main activity: http://hastebin.com/udinucilus.java TeamsOpenHelper: http://hastebin.com/sacucureke.java Mar 09 01:55:17 * thomasross reads about loaders Mar 09 01:57:52 rager: So should I create the SQLiteOpenHelper in onCreateLoader() ? Mar 09 01:58:21 no Mar 09 01:58:28 that is where you trigger the loader Mar 09 01:58:44 onCreateLoader() returns a Loader Mar 09 01:59:22 see this page: http://developer.android.com/reference/android/content/AsyncTaskLoader.html Mar 09 02:00:15 and in said loader, you override loadInBackground and do your thing, then onLoadFinished in your activity (when you implement the interface) will get the results from the background thread Mar 09 02:00:35 it's pretty boilerplatey Mar 09 02:01:09 I have MainActivity window. This is the only Activity I have. Some how I have Arrow button in top left corner like usually you could go back. Not sure how to turn this off and where? What property needs to be set or turned off. Mar 09 02:01:44 should I be reading this? https://developer.android.com/guide/components/loaders.html#app Mar 09 02:02:24 thomasross: sure, but also see AsyncTaskLoader Mar 09 02:02:49 it's a basic loader that will work for getting your stuff out of the DB if you don't already have a ContentProvider for the uri resolving Mar 09 02:04:33 thomasross: you do all your DB stuff in loadInBackground Mar 09 02:04:44 rager: so specifically what I should be looking at is AppListLoader right? Mar 09 02:05:02 and you can have the thing either return a Cursor for using a CursorAdapter or return a list of domain objects from unpacking them out of the Cursor Mar 09 02:05:19 yes, AppListLoader Mar 09 02:05:53 So I have to create a class that extends AsyncTaskLoader? Mar 09 02:10:57 Okay, I _think_ I made my DatabaseLoader right: http://hastebin.com/qopafekoye.java Mar 09 02:11:26 or should teamsDatabase be constructed in loadInBackground()? Mar 09 02:12:05 <_xor> Hey guys, is there an on-device method to inspect network calls that a runtime app makes? Mar 09 02:12:22 and then I need a CursorAdapter to call the loader right? Mar 09 02:12:24 <_xor> Basically, I'm writing a prototype/demo app for a company. I have their current app and it calls a system they host for content. Mar 09 02:12:24 charles proxy is pretty good Mar 09 02:12:24 rager: ^ Mar 09 02:12:42 <_xor> wabz: Cool, just Googled it. Checking it out now :) Mar 09 02:12:47 thomasross: look at the Loaders page Mar 09 02:13:09 rager: the reference or the guide? Mar 09 02:13:13 the guide Mar 09 02:13:14 <_xor> wabz: Ah ok, I see, this is a desktop app. So I would run the app within the simulator & then run this thing to watch traffic? Mar 09 02:13:20 the loaderS one Mar 09 02:13:29 yep, there Mar 09 02:13:38 see the method onLoadFinished ? Mar 09 02:13:44 yep Mar 09 02:13:48 https://developer.android.com/reference/android/app/LoaderManager.LoaderCallbacks.html#onLoadFinished(android.content.Loader, D) Mar 09 02:13:58 that's where you hand off the cursor to your adapter Mar 09 02:14:00 _xor: it can also just run as a proxy, so you can set proxy settings on your device. It gives you a root cert to install on device too so you can see https traffic too Mar 09 02:14:07 ah, I see Mar 09 02:14:22 _xor: https://www.charlesproxy.com/documentation/proxying/ssl-proxying/ Mar 09 02:14:35 usually, I just have the Activity extend LoaderManager.LoaderCallbacks if I'm using cursors Mar 09 02:15:47 rager: wait, so I did have to make that DatabaseLoader class right? Mar 09 02:15:56 <_xor> wabz: Oh that's pretty sweet :) Mar 09 02:15:58 yes Mar 09 02:16:02 okay good lol Mar 09 02:16:03 the loader is what does all the DB stuff Mar 09 02:16:17 the LoaderManager.LoaderCallbacks is what handles loader events Mar 09 02:16:37 (make the loader, use the loader's output, reset the loader)\ Mar 09 02:17:18 so in onCreateLoader i need to return a new DatabaseLoader? Mar 09 02:19:45 okay I think I did it Mar 09 02:22:44 rager: alright, it seems onLoadFinished isn't getting called... Mar 09 02:25:15 whats the best way to get started on app development Mar 09 02:27:40 django_ find a topic that interests you, write app about it Mar 09 02:27:54 hi! I need help. Mar 09 02:28:05 ;) Mar 09 02:28:13 hi, what's your question? Mar 09 02:28:22 in intersticials on admob Mar 09 02:28:50 onAdLoad is called when an ad is ok to be shown? Mar 09 02:28:57 Im getting blank ads Mar 09 02:29:12 is it worth it to put ads in your app? Mar 09 02:29:17 the best kinds of ads are blank :D Mar 09 02:29:25 something related to no fill Mar 09 02:29:40 I thought the days of making easy money on ad revenue were over Mar 09 02:29:51 RustyShackleford: why are they? Mar 09 02:29:54 lol Mar 09 02:30:00 not worth it unless you have lots of installs Mar 09 02:30:04 well not if your app gets a ton of views Mar 09 02:30:21 a facebook caliber app would make lots in ad revenue Mar 09 02:30:25 IAP all the way! selling virtual gems that don't exist... Mar 09 02:30:40 Leeds, xD Mar 09 02:30:46 I just want an app in the Play Store because its a goal Mar 09 02:30:59 I'll be a real android dev when that happens Mar 09 02:31:12 easy Mar 09 02:31:18 RustyShackford, I need to eat xD Mar 09 02:31:31 so get a job that you despise like me Mar 09 02:31:41 open intellij->new project->android->hello world activity->do the stuff to publish it Mar 09 02:32:04 setting my sights a little higher haha Mar 09 02:32:05 back to the subject Mar 09 02:32:08 thomasross: are you making sure to force the loader to start? Mar 09 02:32:14 AsyncTaskLoader needs to be forced Mar 09 02:32:23 can anyone help me? Mar 09 02:32:30 rager: how do I do that? Mar 09 02:32:32 g00s: my boss is alive! meeting him tomorrow, expect to be looking for work - possibly full-time, possibly part-time - by lunchtime Mar 09 02:33:19 Leeds he's some kind of international man of mystery Mar 09 02:33:21 dragorn: ok so I write the driver in C? Mar 09 02:33:32 dragorn: is there a userspace driver howto for Android? Mar 09 02:34:10 Leeds android work ? Mar 09 02:34:19 Leeds do you still do android :D Mar 09 02:34:33 g00s: well, I knew he was back in HK this week, partly because he told me a couple of weeks ago that he would be - but plans change! - and partly because I get some of his mail sent to semi-abandoned domains, and I got an email for him saying he'd signed into yahoo mail on a new device in HK :) Mar 09 02:34:47 rager: looking through the example (AppListFragment) i've done everything that looks relavent Mar 09 02:34:51 (sp?) Mar 09 02:35:27 I haven't really done much of anything apart from a bit of HTML/CSS for months now... Mar 09 02:38:30 Leeds what are you working on to stay up to date ? Mar 09 02:38:49 nothing, rusted-up, out-of-date Mar 09 02:39:32 Leeds what would you like to do next ? Mar 09 02:39:55 too much competition for web stuff i think Mar 09 02:40:42 beside your unspoken desire to be a bacon farmer :) Mar 09 02:41:01 different answers to that... in some ways, I'd like to keep on with the existing boss, part-time - partly just because I like the idea of not worrying about paying rent... I do get approached fairly often by people asking if I'm available for work Mar 09 02:41:16 how in-demand is android development? Mar 09 02:41:38 android or web stuff, not all that fussed... I need to be working with some other developers, though, had enough of sitting by myself in front of a screen all day Mar 09 02:41:51 I'd probably have more job oppurtunites if I learned more about web stuff Mar 09 02:41:58 g00s: http://www.imdb.com/title/tt0104710/ Mar 09 02:42:29 <_xor> Is there a good crash course for auto layout? Mar 09 02:42:31 lol Mar 09 02:42:43 <_xor> I've been doing everything programmatically using SnapKit, which I like, but Launch Screens can only use Auto Layout. Mar 09 02:42:46 a classic of the Yorkshire Jewish pig farmer genre :D Mar 09 02:43:18 _xor you in the right channel ? Mar 09 02:44:40 <_xor> Hahaha, no. I just noticed. Mar 09 02:44:47 <_xor> Thanks for pointing it out :) Mar 09 02:45:10 oh. I just have to add .forceLoad(); lol Mar 09 02:46:03 Leeds this was from the other day https://news.ycombinator.com/item?id=11237384 Mar 09 02:46:30 i get the impression this is pretty specialized though Mar 09 02:46:42 g00s: I've started to feel that HN is pretty disconnected from the actual real world of work, particularly outside SV Mar 09 02:47:17 Leeds yeah, that pretty much describes SV itself ;) Mar 09 02:47:41 did you see the article about the google employee who lived in a truck in their parking lot? Mar 09 02:47:50 yeah Mar 09 02:48:09 probably not anymore since the article went viral Mar 09 02:49:09 rager: Okay, now onLoadFinished gets called, but there is nothing in the cursor. Mar 09 02:49:31 that could be fun for a while. I would have decked out my truck a little better Mar 09 02:49:36 nah, people have always done that Mar 09 02:50:11 loaded rv Mar 09 02:51:01 the inside of his truck was just like a bed and some clothes on hangers Mar 09 02:51:26 you could do so much better with a cheap box truck Mar 09 02:56:16 unfortunately, one thing that the past couple of years has left me quite unprepared for... I don't particularly want a situation where someone expects me to be at a 'desk', wearing 'clothes', before say 10am Mar 09 02:57:50 hah that reminds me Mar 09 02:58:17 dialed into a meeting at 730 this morning. Nature called about 10 mins into it Mar 09 02:58:25 so I made the bathroom my office rofl Mar 09 02:58:55 don't forget to mute! Mar 09 02:59:06 definitely double checked Mar 09 02:59:20 but I had a grin on my face the whole time. They had no idea lol **** ENDING LOGGING AT Wed Mar 09 02:59:58 2016