**** BEGIN LOGGING AT Fri Apr 15 02:59:58 2016 Apr 15 03:15:02 slow night Apr 15 03:18:25 I have a main activity, which is divided into the actionbar on top and blank space underneath. I want the blank space to be a fragmentlayout, so i can switch fragments there. What would be the best way? Somehow i cant manage to make it work... Apr 15 03:19:52 sponge-tmp: what part Apr 15 03:22:30 orbyt_: just a second Apr 15 03:23:14 sup orbyt_ Apr 15 03:23:26 o7 Apr 15 03:23:32 Haha I like that Apr 15 03:23:36 o7 Apr 15 03:23:38 Hows it goin? Apr 15 03:24:02 Rewriting an app atm. Apr 15 03:24:21 Why re-writing? Apr 15 03:24:34 Cause I was considering doing that too Apr 15 03:24:58 Cuz the first version was buggy and it'd take longer to refactor everything. Apr 15 03:25:06 I see Apr 15 03:25:09 Im trying out some mvp right now Apr 15 03:25:12 Liking it so far Apr 15 03:25:14 Seems clean Apr 15 03:25:28 orbyt_: ok so far, i have a main, where in the oncreate i create the toolbar, and it works. I have a fragment.xml and a fragment.java which returns a view. Apr 15 03:25:46 What^? Apr 15 03:26:53 sponge-tmp: all you need is a container layout and swap fragments out via FragmentManager Apr 15 03:28:45 my main activity uses this .xml file: http://pastebin.com/09Fkf247 Apr 15 03:29:20 there is the container layout with the id fragment_container. is that correct so far ? Apr 15 03:29:26 orbyt_: ^ Apr 15 03:29:34 yes Apr 15 03:32:46 orbyt_: ok and then here is my main, but the commented part does not work: http://pastebin.com/76Paj4FL Do you have an idea why ? Apr 15 03:35:08 sponge-tmp: what happens if you add a tag at the end? Add another parameter at the end of .add(id, fragment, "text"); Apr 15 03:36:29 sponge-tmp: Actually, you should probably be using getSupportFragmentManager because i bet your using support fragments Apr 15 03:36:43 post your fragment class with the imports Apr 15 03:37:23 btw it should tell you this before compiling Apr 15 03:37:30 when adding a tag, it say: Wrong 2nd argument type. Found: 'altitech.actionbar.MainFragment', required: 'android.app.Fragment' Apr 15 03:37:38 sec, i will paste it Apr 15 03:38:32 orbyt_: here is the MainFragment.java http://pastebin.com/tt12ahBh Apr 15 03:39:14 sponge-tmp: Try using supportFragmentManager Apr 15 03:39:21 you're mixing support and framework fragments, stop it Apr 15 03:39:52 ok i fixing it with supportFragmentManager did the job Apr 15 03:40:11 good. Apr 15 03:41:59 orbyt_: yep, works! thx, 10/10 would ask again for help Apr 15 04:10:11 interesting. so this AS hang I keep seeing - seems to be related to instant run. once i disabled that, AS no longer permanently hangs on machine wake-up Apr 15 04:15:03 getting bored of my train prediction app Apr 15 04:15:12 this always happens once I get the interesting parts done Apr 15 04:15:48 now I need to clean up a few bugs, write tests that I didn't write before, find all the ways the app might crash and fix those Apr 15 04:21:39 RustyShackleford yeah i get bored with stuff quick too Apr 15 04:22:23 pretty happy with how it turned out and what it taught me Apr 15 04:22:29 now I want something more exciting Apr 15 04:25:14 Hi.. how does an app present users to login to their google account and can upload data to google drive? Apr 15 04:26:07 goals would be to learn more about UI design Apr 15 04:26:20 work with a more complex web service (make it myself maybe) Apr 15 04:26:40 and do something useful and unique. Too bad I don't have much free time to do this lol Apr 15 04:26:55 RustyShackleford only advice i can give, is balance theory with practice Apr 15 04:27:10 learn stuff that won't be out of date 10 years from now Apr 15 04:27:25 3 years for that matter ;) Apr 15 04:27:28 I might want to roll my own web service Apr 15 04:27:38 it would be good practice Apr 15 04:27:48 and its marketable if I decide i've had enough with android Apr 15 04:27:59 its not hard, but locking it down so it isn't hacked is something else Apr 15 04:28:35 RustyShackleford did you see that google SRE book that came out a few days ago ? Apr 15 04:28:39 you may like that too Apr 15 04:28:46 nope. I'll look it up Apr 15 04:28:59 free online i think Apr 15 04:29:02 really its sad how long android development takes. Maybe I'm just slow Apr 15 04:29:34 https://landing.google.com/sre/book.html Apr 15 04:29:51 compare that with compare it to like ruby on rails, where you can bang out a working app in an afternoon Apr 15 04:30:45 is there any faster way to use google maps, without registrating for api key etc ? is there any other solution for maps ? Apr 15 04:31:28 you're gonna need an api key hah Apr 15 04:31:34 thats the whole point Apr 15 04:33:52 RustyShackleford: so, is there a better way than to hardcode API key in code? Apr 15 04:35:03 here's how I did it Apr 15 04:35:22 create a file res/values/keys.xml Apr 15 04:35:34 add this file to your .gitignore Apr 15 04:35:37 I think google wants map provider to know how many users are using maps with a particular provided, and hence i guess they designed it like that: Apr 15 04:36:11 and then you have a string resource called api_key or something Apr 15 04:36:26 access this in your app with getString(R.id.api_key) Apr 15 04:36:44 hmm.. nice idea! Apr 15 04:36:54 I suppose if you keep your code somewhere private, you can keep keys.xml in source control Apr 15 04:38:34 hey, i am still working with eclipse, i see lots of projects are in gradle in github with a different structure. Apr 15 04:38:57 is there some tool to directly convert them into eclipse project? Apr 15 04:39:19 i am sure i am missing something here, please help Apr 15 04:45:21 just copy your code over I think Apr 15 04:45:34 back when I transitioned, importing projects didn't go very smoothly Apr 15 04:45:59 so... what's my next side project? Apr 15 04:46:14 pranav I strongly suggest switching to Android Studio Apr 15 04:46:44 h, i have a mix of fragments and views to put in a viewpager :/ what now ... Apr 15 04:49:36 Ok Apr 15 04:49:54 g00s: inflate the views inside a fragment Apr 15 04:50:32 I'm not sure if its a different viewpager for fragments Apr 15 04:52:23 where can i find good UI design samples :( Apr 15 04:53:26 pranav you can watch the material design presentations / talks from google :D Apr 15 04:53:59 implementation is left as exercise of reader though ;) Apr 15 04:54:48 ripping off code from good examples is an excellent strategy Apr 15 04:54:56 too bad they're difficult to design Apr 15 04:55:33 yes Apr 15 04:55:38 haha Apr 15 04:55:55 harder than coding most of the times :/ Apr 15 04:56:51 ah VS Code @ 1.0 - pretty damn good editor IMHO Apr 15 04:57:01 i think Google should create an Android plugin for it Apr 15 04:57:09 for those of us not impressed with AS Apr 15 04:57:36 just the basics; autocomplete, build, etc Apr 15 05:04:31 generally i make all my different screen an activity, is it a good practice. when should i use fragment ? Apr 15 05:06:05 pranav: latest android studio update puts activity template a bit different Apr 15 05:06:51 activity_main.xml, content_main.xml Apr 15 05:07:44 hmm... Apr 15 05:08:15 http://vpaste.net/lFo5a Apr 15 05:08:19 this is activity Apr 15 05:08:35 and content is your stuff Apr 15 05:17:01 anyone in the mood to shit all over someone's hard work and effort? Apr 15 05:17:50 http://imgur.com/USYYEQO <-- brutal opinions Apr 15 05:21:19 i.. disagree Apr 15 05:21:31 Ping_2_Ur_Pong: where exactly is 50° Apr 15 05:21:41 who uses F these days Apr 15 05:21:43 Ping_2_Ur_Pong, the color and theme is rather ugly Apr 15 05:22:08 and who uses floating point for temperatures Apr 15 05:22:25 there's not enough precision in measurement Apr 15 05:22:34 especially from one area to the next Apr 15 05:23:02 you could somehow mark where is 'current' Apr 15 05:23:28 you don't like the colors? :( Apr 15 05:23:36 of course no Apr 15 05:23:36 yea float is shit, me changes Apr 15 05:24:24 chart graphic looks nice, the scale doesn't Apr 15 05:24:58 hmm... Apr 15 05:25:06 * Ping_2_Ur_Pong nods Apr 15 05:25:41 i'd just start over Apr 15 05:26:25 * Ping_2_Ur_Pong loves the internet Apr 15 05:26:26 grid system is messed up, chartjunk Apr 15 05:26:48 why is toolbar icon different color than text ? they should both be white Apr 15 05:27:50 too much contrast, large bright areas, large dark areas Apr 15 05:28:20 wasted space on the bottom, etc Apr 15 05:28:34 yeah definitely a do over :D Apr 15 05:29:34 :) Apr 15 05:30:05 red|blue Apr 15 05:30:17 69|39 — is not clear what the fuck that is Apr 15 05:30:28 is it Celsius|Far.? Apr 15 05:30:45 why first one is red and second blue :-) Apr 15 05:30:53 only questions Apr 15 05:30:56 high / low Apr 15 05:31:03 day/night Apr 15 05:31:22 fire/ice Apr 15 05:31:23 though, the question of should I add the symbol has been in my mind. Apr 15 05:31:34 fire ice yeah Apr 15 05:31:34 ping|pong Apr 15 05:31:40 :) Apr 15 05:32:50 of course you just randomly pasted available chart library Apr 15 05:32:52 but Apr 15 05:33:08 if you ever consider doing axis labels yourself Apr 15 05:33:19 don't just put 100° on top Apr 15 05:33:21 :) Apr 15 05:33:38 but 0° at center may be okey Apr 15 05:35:53 for days use android Cards Apr 15 05:35:55 https://www.google.com/design/spec/components/cards.html Apr 15 05:36:12 shadows, corners Apr 15 05:36:50 pay attention to margin between them too Apr 15 05:38:01 Ping_2_Ur_Pong: we'll wait your feedback with all the fixes Apr 15 05:38:03 :) Apr 15 05:58:38 I have a BaseAdapter with an ArrayList of Objects. If I change a field within one of the objects and call notifyDatasetChanged my View is not updated. Is this a bug or works as designed? Apr 15 06:10:04 are you modifying the correct list? can always paste your adapter code Apr 15 06:16:58 This is my adapter: https://gist.github.com/anonymous/72ee785d8ec5033e3c5ad9955327fc0b Apr 15 06:18:31 canvs2321- Apr 15 06:22:32 can you show the code where you are modifying your list and notifying the adapter Apr 15 06:22:59 and what isn't being updated, the icon, caption, all of it? Apr 15 06:25:45 It's a button that has an icon and a caption. Apr 15 06:26:27 In the Activity I call MyAdapter#notifyDatasetChanged Apr 15 06:26:34 morning Apr 15 06:27:54 In the Activity I initialize the adapter as follows: MyAdapter myAdapter = new MyAdapter(this, myObject.getItems(), R.layout.buttons); Apr 15 06:28:11 And then I modify the items in myObject Apr 15 06:28:43 barq, what does myObject.getItems() return? and how are you modifying the list afterwards Apr 15 06:29:40 myObject .getItems() returns List Apr 15 06:30:12 i mean does it create a new list and return it, or do you have on copy in myObject and you are passing that? Apr 15 06:30:20 one copy* Apr 15 06:33:14 I manipulate the List Apr 15 06:34:04 https://gist.github.com/anonymous/74204428fdfdd54a7f5b889316d3d7a5 Apr 15 06:34:21 And then call notifyDatasetChanged Apr 15 06:35:07 im just guessing that multiple list maybe getting created and if new objects are added to only one, then the list passed to the constructor is a list of objects from getItems in your myObject and the list passed in the adapter constructor isn't being updated with new items, it has only the old objects from creation Apr 15 06:35:35 The strange thing is that it works in some cases and doesn't in others. Apr 15 06:35:50 So I am guessing it is a problem with the implementation of notifyDatasetChanged Apr 15 06:35:50 if that is how you are manipulating the list, and if myObject.getItems() isn't returning mObjects it just loops it, then it would only pass that intial list of objects Apr 15 06:36:13 the constructor you should just pass myObject.mObjects Apr 15 06:36:41 I am doing that by passing getItems() Apr 15 06:37:25 is getItems just List<...> getItems(){ return mObjects;}? Apr 15 06:38:37 Yes. Apr 15 06:38:53 ah k, sorry then, i'm pretty tired, haha Apr 15 06:39:44 I have an ExpandableListView with CheckBoxes. If one or more CheckBoxes are selected I want the button to be activated, otherwise deactivated. So I have two groups with two childs each. If I Enable a CheckBox in one group it enables the button and disables it if I uncheck the CheckBox. The same works for the other group. Apr 15 06:40:24 The strange thing is that if I keep a CheckBox ticked in one group and switch to the other I ticking the CheckBoxes in that group no longer has any effect on the button. Apr 15 06:40:55 If I debug, I can see that the Adapter correctly changes the enabled state, but for some reason notifyDatasetChanged does not refresh the View. Apr 15 06:42:15 how many items are in your list? as you have it, if convertView == null, you set your onClickListener to the lItem.getItent, once the views start getting recycled they will stay with those older first set onClickListeners Apr 15 06:42:43 you should add an else { and setyourclicklistener} Apr 15 06:43:08 There are 10-12 buttons but in this case I am setting all but two invisible. Apr 15 06:43:31 but if your views are recycled they will have the invalid click listener Apr 15 06:43:52 you aren't doing the if convertView !=null setClickListener(lItem.getIntent()); Apr 15 06:44:37 What should I do in the else? Apr 15 06:44:39 again, i'm tired, i'm sure i'm following haha, i'm making it difficult for myself Apr 15 06:45:39 i got stuck on the checkboxes and saw the click listener, but that has 0 to do with the checkboxes. sorry for wasting your time Apr 15 06:46:13 I don't think the CheckBoxes are the problem, because I've debugged up to the adapter and saw that the List is updated correctly. Apr 15 06:46:30 It is just very strange the button only changes its enabled state in certain cases and not in others Apr 15 06:46:58 For some reason notifyDatasetChanged is not triggering the refresh properly Apr 15 06:47:14 I don't know exactly where the redrawing happens Apr 15 06:47:40 I stepped through the framework code and only saw a requestLayout somewhere in the onChanged the notifyDatasetChanged triggers. Apr 15 06:49:18 In AdapterDataSetObserver#onChanged there is a requestLayout Apr 15 07:13:46 The problem is that getView never gets called in one case. Apr 15 07:45:31 How can I set breakpoints in framework code? Apr 15 07:46:31 onSaveInstantState doesnt work in fragment ? Apr 15 07:49:03 It does. Apr 15 07:54:05 hmm Apr 15 07:54:15 no idea why my fields arent filled with text then Apr 15 07:54:35 Paste your code. Apr 15 07:55:30 no biggie Apr 15 07:55:31 http://pastebin.com/Fwd0jqk8 Apr 15 08:21:20 pfn, dexmaxheap seems to have no effect Apr 15 08:21:34 but I'm too busy to try more things Apr 15 08:23:20 boolean layoutRequested = mLayoutRequested && !mStopped is false in ViewRootImpl#performTraversals():1269 in one case but not the other when I do notifyDatasetChanged S: Apr 15 08:58:59 may I ask about android shell scripting here Apr 15 09:01:49 i permit Apr 15 09:07:24 like nromal shell scripting ? Apr 15 09:22:34 I have an "log" issue with Choreographer and skipped frames. It happens occasionally during data preparation (which takes few seconds) Apr 15 09:22:34 In main thread of activity I create design, with progress bar, than start two threads - one for data preparation, second for updating progress bar (sleep for 200ms). Apr 15 09:22:34 I was trying to disable some extensive candidates picked by time when Choreographer complained, but it complained lately somewhere else. Apr 15 09:22:34 Now I have done profiling and caught it with skipped frames. I am looking for Main activity thread - and its most extensive task, but without any success so far. Any better way how to search for cause? Apr 15 09:24:49 hi there Apr 15 09:46:38 hi guys Apr 15 09:47:40 I would automatically paste some text from clipboard to the focused edittext of another app... is this possible? Apr 15 09:48:10 or better... is there a way to send the equivalent of crtl+v Apr 15 09:48:19 ? Apr 15 09:54:28 I'd say not possible Apr 15 09:58:22 hello Apr 15 09:58:33 I keep get cursorWindow is full Apr 15 09:58:45 and also cursorWindow create failed Apr 15 09:58:54 is it because I am doing too much database queries? Apr 15 10:00:37 hey guys! Apr 15 10:01:20 do you preferr custom toolbar or just use the Toolbar widget? Apr 15 10:01:38 the thing is.. i would beed some changin text in the header (action bar) Apr 15 10:14:32 nobody here? Apr 15 10:19:39 how safe it is to go with Buck? Apr 15 10:20:45 sasos90: set your toolbar to actionBar, and then change title for actionBar Apr 15 10:21:19 oh. can i also do a bit of styling there or not actually? Apr 15 10:21:19 your toolbar == Toolbar widget Apr 15 10:21:43 depends on what kind of styling Apr 15 10:21:57 i mean.. on the left side of the text i need the button.. ok the structure: BUTTON TEXT (dynamic) BUTTON BUTTON Apr 15 10:22:24 is it possible to do it with only main_menu.xml ? Apr 15 10:22:45 left part is custom, right part filled when onCreteMenu fires up Apr 15 10:22:49 not sure Apr 15 10:22:54 just use Toolbar Apr 15 10:23:13 i am using toolbar yes... in any case.. but one can be custom and one not.. or am i wrong? Apr 15 10:23:52 oh no.. i am using the relativelayout actually for custom things yes Apr 15 10:24:00 isn't Toolbar just ViewGroup? you can create own Apr 15 10:24:15 sasos90: http://stackoverflow.com/questions/26533510/android-toolbar-center-title-and-custom-font Apr 15 10:24:26 hm.. let me see Apr 15 10:24:57 it looks fine i think yes Apr 15 10:25:03 i will try it.. Apr 15 10:25:05 thanks! Apr 15 10:25:10 np Apr 15 10:25:20 guys, anyone using Buck? Apr 15 10:27:05 what's that Apr 15 10:27:24 https://buckbuild.com Apr 15 10:29:31 > Buck is a build system developed and used by Facebook Apr 15 10:29:39 like Facebook is synonym for quality Apr 15 10:32:08 it may be not, but FB got some smart engineers working over there Apr 15 10:32:24 Unless you have a really good reason for switching, don't bother Apr 15 10:33:02 I'm sure facebook do all kinds of crazy things that make buck worth it.. For your average app, probably not so much Apr 15 10:33:18 I agree with that :) Apr 15 10:45:43 link the adb dev binary Apr 15 11:04:14 it's not about quality. buck uses some clever trick to make builds super fast Apr 15 11:04:21 *tricks Apr 15 11:06:26 I'm still searching way out from gradle Apr 15 11:07:39 right now not sure will it be buck or bazel. facebook tends to close things like that Apr 15 11:08:42 bazel will be in beta at least next year Apr 15 11:08:56 and both do not support kotlin out-of-box Apr 15 11:10:34 main issue with gradle is build time Apr 15 11:11:52 trick may be only one Apr 15 11:12:06 track changes and re-compile what was changed Apr 15 11:13:48 hey Apr 15 11:14:15 could use a hint .. I have some background async tasks uploading videos to an api, but the customer has a bad internet connection Apr 15 11:14:41 is there some way to notify that the internet connection went down? his wifi is still up but connectivity is gone Apr 15 11:15:06 I saw this using testfairy .. he kept saying that it does not work for him Apr 15 11:16:58 wouldn't you async task fail with an error? (giving indication of failure?) Apr 15 11:17:33 squ: fast dex merging, nailgun, exopackage. and watchman to track changes Apr 15 11:19:18 AlexandruM: http://stackoverflow.com/a/22256277/4594990 Apr 15 11:19:52 ping is a good way to check connectivity Apr 15 11:20:05 Would anyone have any words of wisdom on creating this interface? http://imgur.com/fbWT9Fx . When the user clicks anywhere on the screen, the next sentence will move up to where the first is (inside the box) and the first will move up off the screen(so a kind of scrolling). Apr 15 11:20:18 This will be used for loading in large amount of plain text(converted ebooks). Apr 15 11:20:19 I have a few ideas but I think i'm over complicating it. Apr 15 11:20:19 list/recycler view - a textview in each line and on each “press” insert a new line at the bottom and remove the first one. Apr 15 11:20:20 Grid view of textviews? Apr 15 11:20:22 Custom layout? Apr 15 11:20:24 Scrollable textview - need to be able to get the location of the first sentence such that I can draw a wee box around it. Apr 15 11:21:04 vigilancer : yup .. found that too Apr 15 11:21:20 AlexandruM: i'm using it, it's ok Apr 15 11:21:23 AlexandruM ping isn't working? Apr 15 11:21:24 thing is if the internet goes down, I need to suspend the threads Apr 15 11:21:33 and when it comes back up resume them Apr 15 11:21:44 maybe I should implement a sleep method in the asynctasks ? Apr 15 11:21:45 AlexandruM: don't use AsyncTaks Apr 15 11:21:47 Isn't there a background service for this use-case? Apr 15 11:22:02 I don;t know to be honest .. Apr 15 11:22:02 I.e Async task shouldn't be used in this usecase :) Apr 15 11:22:40 there's a good section on this in the udacity intermediate course :) Apr 15 11:24:35 I'll look that up Apr 15 11:24:36 thanks Apr 15 11:25:23 it's in one of the later sections :) Apr 15 11:31:32 AlexandruM: https://www.youtube.com/watch?v=uzboHWX3Kvc Apr 15 11:52:55 Will you link to the dev build adb linux bin? Apr 15 11:58:11 Leeds: ^ Apr 15 12:00:48 The meta control is installed. Apr 15 12:01:53 google only turned up links to the prod. bin Apr 15 12:03:46 It doesnt allow port forwarding so I can use my keyboard. Apr 15 12:07:02 link to the dev bynarie Apr 15 12:08:09 once I can port forward I can have the packs install. Apr 15 12:12:52 I override Application and do setup stuff in onCreate, how do I either Mock that or actually get that to run so that I can test my app. Without the setup done in Application, 90% of what the app does won't work. Apr 15 12:14:47 any push in the direction I should be looking would be great. The one thing is for pretty much all my tests that setup logic has to happen. Apr 15 12:17:59 I have a button that only changes its drawn state when I touch the screen. Any ideas why this can happen or how to fix this? Apr 15 12:18:33 do you override button or are you using the default? Apr 15 12:19:25 It's a custom View Apr 15 12:19:35 invalidate Apr 15 12:19:45 are you using selector background Apr 15 12:21:09 calling invalidate makes no difference, I still need to touch the screen Apr 15 12:22:03 It's a GridView that contains a number of items Apr 15 12:24:05 bet ya there is something wonky with your adapter, but try invalidateViews() Apr 15 12:25:58 Zharf, weird... Apr 15 12:28:50 Where do you call invalidateViews Apr 15 12:41:26 getView only get called when I touch the screen Apr 15 12:41:34 And that's where the enabled background is drawn Apr 15 12:41:58 In other cases getView is called immediately when clicking the checkbox Apr 15 12:46:12 can i create a link inside my webiew to open a share dialog of android? Apr 15 12:48:18 Hello Apr 15 12:48:35 I have problem guys, can someone help me please? Apr 15 12:50:18 ask, don't ask to ask Apr 15 12:50:52 okok Apr 15 12:51:05 so I have google nexus 7 tablet Apr 15 12:51:37 and it started doing this: it is booting, I can see google logo...but it never boots Apr 15 12:52:18 when I press power off, it shut downs tablet but than it starts again without even pressing it Apr 15 12:53:10 I wanted to flash new android..but I think I cant do it..because I have to enable usb debugging..and I cant enable it when I cant boot the system... Apr 15 12:53:45 #android-root Apr 15 12:54:05 so I have to root it ? Apr 15 12:54:43 we're unlikely to be help with device issues, sorry, #android-root might know something or they can point you to a better place Apr 15 12:55:19 See topic Apr 15 12:55:45 ok Apr 15 13:01:02 hello Apr 15 13:04:54 orning markyosullivan Apr 15 13:16:30 friggity fuck its a PITA to mock out resources Apr 15 13:16:40 * Ping_2_Ur_Pong thinks he will be writting a program to do that shit in the future. Apr 15 13:19:06 If anyone was wondering if your application makes use of context and context.getResources() the way you handle it so you can test is by overriding MockContext and MockResources and returning your MockResources implementation which overrides the methods you make use of. Apr 15 13:30:07 Calling GridView#invalidateViews does not update them either until I touch the screen. Apr 15 13:30:52 barq, its hard to diagnose a problem without being able to see whats going on. Apr 15 13:31:11 morning Ping_2_Ur_Pong Apr 15 13:31:22 * Ping_2_Ur_Pong bows Apr 15 13:33:45 This is my refresh method https://gist.github.com/anonymous/83129b9b570158e6fd7a28657cb7db08 Apr 15 13:35:01 I want to trigger the Adapter's getView() method Apr 15 13:35:29 And notifyDatasetChanged is not doing the trick as I would expect it to. Apr 15 13:36:52 Works for everyone else.. Your problem is not the refresh method itself, and invalidateViews and requestLayout is not necessary Apr 15 13:40:00 What do you think is the issue then? I debugged the AOSP code and see that requestLayout is not called on the parent in some cases. The behavior makes no sense to me, though. Apr 15 13:40:25 I think your code is the issue Apr 15 13:40:37 barq: I can I point out that is the most retarded gist post I have ever read. That shows no logic, it doesn't show your layout, it doesn't show the logic you use to setup your adapter it doesn't even show anything. I have wasted 30 seconds of my life actually looking at that. Apr 15 13:41:01 Having no idea what you're actually doing, I can't really tell what you're doing wrong Apr 15 13:41:07 ^^ Apr 15 13:41:12 The adapter https://gist.github.com/anonymous/72ee785d8ec5033e3c5ad9955327fc0b Apr 15 13:44:21 I want to set the MyListItem enabled, which happens in line 71-73 of the paste. Apr 15 13:44:40 But I have the problem getView is not called until I touch the screen in some cases Apr 15 13:45:23 The adapter contents are the same, in some cases it works, in others it doesn't when notifyDatasetChanged is called. Apr 15 13:46:29 No issue in your adapter, other than a pointless call to invalidate() Apr 15 13:47:02 ok Apr 15 13:48:15 I debugged AOSP and for some cases mParent.isLayoutRequested() returns false. The difference is the mPrivateFlags in View.java. I don't understand why the flags differ, though. Apr 15 13:48:47 Looking for bugs in all the wrong places Apr 15 13:48:53 Hello guys, how can I add list of items in an arrylist to another arraylist? Apr 15 13:49:35 Probably messed up your threading or something, calling view methods from the wrong thread Apr 15 13:49:47 List#addAll Apr 15 13:49:54 Number5: mDataset = new ArrayList<>(newDataset); Apr 15 13:50:27 Collections.addAll Apr 15 13:50:51 I have an ExpandableListView with CheckBoxes. If one or more CheckBoxes are selected I want the button to be activated, otherwise deactivated. So I have two groups with two childs each. If I Enable a CheckBox in one group it enables the button and disables it if I uncheck the CheckBox. The same works for the other group. Apr 15 13:50:57 barq, I already tried list.addAll(anotherArrayList) but it gives me error Apr 15 13:51:09 The strange thing is that if I keep a CheckBox ticked in one group and switch to the other I ticking the CheckBoxes in that group no longer has any effect on the button. Apr 15 13:51:26 Number5: you can't edit a collection while using an iterator Apr 15 13:51:58 The same call to notifyDatasetChanged happens and the contents of the adapter are updated to enable the Item, but in the latter case the view is not redrawn for some strange reason. Apr 15 13:52:24 Ping_2_Ur_Pong, so...? I've to iterate and add item for item? I can do that, but I thought there's a built in function. Apr 15 13:52:37 "it gives me error" ... Apr 15 13:53:08 you don't have to iterate you can use any of the mechanisms metioned, but a common error is people try to add to a list while they are iterating through it. Apr 15 13:54:09 Ping_2_Ur_Pong, I don't iterate, I just receive an ArrayList from a callback and all I want is to add it to my 'main' ArrayList. Apr 15 14:01:20 SimonVT: Where do you think the problem is then if it is not the adapter or AOSP? Apr 15 14:02:12 Somewhere in the rest of your app Apr 15 14:02:23 Excluding stuff that doesn't touch the view, adapter or list of items Apr 15 14:02:26 haha Apr 15 14:03:44 barq, if you're a noob, bugs are never in framework Apr 15 14:06:24 Sometimes I really need to take a break if I want to call list.addAll() but in reality I call list.add() and than don't understand why list.addAll() doesn't work :P Apr 15 14:07:23 Someone could have told you that 15 minutes ago if you bothered to paste your code and error Apr 15 14:17:17 is it a bad idea to keep a static reference to your applicationContext? Apr 15 14:17:56 Not really, it's a singleton anyway Apr 15 14:19:42 pfn: I've found AOSP bugs before Apr 15 14:19:46 SimonVT: How is the context a singleton if every activity is a context? Not saying you're wrong, I'm just confused. Apr 15 14:22:33 barq, sure you have Apr 15 14:22:53 There's only one Application instance per process, magically Apr 15 14:23:08 Many Activities Apr 15 14:24:08 pfn: you're always so negative whenever I come in here :p Apr 15 14:24:10 pfn: Yep, was fixed in Marshmallow Apr 15 14:24:29 Smile :) Apr 15 14:24:57 SimonVT: thank you! So a Context object is just...anything that keeps system context? Apr 15 14:25:22 I'm googling it and I don't understand what the "job description" of a context is and what it means when a class extends from Context Apr 15 14:29:55 Just how tough it is to develop a QR Code scanner? Apr 15 14:32:27 hm nvm google already has api for this stuff Apr 15 14:33:25 using the google vision api is easy Apr 15 14:33:30 using zxing isn't Apr 15 14:33:37 I'm going with vision Apr 15 14:33:52 I have no idea how to implement a whatever code reader though Apr 15 14:34:00 Guess I'll make it a personal project :p Apr 15 14:34:07 though it seems kinda pointless Apr 15 14:38:12 god the dev team is trying to make a hackathon here at the company and they are failing miserably Apr 15 14:38:15 jesus h christ Apr 15 14:38:22 theorython Apr 15 14:38:33 it's almost lunch time and I don't think anyone has written a single piece of code Apr 15 14:38:38 not a word Apr 15 14:41:10 I don't like the idea of companies trying to do hackathons Apr 15 14:41:27 it just sounds like them trying to force people to work extremely quickly to produce something they could use Apr 15 14:42:04 casadogg, vision api does face and barcodes, nothing special to do Apr 15 14:43:33 I can't really understand the "outPadding" of this decoding method: http://developer.android.com/reference/android/graphics/BitmapFactory.html#decodeStream(java.io.InputStream, android.graphics.Rect, android.graphics.BitmapFactory.Options) Apr 15 14:44:14 "decodeStream(stream,??,options);" what sort of padding are they meaning? Apr 15 14:45:20 pfn it's just that i never worked with any kind of recognition algorithm Apr 15 14:45:50 casadogg_, you don't need to write anything Apr 15 14:46:00 casadogg_, just feed frames into. the detector Apr 15 14:46:12 casadogg_, and the detector tells you when objects are found Apr 15 14:46:58 Bernzel_: no idea. the version that takes just an inputstream passes null as the padding, so just pass null. http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/5.1.1_r1/android/graphics/BitmapFactory.java#BitmapFactory.decodeStream%28java.io.InputStream%29 Apr 15 14:47:41 ludocode: good spotting. That I'll do Apr 15 14:48:08 pfn Yeh thanks Apr 15 14:53:10 JakeWharton, why do you always have a library for what I want to do :p Apr 15 14:54:21 because you do common things and I'm easily annoyed Apr 15 14:55:16 although i'm annoyed by uncommon things as well Apr 15 14:55:21 had to restart the process because of third party library crap, I had the same idea already in my mind when I found processphoenix Apr 15 14:56:29 haha nice Apr 15 14:58:02 My google-fu is failing me - is there some property one can add in a manifest to ensure only ssl network connections can be made? Apr 15 14:58:16 only on N+ Apr 15 14:58:20 aah Apr 15 14:59:13 On line 56: http://pastebin.com/biWngNWg I get NPE. Which means that the bitmap I decode from stream isn't being created. I used the exact same code as described in the guidelines of loading bitmaps, so I can't see why this would fail? The stream is working, I tried decoding a bitmap via vanilla methods and it worked. Apr 15 14:59:53 Is it as always that the psuedo code provided by google is broken? Apr 15 15:03:08 Probably Apr 15 15:03:26 thanks JakeWharton - also http://developer.android.com/preview/features/security-config.html for anyone else who's curious. Apr 15 15:09:22 Say I have a class, and its running an async operation, and I pass that class a Context from my activity Apr 15 15:09:35 If that activity closes, will there be a memory leak? Apr 15 15:10:09 pass it a getApplicationContext Apr 15 15:10:18 Why is that? Apr 15 15:10:28 because that does not hold references to views Apr 15 15:10:50 So no leak? Apr 15 15:10:53 yes Apr 15 15:11:00 Ah cool Apr 15 15:11:07 application context is the one context that lives as long as your app is running Apr 15 15:11:11 Thanks Apr 15 15:11:15 hold onto it as long as you wish Apr 15 15:11:29 cuz if the system needs memory it will wtfpwn your entire process which frees everything Apr 15 15:11:44 Im implementing MVP Apr 15 15:11:52 So I have my activity (View) then I have a Presenter Apr 15 15:12:13 The presenter holds a reference to the View, which is an instance of an interface which my activity implements Apr 15 15:12:33 So when the view closes wont there be a leak because the presenter holds ref to the View missingno ? Apr 15 15:12:41 yes Apr 15 15:12:53 you have to apply some mechanism to avoid that Apr 15 15:13:05 null out the view onDestroy, or communicate without a reference Apr 15 15:13:09 So I was thinking like a disconnect method on the presenter Apr 15 15:13:15 which makes the view null in presenter Apr 15 15:14:08 Yeah, thatd work, but then I have to check if View is null before I call a method on it Apr 15 15:14:39 Which is fine I guess Apr 15 15:17:07 Does that make sense missingno Apr 15 15:20:12 is there an appropriate way for native code (NDKland) to exit? i'm finding that even after i stop my threads, the system doesn't terminate the process Apr 15 15:37:57 <_kw> I'm trying to run a command in my main thread, but it's not working.. I'm seeing the top log, but not the inner log http://pastebin.com/xDFakEwd Apr 15 15:38:13 <_kw> should be trivial, but I just don't see why I'd see one and not the other there Apr 15 15:41:24 <_kw> Anyone have any pointers? Apr 15 15:41:36 <_kw> been stumped for an hour or so now :( Apr 15 15:47:12 leakcanary + esspresso + monkey == omg that is just beautiful Apr 15 15:50:04 thebishop, why would it exit, let your application handle its lifecycle... there's always the exit syscall Apr 15 15:50:14 I'm getting a NoClassDefFound on retrofit.create(FarmnetLoginService::class.java) (that's kotlin), any ideas what may cause it? The interface does exist Apr 15 15:57:14 pfn, so this is for handling task-swipe to close. everything looks alright on the java side, but i got C/C++ threads that need to die too. Apr 15 15:57:36 pfn, i'm finding exit() throws a crash message to the user Apr 15 16:13:55 task-swipe to close isn't handleable Apr 15 16:20:34 Can anyone explain why the Espresso 'check' method isn't working for me? Apr 15 16:23:43 Do you need the hamcrest packages forit Apr 15 16:23:45 for it Apr 15 16:31:17 https://code.google.com/p/android/issues/detail?id=207067 Apr 15 16:31:21 I wonder if 2.1.x is as slow Apr 15 16:43:52 `minSdkVersion 21` master race checking in. :D Apr 15 16:44:22 Wassup TacticalJoke Apr 15 16:44:45 Hey, drose379. Apr 15 16:44:53 TacticalJoke ahah, did you !? Apr 15 16:45:16 Yeah, I took the plunge. Only drawback is that I can no longer test on my old phone. Apr 15 16:45:24 Anyone here familiar with MVP? Apr 15 16:45:39 But that phone is so 2014. Apr 15 16:45:42 we need a separate channel for MVP Apr 15 16:45:47 drose379: Only *everybody*. :D Apr 15 16:45:48 like android-mvp or something Apr 15 16:45:57 Ok I got a question Apr 15 16:46:14 So theres the View and the presenter, and the interactor Apr 15 16:46:29 The Presenter has a reference to the View (An interface that the activity implements) Apr 15 16:46:42 But when the actiivty ends, we need to disconnect it from the presenter Apr 15 16:46:49 So presenter._view = null Apr 15 16:46:50 Right? Apr 15 16:47:12 To avoid leak Apr 15 16:47:48 damn TacticalJoke, that's excluding a lot of users *.* Apr 15 16:47:55 for few features only Apr 15 16:48:01 adq but is it excluding a lot of money ? :) Apr 15 16:48:10 its is excluding a lot of headache :D Apr 15 16:48:17 <***> 8=100%, 10=100%, 15=97%, 16=95%, 17=87%, 18=77%, 19=74%, 21=40%, 22=24%, 23=5% Apr 15 16:48:26 60% excluded Apr 15 16:48:41 g00s, doubt that :) Apr 15 16:48:59 right now I have minSdk=19 - but once you do that, you ask yourself the inevitable - is one api level worth all the appcompat shit Apr 15 16:49:13 otoh there will always be appcompat Apr 15 16:49:20 yes because appcompat embeds bug fixes Apr 15 16:49:43 which are never updated by the manufacturer, you know it :) Apr 15 16:49:47 oops Apr 15 16:49:53 platform got bugs which are never updated by the manufacturer, you know it :) Apr 15 16:50:05 Hi, i got a webview in a fragment. I use webview.loadurl("http://www.google.com"). Instead of showing the website in the webview, the browser gets opened ! why? Apr 15 16:50:20 well its like a new and exciting / playful mix of bug fixes and new bugs Apr 15 16:50:29 ahah true Apr 15 16:51:50 drose379: Not sure off the top of my head. Can't remember the Android-specific details. Apr 15 16:51:59 Hmm ok Apr 15 16:52:08 adq: Wouldn't that be a different support lib, though? I'm talking about the AppCompat v7 thing. Apr 15 16:52:34 drose379: Isn't there that simple MVP example by that one guy (whose name I can't remember)? Apr 15 16:52:42 mosby Apr 15 16:52:54 Yes Apr 15 16:53:00 Oh, I mean Antonio Leiva. Apr 15 16:53:03 i think another one is ionic Apr 15 16:53:04 I think. Apr 15 16:53:04 ok found solution Apr 15 16:53:33 adq: Anyone not running Lollipop is *so* last season. Apr 15 16:53:40 lol Apr 15 16:53:52 TacticalJoke, no idea for the "different support lib"? or did not understand Apr 15 16:54:58 Well, the one I'm no longer using describes itself as "This library adds support for the Action Bar user interface design pattern. This library includes support for material design user interface implementations". I guess I might end up using another support lib in future, but probably not this one. Apr 15 16:55:07 Instead an empty View gets created dynamically by using reflections and gets attached as view to the Presenter Apr 15 16:55:07 Maybe I'm wrong. Apr 15 16:55:10 What is reflections? Apr 15 16:55:42 drose379: Where did you read that? Apr 15 16:55:49 It should be "reflection", as a mass noun. Apr 15 16:56:00 mosby site Apr 15 16:56:14 Im just trying to avoid having to check if view is null each time I call it Apr 15 16:56:29 Because when I detach the view from the presenter, I need to set it to something Apr 15 16:58:43 I guess Ill just set view to null and check if its null before calling a method on it Apr 15 17:01:51 But what about the presenter and the interactor Apr 15 17:02:05 Need to detach those too Apr 15 17:04:19 Say object A holds reference to object B, when Im done with A, do I have to detach it from B? Apr 15 17:06:04 TacticalJoke surprised nobody wrote a book on Android MVP yet :P Apr 15 17:07:03 'robovm winding down' i'm sorry, but anybody that uses these things is just asking for it Apr 15 17:08:09 Is that the thing where you can write java for ios? Apr 15 17:08:16 yeah Apr 15 17:08:42 Ah I checked that out once Apr 15 17:11:54 TacticalJoke are you using Instant Run? its supposed to be faster if minsdk=21 Apr 15 17:12:07 i disabled it because it wasn't working Apr 15 17:12:44 I got a GC question Apr 15 17:12:57 I have Activity , B and C Apr 15 17:13:06 B references activity, C references B Apr 15 17:13:16 If Activity detaches from B Apr 15 17:13:21 Will B and C be eligable for GC? Apr 15 17:14:38 g00s: Oh, is it? Didn't know that. Apr 15 17:15:09 Does what Im saying make sense? Or is everyone just chosing not to answer Apr 15 17:15:12 drose379: What do you mean by "detaches from"? Apr 15 17:15:35 The reference to the activity in B is set to null Apr 15 17:16:02 So basically there is just B and C left, and B references C Apr 15 17:16:08 I am wondering if B and C will be GCd Apr 15 17:16:40 drose379: an object will be gced if there is *no way* for you to access it anymore. Apr 15 17:27:15 Sorry guys, was just talking to myself, got disconnected Apr 15 17:27:22 Think I figured out the GC question I had Apr 15 17:27:45 the channel got GC Apr 15 17:28:05 Once Activity detaches from B, then B and C will be eligable for GC, because B is not on a live thread Apr 15 17:35:01 TacticalJoke adq having a problem with AS, wonder if you noticed this: when I edit an XML file, android:XXX *values* do not auto-complete on the root node Apr 15 17:35:32 so if i type android:layout_w it will fill out android:layout_width Apr 15 17:35:52 but then once the cursor is in "", it does not fill out values like match_parent, etc Apr 15 17:36:12 g00s, yeah sometimes it happens :( Apr 15 17:36:17 this is only for the root node Apr 15 17:36:19 same for javadoc Apr 15 17:36:27 same for go to string reference too depending on the module Apr 15 17:36:36 stuff is seriously unstable Apr 15 17:36:54 Works for me right now. I wonder whether invalidating caches would help. Apr 15 17:37:23 there are few tickets related to xml completion issue iirc Apr 15 17:37:47 TacticalJoke this is a clean install of AS from 1.5 Apr 15 17:37:49 a googler recommanded to create a dummy boolean in attr to force cache to be invalidated Apr 15 17:37:50 i noticed it there too Apr 15 17:37:54 things crazy like that Apr 15 17:38:04 i just don't care anymore Apr 15 17:39:22 Why do people use huge numbers for the activities response codes? Apr 15 17:39:45 to prevent collision? Apr 15 17:39:52 (no idea, random guess) Apr 15 17:41:08 Hmm I don't know. Here in the Mobile Vision Barcode API Google uses 9001. Apr 15 17:41:11 https://github.com/googlesamples/android-vision/blob/master/visionSamples/barcode-reader/app/src/main/java/com/google/android/gms/samples/vision/barcodereader/MainActivity.java Apr 15 17:41:18 That's over 9,000. Apr 15 17:41:21 for the lulz? over nine thousand? Apr 15 17:41:32 yeh well that's what I thought initially lol Apr 15 17:41:38 My OCD triggers though Apr 15 17:43:58 Is this bad? findViewById(R.id.read_barcode).setOnClickListener(this); Apr 15 17:44:08 It looks ugly as fuck. Apr 15 17:45:49 casadogg, it's not if you are sure it cannot be null Apr 15 17:45:49 ok weird. I set up a .sh "input tap" script to run over night on my phone, and now it makes a tap noise hours later. The tap noise can't be silenced by volume. Is this some weird security feature; Only the first thousand taps are quiet, to prevent hijacking devices with shell scripts? Apr 15 17:46:31 could be queued and delayed? Apr 15 17:46:57 adq It's not bad or it's not ugly? Apr 15 17:47:00 what's the rate/frequency of your input tap? Apr 15 17:47:15 casadogg, you asked if it's bad Apr 15 17:47:18 adq: 60 seconds, 2 seconds, 2 seconds, repeat Apr 15 17:47:35 actually, 2, 2, 62. Apr 15 17:47:36 I know but people tend to answer unasked questions Apr 15 17:47:58 well, no idea Raccoon, i still doubt it's related to security Apr 15 17:48:04 Is it bad in the Michael Jackson sense? Apr 15 17:48:08 lol Apr 15 17:48:20 adq: It hadn't made a noise when I launched the shell script Apr 15 17:48:35 I tried killing and running it again, and still makes a noise Apr 15 17:48:48 Raccoon, you would better inject touch event directly in code if you want to test things like that Apr 15 17:49:06 also if it's on the emulator you are testing.. many things can go wrong Apr 15 17:49:07 I'm not at that level Apr 15 17:49:37 it's on the phone. Apr 15 17:51:04 I think it must be a security feature Apr 15 17:52:42 TacticalJoke I'm guessing it's in the David Guetta sense. Apr 15 17:56:53 Don't people capitalize static final variable names? Apr 15 17:56:55 Geez. Apr 15 17:57:16 is android studio the same thing as the SDK/AVD? Apr 15 17:57:43 casadogg: Not always. Apr 15 17:58:00 Depends on whether it really represents a 'constant'. Apr 15 17:58:26 There's quite a few SO questions on this topic. Apr 15 17:58:28 This confused me: boolean autoFocus = getIntent().getBooleanExtra(AutoFocus, false); Apr 15 17:59:00 That's a weird naming style. Apr 15 17:59:13 Yeh Apr 15 17:59:26 It's an extra key constant Apr 15 17:59:30 I'd capitalize the shit out of it. Apr 15 18:00:03 it's from google code btw Apr 15 18:01:55 WallabyJenkins: no, android studio uses the sdk and avd Apr 15 18:02:36 wyrdtryle: So this is your way of saying semantically it based on those but not the same thing, gotcha Apr 15 18:03:49 I found that Sounds > Tap Sound was turned on. I didn't turn this on last night :S Apr 15 18:05:30 you need the sdk to build anything for android, studio is more for building the apps. it incorperates several build functions like gradle, maven etc etc Apr 15 18:05:46 Hi, why is the onSensorChanged method not being called? http://pastebin.com/tRFhEcAy Anyone help pls Apr 15 18:06:38 App does not crash, it just does not call the onSensorChanged method... Apr 15 18:07:18 https://www.quora.com/What-is-the-difference-between-Android-SDK-and-Android-Studio Apr 15 18:09:09 i couldnt come up with an intelligent way to explain the difference, so i let google find one for me lol Apr 15 18:09:13 wyrdtrtle: Only reason I ask is because Im taking a class on android forensics but the material is quite outdated. It relied on my installing just the SDK and creating an AVD from there. Upon doing so I got an error message that told me what I am using is outdated and that I should download android studio. So Im not quite sure if I should stick with what I have Apr 15 18:09:38 Android forensics? ;o Apr 15 18:09:43 You want the link? Apr 15 18:09:48 Very cool stuff, sec Apr 15 18:09:53 download android studio, it will download android sdk if needed Apr 15 18:10:00 http://opensecuritytraining.info/AndroidForensics.html Apr 15 18:10:07 For anyone else interested in this stuff heh Apr 15 18:10:15 Ashiren: Ok cool Apr 15 18:10:37 qtadb eh? Apr 15 18:11:08 android manager? No i never heard of that huh Apr 15 18:11:25 It blows my mind that a security training site doesn't use HTTPS though. Apr 15 18:11:41 hmm the textbook is from 2011 :v Apr 15 18:11:47 I asked around, it doesn't cause issues Apr 15 18:11:56 1. ARM processing hasn't changed in 10 years Apr 15 18:12:09 2. All the trees are similar to older androids Apr 15 18:12:25 I got away using Marshmallow and Ubuntu 14 instead of android 4.1 and and ubuntu 11.10 Apr 15 18:12:32 qtadb, never have used that, much easier to use the adb included with the sdk Apr 15 18:12:41 You can even use the guide to forensically investigate Android N since the SDK has it Apr 15 18:13:02 also thats an ancient link for the sdk, no wonder it says outdated Apr 15 18:13:16 I got the SDK link directly from google Apr 15 18:13:24 for my SDK* Apr 15 18:14:03 but did you run the sdk manager? it will dl all the updates for it Apr 15 18:14:27 Yes I did. Apr 15 18:14:36 I had to install some stuff and fix some USB drives so it updated along the way Apr 15 18:14:42 but like was said before, the studio will also dl the sdk for you Apr 15 18:14:46 I still got a pop-up saying to download studio Apr 15 18:15:05 Ya, ill try out the studio Apr 15 18:16:02 strange, i have the studio, but didnt ever get a notice about needing it and ive had the sdk and build envivroment for yrs Apr 15 18:16:04 I mean, it worked without studio don't get me wrong, but it was a little laggy and weird Apr 15 18:16:13 i really, really wish things would stop trying to point to the SDK, and just point to the developer.android.com site Apr 15 18:16:14 and did give me an error* Apr 15 18:16:48 ya I had to go to the developer android site, exactly. The link they gave me didn't work. NOTHING they gave me worked lol. That guide is a rough outline and a lot of figure it out yourself Apr 15 18:16:54 shmooz: Are you still working on your app? Apr 15 18:17:34 sup guys Apr 15 18:18:02 What's good wichu, Holmes. Apr 15 18:18:02 TacticalJoke: yeah sortof, I am working on installing linux so that I can compile ffmpeg and hopefully extract a working AAC decoder out of it Apr 15 18:18:10 lol, one change that did happen recently was the need for maven to build cm13 based on android 6.0 Apr 15 18:18:15 Sounds complex. :s Apr 15 18:18:53 TacticalJoke: I wish someone would just send me their ffmpeg.so file so that I don't have to install linux Apr 15 18:19:27 I remember the pain and misery that came with installing Linux. I guess things are better today, though. Apr 15 18:19:53 Ive never had issues installing linux except ubuntu touch. I must be young compared to you guys. Apr 15 18:20:06 TacticalJoke: everything in my app works except the decoder part for AAC for playing streaming stations, that works on some phones and fails on others Apr 15 18:20:17 that pain is pretty much gone nowadays Apr 15 18:20:37 Especially if all you need to do is compile something, you can download a VM image, and just use that Apr 15 18:20:43 Ya exactly Apr 15 18:20:45 WallabyJenkins: I'm trying to install it with windows 10 on a laptop dual boot Apr 15 18:21:01 shmooz: Well there's your problem, go get a Mac and use Bootcamp Apr 15 18:21:11 I have disable the protection that windows 10 has for the boot sector Apr 15 18:21:34 i have win 10 and linux mint on a laptop dual boot Apr 15 18:22:39 wyrdtrtle: any tricks I should know? Apr 15 18:22:57 Sure but Windows makes everything stupid difficult un-necessarily. But thats my completely biased opinion. I have a Triple Boot Windows/Linux/OSX on my Mac and I like all 3 in their own way Apr 15 18:23:09 only one is make sure the image supports uefi and secure boot Apr 15 18:23:22 thought most of them do now? Apr 15 18:23:56 well I'm installing the official ubuntu 15.10 image Apr 15 18:24:15 i have a PC that dual boots OS X/Win 10, but it tends to get messed up every so often, usually thanks to Windows Apr 15 18:24:16 from the main place where you download it Apr 15 18:24:30 I should back up my stuff, and reformat the whole thing. Apr 15 18:24:49 i even have separate SSDs for each OS Apr 15 18:25:27 s73v3r: What are you doing that its breaking things? If you aren't doing much on the Windows partition nothing should be messed up like that. I only had issues when doing crazy shit on my Windows I shouldn't be doing anyways lol Apr 15 18:25:45 I don’t know. I think it happens with updates Apr 15 18:26:21 i only had an issue when i tried to add win 10 to it when linux was already there, windows wants to be first or it goes bonkers Apr 15 18:27:10 i have a weird setup with hard drives. there are also old Windows partitions on some of the other spinning hard drives Apr 15 18:27:14 wyrdtrtle: Theres some know issues with how ubuntu 15.10 installs with Windows and how the boot partition installs Apr 15 18:27:20 like I said, I should just clean reformat Apr 15 18:27:21 Windows !)* Apr 15 18:27:22 10* Apr 15 18:28:00 http://askubuntu.com/questions/693159/uefi-question-why-does-ubuntu-15-10-installer-ask-where-to-put-bootloader Apr 15 18:29:29 How would I go about updating a single row in a ListView from the listView’s adapter? Apr 15 18:31:00 one thing i know, win 10 is miles ahead of win 8 or 8.1, hated those POS Apr 15 18:31:22 meh, I didn’t see anything wrong with either of them Apr 15 18:31:58 windows 7 is better than 8 and 8.1 too Apr 15 18:31:59 JamEngulfer: The easiest way is to just do notifyDataSetChanged() Apr 15 18:32:06 they were both bad atempts at making a pc operate like a winphone Apr 15 18:32:32 meh. they were just fine Apr 15 18:32:43 If I’m updating each cell when I finish processing the data for it, wouldn’t calling notifyDataSetChanged() many times be a performance drain? Apr 15 18:32:59 you could wait and do them in batches Apr 15 18:33:14 are you married to a ListView? Apr 15 18:33:27 cause a RecyclerView has methods to update specific rows Apr 15 18:33:45 well its like most things in life, it all comes down to personal preference Apr 15 18:33:48 I’m not really sure honestly. I just saw ListView and thought it made sense to use Apr 15 18:33:58 for the most part, it does Apr 15 18:34:00 I’m just displaying rows of data Apr 15 18:34:10 I like using the wireless display connection feature in windows 10, except when I'm downloading stuff using wifi it will stutter Apr 15 18:34:21 RecyclerView is just kinda an advanced version Apr 15 18:34:30 or a more flexible one, anyway Apr 15 18:34:38 Is there an API restriction with it or anything? Apr 15 18:34:49 don’t think so, it’s in the support library Apr 15 18:34:53 Cool Apr 15 18:35:01 I guess it only works back to API 7? Apr 15 18:35:05 How similar to how ListView works is it? Apr 15 18:35:13 almost exactly the same Apr 15 18:35:18 Like, does it use the Adapter stuff? Apr 15 18:35:21 yeah Apr 15 18:35:28 Cool Apr 15 18:35:36 read up on it. shouldn’t take you more than an hour or two to switch over Apr 15 18:35:59 I’m not super far into setting up the ListView, so it shouldn’t be too tricky to switch Apr 15 18:36:02 Thanks for the help! Apr 15 18:36:04 and then it has a method named notifyItemChanged(position), which will update a specific item Apr 15 18:36:18 Noted Apr 15 18:41:30 For some reason when my AlertDialog is showing the back button on the device is disabled Apr 15 18:41:33 Is that normal Apr 15 18:41:39 Ahh, set cancelable Apr 15 18:41:42 oops Apr 15 18:42:22 did you guys hear the rumors about SWIFT being a FIRST CLASS language for Android ? Apr 15 18:43:29 so google is thinking about replacing java with swift?? Apr 15 18:44:08 You shittin me Apr 15 18:44:44 I think apple bought google just around the time when lollipop came out, and they are not admitting it! Apr 15 18:44:51 Noo Apr 15 18:44:59 No way Apr 15 18:45:39 I wouldn’t put too much stock in those rumors Apr 15 18:45:52 I would love it if it were true, but I just don’t see it happening Apr 15 18:46:27 far, far too much work to port everything from the JVM to a native stack. And it they were doing so, it would have leaked Apr 15 18:46:59 well I heard it on the last All About Android show Apr 15 18:47:20 that google is thinking about making swift a first class language for android Apr 15 18:49:50 which probably just got that from the same articles we’ve all read Apr 15 18:52:11 s73v3r: we all read where? Apr 15 18:52:33 shmooz that's a rumour Apr 15 18:52:52 look at all these rumours! Apr 15 18:53:09 just because facebook uber and google sat down to discuss swift Apr 15 18:53:18 doesn't mean google is switching to swift Apr 15 18:53:46 it's true they are being sued big time by oracle, still, it doesn't seem probable the switch to swift Apr 15 18:54:01 and even if they do end up going with swift, it's not gonna happen in this decade Apr 15 18:55:03 so it will more likely be kotlin then I guess Apr 15 18:55:38 but kotlin is too dependent on java no? Apr 15 18:55:39 I don't know, they say Kotlin has slow compile times Apr 15 18:55:39 damnit, I spent several days writting a small charting lib, https://medium.com/robinhood-engineering/introducing-spark-dc17269b83f6#.fbvt83apb Apr 15 18:56:19 oracle would sue kotlin too Apr 15 18:56:32 Maybe they do end up going with Swift Apr 15 18:56:43 there's GoLang too Apr 15 18:56:44 :P Apr 15 18:59:23 I just saw some scuttlebutt that says google is thinking about making Swift a first class language because of law suit with oracle, which source are you guys referring to? Apr 15 19:02:12 shmooz why would they sue the guys who made kotlin? Apr 15 19:04:02 casadogg: I think cotlin depends on java too much Apr 15 19:04:12 *kotlin Apr 15 19:04:21 huh it runs on the jvm Apr 15 19:04:44 google is being sued for using packages from the java API with no legal permition Apr 15 19:05:03 If Windows can run Ubuntu binaries natively, then Android can run Swift Apr 15 19:05:25 it’s not that simple Apr 15 19:05:38 Oracle is suing someone for making something that runs on the JVM would make no sense Apr 15 19:05:45 Oracle suing* Apr 15 19:06:02 There’s also scala, clojure, jython, jruby, etc Apr 15 19:06:02 Hey guys, if I wanted to convert wifi dbm (lets say -54) to a wifi percentage signal, how would one go about that? Apr 15 19:06:07 That is kinda weird honestly Apr 15 19:06:17 oracle is fucking it up, they can only rely on their oracle sql /mysql, since companies use it and thats it Apr 15 19:06:31 In Google's case it makes sense the legal procedures because they have been negotiating the use of the APIs since before oracle bought sun Apr 15 19:06:34 even now c# is way superior than java will ever be Apr 15 19:06:54 meh, c# Apr 15 19:06:59 StephenS java has better marketing Apr 15 19:07:06 it does, but it sucks Apr 15 19:07:11 write once, run everywhere lol Apr 15 19:07:11 it would be nice if it was swift, so that we could also spit out an IOS executable while we're at it ;) Apr 15 19:07:14 Doesn't matter Apr 15 19:07:16 what a tool slogan Apr 15 19:07:21 It has better marketing Apr 15 19:07:26 thought they had reached a deal in that case? Apr 15 19:07:34 You have to stick to what has better marketing Apr 15 19:09:06 Although, with Swift, you’d have the problem of having potentially different UI things Apr 15 19:09:23 There’s a few fundamental structure differences between iOS and Android Apr 15 19:09:39 you’d have to write separate UI layers, but that’s a smaller problem than having to write two separate apps Apr 15 19:09:56 Yeah Apr 15 19:09:57 if you architect your apps properly, switching out the UI layer should be possible Apr 15 19:10:05 and straightforward Apr 15 19:10:22 and Swift does have some nice stuff to make that easier Apr 15 19:12:04 True Apr 15 19:23:11 What is it with that happening? Apr 15 19:23:17 Everyone just leaving Apr 15 19:23:44 It's a prearranged protest. Apr 15 19:23:59 Ah, I see... Apr 15 19:24:08 Against the dictators running this service. Apr 15 19:24:12 Just kidding; it's this: https://en.wikipedia.org/wiki/Netsplit Apr 15 19:24:16 XD Apr 15 19:24:24 Or something like it. Apr 15 19:24:52 Oh right, so it’s some bit of Freenode detatching itself for a bit? Apr 15 19:27:33 It’s one of the artifacts from the IRC protocol being old as dirt Apr 15 19:30:53 there is something truly magical about reading the source for a product. You get to peer into the mind of other people, often you think they should be jailed for abuse. But occasionally you say... damn that's just friggin beautiful. Apr 15 19:31:55 Yeah, sometimes you encouter someone who makes beautiful code, then you encounter that one guy that named all of his variables phonetic Chinese characters Apr 15 19:32:19 It was SO unhelpful Apr 15 19:32:45 haha Apr 15 19:34:05 JamEngulfer your own fault for not knowing chinese. Apr 15 19:34:12 That's like, industry standard nowadays. Apr 15 19:34:21 But I did Apr 15 19:34:29 Log.d("sumTingWong") Apr 15 19:34:32 XD Apr 15 19:34:52 To be honest, having it written out in characters would have probably made it more readable Apr 15 19:34:59 :O Apr 15 19:35:11 But it was all in the English writing of how you pronounce it Apr 15 19:39:43 * Ping_2_Ur_Pong hasn't noticed anyone posting any good reads to the channel lately. Apr 15 19:39:48 https://github.com/alex-townsend/SwipeOpenItemTouchHelper?utm_source=androiddevdigest <-- seems nice Apr 15 19:40:51 What do you guys do if you have to cancel a http request Apr 15 19:40:54 When I read others' code, I feel like a wine taster sampling Walmart's economy range. Apr 15 19:41:09 Heck, I’m like that reading my own code Apr 15 19:41:21 drose379: OkHttp has Call.cancel. Apr 15 19:42:06 TacticalJoke: but occasionally you come across that 2016 wine that has no vintage but damn it tastes good. Apr 15 19:42:13 Ok TacticalJoke, but what if I cancel and my script is in the middle of saving something to the DB, then half the users stuff gets saved and half doesnt Apr 15 19:42:14 What then? Apr 15 19:42:26 * Ping_2_Ur_Pong really likes reading big tech companies open source code Apr 15 19:42:34 always see neat tricks and cool ideas Apr 15 19:43:46 I think you have to use atomic (all-or-nothing) transactions. Apr 15 19:44:02 So if it stats, its gonna finish? Apr 15 19:44:16 Even if I cancel? Apr 15 19:44:49 Is there any way to determine the foreground application from a shell/adb script? Apr 15 19:44:53 It's more like writing either 100% or writing 0%. Apr 15 19:44:59 In that case, I'm guessing 0% would be appropriate. Apr 15 19:45:15 fuck does anyone write tests, so much code on github has never even heard of the concept of a friggin test. Apr 15 19:45:16 I remember when I used to read code written by a guy who used to write fantasy in the commentaries Apr 15 19:45:18 TacticalJoke: so what if im writing to a Db and it gets canceled, do I remove everything ive written? Apr 15 19:45:31 Code wasn't good but damn, he wrote good fiction Apr 15 19:45:36 casadogg: was it good? Apr 15 19:45:39 haha Apr 15 19:45:40 his name Apr 15 19:45:43 George R R Martin Apr 15 19:45:47 * Ping_2_Ur_Pong thinks that was almost worth it Apr 15 19:45:48 lulz Apr 15 19:45:51 JK JK Apr 15 19:45:53 I haven't done SQLite stuff lately -- doesn't it have the concept of atomic transactions? Apr 15 19:46:02 I thought it did. Apr 15 19:46:06 Oh no this is MYSQL, im talking on the server Apr 15 19:46:16 It was actually JRR Tolkien Apr 15 19:46:18 What if I need to cancel a server request Apr 15 19:46:26 Midway thru writing to the DB Apr 15 19:47:14 I’d cache the data until it’s all sent, then put it in the DB once it’s fully sent Apr 15 19:47:43 Or, keep a record of where all of the data has been put, then remove it all if the request is cancelled Apr 15 19:48:38 Cache it where? Apr 15 19:48:40 wtf is that http://www.hastebin.com/sebedofiqe.coffee Apr 15 19:48:59 Also im not sure how id even cancel with php Apr 15 19:49:10 * Ping_2_Ur_Pong hates methods over 15 lines... If you go past 30 fuck you. Apr 15 19:50:32 drose379: I don’t know, on your server. The use of PHP does complicate things Apr 15 19:50:47 What would you use for a api? Apr 15 19:51:15 Idk. I don’t really know what you’re doing Apr 15 19:51:33 Ping_2_Ur_Pong: If that’s only doing one thing, that doesn’t seem too bad Apr 15 19:52:29 Im backing something up to the servers db JamEngulfer Apr 15 19:53:10 In an iOS app I have a 164 line method. There’s no point modularising it or anything, because it’s just layout code for a table row and there’s just a lot of layout code Apr 15 19:54:01 JamEngulfer yeah if the function is highly regular doesn't make sense to break it up Apr 15 19:54:05 sometimes, like in intensive loop, you don't want to follow these strict rules of max nb of lines per function/method, because calls are expensive Apr 15 19:54:27 drose379: Oh right. So you’re sending data to the server, and you’re worried about handling it when it abruptly stops mid-stream? Apr 15 19:54:36 adq in high precision code yes. Apr 15 19:54:41 proguard can help merging these calls though, but it's a bit hazardous and a lot of work to be sure/verify Apr 15 19:54:43 google git congrats me on 2 hours of sitting :D Apr 15 19:54:46 *google fit Apr 15 19:54:52 lol Apr 15 19:54:55 But alot of readability rules get tossed out the door for precision Apr 15 19:55:08 g00s: were you masturbating? Apr 15 19:55:18 it thought it was vigorous exercise Apr 15 19:55:32 ok i know Ping_2_Ur_Pong is probably a teenager now Apr 15 19:55:44 * Ping_2_Ur_Pong shakes his head Apr 15 19:55:55 * Ping_2_Ur_Pong just likes childish jokes. Apr 15 19:56:29 bah... Im going to actually sit down and try to figure out what this damn method is doing Apr 15 19:57:06 i just tried the IAB promo code with a little experiement on 100 codes, works pretty well Apr 15 19:57:17 it's crazy how ppl wants free stuff.. Apr 15 19:57:20 If you have code repetition etc, then I’m all for modularising, but if splitting it into different methods is just a glorified way of adding identification comments to your code, then there’s not much point Apr 15 19:57:46 Yes JamEngulfer Apr 15 19:57:52 i'm wondering why they limited to max 500 codes per quarter Apr 15 19:57:52 One thing iOS doesn’t do which confuses me is allow you to give out codes for In-App Purchases Apr 15 19:57:55 I don't agree. Readability is important. Apr 15 19:58:05 Shoving everything into one method just because you can is a bad idea. Apr 15 19:58:37 drose379: What format are you sending your data in? Surely you can just store everything the client sends in a variable or something Apr 15 19:59:00 Its JSON Apr 15 19:59:16 TacticalJoke: That’s where good commenting comes in Apr 15 19:59:26 drose379: How much data is being sent? Apr 15 19:59:34 JamEngulfer: good code doesn't need comments Apr 15 20:00:11 To an extent. Even the best code can be confusing if you don’t have any context Apr 15 20:00:23 It depends JamEngulfer Apr 15 20:00:32 Not a huge amount Apr 15 20:00:57 there is a compromise for readability, otherwise you end up close to assembly code lol Apr 15 20:00:59 Naming is better than commenting. Apr 15 20:01:19 drose379: So yeah, in your PHP, just store the data in a variable, make sure it’s all there, then put it into your database Apr 15 20:01:50 If you don’t know how much data you’ll be getting, just send something that marks the end of the data once the client has finished sending it all Apr 15 20:02:12 problem with naming in java is: http://projects.haykranen.nl/java/ just click enterprisify button few times :)) Apr 15 20:02:48 Hmm ok JamEngulfer Apr 15 20:04:03 Heyo Apr 15 20:04:24 I’ll admit, I might be guilty of that a little bit Apr 15 20:05:36 I think comments have their place, but loads of people (not necessarily the people taking part in this debate) use them instead of good naming and good architecture. Apr 15 20:06:01 self documenting -> http://www.hastebin.com/zozaleteqa.coffee Apr 15 20:07:31 Ping_2_Ur_Pong: I'd get rid of `numAnims` there. Apr 15 20:07:39 The fact that it's reused is also kinda confusing. Apr 15 20:08:24 meh... you going to say don't use i as the counter too? Apr 15 20:08:35 No, using `i` is good practice. Apr 15 20:09:26 Short variable names definitely have their place. Apr 15 20:09:26 hmm... what's gained by reusing numAnims? Apr 15 20:13:47 hmm... what's gained by reusing numAnims? < it's good practice to give a final constant in a for loop Apr 15 20:14:04 otherwise you endup have .size() being called at every iteration of the loop Apr 15 20:14:11 having* Apr 15 20:14:33 Not in this case, though, because the condition is `i >= 0`. Apr 15 20:15:04 ah right Apr 15 20:15:35 On a side note, that code would be so short in Kotlin. Apr 15 20:15:40 It's just querying three collections Apr 15 20:15:42 well then, he called the size() one time instead of 4 Apr 15 20:15:42 :> Apr 15 20:16:06 Oh, wait, I'm not sure about what I just said. I haven't used this API before. Apr 15 20:16:35 it's not even 4, i said bullshit, sorry Apr 15 20:17:32 he could have made one method passing in param the size the list of handler.mPending.. and the instanceof to test Apr 15 20:18:12 and just call this method 3 times against handler.mAnimations, handler.mPendingAnimations & handler.mDelayedAnims Apr 15 20:18:34 but really, it does not matter much Apr 15 20:18:35 Yeah, it's code repetition. Apr 15 20:18:46 He just needs to pass the item and run the conditional statement. Apr 15 20:18:57 Also, each `handler.mDelayedAnims.get(i)` happens twice. Apr 15 20:19:17 true, good catch Apr 15 20:19:25 Stay tuned for more Android Development: Under the Microscope. *theme music plays* Apr 15 20:19:52 poor D. Knuth Apr 15 20:20:05 * sad piano music * Apr 15 20:21:17 I’ll say one thing, I much prefer how iOS handles Async code. There’s no fussing around with making mini psudo-classes for Runnables or anything like that. It’s just give it a block of code and tell it to run it async/on the main thread Apr 15 20:22:24 Kotlin has some `async` stuff coming that might make that possible in Android development. Though I'm not sure how it's gonna work out. Apr 15 20:22:51 In particular, I wonder how that stuff will work alongside the Activity life-cycle and stuff. Apr 15 20:23:14 Activity lifecycle manages to shit on everything Apr 15 20:23:21 why you can't have nice things :) Apr 15 20:23:31 The Fragment life-cycle is the uber-defecator. Apr 15 20:23:41 JamEngulfer, sadly limitation of Java6 Apr 15 20:23:55 easily rectified with java8 Apr 15 20:24:10 JamEngulfer, if you use RetroLambda to bring back lambdas (Apple calls them "blocks") will make the code a bit less verbose Apr 15 20:24:16 g00s: I was thinking that it'd be cool if they rewrote the SDK for Swift or something. Apr 15 20:24:25 Though I'm not sure I trust them *not* to make a mess even the second time around. Apr 15 20:24:34 s/lifecycle/lolcycle/ Apr 15 20:24:36 TacticalJoke haha yes Apr 15 20:24:37 If you use RxJava it gets probably better than GDC Apr 15 20:24:41 *GCD Apr 15 20:24:41 Activity should be considered a complete failure of design. Apr 15 20:24:42 It’s like, do I really have to make an entire subclass of Runnable just to run one block of code async and pass it a variable? Apr 15 20:24:56 yes Apr 15 20:24:57 it's java Apr 15 20:25:04 Fks sake Apr 15 20:25:06 and use classes anonymously Apr 15 20:25:15 that's the closest you'll get to lambda notation Apr 15 20:25:31 Grand Central Dispatch made my life so much easier when doing iOS Apr 15 20:26:03 That combined with semaphores as well Apr 15 20:26:13 JamEngulfer, we just wrote you a solution. Apr 15 20:26:15 anyone know of a channel to talk about rxjava/reactive/functional? Apr 15 20:26:17 Why are you still bitching? Apr 15 20:26:30 Wow, ok Apr 15 20:26:42 I don't think it's really bitching. It's more of an academic discussion. Apr 15 20:26:49 Chill out man, I wan’t bitching, I was reminiscing Apr 15 20:27:09 * g00s won't be reminiscing about android haha Apr 15 20:27:36 TacticalJoke, right. Apr 15 20:27:49 STOP WHINING! Apr 15 20:28:05 whining shmining ! Apr 15 20:28:06 Apr 15 20:28:18 Everything about that has been grinded to the dust and beyond in last 5 years. Apr 15 20:28:29 "Deal with it." Apr 15 20:28:45 Stop wasting time battling shit you can't change. Apr 15 20:29:39 Dude, it’s ok. Apr 15 20:29:56 do you guys know if the enhanced adb protocol is only for the new emus ? Apr 15 20:29:59 It’s fine to complain about stuff Apr 15 20:30:28 or does it work on android 5+ / or 6+ Apr 15 20:32:32 g00s, I've only seen fast transfers on API 23 and 22, not sure about 21 Apr 15 20:32:39 19- was pretty crap most of the time still Apr 15 20:33:16 hm ok, i have 6.0.1 on my device Apr 15 20:33:57 Lately I've been mostly using adb-sync though. Apr 15 20:44:06 yigit talks about stuff https://www.reddit.com/r/androiddev/comments/4exvz7/is_androidpriorityjobqueue_ready_for_production/d24f65y Apr 15 20:45:48 not really sure what he means by jobmanager though ... Apr 15 20:46:55 https://github.com/yigit/android-priority-jobqueue/blob/master/jobqueue/src/main/java/com/birbit/android/jobqueue/JobManager.java ? Apr 15 20:47:39 ah yes Android Priority Job Queue (Job Manager) Apr 15 20:47:51 Mavrik are you using it ? Apr 15 20:48:02 Nah Apr 15 20:48:16 I've usually defaulted to the GCM manager lately Apr 15 20:48:23 But didn't need priorities. Apr 15 20:50:50 Hmm, Instant Run seems to interfere with the "Show device-chooser dialog" setting. Apr 15 20:51:09 It seems to be ignored with Instant Run enabled. Apr 15 20:54:53 Sigh. Disabled Instant Run and now "Installing APK" and "Stopping 'Installing APK'" are hanging. Apr 15 20:55:43 TacticalJoke i had problems with IR hanging AS, but only when my machine woke from sleep Apr 15 20:55:55 once i disabled it, seems OK again Apr 15 20:56:34 TacticalJoke, hanging install APK usually means you have a prompt for APK verification waiting on your device. Apr 15 20:56:37 I had to kill the emulators. Apr 15 20:56:53 Hmm, didn't see a prompt this time. Apr 15 20:57:10 i've also noticed when i shut down AS my app dies lol Apr 15 20:57:26 g00s, you have a tick at "Terminate process when exiting"? Apr 15 20:58:11 Mavrik where is that ? doesn't sound familiar Apr 15 20:58:22 The dialog when exiting AS. Apr 15 20:58:38 Probably somewhere in settings as well. Apr 15 20:59:18 ah, i have 'confirm exit' unchecked, i'll set that again to see what it does Apr 15 20:59:38 'do you really want to XX' STFFUUU! Apr 15 21:00:54 Are you sure you want to enable this setting? Apr 15 21:05:59 it would be kind of cool, if supported some kind of macro expansion Apr 15 21:06:41 like Apr 15 21:06:56 and in foo layout, $1 and $1 were placeholders Apr 15 21:07:03 $1 and $2 Apr 15 21:07:16 something like that :) Apr 15 21:07:55 hey, any of you guys have experience with not getting banner ads to register views because of how long the ad is up? Apr 15 21:08:07 is there a time requirement to count as an impression? Apr 15 21:08:28 hm maybe i can somewhat emulate this with ViewStb Apr 15 21:08:39 ViewStub Apr 15 21:15:21 looks cool https://github.com/btraceio/btrace Apr 15 21:18:34 agreed, although isn’t their method of injecting bytecode not possible using Jack? Apr 15 21:20:06 So has everyone disabled Instant Run? Apr 15 21:20:27 I'm finding it's giving me too many problems when running multiple emulators. Apr 15 21:32:07 TacticalJoke yeah i disabled it Apr 15 21:48:59 I'm converting a massive activity into fragments and had a question. If I have a bunch of variables and methods in the main activity that the fragment would use should I move them all to the fragment and pass the objects I need as a fragment parameter? Apr 15 21:49:25 Or should I implement the fragments onclicklisteners in the main activity Apr 15 21:49:29 hi guys is there a way i can download apps for the play store to my laptop to then install on a SD card without using a phone(but have the apps installed and ready to use on SD card?) Apr 15 21:50:10 confox . nope Apr 15 21:51:14 The closest you can do is find an APK on a mirror, cross your nuts that it's not tampered with and is for your version of Android and save the APK to an SD card for you to manually install when you put the card in the phone Apr 15 21:51:14 confox: you can't do it with the play store Apr 15 21:54:17 ok guys thanks Apr 15 21:55:52 i heard a that android apps may soon be coded in swift is that true? Apr 15 21:56:31 Maybe? Apr 15 21:56:35 well I just check my sources and they still all seem to be Java Apr 15 21:56:38 I think that is mainly rumour Apr 15 21:59:07 guys it is - http://thehackernews.com/2016/04/android-swift-programming.html Apr 15 22:00:27 confox: the android NDK is getting swift support - you can also use the NDK with C++....but that's not the SDK Apr 15 22:01:35 Ah, so i still need to learn Java in order to code android apps Apr 15 22:01:41 huh! Apr 15 22:01:55 titanblue what are you basing that on Apr 15 22:01:57 pretty much Apr 15 22:02:00 It seems like Rust would be a more natural fit, but what do I know … ;-) Apr 15 22:02:12 Chainfire: i forget what exactly, do I need to go lookup my sources? Apr 15 22:02:22 Google's not going to chain themselves to apple Apr 15 22:02:32 all I've seen is that there have been some people that have done experimented with building swift things using the NDK Apr 15 22:02:41 surprise surprise, you can build a great lot of things using the NDK Apr 15 22:02:57 just not everything Apr 15 22:02:59 nowhere have I seen it stated that it will get official support. If you have, then yes, I would like to see that Apr 15 22:03:16 not without effort no Apr 15 22:03:16 don't think I've seen anything on the official end yet, that I can remember Apr 15 22:03:44 so "the android NDK is getting swift support", but not officially ? Apr 15 22:04:04 "" Apr 15 22:10:34 The Play Store is harassing us about using Android Pay and not having it set up correctly, but we def are not using it. I can see several occurrences of `com.google.android.gms.wallet.api.enabled` in our intermediate build xmls. What is the deal? Apr 15 22:11:08 I narrowed down our `play-services` dependency to simply `play-services-analytics` but one reference to wallet still remains. Apr 15 22:17:18 you've searched your project for wallet? Apr 15 22:18:16 ghostmoth: https://developers.google.com/android/reference/com/google/android/gms/wallet/package-summary#interfaces Apr 15 22:20:47 titanblue: Step 1. be more specific with play-services (play-services-analytics in our case); Step 2. rm -rf the the build folder to get rid of artifacts and junk Apr 15 22:20:52 Looks like it’s gone, now Apr 15 22:21:12 i congrats Apr 15 22:21:13 One of the Play services was enabling it when we had the whole shebang as a dependency Apr 15 22:49:44 google Keep is embedding child fragments directly in the XML; i thought that wasn't allowed Apr 15 22:50:08 this is where i wonder; do they know what they are doing or was this changed since 4.2 Apr 15 22:50:38 Do we have any google devs in here? Apr 15 22:50:45 no Apr 15 22:50:48 g00s: try it out Apr 15 22:51:12 s73v3r oh i have tried it with "seemingly" no problems, but the docs explicitly say do not Apr 15 22:51:29 its one of those things, seems to work, but then who knows when you kick it hard Apr 15 22:51:42 maybe they decided that the risk was worth it? Apr 15 22:51:48 lol Apr 15 22:52:39 the Keep devs loved fragments ... Apr 15 22:52:50 fragment for snackbar, fragment for toolbar lol Apr 15 22:53:15 makes sense, I suppose. if fragments lived up to their promise, that’s probably how they’d be use Apr 15 22:53:17 used Apr 15 22:53:32 Why do people hate on MVP design, seems great? Apr 15 22:53:43 who hates on it ? Apr 15 22:53:53 Idk I thought people were making fun of it earlier Apr 15 22:54:03 maybe. everything gets hated on Apr 15 22:54:06 i make fun of everything eventually; nothing is sacred Apr 15 22:54:09 Thats a fact Apr 15 22:54:21 Im trying it out, and it seems really clean Apr 15 22:54:24 i think one of the big issues with it currently is that there are no less than a dozen different ways to do it Apr 15 22:54:34 As with everything though Apr 15 22:54:45 everything android; ftfy :) Apr 15 22:54:56 Whats ftfy stand for Apr 15 22:55:00 and each of them has its own issues, most of which you won’t see until you’re about waist deep Apr 15 22:55:21 Example of an issue s73v3r ? Apr 15 22:55:26 i prefer to reuse the pattern than library for this Apr 15 22:55:39 because i don't do it strictly and the same everywhere Apr 15 22:55:49 how does one actually instantiate the presenter and transition screens? Apr 15 22:56:08 I just do new Presenter( this ) Apr 15 22:56:12 Kill all fragments with fire - they are evil Apr 15 22:56:18 on what, though? the activity? Apr 15 22:56:23 My activity implements a interface Apr 15 22:56:29 Yeah s7 Apr 15 22:56:32 in onCreate Apr 15 22:57:04 but now that’s a dependency in your activity, one that you can’t easily mock away Apr 15 22:57:20 and likely the presenter has a reference to the activity, so now you have circular references Apr 15 22:57:36 It does, but I have a disconnect method in the Presenter Apr 15 22:57:38 You'll certainly need to pass a context to the presenter Apr 15 22:58:00 No not a context, just an instance of the Activity, but not the actual activity, the interface that the activity implements Apr 15 22:58:03 i’m not trying to pick on your implementation; the other ones I’ve heard usually have their own issues Apr 15 22:58:14 I want you to pick on it s73v3r Apr 15 22:58:23 I want to realize potential issues and have fixes Apr 15 22:58:48 I can tell you about it a bit if you want Apr 15 22:58:48 drose379: if you don't pass a context how do you retrieve items from the resources? Apr 15 22:58:52 well, that’s the big downfall of the pattern: there are these issues, but there really aren’t fixes. just workarounds Apr 15 22:59:14 s73v3r: All patterns have flaws. Apr 15 22:59:22 tilal6991, I just pass a ApplicationContext to the specific methods when necessary Apr 15 22:59:24 tilal6991: that shouldn’t be an issue, as the resources should be fetched by the activity or view Apr 15 22:59:24 Otherwise there would be a single one everyone uses Apr 15 22:59:31 i wouldn't say flaws, tradeoffs Apr 15 22:59:42 Well yes that's another way to put it Apr 15 22:59:42 No the resources are grabbed by the model Apr 15 22:59:46 i would say ApplicationContext is not a good thing to use for that Apr 15 22:59:52 It is Apr 15 23:00:02 Why wouldnt it be? Apr 15 23:00:13 Well if you're retrieving strings then sure the application context is fine Apr 15 23:00:14 cause it’s not the Activity context Apr 15 23:00:29 If you want to retrieve any sort of styles/themes then it's very bad Apr 15 23:00:32 Activity context is going to have different “context” for lack of a better term than the Application context Apr 15 23:00:44 When does it matter? Apr 15 23:01:00 well, as was said, when you’re dealing with themes/styles Apr 15 23:01:02 When inflating views Apr 15 23:01:06 Also Apr 15 23:01:22 and yeah, the Activity/Fragment/View should be handling getting the resources, at least the UI ones Apr 15 23:01:23 Not doing any of that in the Presenter Apr 15 23:01:34 How do you handle adapters then? Apr 15 23:01:41 Do you pass those into the presenter too? Apr 15 23:01:53 A list adapter? Apr 15 23:01:57 Yes Apr 15 23:02:07 "com.google.android.keep.editor.ViolatorFragment" somebody liked depeche mode Apr 15 23:02:09 I would get the data from the presenter, then pass it to the adapter in the View Apr 15 23:02:21 The view handles the adapter? Apr 15 23:02:36 Yes Apr 15 23:03:12 all my adapters have the shittiest code for some reason Apr 15 23:03:25 Interesting idea (and one I tried) but feel that breaks the seperation of the layers - I don't quite think adapters fit in the view layer Apr 15 23:03:39 Adapters seem to fit better in the presenter layer Apr 15 23:03:59 How would you put it in the presenter Apr 15 23:04:12 Unless you literally create the adapter in the presenter and pass it back to the view Apr 15 23:04:23 I did exaclty that yes Apr 15 23:04:30 so the view can do _myListView.setAdapter(adapterPasedBackFromPresenter) Apr 15 23:04:35 In any case I did attempt the presenter pattern and it seemed nice but felt like a bit bolted on for Android Apr 15 23:04:49 I'm experimenting with Redux ideas now Apr 15 23:05:00 What about when you need to update the data in the adapter tilal6991 Apr 15 23:05:01 Some nice ideas there Apr 15 23:05:26 Well the model recieves the notification from the model and calls the relevant methods on the adapter Apr 15 23:05:32 * the presenter Apr 15 23:06:37 View realizes new data is requested by the user, calls method in Presenter, presenter queries model, model passes back to presenter, presenter creates (or updates existing) adapter, gives back to view Apr 15 23:07:44 More like I inject view click listeners into the adapter so that the view telling presenter means directly calling a method on the presenter Apr 15 23:08:05 And moreover, I register callbacks with ObservableLists in model so the notificaiton is recieved there directly Apr 15 23:08:16 Cuts out the cruft Apr 15 23:08:22 the what? Apr 15 23:08:46 The extraneous middle methods which are just passing data through the layers Apr 15 23:08:58 Yeah true, it would work though Apr 15 23:09:22 The presenter is basically the middle man between the View and the Model Apr 15 23:09:26 It's one idea - one which felt good for me :) Apr 15 23:09:29 Yes exactly Apr 15 23:09:32 Ok cool Apr 15 23:09:53 Well currently I Have all logic in my activities, and I think it would be better to move it into the presenter / model Apr 15 23:10:11 It's definitely nicer than having everything in the activity for sure Apr 15 23:10:31 Ive run into one issue / not really issue Apr 15 23:10:49 Have to pay attention to activity lifecycle Apr 15 23:11:01 Disconnect the presenter from the activity when the activity is gone Apr 15 23:11:18 So it can be GCd Apr 15 23:11:28 I created a Presenter interface with 5 methods - create, bind, unbind, saveState, destroy Apr 15 23:11:45 Create a PresenterManager which stores presenters for activity Apr 15 23:12:04 And the bind in onStart and unbind in onStop Apr 15 23:12:24 The presentermanager dispatches to all child presenters Apr 15 23:13:11 Why do you have multiple presenters for an activity? Apr 15 23:13:19 Each manages a part of the UI Apr 15 23:13:36 One manages my nav drawer, one manages the main content Apr 15 23:13:42 One manages the toolbar Apr 15 23:13:46 Kinda cool Apr 15 23:13:53 I do have it stuffed into one presenter now Apr 15 23:13:57 Similar to how Keep described above Apr 15 23:14:03 Except not with fragments Apr 15 23:14:08 Because as I said they are evil Apr 15 23:14:13 So what happens in the presenter unbind method? Apr 15 23:14:21 I unregister model listeners Apr 15 23:14:38 Dont you keep a reference to the View in your presenter Apr 15 23:14:43 Because otherwise the activity context leaks Apr 15 23:14:52 Yes I do Apr 15 23:15:00 So do you set that to null Apr 15 23:15:03 No Apr 15 23:15:06 Why Apr 15 23:15:23 It doesn't matter because the presenter is not registered anywhere outside the activity on unbind Apr 15 23:15:39 So all the views, presenters etc are part of the same graph componenet Apr 15 23:15:43 Wont that cause a leak if the activity is destroyed and the presenter still holds reference Apr 15 23:15:46 So the GC will collect them all together Apr 15 23:15:48 No Apr 15 23:15:57 Because then nothing is keeping the presenter alive :) Apr 15 23:16:17 So it will be destroyed too Apr 15 23:16:22 Hmm, I just set the view to null on disconnect Apr 15 23:16:35 Then the presenter, the model and the activity are eligable to be GCd Apr 15 23:16:37 I mean it doesn't hurt but shouldn't help anything either Apr 15 23:17:04 So youre saying when the activity is destroyed I dont have to set it to null in the presenter? Apr 15 23:17:09 No Apr 15 23:17:18 I dont understand why not Apr 15 23:17:42 Think of it like this: I have a object in my activity which holds a reference to a view. When I destroy the activity do I need to null the object? Apr 15 23:17:51 No Apr 15 23:17:56 No - because the object is GCed along with the activity Apr 15 23:18:03 Same way the presenter is a child of the object Apr 15 23:18:07 * activity Apr 15 23:18:12 So it will be GCed with it Apr 15 23:18:48 Well ok, but my presenter holds reference to my model Apr 15 23:18:54 That's true as long as you don't hold a reference to the presenter from some other longer lived object (say a persistent model - if you do then stuff breaks) Apr 15 23:19:04 What if my model is working on something in the bg thread Apr 15 23:19:14 Ah then you get into trouble as I say Apr 15 23:19:32 So thats why I set the activity to null on disconnect Apr 15 23:19:38 So the prestner + model can finish up Apr 15 23:19:48 But why do you care if the model finishes? Apr 15 23:19:55 If there is no view to display it? Apr 15 23:20:07 It could be working on a background task, writing something to the server for example Apr 15 23:20:30 Then why does the presenter need to register with that model? Apr 15 23:20:40 The presenter should be tied strongly to the activity not the model Apr 15 23:20:51 It should be weakly linked to the model in bind and unbind Apr 15 23:20:51 I keep a instance of the model in the presenter Apr 15 23:20:57 Would you say thats strongly tied Apr 15 23:21:05 See there's your problem - yes that's strongly tied Apr 15 23:21:15 How would I weakly tie it Apr 15 23:22:06 Idk the best way to do this - the app I was working on was an IRC one where I required a global singleton which acted as the model. This meant even when the user left the app the connection could keep going. Apr 15 23:22:26 It depends on what your specific usecase is. Apr 15 23:22:28 Maybe a WeakReference Apr 15 23:23:17 For now I think Ill just set the view to null in the presenter on disconnect, let the model finish up and then the presenter and model will die together Apr 15 23:23:49 Fair enough. Apr 15 23:24:00 Would you say its a _bad_ idea? Apr 15 23:24:56 Well not necessarily bad but more that I don't like it too much. I feel that presenters are to do with presenting data to the user. If there is no place to present it (i.e. no view) why should the presenter even be alive? Apr 15 23:25:17 Ah true Apr 15 23:25:32 So for a second lets say there is no model, just View <-> Presenter Apr 15 23:25:51 View has reference to the Presenter Apr 15 23:26:00 Presenter has reference to the View Apr 15 23:26:07 No no. View doesn't have a reference to the presenter Apr 15 23:26:18 Yes mine does Apr 15 23:26:22 View doesn't care who is presenting it - it could be an activity for what it cares Apr 15 23:26:27 Oh right for yours Apr 15 23:27:07 The View needs to call methods on the presenter though tilal6991 Apr 15 23:27:31 It needs ref to the presenter Apr 15 23:27:37 Hummmmmmm. I don't think it necessarily should though. If there are listeners, the presenter should be registering them on the view Apr 15 23:28:53 I guess we have it set up differenct Apr 15 23:29:00 *differently Apr 15 23:29:07 Yes it does sound like it Apr 15 23:29:49 Say button A is clicked in the View Apr 15 23:29:59 _presenter.buttonWasClicked() Apr 15 23:30:18 Then I have a listener method that gets the result or whatever the presenter needs to pass back to the view Apr 15 23:32:00 Does that make sense Apr 15 23:32:34 Sure it's similar to what I played around with except with the extra layer Apr 15 23:33:40 Right Apr 15 23:33:51 Wait how come you didnt end up using it long term though? Apr 15 23:34:33 Because I discovered React and an implementation for Android: https://github.com/zserge/anvil Apr 15 23:35:07 And also Redux and an implementation also: https://github.com/brianegan/bansa Apr 15 23:35:07 Interesting, I have a project all built out, but a month until the dealine so I think im gonna convert it to MVP Apr 15 23:35:27 Yeah definitely don't recommend those for a proper project yet Apr 15 23:35:38 Those libs you showed? Apr 15 23:35:48 Well Anvil maybe but not Bansa Apr 15 23:35:51 It's too experimental ATM Apr 15 23:35:55 Changing too quickly Apr 15 23:35:56 You think MVP is solid? Apr 15 23:36:01 By the way I desctibed it Apr 15 23:36:13 I mean React and Redux are pretty new themselves Apr 15 23:36:41 I mean you're not relying on a library or anything and the pattern itself has been around forever for desktop apps Apr 15 23:36:57 It's just new to Android dev I guess after people found the limitations of Fragments Apr 15 23:37:13 Right Apr 15 23:37:18 I think im gonna go with it Apr 15 23:37:29 Got a month until when I'd like to have an alpha version Apr 15 23:37:32 Plenty of time Apr 15 23:38:48 Anyways, good to talk with you tilal6991 Apr 15 23:38:54 I'm gonna log off for now Apr 15 23:39:03 Cool nice chatting to you too :) Apr 15 23:39:20 Hope to see you on here again Apr 16 00:40:35 Napalm you there ? Apr 16 00:57:58 ah , finally an android book that looks interesting http://www.informit.com/store/android-concurrency-9780134177571 Apr 16 01:29:10 holy fucking shit what a week Apr 16 01:30:39 RustyShackleford: welcome to the weekend! Apr 16 01:30:55 stayed late today Apr 16 01:31:05 but they have literally no reason to contact me over the weekend Apr 16 01:31:12 or someone will be murdered Apr 16 01:38:18 RustyShackleford i have a feeling they will call you, and you'll just come in anyhow Apr 16 01:40:26 anyone have any good reads for today/this week? Apr 16 01:40:43 * Ping_2_Ur_Pong wants to write some open source software so is pretty much looking for something to dive into. Apr 16 01:42:49 anyon ehave thoughts on atom? Apr 16 01:44:07 g00s: well i can do it from home hah Apr 16 01:44:19 i did mondays shit even Apr 16 01:45:44 why do it from home - its the weekend, have boundaries Apr 16 01:46:32 * Ping_2_Ur_Pong needs something to look into, he's done enough Android coding for this week. Apr 16 01:47:31 Ping_2_Ur_Pong how about UI design :P Apr 16 01:47:46 Ping_2_Ur_Pong: spend some time practising your juggling Apr 16 01:47:48 * Ping_2_Ur_Pong kicks g00s in the shin Apr 16 01:48:25 * Ping_2_Ur_Pong wants to code something. Leeds, I hope that isn't an Insane Clown reference, I will instantanously lose all respect for you. Apr 16 01:48:46 nope, perfectly sane clown Apr 16 01:49:07 also, I was planning at one point to make a juggling simulator - there's a pretty good one in xscreensave Apr 16 01:51:57 I have a background thread using DownloadManager to queue downloads and then loop, querying for progress. Apr 16 01:52:20 if I wanted to build a head unit for android auto, where would I look for that software? All I can find is app development Apr 16 01:52:38 Once through each progress query loop I use runOnUiThread to post a message to the UI with the current download progress so I can display updates in a progress bar Apr 16 01:53:37 But my UI thread seems to get starved: I go through a lot of query iterations on the background thread, then the UI gets all of its updates all in a row right at the end. Apr 16 01:55:07 I’ve tried a yield() at the end of each loop of the background thread, and also a Thread.sleep(), but neither seem to result in the UI thread getting control back in order to process its updates in a timely manner. Apr 16 01:55:42 Am I wrong to expec that to be workable? Apr 16 01:56:59 The progress meter is in a ProgressDialog. Apr 16 02:03:28 I could try an AsyncTask, but I don’t see why that would be better. Apr 16 02:19:24 g00s: yeah I agree with you... going to have a word with the manager about knowingly planning too much Apr 16 02:19:39 and then being suprised when we just barely get it done Apr 16 02:20:17 its an odd situation being an employee but working with 90% contractors. I feel like i'm the contractor haha Apr 16 02:20:33 Ah … my thread got foreground priority by default :( (So AsyncTask would have been better because I wouldn’t have made that mistake, for one). Apr 16 02:38:57 Hello, does someone know how to fix this error in android studio http://i.imgur.com/vQGUVoD.png Apr 16 02:42:42 * Ping_2_Ur_Pong kind of loves being a contractor when he has to work more than 40 hours Apr 16 02:43:10 * Ping_2_Ur_Pong spends damn near all his time coding anyway so he enjoys when he can get paid to code past 40 hours. Apr 16 02:46:53 damn you guys are quiet tonight **** ENDING LOGGING AT Sat Apr 16 02:59:58 2016