**** BEGIN LOGGING AT Sat Mar 05 02:59:58 2016 Mar 05 04:37:20 hi Mar 05 04:40:06 I have a quad hd image for the background of my fullscreen activity. Now if I do it in xxxhdpi and a bigger device with also quad hd resolution will get a lower resolution of the file or because the dpi is lower (but is also quad hd) or do I understand this wrong? Mar 05 04:41:12 but since it covers the whole screen it is more resolution based not really dpi based Mar 05 04:59:11 any idea? Mar 05 05:09:23 I want to make a layout for list items Mar 05 05:09:50 3 or 4 pieces of data. I never know which layout to pick, I'm embarassingly bad at UI Mar 05 05:11:25 why not linearlayout or relativelayout Mar 05 05:11:46 relativelayout seems like the one Mar 05 05:12:12 isn't relativelayout expensive? like not as efficient as others Mar 05 05:13:10 I remember reading an article about efficent layouts and anti patterns you should avoid. Wish I could find it again Mar 05 05:14:29 it is fine to use if you don't have too many complex nested layouts Mar 05 05:15:08 well also curious about more complicated layouts Mar 05 05:15:13 but android studio would warn you in this case... Mar 05 05:15:21 finding myself doing lots of UI stuff at work and its a mess Mar 05 05:15:43 I dunno, know of a crash course on UI design? I gotta search for a dev summit video or something Mar 05 05:15:58 particularly reusing layouts Mar 05 05:16:08 oh my god the redundancy Mar 05 05:17:02 how about this http://developer.android.com/guide/topics/ui/declaring-layout.html you also see the most common layouts there Mar 05 05:17:32 nested layout is fine but nested weight layout should be avoided Mar 05 05:18:06 linearlayout with weight (percentage) Mar 05 05:18:37 yeah I came across this exactly today Mar 05 05:19:02 lots of wierd things happened in a file that used a linearlayout with weight Mar 05 05:19:20 oh nested weight. hm I'll look into that Mar 05 05:25:48 RustyShackleford: just dont nest layouts if possible Mar 05 05:32:23 I have a quad hd image for the background of my fullscreen activity. Now if I do it in xxxhdpi and a bigger device with also quad hd resolution will get a lower resolution of the file or because the dpi is lower (but is also quad hd) or do I understand this wrong? Mar 05 06:01:33 do I really need an ORM? Mar 05 06:02:07 er I mean, given the option what would you do? Built in SQL features, or a library? Mar 05 06:02:23 of course not ... Mar 05 06:12:02 so happy Mar 05 06:14:19 hm, this looks like some kind of wizard thing .. http://developer.android.com/reference/android/support/v17/leanback/app/GuidedStepFragment.html Mar 05 06:14:24 wonder why its only for TVs Mar 05 06:14:34 lol who does google tv development Mar 05 06:34:02 I have a question on MVP with Android if anybody here is very familiar with it Mar 05 06:41:18 david karnok is porting rxjava 2 to C# ... i thought they already had an Rx impl Mar 05 06:46:53 sorry I just want to ask what could I have possibly done wrong when some errors such as Illegal arguments button does not exist even if I correctly identify the button with its id Mar 05 06:47:10 android:id="@+id/actionButton" Mar 05 06:47:18 I am trying to create a widget Mar 05 06:50:17 I tried google already Mar 05 07:02:21 easyOnMe: post your code, as well as the error Mar 05 07:02:43 let me redo the whole thing again Mar 05 07:02:49 if there are still errors then I will post Mar 05 07:02:50 thanks Mar 05 07:09:53 how do I name my package if I don't own a url? Mar 05 07:10:16 easyOnMe, always use + when referencing an id Mar 05 07:10:27 com.rusty.myapp Mar 05 07:10:35 well, a domain related to my project Mar 05 07:10:38 hah yeah Mar 05 07:10:44 I use lampy Mar 05 07:11:11 com.brokentoeproductions.myapp Mar 05 07:11:13 sort of a nickname that my friends know I hate, makes fun of my last name Mar 05 07:11:22 com.lampy.myapp Mar 05 07:11:41 I want to put this in the play store. I don't necessarily need to buy a domain for this though Mar 05 07:12:09 holy fuck man, I still can't walk. I'm walking on it now, but with crutches for support Mar 05 07:13:22 http://pastebin.com/DDnRaudM that is my activity_main.xml Mar 05 07:14:48 MainActivity.java: http://pastebin.com/Jnfg2U22 Mar 05 07:16:11 simple_widget_info.xml inside the res/xml folder: http://pastebin.com/Cph1hkQx Mar 05 07:16:50 Android manifest file: http://pastebin.com/bXWZjy7h Mar 05 07:17:14 please tell me what I did wrong as the app still keeps giving me the Illegal arguments buttons does not exist ) Mar 05 07:17:20 please tell me what I did wrong as the app still keeps giving me the Illegal arguments buttons does not exist 0 Mar 05 07:25:25 ofc is closing need to go Mar 05 07:25:41 hope when I log it I still can get your replies when I post the question again Mar 05 07:25:42 bye Mar 05 08:14:31 Hi, how do I fix this error: Error:Execution failed for task ':app:transformClassesWithMultidexlistForDebug'. Mar 05 08:14:31 > com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command 'C:\Program Files\Java\jdk1.8.0_73\bin\java.exe'' finished with non-zero exit value 1 Mar 05 08:14:47 I'm using android studio Mar 05 08:17:11 and jdk 8 Mar 05 08:41:12 is it possible to have android studio show you where code broke when the app unexpectedly quits while youre in debug mode? like how visual studio will go right to a line when a program throws an exception/breaks Mar 05 08:50:49 emceelovin: that would be cool Mar 05 08:51:02 I think you just need to read the stack trace Mar 05 08:56:11 oh good idea. yeah it would be nice. its amazing how you can notice immediately what youve been spoiled with forever Mar 05 09:00:23 You can set it to break on exceptions Mar 05 09:00:30 so its better than nothing Mar 05 09:00:45 that sounds pretty close to what i need Mar 05 09:01:18 i just checked both any exception boxes. hopefully that helps a litte Mar 05 09:01:19 Run->View Breakpoints Mar 05 09:02:00 yeah already got it Mar 05 09:02:28 just kinda sucks because it literally breaks at every exception now lol. Mar 05 09:02:34 but this is good Mar 05 09:11:19 sorry to ask this again Mar 05 09:11:54 earlier I made a question about some error message popping up in my android studio saying illegal arguments Mar 05 09:12:00 button does not exist Mar 05 09:12:21 despite using the correct id for the button I kept on getting the error message Mar 05 09:12:47 I am trying to create a simple widget only but this error message gets in the way and I could not figure out what is wrong Mar 05 09:13:07 I was in the office when I ask this but we were closing so I had to log out Mar 05 09:13:18 I just wonder if someone gave an answer Mar 05 09:18:07 activity_main.xml file: http://pastebin.com/01BA7me7 Mar 05 09:18:32 MainActivity.javafile: http://pastebin.com/XT6a0wFS Mar 05 09:18:54 simple_widget_info.xml file: http://pastebin.com/1KHYFkHu Mar 05 09:19:17 Android Manifest file: http://pastebin.com/PZLfQ9KZ Mar 05 09:25:05 sorry to ask this again Mar 05 09:25:14 earlier I made a question about some error message popping up in my android studio saying illegal arguments Mar 05 09:25:21 button does not exist Mar 05 09:25:28 despite using the correct id for the button I kept on getting the error message Mar 05 09:25:30 im calling the police Mar 05 09:25:49 I am trying to create a simple widget only but this error message gets in the way and I could not figure out what is wrong Mar 05 09:25:56 I was in the office when I ask this but we were closing so I had to log out Mar 05 09:26:13 I just wonder if someone gave an answer that I missed Mar 05 10:13:56 Could not identify launch activity: Default Activity not found Mar 05 10:13:59 I got this message Mar 05 10:14:11 can anyone help me this message Mar 05 10:14:46 I just tried to follow an online tutorial on creating a widget and after running it for a while I got nothing on the android phone Mar 05 10:14:53 and found this out in the log Mar 05 10:37:55 hi. i'm developing an android widget and need some help. is there anyone here who can help me? Mar 05 10:40:47 How can I use VectorDrawable in the Toolbar? app:srcCompat does not seem to be supported in the Toolbar Mar 05 10:45:31 hey yall Mar 05 10:45:37 hi Mar 05 10:46:24 Does amy one got an idea on how to upload pictures or videos to firebase in order to use it with VideoView in android studio ... Mar 05 10:46:57 all what i understood so far reading about it and learning about firebase is that the uploaded files should be JSON ? Mar 05 10:47:16 and i guess with 10MB limit Mar 05 10:47:39 not sure how to convert a vid to JSON and then upload it to firebase ? or is there another way to do that ? Mar 05 12:35:52 now, how to use VertorDrawable in menu indeed? Mar 05 12:36:59 it's ignoring app:srcCompat tag and android:icon=@some_vector_drawable have no effect also Mar 05 12:41:12 Hello. I am trying to use Ionic Push to send push notifications. My notifications get "queued" but never received by my device. Also, the device token changes from one app run to another. Is this normal? Mar 05 12:44:23 dinosauranus: don't ask to ask just ask (c) Mar 05 12:46:12 Rashad: never tried Ionic Push. But Parse have dashboard where one can see if devices was registered correctly Mar 05 12:46:21 *had Mar 05 12:46:40 Parse? Mar 05 12:47:07 yes, Parse Mar 05 12:52:14 ah, Ionic is in alpha or beta. so could be anything really) Mar 05 12:53:03 Yes that's right. I am having a look at OneSignal right now. Mar 05 13:22:12 pux: check out: http://stackoverflow.com/questions/35813199/how-can-i-use-vectordrawable-with-the-android-toolbar/35814509#35814509 Mar 05 13:23:39 Anyone used MTP over OTG? I want to for a camera set up. Mar 05 13:23:42 pux: in a word - wrap it with StateListDrawable for example Mar 05 13:23:48 Community documentation seems.. limited Mar 05 13:23:49 and old. Mar 05 14:07:45 vigilancer: thanks alot mate Mar 05 14:16:33 hm https://scontent.xx.fbcdn.net/hphotos-xlf1/v/t1.0-0/s526x395/12806217_10153377706666821_2124751338439608475_n.jpg?oh=d9c6fef6644dad5eb9f840c5dc5e3d43&oe=57937721 Mar 05 14:19:29 for an app I'm making, I've implemented some sort of stepcounter, and in its own activity it works as intended Mar 05 14:20:02 but I wonder if I have to implement it in a service if I want to keep getting data from the accelerometer into my algorhytim Mar 05 14:20:16 algorhytm* Mar 05 14:21:00 and say if I do implement it in a service, would that drain the battery? (is there a rule about how much polling an app should do?) Mar 05 14:23:24 hi, i want to ask if i need to do addToBackStack(null) on any new fragment that i replace ? ;] Mar 05 14:55:39 Hello guys. I want to make a dictionary from a sqlite database. I'm looking for Open Source app that I can use. Mar 05 14:56:13 I don't want those that download dicts. I want a one that can use a preconfigured database. Mar 05 15:01:38 er... you want to make an app from an epub, or a dictionary from a database? Mar 05 15:05:26 Candyman: you dont need unless you want the backstack functionality Mar 05 15:08:05 Hello. Is there a way to group push notifications? Or maybe to update them? Mar 05 15:26:00 is there a simple library that i can use to generate QR code bitmaps offline? Mar 05 15:29:19 Leeds I want to make a dictionary from a Sqlite database first Mar 05 15:30:10 I also want to make a book from an epub. Mar 05 15:30:10 But these two are seperate apps. Mar 05 15:50:18 Hey Mar 05 15:52:54 I have an utility singleton that exposes some methods to query some data. The data I put in a XML file. I need to load the XML file for the singleton to work. Problem: I can't access getResources().getXML() from the singleton since it's not an activity. What do? Mar 05 15:53:19 Hello everybody. Please, can anybody help me with using of internal (not public) android classes. I need to import com.android.systemui.statusbar.phone.StatusBarIconController and was not able to find a solution yet. Thank you. Mar 05 15:59:33 little-fish: You can’t do so in Android Apps, sadly. Mar 05 15:59:43 that’s just another thing Google prefers to hide. Mar 05 16:01:02 justJanne: according to https://github.com/anggrayudi/android-hidden-api there has to be a solution! Mar 05 16:01:58 little-fish: then use that project Mar 05 16:07:50 justJanne: actually I can not :) The class I need comes from newer API Mar 05 16:17:52 I guess I'll have to use Kivy (Python for Android) for my dictionary. Mar 05 16:19:09 Hello. I'm currently drawing a background on a custom View and scrolling it towards the left. Unfortunately the background appears to stutter as it scrolls and I'm not sure what is causing that behaviour. Anybody have any pointers on what I should look into or any tools I could use to help diagnose this? Mar 05 16:26:02 so a Rx library to wrap Google Fit. i guess everything needs an Rx wrapper ? Mar 05 16:26:34 * g00s glad not maintaining anyone else's code Mar 05 16:27:21 yep, everything needs an Rx wrapper. Mar 05 16:27:32 do people actually use this android studio ide? Mar 05 16:27:47 :O Mar 05 16:27:55 odraencode, nooooo Mar 05 16:27:59 People use nano. Mar 05 16:28:13 /s Mar 05 16:29:43 Mavrik: that actually sounds more useful than the IDE Mar 05 16:30:52 I can't zoom in with my mouse, I can't regex replace, and the stupid thing auto completes too much all the time :/ Mar 05 16:31:20 nano will fix the autocomplete problem for sure Mar 05 16:32:29 ugh D: Mar 05 16:32:34 I hate android and java! Mar 05 16:33:00 I use Atom, SublimeText, Gedit, Also Jetbrains IDE Mar 05 16:33:21 It was so easy making this XML file in Python and now it's hell to get Java to read it Mar 05 16:33:22 odraencode, then I suggest you pick up JavaScript and go away? Mar 05 16:33:43 What's the point of spamming channel here if you don't want to use Android or Java? Mar 05 16:34:15 I want to use it, but I'm not liking to use it Mar 05 16:34:17 dom96, hmm Mar 05 16:34:24 dom96, stutters in what kind of way_ Mar 05 16:34:26 ? Mar 05 16:35:07 Mavrik: kind of like in this video: https://www.youtube.com/watch?v=cnST1QzoDw4 Mar 05 16:35:22 odraencode: you're going at this life thing wrong man Mar 05 16:35:31 Mavrik: it doesn't seem to scroll at the same pace throughout Mar 05 16:35:34 ik :( Mar 05 16:35:41 dom96, I suggest you grab systrace and see what's causing delays on drawing thread Mar 05 16:35:51 dom96, so, run systrace, do the scroll, see the output graph Mar 05 16:35:57 (There's a guide on android developers) Mar 05 16:36:03 And you'll quickly see what causes stutters Mar 05 16:36:14 Mavrik: will do, thanks. I found a code sample which uses SurfaceView and it scrolls smoothly Mar 05 16:36:20 https://developer.android.com/tools/debugging/systrace.html Mar 05 16:36:24 odraencode, Java is great when you get to use it properly Mar 05 16:36:38 dom96, might be that you're redrawing a huge image when you probably wouldn't have to or something, hard to say :) Mar 05 16:36:56 OverCoder: I see... I see... Mar 05 16:37:05 Is there a way to make an app without Java? Mar 05 16:37:13 odraencode, I know Python makes programming look easy. When I look at Java I'm like what is this Jubberish. Mar 05 16:37:35 Android app? well you need some Java, but you can use C/C++ and/or Python Mar 05 16:37:40 Kivy. Python for Android. You can compile app to Android and IOS Mar 05 16:37:42 But I still think you need Java, not sure though Mar 05 16:37:47 Mavrik: I'm guessing it's something to do with the way the draw thread interacts with the custom View Mar 05 16:38:16 No Pure Python and simple (KV languagefor GUI) Mar 05 16:38:18 I stripped out everything in my project, down to a simple ~500x500 image which I scroll and it still has the same issue. Mar 05 16:38:47 dom96, how do you do the scroll? Mar 05 16:39:17 http://kivy.org/ Mar 05 16:39:47 Mavrik: I just decrement an x value. Mar 05 16:39:50 This looks great. Mar 05 16:39:57 Mavrik: every frame Mar 05 16:40:01 Now I can make apps with python, and more importantly, I can use python Mar 05 16:40:06 dom96, of what? Do you redraw on every frame? How are you rendering? Canvas custom view? Mar 05 16:40:37 You can even call Java code from Kivy using pyjnius Mar 05 16:41:20 OverCoder Forgot, You can also use PhoneGap or Cordova for hybrid apps. Mar 05 16:41:25 Mavrik: I've got a Vector2 object as a field of my class, its x coordinate is decremented. The decrement happens every frame right before the redraw, which I perform via postInvalidate() in a new thread on a custom View. Mar 05 16:41:53 Hmm, that's not the most efficient way of doing that :/ Mar 05 16:42:12 Numix, ew Mar 05 16:42:14 By far the best result is if you have a view that you just shift via translateX Mar 05 16:42:21 Numix, Hybrid apps are bad and sluggish Mar 05 16:43:01 meh, it all ends up to using java in android Mar 05 16:43:12 otherwise dont bother Mar 05 16:43:18 hm I wonder if I can use ColorMatrix for what currently is done using IndexColorModel in my code hm.. Mar 05 16:43:20 Mavrik: I've used canvas.translate() too and I ended up with the same issue. But as far as I can tell, translate() will pretty much do the same thing right? Mar 05 16:43:38 dom96, well, that still does the redraw Mar 05 16:43:56 while using translateX on a drawn view, it'll only draw once and then just move the view while compositing Mar 05 16:44:07 BUUUT.... you should easily get 60fps with 500x500 bitmap redraw on every frame Mar 05 16:44:12 So you have something else going on. Mar 05 16:44:16 So use systrace :) Mar 05 16:44:24 Mavrik: well, I am only redrawing once anyway. Mar 05 16:44:58 not sure I get how translate can make this more efficient Mar 05 16:45:09 but yeah, 500x500 bitmap should be no issue anyway Mar 05 16:45:37 I disagree. Jquery mobile is ugly, but Ionic apps look native. Mar 05 16:45:51 They almost look native Mar 05 16:46:56 Mavrik: In any case, I need to leave for a while. Thank you very much for your help. I will report with my systrace results later if I can't make sense of them :) Mar 05 16:47:13 quit Mar 05 16:52:27 Numix: none of the Ionic apps they showcase look and feel native Mar 05 16:52:37 and I recently used one that looked native, Mar 05 16:52:44 but performance was SHIT. Mar 05 16:52:49 Shit in bold and caps. Mar 05 16:52:57 Literally 30sec to open the navigation drawer. Mar 05 17:02:07 I guess I'm used to Hybrid apps. Many regional apps in my countries are shitty apps. They made an app that linked to a few government sites. Basically a single page with a dropdown clicking the go button takes you to the site. It has startupads and a lot of installs. Mar 05 17:02:49 The app actually starts on boot though it has about what "10 lines" of code Mar 05 17:03:03 That too Javascript Mar 05 17:03:24 lol Mar 05 17:03:47 well, here every city’s transit authority has their own native, material, fully themed native app Mar 05 17:03:49 what a waste Mar 05 17:04:39 luckily, all their backends are compatible, so you can use any city’s app to buy tickets for any other city, as all of them use the HAFAS backend anyway Mar 05 17:07:57 Mavrik quick Q; looking at Gmail - SlidingPaneLayout behavior (or nav drawer) some aspect of this animation has me confused. If you open and close the pane , you notice alpha changing to show / hide things - but in a few places the distance between items changes subtly - do you know how they do that ? Mar 05 17:08:08 for example, distance between 'All inboxes' and 'Inbox' - that divider there changes alpha but the space between them does too Mar 05 17:09:17 i wonder if they are just changing properties of one layout, or cross fading two totally different layouts Mar 05 17:24:31 what does a BadParcelableException mean? its evidently not finding my parcelable class while unmarshalling Mar 05 17:25:03 ive used the correct ClassLoader (afaik), and implemented all the methods i should be i think Mar 05 17:37:46 Uhm, why my files aren't grouped as they used to in Android Studio? Mar 05 17:38:06 I mean the project was organized in a neat way, not it's just a tree of folders Mar 05 17:38:25 now* Mar 05 18:16:52 Hey, I have an MVP question: how much access should the Presenter have to individual views? I need to set up a ViewTreeObserver to set up some padding with a coordinator layout and it feels like that should be managed in the Presenter, but it also feels like that requires me operating directly on a view which should be happening in the View layer Mar 05 18:25:36 capella http://news.slashdot.org/comments.pl?sid=8836539&cid=51642315 Mar 05 18:26:36 g00s: oh, ouch Mar 05 18:27:18 drinfernoo: maybe you writing/reading fields in wrong order Mar 05 18:27:25 wild guess Mar 05 18:30:17 OverCoder: open Project side pane. take a look at top of it. find menu on top left Mar 05 18:32:44 vigilancer, hm? what do you mean? Mar 05 18:32:54 I have the pane brought up, but what do I do with it? Mar 05 18:37:51 OverCoder: do it have dropdown menu? Mar 05 18:38:18 vigilancer, Yes Mar 05 18:38:59 OverCoder: try to pick another item from menu Mar 05 18:39:25 I believe AS have there special view mode Mar 05 18:39:32 hmm Mar 05 18:39:34 * OverCoder tries Mar 05 18:39:52 * OverCoder hugs vigilancer so tight Mar 05 18:40:03 Picking 'Android' changed it back, yay, thank you :* Mar 05 18:40:57 no kiss and tell )) Mar 05 18:41:08 :P Mar 05 18:50:39 Numix: wtf. why python for this? Mar 05 18:55:00 Too quiet, seems like people are happy with the Android API :P Mar 05 18:55:36 they trying to comprehend it Mar 05 19:00:04 I have an actionbar in my activity and I want to add a search textview, does it make sense to add it into the actionbar itself or should I just put it below? Mar 05 19:01:31 grekkos: http://developer.android.com/intl/ru/training/search/setup.html Mar 05 19:02:31 sick Mar 05 19:03:00 try #medicine :) Mar 05 19:03:40 haha Mar 05 19:04:46 is there an antidote for 'android' ? Mar 05 19:04:58 also for JNI does anyone know is there a special way to compile the JNI wrapper code for android platform? Mar 05 19:05:05 doctor: "you're looking a little green ..." Mar 05 19:09:45 hahaha, nice g00s Mar 05 19:11:43 will I encounter any hardships if my AS generated project isn't the source root in git? Mar 05 19:12:10 like if I have myrepo/ which has README.md and then mysrcroot/ inside of it that shouldn't cause any trouble right? Mar 05 19:12:33 oh wait .gitignore is inside of the src root Mar 05 19:20:26 How's that? getItem() is not getting called in my FragmentPagerAdapter, the created fragment is being null Mar 05 19:21:20 I can't seem to get kivy to work. Mar 05 19:21:22 All is lost. Mar 05 19:21:49 I'll have to do this the hard, gruesome way, with Jehvah Mar 05 19:26:18 hi, i bought galaxy s6 and install from unknown source is greyd out, what i can do? Mar 05 19:29:48 git Mar 05 19:30:59 I guess I could rephrase my earlier question like this: Is it acceptable in MVP for the presenter to directly access individual android views, or should it always use the MVP View class as a line of separation Mar 05 19:31:40 E.g. could a presenter store an edit text as a field in order to access the text for validation logic Mar 05 19:31:58 Or should it call view.getXTextViewText(); Mar 05 19:33:20 it shouldn't Mar 05 19:33:35 it could have a String to represent the text from that field Mar 05 19:33:39 but it should not know about UI Mar 05 19:33:57 so your presenter should be reusable with a different UI Mar 05 19:34:16 the presenter to view relationship is theoretically one to many Mar 05 19:40:23 Mavrik: It looks like systrace does indeed report a lot of delayed frames. I reproduced the problem in a smaller project. I basically have a custom view, and a separate thread. In that thread I call view.postInvalidate(), that seems to be bad. Mar 05 19:40:41 If anybody else has any ideas, please let me know ^^ Mar 05 19:41:15 grekkos: thanks Mar 05 19:41:54 That helps a lot, I'll just pass text observables in lieu of that Mar 05 19:42:59 konk3r: no problem Mar 05 19:43:38 dom96: what are you actually doing Mar 05 19:44:11 Napalm: Just trying to draw a game background and scroll it every frame. Mar 05 19:44:25 dom96: what type of view? Mar 05 19:44:33 Napalm: custom view Mar 05 19:44:38 ugh Mar 05 19:45:21 Napalm: Is that where I am going wrong? Mar 05 19:45:39 possibly, its been awhile Mar 05 19:45:40 shouldn't you be using some kind of graphics library for this? Mar 05 19:45:47 grekkos: na Mar 05 19:45:55 I don't know I've never done any gme stuff on mobile before Mar 05 19:46:00 standard stuff is fine for basic things Mar 05 19:46:15 dom96: what type of game.. are you redrawing the entire view every frame? Mar 05 19:46:41 Napalm: It's the classic 2d motorbike game. Yes, I am. Mar 05 19:46:56 motorbike game :O Mar 05 19:47:03 ok Mar 05 19:47:12 so yea.. use a SurfaceView Mar 05 19:47:16 lol Mar 05 19:47:23 I used a SurfaceView initially Mar 05 19:47:32 and why did you stop? Mar 05 19:47:40 Because I didn't get more than like 20 FPS Mar 05 19:47:48 but maybe I was just using it wrong Mar 05 19:47:52 sounds like it Mar 05 19:48:03 maybe your using what you currently have wrong Mar 05 19:48:28 Quite possible Mar 05 19:50:29 dom96: ok so first things first.. sounds like you have a thread that constantly renders and tells the ui to post an invalidation Mar 05 19:50:33 this is bad Mar 05 19:50:56 your external thread is running the game at say 1000fps Mar 05 19:51:03 and flooding the ui with invalidations Mar 05 19:51:04 indeed. Precisely what I have. Mar 05 19:51:15 oh Mar 05 19:51:29 I had a feeling that could be the problem. Mar 05 19:51:30 wait Mar 05 19:51:39 when your view's onDraw gets called then you render the frame Mar 05 19:51:39 sure. I'm listening :) Mar 05 19:51:56 no currently.. how are you rendering your frame.. in canvas in onDraw? or on the other thread to a bitmap? Mar 05 19:52:09 in canvas in onDraw Mar 05 19:52:22 ok so, why do you post invalidate from the other thread at all? Mar 05 19:52:27 in your onDraw Mar 05 19:52:34 at the end Mar 05 19:52:35 add this Mar 05 19:52:45 to refresh the frame I suppose Mar 05 19:53:12 if(gameIsRunning){ ViewCompat.postInvalidateOnAnimation(this) } Mar 05 19:53:34 so once one frame is rendered by onDraw.. it will invalidate for the next frame Mar 05 19:53:40 also, because I want the GameLoop to control the drawing Mar 05 19:53:48 this is where you are going wrong Mar 05 19:53:50 it can Mar 05 19:53:58 but then your onDraw doesnt draw it Mar 05 19:54:11 your gameloop can software render to a bitmap Mar 05 19:54:36 and that bitmap can be drawn to the ui in onDraw and the onDraw can post invalidate itself as above Mar 05 19:54:36 see Mar 05 19:54:47 this way.. you can full hardware fps from onDraw Mar 05 19:54:56 Makes sense :) Mar 05 19:54:59 and your thread can render as fast as it wants Mar 05 19:55:04 but all of that is a waste Mar 05 19:55:12 why do you want your GameLoop to control the drawing? Mar 05 19:55:17 what is it that requires this? Mar 05 19:55:41 I suppose it's not required per say. Mar 05 19:55:56 But the GameLoop controls the frame rate Mar 05 19:56:06 right Mar 05 19:56:14 this sounds more and more like you want a SurfaceView Mar 05 19:56:39 then theirs no invalidation required Mar 05 19:57:06 I have a TabLayout, it looks neat, but it's not like being one piece with the ActionBar, it's being a separate part with different evaluation, how do I fix that? Mar 05 19:57:06 Have any of you had issues with Android Studio/the compiler not recognizing custom views as views? I'm having to manually cast inherited views as View objects and it's making my code really ugly Mar 05 19:57:08 when the normal view ui gets rendered in hardware it will sample the surface and use that Mar 05 19:57:41 OverCoder: use a Toolbar and not the Actionbar Mar 05 19:57:52 Napalm: right, I saw an article which showed how to use SurfaceView for this. It suggested that the surface should be locked once (to get the canvas), then the gameloop should run forever. Whereas IIRC when I tried to use SurfaceView for the first time, I was locking and unlocking the canvas each frame. Mar 05 19:57:53 And it's preventing Butterknife from being able to inject them Mar 05 19:58:10 Napalm, o Mar 05 19:58:13 Napalm, thanks Mar 05 19:58:22 Napalm: Does that sound right? Mar 05 19:59:12 konk3r: what version of AS are you using... and check your project build.gradle .. what version of the andriod plugin does it use? Mar 05 19:59:15 hmpf I am so close to converting image4j for android.. if only I understood ColorMatrix better :( Mar 05 19:59:39 divStar: its explained in the docs pretty well Mar 05 19:59:51 https://developer.android.com/reference/android/graphics/ColorMatrix.html Mar 05 20:00:06 it shows how it uses it under the "computed as" bit Mar 05 20:00:23 yeah - I do understand it like that, but not if I have to convert a color-table (which is present in 1, 4 and 8 bit bitmaps) Mar 05 20:00:48 erm.. a ColorMatrix is nothing to do with color-table/palette Mar 05 20:00:49 hm I'm gonna read more >.< perhaps that'll solve my problems Mar 05 20:01:24 I thought a ColorMatrix can be used to blend a mask with the actual image for higher-bit images (32 bit mostly) Mar 05 20:01:55 blend a mask? Mar 05 20:02:09 you mean a blit transfer operation? Mar 05 20:02:18 Napalm: 1.5.1 for AS and 1.2.3 for my gradle plugin, I'll try updating the gradle plugin and see if that helps Mar 05 20:02:22 hm I suppose so, Napalm Mar 05 20:02:39 konk3r: change your plugin version to 1.5.0 .. 1.2.3 is REALLY OLD! Mar 05 20:02:58 divStar: what you trying to do exactly? Mar 05 20:03:22 Hahaha yeah, I just picked up an old side project because I was using it as a spike for testing out Rx and MVP patterns months ago, didn't update it yet Mar 05 20:04:02 I got a favicon and I need to read it and display it basically.. BitmapFactory only reads the first image - so I used image4j to get an idea of how to read the bytes properly and it works (I am drawing the colors per pixel using setPixel of Bitmap) Mar 05 20:05:02 so I want to know what kind of images are in an ICO file and what size/color-depth etc. and handle them.. which is what I am already able to do.. it's just that 1,4 and 8 bit images have index colors - and apparently I need to read and somehow use them or something.. not entirely sure how that works Mar 05 20:05:21 24 (without the alpha channel) and 32 (with alpha) already display correctly (and so do PNG images) Mar 05 20:06:10 Napalm: I like the idea of software rendering to a Bitmap, then letting the View draw the Bitmap. I'm guessing that the SurfaceView is pretty much that already though? So I may as well use it? Mar 05 20:06:28 you know, Napalm, in the image4j library the "IndexColorModel" is used for 1, 4 and 8 bit images, but unfortunately I do not have those in android (and I do not want to use apache harmony to get them) Mar 05 20:08:32 dom96: correct. its basically that.. your suppose to to call lockCanvas() on the Surface to get a Canvas with the surface bitmap. this you then render to. then you call unlockCanvasAndPost() once your done drawing.. this then updates the bitmap in the surface. Mar 05 20:09:05 Napalm: So I am supposed to call lockCanvas() and unlockCanvasAndPos() every frame? Mar 05 20:09:12 dom96: yes Mar 05 20:09:33 dom96: its no different if you do it yourself with a software bitmap.. you still going to need to have a lock around it. Mar 05 20:10:04 dom96: it sounds to me like if your only getting 20fps when your doing your game like that.. that your drawing is taking too long.. Mar 05 20:10:05 Napalm: true. Okay, I think I understand it now. Thank you :) Mar 05 20:10:48 Will try with a software bitmap first (I think it will be easier to edit my code to use that) Mar 05 20:10:56 dom96: i'd need to know what your doing to draw your game frames to understand what you are doing.. but the key is to do your game in two steps Mar 05 20:11:13 dom96: first update() ie) manage the game logic and physics or whatever Mar 05 20:11:35 dom96: then you do your draw() which basically just draws your game state to the frame Mar 05 20:12:02 dom96: if your locking a frame then updating logic and drawing at the same time.. your update of logic can hold up the frame render Mar 05 20:12:39 dom96: anyways, once you have it working with a SurfaceView .. i suggest you switch to a TextureView.. same thing but you can create your own Surface object from the SurfaceTexture it supplies. Mar 05 20:12:53 dom96: now you can lock and unlock that surface.. and render to a hardware texture Mar 05 20:13:22 thinking about finally buying this 6P Mar 05 20:13:32 Napalm: hrm, haven't heard of TextureView, is it a recent addition to Android? Mar 05 20:13:46 no Mar 05 20:13:48 or I could save the 500 bucks in case I want to quit my job lol. I'm conflicted Mar 05 20:14:00 since api 14 Mar 05 20:14:19 divStar: ok.. i see Mar 05 20:14:27 divStar: you want to display palettized graphics on Android Mar 05 20:14:33 divStar: or something else? Mar 05 20:14:42 Napalm: Will look into it. Thanks again! Mar 05 20:19:32 I'm going to set up a database. This example uses sqlbrite Mar 05 20:19:42 divStar: never used image4j before.. just looked at the docs. looks pretty straight forward. your IndexColorModel has a convertToIntDiscrete() method that will return a BufferedImage.. you can call getRGB() on that to get a int[] of RGB color values.. you can then pass that to Bitmap.createBitmap(int[] data, width, height, Bitmap.Config.AARGB_8888) Mar 05 20:19:45 I dunno, do you use a 3rd party library or android's built in stuff? Mar 05 20:20:36 off-topic http://thedroneracingleague.com/ < this looks awesome Mar 05 20:23:04 @ Napalm - there's no IndexColorModel or BufferedImage on Android unless one uses e.g. Apache Harmony Mar 05 20:23:24 divStar: you just said you were using IndexColorModel in image4j Mar 05 20:23:32 divStar: explain what you are doing Mar 05 20:24:19 I copied the Image4J classes basically and tried to replace as much as I could (e.g. most of the BufferedImage fields with Bitmap and such) and the 32bit bitmaps and png images already load as intended Mar 05 20:24:38 I am basically just struggling with that indexed color pallete with images of 1, 4 and 8 bit Mar 05 20:24:40 RustyShackleford: for key/value you can use leveldb or mvstore Mar 05 20:25:06 well I need more than that Mar 05 20:25:13 a few tables Mar 05 20:25:20 use two of them :D Mar 05 20:25:39 I mean, I'm going to use sqlite3 Mar 05 20:25:58 used ormlite but this is too much for few tables Mar 05 20:26:08 I need queries and stuff Mar 05 20:26:22 divStar: omg.. you still havent explained what you are trying to do. Mar 05 20:26:23 ormlite looks really nice Mar 05 20:26:35 divStar: what is your expected result? are you trying to load a type of image file? Mar 05 20:26:37 So this example uses sqlbrite with rxjava Mar 05 20:26:51 I'm not 100% sure if I can swap in the regular sqlite classes Mar 05 20:27:26 guys quick testing question: I have a small helper method that simply creates a new Location object, sets the lat/lng, and then uses the location.distanceTo(otherLocation). These are all Android methods. Should I need to test my helper method at all? Mar 05 20:27:43 divStar: so forget about Image4J.. what are you actually trying to do.. whats your input .. and what do you want as your output? Mar 05 20:28:22 RustyShackleford: anything can be wrapped with r Mar 05 20:28:27 *rx Mar 05 20:28:52 and thing "db.createQuery("users", "SELECT * FROM users")" looks.. meh Mar 05 20:40:32 vigilancer: so you would prefer a 3rd party library? Mar 05 20:43:31 vigilancer i dont think leveldb supports android any more Mar 05 20:45:00 lol new ubuntu installation. All the android docs load using chinese first Mar 05 20:45:15 wtf. I'm not connected to VPN or anything Mar 05 20:59:22 g00s: can be, I've used only mvstore Mar 05 20:59:40 vigilancer how is mvstore working for you, i've played around with it Mar 05 20:59:59 RustyShackleford: well, good abstraction makes code more stable and easier to read/write Mar 05 21:00:10 haven't found any bugs, only thing that might not be as robust as sqlite is if process crashes / gets killed Mar 05 21:01:13 g00s: I'm considering key/value when need something little bit more than preferences Mar 05 21:01:42 vigilancer sure ... only thing i didn't like about it, was the keys / values are Objects Mar 05 21:02:03 i commented on channel they should be byte[] like leveldb Mar 05 21:02:15 but he didn't agree :D Mar 05 21:02:56 g00s: the problem with blob state like byte[] is that people store way too much in it.. Mar 05 21:03:22 * Napalm watches another dev, derpy derp. "lets put this 16MB bitmap in the data-store" Mar 05 21:03:35 hm. not fancy at all) mvstore can operate different types. but classes have to implement Serializable, no support for Parcelable. understandable. or just gson it to string Mar 05 21:03:35 Napalm actually, should work fine Mar 05 21:03:42 "should" Mar 05 21:03:50 there's a place for files.. Mar 05 21:03:53 on the filesystem Mar 05 21:04:07 vigilancer yeah you can implement your own "serializer" , not the Serializable stuff gladly Mar 05 21:04:12 its designed for it.. Mar 05 21:05:32 Napalm mvstore handles large blobs OK Mar 05 21:06:01 i had no idea what one your specifically talking about Mar 05 21:06:08 it was just a general remark. Mar 05 21:06:14 earlier today someone asked how to store video in firebase. he suggested to "convert it to json" or something... Mar 05 21:06:23 Napalm even lightroom stores files in sqlite :) Mar 05 21:06:24 fff Mar 05 21:06:25 see Mar 05 21:06:30 stupido Mar 05 21:06:52 i wonder how that JSON1 extension for sqlite works Mar 05 21:07:18 it would be good if google had support-sqlite with newest sqlite, binding, etc Mar 05 21:07:29 sqlite 4 will have a dedicated k/v engine Mar 05 21:07:52 ooo Mar 05 21:07:54 nice Mar 05 21:08:12 support-sqlite ? :) Mar 05 21:08:36 ah, you already said it g00s ) Mar 05 21:09:01 vigilancer like this but official https://www.sqlite.org/android/doc/trunk/www/index.wiki Mar 05 21:09:09 g00s: https://android.googlesource.com/platform/external/sqlite/ < looks like its merged with 3.9.2 a couple of months back Mar 05 21:09:59 Napalm are you using WAL mode in any projects ? Mar 05 21:10:07 sqlite WAL Mar 05 21:10:20 i dont think its default so you have to enable it Mar 05 21:10:23 i had it enabled on one a long time ago Mar 05 21:10:31 then used transactions Mar 05 21:10:31 hm, nice Mar 05 21:11:07 g00s: I used this https://developer.android.com/reference/android/database/sqlite/SQLiteDatabase.html#enableWriteAheadLogging() Mar 05 21:11:31 I'm calling startService(new Intent(this, SyncService.class)); Mar 05 21:11:36 Napalm if i submitted an enhancement in b.android.com would you star it? doubt it would go anywhere, but ... Mar 05 21:11:49 'please add sqlite-support' :) Mar 05 21:11:49 I have logging statements in the onStartCommand() method of the SyncService Mar 05 21:11:59 depends on what it is Mar 05 21:12:06 if its a support-sqlite.. then u Mar 05 21:12:08 yes Mar 05 21:12:14 yeah Mar 05 21:12:24 the logging is never printed... so I dunno. I guess it's not being started, but I have no idea why Mar 05 21:12:25 g00s: but add links to the sqlite android page and also json1 page Mar 05 21:12:35 yeah Mar 05 21:12:44 g00s: also add in their.. the new support lib needs to support extension loading and function loading Mar 05 21:13:06 oh yeah, that too Mar 05 21:13:25 maybe we should just make an unoffical one and then link it in the ticket.. lol Mar 05 21:14:56 g00s: you know what we could do.. create our own SDK Manager repo file.. the xml file.. then we stick that up on the GitHub readme.. so people just add our repo url to the SDK manager and then they can get the latest releases and pull it in.. mind you.. saying that.. might aswell just do it as a aar and stick it up on jcenter Mar 05 21:15:32 RustyShackleford: do you Log before return? do service declared in manifest? Mar 05 21:15:50 g00s: ever tried the JSON1 extension? Mar 05 21:16:11 Napalm yeah - whats most important to me though is the googlers maintaining the jni / java packages - since thats pretty critical Mar 05 21:16:12 DO'H Mar 05 21:16:17 haven't used that extension Mar 05 21:16:19 didn't declare it in the manifest Mar 05 21:16:24 that must be the problem Mar 05 21:17:17 AndroidManifest.xml is a little tough to deal with in a large app. It gets out of hand, doesn't it? Mar 05 21:17:45 i have ~ 65 xml files, things are already "out of hand" Mar 05 21:17:58 g00s: really looks like it should be handy for using sqlite as a json object store Mar 05 21:18:26 g00s: you mean layouts? Mar 05 21:18:44 drawables, layouts, animations, transitions .... Mar 05 21:18:59 that's not fair :) Mar 05 21:19:00 https://github.com/dmytrodanylyk/folding-plugin < use this Mar 05 21:19:14 tis awesome Mar 05 21:19:18 oh i remember that Mar 05 21:19:48 resources are also impossible to keeep organized Mar 05 21:19:52 its been brought up a few times to the tools guys, even during i/o ... Mar 05 21:19:57 g00s: to be honest.. this should just be a feature of AS Mar 05 21:20:09 yeah Mar 05 21:20:17 I wish we could say R.layout.main.list_item or something Mar 05 21:20:26 RustyShackleford yeah that would be nice Mar 05 21:22:02 there are just so many thing that are absolutely baffling , somebody should have thought ahead "who needs more than 64k methods" "who needs more than resource dir to put eveyrthing" "who would need namespacing on attributes so libs don't clobber each other if they define the same ones" Mar 05 21:22:33 hah the dex limit is hilarious Mar 05 21:22:52 in 2016, to all these things, we should be saying "do you remember that time, when we had the 64k method limit hahaha .. .you yungins!" Mar 05 21:23:02 pretty sure I'm above the dex limit just by including some 3rd party libraries Mar 05 21:23:46 thats one thing i disliked so much about obj-c, the whole NSblablah Mar 05 21:23:51 my uncle used to work on mainframes in the 70s. Every time I see him I hear about when the upgraded from 128k to 256k of RAM and they thought it was the sweetest thign ever Mar 05 21:24:06 "what are we going to do with all this memory?" Mar 05 21:25:24 'we're going to use it for our java app' Mar 05 21:25:24 g00s: they have swift now, but dex limit still there Mar 05 21:26:12 if I see a gradle task like transformClassesWithDexForDebug, does that mean I'm above the dex limit? Mar 05 21:26:27 have to say swift feels very much like kotlin. constructs and all. but no smart casting sadly Mar 05 21:26:49 RustyShackleford no ... Mar 05 21:26:52 RustyShackleford: no Mar 05 21:27:43 RustyShackleford: https://github.com/mihaip/dex-method-counts Mar 05 21:27:53 not sure if it's accurate 100% Mar 05 21:28:02 but can give idea Mar 05 21:28:05 RustyShackleford ClassyShark is nice app for exploring your dex counts too Mar 05 21:28:33 i submitted an enhancement to have a report put into AS for method counts, i think its pushed to 2.1 Mar 05 21:28:53 seems like 2.0 might need to be a cesarian Mar 05 21:29:25 do you uses AS's integrated Git plugin? Mar 05 21:29:26 *cesarean Mar 05 21:29:40 never really tried it hah. I always fire up git gui Mar 05 21:29:45 me no, i use command line and sourcetree Mar 05 21:29:57 and gitup looks neat too if you're on mac Mar 05 21:31:14 I like the way git gui shows you the diff Mar 05 21:31:25 you can easily stage only certain lines of a file if you want Mar 05 21:31:44 i'm using git plugin, nothing wrong with it. commit or browse history can be handy. but git flow from console, yeah Mar 05 21:34:11 vigilancer: I can't figure out how to stage changes Mar 05 21:34:23 I only see an option to commit them Mar 05 21:34:53 select file, Cmd-Shift-A to stage if not staged Mar 05 21:35:05 or from right click menu Mar 05 21:37:04 g00s: why cesarean? don't get i Mar 05 21:37:06 *it Mar 05 21:37:14 vigilancer: changelists? Mar 05 21:37:21 is that how staging is handled? Mar 05 21:37:34 haha I'm not new to git, but this plugin is baffling Mar 05 21:38:25 not sure what's changelists Mar 05 21:39:18 one have to enable plugin and add git project root from VCS menu Mar 05 21:40:01 its enabled. I just gotta figure it out. Google I guess Mar 05 21:45:22 Napalm google still hasn't updated the docs for support 23.2 on d.android.com Mar 05 21:45:32 supprised? Mar 05 21:45:34 :| Mar 05 21:45:37 i mean, methods, etc still reflect 22 Mar 05 21:45:45 oops 23.1 Mar 05 21:46:01 usually the switch over has happened quickly, i've never noticed it Mar 05 21:46:30 i submitted a bug in case they forgot :D Mar 05 21:46:46 'this is your friendly reminder from goos - get your shit together' :D Mar 05 21:46:55 i think someone forgot Mar 05 21:47:01 or forgot to invalidate the caches Mar 05 21:47:02 :| Mar 05 21:51:41 this app is turned out so beautiful Mar 05 21:51:52 could probably have all the backend stuff done this weekend Mar 05 21:52:45 http://akarnokd.blogspot.hu/2016/03/rxjava-design-retrospect.html?m=1 Mar 05 21:52:52 hm i haven't looked at Reactor in a while Mar 05 21:53:56 reactive design is the coolest thing i've ever seen Mar 05 21:54:26 its amazing how nicely you can organize and decouple things. RxJava and greenrobot are great Mar 05 21:54:35 might add in dagger2 if I see the need for it Mar 05 21:54:36 hm wonder if reactor can be used on android https://github.com/reactor/reactor Mar 05 21:59:56 RustyShackleford: did you ever implement any kind of mvp lib? Mar 05 22:00:06 I remember you asking a while back Mar 05 22:00:33 vigilancer https://groups.google.com/forum/?#!topic/h2-database/Trf0QNnkiYI Mar 05 22:00:48 kinda worried theres really only one guy working on H2 - bad bus factor Mar 05 22:02:26 orbyt_: I'm following this as a template https://github.com/ribot/android-boilerplate Mar 05 22:02:56 I'd be interested in other takes on MVP. I saw some diagrams for MVP and it seems like it's their own take on it Mar 05 22:03:35 so I follow that, but with fragments being the MVP components. The fragments communicate with MainActivity Mar 05 22:03:49 How do I setActionBar with a minSdk of 13? I want to use a Toolbar Mar 05 22:04:06 setSupportActionBar Mar 05 22:04:11 o, thanks Mar 05 22:04:14 so my StopFragment will tell the MainActivity that the user selected the Western Brown line stop. The MainActivity handles the fragment transactions and creates the ArrivalFragment Mar 05 22:04:39 once it's a little closer to beign done, I'd love to do like a code review. Mar 05 22:04:51 it might be a little overarchitected :p Mar 05 22:05:10 g00s: what did you call that? Mediator pattern? Mar 05 22:05:21 RustyShackleford: I've been trying out nucleus lately. Its pretty neat, can just have a fragment with @RequiresPresenter(mypresenter.class) and it hooks everything up to communicate view->presenter Mar 05 22:05:42 RustyShackleford yeah Mediator is like a switchboard in that sense Mar 05 22:05:42 g00s: saw something similar, h2 was used as server db and was damaged. but logs look disturbing. maybe it's worth to spend some time for own abstraction around sqlite4 indeed. with blackjack and all Mar 05 22:06:32 this design seems infinitely expandable. I could add as many pages/flows to this as I want Mar 05 22:06:37 brb afk Mar 05 22:06:45 any downsides to putting all content in fragments? Mar 05 22:07:06 i have all my content in fragments. my activities are mostly empty Mar 05 22:07:23 I'm gonna show the architect at work and see what he thinks. This seems like a great way to fix our shitheap of a project Mar 05 22:07:56 well, i should clarify: activities are mediators, fragments are views Mar 05 22:09:36 yeah exactly what I'm trying to do Mar 05 22:09:57 do you make multiple Activities in an app? Mar 05 22:10:33 i have a Home activity with NavDrawer that switches most fragments in and out, but in a few places like Settings it goes to another Activity Mar 05 22:10:54 got any code in a public place like github? Mar 05 22:11:05 nah i don't ... Mar 05 22:11:17 just wondering. I love examples Mar 05 22:11:45 my next refactor is to package by feature. i had { ui / util / provider / service } and it became a mess Mar 05 22:11:54 hope to fix that this weekend Mar 05 22:12:13 RustyShackleford https://medium.com/the-engineering-team/package-by-features-not-layers-2d076df1964d#.lx8mcil9c Mar 05 22:12:36 not deep (better discussions out there) but example is nice Mar 05 22:13:24 if you can disentangle your blob code into those packages by feature it would go a long way Mar 05 22:14:02 probably too much for this app. I'll see how it grows Mar 05 22:14:10 i used to have a book called 'antipatterns' that was hilarious Mar 05 22:14:23 i don't like idea about separating fragments and activities by resposibility. sure, most of the time fragment is a 'view'. but with lot of fragments you'll put too much logic in single activity. after some point it's hard to understand what it's all about Mar 05 22:14:28 I prefer keeping the adapter where it's used Mar 05 22:14:56 although I do wonder if I should use some inheritance or something. I have three adapters which are all extremely similar except for the data I give them and the viewholder Mar 05 22:15:54 vigilancer i must have gotten lucky - maybe my approach wouldn't work elsewhere. activities wire up fragments, fragments wire up views. all the other stuff, model, business logic is elsewhere Mar 05 22:16:17 ui {MainActivity stop {StopFragment, StopPresenter, StopMvpView, StopAdapter}} Mar 05 22:16:19 g00s: what will you do with abstract classes when separating by features Mar 05 22:16:33 I do keep all the data and models elsewhere Mar 05 22:16:37 actually I think i'm a poor developer though, thats why i'm transitioning to something else Mar 05 22:16:54 oh man I should write a book on antipatterns Mar 05 22:17:14 g00s: yeah, but what about spaghetti in onActivityResult() Mar 05 22:17:18 Singletons with public constructors (that are being used!!!) Mar 05 22:17:49 the Facade pattern omg. So we have a library A that depends on common Mar 05 22:17:51 vigilancer i don't think i've used onActivityResult for things in my own app ... Mar 05 22:17:56 but common depends on A too Mar 05 22:18:06 activity B saves to model , activity A gets notification Mar 05 22:18:24 RustyShackleford http://www.amazon.com/AntiPatterns-Refactoring-Software-Architectures-Projects/dp/0471197130 Mar 05 22:18:25 so we make something like LoginFacade in common, LoginFacadeImpl in A, then we load the classes we need from A at runtime Mar 05 22:18:38 dont recommend buying it - just saying it was funny Mar 05 22:18:42 had good cartoons Mar 05 22:19:12 ever tried android-priority-jobqueue? Mar 05 22:19:28 is that yigits things? no i was wondering when 2.0 will be done Mar 05 22:19:32 I see this all the time too: public void getName() :/ Mar 05 22:20:13 vigilancer timing for onActivityResult is .. inconvenient too Mar 05 22:20:50 well, all those lolcycles are inconvenient Mar 05 22:20:56 fuck all that shit Mar 05 22:21:02 there is more. you can catch onActivityResult in fragments too. such a mess Mar 05 22:21:43 when i knew C++, at the time i was pretty good. i was working on gcc Mar 05 22:21:51 i considered myself a c++ language lawyer Mar 05 22:22:02 at work we'd all get into debates about the dark corners of c++ Mar 05 22:22:32 then somewhere, i decided - fuck all that shit, just use the good parts and obvious thing w/o dark corners Mar 05 22:22:43 i feel that way about android corner cases in lifecycle now too Mar 05 22:23:02 i just simplified my mental model into 'anything can go away whenever it wants' Mar 05 22:23:31 hm.. play some Dead or Alive 5 LR or try to get that color palette stuff working... Mar 05 22:24:03 sometimes man have to take a photo :) or deal with orientation changes and async operations Mar 05 22:24:18 I wrote something similar jobqueue Mar 05 22:24:21 https://github.com/vigilancer/rx-jobqueue Mar 05 22:24:41 vigilancer did you post that on /r/androiddev a while back ? Mar 05 22:24:45 event bus in a word Mar 05 22:24:48 nope Mar 05 22:25:57 there is some work to do. cache Job results so activities can latter resubscribe and get requested results Mar 05 22:27:18 do you guys open source your projects usually? Mar 05 22:27:52 on one hand, theres no reason I couldn't Mar 05 22:28:03 on the other hand, this code is mine! mine mine mine Mar 05 22:28:19 there is. 'holly shit, nobody should see this' Mar 05 22:28:41 hah thats another reason to keep it closed source Mar 05 22:28:49 Dammit! 3 hours spent trying to track down why my last changes broke my collapsable toolbar only to realize that the breaking change was updating my support library Mar 05 22:29:01 keep your code closed source and nobody will laugh at it Mar 05 22:29:17 Remind me to isolate library updates in their own commit Mar 05 22:30:11 well, I've liked Theo De Raat's message about BSD licence. point was something like 'we teaching manufacturers how to write code. doesn't matter if they don't contribute' Mar 05 22:32:33 and also, if pidcat wouldn't be opensource I'll live forever with own special patched version. now I'm 'brew' from HEAD and happy Mar 05 22:33:11 one thing we do at work is these navToLogin(), navToAccountHome(), etc methods Mar 05 22:33:45 I don't like it. I dunno, what do you think? Mar 05 22:35:00 why not Mar 05 22:35:05 on one hand its just a convenience method, but it makes changing things difficult Mar 05 22:35:54 I bet that not the problem of naming :) Mar 05 22:36:11 there are major lifecycle problems. I'm working on making the app log out gracefully Mar 05 22:37:08 point is, it sorta depends where you're calling those methods. I can't change navToLogin() without messing up everywhere else it's called Mar 05 22:38:54 navToLogin() should only replace fragment/call activity Mar 05 22:39:16 hm okay so 32bit images are drawn correctly with the adoption of image4j that I adjusted to work with Android.. but apparently not 8bit icons D:.. probably messed up somewhere Mar 05 22:39:18 if I understand it's meaning correctly Mar 05 22:40:37 g00s: there is something similar already? could you find link? Mar 05 22:41:01 vigilancer: pretty much. I suppose those methods are not where the problem exists Mar 05 22:41:29 when the logout sequence starts, the order of where you call that is tightly coupled for some reason Mar 05 22:42:38 call navToLogin() in the wrong place, nullpointerexceptions fuckin everywhere lol Mar 05 22:43:13 back in a days I was starting logout async that will fireup event via LocalBroadcastReceiver on finish so everyone interested can catch it with BroadcastIntent Mar 05 22:44:17 *LocalBroadcastManager Mar 05 22:44:33 yeah I dunno. I came up with a way to start a new thread, wait for the active activity's onResume to be called, and then call navToLogin() Mar 05 22:44:45 its a hack :/ Mar 05 22:44:59 *catch with IntentFilter Mar 05 22:45:07 what wrong with me :) Mar 05 22:45:11 no Mar 05 22:45:32 I need to figure out a way to decouple the user's session and all the UI components. Really, they should be designed so that there aren't crashes if no user data is available Mar 05 22:45:51 on the contrary. it is decoupling Mar 05 22:46:11 ah, you mean you solution is a hack Mar 05 22:46:15 *yiur Mar 05 22:46:17 *your Mar 05 22:47:54 yup its embarassing hah. Best I could come up with Mar 05 22:48:15 I'm adding to the problem :( Mar 05 22:48:57 with rx you could subscribe on observer that do logout, in onSubscribe() show spinner and block ui, and in doOnFinish() hide spinner Mar 05 22:49:27 onNext, of course, do your usual stuff Mar 05 22:51:33 *subscribe on observable Mar 05 22:52:02 ah, time to rest Mar 05 22:54:00 g00s: ping? Mar 05 23:14:17 vigilancer: but first I have to file an assload of paperwork to use the library Mar 05 23:14:26 get it approved, put in Nexus Mar 05 23:14:59 security is a valid concern I guess, we're dealing with financial information Mar 05 23:15:25 is maven not trusted? Mar 05 23:16:24 working on a personal project now, I'm implementing a SyncService. Sorta new to rxjava, can I have an observable that doesn't return a type Mar 05 23:16:37 examples I see always have Observable Mar 05 23:21:21 Observable? Mar 05 23:21:46 with Service you may need a threadpool, and bunch of related to threading problems Mar 05 23:21:59 yeah, it can be primitive. Void is good Mar 05 23:22:40 *it cannot be Mar 05 23:23:22 I just sync at startup for now Mar 05 23:23:35 RustyShackleford: wow, sounds tough. papers to use library.. Mar 05 23:24:15 that would be more than sufficient. All the data I'm going to cache doesn't change often at all. Once a week might even be sufficient Mar 05 23:24:24 vigilancer: and for each update to the library Mar 05 23:25:08 RustyShackleford: than maybe would be handy Mar 05 23:25:14 fk Mar 05 23:25:24 I need to learn more of the operators. Mar 05 23:25:24 *SyncAdapter Mar 05 23:26:34 I do want to keep the data persistent in an sqlite3. Is Service not the right tool for the job? Mar 05 23:27:20 I'm ripping this off, basically https://github.com/ribot/android-boilerplate/blob/master/app/src/main/java/uk/co/ribot/androidboilerplate/data/SyncService.java Mar 05 23:27:23 you still will be need a Service Mar 05 23:28:29 eh I don't think a SyncAdapter adds anything I need... Mar 05 23:28:49 I'll read the docs a little more, but I think I'll keep it simple. Handling threads is pretty easy with rxjava Mar 05 23:29:31 check this out: http://stackoverflow.com/a/22256277/4594990 Mar 05 23:29:31 I do need to make several network calls while syncing. Pretty sure you can chain it all together with rxjava, but I haven't gotten that far yet Mar 05 23:29:53 that's how to check if you are online Mar 05 23:30:29 that example was copied and pasted from the android-boilerplate project I just linked hah Mar 05 23:30:36 the helper method anyway Mar 05 23:31:06 or maybe vice versa Mar 05 23:31:43 the idea is to use "ping". don't see it in 'boilerplate' Mar 05 23:33:24 ok afk Mar 05 23:38:06 oh I see Mar 05 23:38:21 missed that on first glace. NetworkAvailability doesn't mean you're online Mar 06 00:14:29 vigilancer, you still around? Mar 06 00:16:57 1. stacktrace? Mar 06 00:17:09 2. why are you storing two ints as array Mar 06 00:17:47 drinfernoo: ^ Mar 06 00:18:49 i.. dont know lol Mar 06 00:19:09 idky that was the first thing i tried Mar 06 00:20:15 still need stacktrace tho :) Mar 06 00:20:38 but use .writeInt() this time Mar 06 00:26:32 also. you storing in bundle "ArrayList " but implementing Parcelable for InformationPage Mar 06 00:28:08 can you reproduce and pastebin stacktrace? Mar 06 00:28:13 drinfernoo: ^ Mar 06 00:45:59 is it bad design to leave the members of your model public? Mar 06 00:48:18 I mean I could just generate a bunch of getters and setters. But thats so much extra noise Mar 06 01:07:33 if you sure it will never leave small scope like ViewHolder in RecyclerView, i making fields public Mar 06 01:08:07 RustyShackleford: I believe it is, if they are not final Mar 06 01:08:22 if it should be thread-safe, that init all fields in constructor and provide only getters Mar 06 01:08:47 *than Mar 06 01:09:19 RustyShackleford: if you have models that are immutable. its perfect for public final. Mar 06 01:10:00 RustyShackleford: yea and what vigilancer said.. i also use public for private inner classes where they have restricted scope Mar 06 01:10:37 otherwise provides setters and getters, but mark it with @NotThreadSafe or deal with it later :) Mar 06 01:11:20 Where'd you get @NotThreadSafe from? its not a standard annotation is it? Mar 06 01:11:27 jcip Mar 06 01:12:01 annotate or just explaint it comments. or don't. Mar 06 01:12:18 *explain it in Mar 06 01:13:13 vigilancer: is the book any good? Mar 06 01:13:17 I believe it can be found in jsr-305 implementations Mar 06 01:13:45 Napalm: definitely Mar 06 01:14:28 vigilancer: dis one? http://www.amazon.co.uk/Java-Concurrency-Practice-Brian-Goetz/dp/0321349601/ Mar 06 01:14:45 I bought paper version and no regrets Mar 06 01:14:58 that is paper Mar 06 01:14:58 yup Mar 06 01:15:02 oh.. ebook also.. Mar 06 01:15:13 i never get ebooks Mar 06 01:15:20 im old fashion Mar 06 01:15:28 could try abebooks, saves some bucks Mar 06 01:16:16 orderd, it'll be here tomoz Mar 06 01:16:22 luv amazon for that Mar 06 01:16:34 vigilancer: could, but didnt Mar 06 01:16:38 :) Mar 06 01:16:46 hah Mar 06 01:16:48 i've waited about month :) Mar 06 01:16:52 they gave me the ebook free Mar 06 01:18:38 I was talking about "http://www.abebooks.com" by the way :) Mar 06 01:23:47 vigilancer jcip was a good book ... Mar 06 01:24:01 was? Mar 06 01:24:01 little long in the tooth now, but still good Mar 06 01:26:31 g00s: you said earlier that saw something similar to jobqueue on /r/androiddev Mar 06 01:26:38 could find link? Mar 06 01:27:20 vigilancer only one i know of is yigit boyar's , and there is one called Goro that i think is similar Mar 06 01:28:34 ah, I see, later deals with Futures. thanks Mar 06 01:39:15 RustyShackleford: by the way if not afraid of black magik you could try lombok Mar 06 01:39:48 it can generate setters getters, and something else can't recall Mar 06 01:40:25 there is also IDEA plugin for autocompletion to work Mar 06 01:43:09 Guys, say I have a helper method that creates a new Location object, sets the lat/lng, and then does a Location.distanceTo() another object. How important is it that helper method if it is just using default Android methods? How would it be tested? Mar 06 01:43:31 how important is it to test* Mar 06 01:47:10 how to test: maybe `provided 'com.google.android:android:4.1.1.4'` Mar 06 01:48:24 repo forall -vc "git reset --hard"; repo sync Mar 06 01:48:24 error: .repo/repo/: contains uncommitted changes Mar 06 01:48:26 I'm not strong in tests. But at this point you'll test android framework actually Mar 06 01:48:40 wtf! Mar 06 01:49:52 vigilancer: yea, so is that actually needed? Mar 06 01:50:19 seems like it would be a redunant test. Unless the implementation in the framework drastically changes Mar 06 01:53:12 can't say if it's a good idea or not, not enough experience in reasoning about such things Mar 06 01:53:58 if it's unittest, than you still will test against "android:4.1.1.4". if androidTest, to this test need to be done on all apis Mar 06 01:54:20 *than this test Mar 06 01:54:51 you can check that not misplaced lat and lng tho :) Mar 06 02:04:01 orbyt_: wondering are you following some methodology? Mar 06 02:04:39 vigilancer: no just wanting to be thorough Mar 06 02:05:49 so you test everything? Mar 06 02:06:14 like "if it can be than it should be" Mar 06 02:10:41 I am looking for some methodological approach for testing. TDD offers too much hustle, and virtually all application examples are artificial Mar 06 02:11:09 vigilancer: no, submitted a small app as part of a technical interview screening, and was wondering whether or not i should have tested it. Mar 06 02:11:23 tested that method* Mar 06 02:12:02 vigilancer: i've been getting into nucleus and am loving the complete seperation i can get between my view/presenter/model Mar 06 02:12:24 trying to get just pure java almost everything but the view, so easier to test Mar 06 02:14:47 hm, looks too intrusive. have to extend NucleusAppCompatActivity Mar 06 02:15:57 vigilancer: actually one of the reasons i liked nucleus is cause it seemed way less intrusive than, say, Mosby Mar 06 02:16:10 vigilancer: the entire lib is really small Mar 06 02:16:26 *note that i've never used Mosby though so take that with a grain of salt Mar 06 02:25:29 orbyt_: so code became more testable thanks to nucleus or MVP? Mar 06 02:32:35 vigilancer: yea mvp helps promote a more testable architecture Mar 06 02:35:01 I like mvp, it even 'feels' cleaner than mvc on android Mar 06 02:35:16 Hey anyone around who can answer questions? I'm having some trouble figuring out AlarmManager. Mar 06 02:36:26 vigilancer: Yea if your familiar with Rx try out Nucleus, otherwise have a look at Mosby if you dont want to roll your own implementation Mar 06 02:36:57 Kate6: I'm loving to answer questions! But will I?.. ;D feel free to fire up maybe someone pick it up Mar 06 02:37:39 Well the examples on developer.android.com all reference an "AlarmReceiver.class" but Android Studio can't seem to find such a class. Mar 06 02:37:59 Is it a poorly documented interface or something along those lines, maybe? Mar 06 02:39:11 I really like rx too :) Extending Activity.. it just doesn't feel right. On the other hand one should write all that boilerplate himself.. I'll look examples more carefully at first, thanks for the hint Mar 06 02:39:47 Kate6: can you provide link to confusing code? Mar 06 02:39:56 vigilancer: Well the thing there is that there all extending a BaseView, and the objective is to make your views as dumb as possbiel Mar 06 02:40:01 possible* Mar 06 02:40:25 vigilancer: There's some references to that class here, for example - http://developer.android.com/training/scheduling/alarms.html#set Mar 06 02:42:54 vigilancer: Is it maybe just pseudocode saying "Put in a reference to the class that's going to be receiving this intent"? Mar 06 02:43:11 yes Mar 06 02:43:17 Kay. Mar 06 02:43:19 *facepalm* Mar 06 02:43:20 I'm dumb. Mar 06 02:43:22 no Mar 06 02:43:22 Thank you! Mar 06 02:43:24 stop Mar 06 02:43:41 new Intent(context, AlarmReceiver.class) Mar 06 02:43:55 this intent will fireup when time is right Mar 06 02:44:14 I'm going to look at the downloadable sample code I just noticed they link to on the right. Mar 06 02:44:20 I think these out of context snippets keep confusing me. Mar 06 02:44:22 hm.. seems like in order to test the converted library, I need to get one icon per type (as in: create or something).. *sigh* Mar 06 02:44:51 Any one can recommend good chart ing library that I can use use? I am just starting with Android Studio and Android. What I am looking for is chart that can possibly support multiple series with option to hide/show each series also chart will be feed data point with preconfigured number of points. It is real time scrolling chart Mar 06 02:47:23 https://github.com/PhilJay/MPAndroidChart Mar 06 02:47:35 This is the go-to chart library for Android Mar 06 02:47:49 @Guma Mar 06 02:48:19 Guma no time series though Mar 06 02:51:00 Ok any other time options with time series? Mar 06 02:54:31 liuwenhao: nice thing, how did I missed that Mar 06 02:55:01 liuwenhao Th,and you Mar 06 02:55:07 Thank you Mar 06 02:55:11 Guma only one i know of that does time series http://www.android-graphview.org/documentation/how-to-create-a-simple-graph Mar 06 02:55:22 but its a bit ugly Mar 06 02:57:23 oh this does time series too, but also ugly http://androidplot.com Mar 06 02:58:16 I will start with liuwenhao suggestion and maybe I will add series to it later on when I get little more acquainted with Android/Gradle/Android Studio. So my other question is I see two grade files? under Gradle Scripts. One is Project and the other is Module. If I need to import MPAndroidChart which one should I add it to. What is the difference between both? Mar 06 02:58:34 one is project, one is module Mar 06 02:58:51 That dependency should be added to the app build.gradle not project Mar 06 02:59:54 http://stackoverflow.com/questions/28295933/difference-between-build-gradleproject-and-build-gradlemodule **** ENDING LOGGING AT Sun Mar 06 02:59:57 2016