**** BEGIN LOGGING AT Thu Mar 10 02:59:58 2016 Mar 10 03:00:06 I got nexus 6 so... Mar 10 03:00:35 how would multiwindow work for small screen O.o Mar 10 03:00:47 you would be able to fit a fab on each window Mar 10 03:00:50 I didnt have problem with that Mar 10 03:00:58 at least on nexus6 ;) Mar 10 03:01:06 video on left, chat on right Mar 10 03:03:44 i love this sentence "Java 8 language features, including lambdas and more" - like they deliberately cut it short coz there's really not much more support than lambdas Mar 10 03:05:02 bankai_: and streams Mar 10 03:05:12 and method references, default methods, etc Mar 10 03:05:22 "Improved Java 8 language support - We’re excited to bring Java 8 language features to Android. With Android's Jack compiler, you can now use many popular Java 8 language features, including lambdas and more, on Android versions as far back as Gingerbread" Mar 10 03:05:41 so it's back supported Mar 10 03:05:42 i'm unclear on what exactly is GB and above , beside lambdas Mar 10 03:07:05 gordon_: where'd you read that? streams would be nice ... Mar 10 03:07:52 bankai_: http://android-developers.blogspot.jp/2016/03/first-preview-of-android-n-developer.html Mar 10 03:08:01 For example, lambdas can replace anonymous inner classes when providing event listeners. Some Java 8 language features --like default and static methods, streams, and functional interfaces -- are also now available on N and above. With Jack, we’re looking forward to tracking the Java language more closely while maintaining backward compatibility. Mar 10 03:08:27 nice nice thanks Mar 10 03:09:17 they resolved it nicely - what could be done, is backported to GB, but new classes are available from N Mar 10 03:13:46 gordon_ still, what is backported beside lambdas ? Mar 10 03:14:28 g00s: https://developer.android.com/preview/j8-jack.html Mar 10 03:16:01 wonder how jack is related to custom languages Mar 10 03:16:03 lol i read that, but it doesn't say what you can use before N Mar 10 03:16:23 well, probably lambdas Mar 10 03:16:32 I dont remember what else is in java8 Mar 10 03:16:53 probably method references ? Mar 10 03:20:36 IntelliJ and AS already collapse anonymous inner classes and they auto complete after typing a couple characters. I haven't done much with Java 8 (streams are nice), but are lambdas really that great? Mar 10 03:21:56 lamda's seem awful confusing Mar 10 03:22:26 the syntax looks nice, maybe its great if you're super familiar with the boilerplate it replaces Mar 10 03:22:47 I was totally lost looking at rxjava examples with lambdas Mar 10 03:22:55 RustyShackleford: dont know what you smoke, but I dont want any of that ;) Mar 10 03:23:37 I remember few years ago doing c# with linq to sql Mar 10 03:23:46 that was nice and easy Mar 10 03:24:12 gordon_: its called "marijuana" Mar 10 03:24:32 whatever it is, it seems bad for you Mar 10 03:26:21 gordon_, I'm with RustyShackleford on this. RxJava examples would make more sense to me if everything wasn't a lambda. Mar 10 03:26:49 for me lamda is better Mar 10 03:26:57 *lambda Mar 10 03:29:50 it was pretty much always call() being replaced Mar 10 03:30:02 Where does lambdas originated from? Mar 10 03:30:07 but I like see the return and parameter types Mar 10 03:30:22 And how does it help us writing efficient code? Mar 10 03:30:40 br0mahn: I think the idea is to write code efficiently Mar 10 03:30:51 more concisely Mar 10 03:31:18 So its just another way of simplifying code writing? Ok. I wish java had this long time ago. Mar 10 03:31:47 so I'm trying to track down this bug. There's a fragment that has a viewpager or fragments. The first instance is created no problems. But if there are two of these in the Fragment stack, the second one is entirely blank Mar 10 03:33:03 br0mahn: everyone wishes for that ;) Mar 10 03:37:24 lambdas came from like 50 years ago Mar 10 03:41:02 and they are an essential part of learning to program, eg sicp Mar 10 03:42:02 pfn: Try 60 years :-) Mar 10 03:42:26 I forget my decades Mar 10 03:42:32 just rounding to 50 now Mar 10 03:42:35 pfn: It's easy when you get old :-) Mar 10 03:42:44 What's a decade or two? Mar 10 03:42:48 pretty much Mar 10 03:42:58 functional programming Mar 10 03:43:16 what's old is new again Mar 10 03:44:51 pfn: I just wish what's new could become old. There are a lot of modern hipster things in development that really needs to be relegated to the scrap pile of history. Mar 10 03:47:00 so I'm trying to track down this bug. There's a fragment that has a viewpager of fragments. The first instance is created no problems. But if there are two of these in the Fragment stack, the second one is entirely blank Mar 10 03:47:32 viewpager shows the correct number of items, but a blank page for each. I'm so confused. I read all the classes numerous times today Mar 10 03:49:53 oh fucking come on, 23.2.0 fucked up the TabLayout tabTextAppearance attribute Mar 10 03:50:29 RustyShackleford, paste some code. Are you using childFragmentManager? Mar 10 03:53:47 I did find a stackoverflow post about that Mar 10 03:54:34 surf2b1: I don't have the work laptop out, but a reference to the parent fragment's (the one that hosts the viewpager) fragmentmanager Mar 10 03:57:08 so weird... Mar 10 03:58:27 have to also set android:textAllCaps in my tabTextAppearance now Mar 10 04:05:24 im sucking at udaicity course :/ Mar 10 04:05:31 udacity* Mar 10 04:11:01 do I need to write more dagger components/modules for my test classes? Mar 10 04:11:26 can I just reuse the ones I wrote for the app? Mar 10 04:40:34 https://bintray.com/android/android-tools/com.android.tools.jill.jill-api/0.10.0/view Mar 10 04:40:37 hmm, was published today Mar 10 04:41:46 was hoping next step after 0.9 was 1.0 :D Mar 10 04:41:55 oh well, 0.10 Mar 10 04:50:58 anyway, scala is so not dead on android now Mar 10 04:51:06 google dunno what they gone done Mar 10 05:32:32 Can anyone explain this "Future releases of Android may deprecate additional implicit broadcasts, as well as unbound background services. For this reason, you should avoid or remove dependencies on manifest-declared receivers for implicit broadcasts, as well as on background services." Mar 10 05:34:14 I should avoid background services? Mar 10 05:34:39 eghdk yeah i'm worried about that too Mar 10 05:35:20 "implicit" as in manifest receivers Mar 10 05:35:23 I kind of agree Mar 10 05:35:33 too many apps wake up as a result of manifest receivers Mar 10 05:35:58 the term implicit broadcast is a little weird Mar 10 05:36:03 hm, not worried about the receivers either; but background services ? Mar 10 05:36:05 and sounds like it's been recently coined Mar 10 05:36:32 who knows, don't care, wait 'til it's updated then see Mar 10 05:36:58 my app wouldn't be possible w/o background services ... Mar 10 05:37:18 i can't do these things in JobScheduler or whatever bin they want us all in Mar 10 05:38:26 So I'm having a pretty bad realization that I architected my app all wrong. Let's see if anyone can help. I essentially am working on a weird messaging application. So basically when I hit the send message button, I immediately kick off an IntentService that makes a database entry and a network call. Is that kosher? It seems smart because literally right away, I'm off of the mainthread and I'm on the IntentService thread. Does tha Mar 10 05:41:12 eghdk maybe a little heavyweight start service for each outgoing message ,,, Mar 10 05:41:21 and what do you do for incoming ones ? O.o Mar 10 05:42:32 Similarly, if I have to download a msg, I start an IntentService that hits the network, and pulls down new messages, and makes entries into the DB. I have a whole bunch of other db stuff which I just made each one a separate IntentService. Like updateUserNameInDBIntentService. Literally, an intentservice makes not working on the main ui thread so easy... so I did it for any kind of io Mar 10 05:43:36 So Palette seems to only generate a small amount of swatches depending on the image, do you guys prefer to trickle down to backup swatches or to have specific backup colors you revert to? Mar 10 05:44:09 I guess that's much more of a design question than a programming question Mar 10 05:45:17 It works fairly well actually g00s but I'm getting concerned that it may not be the best thing to do. I specifically use a service, because I was taught that a Service makes your app less likely to be killed. So when I send a message, I decided to do that in a service because I WANT the DB to persist and the network request to go off, even if I leave the app and quickly open up a game. Mar 10 05:46:16 eghdk technically, you are correct. all the older AOSP apps did their db stuff in services Mar 10 05:46:28 WOO Mar 10 05:46:32 Anyone knows How to add tablerow to tablelayout dymaically , I want to add the textview and a button to delete it Mar 10 05:46:36 eghdk also, Activity#onStop blocks if there are any pending preference writes Mar 10 05:46:46 whenever user clicks add button Mar 10 05:46:56 what do you mean blocks? Mar 10 05:47:02 eghdk but starting/stopping services for each message sent/received seems , hm Mar 10 05:47:44 starting a service isn't heavyweight Mar 10 05:48:11 Chet Haase says why Mar 10 05:48:30 You had my curiosity, but now you have my attention... Mar 10 05:48:37 it has to be taken into context, what heavy is Mar 10 05:49:32 eghdk see https://medium.com/google-developers/developing-for-android-vii-the-rules-framework-concerns-d0210e52eee3 Mar 10 05:51:13 eghdk btw "Isolate UI processes from Background Services" ... Mar 10 05:51:20 i thought , man thats a pain in the ass ... Mar 10 05:51:26 Hi, new here. Haven't used irc in 15 years. Mar 10 05:51:39 but dianne H said recently on SO thats the way google apps are now Mar 10 05:52:04 I have a project on git that has a bug. Can I post the link here to see if anyone is interested in working on it? Mar 10 05:52:21 lukeallison things must have changed in 15 years ;) Mar 10 05:52:35 g00s: Do you happen to have a link to that? I'm just lost on what's the best way to do it. Mar 10 05:52:50 actually it was google+ i remember now Mar 10 05:52:59 i'll never be able to find it, because i can't find shit on g+ Mar 10 05:53:43 I was always taught that an activity shouldn't create threads and stuff really (specially for network stuff), because you don't know when the network will respond, and the user could have left the activity and so it could be long gone. If something doesn't happen in an Activity or a Service. Where does it even exist? Mar 10 05:53:59 it looks the same to me! Less MP3 piracy though. Mar 10 05:54:02 :P Mar 10 05:55:14 Project: ViewPager with three Fragments. The third fragment is a Master (list) that has a Child (detail) fragment. There is one issue, which is stated in the readme. https://github.com/lukeallison/ViewPagerMasterDetail Mar 10 05:58:04 g00s: Can you remember anything else about the post by Dianne. Was it a post or a comment? I'm going to go searching it sounds interesting. Mar 10 05:58:23 eghdk it was her comment on a bug in android Mar 10 05:58:40 about some corner case, services being killed Mar 10 05:59:07 eghdk is there a way to browse a person't comments left on other threads ? Mar 10 05:59:42 i have a list of questions i keep, if i ever meet a framework engineer like dianne :) Mar 10 06:00:29 I met her at android dev summit. asked her a LOT of questions I was saving myself. Mar 10 06:01:06 I think the bug you were talking about was because she said all of googles apps used the service in a different process to make sure it stays alive. Mar 10 06:01:22 eghdk yes that is the one Mar 10 06:01:38 yeah. I saw that one. And we actually talked about that one when I met her. hahaha Mar 10 06:01:53 any thoughts on my previous message "I was always taught that an activity shouldn't create threads and stuff really (specially for network stuff), because you don't know when the network will respond, and the user could have left the activity and so it could be long gone. If something doesn't happen in an Activity or a Service. Where does it even exist?" Mar 10 06:01:54 eghdk , oh now you have my attention :D Mar 10 06:02:11 eghdk what did she say ? Mar 10 06:02:48 and they seem to keep changing their advice, i don't know what to believe any more ;) Mar 10 06:02:49 g00s: It just came up in conversation because I asked her about the docs saying/insinuating that a single activity could be killed while others lived. Mar 10 06:05:20 not that services were being killed, they were getting dozed Mar 10 06:05:41 Nothing wrong with creating threads in activities, just be ready to deal with the fact that the activity might have gone away Mar 10 06:05:53 service is a lifecycle container Mar 10 06:05:54 that is all Mar 10 06:06:06 if you need something that lives beyond your activity, you use a service Mar 10 06:06:13 if your thread lives within your activity, you can do that Mar 10 06:06:54 So, my db operations... I feel like they should live in a service. Is that "okay"? Mar 10 06:07:02 sure Mar 10 06:07:03 If the response comes after your activity is gone, do you still need that result? If no, launch from the activity. If yes, use a service. Mar 10 06:07:21 eghdk if you look through the old AOSP apps, you will find something called AsyncQueryService Mar 10 06:07:25 CedricBeust: What do you mean response? Mar 10 06:07:36 the completion of your thread Mar 10 06:07:44 Whatever your thread is doing that might outlive your activity, typically a network call Mar 10 06:07:50 Has anybody come accross this issue? I'm using a Toolbar in a Coordinator layout with a List underneath the Toolbar. The first time the layout is inflated results in the last item of the List being pushed below the screen's bounds. After rotating the issue dissapears. Mar 10 06:08:29 Simply putting padding on the bottom of the screen the height of the Toolbar doesn't solve the issue as it will leave an unwanted space at the bottom after rotating the device and the layout is inflated again. Mar 10 06:08:42 I basically use my activity to kick off my services, and at the end I post an event via Otto. Any activity subscribed will know what to do with the response. Usually notifyDataSetChanged() Mar 10 06:09:20 eghdk there are so many ways to skin this cat on android ... Mar 10 06:09:44 Okay. I just wanted to make sure this way of skinning this cat wasn't like the devils way or something. Mar 10 06:09:49 what arguments do TextView.canScrollHorizontally(??) accepts? Mar 10 06:10:07 * vigilancer dreaming of enums Mar 10 06:10:18 CedricBeust: what kind of service? Unbound services are deprecated in 24, and can get killed as soon as the screen is off... Mar 10 06:10:39 vigilancer from today https://groups.google.com/forum/#!topic/h2-database/VXRkby3jucc Mar 10 06:10:40 Haven't read up much on 24 yet Mar 10 06:10:43 that's not true at all Mar 10 06:10:51 but I do have the beta of N running on my device Mar 10 06:10:52 people are reading too much into "may deprecate in a future version" Mar 10 06:11:03 people like to claim the sky is falling Mar 10 06:11:17 vigilancer you were using mvstore right ? Mar 10 06:11:24 yup Mar 10 06:11:36 yeah i think i'm changing my mind Mar 10 06:11:45 How would I create a "service" that should be tied to a single activity? Like... I want to load an image... I want to use a service so that it runs in the background, but when the activity is actually put in the background, I want the service to stop. Is there a way to get a thread to just run while the activity rotates? Mar 10 06:11:48 Is there a specific Context you have to use to pull the theme from to get values from "theme.resolveAttribute()"? Mar 10 06:11:54 It's just returning 0 for everything Mar 10 06:12:12 g00s: about? Mar 10 06:12:13 justJanne i saw that warning, but it was kinda ... unclear / distant. are you sure ? O.o Mar 10 06:12:18 vigilancer about mvstore Mar 10 06:12:36 about asking me? about using it? about not using it? :) Mar 10 06:13:11 I'm actually confused about the JCE change, so if there's any crypto to be used at all, it must be explicitly by a bundled bouncycastle now? that's harsh Mar 10 06:13:15 vigilancer i was going to use it, but seems this issue keeps coming up in tracker of files getting corrupted Mar 10 06:13:33 I'm using the application for context if that makes a difference Mar 10 06:13:38 vigilancer let me know how it goes :D Mar 10 06:13:52 No? I guess haha. Mar 10 06:13:57 g00s: ah, well. good to know. not using it in production anyway Mar 10 06:14:14 g00s: the warning means using them is unsupported, and at least with 25 or so they'll just completely throw it out of the window. Plus, Doze. Mar 10 06:14:29 oh, you can use crypto, you can't just assume "BC" is present Mar 10 06:15:00 pfn: that part is also concerning. Does that also apply for legacy apps? Because it's break a lot of currently working gingerbread era apps. Mar 10 06:15:10 I'm thinking about to try that nice sqlight embedded feature Mar 10 06:15:13 Like most apps from carriers... Mar 10 06:15:17 not concerning, fuck gb apps Mar 10 06:15:48 pfn: yeah, and, as an alternative, I call my carriers support every time I want to add some money to my prepaid SIM? Mar 10 06:15:53 No thanks, gonna use the app. Mar 10 06:16:18 justJanne yeah, dunno. but when google says shit like that , they should provide more information not just "look out, things are gonna change!". i mean, wtf would you replace it with (as a developer, given whats available now) Mar 10 06:16:35 Well, BC doesn't work on pre-N Mar 10 06:16:40 So use SpongyCastle Mar 10 06:16:52 (oh, i meant background service thing) Mar 10 06:17:20 Oh, that. Mar 10 06:17:25 Well, simple: Mar 10 06:17:52 How to use apps that aren't glorified webpages and actually do something on Android MM, N and above: Mar 10 06:17:56 they already told you what to use Mar 10 06:18:00 Step 1: throw out your phone Mar 10 06:18:13 Step 2: buy one with another OS, like SailfishOS Mar 10 06:18:22 * g00s headdesk Mar 10 06:18:24 g00s: So an issue I'm having is that network requests take long... but db ops are short. In my SendMessageService I do the Db op... wait for network, then process next intent, which does the Db op, then waits for network. How would I go about solving this in my architecture? My first reaction is to split up the db operations into their own service, and then kick off the UploadNetworkService. Does that make sense to you? Mar 10 06:18:55 eghdk usually your networking and db go on different threads ... Mar 10 06:19:09 ... But in the same service Mar 10 06:19:28 Is the order sequential? networj -> db -> network -> db ? Mar 10 06:20:18 Well... I always/usually want the db stuff to happen first, but once something is in the Db but not sent up to the server, I want to send that up as well. Mar 10 06:20:21 Well, g00s, Google very directly said they wouldn't want any local apps computing anything, or collecting data. Except their own, of course. Mar 10 06:21:06 justJanne i need to maintain connection to bluetooth device in my bg service, i don't know what they would expect me to do if they got rid of unbound services Mar 10 06:21:08 g00s: Good point about "usually you want your networking and db to go on different threads" Mar 10 06:21:50 g00s: how do you handle Doze today? Mar 10 06:22:02 Doze is going to be a headache Mar 10 06:22:30 ugh my service is Foreground, i haven't had a problem yet but ... i haven't tested too much Mar 10 06:22:42 CedricBeust: What do you mean sequential? What does that have to do with it? (pardon my ignorance/stupidity) Mar 10 06:22:43 Ah, that does work then. Mar 10 06:22:51 Foreground Services are bound services. Mar 10 06:22:55 eghdk: I just don't quite understand your problem Mar 10 06:23:01 Bound to the lifetime of a notification, in fact. Mar 10 06:23:14 (But still can be killed during Doze) Mar 10 06:23:18 justJanne O.o we are using bound differently i think Mar 10 06:23:34 man i hate this fucking topic Mar 10 06:23:40 g00s: bound meaning "bound to at least one context" Mar 10 06:23:53 A context being activity, application, or notification, etc Mar 10 06:24:07 bound to notification ... i've never heard of that before Mar 10 06:24:18 So is it just me or are themes amazing and should be used as much as possible, except the documentation for them is absolutely shit? Mar 10 06:24:25 CedricBeust: Basically I started the conversation off today saying... "Holy shit, I just made my app architecture "Anything that is i/o goes into an intentservice"" This is mostly because I'm writing a messaging app. So, when I press send... I want it to commit to DB right away. and then send over the network. Mar 10 06:24:28 how do I import my non-gradle code into android studio? I tried File > New > Import Module ... but it's looking for a gradle file. I'm trying to import some jni java + c sources Mar 10 06:25:20 konk3r how the theme system works is well documented - the theme itself, and its attributes ... not :D Mar 10 06:25:28 CedricBeust: and I was just seeing if anything with my approach to make like everything a service was inherently terrible for my app. Mar 10 06:25:40 i always have the system attr.xml up for reading Mar 10 06:25:45 The theme system is powerful and great! Mar 10 06:26:04 konk3r except no multiple inheritance, that does suck Mar 10 06:26:31 They just need to make it easier to access programmatically and give a COMPREHENSIVE list of its attributes Mar 10 06:28:33 g00s: indeed... Mar 10 06:30:29 eghdk: Still not sure what you are trying to do, fetching things from the network into your db? Mar 10 06:31:36 Ugh, I was right Mar 10 06:31:50 You have to use an Activity to retrieve theme values, you can't use an application Mar 10 06:31:52 CedricBeust: My send button kicks off SendMessageIntentService. The intent service right now does the db insert... then the network call. All of those calls are synchronous inside of the intentservice. Mar 10 06:32:24 That's annoying Mar 10 06:32:47 has anyone here ever done NDK before with Android Studio? Mar 10 06:33:37 So I basically have db insert, network call, db insert, network call, if I send two messages really quick. So I'm deciding to make a DBInsertIntentService, and on complete of the DBInsertIntentService, another service gets called UploadUnsentMessageIntentService. But idk if I'm going overboard on IntentServices CedricBeust Mar 10 06:34:07 lol Mar 10 06:34:24 I feel like I'm literally making everything an IntentService, and I just didn't want to be breaking any "rules". Mar 10 06:34:26 eghdk i'd take a look at rxjava ;) Mar 10 06:34:37 put the whole pipeline in one service Mar 10 06:34:50 g00s: I AM! But I wanna solve this without Rx lol. It's a challenge for myself right now Mar 10 06:35:13 but it sounds like you're playing ping pong :D Mar 10 06:35:39 Passing shit through extras and stuff IS being a bitch in this scenario g00s hahaha Mar 10 06:38:24 g00s: How would I go about downloading an image or just any other network call that ONLY has to be shown in an activity, so I don't want to do it in a service? But I want it to live across rotation. Is that even possible? Or only with a headless fragment? Mar 10 06:39:32 eghdk yeah you could use headless for that ... Mar 10 06:39:46 eghdk guess you could also make custom loader Mar 10 06:39:52 i never did that Mar 10 06:41:25 g00s: Where does a thread live if... like... it's not attached to an activity? I think my main reason for architecting my app around Android Components (like Chet Hasse said NOT to do) is because I feel like my app and threads have to be running inside of one of the Android components. Mar 10 06:45:27 eghdk, nope Mar 10 06:45:31 there is no such thing as "inside" Mar 10 06:46:14 any retrofit 2.0 user here? Mar 10 06:46:26 pfn: I want to argue with you... but I don't actually know. hahaha. What do you mean there's no "inside"? Activities have very clear lifecycles... and so do services... Mar 10 06:46:41 arunl: me Mar 10 06:47:38 Hey, Jake. if I use Call getRequest(@Url String url, @QueryMap Map options), can I later convert the raw json myself in onResponse callback? Mar 10 06:48:51 Sure. You can use the Retrofit class to look up a converter by calling reaponseBodyConverter(SomeType.class) and then passing it the ResponseBody Mar 10 06:49:57 Thanks JakeWharton: I saw your comment somehwere where you said the biggest asset of retrofit is static typing. I was thinking of using retrofit as a module to plug it in multiple apps. More like making use of generic functions in a retrofit interface. Is it possible in anyway? Mar 10 06:50:44 It won't work with generics because the type information is lost at runtime Mar 10 06:51:09 You might be better off just using OkHttp and your serialization library directly at that point. Mar 10 06:51:25 Oh ok, thanks Mar 10 06:52:38 I wish I could make dagger work with my unit tests Mar 10 06:52:57 all I really need is a Context for my database Mar 10 06:53:20 eghdk, threads have their own lifecycles, an activity and service have no influence over them, and thus, you cannot design threads around android components Mar 10 06:53:27 i'm following android-boilerplate as a template Mar 10 06:53:43 eghdk, the proper thing to do is select a component whose lifecycle would accomodate what you need Mar 10 06:53:47 compiler cannot find DaggerTestComponent Mar 10 06:54:05 eghdk, but there's no such thing as ownership of the thread from an android component perspective Mar 10 06:54:39 pfn: Well a thread that creates a thread is the owner of the thread correct? Mar 10 06:54:46 eghdk: no Mar 10 06:54:54 A thread has no "owner" Mar 10 06:55:15 a thread is a top level construct Mar 10 06:56:11 If a regulat java thread is created inside of activity onCreate() doesn't the thread hold an implicit reference to the activity class? Mar 10 06:56:17 eghdk: No Mar 10 06:56:20 activity object* Mar 10 06:56:23 nope Mar 10 06:56:31 hm. I suck at threads and stuff I guess. Mar 10 06:56:32 if you create it as an anonymous class, sure Mar 10 06:56:40 but that's because of the synthetic this field Mar 10 06:56:45 has nothing to do with thread Mar 10 06:56:47 or ownership Mar 10 06:56:47 So why can't we use AsyncTasks? Mar 10 06:56:52 you can Mar 10 06:57:01 no one ever said you can't Mar 10 06:57:14 pfn: True, but I'm afraid that will be even more confusing since that reference has exactly zero impact on anything. It's not like threads can be garbage collected and killed. Mar 10 06:57:15 and any memory leak associated with an asynctask is thoroughly overblown Mar 10 06:57:33 loke, actually, if it's a long-running thread, then it definitely has impact Mar 10 06:57:46 it's a memory leak if it's long-lived Mar 10 06:58:01 pfn: I see what you mean. My point was in the context of having a thread's lifecycle constrained to that of the Activity. Mar 10 06:58:19 Only a crazy person would start a long-running thread in an Activity anyway Mar 10 06:58:24 Okay, so pfn. Lets say I press a button in an activity to load an image via the network. While it's half way done downloading. I rotate. The thread that I started in the original activity keeps going... and the download actually completes... but how do I get that thread from the newly created activity from the rotate? Mar 10 06:58:44 eghdk: You have to manage the thread manually from the Activity lifecycle methods. Mar 10 06:58:49 eghdk, you don't, you create that thread outside the lifecycle of your activity Mar 10 06:58:58 a singleton, a retained fragment, etc. Mar 10 06:59:02 pick your poison Mar 10 06:59:08 pfn: a service. Mar 10 06:59:57 service isn't necessary if the activity will always be foreground, and you don't care about it getting killed in the background Mar 10 07:00:09 service is only a lifecycle container to hint to android that your process should not be killed Mar 10 07:00:28 it is nothing more, until you start using ipc Mar 10 07:00:36 or the binder mechanism Mar 10 07:00:41 pfn: Not only. You can also use it to manage the lifecycle of a containing thread which has a lifetime longer than that of a single Activitry. Mar 10 07:00:55 it is only that Mar 10 07:01:06 and if the thread is only ever used from an activity, there's no reason for the service Mar 10 07:01:20 you don't want to hint to android that your app should stay alive Mar 10 07:01:27 you are already in the foreground when rotating, etc. Mar 10 07:01:58 creating a service is unnecessary boilerplate Mar 10 07:02:04 There was someone in here a few weeks ago that said that theres a way to make sure that downloading something in the background was possible to do while an activity was up and on rotation, but the thread would stop itself once you actually left the activity. That's what I'm trying to figure out now I guess. How do I do that. But I guess it's nothing magical huh pfn I just have to keep a ref to that Thread somehow, and then my newl Mar 10 07:02:17 create a service when you /need/ something to keep your process alive beyond foreground status Mar 10 07:02:27 hi! Mar 10 07:02:51 if you don't need your app to stay alive while it's not foreground, do not create a service Mar 10 07:03:54 Okay pfn so last question. Button in my activity downloads a big image (4k wallpaper or something) to display in the app. If I leave the app I want it to stop downloading. If I rotate, I want it to keep going. How would you solve that? Mar 10 07:04:08 you don't Mar 10 07:04:19 ? Mar 10 07:04:36 you can do tricks to keep track of foreground activities Mar 10 07:04:39 but otherwise, you don't Mar 10 07:04:56 So what would you do if you were told to program my example above? Mar 10 07:04:59 you can use the activity lifecycle listeners Mar 10 07:05:12 I would say it's not worth doing, unless there is a compelling business reason Mar 10 07:05:29 pfn: What if he configures his activity so that it doesn't restart when rotating? Mar 10 07:05:37 loke, that's a shitty solution Mar 10 07:05:38 In most cases, that's the right thing to do anyway Mar 10 07:05:46 So downloading the picture... you would just do it in a service? Mar 10 07:05:47 s/most/many/ Mar 10 07:05:48 where can I find more about the plugin: gradle-experimental:0.4.0 ? is there a documentation page? Mar 10 07:06:32 or you would start the big download in a thread from the activity, and onDestory you stop the thread... so you just lost all progress on the photo? Mar 10 07:07:53 totally depends on the full parameters of what you want to accomplish Mar 10 07:08:11 and you can detect recreation due to rotation, etc. Mar 10 07:08:21 onSaveInstanceState isn't called for pressing back Mar 10 07:10:15 well back calls onFinish() so that would destory, but okay I think I understand what you're saying. If I'm using a thread that I ONLY need in my activity, I can keep track of it in some way, but the thread is in NO WAY tied to an activity or another thread (main thread in this case). Is that correct? Mar 10 07:10:20 pfn: Mar 10 07:10:51 yes Mar 10 07:11:16 omg, the much needed multi window in N Mar 10 07:11:18 sooper Mar 10 07:11:46 direct reply.. nice Mar 10 07:12:12 I should install N preview on my nexus 9 Mar 10 07:12:19 too lazy to bother Mar 10 07:12:24 Hooray! Thanks pfn it's starting to make sense. So last thing about a thread in Android world. If I start a Thread in an android activity that had an infinite loop in it, what cases would that thread actually die? Mar 10 07:12:40 eghdk, when android kills your process Mar 10 07:12:58 the thread will never die while your process is running otherwise Mar 10 07:13:07 eghdk, get jcip, read it Mar 10 07:13:11 and ONLY in that case? Thats kinda crazy. Never knew that. Mar 10 07:13:57 pfn: reading http://www.amazon.com/Java-Beginners-Guide-Herbert-Schildt/dp/0071809252/ref=sr_1_2?s=books&ie=UTF8&qid=1457594021&sr=1-2 now Mar 10 07:14:01 pfn, literally one click to enroll in the beta program. It was easier than flashing. https://www.google.com/android/beta?u=0 Mar 10 07:14:39 then will move onto effective java, then jcip. Unless you think jcip would be better to read before effective java Mar 10 07:14:40 can someone point me to gradle-experimental:0.4.0 documentation? Mar 10 07:19:29 pfn: besides the question about the books above... I have 2 more questions for the night before I leave you alone and go to sleep myself. So if I start a thread. That bad boy is basically guranteed to run until it finishes or my process dies. 1. Is it bad practice to have a long running thread (network call) running while theres no foreground activity? 2. What ways can I make that Thread finish prematurely? Only if I keep a static Mar 10 07:19:32 eghdk, I have no real recommendation for books Mar 10 07:20:14 with no foreground activity, your app is eligible to be killed at any time Mar 10 07:20:34 app = process which in terms means the thread would die. Gotcha. So no gurantees. Mar 10 07:20:36 at the same time, running a thread in that situation intentionally is just unclean and being a bad app citizen Mar 10 07:21:30 how to make your thread finish is a question for jcip, but you would use flag variables, interrupt the thread, etc. Mar 10 07:21:39 threads in java are purely cooperative Mar 10 07:22:12 in terms of termination Mar 10 07:23:12 no useful comment but: I once read: "if you understand how threads works, you didn't get it"... thats what I stick to, just use them if I have to and dont think about how they work xD Mar 10 07:23:21 okay. jcip. understood. Anytime I create a thread in ANdroid I've always used new Thread(new Runnable()) so in that way I would NOT be able to interrupt the thread right? because I didn't map the new Thread to a variable right? Mar 10 07:23:45 jack and jill.. haha Mar 10 07:23:52 the android devs are having fun :) Mar 10 07:24:48 you wouldn't be able to interrupt the thread, but you could set a flag "running" that the thread could read, and respond to at some point Mar 10 07:27:08 pfn: That makes sense. If I make the flag a static or if I set it as part of the member of the Application class. So let's just say I feel like something is going to be done in a thread, because I need it off the UI thread, but it doesn't require a full blown service, I'm usually okay with not keeping a reference variable to the Thread? That's the feeling that I'm getting from you. Mar 10 07:27:40 you don't necessarily need to reference the thread Mar 10 07:27:48 stuff like this would be answered by reading jcip Mar 10 07:32:05 eghdk.. try handler, asynctask , service.. before getting into threads Mar 10 07:34:51 pfn: Cool man. You have educated me a ton tonight. APpreciate you working with me. Time to build better apps. Thanks again dude. Have a good night Mar 10 07:51:01 JakeWharton: With Call in retrofit interface and .addConverterFactory(GsonConverterFactory.create()) while building retrofit, if I later deserialize in onResponse callback, does it mean the response will be deserialized twice? Mar 10 07:51:44 I mean, will there be any unwanted overhead? Mar 10 07:52:23 how would i populate a listview whose individual row item, i have set as a horizontal linear layout containing two side-by-side textviews? Mar 10 07:53:33 http://pastebin.com/BzxtP6sf — this is my ArrayAdapter code which is populating said ListView with an ArrayList called Transactions Mar 10 07:54:01 JakeWharton: just a fundamental question, does ResponseBody in Call also get deserialized by Retrofit if I'm specifying GsonConverterFactory in addConverterFactory? Mar 10 07:55:16 Will the json response get deserialized if it's Call Mar 10 07:59:15 arunl: usually, no. Mar 10 07:59:45 You can also use JsonElement to get the JSON element Mar 10 08:01:12 some links would be really useful Mar 10 08:01:24 not that i cant google, im getting confused with some of the posts Mar 10 08:13:55 whats the probs supay Mar 10 08:14:30 muthu: i would like a custom listview row with two side-by-side textviews Mar 10 08:15:11 muthu: this is each individual row layout - http://pastebin.com/ZMHhyadc Mar 10 08:16:15 muthu: and im using two ArrayLists to populate specific elements in that row xml, like so: http://pastebin.com/sZMBh8xF Mar 10 08:16:36 am i doing it right? or is there a better more efficient way to do it? Mar 10 08:18:49 use a simpleadpter Mar 10 08:19:05 http://developer.android.com/reference/android/widget/SimpleAdapter.html Mar 10 08:19:53 how can I tell gradle to fetch the sources for my dependencies from maven central... I know i've seen a check box for this somewhere but it's not showing Mar 10 08:22:42 oh never mind I got it Mar 10 08:24:22 where is it? Mar 10 08:27:28 grekkos where is the checkbox? Mar 10 08:30:02 muthu: well I didn't find the checkbox, but I saw that it pulled in the sources. It might have been from the build.gradle change I made to add the idea/downloadSources option Mar 10 08:30:23 muthu: https://docs.gradle.org/current/dsl/org.gradle.plugins.ide.idea.model.IdeaModule.html in this example he shuts it off by setting to false Mar 10 08:34:55 thanks grekkos Mar 10 08:36:37 why is adding a non-android studio/gralde project so annoying in AS? Mar 10 08:36:41 oh new adb has progress bar for push now Mar 10 08:36:58 woah nice Mar 10 08:37:05 grekkos, because you're not using a sane build system? :P Mar 10 08:37:12 It should support Maven and Gradle out of the box Mar 10 08:37:24 I have no idea how this import module thing works Mar 10 08:37:32 haha Mar 10 08:37:39 its a coin flip :) Mar 10 08:37:47 sometimes it imports.. sometimes it don't Mar 10 08:37:48 I have a dependency on this 3rd party lib (it's in maven) but I need to edit the sources for android or it won't work Mar 10 08:38:07 and I have the sources on my hard drive but I don't know how to get them into the AS project Mar 10 08:38:17 every time I do import module it says that it's not a gradle or eclipse project Mar 10 08:38:32 create a new gradle project.. then copy the sources Mar 10 08:38:53 easier than to try import a non gradle project Mar 10 08:39:20 I tried just dragging and dropping but that doesn't work Mar 10 08:39:25 and if I delete in AS it deletes it from my filesystem Mar 10 08:39:36 how do I remove it without deleting it Mar 10 08:40:04 oh i see Mar 10 08:40:06 it moved them Mar 10 08:40:08 stupid thing Mar 10 08:44:12 that didn't work either Mar 10 08:44:42 grekkos, normally AS is smart enough to convert an Eclipse project to AS. If it can't import a lib, it tries to get it from maven. Most often it works. Mar 10 08:45:02 it's actually being pretty stupid right now Mar 10 08:45:04 Hey all. Quick question that I can't find the answer to. I have a Framelayout with two children, a Google Maps Map Fragment and a TextView. The TextView appears over the fragment (like it should) when the activity starts, but when the map fragment is finished with its zoom animation the text view disappears. Anyone have ideas how to fix this?? Mar 10 08:45:22 Number5: I think there are only pom files in my case Mar 10 08:45:45 Number5: it can grab it from maven perfectly fine but I want it to use the one on my hard drive because I need to alter those sources Mar 10 08:46:54 it's not creating any gradle files for it Mar 10 08:47:16 grekkos, maybe you can tell AS to make an exception for your lib. I'm afraid you have to google more. Mar 10 08:47:45 everything comes up for eclipse and that's not what I'm looking for :| Mar 10 09:01:02 for the sake of my sanity please let this work ._. Mar 10 09:01:39 unable to decode a string from base64 Mar 10 09:02:46 fbPin = Base64.decode(pinBase64.getBytes()); Mar 10 09:03:04 it says ‘cannot resolve method decode(byte[])' Mar 10 09:04:23 supay: as far as I can tell it doesn't: https://developer.android.com/reference/android/util/Base64.html Mar 10 09:04:55 supay: maybe you're looking for https://developer.android.com/reference/android/util/Base64.html#encode(byte[], int) Mar 10 09:05:19 grekkos: nope, not encoding. encoding is working fine. decoding isnt Mar 10 09:06:07 rtfm Mar 10 09:06:23 you should see that there is two (or more) params for the decode Mar 10 09:06:33 fbPin = Base64.decode(pinBase64, Base64.DEFAULT); Mar 10 09:06:39 not working. Mar 10 09:07:04 now it says “Incompatible types: need String, found byte[]’ Mar 10 09:07:06 that's an another issue compared to: fbPin = Base64.decode(pinBase64.getBytes()); Mar 10 09:07:20 you must be more careful in passing the correct param type Mar 10 09:07:58 supay: sorry I misclicked Mar 10 09:08:20 no problem! :) Mar 10 09:08:22 supay: I meant to reference this https://developer.android.com/reference/android/util/Base64.html#decode(byte[], int) Mar 10 09:09:35 guess i have it fixed now! :) Mar 10 09:09:36 thanks guys Mar 10 10:04:02 Hey all! Mar 10 10:05:13 So, Android tools for Gradle is supposed to have a 2.0.0-beta6. However, when I try using that in my build.gradle I get the following error: Mar 10 10:05:16 https://bpaste.net/show/1893ef4c811a Mar 10 10:05:59 But those paths indeed give a 404. Anyone know why those were taken down? Mar 10 10:08:04 yakitty, those were never on maven central but were part of a repo on your local machine Mar 10 10:08:12 so update your two repositories with SDK manager Mar 10 10:08:20 Aaaah. I see Mar 10 10:08:22 And it's entirely possible those were replaced with 2.1.0-alpha1 Mar 10 10:08:26 Ok, that makes sense Mar 10 10:08:54 Mavrik: Thanks! Will give that a short. Mar 10 10:09:00 shot* Mar 10 10:19:30 I am using git in android studio - I have enabled Version control integration, selected git Mar 10 10:19:37 than add files Mar 10 10:19:51 ctrl + k (commit) Mar 10 10:20:00 filled commit message Mar 10 10:20:03 everythin as usual Mar 10 10:20:28 but - clicking on commit and push does nothing Mar 10 10:21:55 no warning error just "Performing Code Analysis" window blinks in a split of a second Mar 10 10:21:57 that is all Mar 10 10:22:02 where can i search for what went wrong Mar 10 10:22:15 or any idea what could it be? Mar 10 10:26:59 http://stackoverflow.com/questions/31865143/android-studio-commitpush-bug Mar 10 10:54:43 hi! Mar 10 10:59:47 where can I find how ART behaves compared to NDK code when doing processor intensive work? Mar 10 11:00:18 Mavrik: So I updated twice. And now I have 2.1.0-alpha1 in Android Studio's m2 repository, and still: https://bpaste.net/show/ae2e87884003 Mar 10 11:00:47 It looks like it isn't even looking at my local maven repo. :( Mar 10 11:01:49 Hmm. Maybe I need to add mavenLocal() Mar 10 11:02:44 Nope. :( That's looking at my ~/.m2 instead Mar 10 11:02:57 Not in Android Studio's m2repository Mar 10 11:04:23 Hi. i'm trying to achieve this layout http://imgur.com/3vNSipp Now that is quite simple. I want add more times to it to the right. I also want the user to scroll in a horizontal way finding the right time. The buttons works like radiobuttons, so only one must be selected. Do you have any suggestions? I've tried this, but it doesn't work like i want (maybe because of weight): http://pastebin.com/Gxe12BBM Mar 10 11:05:02 With simple i was meaning about considering it without the scroll ;) Mar 10 11:13:41 Hello guys, I have a question about a design problem. I have multiple TextViews in several fragments. What I want is to change textsize property of all those TextViews when the user modifies it in the setting page. What's the best way to do that? (I was thinking about an observable kind of thing, but never experimented with that). Mar 10 11:15:27 A straightforward solution would be to get the setting value and set each TextView on loading fragment/activity. But that means I have to do that like in 20 or more textviews. Which is tiresome. Mar 10 11:19:15 Word to your respective mothers Mar 10 11:23:57 is android runtime (ART) also a virtual machine? is ART code garbage collected? Mar 10 11:42:29 morning all, is there a way to disable the white 'highlight' that certain phones seem to apply whenever I press certain buttons/menu items? i've tried setting android:actionBarItemBackground and android:selectableItemBackground to transparent in my theme, but no luck :( Mar 10 11:42:57 Im seeing the issue on a samsung galaxy s4, if that matters. emulator/other devices don't apply this same decoration Mar 10 11:44:01 https://imgflip.com/i/10l92f Mar 10 11:44:49 danijoo: ha, can i take that to mean it can't be done? or it's just a massive headache? Mar 10 11:45:20 i dont know what highlight you mean unfortunatly :/ Mar 10 11:46:19 hmm Mar 10 11:47:00 for context, im using an appcompat theme and have implemented the toolbar with some of my own icons Mar 10 11:47:13 can you make a screenshot? Mar 10 11:47:30 whenever i tap one of these icons, I see a white 'glow' around them as it's depressed Mar 10 11:47:34 I can try, yes Mar 10 11:50:37 danijoo: http://puu.sh/nBsOq/cffa81d4d1.png Mar 10 11:50:39 here you go Mar 10 11:51:01 the white square around the button is when it is tapped/held Mar 10 11:51:59 hm. iirc thats colorControlHighlight Mar 10 12:08:03 I have a cursor that crashes with an index out of bounds exception because -1 was requested. however the value isn't -1, it's 1. it's that according to the debugger, it's that according to the log, it's that according to the if check right before. Mar 10 12:08:12 Why would this be so weird? Mar 10 12:11:48 yesterday I was having problem with Setting / SharedPreferences / NumberPicker Mar 10 12:12:44 I have coppied Mar 10 12:13:14 NumberPickerPreference.java from another project, where it works Mar 10 12:13:28 in new project source https://github.com/sonavolob/SettingsWithNumberPickerPreference Mar 10 12:14:30 I didn't realise Android did this while downloading system updates: http://picpaste.com/oGjzndN5.png Mar 10 12:15:29 I am constantly getting errors "Error:(36) No resource identifier found for attribute 'charInputMinimum' in package 'com.example.settingswithnumberpickerpreference'" - for using namespace "xmlns:app="http://schemas.android.com/apk/res-auto" which works in another project. This error can be overcome with namespace xmlns:app="http://schemas.android.com/apk/lib/com.example.settingswithnumberpickerpreference" Mar 10 12:15:44 Any clue why? Mar 10 12:16:17 Second error is related to file https://github.com/sonavolob/SettingsWithNumberPickerPreference/blob/master/app/src/main/java/com/example/settingswithnumberpickerpreference/NumberPickerPreference.java Mar 10 12:17:13 compiling project says "Error:(29, 12) error: invalid method declaration; return type required" - again this is version of NumberPickerPreference.java which I am using in another project without any problem Mar 10 12:18:31 Can anyone please compile that test project https://github.com/sonavolob/SettingsWithNumberPickerPreference and help me with that? Mar 10 12:22:21 bolovanos: open up NumberPickerPreference.java and goto Line 29 Mar 10 12:22:43 change to: public void NumberPickerPreferencer(Context context, AttributeSet attrs) { Mar 10 12:22:48 see if that works Mar 10 12:32:55 naise1, I have noticed that lint is complaining about return statement, but 1) I thing that it is constructor and as such it has no return type 2) if 1 is true that is why it was not there in previous usage 3) tested it with void - now it says "Error:(30, 14) error: call to super must be first statement in constructor", "Error:(50, 21) error: cannot find symbol variable NumberPickerPreference", "Error:(51, 45) error: cannot find symbol variable Mar 10 12:32:56 NumberPickerPreference_charInputMinimum", "Error:(53, 45) error: cannot find symbol variable NumberPickerPreference_charInputMaximum" Mar 10 12:36:01 Sigh... I'll download it and see if it comiles. Mar 10 12:36:04 compiles* Mar 10 12:51:34 Hmm I'm getting build errors too Mar 10 12:51:44 although different from yours Mar 10 12:52:07 Actually it's exactly like yours, the charInputMinimum Mar 10 12:54:54 naise1, thank you for your effort, I cannot get it Mar 10 12:55:21 if you try to write R.styleable. in code and than ctrl + space - it does not know "NumberPickerPreference_charInputMinimum" either Mar 10 12:56:12 maybe because it cant compile it and therefor R.java is not available yet Mar 10 12:57:19 yes and it cannot compile because it does not know it loop closed Mar 10 13:10:18 Hello guys, I have a question about a design problem. I have multiple TextViews in several fragments. What I want is to change textsize property of all those TextViews when the user modifies it in the setting page. What's the best way to do that? (I was thinking about an observable kind of thing, but never experimented with that). Mar 10 13:10:50 A straightforward solution would be to get the setting value and set each TextView on loading fragment/activity. But that means I have to do that like in 20 or more textviews. Which is tiresome. Mar 10 13:12:21 Number5, maybe use a custom theme Mar 10 13:12:30 so you just have to call setTheme Mar 10 13:14:03 ktwo, hmmm that's a solution, I'm just not so familiar with changing theme property, but I'll check it out later. Mar 10 14:15:16 How do I publish my make gradle generate a propper pom when publishing my aar using gradle maven-publish plugin? Mar 10 14:15:30 The issue is that it does not include transitive dependencies Mar 10 14:52:38 Hey guys, does anyone know a way I could download/use the iPhone calculator button styles in my android app? Mar 10 14:54:20 casadogg I was away from my computer yesterday, I'm here for a while now if you want to talk annotations again. Mar 10 14:59:09 Hello Mar 10 15:00:17 Why is it that if I create a LinearLayout and use: android:paddingBottom="@dimen/activity_bottom_margin" Mar 10 15:00:17 and android:paddingTop="@dimen/activity_top_margin" I get errors saying the symbol cannot be recognized but when I use the same attributes in a relative layout I get no errors? Mar 10 15:01:02 areitz Thanks man. I'm caught up in something else now =/ I'll have to figure this annotation processing thing later Mar 10 15:01:03 Thanks for the help though Mar 10 15:03:26 Got my problem to work the dimens weren't added correctly Mar 10 15:14:51 Hey guys, do you know why I keep getting an error on Android Studio regarding not being to install platform-tools on OS X ? Mar 10 15:15:53 hi! Mar 10 15:16:16 hi! Mar 10 15:16:19 I am using com.android.tools.build:gradle-experimental:0.7.0-alpha1 Mar 10 15:16:22 areitz Do you think that if I try annotation processing outside of the Android context will help me understand it better? Mar 10 15:16:37 and the native activity sample Mar 10 15:16:47 I have this issue I noticed last night when I was debugging my BLE code. My tablet that I am developing sits next to BLE unit that is broadcasting (I am not pairing) and when I connect I get data. With out my disconnecting I get BluetoothProfile.STATE_DISCONNECTED event from onConnectionStateChange. Sometimes I will get data for 5 min to 15 min and I get disconnected. Anyone seen thins> Not sure if this is my code or sometime else. Mar 10 15:17:15 but in Android Studio (version 2.1) all the includes are red. like all: #include , #include .. etc Mar 10 15:17:31 any ideas on how to point Android Studio to the headers from NDK? Mar 10 15:17:37 casadogg no, it might help with setting up gradle files, but Android really doesn't change anything Mar 10 15:18:14 casadogg this is what I wrote to just get the hang of it. A joke annotation processor https://github.com/pieces029/bad Mar 10 15:18:17 *when I say the includes are red I mean not found by Android Studio Mar 10 15:18:39 Anyone ?? Mar 10 15:18:50 Anyone here also ? :) Mar 10 15:18:56 areitz I giggled. Mar 10 15:19:47 Will have a look at your project, thanks man. Mar 10 15:19:52 np Mar 10 15:20:26 I've wanted to make an annotation that purposely slows down compilation too so you can hang out something like @LunchBreak and @CoffeBreak :) Mar 10 15:22:01 Hello guys, if I want to get a listpreference object from xml, does this mean that I have to define an id to a preference item? Like in layouts? Mar 10 15:24:56 when launching a new activity will Intent.FLAG_ACTIVITY_CLEAR_TOP use an existing instance of my activity if one is available on the back-stack? Mar 10 15:27:58 areitz You could add a WhatTheFuck annotation and count the number of WhatTheFucks in the processor. Code quality measurement in a team environment is good. Mar 10 15:28:14 rmrrn: yes Mar 10 15:28:39 rmrrn: "If set, and the activity being launched is already running in the current task, then instead of launching a new instance of that activity, all of the other activities on top of it will be closed and this Intent will be delivered to the (now on top) old activity as a new Intent." Mar 10 15:29:05 Haha that would be a good one. It's just hard to justify maintaining a joke library when there is a lot of other real work to do out there. Most of these ideas I've had were going to go into this https://github.com/InkApplications/java-hyphen-the-github-repo/ Mar 10 15:31:25 Maurits-: thank you. i'm noticing that the animation isn't always the same, depending on when this is executed, for context, i have a 'return to homescreen' button that makes use of this. Mar 10 15:31:36 i've tried the no animation flag, but it doesnt make any difference Mar 10 15:34:03 I'm not sure about that. It could be the case that it matters whether the activity is relaunched or not. Mar 10 15:34:28 Is it always running in the stack of the task that you're launching it in? Mar 10 15:34:59 yeah, it should be. Mar 10 15:35:24 I never finish it. the behavior isn't really consistent but the difference is quite jarring Mar 10 15:38:32 Can anyone help me with platform-tools on OSX ? Mar 10 15:39:12 areitz yeh time's short, I know, but it's haha Mar 10 15:39:19 I mean it's funny* Mar 10 15:45:59 Potentially dumbass question but I can't find the answer for this anywhere: when you have two different flavors of an app, do you have to create two different "apps" in the playstore? Mar 10 15:46:37 yes Mar 10 15:46:43 that's the point of flavors Mar 10 15:46:54 unless you mean abi and resource splits Mar 10 15:49:07 hey! I am interested in automating some stuff in a WebView, is it possible? Mar 10 15:49:44 I am thinking of something like Selenium WebDriver but it doesn't have to be for testing. I just need to enter a couple of strings in some textboxes of a web page and click a button Mar 10 15:53:53 rmrrn: there is a setting in developer options that will always kill activities when they would normally be sent to the background (ie, onStop()) Mar 10 15:54:09 rmrrn: you could try enabling that and seeing if you get consistent animation behavior then Mar 10 16:00:12 Maurits-: i'll try that, thank you! Mar 10 16:00:35 How do you get the width and height of a layout which uses wrap_content? Mar 10 16:01:11 I'm using a GlobalLayoutListener and I got the width of the layout which is was listening to and it returned 1328. What is that in terms of px? Mar 10 16:03:03 pfn cheers :). Mar 10 16:04:41 Maurits-: nah, that does not seem to make a difference unfortunately. interestingly, if I press my 'return to home' button when I am actually on the home activity, I get a more suble animation the first time only, each subsequent press gives me the full closing/opening animation. it's not a huge deal, I was just curious if anyone had seen it before. Mar 10 16:13:29 I wonder if I can embed a clojure interp Mar 10 16:14:21 Are you supposed to initialise variables in onCreateView or onViewCreated for Fragments? Mar 10 16:14:42 I've been doing it within onViewCreated but I'm doubting myself if that's correct Mar 10 16:14:54 and also wondering if it's possible to do it within onCreateView Mar 10 16:18:40 I want to display a vector drawable but recolor it and add a black stroke around its shape. Is that doable in API 15, and how? Mar 10 16:26:26 Guys how can create the same 'background padding' that the default android buttons have inside them. When I create two regular buttons they are automatically not right next to each other for the naked eye because their backgrounds are smaller than their actual borders. My question is how could I recreate that in my own button? Mar 10 16:31:30 pfn: I don't know if you're around but since we were talking about services last night, I'll ask this question. I sometimes pass very sensitive information in extras to a service, like passwords and such. Do you know if it's bad practice? because it seems like it is frowned upon passing sensitive extras between activities, because the OS will save them and then the extra is out of your control. Mar 10 16:31:57 I got a question but i not sure if anyone have the same prob.Is anyone have prob installing android studio? Mar 10 16:33:03 i think it odd this is happoning. Mar 10 16:39:17 I'm trying to replace the fill color of a drawable dynamically but maintain its stroke color. Right now I draw it to a bitmap, and replace all the pixels if it's the known fill color. It works but seems a little slow. Is there a built-in way to do that? Mar 10 16:39:35 I tried tint but it replaces the stroke color too Mar 10 16:39:41 eghdk, you need to trust the system at some point, and to have access to your extras, basically need root Mar 10 16:43:24 pfn: Thanks, that's comforting. I had one more thing I thought about while lying in bed last night. If I have a DBOperationQueueList as a member of my App class, and it holds DBOperations. In an activity when I hit a button, I create a new DBOperation and add it to my list, and then start an intent service, the IntentService goes ahead and looks at my App class, and gets the DBOperationQueueList and just cycles through the list u Mar 10 16:43:44 Does that sound like a good solution? It prevents me from having to make DBOperation parcelable and stuff. Mar 10 16:44:03 eghdk, line length in irc is limited Mar 10 16:47:05 pfn: http://pastebin.com/B75xrdBM Mar 10 16:47:35 yeah, that works Mar 10 16:51:22 pfn: Hooray! I feel better about myself already. Anytime I make something the member of the App class I feel like I'll regret it later some day. hahah Mar 10 16:53:38 How can you convert dp to px Mar 10 16:53:50 displaymetrics.density Mar 10 16:53:58 I'm trying to resize images so I can get the exact size I need Mar 10 16:57:35 markyosullivan: Number 1 google search http://stackoverflow.com/questions/4605527/converting-pixels-to-dp Mar 10 16:58:19 I'm not even sure if what I'm doing is right Mar 10 16:59:01 Trying to insert images using glide and it's not the same size as my layout, thought it'd be easy to resize it but I don't know the size of the width but I know the height is 120dp Mar 10 17:00:09 theres also resources.getDimensionPixelSize(R.dimen.someDpValue) Mar 10 17:02:04 areitz When messager.printMessage is called, where is this message printed? Mar 10 17:02:53 hey, does google play check aps that i upload to beta testing ? Mar 10 17:03:12 Hi. i'm trying to achieve this layout http://imgur.com/3vNSipp Now that is quite simple. I want add more times to it to the right. I also want the user to scroll in a horizontal way finding the right time. The buttons works like radiobuttons, so only one must be selected. Do you have any suggestions? I've tried this, but it doesn't work like i want (maybe because of weight): http://pastebin.com/Gxe12BBM Mar 10 17:03:44 I've written the message this morning Mar 10 17:04:17 nevermind danijoo figured out which method within glide did what I wanted Mar 10 17:04:23 thanks though! Mar 10 17:05:58 LucaS05: , a HorizontalScrollView, with each column being a linear layout Mar 10 17:06:39 or if you need dynamic item adding you should implement a horizontal listview Mar 10 17:07:08 Does anyone know, does google play check apps that i upload to beta testing ? Mar 10 17:07:34 yes Mar 10 17:10:06 i've been kind of thinking about this multi-window thing ... Mar 10 17:10:26 * pfn installs N preview on n9 Mar 10 17:10:38 that preview registration link is awesome Mar 10 17:10:40 is it admission of defeat, instead of having large form factor apps, to have 2 phone-size apps side by side ? Mar 10 17:11:03 and for that form factor, where you would have 2, why just 2 ? Mar 10 17:11:11 Does anyone know, does google play check apps that i upload to beta testing ? Mar 10 17:11:15 you can have 2 on the phone Mar 10 17:11:19 why is it admission of defeat? Mar 10 17:11:28 because g00s loves to be pessimistic Mar 10 17:11:33 and see the negative Mar 10 17:11:45 Its just another possibility Mar 10 17:11:48 i like to explore all angles Mar 10 17:11:50 or just imagine the negative, rather Mar 10 17:11:58 you like to explore negative angles Mar 10 17:11:59 sometimes you need a big window, and sometimes you want to see 2 Mar 10 17:12:10 it’s an admission of defeat because they couldn’t get developers to properly support tablets? Mar 10 17:12:38 it's more a matter of design **** ENDING LOGGING AT Thu Mar 10 17:12:39 2016 **** BEGIN LOGGING AT Thu Mar 10 17:15:12 2016 Mar 10 17:15:21 its because ios isnt full of crap apps Mar 10 17:15:32 that got hacked together in 2 evenings Mar 10 17:15:41 and yes, there's that, on android as well Mar 10 17:15:46 and 2 evenings? Mar 10 17:15:57 I'm sure there are people who uploaded empty project templates that built into apk :P Mar 10 17:16:05 it builds? ship it! Mar 10 17:16:09 so is Android, so is Windows Phone, so is (was?) Blackberry Mar 10 17:16:12 vicious circle, ios isn't full of crap apps because orgs tent to place higher budgets/emphasis on iphone/ipad design Mar 10 17:16:30 s/tent/tend/ Mar 10 17:16:53 no, the full of crap apps refers to the lack of review process and low barrier to entry on the play store Mar 10 17:17:01 Would help if Android could have the update cycle that iOS has Mar 10 17:17:17 hey, how do you turn on multi-window mode in the N beta? Mar 10 17:17:48 i was reading just the other day, of devs surveyed, most found android most favorable platform - so if there is a quality gap between apps of android / ios i'd like to know the reason Mar 10 17:18:01 $$$$$ Mar 10 17:18:28 g00s, so counter to your typical thinking :P Mar 10 17:18:44 and maybe iOS devs are more likely to try and do some design, or work with a designer Mar 10 17:20:46 here that is https://adtmag.com/articles/2016/03/02/inmobi-mobile-dev-survey.aspx Mar 10 17:21:45 not sure if the survey was just bangalore though Mar 10 17:22:02 hello guys ! I would like to know what is the best option to upload an image with some information like id-date-uuid from android to java server ? Mar 10 17:22:43 is multipart the best option ? Mar 10 17:23:06 it says it’s a global survey, but it also says that almost half are from the Asia Pacific region Mar 10 17:23:43 they forgot to ask me Mar 10 17:24:06 because representative statistics aren’t a thing Mar 10 17:30:55 s73v3r: http://goo.gl/3u057r Mar 10 17:33:40 eclpse che http://www.eclipse.org/che/ Mar 10 17:33:51 hm .. seems I successfully converted the decoding functionality of image4j to android (without using BufferedImage, ColorIndexModel and the likes).. now I wonder if I should also convert the encoding functionality or not.. I do not really need it myself, but it wouldn't be too hard I think.. Mar 10 17:34:44 still forces workspaces on you. pass Mar 10 17:35:09 * g00s likes workspaces :( Mar 10 17:35:51 when i was using eclipse i had a bunch of projects in workspace like demos, iosched, to quickly nav / search Mar 10 17:35:56 yeah .. I wish Android Studio had them, too .. Mar 10 17:36:23 maybe the eclipse guys should have figured out a way to not require them, because they seem pretty polarizing Mar 10 17:36:33 but apparently IntelliJ does not support workspaces, but only projects and modules and while the IntelliJ project is roughly the same as eclipse workspace, it is not exactly the same Mar 10 17:37:18 even after reading a couple of articles, I am not entirely sure if I can export a module as library so others can use it.. Mar 10 17:37:38 if its a library module, yes Mar 10 17:38:01 i think people also got confused with projects going in workspace physically, or if workspace just 'linked' to it Mar 10 17:38:22 in eclipse you can have both, g00s Mar 10 17:38:29 yeah Mar 10 17:38:43 they can be included in your physical workspace, but you do not have to (And at work we don't do that) Mar 10 17:39:13 Hey everyone, I've just been monitoring the memory usage for my app and it continues to increase and never decreases when I go from one fragment to another using my navigation drawer? Mar 10 17:39:29 also danijoo - I /think/ it is a library module, because it does not have an application Id and it wouldn't let me set one Mar 10 17:39:30 lol markyosullivan are you creating new fragments each time you switch ? Mar 10 17:39:36 it’s weird in that, a workspace is not a directory, and workspaces kept getting checked into version control Mar 10 17:39:48 markyosullivan check out LeakCanary Mar 10 17:40:04 divStar, if its a library module, it will say so in the gradle file.. Mar 10 17:40:12 oh .. let me see Mar 10 17:40:36 "apply plugin: 'com.android.library'" is what it says in the first line of that module's gradle file Mar 10 17:40:47 its a library Mar 10 17:41:06 cool.. I'll go see how to export it to an AAR file Mar 10 17:44:07 oh hum .. I have a .aar file it seems.. so then people could just import and use it in their projects or do I have to do anything else? Mar 10 17:46:03 hm, pypy 5 Mar 10 17:46:28 "PyPy 5.0 ships with cffi-1.5.2 which now allows embedding PyPy (or CPython) in a C program." thats cool Mar 10 17:47:03 i wonder how easy that is compared to regular Python, or even Lua Mar 10 17:47:34 wonder if you can embed it in rust app too Mar 10 17:48:29 Hi all. Can someone please help me regarding the following issue : http://stackoverflow.com/questions/35893476/update-images-in-gridview-via-custom-adapter# Mar 10 17:48:39 any help would be much appreciated. Mar 10 17:48:45 casadogg in the console Mar 10 17:49:01 standard out I think, unless it's warning or error. Mar 10 17:49:28 Siddharth_10 calling notifyDatasetChanged? Mar 10 17:50:02 you either have to set a new adapter (probably not what you want) or call ^^ Mar 10 17:50:42 g00s: notifyDatasetChanged is called in updateList() which itself is not getting called. Mar 10 17:51:18 for AdapterView problems, please press 1 Mar 10 17:51:42 If you are having problems with updates, please press 1. all other callers stay on the line Mar 10 17:51:54 1 Mar 10 17:52:26 this call may be monitored for quality purposes Mar 10 17:53:03 *music plays* Mar 10 17:53:17 anyone ever worked with the scan codes you get in a KeyEvent? For virual keyboards I always get zero, and docs say the scan codes are included but not significant to Android. I'm hoping that's not quite true. Mar 10 17:53:49 I'd like to have a way, given a scan code, to map back to an android keycode, but so far it seems the docs are correct and there's no way to do it. Mar 10 17:54:03 clear Mar 10 17:54:09 Any lucky ideas on how? Mar 10 17:55:23 g00s: any ideas how to solve the problem? Mar 10 17:55:26 (hardware keyboards do sometimes give scancodes, it's just that I can't make any use of them to get back to any other information) Mar 10 17:56:56 hey, just wanted to ask if there is like a list or something of the methods/classes that can be used to make an internet connection ? Mar 10 17:57:54 i don’t know what you’re asking Mar 10 18:00:46 s73v3r, I believe there are several ways to connect your app to internet, right ? Mar 10 18:02:40 Can someone please help me regarding the following issue : http://stackoverflow.com/questions/35893476/update-images-in-gridview-via-custom-adapter Mar 10 18:04:14 Siddharth_10 thats some pretty crazy code Mar 10 18:04:24 i'd recommend looking at picasso or glide or something Mar 10 18:04:43 I am using picasso. Mar 10 18:18:27 If I want to create a landscape view of my layout what name should I give for the landscape xml in the 'layout-land' folder? I read that it should be named as the layout that exists in the original 'layout' folder but I cannot create another layout with that name.. Mar 10 18:19:03 It says a layout already exists with that name Mar 10 18:19:42 Then either you already have a layout called that in layout-land/, or you're not trying to create it in layout-land/ Mar 10 18:21:09 SimonVT, I created a dummy layout and you are right! But I do select the layout-land/... but I'm choosing New -> XML -> Layout XML File Mar 10 18:21:37 I am right clicking on the right folder but I'm guessing the New XML part is incorrect? Mar 10 18:22:03 I usually do New > Layout Resource File Mar 10 18:22:13 At the very top Mar 10 18:22:27 SimonVT, Thanks that worked out! Mar 10 18:23:03 anybody here worked with the experimental gradle plugin? Mar 10 18:28:28 Afzal: generic question or survay Mar 10 18:28:38 areitz can i pm u a link? Mar 10 18:29:18 thepoosh specific question. I don't know how to access things inside the model {}. Like how to access defaultPublishConfig in model { android { defaultPublishConfig "debug" } } Mar 10 18:29:28 project.model.android doesn't work, neither does project.android Mar 10 18:29:50 and unfortunately I'm using it because of ndk right now Mar 10 18:30:18 While running my app on my phone the background image that I've set does not show but when I run it in an emulator it shows -- what gives? Do I have to somehow compile the image ? Mar 10 18:30:20 isn't the plugin opensource? Mar 10 18:30:52 thepoosh probably, just wondering if anyone has already figured it out Mar 10 18:31:13 SO is your best friend Mar 10 18:32:50 Anyone use MVP? I'm looking into it now, but curious to see if it solves saving state in any way, or do I still have to use onSaveInstanceState() and such. Mar 10 18:33:00 meh Mar 10 18:33:19 eghdk: MVP as the paradigm? Mar 10 18:33:24 or a library Mar 10 18:34:52 eghdk lots of MVP examples have mechanisms to save states in different ways Mar 10 18:35:08 MVP as in the architecture type? THere's an MVP library? Mar 10 18:35:20 some use a Presenter cache to save the data in the presenter, and then the view gets recreated with that data on config changes Mar 10 18:35:45 anyone know what this "StringFactory" business is about? I just came across this in the string sources https://gist.github.com/hk0i/08dae76cf8d30e652d16 but when I search in the javadocs I get nothing Mar 10 18:36:55 also, when I use that method it doesn't seem to be throwing an UnsupportedOperationException so i'm confused :) Mar 10 18:41:27 grekkos, https://android.googlesource.com/platform/libcore/+/master/libart/src/main/java/java/lang/StringFactory.java Mar 10 18:41:47 interesting Mar 10 18:41:50 have you ever used it before? Mar 10 18:41:59 no Mar 10 18:42:00 g00s yeah I might be creating a new fragment each time I switch Mar 10 18:42:25 To stop from creating new fragments, do you just check if the fragment exists and if it does then switch to it? Mar 10 18:42:26 it looks like maybe it's not ready for prime time but I don't know for sure Mar 10 18:42:38 Or do you just close the fragment whenever you switch to another fragment Mar 10 18:42:41 should i dive straight in Dagger 2 or first read about Dagger 1? (I have some basic understanding of DI ) Mar 10 18:43:21 danijoo: had a chance to check out N preview? Mar 10 18:43:38 thepoosh, no. i only have my private phone here right now Mar 10 18:43:43 and i dont want to flash that Mar 10 18:43:53 you can get an emulator Mar 10 18:44:00 not the same but at least it's somethig Mar 10 18:44:00 yeah but no time yet.. Mar 10 18:44:11 well, it's only been a few hours Mar 10 18:44:32 I think i wait for others to investigate how often dooze kicks in now :p Mar 10 18:44:55 godam doze Mar 10 18:46:42 fortunatly i dont have any running background services I have to remove Mar 10 18:47:37 gottaGO: I've used Dagger1 in a super simple app, and going to Dagger2 was easy. I guess I would try to be familiar with both, but I guess I'd probably just jump right into Dagger2. IMO Mar 10 18:47:51 I'm surprised at amount of apps that work well with split screen >P Mar 10 18:48:21 eghdk, im going for Dagger 2 then Mar 10 18:50:43 Mavrik: Haven't been home the past two days, but I have a pixel c and I'm dying to try out split screen. Mar 10 18:51:12 Ironically, YouTube is the one that's broken :P Mar 10 18:51:37 Mavrik, which is usecase #1 i guess :D Mar 10 18:51:49 Yeah, they pause playback in onPause() Mar 10 18:52:05 Which is what you get when your app loses focus in split screen as well :P Mar 10 18:52:13 ah makes sense Mar 10 18:52:27 pretty excited to write an android native app Mar 10 18:52:35 is always drives me crazy if I watch a youtube vid and have to quickly anser some IM Mar 10 18:52:38 and it stops.. Mar 10 18:52:41 Yeah Mar 10 18:52:54 Instead of stopping in onStop() to avoid that, they do it in onPause() Mar 10 18:52:56 #monkeys. Mar 10 18:53:27 is it hard for a seasoned dev to write android apps if they haven't don e it alot before Mar 10 18:54:26 I mean, if the app is just a front end calling webservices Mar 10 18:54:31 should be easy as pie right Mar 10 18:54:36 there’s more to it than that Mar 10 18:54:58 of course :) Mar 10 18:57:07 android N preview has bricked my n9 Mar 10 18:57:19 if youre familiar with OOP it shouldnt be too hard for you Mar 10 18:57:51 Why do I get an error if I try to set my background using this: android:background="@drawable-nodpi/matte_black_background2" Mar 10 18:58:03 is the drawable-nodpi not used anymore?7 Mar 10 18:58:04 Psychiatrist, because you don't specify discriminator Mar 10 18:58:08 no, you don't -nodpi Mar 10 18:58:14 that's the whole point of discriminators Mar 10 18:58:42 its androids job to decide which discriminator to use Mar 10 18:59:10 ktwo: i'm very familiar with oop languages, c# comes to mind Mar 10 18:59:25 java i'm also familiar with, in a mid 90's kind of way :D Mar 10 18:59:32 it hasn't changed much Mar 10 19:00:07 but since I have been using c#/c++/other languages for 20ish years, and developed apps for ios, windows phone, and even android (through xamarin) Mar 10 19:00:07 we are still on 1.7 so welcome back :p Mar 10 19:00:10 should be a sinch right Mar 10 19:00:12 guideX main thing is just being OK with concurrency Mar 10 19:00:15 danijoo: oh cool heh Mar 10 19:00:23 So while putting the image just in the drawable folder Android is going to know if to scale the image up or down? Mar 10 19:00:36 Psychiatrist, said nothing about folder Mar 10 19:00:46 Psychiatrist, go back to reading the resources guide Mar 10 19:00:52 i'll open my mind to it Mar 10 19:01:42 luckily, I have written the entire app already via webservices and such, so all I need to do is call those services, and display a UI, (the easy stuff) :D Mar 10 19:01:43 pfn, So I just don't mention the nodpi.. got it. Mar 10 19:01:52 Thanks pfn and danijoo. Mar 10 19:03:05 starting with android studio Mar 10 19:03:10 g00s: What was your question? Mar 10 19:03:43 kroot lives Mar 10 19:04:32 kroot on this page http://developer.android.com/preview/behavior-changes.html , it says "Future releases of Android may deprecate additional implicit broadcasts, as well as unbound background services." Mar 10 19:04:48 can you elaborate, on deprecating unbound background services ? Mar 10 19:05:04 (what should we do, then?) Mar 10 19:05:42 use a bound service Mar 10 19:05:47 use a foreground service3 Mar 10 19:05:48 etc. Mar 10 19:05:52 seems pretty straightforward Mar 10 19:05:58 use the job scheduler Mar 10 19:06:05 g00s: I don't know much about it, but it's probably just to reign in battery usage. If you look at a typical device, too many things register for CONNECTIVITY_ACTION where their process spins up and does nothing. This usually isn't a problem if only one or two do it, but now it's getting to the point where nearly all apps are registering for it. Mar 10 19:06:46 kroot OK, so if you have an app like google My Tracks - which i'd image records GPS with a foreground service, will that scenario still be OK ? Mar 10 19:07:04 g00s: So once you start looking at CONNECTIVITY_ACTION, you start thinking, "this might get better with even more drastic changes." Then you tell people to prepare for the worst to see what kind of feedback you get from developers. Mar 10 19:07:11 so is android studio the only way to build android apps? is there a more recommended set of tools? Mar 10 19:07:14 (in windows) Mar 10 19:07:30 g00s: I don't think any service with a foreground notification will go away. Mar 10 19:07:40 kroot ahh, thanks - i feel better now ;) Mar 10 19:07:44 I can also use my fedora vm if I must Mar 10 19:07:54 g00s, it's not a background service Mar 10 19:08:00 g00s, that's why it's a foreground service Mar 10 19:08:30 guideX: why would there be a more recommended set of tools than those that Google suggests? Mar 10 19:08:48 kroot "unbound background service" seems to imply stuff like IntentService ... Mar 10 19:08:56 i use those a lot too :| Mar 10 19:09:02 There are currently a lot of apps that do a lot of naughty stuff to try to stay running without letting the user know they're running, so if you're trying to do sneaky stuff like that, don't expect it to work for very long. Mar 10 19:09:04 s73v3r: just checking Mar 10 19:09:14 maybe dependent on what os etc Mar 10 19:09:16 checking what? Could you not google? Mar 10 19:09:28 I'd just like to have at least a dangerous level permission to allow a service to run in background hidden though. Mar 10 19:09:37 There are use-cases where running stuff permanently does make sense :/ Mar 10 19:09:52 i don’t think there is any valid use case for running a hidden service Mar 10 19:09:55 or a per-app disable doze switch Mar 10 19:09:57 I did, just found android studio Mar 10 19:10:13 as thwe most recommended Mar 10 19:10:20 then why ask us Mar 10 19:10:20 just wanted to check with the experts :) Mar 10 19:10:23 is there a way i can bundle a binary into an apk intended to be run with adb? Mar 10 19:10:26 kroot sure, i do my best to behave and respect user settings etc. thanks again Mar 10 19:10:31 s73v3r, sure they are Mar 10 19:10:38 no. that question has been asked far, far, too many times, and it constantly has the same answer Mar 10 19:10:40 Listening to network socket for network discovery Mar 10 19:10:52 Things like that where you don't want to have your notification bar littered with crap Mar 10 19:10:57 No Mar 10 19:11:05 s73v3r: I guess part of the confusion is because windows, sometimes with windows, there's different dev tools than usual Mar 10 19:11:13 but good to know Mar 10 19:12:01 Hey everyone. Does anyone know of a way to detect whether or not a folder resides on "adopted storage"? Mar 10 19:12:11 or are we facing the same scenario where we dont know what "external" storage means Mar 10 19:12:52 s73v3r, that's to me? Mar 10 19:12:55 afaik adopted storage is basically raid-0'd into the system storage; it is no longer external Mar 10 19:13:05 thebishop: no Mar 10 19:13:07 k Mar 10 19:13:30 this sample code/tutorial, do you think it's a good/bad one? http://programmerguru.com/android-tutorial/android-restful-webservice-tutorial-how-to-call-restful-webservice-in-android-part-3/ Mar 10 19:13:40 I'm going to use it as an example for my project Mar 10 19:13:57 Pyuruku, afaik adopted storage is totally transparent Mar 10 19:13:58 dragorn: sure, but from my end, doing Context.getExternalFilesDir() might return a directory on adopted storage, right? Did google also introduce a way to say "This folder is on adoptable storage" ? Mar 10 19:14:12 guideX, id start with part-1 Mar 10 19:14:12 Pyuruku, getExternalFilesDir will not return adopted storage. Mar 10 19:14:19 indeed Mar 10 19:14:22 That isn't true Mar 10 19:14:24 Mavrik: Mar 10 19:14:43 part -1 is going to buy an android book, or watch some videos :D Mar 10 19:14:55 I see a trip to frys during my lunch break :D Mar 10 19:14:58 Pyuruku, the whole point of adopted storage is that it functions invisibly & is part of the standard storage dirs Mar 10 19:15:18 dragorn: which is also a huge problem for any applications that deal with media Mar 10 19:15:33 like mine, where you can suddenly lose all of the media files if you choose to eject / mount your sd card Mar 10 19:15:43 which to the end user looks like I deleted all of their stuff Mar 10 19:15:47 when in reality, I cant access it Mar 10 19:15:50 g00s ""unbound background service" seems to imply stuff like IntentService" Do you think that's true? I use a ton of intentServices. Mar 10 19:15:51 Pyuruku, adopted storage plugs and replaces your basic data dirs (getFilesDir(), getCacheDir(), etc.) Mar 10 19:16:04 guideX: Either get the Big Nerd Ranch book, 2nd edition, or do the Google course on Udacity Mar 10 19:16:08 Mavrik: it also replaces getExternalFilesDir Mar 10 19:16:11 you can no longer remove a card after adopting it w/out major data loss issues, correct Mar 10 19:16:19 I have a Moto G right in front of me that is exhibiting this behavior Mavrik Mar 10 19:16:21 Is there a MediaController alternative (i.e not docked in bottom of screen, better looking, has full screen button, etc..) ? Mar 10 19:16:21 guideX, if you you like videos, the udacity courses are nice imo Mar 10 19:16:31 Pyuruku, if that dir is on the same card yes. Mar 10 19:16:54 dragorn: yes, I understand that. Now I'm trying mitigate people blaming me for data loss Mar 10 19:16:56 Pyuruku, also, I hope you realise that those paths can change according to user moving stuff around :) Mar 10 19:17:05 which is why I'm trying to detect / identify people who have my app's media on adoptable storage Mar 10 19:17:56 the fact that google just introduces new storage options without giving developers any insight as to what storage is being used is pretty dumb Mar 10 19:18:21 Google introduces new storage options because developers are dumb :P Mar 10 19:18:33 this shouldnt be an issue if you use the correct methods to access those options Mar 10 19:18:33 And could never properly manage it Mar 10 19:18:49 But yeah, in some corner cases it gets wierd. Mar 10 19:18:54 hi Mar 10 19:18:59 danijoo: It isnt an issue until a user decides to remove the sd card or connect their phone to their pc Mar 10 19:19:09 Pyuruku, that won't work with adopted storage. Mar 10 19:19:11 why is that an issue>? Mar 10 19:19:12 It's not even supported. Mar 10 19:19:17 which I cannot do anything about, but I'm receiving the negative effects of it Mar 10 19:19:29 And the user will notice half of his device missing. Mar 10 19:19:33 anyone who have worked on xmpp here ? Mar 10 19:19:36 And the card not being readable. Mar 10 19:19:37 s73v3r: because, user does any of those actions, opens my app, suddenly all of the media is gone Mar 10 19:19:38 -> blame me Mar 10 19:19:46 stupid user is stupid. News at 11 Mar 10 19:20:01 cool, now, what can I do to educate the user is a better question Mar 10 19:20:05 instead of writing them off as stupid Mar 10 19:20:06 danijoo: I like books, but I have a very old book called "The Object of Java" has a 1999 somewhere on it and still talks about sun java Mar 10 19:20:07 Nothing. Mar 10 19:20:10 because they pay the bills Mar 10 19:20:19 Pyuruku, I mean I don't get your point Mar 10 19:20:19 it's not even about android, so need to pickup a book for sure Mar 10 19:20:29 Pyuruku, if someone removes the storage device then that data isn't there. Mar 10 19:20:36 What's there to "educate" people? Mar 10 19:20:43 Yes thanks for the very obvious logical way of looking at it Mavrik Mar 10 19:20:50 thats not how people think Mar 10 19:21:00 people dont even understand that the media from my app is stored on their sd card Mar 10 19:21:15 anyway, this is all irrelevant, my question is: Can you detect adoptable storage in any way? Mar 10 19:21:18 No. Mar 10 19:21:25 I've worked on android app before, "scion's build your scion" app, but that was in like 2012 and I wasn't the main dev Mar 10 19:21:26 Since it can be anywhere on any number of devices. Mar 10 19:21:26 cool, thanks Mar 10 19:21:35 And the mount points may differ. Mar 10 19:21:56 It would be nice if google provides ways of detecting storage types that can be removed, but whatever Mar 10 19:22:21 *sigh* Mar 10 19:22:27 But google hates removable storage Mar 10 19:22:42 they hate it so much as to allow you to adopt it as storage for your device Mar 10 19:23:02 It's annoying for sure. Mar 10 19:23:05 Pyuruku, users will get a huge warning that they have removed storage Mar 10 19:23:09 And they should put it back. Mar 10 19:23:22 Mavrik: even when connecting their phone to their computer? Mar 10 19:23:30 because I cannot access my data in that scenario either Mar 10 19:23:34 What? Mar 10 19:23:57 connecting via usb to browse files Mar 10 19:24:39 how do people not understand that it’s being stored on the SD card? Mar 10 19:24:49 Pyuruku, that sounds like there's something wrong, which protocol? Mar 10 19:24:55 MTP, PTP, ... _ Mar 10 19:25:19 s73v3r: to quote you, stupid user is stupid. News at 11 Mar 10 19:27:07 The app can't see external storage when the phone is connected to the PC? Mar 10 19:27:17 That's odd. Mar 10 19:27:56 you can’t mount it twice. Mar 10 19:27:58 Yeah, it is. MTP doesn't unmount stuff. Mar 10 19:28:05 s73v3r, it's not mounted, not since MTP Mar 10 19:28:15 there's a daemon that acts like an intermediary Mar 10 19:28:36 That was the main reason for removal of mass storage mode Mar 10 19:29:21 agg, tghe really boring part of android dev, setting up the environment lol Mar 10 19:29:31 at least I have irc and research while I wait :) Mar 10 19:39:52 is there a way to use the new vector drawable compat stuff, without having to add android:tint="?attr/colorControlNormal" to every drawable XML file ... because w/o that , Toolbar etc doesn't work Mar 10 19:40:23 and if i want to use the same drawable with different tints, then I would need N versions of the same one ... Mar 10 19:40:27 which is also lame Mar 10 19:41:03 (none of the xmls from google material icon pack have that specified, either) Mar 10 19:43:24 Is there somewhere that says what unix paths are available to an Android application? I'd like to be able to read /system/usr/key{chars,layout} Mar 10 19:43:38 It seems I can do that from an adb shell, even when I run-as my app. Mar 10 19:43:52 I can't access /data/system/devices/keychars/ though. Mar 10 19:44:05 Are those things going to be consistent across devices / OS releases? Mar 10 19:44:32 (on a non-rooted device) Mar 10 19:44:40 If it's not part of the public api (d.android.com), there's no guarantee Mar 10 19:45:01 duboisj, officially, none. Mar 10 19:45:18 If it's there, it's pure luck and may not be there on other devices Mar 10 19:45:29 if it weren't official, do you have a guess as to how often I could read those files? I have a handfull of devices to test with, but not a ton. Mar 10 19:45:55 duboisj, what are you trying to do? Mar 10 19:46:06 It's not totally out of the blue ... it's referenced (https://source.android.com/devices/input/key-character-map-files.html ), but I think that doc is more for device manufacturers. Mar 10 19:46:54 I want to be able to use a scancode (like the kind a physical keyboard can give in a KeyEvent) to get to a virtual keycode. Mar 10 19:47:05 Ah. Mar 10 19:47:10 Yeah, that's for vendors really. Mar 10 19:47:12 I don't think there's a public api for it, so I'm looking for an alternative that might work Mar 10 19:47:17 But on the other hand that means it's decently consistent Mar 10 19:47:22 Good afternoon guys Mar 10 19:49:11 g00s: you said ""unbound background service" seems to imply stuff like IntentService" Do you think that's true? I use a ton of intentServices. Mar 10 19:49:18 that document describes a pathlist consulted in order, files in /system/usr being consulted in priority to those in /data/system. Mar 10 19:49:25 eghdk i don't know, thats why i asked Mar 10 19:49:40 Any idea when / why keyboard information would end up in /data/system as opposed to /system? Mar 10 19:49:50 eghdk, there is nothing set in stone or planned yet Mar 10 19:49:56 the statement is simply put out there Mar 10 19:49:57 In general I expect application data to live there. Mar 10 19:50:06 eghdk, it likely won't happen for N Mar 10 19:50:35 most apps that use services shouldn't care if they get killed Mar 10 19:50:45 apps that need an absolutely persistent service should set it foreground Mar 10 19:51:15 people that have been sneaking by under the radar need to be beat up Mar 10 19:52:10 eghdk, and for that matter, while your app has foreground status, it doesn't matter if "background services" will be disabled Mar 10 19:52:11 By beating up people that have legitimate uses? Mar 10 19:52:13 you're already foreground Mar 10 19:53:25 again, I’m not entirely sure that a persistent, hidden service has legitimate uses Mar 10 19:53:38 I pretty much agree Mar 10 19:53:43 far too much potential for abuse Mar 10 19:53:50 already being abused Mar 10 19:53:50 :P Mar 10 19:54:26 Well if you can't think of it, then let's go ahead and turn Android into iOS 3 level toy :) Mar 10 19:54:27 i agree with mavrik, what should be the definition of "hidden" - if its easily discoverable but doesn't have something cluttering the status bar, thats seems OK Mar 10 19:54:45 foreground services don't have to clutter the status bar Mar 10 19:54:47 nub Mar 10 19:54:47 Mavrik: that’s not a good rebuttal Mar 10 19:55:02 also as battery tech improves, we're going to be left with an OS that goes through major hoops for nothing eventually Mar 10 19:55:02 foreground services /must/ post a notification Mar 10 19:55:09 yes. Mar 10 19:55:09 but notifications need not always be in the status bar Mar 10 19:55:13 hence clutter notifications. Mar 10 19:55:21 And then there you have shit that aren't notifications. Mar 10 19:55:26 g00s: when that battery tech comes, then it can be readdressed. But right now, we don’t have it Mar 10 19:55:30 N is starting to address that already Mar 10 19:55:34 by doing notification grouping Mar 10 19:55:44 by the time "hidden" background services are no longer available Mar 10 19:55:48 That still means that you have actionable notifications cluttered by running crap Mar 10 19:55:50 the notification stuff will have already been addressed Mar 10 19:56:09 I mean, by all means show things running in the background Mar 10 19:56:10 I find it a good thing. Maybe users will see how much crap is running in the background and push back Mar 10 19:56:21 there's truth to that Mar 10 19:56:31 y u do dis on my pone Mar 10 19:57:00 pfn, I mean, half of their issues would be solved if they'd just show actual wakelocks held in the battery screen Mar 10 19:57:05 not some random halfassed data Mar 10 19:57:19 And not by blocking functionality. Mar 10 19:57:45 With these changes you can't even do P2P discovery and messaging properly. Mar 10 19:58:04 sure you can. you just have to be prepared for it to die Mar 10 19:58:11 like you should have from the start Mar 10 19:58:18 Mavrik, the changes aren't implemented yet, they're only mentioned as "may" in the "future" Mar 10 19:58:25 pfn, and? Mar 10 19:58:31 so nothing's changed Mar 10 19:58:40 s73v3r, now thing about what you just said and consider how silly it is. Mar 10 19:58:47 it’s not silly Mar 10 19:58:50 pfn, and? Mar 10 19:59:08 why is it silly that you might have to prepare for a service to die Mar 10 20:00:24 s73v3r, the way powersaving and doze works (and iPhone for example) makes sure some service types cannot be developed at all Mar 10 20:00:38 that’s not true Mar 10 20:00:42 if you're happy with your dumb snapchat machine that's fine. Mar 10 20:00:44 you just can’t run your services willy nilly Mar 10 20:00:55 But acting like there are no other use cases for pocket computers is just idiotic Mar 10 20:00:57 i bet the worst offenders of all this are bloatware loaded on devices hahaha Mar 10 20:01:07 g00s, yep, the ones that will bypass that :P Mar 10 20:01:07 i’m sorry, but that is not what I’m acting like Mar 10 20:01:14 logcat is an offender Mar 10 20:01:20 it's incredibly verbose Mar 10 20:01:21 you are being far too melodramatic for something that hasn’t actually been implemented yet Mar 10 20:01:34 s73v3r, except that doze already seriously interferes with several services Mar 10 20:01:50 it interferes with improperly written services Mar 10 20:01:54 including P2P messaging systems, IoT control devices, non-Google push notifications, etc. Mar 10 20:02:04 i'm wondering if someone benchmarked battery impact on a device with and without most of logcat (maybe keeping Log.e is ok) Mar 10 20:02:21 adq, that's an interesting thought experiment :P Mar 10 20:02:29 adq, but I doubt it does much Mar 10 20:02:34 since you don't get logcat in deep sleep Mar 10 20:02:41 oh out of doze mode for sure Mar 10 20:03:19 s73v3r, oh, and you decided it's willy nilly? Mar 10 20:03:47 if you’re trying to hide the service, then yeah, it probably is Mar 10 20:04:10 if you’re not preparing for your service to be shut down, then it probably is Mar 10 20:04:46 Now you're just deliberately acting like a moron that can't understand that some services require constant runtime to be useful. Mar 10 20:04:51 You know. Mar 10 20:04:53 Like IRC. Mar 10 20:04:56 You're using right now. Mar 10 20:04:57 nope Mar 10 20:05:17 if you can’t handle your service being shut down, then you have not written your service properly Mar 10 20:05:30 if your service is shut down, that’s likely a signal from the user that they don’t want to be bothered Mar 10 20:05:34 ... Mar 10 20:05:45 I would be quite upset if my computer maintained the connection to IRC after I closed my client Mar 10 20:06:01 doubly so on a device with far less battery Mar 10 20:06:55 another argument for not needing Notifications for 1st class BG tasks, is when you want to split work into two physical services (like one doing GPS, another doing connectivity) - then you are stuck with 2 notifications in the status bar. So to get around that I put both things into one service, but its a mess really Mar 10 20:07:00 You really are so dumb you cannot understand that some usecases require persistent running process aren't you? Mar 10 20:07:10 they don't Mar 10 20:07:11 it really depends on the use case s73v3r, you would not want to relaunch/close n times (n is big) it would cost too much in resources at each initialization Mar 10 20:07:16 they all need to be able to shut down Mar 10 20:07:29 Are you still having the same convo about services from midnight last night? Mar 10 20:07:36 i tried "sharing" a notification between my 2 services but that didn't end well :( Mar 10 20:07:39 g00s, yeah, I mean just a list of icons in notification shade would be enough Mar 10 20:07:43 are you really so arrogant to think that your thing should always be running, despite what a user might wish? Mar 10 20:07:48 and perhaps a prompted permission to have the ability for app to disable doze Mar 10 20:07:53 That would be pretty much enough. Mar 10 20:08:13 But then again that comes from the people that killed SD card access first and then fixed APIs two versions later. Mar 10 20:08:14 don't trust (most of) users :D Mar 10 20:08:22 they will install "app killer" Mar 10 20:08:30 adq, users that can't be trusted can go fuckoff to Apple :/ Mar 10 20:08:40 I'd rather have at least one usable OS on the market. Mar 10 20:08:44 and that statement right there is why no one takes you seriously Mar 10 20:08:53 Don't see the reason of having another iOS with crappy updates, less performance and Java. Mar 10 20:08:54 yeah maybe android has this, but WP has a top level settings window you select if each app can do stuff in the bg Mar 10 20:08:59 well, i had hard time to explain to my dad that app killer is really useless, and might even be counter productive Mar 10 20:09:04 due to the OS design lol Mar 10 20:09:28 unfortunately they came into fashion due to people abusing background hidden services Mar 10 20:09:48 casadogg sure you can pm me Mar 10 20:10:48 g00s, false Mar 10 20:10:55 g00s, once you have one foreground service, your entire app has foreground status Mar 10 20:11:00 g00s, don't make up stuff Mar 10 20:11:39 pfn, app or process? Mar 10 20:11:54 Afaik it's bound to process. Mar 10 20:12:29 pfn huh? make what up? i'm talking about 2 independent services your app may have. if one must rely on the other to be running so there is 'foreground status' they are not independent Mar 10 20:12:29 yeah, but are you really going to have multiple service processes? Mar 10 20:12:30 but yeah Mar 10 20:12:33 pfn: Do you mind if I pm you? Got a perfect example of me wants to use a new thread in my activity but not create a service. I'll ask the question here anyway. I am working on my SearchActivity. After I hit enter, querying the DB can take some time depending on the number of entries. Now... I don't want to create a service for this, but I need this to keep searching across rotations. What would you do in this scenario? Mar 10 20:12:39 I don't do pm for free Mar 10 20:13:09 charge by the hour pfn =)? Mar 10 20:13:21 g00s, and you fall into the "design around android components" trap Mar 10 20:13:30 a service is a lifecycle container, nothing more Mar 10 20:13:31 Is there a way I could make my button text resize automatically if I switch to landscape? Mar 10 20:14:02 Psychiatrist: All button text? Mar 10 20:14:07 Or a specific button? Mar 10 20:14:15 Psychiatrist, match_parent or provide a custom layout for landscape Mar 10 20:14:21 konk3r, Every button text, yeah. I don't have any other buttons Mar 10 20:14:33 g00s, do not conceptually think you /must/ have 1 service instance for every job you must do Mar 10 20:14:37 You can create -landscape resource folder Mar 10 20:14:41 adq, I am providing a custom layout for landscape currently but my landscape buttons do use my portrait buttons' style Mar 10 20:14:43 Psychiatrist, check material design spec Mar 10 20:14:54 Then set your button text to @dimen/button_text_size Mar 10 20:15:04 not sure you should (but you could) have different size for landscape/portrait Mar 10 20:15:05 And in your -landscape folder change the value Mar 10 20:16:53 heh ... the audio jack has a keyboard layout on this device. (pressing the button on some headsets can send a wake, I guess). funny. Mar 10 20:17:00 So opening up my question to everyone. I am working on my SearchActivity. After I hit enter, querying the DB can take some time depending on the number of entries. Now... I don't want to create a service for this, but I need this to keep searching across rotations. What would you guys do in this scenario? Mar 10 20:17:37 duboisj, I guess that's rather standard functionality :) Mar 10 20:17:42 Most mobile headphones have at least one button Mar 10 20:17:43 konk3r, Did you mean a completely separate res for landscape? I'm currently using only layout-land. Mar 10 20:17:48 eghdk: Once again, there's a lot of ways to tackle that Mar 10 20:18:08 eghdk, you can retain the search thread by keeping it in a headless fragment for example Mar 10 20:18:17 I prefer to have a separate data access layer that activities submit requests through that can maintain state Mar 10 20:18:20 But that's a LOT to build up Mar 10 20:18:24 yeah, it's just funny to have a keyboard layout called Intel_MID_Audio_Jack.kl . it makes sense, given how things are done. Mar 10 20:18:26 or loaders Mar 10 20:18:33 Hmm. Mar 10 20:18:44 Still wondering when google got the idea to replace onRetainNonConfigurationInstance with Fragments. Mar 10 20:18:52 So let me see if I have the list of ways right. 1. Headless fragment 2. Singleton thread 3. Loaders 4. RxJava (haven't used it but from what I heard, makes sense here?) Mar 10 20:18:53 It's... like utterly illogical API for the job :/ Mar 10 20:18:53 Pyschiatrist: I *believe* you can make a values-land folder Mar 10 20:19:05 Psychiatrist* Mar 10 20:19:05 konk3r, yes he can Mar 10 20:19:31 But I agree with the statement above, I'd double check your use case to make sure you actually want to Mar 10 20:20:18 konk3r, Just to make it clear -- I will create a new values-land folder and then a new styles.xml where I specify the same styles that I already have just now with specific size for my landscape view? Mar 10 20:21:10 I wouldn't do that in the styles folder Mar 10 20:21:16 I'd do it in the values folder Mar 10 20:21:33 Psychiatrist, or you just define a dimens.xml with a new size dimension and consume that from your style Mar 10 20:21:35 have a dimens.xml file where you would put your text sizes Mar 10 20:21:39 konk3r, I meant inside the values folder I do have to create a file called styles.xml -- right? Mar 10 20:21:39 :+1: Mar 10 20:22:16 Oh, alright! Thank you all, especially konk3r ! Mar 10 20:22:17 You would keep using a single styles.xml file for your entire app, but inside that styles.xml file set your button text size to "@dimen/button_text_size" Mar 10 20:22:25 Then have 2 different dimens.xml files Mar 10 20:22:35 Yup, I get it now Mar 10 20:22:36 Thanks again Mar 10 20:24:42 eghdk: Yes, except not loaders. Never loaders Mar 10 20:26:03 konk3r: cool. Okay. So it's not too scary then. I think I should be able to make this work. Mar 10 20:27:13 I have a boolean[][] that I would like to print to the screen. What widgets should I use? It seems that using TableLayout with TableRows is very cumbersome because I can't index the rows or the widgets in the rows with normal / intuitive coordinates (e.g., (1, 4) ) Instead I have to look them up by R.id.BLAH and so my nice for(i = 0...){ for(j = 0...){ } } needs to have a million if statements to choose the appropriate BLAH. An Mar 10 20:27:13 y suggestions? Mar 10 20:27:28 The next time I tackle that problem I'm planning on using my own custom loading framework that returns an Rx observable when a request is made, but checks the current request pool Singleton to see if a request is already active before creating a new one Mar 10 20:27:44 Mavrik: Just sayin. I agree with you on the services thing "~ think of the usecases require persistent running process". How do people think push notifications work. You need a persitant connection, google just happens to funnel everything through that one, which is fine. But I agree, I have a tiny computer in my pocket, if I agree (via permission or what have you) I should be able to allow background stuff without being bothered Mar 10 20:28:50 you aren't bothered Mar 10 20:29:54 pfn, so how can I wake up the phone from doze to sync up with my IoT device while at home? Mar 10 20:30:18 why does it need to if the phone isn’t moving? Mar 10 20:30:52 s73v3r, because puppies will die Mar 10 20:30:56 if it doesn't. Mar 10 20:30:57 Mavrik thats my exact use case :/ Mar 10 20:31:18 no, they won’t. you’re not being serious Mar 10 20:31:23 i have schedule where app connects to logger and then xfers that data to server Mar 10 20:31:45 g00s: why can’t the logger xfer data to server? Mar 10 20:31:53 nope Mar 10 20:32:01 thats why my app exists :) Mar 10 20:32:14 again, why can’t the logger xfer the data? Mar 10 20:32:16 Mavrik, there's a job scheduler now Mar 10 20:32:17 (i didn't make the logger btw) Mar 10 20:33:09 i have to read this again, but thought using JobScheduler - doesn't mean you get network connectivity. is that incorrect ? Mar 10 20:33:59 ahaha more cheezy "stuff" g00s: https://medium.com/google-developers/detecting-camera-features-with-camera2-61675bb7d1bf#.18hbgyi0b Mar 10 20:34:28 So... is it common to provide an Activity context with Dagger, or do people prefer to only create a single object graph at the application scope? Mar 10 20:34:55 Or has everybody moved onto Dagger 2 at this point? Mar 10 20:35:45 adq "Banning Selfies with Camera2" lol Mar 10 20:36:08 pfn, Job scheduler does not wake device from doze Mar 10 20:36:24 Mavrik, is that so, well, there's bound to be something Mar 10 20:36:28 pfn, how do I implement Nintendo-like BLE data exchange functionality in M/N ? Mar 10 20:36:29 My use case is this: I'd like to inject a ThemeAccessor object which allows classes to easily pull theme attributes, but to do so it appears I need to use the actual Activity as the base Context for getTheme Mar 10 20:36:44 pfn, so it works on underground and locations without reliable GPS and 4G? Mar 10 20:36:49 I have all the sensors. Mar 10 20:36:58 I dunno, you figure that out :P Mar 10 20:37:06 But morons like s73v3r tell me I shouldn't be able to implement that functionality. Mar 10 20:37:11 Even though I have all the radios and hardware. Mar 10 20:37:22 :) Mar 10 20:37:28 Again, not bothered by shielding users from abuse. Mar 10 20:37:40 no, we’re telling you to pay attention to user signals Mar 10 20:37:45 But just nuking functionality from a computer is moronic when better ways exist. Mar 10 20:37:52 the user’s battery is not your plaything Mar 10 20:38:00 they’re not nuking functionality Mar 10 20:38:08 s73v3r, indeed, it's users. Mar 10 20:38:21 And you're defending taking away users option to do something useful for their device and decide to spend the battery. Mar 10 20:38:23 * pfn shrugs Mar 10 20:38:27 we'll see what happens when it happens Mar 10 20:38:28 no, we’re not Mar 10 20:38:37 Mavrik: would this be opt in behavior or automatic behavior? Mar 10 20:38:39 you’re trying to say you know better than the user Mar 10 20:38:45 too much complaining over nothing at the moment Mar 10 20:38:48 konk3r, I'm always for opt-in when it comes to battery Mar 10 20:38:57 pfn, both of those cases are already implemented and prevented. Mar 10 20:39:01 can you change the target android platform later? Mar 10 20:39:05 pfn, in 6.0 and N Mar 10 20:39:10 guideX, yes. Mar 10 20:39:14 ok cool Mar 10 20:39:21 so no issues if I choose kitkat to start? Mar 10 20:39:26 Nop Mar 10 20:39:33 only because, I have kitkat test devices lol Mar 10 20:39:55 Nevermind, I put all my tableRows and TextViews (the cells) into a tablelayout and then used .getChild(X) to index them. Mar 10 20:40:22 deadmund: you might want to write a custom view which can abstract that away, so you can access by index Mar 10 20:40:25 deadmund, you could also create the childs at runtime and put then in a View[][] array Mar 10 20:41:03 danijoo, Seems like creating the views at runtime is a big waste of resources. This table of data is updated every second. Mar 10 20:41:07 ugh, fastboot driver in sdk isn't signed Mar 10 20:41:09 s73v3r, I'll think about that. Thank you! Mar 10 20:41:26 deadmund: it wouldn’t be a waste of resources unless you recreate them every time Mar 10 20:41:31 lol :) Mar 10 20:41:34 deadmund, you only create them once. and it doesnt need more resources than doing it from xml Mar 10 20:41:36 wtf doesn't google sign the driver... Mar 10 20:42:15 on win, they don't even sign the binary tools :x Mar 10 20:42:25 I see, if I create the views in onCreate() then just updated them. Well I have a solution that's working just as good with .getChild() Mar 10 20:42:31 goddamnit google Mar 10 20:42:38 Also NDK 11 doesn't work with gradle plugin :P Mar 10 20:44:00 hm? Mar 10 20:44:43 They changed toolchain directories so Gradle plugin doesn't find clang toolchain anymore. Mar 10 20:44:52 (Current one, not experimental) Mar 10 20:44:58 if i use classpath 'com.android.tools.build:gradle:2.0.+' , how can i determine what 2.0.+ is resolving to ? Mar 10 20:45:11 gradle dependencies doesn't show that stuff Mar 10 20:45:22 g00s, thats why you dont use + :P Mar 10 20:45:27 oh ffs Mar 10 20:45:28 g00s, https://jcenter.bintray.com/com/android/tools/build/gradle/ Mar 10 20:45:30 on of them :p Mar 10 20:45:33 one* Mar 10 20:45:36 Mavrik: Can the application tell the user at install time to add the app to the whitelist? Isn't there a place for that. I feel like I heard of it when doze was released, and thats where Google Play Services live. Mar 10 20:45:40 g00s: you can actually print out what they were resolved to Mar 10 20:45:59 eghdk, theres no doze whitelist Mar 10 20:46:07 herriojr do you know how? gralde --dependencies only shows the regular app ones Mar 10 20:46:17 fucking AS just says "2.0.+" lol Mar 10 20:46:29 g00s, maybe if you run gradle from commandline with verbose output Mar 10 20:46:42 * g00s sighs Mar 10 20:46:55 g00s: which deps are you trying to list? Mar 10 20:47:36 'com.android.tools.build:gradle:2.0.+' Mar 10 20:48:07 or check whats in the cache dir Mar 10 20:48:10 basically i want a report like gradle --dependencies which also shows me the compile time deps Mar 10 20:48:18 cool, I can see my hello world app in the emulator Mar 10 20:48:31 in the studio Mar 10 20:48:38 guideX, #shipit Mar 10 20:48:49 danijoo: Damn really? How do I get Android Device Manager to work when my phone is in DOZE! OH NO Mar 10 20:49:21 danijoo: I feel like I'm two and a half restful calls calls away from that Mar 10 20:49:23 lol Mar 10 20:50:03 eghdk you can use AlarmManager setAndAllowWhileIdle() etc but i don't think you get network access Mar 10 20:50:26 and the maintenance window for doze is out of your control, it starts semi frequently then backs off Mar 10 20:50:48 you get network access then, but you have no control over when that happens Mar 10 20:50:59 thank god I have a mac Mar 10 20:51:02 can flash using that instead Mar 10 20:51:06 im really curious about when doze will kick in with N Mar 10 20:51:10 g00s is gradle --dependencies the same as gradle app:dependencies? Mar 10 20:51:13 I'm guessing so Mar 10 20:51:22 *waiting for someone to investigate this* Mar 10 20:51:39 danijoo sounded pretty agressive Mar 10 20:51:46 * guideX is dialing inspector gadget Mar 10 20:52:03 g00s: I found this for you: https://gist.github.com/xconnecting/4037220 will that help? Mar 10 20:52:05 yeah but i dont want to make assumptions before knowing that Mar 10 20:52:19 it could be anything from immediatly to 1 hour right now Mar 10 20:52:27 damn. I literally had this issue where I lost my phone on new years day after drinking. Tried to ping the device via Android Device Manager... Nothing. Found my phone 5 hours later. I pick it up, and it starts ringing from Android Device Manager. hahaha Mar 10 20:52:39 herriojr cool i'll check it out, thanks Mar 10 20:53:19 http://stackoverflow.com/questions/27779342/is-there-gradle-dependencies-task-for-buildscript-dependencies Mar 10 20:54:05 herriojr great! gradle buildEnvironment Mar 10 20:54:08 thx Mar 10 20:54:32 lol that didn't work Mar 10 20:55:10 g00s: it looks like it depends on the version of gradle you're running if that will work or not Mar 10 20:55:23 yeah i'm on 2.11 Mar 10 20:55:39 ah kk, yeah, I don't know what's up then Mar 10 20:57:41 herriojr hm, not pulling up much docs for "gradle buildEnvironment" Mar 10 20:58:41 g00s: I got it to work for me Mar 10 20:58:53 huh Mar 10 20:59:06 what did it fail on when you tried? Mar 10 20:59:16 waiting for pfn to tell me i need a new computer :) Mar 10 20:59:25 herriojr didn't say anything at all Mar 10 20:59:56 so I'd get complaints that 2.2 was required when I had 2.11 specified in my wrapper, so I had to add an override to allow 2.11 Mar 10 20:59:56 You need a new computer. Mar 10 20:59:57 I needed a new computer before, but it turns out all I needed was more ram, to swap out the hdd, and a format of windows Mar 10 21:00:08 eww windows Mar 10 21:00:11 now my computer is not slow no more Mar 10 21:00:16 herriojr OK i get it. you have to be in the project root Mar 10 21:00:20 i was in a submodule Mar 10 21:00:24 ah kk Mar 10 21:00:39 yeah thats great, thanks Mar 10 21:01:04 i'm trying to use plugin 2.0.0 with AS 1.5 - not sure if this is kosher Mar 10 21:01:05 you do Mar 10 21:01:08 herriojr: yes eww windows Mar 10 21:01:11 yuck Mar 10 21:01:18 gonna use it anyways :D Mar 10 21:01:23 heh Mar 10 21:01:35 I really don't care, whatever allows you to be productive :P Mar 10 21:01:43 that's the ticket Mar 10 21:02:07 oh i guess there is gradle plugin 2.1.0-alpha1 Mar 10 21:02:15 christ there are too many preview things ! Mar 10 21:02:18 windows! because if I did it in linux, i'd just be googleing all day Mar 10 21:02:41 to like connect to wifi, and simple things like that Mar 10 21:03:24 I have a list item that expands, but when it expands, and it's the bottom most list item, you can't tell that it expanded unless you scroll down. anyway to fix that? Mar 10 21:04:14 eghdk: define expands Mar 10 21:05:05 you might need to scroll down by the amount of pixels taken by your expanded view, or scroll to next item Mar 10 21:05:51 I have a button in the list item that shows up when a message send fails... and so the list item expands to show more options, like retry and delete. They show up, theyre just off the screen for the last list item, so you can't even tell that clicking the original button did anything. Mar 10 21:05:53 they abandoning chome os, they introducing multiwindows ... Mar 10 21:05:57 *chrome Mar 10 21:06:43 hi. I've this error http://pastebin.com/Q4gaKwZx but I don't know how to solve it, do you have any advices? Mar 10 21:07:55 welp, so far idk wtf I'm doing, maybe I should go buy the android book now Mar 10 21:08:12 eghdk: is this what you wnat? https://developer.android.com/reference/android/support/v7/widget/LinearLayoutManager.html#scrollToPositionWithOffset(int,%20int) Mar 10 21:08:25 I can create new projects from the templates, and code some java, and see my result in the emulator Mar 10 21:08:27 damn, plugin 2.0.0 is slower for me than 1.5 Mar 10 21:08:32 so i'm to noob 0.1 status Mar 10 21:08:38 I look at the sqlite tables in my app through Chrome Dev Tools and see that they have two _id columns each. How could it happen? Mar 10 21:09:05 be prepare guideX, road is long and painful Mar 10 21:09:12 AlexBerdnikov can't have 2 columns with same name :| Mar 10 21:09:17 herriojr: idk. I want to scroll to bottom if I'm the last item in the list. Just need to figure out if I'm the last item in the list in an adapter. Not sure if that's possible. Thought that was a listview attribute. Mar 10 21:09:22 I definitely not created them that way nor I don't understand how table might have two columns with same name Mar 10 21:09:23 maybe bug in dev tools, pull the db and check with sqlite command Mar 10 21:09:48 btw stetho is great, but flaky as all F$# Mar 10 21:09:56 adq: hopefuilly shorter for people who have been programming longer Mar 10 21:10:07 for instance, I already have 20 years doing other things Mar 10 21:10:17 well, you will see :p Mar 10 21:10:32 mostly .net/c# Mar 10 21:10:41 including windows phone, so should be some parellels there Mar 10 21:11:14 eghdk: honestly, if someone clicks on it, I think it would make sense to smooth scroll it to the top and expand it Mar 10 21:11:40 just need to figure out how to smooth scroll a listview inside of an adapter. Mar 10 21:11:41 LucaS05: resource not found, that's it Mar 10 21:11:53 eghdk: oh, you're using a listview not a recyclerview? Mar 10 21:12:12 g00s: I think it's a bug in Dev tools. BEcause Android It wouldn't create a table with coulmn name duplication Mar 10 21:12:12 yeah, welcome )) Mar 10 21:12:48 herriojr: In this case yes Mar 10 21:13:10 guideX: is there any life in windows mobile world? Mar 10 21:13:11 g00s: http://i.imgur.com/XUOP7s9.jpg Mar 10 21:13:16 eghdk: did you try ListView.smoothScrollByOffset() ? It may make the whole thing visible (I don't know tho) Mar 10 21:13:40 herriojr: Yeah, my issue is getting the listview inside of the adapter Mar 10 21:14:21 well, you could pass it in as an argument to the constructor Mar 10 21:15:03 isnt the ViewGroup passed to getView() the listview? Mar 10 21:15:28 How can I make my textview when it has seen more input that it can show to add the extended input to the left instead of right? If I add more text the disappearing text goes to the left not to the right. Mar 10 21:15:30 possibly, I haven't used a listview in forever Mar 10 21:16:04 I just use RecyclerViews by default at this stage Mar 10 21:16:11 Psychiatrist, android:ellipsize=¨left¨ Mar 10 21:16:37 AlexBerdnikov weird, well pull it manually or try sqlutestudio Mar 10 21:16:44 *SQLiteStudio Mar 10 21:17:07 danijoo, Thanks! Mar 10 21:18:31 g00s: Thank you for advice, but I'm not sure how to pull the DB manually? You mean run DESCRIBE TABLE sql commands in the app and save the output? Mar 10 21:18:39 danijoo: will try that. Thanks! Forgot that ListView is just a viewgroup. heh Mar 10 21:18:50 really didn't want to have to pass in a listview to my adapter. Mar 10 21:19:01 AlexBerdnikov adb exec-out run-as package.name cat databases/file > file Mar 10 21:19:15 g00s: Oh, ADB... :) Mar 10 21:19:18 LOL Mar 10 21:19:29 i'd kill the app before you do that Mar 10 21:19:49 g00s: it might malform the data? Mar 10 21:20:12 i think once or twice i got unexpected results, not malformed though Mar 10 21:21:29 sorry guys. connection problems. anyone can help me with this: http://pastebin.com/Q4gaKwZx ? Mar 10 21:21:32 so I have created question on stack - there is a link to project that cannot be compiled, until now - for unknonw reasonstack so if anyone give it a try I would be happy http://stackoverflow.com/questions/35920209/android-preferences-numberpicker-and-preferencescreen-compile-errors-no-res Mar 10 21:24:21 i've synced the project with gradle, now it works fine Mar 10 21:24:24 very strange Mar 10 21:41:06 bunch of issues with RS potentially fixed: https://code.google.com/p/android/issues/detail?id=183144 https://code.google.com/p/android/issues/detail?id=188096 https://code.google.com/p/android/issues/detail?id=179580 Mar 10 21:41:41 adq probably best way to dev is just have no code at all, just static resources :D Mar 10 21:41:50 lol Mar 10 21:46:03 google has to do something about the 'support lib repository' in the SDK Manager Mar 10 21:46:23 this is ridiculous, downloading a new maven repo each time they add an artifact Mar 10 21:46:34 at this point, its getting pretty big Mar 10 21:48:35 and support lib 23.2.1 is out Mar 10 21:49:18 pretty fast Mar 10 21:51:32 java.lang.IllegalMonitorStateException: did not lock monitor on object of type 'com.hanhuy.android.irc.model.Channel' before unlocking Mar 10 21:51:33 that's new Mar 10 21:51:42 is there any easy way to inject methods into an apk? could've sworn someone here talked about it before. Mar 10 21:51:59 eghdk add classes, sure Mar 10 21:52:08 i mean , using class loader Mar 10 21:53:02 class loader? pardon my stupidity... thats not the name of a tool or something right? Mar 10 21:53:21 eghdk http://gilvegliach.it/?id=12 Mar 10 21:54:11 eghdk not sure what you want to do, but caution - updating app outside play violates ToS Mar 10 21:54:22 but its fun experiment Mar 10 21:54:43 g00s: I'm more trying to mess with my apk and see what a malicious user could do. (forge messages, etc;) Mar 10 21:55:36 could do everything Mar 10 21:55:55 https://android.googlesource.com/platform/art/+/master/runtime/stack.cc#1057 Mar 10 21:55:56 hmmm Mar 10 21:56:34 yeah, but is there a tool I could use to do that you know? Like... I have a rooted device, and an apk installed on my phone, is there a tool I can use to just start writing new methods into my apk Mar 10 21:56:47 hi. I've radiobuttons organized in two rows. All the radio buttons are in a radiogroup. The problem is that i can select each one of them not only one as i want. Here the layout: http://pastebin.com/P55nqKB1 Mar 10 21:57:10 there are many tools eghdk but this is the wrong channel, you could start by playing with apktool Mar 10 21:57:49 thanks. that gives me a start. let me know if theres a better channel. Thanks adq Mar 10 22:07:09 Hey, with updating the app outside of Play violating the ToS, what about things like React Native, or other web stuff that lets you update the app outside the store? Mar 10 22:10:30 brendan eich "Microsoft, meanwhile has been "kind of acting like Mozilla," with its venture into open source, Eich reasoned. "They open-sourced Chakra Core, their JavaScript engine, on GitHub." Google's Android, meanwhile, has become Windows, but Apple remains Apple, in Eich's estimation." Mar 10 22:13:26 somewhat accurate, i guess Mar 10 22:17:24 does anyone here use otto or butterknife? Mar 10 22:17:33 they're totally unrelated, I'm just curious Mar 10 22:17:38 I use both Mar 10 22:17:42 otto is deprecated though Mar 10 22:17:48 Wait, really? Mar 10 22:17:48 what do you use otto for Mar 10 22:18:23 I use event buses for sending events between units that don't have direct connects, or it would create a circular dependency Mar 10 22:18:29 otto isn’t deprecated deprecated. It’s just finished, and isn’t likely to receive any updates Mar 10 22:19:03 https://github.com/square/otto#deprecated Mar 10 22:19:06 it’ll still work just fine Mar 10 22:19:10 sure it works fine Mar 10 22:19:26 but now that greenrobot's eventbus has annotations, I'll use that Mar 10 22:19:40 grekkos: I have a custom SearchView that sends out an event every time it's opened or closed, and the event for it opening contains an observable for the text change in the search box Mar 10 22:20:42 i see Mar 10 22:21:09 I also like using event buses for sending information between my presenters and activity. For instance: in my current project the top level view uses otto so send "item selected" events to the activity, and the activity replaces the main content based on it. Mar 10 22:21:14 I was just asking a friend if he used butter knife and he threw like 3-4 libraries that "every android app uses" but I don't know too many people who use them so I was curious Mar 10 22:21:46 I used to use Otto for everything and it got ugly fast Mar 10 22:21:49 konk3r: yeah I could see it being useful for that, you can't really have direct object relationships in android normally Mar 10 22:21:55 Exactly Mar 10 22:22:17 well actually Mar 10 22:22:22 I guess you can just not another activity Mar 10 22:22:26 yeah, any event bus is extremely easy to overuse Mar 10 22:22:52 I used to use event buses for everything I currently use Rx for Mar 10 22:23:15 It's important to realize the right library for the job. Event buses are really handy but they have some big drawbacks too. Mar 10 22:23:26 if you still want event bus, green robot is maintained Mar 10 22:23:33 seems pretty active Mar 10 22:23:36 I think my friend told me he uses eventbus to avoid Parcelable Mar 10 22:23:45 ? Mar 10 22:23:48 lol Mar 10 22:23:58 I think that's how I found out about it originally Mar 10 22:24:04 That sounds like an odd usage of it Mar 10 22:24:05 it just seemed too shady to me Mar 10 22:24:13 so he could pass objects between activities Mar 10 22:24:16 using the event bus Mar 10 22:24:24 lol no, bad idea Mar 10 22:24:30 ^^ what g00s said Mar 10 22:24:30 yeah Mar 10 22:24:31 i can see it, but given the plugins and libraries that do parcelable for you, why? Mar 10 22:24:34 I couldn't really find a use for it Mar 10 22:24:43 so I haven't used it Mar 10 22:25:10 I was debating using it for IPC at some point because one of the apps I work on has a separate process and needs to share some kind of cache which is really ugly Mar 10 22:25:16 but I used an intent instead Mar 10 22:25:17 grekkos: It's basically useful if you want to send a notification for an event happening, like the name implies, that other parts of the code can optionally pick up on Mar 10 22:25:46 I have other observers in my apps already that don't require it Mar 10 22:26:10 IPC? Mar 10 22:26:11 but I guess I could see it Mar 10 22:26:15 interprocess communication Mar 10 22:26:18 Oh, okaky Mar 10 22:26:19 okay* Mar 10 22:26:44 Wow, what are you doing across processes? I've never needed to get into anything past threading Mar 10 22:26:52 yeah it's ugly Mar 10 22:26:57 it's vendor code Mar 10 22:27:01 Hahaha alright Mar 10 22:27:14 for connecting the phone to other devices Mar 10 22:27:20 For sharing a cache I'd probably try to inject it first Mar 10 22:27:42 problem with the cache thing was keeping them both in sync Mar 10 22:28:02 Yeah, that sounds like a huge pain Mar 10 22:28:20 yeah Mar 10 22:28:28 the process had to add something to the cache Mar 10 22:28:32 and the main process had to pick it up Mar 10 22:28:43 So has anyone here used Dagger 2? Mar 10 22:28:56 I just switched it around to send an intent to the main process to have it handle the cache stuff Mar 10 22:29:09 I haven't used butterknife or any of those things Mar 10 22:29:13 or is dagger unrelated Mar 10 22:29:25 Butterknife is semi related to dagger Mar 10 22:30:37 not really, annotations were changed from @Inject to @Bind to quit promoting the idea that Butterknife is performing any injection Mar 10 22:31:01 butterknife does look kind of nice though Mar 10 22:31:08 it is very nice Mar 10 22:31:13 hahaha Mar 10 22:31:34 looking at it now it seems like butter knife is also using @Bind **** BEGIN LOGGING AT Thu Mar 10 22:36:14 2016 Mar 10 22:36:29 clean? Mar 10 22:36:53 instant run for the fail? Mar 10 22:36:58 Start AS on fire? Mar 10 22:39:16 should probably reboot Mar 10 23:01:21 I don't come here often, but someone in #android thinks twrp is Uefi and holocaust never happned, please set him streight: http://strawpoll.me/7047569/r Mar 10 23:01:55 nope Mar 10 23:01:57 wow, I never thought I’d have to say this here, but “not your personal army" Mar 10 23:01:58 wrong place Mar 10 23:01:59 go away Mar 10 23:02:54 ok then, thought you would know Mar 10 23:03:09 i’m bored, but I’m not that bored Mar 10 23:05:05 wtf Mar 10 23:08:44 i guess, if you change gradle plugin versions, you really have to remember to delete the .gradle dir in your AS project Mar 10 23:08:54 that fixed it :| Mar 10 23:09:39 * p_l wants to have words with whoever effects leadership on android tv Mar 10 23:10:40 weird, had to move synchronized from base class to child class to prevent a crash on N Mar 10 23:10:51 O.o Mar 10 23:11:24 i think there will be quite a few of these little jack / jill /openjdk transition issues Mar 10 23:11:36 https://github.com/pfn/qicr/commit/6ca6cbe387a5d0c7b38aaf83b1f3a455d3bd6fa0 Mar 10 23:12:45 so good thing we have N preview i guess Mar 10 23:13:36 had to flash my device to get the N preview to work, the OTA bricked Mar 10 23:13:41 weird... Mar 10 23:15:20 I am now learning android, please wait... Mar 10 23:15:44 got a book now :) Mar 10 23:15:45 reading it Mar 10 23:22:11 pfn i think you mentioned this the other day https://code.google.com/p/android/issues/detail?id=201827 Mar 10 23:22:25 yeah Mar 10 23:22:32 I saw mine get marked as dupe Mar 10 23:22:36 lol #8 Mar 10 23:22:50 did 23.2.1 fix it ? Mar 10 23:26:28 dunno, haven't checked Mar 10 23:31:10 hmm.. this is quite the situation.. in order to test out some code to "sign in using google" I have to sign in using the "google apps device policy" app Mar 10 23:31:35 however, when it tries to download (inside the emulator), it crashes the sign in app Mar 10 23:31:49 anyone run into this before? Mar 10 23:31:57 Style question: do you prefer to to keep all of your strings in one file or do you divide them up by activity or something similar? Mar 10 23:32:12 i even tried with a new emulator image.. this feels like it's going to be one of "those" issues right now Mar 10 23:33:05 konk3r string resources ? Mar 10 23:33:21 Yeah Mar 10 23:33:27 Do you use a single Strings.xml file or multiple? Mar 10 23:34:09 Having a single file seems like it gets messy really fast Mar 10 23:35:07 konk3r its preference. this was from other day https://www.reddit.com/r/androiddev/comments/49habh/a_successful_xml_naming_convention_jeroen_mols/ Mar 10 23:35:32 what i do tend to split out, are things i may transplant elsewhere ... like attrs for a custom view, etc Mar 10 23:35:44 but yeah, if you have tons of strings why not break it up Mar 10 23:39:25 most larger projects I’ve been on, have usually been one file, but there are sections Mar 10 23:42:33 yeah, usually people do use a single strings file, and yeah, even with sections, sometimes it's difficult to properly relegate them to a particular section (especially when it's a common word used everywhere) Mar 10 23:51:56 many large projects split into multiple values files Mar 11 00:00:44 I have a Spinner with ArrayAdapter, how do I get the current selected item? and when I assign an onItemSelectedListener, does it immediately fires onItemSelected initially? Mar 11 00:09:04 quick santiy check, please. return (int) (mRecyclerView.getAdapter().getItemCount() * scrollProgress); If getItemCount() returns 0, then that statement should return 0, right? Mar 11 00:09:16 scrollProgress is a float Mar 11 00:11:05 dude it's pretty rad so far Mar 11 00:11:24 OverCoder - you use getSelectedItem() Mar 11 00:12:49 I am using a LinkedHashMapAdapter, which let's me get a LinkedHashMap.Entry when I use getSelectedItem() Mar 11 00:13:07 ((LinkedHashMap.Entry) ((Spinner) view).getSelectedItem()).getKey() is how I get the key then Mar 11 00:14:00 also s73v3r I am not exactly sure - if it does not return 0, you should debug into it or try casting scrollProgress to int first maybe.. Mar 11 00:14:31 i’m pretty sure it does. i see now the issue Mar 11 00:15:13 hm.. on a different note.. how do I include images, that are not PNG/XML? I want to open them later in an AsyncTask (hence openRawResource won't work for me) Mar 11 00:16:02 that’s in a getPositionForScrollValue method. the return of that gets passed into a getSectionForPosition method, which has the line if(position >= mStuff.getCount()) { position = mStuff.getCount() -1 } Mar 11 00:16:04 I currently have them in a raw folder and accessing them from UI thread is easy, but I do not want to open a Stream right away.. Mar 11 00:16:14 but if getCount() is 0, then that will return -1 for section Mar 11 00:50:48 divStar, oh, thanks :) Mar 11 01:33:27 hm.. so .. question.. now that I have managed to decode ICO files properly, I thought about testing it.. but honestly: it's such a big PITA that I decided to make an application which contains 2 ICO files with a ton of possible formats and upon calling that test-app one can see if it works or not Mar 11 01:33:43 do you guys still think I should create individual unit tests for the icon-decoding library? Mar 11 01:35:28 man, how many nicks do you use Mar 11 01:35:37 2 Mar 11 01:35:49 lol, yeah sounds like a pita. you would probably use 'oracle' technique Mar 11 01:36:06 divStar and Aoi - it's in my mirc config and because ghosting + identifying + rejoining does not flawlessly work with this channel, it so happens I keep chaning nicks Mar 11 01:36:43 have a graphic that you decode from known format into known result, and compare buffer with ico decoded result Mar 11 01:36:52 g00s so what I basically have is some sort of a very simple one-activity-UI that let's you load embedded sample icons or icons from a given URL (if valid) Mar 11 01:37:57 hm.. that's actually a smart idea.. I am just unsure if I can compare Bitmaps like that.. Mar 11 01:38:22 I probably could compare BufferedImage-objects like that, but well - no such thing in android (unless one uses apache harmony or something) Mar 11 01:38:56 ah.. copyPixelsToBuffer.. Mar 11 01:39:19 I'll try to fiddle with it - thanks for the idea, g00s! Mar 11 02:05:07 * Napalm waits for a question to be asked.. the silence is palpable Mar 11 02:13:18 Napalm did the bottomsheet setState bug get fixed in 23.2.1 :) Mar 11 02:13:35 never heard of it Mar 11 02:13:43 what was the bug? Mar 11 02:13:54 201825 Mar 11 02:14:09 https://code.google.com/p/android/issues/detail?id=201825 Mar 11 02:14:55 man i think chris banes should get these things in cheese square, and test the app on a few things before its released ... Mar 11 02:16:07 so Napalm what are your favorite go-to libs you use in apps ? Mar 11 02:16:48 okhttp top of the list Mar 11 02:17:02 i tried a few image libraries, picasso is still my go-to Mar 11 02:17:15 i like the features of others.. but just not that reliable Mar 11 02:17:36 fresco has this nice feature of progressive jpeg loading Mar 11 02:17:56 but it just fails at memory management and i guess error handling, because i would get native crashes from that Mar 11 02:19:24 g00s: oh and the new Data Binding lib Mar 11 02:19:32 i dont think i could survive without that now Mar 11 02:19:35 Napalm you like that ? i haven't tried it yet Mar 11 02:19:41 I'm totally lost as to why dagger is not working in my test cases Mar 11 02:19:43 hm i have to check it out then Mar 11 02:19:57 who's got nothing better to do but look at my git repo and find out whats wrong? Mar 11 02:21:39 I'm almost ready to strip it out and do DI manually Mar 11 02:22:40 * g00s hasn't used dagger, has no idea Mar 11 02:22:47 Napalm you use dagger ? Mar 11 02:22:54 well thanks for nothing g00s :p Mar 11 02:23:13 Napalm one nice lib i've been messing with is netty core, for their bytebuffers :) Mar 11 02:23:15 nope, but i've wanted to use dagger2 in a few projects.. i might use it in my next one Mar 11 02:24:53 it would be really cool if I could decipher this library Mar 11 02:25:22 supposedly if it builds, it almost certainly works. Not for me, nullpointerexceptions everywhere Mar 11 02:25:45 I guess it doesn't help that I have no idea what I'm doing Mar 11 02:26:02 i like my code. it uses few things. and its going to work and compile until google breaks some api :) Mar 11 02:26:46 gonna make a new branch and strip all this crap out. I can always revisit dagger Mar 11 02:27:01 need to spend more time on rxjava. Mar 11 02:30:32 Napalm , i have a question - have you used the vector drawable compat stuff yet ? Mar 11 02:37:41 g00s: yes Mar 11 02:38:27 Napalm ok great - so , i switched my app over to using vector drawables (changing the build.gradle) etc - and my toolbar icons are not tinted correctly. Mar 11 02:38:38 NavigationView IS ok ... Mar 11 02:38:47 but Toolbar is not. i'm sure there are no stale pngs around Mar 11 02:39:20 only way I can get Toolbar tints to work, is to edit the XML for the drawable, and put android:tint="?attr/colorControlNormal" or something in there ... Mar 11 02:39:49 but that does not seem right. i don't want to have separate XML files for the same drawable just because they are tinted differently Mar 11 02:39:52 any ideas ? Mar 11 02:40:32 in other words, i followed this https://chris.banes.me/2016/02/25/appcompat-vector/ Mar 11 02:42:56 so really this is about tinting.. not the fact they are vector drawables Mar 11 02:43:25 g00s: ^ Mar 11 02:43:46 Napalm hm. but Chris Banes said tint should work in toolbar ... Mar 11 02:43:57 yes they do Mar 11 02:44:02 so is it normal to hard code the tint in the XML drawable then ? Mar 11 02:44:07 g00s: i am just trying to understand your problem Mar 11 02:44:26 no, you can tint in the menu bar still Mar 11 02:44:38 the tint is applied at drawable level and any drawable inside is tinted Mar 11 02:44:39 if i hardcode the tint in the drawable XML file, it works fine Mar 11 02:44:52 well yea, your just changing the color Mar 11 02:44:54 huh weird, its not for me Mar 11 02:45:06 were you trying this: android:tint="?attr/colorControlNormal" Mar 11 02:45:29 yeah i had to put that in the drawable xml file for any toolbar icons to tint correctly Mar 11 02:45:29 because that wont work Mar 11 02:45:41 lol Mar 11 02:45:43 * g00s headdesk Mar 11 02:45:45 first.. android: namespace Mar 11 02:45:58 second.. i think attributes Mar 11 02:46:07 not sure if they work on pre-v21 Mar 11 02:46:08 i forget Mar 11 02:46:22 ok, let me rephrase this. should icons left unedited from the material icon pack work out of the box w/o editing them bu adding a tint Mar 11 02:46:32 yes Mar 11 02:46:36 dafuq Mar 11 02:46:46 any-drawable will work Mar 11 02:46:56 because the tint is applied on-top of it Mar 11 02:47:00 like i said, NavigationView is working fine, but my toolbar icons are just ... black Mar 11 02:47:10 and some are THE SAME ICONS lol Mar 11 02:47:39 hrmf Mar 11 02:47:54 i should probably just say minSdk=21 Mar 11 02:48:30 unfortunately, we're probably going to need some appcompat until google can update its platform w/o carrier & oem intervention Mar 11 02:51:01 g00s: i'll give it a go in a moment, just finishing some view holders **** ENDING LOGGING AT Fri Mar 11 02:59:58 2016