**** BEGIN LOGGING AT Sat Dec 24 03:00:01 2016 Dec 24 04:19:12 Hey guys I am reading dev docs on dataoutputstream/datainputstream. Lets say I have file downloader class, and I am downloading files via asynctask (for example) if I close datainputstream, does that also close my main socket stream? Dec 24 04:20:45 or it will only close main socket if I use .close() in the activity that started the socket connection? Dec 24 11:23:23 Whats the better way to do something in loop with sleep/wait timmer in it and also update/ get updated from UI activity? Dec 24 11:28:21 Sircle_: could you write your question in English? Dec 24 11:29:19 Melatonina: Al seno vekrum electro fins chakhya Dec 24 11:30:21 Sircle_: happy Christmas and good luck Dec 24 11:32:20 Melatonina: I have a UI /activity of course. I want to launch some code when I press 'start' button. THe code launched has some sleep (like thread.sleep()) and some processing. I want to show states of that process in the UI or get the thread updated if a change in a text field occures in UI. Makes sense? Dec 24 11:32:57 Sircle_: it makes much more sense Dec 24 11:33:59 Melatonina: ok, I have all the ears Dec 24 11:34:48 Sircle_: what triggers the processing in the secondary thread? Input from the UI? I/O? Dec 24 11:36:34 Input from UI "start button" or pause button or stop button Dec 24 11:37:34 can you process the work in small amounts? Dec 24 11:38:39 Melatonina: yes but the communication needs to be non-limited to specific data set Dec 24 11:39:39 you may create a state variable (ongoing, pause, stopped), synchronize the access to that variable and check that variable from time to time from the background thread Dec 24 11:41:58 Melatonina: ok, that makes perfect sense but can the Thread t = new Thread() function here. start() started in the activity.java read the class static+ volatile variables on activity.java? Dec 24 11:42:54 Secondly, Is it better to just start a new thread inside MainActivity.java or use a foreground service? Dec 24 11:42:56 as long as you pass a reference to the activity, yes Dec 24 11:43:12 ok Dec 24 11:43:32 I never used a service. Dec 24 11:43:53 Keep in mind that if the activity is terminated, the thread will keep running Dec 24 11:44:14 So you either have to stop the thread in onDestroy() Dec 24 11:44:19 hm. that is an issue Dec 24 11:44:45 or you must setup the things so that the thread has everything it needs to keep working Dec 24 11:45:26 If you terminate the thread in onDestroy() you should wait for it Dec 24 11:45:35 How can I detect that MainActivity.java is active? this way , thread can check it everytime Dec 24 11:45:40 and die if not Dec 24 11:46:23 no, just ask the thread to terminate in MainActivity.onDestroy() and wait for it to terminate Dec 24 11:47:26 If you choose to implement a service, I don't have suggestions because I have no experience with them Dec 24 11:47:49 Melatonina: is it assured that onDestroy() will be called in any case while the activity terminates due to ANY reason? Dec 24 11:48:26 Melatonina: foreground service seemed more systametic but i can go with the new Thread thing for now. Dec 24 11:49:48 I guess that if onDestroy is not called it's because Android is bringing down the whole process, so it doesn't really matter if the thread is not stopped Dec 24 11:50:12 brigding? Dec 24 11:50:24 bringing down = killing Dec 24 11:50:28 hm Dec 24 11:50:30 k Dec 24 11:50:42 One note: I would not make the thread depend on an Activity. I would make the thread and the activity share a data structure Dec 24 11:51:03 how would you make variables synchronized in android? is volative String name; enough as a class variable? Dec 24 11:51:11 This way, even if the activity is killed, the thread can keep working Dec 24 11:51:52 https://docs.oracle.com/javase/tutorial/essential/concurrency/syncmeth.html Dec 24 11:52:09 Melatonina: So I can make a new class MySharedVariablesClass and put the variables there? As both Activity.java and Thread to update it? Dec 24 11:52:32 synchronizing the access Dec 24 11:52:43 yes Dec 24 11:53:15 Melatonina: I guess this is only possbile via methods and simple variables can't be synchronized Dec 24 11:53:35 yes, use synchronized accessors Dec 24 11:54:05 Melatonina: So I can make a new class MySharedVariablesClass and put the variables there? As both Activity.java and Thread to update it? Dec 24 11:54:21 hm Dec 24 11:54:21 synchronizing the access Dec 24 11:54:22 yes Dec 24 11:54:24 yes, use synchronized accessors Dec 24 11:54:27 ok. Dec 24 11:54:32 super Dec 24 11:54:39 Melatonina: no need for loopers? Dec 24 11:54:44 I would read a tutorial about Java concurrency Dec 24 11:54:52 I was going to talk about loopers Dec 24 11:55:22 if your secondary thread just needs to react to inputs from the UI thread Dec 24 11:55:30 you could create a secondary looper Dec 24 11:55:44 and post the work to be done on that looper Dec 24 11:56:13 < Melatonina> if your secondary thread just needs to react to inputs from the UI thread <-- I also want to pass values from thread to UI Dec 24 11:56:49 you have to post runnables on the main (UI) loope Dec 24 11:56:57 Melatonina: but yet again, this looper way gives too much dependancy to thread of UI Dec 24 11:57:07 Melatonina: so looper is not recommened? Dec 24 11:57:27 it really depends on the kind of work Dec 24 11:57:35 hm Dec 24 11:57:38 it doesn't seem your case, tho Dec 24 11:57:51 Melatonina: ok, let me get my hands dirty and make it like we discussed the first time. Dec 24 11:57:56 thread and shared class way Dec 24 11:58:09 Melatonina: thanks. I will be back hopefully before crismans Dec 24 11:58:16 if you need a background thread that does little bursts of work, a secondary looper would be ok Dec 24 11:58:20 if not, happy crismas Dec 24 11:58:36 to you too Dec 24 11:58:44 Melatonina: the worker thread is to run for a very long time Dec 24 11:59:07 ok, then a secondary looper is probably not appropriate Dec 24 12:06:04 Note: The style attribute does not use the android: namespace prefix. Dec 24 12:06:43 Hello guys, from the docs here https://developer.android.com/guide/topics/ui/themes.html#ApplyingStyles there is a note "Note: The style attribute does not use the android: namespace prefix.", does anyone know why? Dec 24 12:07:06 I have a talk next week about styles and themes so I have to understand them correctly Dec 24 12:25:45 It's not an attribute (in the sense), it's used for creating the AttributeSet that's passed to the constructor Dec 24 13:23:49 SimonVT: so its used on compile time? Dec 24 13:41:30 MoshDev: no, still at runtime Dec 24 13:54:56 It looks like animation speed is set once for an entire path, I can't change the speed on individual parts of it without handling each part manually. Izzat right? Dec 24 13:55:07 "of individual parts" Dec 24 16:11:07 Hmm... Dec 24 16:11:29 I think I need a priest to exorcise my code Dec 24 16:13:13 Dagmar: are you preparing yourself to celebrate Christmas? Dec 24 16:13:17 aren't Dec 24 16:13:34 Well, I was hoping to do a nice push for my users this morning Dec 24 16:13:40 Instead, I am staring into the abyss Dec 24 16:14:11 I've got a thing that's going through a list of names, and generating a small array based on the first letter *and* whether or not the critter is in the game Dec 24 16:14:27 I am doing Log.d statements in several places so I can see that it's excluding the names it should Dec 24 16:14:34 ...yet they're ALL getting buttons anyway Dec 24 16:14:39 It's f'ing creepy Dec 24 16:16:07 I'm gonna go with "possible stale objects in build" and maybe splash some holy water on the motherboard Dec 24 16:16:26 clean build Dec 24 16:17:00 12 "Out Father" Dec 24 16:17:07 who art in heaven... Dec 24 16:17:29 8 "Holy Mary" Dec 24 16:17:50 remove all the code Dec 24 16:17:56 re-add it piece by piece Dec 24 16:18:15 That might be on the table Dec 24 16:18:17 what kind of app is it? Dec 24 16:18:24 One of the log.d lines was in the loop that populates the buttons Dec 24 16:18:43 Seeing it log adding five buttons, and then having nine on the screen.... wtf Dec 24 16:20:10 Melatonina: It's actually a Pokemon Go companion app Dec 24 16:20:24 I have all the crap written to do the theorycrafting Dec 24 16:20:42 At the moment it's mainly a detailed pokedex, but the bits I'm sorting now are the type calculator Dec 24 16:20:56 It's SUPPOSED to only be presenting a list of pokemon with names beginning with the selected letter Dec 24 16:21:10 ...except it's demonstrating some very disturbing quantum things Dec 24 16:21:20 I thought you worked on some Android video thing Dec 24 16:21:39 I mess with a lot of stuff in Android but I generally avoid video Dec 24 16:22:32 wrong person then Dec 24 16:28:50 found the bug Dec 24 16:28:55 It's still terrifying Dec 24 16:29:12 Next week I remove every damn duplicated function from this code Dec 24 16:30:29 why do you have duplicated functions in your code in first place? Dec 24 16:31:27 Because when I started I didn't know that services couldn't use fragments Dec 24 16:31:43 I'm still paying the price for that one Dec 24 16:31:49 I should learn services. I don't know anything about that Dec 24 16:33:53 I didnt' even think about the "no UI" thing since I am actually using the service to provide an overlay Dec 24 16:38:19 It still looks like somehow both the intended and the legacy versions of these routines are running at the same time, but I'm going to just sprinkle some holy water on the box and ship it anyway Dec 24 16:40:13 holy water debugging Dec 24 16:40:27 man, don't put an on your CV Dec 24 16:40:30 :D Dec 24 16:41:16 Nah, considering I started working with AS 8 months ago I'm doing pretty damn well at this Dec 24 16:52:02 Well, _heavily_ working with AS Dec 24 16:52:20 I've done *much* stranger things than holy water debugging and made them work Dec 24 17:08:54 Hello everyone Dec 24 17:20:36 Hello AnT00961 Dec 24 17:20:48 Merry Christmas Dec 24 17:26:07 Merry Christmas Dec 24 17:29:01 Merry Christmas. Dec 24 17:29:08 And Happy Chanukah. Dec 24 17:29:38 and please stop writing in private Dec 24 17:30:11 And stop saying hello to a room of 400 people Dec 24 17:33:12 Good afternoon. Dec 24 17:33:23 HELLO 400 PEOPLE! Dec 24 17:33:51 ooo. Dec 24 17:33:52 https://github.com/yakivmospan/scytale Dec 24 17:34:58 OoooooOOooo Dec 24 17:35:42 Mavrik: are you the one who works on video apps for Android? Dec 24 17:35:58 I worked on video and I work on apps for Android :P Dec 24 17:36:05 What's up? Dec 24 17:37:12 Mavrik: I've been thinking about doing some video stuff for android. Dec 24 17:37:17 Nothing particular. I just realized I mixed your identity with Dagmar in my mind. Dec 24 17:37:41 puff, there are better ways for hurting yourself :) Dec 24 17:37:53 Sadly handling video isn't easy in best of cases :/ Dec 24 17:37:57 Mavrik: Did a fun project last year where I took video feed from an IP camera and added AI targeting boxes. Somebody else did the AI, I just did the boxes :-). Dec 24 17:38:11 Mavrik: Yeah, it's un-fun. Still... Dec 24 17:38:25 Mavrik: I should clarify, the app I'm talking about was a java desktop app, not android. Dec 24 17:38:46 Right now I'm debugging on an app that uses mapbox. Dec 24 17:38:55 Trying to make it more stable, etc. Dec 24 17:41:16 OpenCV I guess? Dec 24 17:42:26 For the map app? No. Dec 24 17:43:01 For the AI, also no... that was a startup I was consulting for. Nice guys, very sharp with AI/C++, but not experienced programmers. Dec 24 17:44:18 I've messed around the tiniest bit with opencv in python, that was for a light sculpture that I was helping an artist with. I was using some of the image processing to distort images for artistic effects. Dec 24 17:45:51 This https://www.youtube.com/watch?v=X9cBH8RsK9k Dec 24 17:56:36 AnT00961: so what was you problem? Dec 24 18:06:58 i need a developer to help me privately Dec 24 18:11:02 AnT00961: you want to pay for personal support? Dec 24 18:11:21 yes Dec 24 18:18:17 Hello peeps, I have been writing a really simple movie exploring app and was looking to get some advice on how I can refactor my main activity to be reusable for different categories of movies. Dec 24 18:18:55 I just posted the code on git Dec 24 18:18:55 https://github.com/atbe/AndroidMovieBrowser Dec 24 18:20:11 Now my main concern is this: I have a custom Adapter for the movies when I place them in a listview and some of the data the adapter uses is gotten from a member variable in the activity class and so I am not sure if I should nest the adapter so I can make a base class Dec 24 18:20:39 Line 179 is the only difference between each "category" I am talking about Dec 24 18:20:39 return api.getMovies().getTopRatedMovies("en", CurrentMoviePage++); Dec 24 18:21:23 So, should I make this an activity base class or should I go to fragments instead Dec 24 18:22:03 you probably could turn your current code in a fragment Dec 24 18:22:25 Essentially the app should have a main activity with the following options = "New Releases" "Upcoming Releases" "Top Rated Movies" Dec 24 18:22:27 and use a view pager to display a fragment for each of the categories Dec 24 18:22:54 Clicking an option will take you to the exact same view except that the private ArrayList movieItems = new ArrayList() array is populated with different objects Dec 24 18:23:09 View pager, I will go look into those now Dec 24 18:23:40 google for "android tabbed UI" or something like that Dec 24 18:24:29 atbe: http://www.androidhive.info/2015/09/android-material-design-working-with-tabs/ Dec 24 18:24:47 Yeah, I have done some reading on the tabbed UI. That would be a good option and I will go try to implement that now. But the big question now is, should the adapter class be nested in the adapter class? Dec 24 18:25:05 @Melatonina awesome-sauce, will read that page now Dec 24 18:25:06 your question is unclear Dec 24 18:25:22 "should the adapter class be nested in the adapter class?" Dec 24 18:25:23 This class https://github.com/atbe/AndroidMovieBrowser/blob/master/app/src/main/java/com/atbe/abe/topmovieslist/MovieListItemAdapter.java Dec 24 18:25:35 Take line 57 as an example Dec 24 18:26:18 I could just extend the MovieDb class and add the image and url into the object but I don't want to do that if I do not have to in order to keep the MovieDb object consistent with the library Dec 24 18:26:42 People use RecyclerView nowdays Dec 24 18:26:47 nowadays Dec 24 18:26:56 Actually, that may be the best option to remove the reliance with the MainActivitiy class Dec 24 18:26:58 Yep Dec 24 18:27:12 I'll go read up on that Dec 24 18:27:53 atbe: I don't completely understand your problem with that line. You just want to pass enough information to the adapter so that it can fetch the appropriate set of data Dec 24 18:27:55 Once you wrap your head around the abstraction no one writes good documentation for, recyclerview are easier Dec 24 18:28:35 Melatonina So I can pass more objects to the Adapter class? Dec 24 18:28:44 Dagmar abstraction as related to? Dec 24 18:28:58 Separating the view from the data Dec 24 18:29:15 atbe: this is my favorite RecyclerView tutorial. The example is a movie database. http://www.androidhive.info/2016/01/android-working-with-recycler-view/ Dec 24 18:29:16 Yeah, that is probably the one thing that is difficult for me to design around Dec 24 18:29:26 Ha, perfect Melatonina Dec 24 18:29:29 Once you "get it", it's much easier than the other methods Dec 24 18:30:03 Melatonina What is a RecyclerView a good replacement for? Dec 24 18:30:08 This is just one of the places where people want to write docs for things on their blogs and they don't understand that it's not helpful to write documentation that's also in java Dec 24 18:30:17 i.e. you need to understand it before it can make sense. Dec 24 18:30:26 atbe: use RecyclerView instead of ListView Dec 24 18:30:34 Melatonina I see. Dec 24 18:30:48 Dagmar I hear ya, in time I hope I will Dec 24 18:30:51 atbe: It's a memory-efficient and computationally-efficient replacement for listviews, gridviews, etc Dec 24 18:30:56 the example dataset of that tutorial is a movie database Dec 24 18:31:13 so you basically copy and paste it and you have your app Dec 24 18:31:16 Dagmar Melatonina you two rock, thanks a ton Dec 24 18:31:19 just put your name on it Dec 24 18:31:25 Melatonina lol, pwnd Dec 24 18:31:32 and million$ will flow towards you Dec 24 18:31:59 I converted a 151 item (three elements apiece) listView which took about a second and a half of wall-clock time to render into a RecyclerView and the render time was more or less instantly negligble Dec 24 18:32:23 lol, I'm mainly here for the learning experience and to learn more about state machines. Mobile phones are fun for that because I can play with the program in my hand and it might even be useful Melatonina Dec 24 18:33:20 Dagmar interesting, so ListView does render entirely on load? What was the point of the ArrayAdapter getView convertView argument? Dec 24 18:33:21 atbe: I was joking. Anyway, if you play with the ViewPager tutorial and the RecyclerView tutorial and learn to write a fragment, you should be ok Dec 24 18:33:58 shweet Melatonina lol yeah ik I figured I could share my goal anyways Dec 24 18:34:09 :) Dec 24 18:34:47 Thanks again. Might ask you guys some more idiom questions along the way Dec 24 18:34:56 ListView _does_ render the whole thing at a go Dec 24 18:35:00 I've no idea what you were doing in your code tho Dec 24 18:35:04 Dagmar ....bastard Dec 24 18:35:09 not you, listview Dec 24 18:35:24 Time to make a new branch :/ Dec 24 18:38:33 idiom questions? Dec 24 19:49:19 What might cause "Unable to start activity ComponentInfo" for a custom view that subclasses SurfaceView? Dec 24 19:52:17 I have constructors that take a Context and a Context + AttributeSet Dec 24 19:52:26 and they're both public Dec 24 20:10:05 einzige: who cares? It's Christmas! Dec 24 20:13:25 true, true Dec 24 21:47:05 is there any orm library that supports both nested objects and content provider generation? Dec 24 23:06:57 hello, i have a question if is possible with my poor english ... I newbie aosp kitchen and i'm working on a vendor custom folder and into my config.mk file i want to write a $(shell mkdir -p $(PRODUCT_OUT)/folder) but PRODUCT_OUT var appears to be empty and it create folder in my linux root filesystem, why, please? Dec 24 23:22:15 Hi. Is the android sdk location the android-sdk/tools folder or the android-sdk folder? Dec 24 23:22:41 I mean - where to point the ANDROID_HOME env variable? Dec 24 23:23:12 Karkoon: /usr/share/android-sdk Dec 24 23:23:36 share? I have it in usr/local... but thanks! Dec 24 23:27:28 No one knows how to answer me, please? Dec 24 23:45:03 asdf_: you want to ask that in #android-root, this channel is for app dev Dec 24 23:53:40 Napalm: ok, sorry .. **** ENDING LOGGING AT Sun Dec 25 02:59:59 2016