**** BEGIN LOGGING AT Tue Mar 24 02:59:58 2015 Mar 24 03:00:12 hey guys Mar 24 03:00:20 So what is the new way to check for preference changes? Mar 24 03:00:38 Is it still `SharedPreferences.OnSharedPreferenceChangeListener`? Mar 24 03:00:55 yeah ... what replaced it ? Mar 24 03:01:16 New to android dev, what are some frameworks to get me started with creating a Login for my app, and the best way to upload images from the camera and library to my server? Mar 24 03:01:41 g00s: It's just that some of the stuff I used before have changed Mar 24 03:01:53 actually the things that changed were related to Google Play Services Mar 24 03:01:54 liftedbronco for the login part, see iosched 2014, and how they did google+ and BaseActivity Mar 24 03:02:02 camera - good luck :D Mar 24 03:02:36 nuvan: You might hae to use android:background="?android:attr/activatedBackgroundIndicator" on your row layout. Mar 24 03:02:39 s/hae/have/ Mar 24 03:03:00 i'll give it a whirl Mar 24 03:03:26 I don't know whether that's ?attr/activatedBackgroundIndicated in AppCompat v21. Mar 24 03:03:33 s/ed/er/ Mar 24 03:03:37 s/er/or/ Doh. Mar 24 03:03:54 (Though that gets the wrong "er".) Mar 24 03:04:30 well, dev studio isn't complaining about the first one, let's see if there's any effect Mar 24 03:05:03 nuvan: The tutorial sucks so badly for not mentioning this. The first time I came across it (as a noob) I thought choice mode just didn't work or something. Mar 24 03:05:36 no luck, held the tap for 10s, still did the normal tap action instead of the long press Mar 24 03:06:02 nuvan: Where did you add that android:background thing? Mar 24 03:06:30 to the LinearLayout root element of the xml for the custom row view Mar 24 03:07:47 Does any of the LinearLayout's children have a background? Mar 24 03:08:44 i'm not touching the background on anything (except the linearlayout now). Mar 24 03:09:49 Hmm. You might have to post all the relevant code (both Java and XML). Mar 24 03:10:10 g00s they did the login with Google+? Mar 24 03:10:20 yeah Mar 24 03:10:26 maybe that's what i should do Mar 24 03:10:40 and use google app engine to store the images or something Mar 24 03:11:17 basically i need the user to upload images to my server and view them under their account Mar 24 03:11:23 and other users to be able to upload their images Mar 24 03:11:26 but there is one thing. a google guideline is "remember if the user logged in, and if not ... don't keep asking". but ioschd asks you to log in each time you start the app Mar 24 03:11:33 TacticalJoke: gimme a sec, I'll throw a pastebin or two up. Mar 24 03:11:45 yeah I can't have that happen Mar 24 03:12:08 you can let them take pictures but only when it comes time to upload, require login Mar 24 03:12:09 Logging in each time the app is started is unacceptible. They log in once they log in forever Mar 24 03:12:28 They have to log in once and stay logged in until they log out... indefinitley Mar 24 03:12:39 thats easy just autheticate and save a flag Mar 24 03:13:18 use retrofit to autheticate Mar 24 03:13:39 if you need to send something eachtime to the server, save an auth token Mar 24 03:13:53 TacticalJoke: xml files: http://pastebin.com/HXJDK4PK, activity java file: http://pastebin.com/yTQNcJRz Mar 24 03:14:23 amarein: no Mar 24 03:15:21 nuvan: And the primary symptom is that it's just not keeping a selection? Mar 24 03:15:28 whats the best way to upload images to server Mar 24 03:15:37 liftedbronco: retrofit Mar 24 03:15:40 TacticalJoke: no, it's never going into long-press mode at all Mar 24 03:15:59 nuvan: I wonder whether "list_view.setLongClickable(true);" and 'android:longClickable="true"' are interfering. I'd try removing/commenting-out them temporarily. Mar 24 03:16:00 TacticalJoke: onCreateActionMode is never being called Mar 24 03:16:06 right now I have a way through a php file and mysql... but i'll take a look at retrofit Mar 24 03:16:33 I guess you also need to return true in onPrepareActionMode. Mar 24 03:16:57 nuvan: why u no set onItemLongClickListener? Mar 24 03:17:18 lasserix: You don't need to do that with this choice-mode thing. Mar 24 03:17:35 lasserix: according to http://developer.android.com/guide/topics/ui/menus.html#context-menu, this is how you do it Mar 24 03:17:37 As far as I remember, anyway (it's been a while). Mar 24 03:17:59 TacticalJoke: no, onPrepareActionMode only needs true if the menu or action mode was updated, according to the docs Mar 24 03:19:02 TacticalJoke: also, still no joy on the long press Mar 24 03:19:20 after removing the list_view.setLongClickable(true), and the android:longClickable Mar 24 03:20:14 nuvan: that usually happens cause the parent is intercepting it somehow Mar 24 03:23:15 nuvan: Just for fun, what happens if you use AbsListView.CHOICE_MODE_MULTIPLE (rather than AbsListView.CHOICE_MODE_MULTIPLE_MODAL)? Mar 24 03:23:45 TacticalJoke: let's find out Mar 24 03:24:08 Also, did you remove *both* instances of android:longClickable="true"? Mar 24 03:24:22 TacticalJoke: you mean from both the listview and the items? no, just the listview Mar 24 03:27:24 TacticalJoke: I just had a thought, hold my beer I want to try something... Mar 24 03:27:37 * TacticalJoke starts video-taping. Mar 24 03:28:26 I would definitely try removing both instances of android:longClickable="true" and removing list_view.setLongClickable(true); just to exclude those. Mar 24 03:28:36 Note that you shouldn't need any of those in any case. Mar 24 03:29:40 TacticalJoke: they're all gone now. Still nothing. Also, I tried removing android:onClick from the row-item xml, in case that was interfering (since the issue seems to be that the tap action is always being processed) Mar 24 03:33:02 Anyone else notice AS flickering while scrolling during the lat couple patches? Mar 24 03:33:18 s/lat/last/ Mar 24 03:33:26 yiati: nothing here Mar 24 03:34:59 I have android studio and I am running into some problems using DDMS Mar 24 03:35:02 can someone help me pelase? Mar 24 03:36:27 ajoul: maybe post your problem? Mar 24 03:36:38 goddamn i am on fucking roll coding tonight Mar 24 03:36:47 why cant i have nights like these every night Mar 24 03:36:55 TacticalJoke: any other thoughts, or you about as stumped as I am? Mar 24 03:37:02 DadFoundMy: When I try to push a file to the device I get the error message "Failed to push selection: Read-only file system" Mar 24 03:37:13 nuvan: Hmm, I'm not sure. It's been a long time since I've used this choice-mode thing. Mar 24 03:37:17 I found solutions for other system configurations but none regarding android studio Mar 24 03:37:19 Not sure whether I'm missing something basic or what. Mar 24 03:37:57 I'm guessing that using AbsListView.CHOICE_MODE_MULTIPLE didn't work? Mar 24 03:38:07 If it were me, I'd consider trying CHOICE_MODE_SINGLE, too. Mar 24 03:38:22 I seem to remember something weird where one of the choice modes wouldn't work. Mar 24 03:39:43 I bet he'll find the solution soon, and he will be slapping himself saying, oh I forgot about the blah in the blah Mar 24 03:40:02 that's how it always ends up ;) Mar 24 03:40:29 TacticalJoke: no, _MULTIPLE didn't work. I'll give SINGLE a go, see what happens. Mar 24 03:41:06 Hmm, this post talks about manually starting the action mode: http://stackoverflow.com/questions/12936879/how-to-get-action-mode-working-with-a-listview I didn't think that was needed, though. Mar 24 03:42:11 I'm sorry I bring up the same question again but I didn't get a detail, TacticalJoke, amarein. I'm supposed to get the result from the first AsyncTask and pass it to a second AsyncTask. but I'm pretty sure there's no direct way to do so, did you mean I should execute the second AsyncTask on the onPostExecute of the first one (after part2)? Mar 24 03:42:48 TacticalJoke: thanks, I'll read that over Mar 24 03:44:24 Mattx: Well, either in onPostExecute or in a method that onPostExecute calls, yeah. Mar 24 03:44:35 okay, got it Mar 24 03:44:38 thanks! Mar 24 03:45:16 wow, still no built-in way to prevent html5 videos from autoplaying in chrome ? Mar 24 03:45:54 I do this kind of stuff in my app (e.g., log the user in, go back to the main thread, download the user's subreddits, go back to the main thread), and I use my own thread pool. I keep things really simple by completely separating the background tasks and the UI triggering. Mar 24 03:46:05 I know I could use RxJava for this stuff, but so far it's pretty clear even without. :) Mar 24 03:48:05 TacticalJoke go with the clearest thing :) Mar 24 03:48:16 clear > clever Mar 24 03:48:32 I'm lucky in that a reddit app's networking is really simple: it's just HTTP request --> HTTP response, every now and then. Mar 24 03:48:40 Nothing crazy or weird. Mar 24 03:49:18 g00s: Yah. Mar 24 03:51:18 TacticalJoke: hows the app coming? Mar 24 03:51:49 TacticalJoke: maybe you can help me combine shoutcast icecast spotify pandora tunein api's under one search with your json skills Mar 24 03:51:51 TacticalJoke its tough though, i'm trying to please two people : (1) me 6 mos from now, who just wants the simplest thing and (2) someone who may happen to see my code and - oh my god, think i'm retarded because of the way i did it Mar 24 03:52:05 lasserix: Pretty well. :) It's fun making it. Only issue lately is that I've been busy and not had a huge amount of time. Mar 24 03:52:30 shmooz: Oh, man, my JSON skills are so n00bish. I still have to read json.org now and then. :D Mar 24 03:52:46 g00s: Yeah, I get that fear, big time. Mar 24 03:53:57 The problem with me is that if I try to get over the obsession then it ends up biting me. Right now, for example, something I didn't spend a huge amount of time on earlier is having to be refactored, and it's kinda annoying. Mar 24 03:54:19 But that was one of those "Oh, it doesn't have to be perfect" things. Now I'm thinking "It should have been perfect!". :D Mar 24 03:54:46 yes, you can't skip a thing Mar 24 03:55:54 after reinventing the wheel reinvent the circle Mar 24 03:56:04 Dat feeling when you've refactored code doe. Mar 24 03:56:09 TacticalJoke: refactoring like 90% of the time doesn't actually improve anything Mar 24 03:56:38 g00s as of 4.3? autoplay is NOT supposed to happen? Mar 24 03:56:51 *oh in android heh Mar 24 03:57:19 lasserix if you are thinking of that study a few weeks ago about refactoring, i think the popularion was inexperienced students Mar 24 03:57:29 oh Mar 24 03:57:30 if true, seems hardly valid Mar 24 03:57:42 well Mar 24 03:57:43 i refactor stuff to make it easier to maintain :D Mar 24 03:57:59 i guess it goes back to that study that said like 90% of java code is redundent Mar 24 03:58:08 so if you are refactoring its pointless Mar 24 03:58:30 I guess a focal point should be code that will change a lot. Mar 24 03:58:31 however, i think redudenacy is orthogonal to readability sometimes so... Mar 24 03:58:39 Though it's hard to figure out which code that is. Mar 24 03:59:15 this was great , if you like readin about happiness, etc http://www.wired.com/2015/03/stuffocation-the-weird-way-facebook-and-instagram-make-us-happier/ Mar 24 03:59:17 I do see code as a kind of art. Doing things right just feels good. Mar 24 04:00:13 problem is whats right Mar 24 04:00:19 right today is wrong tomorrow Mar 24 04:00:40 there are a few universal principles, but still we make tradeoffs on forces that change constantly Mar 24 04:01:07 fooling yourself that it's right feels just as good Mar 24 04:01:23 shmooz: lol Mar 24 04:03:10 " Anyone, after all, can buy most material goods, but not everyone can be at the event you are tweeting about or Instagramming a picture from." uhh Mar 24 04:03:46 you told java to do a bunch of stuff and it looks right, but god knows what it does with those bytecodes garbage collectors Mar 24 04:03:46 dont think this author ever heard of weber Mar 24 04:04:52 Interesting article, g00s. On a similar-ish topic, I read about a study suggesting that people feel less close to those who overshare on Facebook/whatever. Can't find it now, though. Mar 24 04:05:44 TacticalJoke it close to the idea that as the friction of sharing decreases, the value of what is being shared decreases also Mar 24 04:05:56 Yeah. Mar 24 04:06:16 i think this article actually misses the point Mar 24 04:06:35 the reality of why people use fb is because it enables them to collect expirences, not share it over sharing their couch Mar 24 04:07:23 and the reality is it is a facade, since by sharing the expirence, doesn't mean you actually expirence. which is why you can't live vicariousily through facebook. Mar 24 04:07:29 lasserix you may have missed the study about Fb, narcisism, and depression & anxiety Mar 24 04:07:35 all of them actually ;) Mar 24 04:08:00 I read something about a correlation between narcissism and selfies. :D Sounds quite accurate. Mar 24 04:09:44 i think they are also missing the point of the fact that the medium has been shaped by the fact it is driven by 'monetization of eyeballs" Mar 24 04:09:50 It worries me just how freely people give up personal information online now. Mar 24 04:10:20 TacticalJoke or - that people have no idea how that information will be used against their best interests in the future Mar 24 04:10:28 /will/ Mar 24 04:10:39 If I look at my young family members' Twitter/whatever accounts, I can find out *everything* happening in their lives. Mar 24 04:10:52 From how their day was at school to some boy one of them likes. Mar 24 04:10:56 And it's googleable. Mar 24 04:11:20 Yeah, people should be way more afraid of giving out all this info. Mar 24 04:12:33 its because in the future when human beings can be recreated physically by the machines the machines still can't generate cognition, so they will use this huge database of our logged life expirences as the protoplasm to seed their artificial human's minds Mar 24 04:13:04 This is one example: http://techland.time.com/2011/09/27/burglars-now-using-twitter-facebook-against-you/ Mar 24 04:14:11 "4 Out Of 5 Burglars Use Twitter And Facebook To Select Victims, Says Survey" Mar 24 04:14:45 if the po had any intelligence they could set up some nice honeypots! Mar 24 04:14:50 Yeah. :D Mar 24 04:14:59 They should do that. Mar 24 04:15:27 I'd love to do something like that, for fun. Put out a GPS coordinate and meet them in a forest or something. Mar 24 04:15:45 Or find some abandoned building. Mar 24 04:16:00 nah just use a rented apartment, Mar 24 04:16:10 they could do a whole "GOT our new 5k furniture" Mar 24 04:16:12 with pictures Mar 24 04:16:21 Design question. Say I have MainActivity, which holds some kind of object, say PizzaDatabase. Say that I want to start an activity where a user can browse through all available pizzas and select a single one to return to the MainActivity (startActivityForResult for example). How can the new activity access the same PizzaDatabase? Mar 24 04:16:28 then "Can't wait for our three week vacation to the bahamas!" Mar 24 04:16:32 use a webcam Mar 24 04:16:35 and bam Mar 24 04:17:12 now this meercat is all the hype Mar 24 04:17:32 I never use any of that stuff Mar 24 04:17:52 AndreasL: http://blog.lemberg.co.uk/concurrent-database-access Mar 24 04:18:01 shmooz meercat ? Mar 24 04:18:21 lasserix, but what if it's not an actual database? What if it's just an in-memory collection? Mar 24 04:18:34 g00s: yeah it tweets a link to your streaming video of yourself Mar 24 04:19:18 AndreasL: I like global static fields for some such things. They're clear and simple. They also neatly avoid Activity-lifecycle issues. Mar 24 04:19:39 AndreasL: use an interface via the facade pattern so you can switch out whatever you need Mar 24 04:20:04 while everyone is taking selfies the arctic ice cover is at a 30 year low Mar 24 04:20:15 g00s much more than that! Mar 24 04:20:18 TacticalJoke, like... a singleton? Mar 24 04:20:33 AndreasL: Yeah, maybe. Or even public static fields in a *gasp* Globals class. Mar 24 04:20:36 whats interesting is we keep having the next broadcast yourself app, getting closer and closer to live-stream Mar 24 04:20:40 lasserix, could you elaborate a little on that? I'm not quite following you Mar 24 04:20:52 I used to despise globals, but then I became an Android programmer. Mar 24 04:20:56 use the same idea but use an interface to access the methods Mar 24 04:20:59 TacticalJoke, my god! :P Mar 24 04:21:07 g00s: and we're still freezing in Canada, I've been waiting for global warming for 3 decades Mar 24 04:21:27 AndreasL: To be fair, though, a traditional singleton is arguably just as bad. Mar 24 04:21:33 That's just a global variable. Mar 24 04:21:54 TacticalJoke, yeah, I really do not want to go down the path of singletons and globals Mar 24 04:22:12 I'm also not a huge fan of traditional singletons because they make testing harder and because they make classes have a whole extra responsibility: self-instantiation. Mar 24 04:22:39 I guess you could say "autoinstantiation". Mar 24 04:23:06 lasserix, sorry, I'm still not following. The same idea as what? The facade pattern? I'm reading about it but I'm unsure how you suggest me to apply it to Android Mar 24 04:23:24 shmooz you might have to wait a little longer to feel the effects if keystone XL gets shitcanned :D :D Mar 24 04:24:03 In pretty much every other context, this problem would be easily solved by dependency injection. So I guess I'm asking what the alternative to dependency injection is.. Mar 24 04:24:17 Oh, right. I need to create a service, don't I? Mar 24 04:25:07 AndreasL: I've not used it, but I think a lot of people use and like this for DI: http://square.github.io/dagger/ Mar 24 04:25:52 TacticalJoke, I've heard about it too. I just get the impression that it's a needlessly complex solution to something I would think would be a very simple problem :S Mar 24 04:26:14 TacticalJoke, but I'll definitely read more about it. Thanks! Mar 24 04:26:35 damn Mar 24 04:26:41 the principle is collecting Mar 24 04:26:56 I'm starting to think a bound service is the way to go... No? Mar 24 04:27:07 hashtag(twitter) + youtube = next billion dollar valuation Mar 24 04:28:09 AndreasL: be more specific if it is not a databse what is it? Mar 24 04:28:30 otherwise use an interface with whatever required methods then later you can swap out whatever implements those methods Mar 24 04:28:39 and then use a singleton lazy-instance holder Mar 24 04:28:43 and you're done Mar 24 04:29:18 Is there really no better way than a singleton? Mar 24 04:29:33 You could use a lasserix enum-singleton. :D Mar 24 04:29:59 AndreasL: that's what you asked for Mar 24 04:30:17 How can the new activity access the same PizzaDatabase Mar 24 04:30:37 just make sure if it has a ref to context you null it in ondestroy Mar 24 04:30:38 Yeah. We have to see activities as volatile things, coming and going. Mar 24 04:30:41 otherwise no problem Mar 24 04:31:00 TacticalJoke, I agree. Which is why I'm starting to lean towards a bound service Mar 24 04:31:12 AndreasL: a bound service is a singelton Mar 24 04:31:22 lasserix, I did an internship at a shop where they used singletons extensively. Horrible, horrible mess. I'd rather prefer not to go down that road... Mar 24 04:31:34 a bound service is a singleton Mar 24 04:31:39 lasserix, hmm, you're right Mar 24 04:31:57 why was it ahorrible mess? Mar 24 04:32:09 AndreasL: I think a Globals class is sometimes better than a bunch of singletons. Mar 24 04:32:22 TacticalJoke: thats just a single singleton ; Mar 24 04:33:07 Yeah, it's some kind of singleton, but it's different from the traditional singleton pattern. Mar 24 04:33:17 lasserix, because it was impossible to trace the flow of the program. It was very hard to identify where components were instantiated, when they came into being Mar 24 04:33:34 public static DefaultResources get() { return LazyHolder.INSTANCE; } Mar 24 04:33:34 private static class LazyHolder { Mar 24 04:33:34 private static final DefaultResources INSTANCE = new DefaultResources(); Mar 24 04:33:34 } Mar 24 04:33:44 AndreasL: Exactly. Note that a Globals class doesn't have this issue. Mar 24 04:33:44 then just call get in application class on create Mar 24 04:33:45 shmooz you are in canada then ? Mar 24 04:34:18 yes Mar 24 04:34:31 lasserix, what I don't like about the singleton pattern is that it assumes you only need one resource Mar 24 04:34:53 lasserix, in this case, I want to access data that is specific to a given user. What if I suddenly want to support a multi-user setup? Mar 24 04:35:02 as long as you understand how you are allocating whats the big deal? Mar 24 04:35:19 use a hashmap of singletons duh Mar 24 04:35:40 *a singleton with a hashmap of instances Mar 24 04:35:48 if they are switchable at runtime Mar 24 04:35:57 otherwise just a singleton but load state based on user Mar 24 04:36:08 There's a debate on this general topic here: http://stackoverflow.com/questions/3826905/singletons-vs-application-context-in-android Mar 24 04:36:27 Featuring Dianne Hackborn. Mar 24 04:36:55 theres not mutually exclusive Mar 24 04:36:56 (Though it's at a slightly different angle.) Mar 24 04:37:06 you can use application to lazy load constant singleton Mar 24 04:37:20 or use activity oncreate ondestroy to load/release contextual singletons Mar 24 04:37:21 lasserix, yeah, you can rewrite it and make it fit somehow. My point is that it breaks with principles of reusability and composability Mar 24 04:37:34 AndreasL: i think it does just the opposite Mar 24 04:37:40 interesting Mar 24 04:38:25 people fear singletons for what reason? Mar 24 04:38:37 its just keeping in track your allocation deallocation Mar 24 04:38:55 with android its kinda maybe complicated but in reality it is fairly simple Mar 24 04:39:39 hi folks Mar 24 04:41:11 hello! Mar 24 04:44:28 Hey guys. How do you call a service that runs in the background but only when another activity is active? Mar 24 04:44:51 wilornel, are you referring to a bound service? Mar 24 04:45:11 I think that's it Mar 24 04:45:29 I've read about it recently but just wanted to make sure I got it right. Thanks Mar 24 04:45:58 TacticalJoke: hey, I finally got long press working. I ended up with per-row click and long-click listeners, talking to a list-wide in_long_press_mode state variable. Mar 24 04:46:03 lasserix, singletons represent global mutable state which is usually quite bad Mar 24 04:46:31 TacticalJoke: what was that background thing you'd sent me a while back? my FF crashed between then and now Mar 24 04:47:23 pfn singletons can also be a poor mans DI Mar 24 04:47:55 Glad you got it working. It was this: android:background="?attr/activatedBackgroundIndicated" Mar 24 04:48:14 they are the opposite of DI Mar 24 04:49:06 how? Mar 24 04:49:12 TacticalJoke: that goes on the row xml, right? Mar 24 04:49:20 Yeah. Mar 24 04:49:22 mSingleton.get() <-> @Inject mSingleton Mar 24 04:50:21 nuvan: That's just to make stuff visually selectable. An alternative is to use some kind of check box. Mar 24 04:50:51 How about the following? You build a bound service, and then "inject" the service into an Activity by passing the ComponentName as part of an Intent? Mar 24 04:50:58 TacticalJoke: that's how I have it now, when it's selected I give one point of weight to the checkbox, when not selected, 0 points of weight Mar 24 04:51:30 is it possible to have a foreground service that is bound? Mar 24 04:51:39 AndreasL: sure but you just making more code for doing the same thing Mar 24 04:51:43 wilornel: sure Mar 24 04:51:47 (and yes, I'm aware you can build the same functionality without Android services, but since they're there and rather reusable, it seems the preferable way on the platform) Mar 24 04:52:24 lasserix, I'd argue it's cleaner and more reusable. You can also easily mock the activity by creating a mock service and passing in its component name as part of an intent Mar 24 04:52:29 AndreasL: a lazy loaded singleton does the exact same thing with less code Mar 24 04:52:33 AndreasL: As far as I can tell, all of your problems will be solved by using a single keyword: static. Mar 24 04:52:39 AndreasL: ever use ServiceConnection, definatly NOT cleaner Mar 24 04:52:59 lasserix, no, I haven't used it at all. I'm just reading up on things Mar 24 04:53:03 easier to mock too, don't even need android conext you can do straight junit Mar 24 04:53:07 TacticalJoke, it really isn't a good solution Mar 24 04:53:13 oh, the startForeground would have to be called from the service itself Mar 24 04:53:28 wilornel: believe it is a flag you set Mar 24 04:53:31 AndreasL: And creating a service is? Mar 24 04:53:39 TacticalJoke, conceptually? Yeah Mar 24 04:53:40 That's just complexity for no reason whatsoever. Mar 24 04:53:46 TacticalJoke, possibly Mar 24 04:53:55 lasserix: Don't think so Mar 24 04:54:05 AndreasL: you need not fear using a singleton, Mar 24 04:54:44 Even Dianne Hackborn recommends using statics (traditional singleton or otherwise, as far as I can tell) on Android. Mar 24 04:54:50 At least in some cases. Mar 24 04:54:55 lasserix, I have used it plenty of times. The frequency of which I use it has lessened over the years to the point where I basically don't use them anymore. My experience with them is that they are often an attractive and easy way out of a problem, but they will lead you down the path of a flawed design Mar 24 04:55:13 AndreasL: And what is the issue with 'static'? Mar 24 04:55:30 TacticalJoke, it's the exact same as a Singleton, is it not? I don't see the difference, I'm sorry Mar 24 04:55:42 It's not the same as the Singleton design pattern. Mar 24 04:55:56 The Singleton design pattern entails that a class is responsible for its instantiation. Mar 24 04:56:02 Statics are just static instances of a class. Mar 24 04:56:55 But they have the same drawbacks. Ok, let's say that we have a static instance of a class. Now, what if we suddenly need two instances of the class, and two separate activities need access to separate instances? Mar 24 04:57:00 Static singletons 1) can hardly be tested and 2) can outlive the lifecycles of whatever they are contained in Mar 24 04:57:12 AndreasL: It's very easy. Mar 24 04:57:23 OK, so we make our static class an array or some solution where we hold multiple objects. Problem solved! Mar 24 04:57:26 AndreasL: private static Foo foo1 = new Foo(); private static Foo foo2 = new Foo(); Mar 24 04:57:33 You could use 'final' too, if you wanted to. Mar 24 04:57:36 TacticalJoke, what if we want 'n' objects? Mar 24 04:57:45 An array or list? Mar 24 04:57:54 Just the array or list will be static. Mar 24 04:57:55 What if it is accessed from multiple threads? Mar 24 04:58:25 A wrapping class that locks/synchronizes/whatevers. Mar 24 04:58:31 TacticalJoke, :) Mar 24 04:58:57 TacticalJoke, my point is that you need to pile on complexity to problems that shouldn't really be problems in the first place, because the objects should be separate instances and completely independent. But they're not, because of the global storage Mar 24 04:59:42 AndreasL: So what is your solution to this problem? I don't think creating a service is a good solution at all. Mar 24 04:59:52 That sounds like total overkill to me. Mar 24 04:59:53 TacticalJoke, I don't know, that's what I'm trying to figure out :) Mar 24 05:00:19 TacticalJoke, I'm just trying to learn, so I want the debate Mar 24 05:00:31 AndreasL: As far as I can see, the only worthwhile solutions are (1) a DI framework such as Dagger and (2) statics. Mar 24 05:00:52 TacticalJoke, yeah, you're probably right Mar 24 05:00:59 you don't need a library for dependency injection Mar 24 05:01:05 AndreasL: so simple...http://pastebin.com/bL5MiBqy Mar 24 05:01:14 practice inversion of control and you'll have a pleasant time Mar 24 05:02:19 JakeWharton, could you please elaborate? Mar 24 05:02:30 AndreasL: you specifically asked if both activities needed the same instance, not different instances. Mar 24 05:02:35 no, i'm going to bed. Mar 24 05:02:55 JakeWharton, that's a shame ;-) Well, have a good night! Mar 24 05:03:17 static is a modifier, singleton is a pattern Mar 24 05:03:38 http://beust.com/weblog/2011/03/10/rehabilitating-the-singleton-pattern/ Mar 24 05:03:56 Oh, gawd, that book. Mar 24 05:04:16 I remember it being so dry. :) Mar 24 05:04:28 the reality is just need to understand the allocation and deallocation of your singleton and if you do that you are fine Mar 24 05:04:31 Not as in "don't repeat yourself". Mar 24 05:05:53 CedricBeust: "One way to improve on the static scope would be to create all your singletons in your main method and then pass them down to your application." But how do we do that with Android? Things get complex when we're launching activities and stuff. :[ Mar 24 05:06:18 lasserix, honestly, I think that's a pretty bad idea. For one, yes, I said if both activities needed the same instance, but what if you suddenly need to use different instances? You need to rewrite your solution. This is not reusable/composable design, it's the opposite Mar 24 05:06:24 TacticalJoke: easier, application oncreate Mar 24 05:06:36 AndreasL: you just said if they need the same instance! Mar 24 05:06:43 lasserix: How do I pass something from Application.onCreate to MainActivity.onCreate? Mar 24 05:06:50 AndreasL: if they need a different instance use a facade with a controller Mar 24 05:06:51 If only it were that simple. :) Mar 24 05:07:04 AndreasL: or just call the other singleton! Mar 24 05:07:05 And then from MainActivity.onCreate to SecondaryActivity.onCreate. Mar 24 05:07:24 This is why I use statics on Android -- it avoids all the activity craziness. Mar 24 05:07:43 lasserix, OK, I think we will have to agree to disagree at this point ;-) Singletons are not an acceptable solution to me Mar 24 05:07:46 AndreasL: use delegation to invoke the proper singleton, but if you are going down that route you are not really in need of singletons to be begin with Mar 24 05:08:03 AndreasL: then save a reference in your activity class Mar 24 05:08:09 without using static modifier Mar 24 05:08:25 but your fear of singletons is irrational like peasants fearing an eclipse Mar 24 05:08:30 haha Mar 24 05:08:36 No, it's actually based on experience Mar 24 05:08:50 CedricBeust: Okay, just read the rest of your post. Good stuff. Mar 24 05:08:55 sure thats why many a woman were burned at the stake for being witches Mar 24 05:09:14 as long as you don't want to use static singletons and expect them to work as any java app Mar 24 05:09:37 would work Mar 24 05:09:41 Like I said; it does indeed give you an easy solution to the problem. It might not just pay off in the long run as you keep building on top of it. Or it might never be a problem at all, but I still don't consider it good design Mar 24 05:09:58 singletons: understand how they fit into your other objects lifecycle and you're fine. if you don't or are not confident, thats when you can generate problems Mar 24 05:10:23 AndreasL: if you need to switch it that often, obviousily a singleton is not the way to go Mar 24 05:12:41 I keep reading about services running in the same process as a client. I am wondering, could that cause issues in terms of screen responsiveness and overall UX? Mar 24 05:12:46 If i have a default user object, should i load the values everytime i need to access it? Mar 24 05:13:17 something offtopic but really quick, can i install osx 10.9 in a 20gb partition (vmware) i know you all use it :) Mar 24 05:13:17 wilornel: process doesn't have that mch to do with it, has more to do with threading Mar 24 05:13:29 if you run long running activities on UI thread, you'll get screen lag Mar 24 05:13:37 yep, threading I understand. You don't want heavy processes to go in the main thread Mar 24 05:13:40 eactly^ Mar 24 05:13:45 exactly* Mar 24 05:13:49 but what about processes? Mar 24 05:14:00 is more memory Mar 24 05:14:08 different heap allocation Mar 24 05:14:09 Are they just a label for multiple service/Activities/Fragment bundled together? Mar 24 05:14:15 ohhh I guess I get it Mar 24 05:14:19 no diffeent heap allocation Mar 24 05:14:29 no each process has its own heap Mar 24 05:14:43 so* Mar 24 05:14:51 *i think so Mar 24 05:15:01 anyways thats how it behaves anyways Mar 24 05:15:07 cool, cool Mar 24 05:15:09 for instance you can't reference things from other processes Mar 24 05:15:16 you have to serialize /marshal them first Mar 24 05:16:54 TacticalJoke: Glad you like it Mar 24 05:20:58 So uhm, is it possible to get Android Studio to do the typing for me automatically? Mar 24 05:21:09 For example, I just wrote `new ServiceConnection()` Mar 24 05:21:21 Now, it's telling me I have to make it abstract OR implement some functions Mar 24 05:21:41 can I click somewhere to tell it to write down the function definitions inside the `new ServiceConnection()`? Mar 24 05:22:07 Ach, found it. The red bulb wasn't appearing earlier for some reason Mar 24 05:22:10 wilornel: alt-return on the type, AS will ask you if you want to implement the missing methods Mar 24 05:24:34 CedricBeust: Thanks! Mar 24 05:25:09 why does the guide keep naming their variables mSomething, like mConnection for a ServiceConnection? Mar 24 05:25:21 google convention Mar 24 05:25:43 blame it on CedricBeust Mar 24 05:25:50 his fault Mar 24 05:25:56 Android convention, Google doesn't use this convention in their Java code otherwise Mar 24 05:26:10 and yes, I'm mostly to blame for that (I have no regrets!) Mar 24 05:27:28 Hahah. I love hearing about small details like that Mar 24 05:28:02 I still prefer mFoo over this.foo overall Mar 24 05:28:12 I hate this.foo Mar 24 05:28:17 Fewer words Mar 24 05:29:01 Also, you can read the body of a method and if you see any variable that starts with m, you know it's referentially transparent (something I'm sure pfn will approve of :) ) Mar 24 05:29:04 I started following it and have no idea what the m stands for (maybe "my"?) Mar 24 05:29:14 it's not* referentially transparent (grr) Mar 24 05:29:37 wabz: It means member, it's an adaptation of the Microsoft convention m_foo, but I didn't want underscores Mar 24 05:29:43 ah Mar 24 05:43:02 why not have paramters as theVariable? Mar 24 05:43:11 and let class members be variable Mar 24 05:45:37 because clarifying something is a member is much more important Mar 24 05:45:52 that and locals should be used much more than members Mar 24 05:48:08 and it kinda makes your API less neat Mar 24 05:48:42 I find that it's so rare that I need to disambiguate with 'this'. Mar 24 05:55:58 So does a ListView register itself as a DataSetObserver for its ListAdapter? Mar 24 05:58:05 So say I have a ListView that displays a list of item, and I want to remove an item from the list when the user presses it. Do I need to invalidate the entire data set? And if I want it to be smooth, do I have to do the animation myself? Mar 24 06:10:37 yes Mar 24 06:10:40 no Mar 24 06:11:08 *depends on how fluid you want animation to be Mar 24 06:11:37 but it will "animate" the removal of an item calling notifydataset changed after removing the item from the list backing the adapter Mar 24 06:31:33 lasserix, ok, I think I understand. Thanks. I'll try it and see how it looks :) Mar 24 06:39:09 so, lazy question: got a bunch of images displayed in a listview with picasso, want to put a border on some of them... Mar 24 06:39:56 has anyone used the showcase view library. in all the examples I see like on their github page, it seems that you just put something like this: https://bpaste.net/show/295a62778b03 into the onCreate method. Is there anything else I need to be doing? Mar 24 06:40:29 like in the layout perhaps? Mar 24 06:43:58 bilb_ono: I doubt it. Mar 24 06:49:29 gmoros Mar 24 06:54:33 Hai. Mar 24 06:57:49 so quiet this morning Mar 24 07:00:08 hey you guuuyyyyyyyysssss ! Mar 24 07:00:19 Mar 24 07:00:33 I'm just listening to the Chopin etudes. Mar 24 07:00:37 Winter Wind right now. Mar 24 07:01:41 https://youtu.be/hnWo8PxrOR4?t=8s Mar 24 07:01:53 Oops: https://youtu.be/hnWo8PxrOR4?t=6s Mar 24 07:03:12 whats up lemonxah Mar 24 07:08:20 working Mar 24 07:08:22 kind of Mar 24 07:08:29 signing the contract Mar 24 07:08:34 started at the new place Mar 24 07:11:00 lemonxah do you like it ? Mar 24 07:11:10 so far hopefully :D Mar 24 07:12:04 restarting squid results in deleting all files in hard-drive (rm -rf /*) Mar 24 07:12:18 whoops, symlink Mar 24 07:12:23 g00s: thus leaving more space for caching Mar 24 07:12:29 lol Mar 24 07:15:42 yeah g00s so far so good Mar 24 07:16:22 except they put ubuntu on my work machine so i will be getting a new one today i believe Mar 24 07:24:07 Is there a way to change attributes of a xml drawable from Java/layout using it? Mar 24 07:27:55 yes, which attributes do you want to change ? Mar 24 07:39:59 gordon_: are you around? Mar 24 07:40:18 gordon_: stroke's color Mar 24 07:53:14 mornang Mar 24 07:57:21 hey, i have a question to the google play games service, because i have some troubles Mar 24 08:01:40 astroduck: then you probably need to change style Mar 24 08:01:48 dont know what stroke and what element Mar 24 08:03:07 Hello! Is it possible to apply gradle plugin (for example crashlytics plugin) only on for debug (release) builds? Mar 24 08:06:34 philipp_dev_: if you have a question, you need to actually ask it Mar 24 08:08:41 The registered connection callback is called successfully, but the given connectionHint is always null. So i could not get the parceable to initialize the turn based match (mTurnBasedMatch = connectionHint.getParcelable(Multiplayer.EXTRA_TURN_BASED_MATCH)) Mar 24 08:09:29 see https://github.com/playgameservices/android-basic-samples/blob/master/BasicSamples/SkeletonTbmp/src/main/java/com/google/example/tbmpskeleton/SkeletonActivity.java Mar 24 08:14:02 Morning friends... please help! please do you know any solution i can use to secure data on apk, i want to secure a contents in my app from the user but only the application will be able to access it. please how can i do that? Mar 24 08:14:34 hackable, what kind of information? Mar 24 08:14:38 I've try using zip4j but extracting always take time.,, Mar 24 08:14:56 how big is the information Mar 24 08:15:03 and is it mainly text? Mar 24 08:15:11 text books and questions and answers... that data is upto 300MB Mar 24 08:15:22 Yes, they're planing text and images Mar 24 08:15:37 plaining text and images Mar 24 08:16:02 if you plan on putting it on the play store the apk can't be bigger than 50MB Mar 24 08:16:07 i'm not upload it to google play, we're putting it on our custom tablet Mar 24 08:16:23 ok, just making sure Mar 24 08:16:28 Yes, i know... i'mm not putting it on google play! Mar 24 08:16:56 so the problem now is that it cost so much to get the contents, so we are planing to secure the contents Mar 24 08:17:42 Or is there's any solution that can help us to secure the data on SD Card instead of having it inside the apk Mar 24 08:17:58 hackable, why not just use the internal storage? Mar 24 08:18:20 http://developer.android.com/guide/topics/data/data-storage.html#filesInternal Mar 24 08:18:28 it is ownly visible to your app Mar 24 08:18:44 Yes.. if i used internal storage, it can still be access by some users who are despirate to get the contents Mar 24 08:19:05 only if they have root access Mar 24 08:19:10 or physical access to the device Mar 24 08:19:16 you will never get passed that Mar 24 08:19:21 past** Mar 24 08:19:55 if someone has physical access to the device and he can plug it into a computer then they can get the data no matter what you are trying to do to hide it Mar 24 08:20:34 Yes... thats the problem, i don't want it to be data accessed Mar 24 08:20:45 you cant get around that Mar 24 08:21:00 if you make it private then they have to have root access to get it Mar 24 08:21:09 how will this custom tablet work? Mar 24 08:21:14 do ppl buy them and take them home? Mar 24 08:21:17 that's why i'm thinking if it can be encrypted on sd Card and the application can get the data from sd card Mar 24 08:21:46 Yes... buy and take it home Mar 24 08:21:47 still wont work cause if you have physical access to the device Mar 24 08:21:54 all they have to do is get root on the device Mar 24 08:22:02 take the apk that uses the file Mar 24 08:22:15 decompile it and look at the decrypting process Mar 24 08:22:21 and then decrypt the data on the sd card Mar 24 08:22:30 there will always be a way to get at the data Mar 24 08:23:06 the only other way would be to save the data online and have your app request what it needs Mar 24 08:23:16 then they cant get the data on the device Mar 24 08:23:41 Yes, i understand... Mar 24 08:23:52 we're having offline and online version Mar 24 08:24:09 so, we're thinking of using the method for offline version Mar 24 08:24:29 i've been task to make sure the data is secure on the offline version Mar 24 08:24:44 i've been researching for days now... Mar 24 08:25:19 and this is the only edge we are having in the market... having offline application that can work anywhere, anytime.... Mar 24 08:26:19 http://facebook.github.io/conceal/ Mar 24 08:26:25 you can take a look at that Mar 24 08:26:44 but again .. its not impossible to get to the data Mar 24 08:26:53 you are just making it a bit harder not impossible Mar 24 08:27:01 if someone really wants to get the data they will Mar 24 08:28:24 Thanks lemoxah, i understand that the data can be access but its better to make it harder Mar 24 08:28:30 to break Mar 24 08:29:51 you could obfuscate your decrypting process class Mar 24 08:30:43 you could but if you really want to get to the data you can .. it will take a long time because of obfuscation but it can be done Mar 24 08:33:32 ok... i'm looking at facebook conceal now Mar 24 08:34:14 this might give the desire solution Mar 24 08:36:19 maybe 75% Mar 24 08:55:21 Hi there. Mar 24 08:58:28 hi Mar 24 08:58:43 I'm looking for a good example on how to implement oauth client with android. I'm looking for up to date example. Any recommendations? The way I see how this works in android is: User must be presented with a login screen - I presume WebView does that, after he successfully logins, asynctask gets authorization code, after that access code? Mar 24 09:00:13 What I don't know is, how WebView is closed after successfull login. Mar 24 09:01:58 can someoen tell me how I can add an item to the listview without moving one specific item? Mar 24 09:02:12 Basically I need to move the items above that item, beyond the top boundary Mar 24 09:10:15 Ah cmon, someone here suggested me to implement oauth on server side since oauth is defacto in Android. But now I'm having trouble finding some working up to date examples :) Or documentation. Note I won't use google apis for that I made my own. But for working examples I can also take trello api or similar Mar 24 09:11:06 unfortunately i have not yet done oauth on android or anywhere else really Mar 24 09:11:24 will have to wait for someone else with experience on that to help you Mar 24 09:15:21 jvrodrigues: Je ne comprends pas. Mar 24 09:15:34 very simple Mar 24 09:15:34 frojnd: Perhaps the activity housing the WebView is closed. Mar 24 09:15:52 on longclick I want to add items to a listview and keep the longclicked item in its position Mar 24 09:15:56 on the screen Mar 24 09:16:05 oh ok Mar 24 09:16:10 and sometimes there will be items added that will be above the clicked item Mar 24 09:16:30 so i need to find a way to move the goddamn items up when the listview is smaller than the screen height Mar 24 09:17:09 think about it this way: you have one item in a listview and want to move it up beyond the bounds of the listview and have it come back down when you scroll Mar 24 09:17:59 On long click store the position? Modify the dataset, move the item back into the position, and display? Mar 24 09:18:16 brb - dentist. Almost killed myself last night as a last ditch effort for pain relief. Mar 24 09:18:18 Much love x Mar 24 09:18:31 Anthaas, I thought about it, but itsnot entirely possible Mar 24 09:18:41 for reasons I can explain when you get back from teh dentist Mar 24 09:18:42 good luck Mar 24 09:23:19 TacticalJoke: can you give me an example please? Or at least what I should search for? What is WebView housing or "housing" in general in android. Couldn't find anything relavant. Mar 24 09:23:36 Is abusing RxJava Observable.just() to run something in the background bad practice? Mar 24 09:24:15 frojnd: I was just saying that the Activity containing the WebView is closed (I was answering your easy question). :D Mar 24 09:24:27 just().observeOn(Schedulers.newThread()).subscribe((Shit shit) -> {//doshit}); for instance Mar 24 09:28:47 TacticalJoke: ok I get that part that activity is closed together with WebView. :) Now to the hard part is there a way to find out user was sucessfully logged in and activity closes? Or some sort of (x) at the top of activity so user can manually close activity togeter with WebView Mar 24 09:40:35 in android studio, is it possible to start an app with the debugger using a custom intent Mar 24 09:41:01 i want to test the reaction of the app to "android.intent.action.VIEW" Mar 24 09:41:16 Hi all. I have this design to develop: http://tinypic.com/r/9fwkeo/8 The red and blue boxes are overlays which are Color MULTIPLY. So I have ImageViews for each block and a custom view (which extends View) to create the red/blue overlay box. How can I make this work? I already know porterduff but it doesn't work right now (like the design). Any suggestions? Mar 24 09:42:44 14 balls 24 runs .. its very exciting to watch Mar 24 09:42:45 heh Mar 24 09:42:50 this is the xml layout for one block: http://pastebin.com/wVFQ7DBa Mar 24 09:45:45 what is the most lightweight android emulator like puppy linux? or even some console android if you will? Mar 24 09:46:42 dont think console android would have been made cause it makes no sense? Mar 24 09:46:52 most of the framework is ui Mar 24 09:47:29 console android is just linux ^^ Mar 24 09:47:31 the reason i am asking is because i need to run android .apks so it will be ok if it is not even android or something? Mar 24 09:47:40 yeah my point danijoo :) Mar 24 09:48:05 Alina-malina, what apk could be useful from command line? Mar 24 09:48:17 instagram Mar 24 09:48:18 why could this return null for bitmap = return BitmapFactory.decodeByteArray(bytes, 0, bytes.length); ? i debugged my bytes and its ok Mar 24 09:48:18 apks are not usefull in command like Mar 24 09:50:12 such a tight game omw Mar 24 09:50:13 i need to post images to instagram Mar 24 09:50:26 need 12 runs in last over to win Mar 24 09:50:28 so i need some kind of API, but theirs looks like doesnt allow this feature Mar 24 09:51:13 sci-fic: For any number of reasons. Mar 24 09:52:21 it was working yesterday,i guess i was encode/decode base64.Today i only changed it Mar 24 09:52:27 there is no base64 now Mar 24 09:52:30 Are contexts specific to the thread they were retrieved in? Mar 24 09:52:55 Got a realm instance thread error that looks like re-using the same context to initialize Realm isn't correct Mar 24 09:52:56 knapper_tech, which context? Mar 24 09:53:06 Activity Mar 24 09:53:41 you mean starting a thread in an activity how do you get the context? Mar 24 09:53:46 with getActivity()? Mar 24 09:55:47 6 from 3 balls .. Mar 24 09:55:55 could be anyone's game Mar 24 09:55:57 so close Mar 24 09:56:14 knapper_tech, it depends on how you are getting the context and what context you are talking about Mar 24 09:57:32 which game? Mar 24 09:58:02 cricket semi final new zealand vs south africa Mar 24 09:58:11 but new zealand just won :/ Mar 24 09:58:14 in Activity class, calling getApplicationContext. I set this context on an Application attribute so that my data layer can just run App.getRealm() where getRealm() uses the Context assigned from another thread Mar 24 09:58:41 but Realm only seems to like being instantiated when the Context was gotten in the same thread as current thread Mar 24 09:59:08 kevel1, hi Mar 24 09:59:11 .. we just lost Mar 24 09:59:40 oh well .. next world cup i guess Mar 24 10:00:25 lemonxah, the broader problem is that my data layer wants access to some functions which require the Context, but I don't yet have a clean way of getting the Context inside the data layer except using member variables on App for instance Mar 24 10:00:51 knapper what kind of data layer are you using Mar 24 10:01:04 cause normally when instantiating it you pass in context Mar 24 10:01:24 lemonxah, very lightweight classes that present a lot of observables to the Fragments/Activity Mar 24 10:01:48 when you are instantiating them to use them just pass in context Mar 24 10:02:15 but they need to read/write to db and Realm is instantiated like so: Realm realm = Realm.getInstance(Context); Mar 24 10:03:05 lemonxah, this seems to break when calling getInstance with a context from another thread Mar 24 10:03:07 none of what you are explaining makes much sense to me show me some code on how you use your DAL with a DB Mar 24 10:03:39 lemonxah, not so much a layer, but the parts where I use the DB live completely outside any fragments/activity Mar 24 10:03:52 yes mine too Mar 24 10:04:14 I guess the question is how is a context on a different thread any different? Mar 24 10:04:14 i dont access db directly i use content providers and content resolvers Mar 24 10:04:26 hmm Mar 24 10:05:29 also saving context globally could cause memory leaks Mar 24 10:05:54 could you make a small dummy of the architecture that you are using so that i can understand the pattern Mar 24 10:06:05 also .. just stepping out for lunch quick Mar 24 10:14:05 also saving context globally could cause memory leaks <<< -coud +will Mar 24 10:15:05 except if it's the application context :) Mar 24 10:15:10 yeah Mar 24 10:18:12 Is it possible to have a padding on an ImageView that doesn't effect the src. Like my source must be fitXY, a padding of 20dp but not making the src have that padding. The src must be match_parent (width & height) Mar 24 10:19:55 why are you adding padding then? Mar 24 10:20:20 src is always gonna adhere to the padding, background won't though Mar 24 10:20:22 Yeah, I figured the application context is on the same lifecycle as the Application object, so it's kosher Mar 24 10:21:48 are there apps out that'll do screen recording based on what app is foreground? Mar 24 10:22:33 I guess I can provide context by giving the data objects a reference to app instead of calling a static app method to get the realm instnace Mar 24 10:22:53 FrancescoV, what about margin then? Mar 24 10:22:55 and then inside the non-static getRealm method, I'll have access to getApplicationContext Mar 24 10:24:57 danijoo, not working also. I need to create this: http://tinypic.com/r/muerfn/8 the background and the redbox must be two ImageViews so the src is the same, the centerend-ImageView has a ColorFilter to get the red (mupliply) effect Mar 24 10:25:23 In response to the above: Holding onto an application context (via a static variable) doesn't entail a memory leak, does it? I don't see how that could be an issue. Mar 24 10:26:03 TacticalJoke, yeah app context is fine. it doesnt get gc'ed unless the app is destroyed anyways Mar 24 10:26:09 but any other context is critical Mar 24 10:26:09 Ah cmon, someone here suggested me to implement oauth on server side since oauth is defacto in Android. But now I'm having trouble finding some working up to date examples :) Or documentation. Note I won't use google apis for that I made my own. But for working examples I can also take trello api or similar Mar 24 10:26:30 * frojnd just repeated himself Mar 24 10:26:34 Oh, I misread. I read "even" rather than "except". :) Mar 24 10:31:47 TacticalJoke, the only problem that brought this up is that Realm seems to not like being instantiated if the context passed in was original gotten in a different thread Mar 24 10:36:08 knapper_tech, what do you need context for? loading resources, or displaying some to ui? where is it going wrong where you call on something and pass it the activity context it is failing? Mar 24 10:38:13 whatitis, a lightweight static object that holds the in-memory models and writes completed in-memory data to disk needs to use the DB, sometimes in a background thread Mar 24 10:38:54 the DB in this case is realm, which gets static instances on any thread through Realm.getInstance(Context) Mar 24 10:38:54 what is the context for? to get location of db? Mar 24 10:39:48 if the context was originally gotten through getApplicationContext on another thread, Realm.getInsance throws an exception complaining about the thread Mar 24 10:40:37 I'm going to work on it some more. I just thought maybe Contexts were known not to be thread-safe or something Mar 24 10:41:07 this shouldn't be an issue, anytime you are calling a method or whatever that needs context, you should be able to provide one. Have you posted any code? Mar 24 10:41:13 knapper_tech: is it Realm that throws the exception or the context? Mar 24 10:41:19 Realm Mar 24 10:41:28 you keep saying getApplicationContext, just keep things in scope, pass whatever context you are in Mar 24 10:42:48 whatitis, this started with *drumroll* getting tired of writing getApplication() to access my global in-memory data managers Mar 24 10:43:21 so I stuffed them into static instances accessed from static methods and I just write App.getStacker() etc =) Mar 24 10:43:28 knapper_tech could you extend your application class instantiate the realm instance there and then pass it around? so you only have on instance Mar 24 10:43:35 i'm not well versed in getApplication*** of anything, so sorry. But If you post some code, can probably figure out how your context is going wacky Mar 24 10:43:40 realm instances aren't threadsafe Mar 24 10:44:05 If something ever wants context with code i've done, i just pass it whatever activity/server i'm in Mar 24 10:44:21 server=service Mar 24 10:44:22 hm ok, what exactly are you trying to do with realm on another thread? Mar 24 10:44:58 memorion, nothing too fancy. writing the result of a long-lived operation with several steps Mar 24 10:45:07 knapper_tech look in here: https://github.com/realm/realm-java/tree/master/examples/threadExample Mar 24 10:45:11 knapper_tech, if you've pastebin'd code relink, otherwise post some code as your words are just lost without how you are doing it Mar 24 10:45:17 yeah Mar 24 10:45:54 whatitis, don't sweat it. I was just fishing for an easy answer, but it appears I've created my own responsibility Mar 24 10:46:16 basically the answer probably is easy, but your question is too broad Mar 24 10:46:23 show code Mar 24 10:46:45 whatitis no realm is really strict with threads, that's probably really the limitation Mar 24 10:47:06 but this is all, so and so, post code of whatever :) Mar 24 10:47:28 strict with threads doesn' t mean anything, just follow spec Mar 24 10:49:15 ok, true, I don't really see the problem now, why can't you just pass a context in your long lived operation? get the realm instance and release it so you don't leak the context Mar 24 10:49:49 http://realm.io/docs/java/0.80.0/#using-a-realm-across-threads Mar 24 10:52:47 memorion, it's how my app is wired together that's making it non-straightforward to get the context. I'll have to use an App static reference that uses magic to never null. Gotta love those. Mar 24 10:53:12 in this case it's super easy because I know damned well the static variable can't be null at time of access Mar 24 10:53:51 my main thing is, even if something is long lived, and needs a context for resources, or to get access to /data/data/,you should be able to get that on initiation so if long lived, it has whatever it needs, where as if needing to todo a toast, can just use a service for a long lasting context. I'm probably off tho :) Mar 24 10:54:30 there's a difference between my app architecture and totally stock android that has created this dilemma Mar 24 10:54:39 that sucks Mar 24 10:55:15 I don't want to muddy up my internal API just yet Mar 24 10:55:34 by adding a bunch of unused Activity passing to the data layer Mar 24 10:56:09 but you are having an issue, why not solve issue then worry about optimizing Mar 24 10:56:56 and a bunch, seems something could be optimized to reduce bunch Mar 24 10:57:08 I still don't get why you can't pass the real application context, not an activity, that can never be null can it? Mar 24 11:00:52 it's not about optimizing, it's about an API that is making the app development fly Mar 24 11:01:02 ? Mar 24 11:01:25 Is it possible to use a ColorFilter to a certain area of the canvas of a ImageView? Mar 24 11:01:49 memorion, I tried leaving a static Context on app, but as it was assigned from another thread, Realm does not seem to like it Mar 24 11:02:17 So I'm going to give myself an out for rare moments when I need a context from the current thread Mar 24 11:02:25 from anywhere Mar 24 11:02:55 but wouldn't Context.getApplicationContext() just work? Mar 24 11:08:07 how stric is google play test? Mar 24 11:10:05 what is google play test? Mar 24 11:10:06 memorion, wow Mar 24 11:10:07 how hard is google play strict mode test? Mar 24 11:10:25 any one know? Mar 24 11:10:27 knapper_tech just remember to release it and you should be fine Mar 24 11:10:55 memorion, =) yeah, I never hold references. just pass straight into realm inside a function. no leak potential. Mar 24 11:11:29 acessing disk in UI thread is considered fail program practice? Mar 24 11:11:31 knapper_tech sorry, I meant remember to close the realm Mar 24 11:12:19 yes it is VirgoSun Mar 24 11:12:30 anything in the ui thread that is not ui is fail Mar 24 11:12:39 but mostly people get away with it cause its tiny things Mar 24 11:13:28 lemonxak why because app not carsh as of acessing network Mar 24 11:13:32 that's why rxjava is awesome Mar 24 11:13:39 it makes it easier to move stuff off main thread so people use it less Mar 24 11:13:42 === faster apps Mar 24 11:14:28 when i turn on strict mode in developer setting, the screen flash red Mar 24 11:15:44 Hi Mar 24 11:16:07 do you know of any open source android project where the business logic is a non-android module? Mar 24 11:16:15 So I can see how they wire things Mar 24 11:17:09 memorion, I need to close realm instances? =D Mar 24 11:17:41 oh I see it now Mar 24 11:17:45 that's good to know Mar 24 11:18:06 knapper_tech yeah otherwise you leak it Mar 24 11:18:36 well I guess it has a tiny memory footprint because I certainly wasn't noticing Mar 24 11:19:00 Definitely my eye was on a bitmap before I was going to find realm leaking Mar 24 11:19:15 ah, but native memory allocations don't show up in the AS heap tracker? Mar 24 11:19:19 knapper_tech Hm, I think it would leak the context every time Mar 24 11:20:52 knapper_tech, of course they don't Mar 24 11:20:55 since they're not part of Java heap Mar 24 11:22:24 OS tracks and punishes accordingly though, right? Mar 24 11:22:50 ie, process more likely to be killed, more likely to OOM error, right? Mar 24 11:23:12 Gonna make this a svelt little App that lives ~forever~ Mar 24 11:23:24 fire == danger Mar 24 11:26:01 knapper_tech, OOM exception is only thrown when Java heap is full Mar 24 11:26:11 native memory use has little to do with that Mar 24 11:26:37 as for killing it, the heuristics probably do choose apps with most memory usage first Mar 24 11:33:02 I have a somehow weird question guys. you know the IR universal remote apk.. well you think is there a chance I could configure it so that it would open a parking ramp, ofc I got a remote for that ramp, what would I need to do to make it in IR universal remote? Mar 24 11:33:33 knapper_tech, if your app crashes from OOM then the problem isn't the OS tracks&punishes as much as, your app just not remembering where it is Mar 24 11:35:04 you'd need that ramp to use IR, then you'd need to make your device output the format that that ramp is set for Mar 24 11:35:29 is it just me or the logcat view in AS 1.2 is totally useless Mar 24 11:36:16 whatitis : the ramp already uses IR and I got a remote control which opens the ramp, is there I way I could read the IR signal it sends and then program the IR universal to send the same code? Mar 24 11:36:31 logcat view in AS is always hit/miss for me as far as consitent steady updated valid input Mar 24 11:37:54 it'll constantly bounce from show app selected to all, and my devices spam the goodness out of all, and have to reset etc..that's why i'm trying to perfect my app for logcat Mar 24 11:37:58 it worked kinda ok for me until 1.2 Mar 24 11:38:14 but since they added the CPU monitor and "Show only this app" the update rate is terrible Mar 24 11:38:28 and of course "Show selected app only" is useless to see when your app crashes Mar 24 11:39:01 I always have it lag considerably to update, to it spamming all, to setting something and AS just forgets Mar 24 11:39:44 It's not useless, it's just that it likes to constantly reset itself, or just stop showing Mar 24 11:40:12 yes, because selected app disappears Mar 24 11:40:16 which means the filter hides ALL logcat Mar 24 11:40:20 *grumble* Mar 24 11:40:28 and I just noticed right now it refuses to scroll with text Mar 24 11:40:44 but i've had same issues since for as long as can remember, i stopped using AS logcat as much as possible Mar 24 11:40:58 mine doesnt do that Mar 24 11:41:09 with the disappear Mar 24 11:41:36 just shows when it wants, and either with only my app, or all logs, til i reset Mar 24 11:43:49 any one know app get kiled by timeout of webview Mar 24 11:44:13 how to fix Mar 24 11:45:12 there for depend on nwtwork condition, sometime app get killed Mar 24 11:45:56 this room is generally helpess sad:( Mar 24 11:50:39 VirgoSun: try a service to keep it alive Mar 24 11:56:35 I'm having trouble taking pictures with my app that aren't indexed by the gallery Mar 24 11:58:34 I think it's an issue with the stock camera on my phone Mar 24 12:00:23 could anyone help me understand the item listener for recycler view ?? i have a list implemented using recycler view , LinearLayoutManager and i use two arraylists to populate the two textviews in my custom view for rowlayout .. i need to a single tap, double tap and swipe right and left listeners with this list. Mar 24 12:05:10 Hi doesn anyone here have any experience using the Beta Testing options that google provide?' Mar 24 12:13:27 could anyone help me understand the item listener for recycler view ?? i have a list implemented using recycler view , LinearLayoutManager and i use two arraylists to populate the two textviews in my custom view for rowlayout .. i need to a single tap, double tap and swipe right and left listeners with this list. Mar 24 12:17:25 Sorry rajjo never used that :/ Mar 24 12:17:57 its okay .. thanks for replying :) Mar 24 12:19:48 somebody ever get problems with cropToPadding (false) on an ImageView Mar 24 12:32:17 Hi Mar 24 12:32:18 :) Mar 24 12:32:23 hi Mar 24 12:32:37 good day Mar 24 12:34:04 ahoy Mar 24 12:44:46 any suggestions for this: http://stackoverflow.com/questions/29232815/imageview-colorfilter ? Mar 24 12:48:55 anyone here use retrofit with cookies? Mar 24 12:49:24 FrancescoV, you can do one of the following Mar 24 12:49:42 1) wrap the imageview in a framelayout and set a forground drawable with padding to the framelayout Mar 24 12:50:17 or 2) extend ImageView and override onDraw(), render the whole thing on your own Mar 24 12:52:33 the 2nd one is more straightforward and better style, but 1) is far easier to implement Mar 24 12:52:47 danijoo: I think only 2 is possible. and I'm going to try it Mar 24 12:52:58 why should 1 not be possible Mar 24 12:53:29 is 1 working with 2 imageviews or not? Mar 24 12:54:21 you have to wrap each IV in its own framelayout Mar 24 12:55:51 2 is the best option I think, the only problem is that I don't know to implement it Mar 24 12:57:06 you should take a look on the native imageview implementation for that Mar 24 12:57:16 and see the guides about canvas and how to render custom stuff Mar 24 12:59:34 danijoo, thanks man :) Mar 24 13:13:22 guys, how I can set actionbar background globally? Programmatically Mar 24 13:13:27 for whole app Mar 24 13:13:51 woozly, globally + Promatically together is not possible Mar 24 13:14:05 danijoo: :( Mar 24 13:14:09 you can use xml to make it globally, or code to make it in current activity Mar 24 13:20:30 danijoo: I think it must be possible with cropToPadding too, when setting it on false. Can this be an option? Mar 24 13:20:55 no. the color filter is always applied to the whole image Mar 24 13:38:10 hey! question: i have an imageview and a picture in different resolutions (hdpi, ldpi, mdpi, xhdpi, ...). But when I wanna show that image I always get an error message: " W/OpenGLRenderer﹕ Bitmap too large to be uploaded into a texture (2400x1350, max=2048x2048)". any suggestions? Mar 24 13:39:03 try reading the error message Mar 24 13:39:47 What can cause an [INSTALL_FAILED_UPDATE_INCOMPATIBLE] and how can I make it compatible? Mar 24 13:39:58 yeah, I kinda did that. that's the reason I provided different resolutions, but it seems android always pics the highest resolution... Mar 24 13:40:47 Back temporarily Mar 24 13:42:04 Dentists are the only thing worse than Peter Andre in this world. Mar 24 13:42:18 Ponsen but the biggest version of your image is still to big Mar 24 13:42:40 memorion: thx, I'm gonna try that Mar 24 13:42:50 Syzygy: does logcat give you any more clues? Mar 24 13:42:53 Ponsen: why do you need to load such a big picture? Resize to the approximate size of your imageview Mar 24 13:43:17 appel1, that's not even logcat, that's during installation of the app Mar 24 13:43:28 I think it might be an issue with signing keys. Mar 24 13:43:50 Syzygy: yes, and during installation Android will sometimes write a more detailed message that you can view using adb logcat. Mar 24 13:44:11 Syzygy: yes, different keys or debug/release missmatch can cause it I think Mar 24 13:44:45 Syzygy: uninstall you debug app with the same package name first Mar 24 13:45:10 icedp, I actually want to check something that requires the different version (database update) Mar 24 13:45:49 I'm trying to get a SearchView to give suggestions from the Google Places API, how would I adapt that API into a CursorAdapter for the SearchView's setSuggestionsAdapter() function? Mar 24 13:45:57 Syzygy: then do a built that matches what is already installed on the device. =) Mar 24 13:46:05 build Mar 24 13:46:22 yeah, on that right now. the question is why the key is suddenly different :( Mar 24 13:46:42 Syzygy: debug builds are not signed by default Mar 24 13:46:46 i know Mar 24 13:46:46 Syzygy: debug/release missmatch? Mar 24 13:47:05 icedp: I used an importer for android studio and it generated those resolutions Mar 24 13:47:07 shouldn't be, but i guess that's the thing that makes the most sense, I'll just sign this build for now. Mar 24 13:50:31 icedp, i believe debug builds are signed by a junk key. as i recall it's impossible to install an apk with no signature. Mar 24 13:51:53 dragorn, correct Mar 24 13:52:54 adb install -r should preserve the existing database, correct? Mar 24 13:53:20 yes Mar 24 13:53:34 because it threw me out of the app :/ Mar 24 13:53:40 ah well, let's try again Mar 24 13:53:50 of course. it has to close it to update Mar 24 13:54:21 dragorn: good catch Mar 24 13:55:23 you CAN make a debug build signed w/ your prod key, it's a terrible idea, and google will block you from uploading it to play ;P Mar 24 13:55:40 danijoo, well, it logged my user out Mar 24 13:55:47 is what i meant Mar 24 13:56:08 all I can say is all preferences that are written to disc are preserved Mar 24 13:56:38 stuff in memory is not of course Mar 24 13:56:52 also onPause etc is not called afaik Mar 24 13:57:06 it just kills the app with a runtimeexception when u are in Mar 24 13:58:35 with robolectric, supposedly you can test if an intent is started with shadowActivity.getNextStartedActivity(), but it seems like it's always null, even after the code starts a new intent Mar 24 13:58:46 is there a new way that I'm not aware of? Mar 24 13:59:00 dragorn: hmm I've seen debug apps in google play Mar 24 13:59:03 test on real device + junit Mar 24 13:59:05 dragorn: they work fine Mar 24 14:01:26 icedp, not recently you haven't, google filters on the debug flag in the manifest and won't allow you to post it. Mar 24 14:02:57 danijoo, turns out i had an issue with my User db table Mar 24 14:05:06 icedp, play prevents uploading apps with android:debuggable=true Mar 24 14:05:38 I asked this earlier but got no response so i try again :) Does anyone have any experience with the Beta Testing features that google provides? Mar 24 14:05:53 arkaros, a lot have Mar 24 14:05:57 just ask your question Mar 24 14:06:55 icedp, it's possible someone made a 'debug' version of their app w/ additional logging, without literally setting debuggable in the manifest, of course Mar 24 14:07:15 I dont really have a concrete question. Just want to know if there is anything specific i should keep an eye open for. What i want to do is add an app to a beta and connect it to a private google+ group. I dont have an app in production yet. Is there anything you guys have experianced that might be good for me to know? Mar 24 14:07:51 what is the difference between TAG_GPS_LONGITUDE and TAG_GPS_LONGITUDE_REF Mar 24 14:09:28 Because from the documentation that google provides it all seems really smooth. Is this your experience too? Mar 24 14:09:36 I've a WebView which is created programatically *after* onCreateView. it is inserted in a LinearLayout, but somehow the screen is no refreshed, I see the webview taking a lot of space but the text is not there Mar 24 14:09:41 what could it be? Mar 24 14:10:04 Matip, landscape or rotating phone involved? Mar 24 14:10:11 no Mar 24 14:10:13 Matip, I've had a similar bug, never figured it out yet, though Mar 24 14:10:19 hmn, weird Mar 24 14:10:46 any suggestions guys? Mar 24 14:10:57 pfn, there must be something we're missing Mar 24 14:11:06 * pfn shrugs Mar 24 14:11:23 hierarchy view suggests it's in view, but it's just not rendering for some reason Mar 24 14:11:31 haven't had the time budget to look into it further Mar 24 14:11:38 just a bug I ship with Mar 24 14:11:50 I can't afford shipping with this bug Mar 24 14:12:01 it's the main functionality Mar 24 14:12:02 :P Mar 24 14:13:38 it's weird because if I set a small text like this it is shown: webView.loadData("asd asd asd

aaaaa bbbbb", "text/html; charset=utf-8", "utf-8"); Mar 24 14:13:53 I'll increase the length and see what happens Mar 24 14:15:45 I just repeated the above text 20 times, no problem at all. weeeeeeeird Mar 24 14:17:41 maybe wrapping is a problem Mar 24 14:17:44 increase line/word length Mar 24 14:18:16 ok, length is no a problem. I repeated it like 1000 times and still works Mar 24 14:18:21 I'm checking the word length now Mar 24 14:18:54 oh wait a sec, it doesn't work with 1000x! Mar 24 14:19:02 the length could be the problem, don't know why Mar 24 14:19:39 "asd " x 8364 to be precise Mar 24 14:20:41 probably some sort of internal webview layout problem Mar 24 14:24:43 pfn, got it! Mar 24 14:25:09 I had webView.setLayerType(View.LAYER_TYPE_SOFTWARE, null) Mar 24 14:25:18 try changing this param to NONE Mar 24 14:25:32 http://stackoverflow.com/questions/15872669/android-4-long-html-in-webview Mar 24 14:25:47 this fixed my problem Mar 24 14:25:47 How important is learning Git? Should I be using it for my personal apps, or only worry about it if I start developing for someone else? Mar 24 14:26:09 I use it for my personal projects Mar 24 14:26:15 (not only apps) Mar 24 14:26:38 Github? Or do you just do everything locally? Mar 24 14:27:08 it help as a backup, as a versioning control (if I need to step back when it was woking if I broke something), and as a way to work with multiple computer on the same project (desktop @home, and laptop when I'm away) Mar 24 14:27:18 Matip, hmm, interesting Mar 24 14:27:19 liuwenhao: it is quite handy when sharing projects with buddies or resetting to a specific change Mar 24 14:27:47 liuwenhao: I don't use github, just vanilla git Mar 24 14:27:59 (unless I want to share) Mar 24 14:28:10 So when you are on your laptop, do you just connect to a server running on your home PC? I'm not really sure how it works Mar 24 14:28:29 liuwenhao, always use git Mar 24 14:28:35 git is distributed Mar 24 14:28:38 you could do it that way, but I use a dedicated server as repository Mar 24 14:28:41 so you don't need a server to run git Mar 24 14:28:46 liuwenhao you can get free repos on https://about.gitlab.com/ Mar 24 14:28:58 free private* Mar 24 14:29:07 you can sync pc to pc using a usb stick if you wanted Mar 24 14:29:08 pfn, now I have another issue anyway. I need to disable horizontal scrolling. the words are not wrapping correctly when they are looooong (like in the case of an URL) Mar 24 14:29:14 do you guise trust "free private" ? :/ Mar 24 14:29:14 clone from usb stick, push to usb stick Mar 24 14:30:05 is there any reason not to trust gitlab? I want to try it Mar 24 14:30:18 do you own a dedicated server ? Mar 24 14:30:26 No Mar 24 14:30:43 you can try it Mar 24 14:30:55 but don't push any config file, or file with passwords in it Mar 24 14:31:16 (keystore's passphrase, ...) Mar 24 14:31:21 alright, makes sense Mar 24 14:31:40 eventually I would like to have my own server but right now it's not an option (no money) Mar 24 14:32:00 you can get a shared for < 5$ Mar 24 14:32:07 I can understand that, even though, it can be very cheap (http://lowendbox.com/) Mar 24 14:32:10 don't need a server to run git Mar 24 14:32:20 orj ust use bitbucked Mar 24 14:32:27 private repos for free Mar 24 14:33:06 How can I trigger focus event on parent (LinearLayout) when a child (Edittext) is focussed? Mar 24 14:33:17 pfn: it is not needed, but it helps if you need to push or clone when you didn't expected it Mar 24 14:33:53 blusky, you can push/clone locally Mar 24 14:33:56 don't need a server Mar 24 14:33:56 liuwenhao: if you only have 1 workstation, you won't need a remote repository Mar 24 14:34:03 git clone originaldirectory/ Mar 24 14:34:05 git push Mar 24 14:34:20 pfn: so how to pull when your original repository is down ? Mar 24 14:34:30 originaldirectory can be cifs/usb/nfs/etc. Mar 24 14:34:47 why would you need to pull, the default here is disconnected operation Mar 24 14:35:02 cifs / nfs mean a server somewhere (not necessary a dedicated server on a datacenter, ok) Mar 24 14:35:06 might still be a good idea having it remote as backup Mar 24 14:35:21 anyone with this issue: getView (ArrayAdapter) being called by GridView in onPause? Mar 24 14:36:37 sure, but a "server" specifically for this purpose is unnecessary Mar 24 14:36:43 you can git clone/push into a dropbox folder Mar 24 14:36:44 if you wanted Mar 24 14:36:47 or a google drive Mar 24 14:36:48 yup Mar 24 14:36:54 I agree Mar 24 14:37:15 however I won't recommand dropbox Mar 24 14:37:18 (or gdrive) Mar 24 14:37:26 cause there is no lock mecanism Mar 24 14:37:32 and you could broke your repository Mar 24 14:37:41 if there's simulataneous push Mar 24 14:38:33 simultanous push would only occur when you have it on multiple machines Mar 24 14:38:46 and then, synced folder isnt an option anymore anyways Mar 24 14:40:42 only matters when you're working from multiple machines at one time Mar 24 14:41:01 push, sync, go to other machine and pull Mar 24 14:41:27 thats the definition of simultanous :p Mar 24 14:41:51 dropbox and friends don't work very well with large amounts of tiny files, so you might have an incomplete tree if you turn off after doing some work Mar 24 14:47:07 hey,i have a list view which contains two image views,i need to detect which row of listview clicked and which image view clicked Mar 24 14:47:26 OnItemClickListener Mar 24 14:47:35 guys, where I can put some config xml file? I mean prebuilt config (not sharedprefs) Mar 24 14:47:48 how to implement it? Mar 24 14:47:51 woozly, config for what Mar 24 14:48:17 for example: config DEBUG = true Mar 24 14:48:22 and then read it in the code Mar 24 14:48:35 Of course I can use just Config class with static fields Mar 24 14:48:38 use the onclicklistener of the listview, or turn off clickable on your row and use the onclicklistener of your imageview (after making it clickable). There's a lot of tutorials out there on either option. Unless multiple things in your row are designed to be clickable, you probably don't need to use the imageview handler. Mar 24 14:48:43 but I want some nice way Mar 24 14:48:45 BuildConfig.DEBUG is set from gradle, not xml Mar 24 14:48:55 danijoo: it is just for example Mar 24 14:49:09 woozly, res/values/any_name.xml Mar 24 14:49:22 danijoo: Okay! thank you Mar 24 14:50:37 BuildConfig is already available... Mar 24 14:50:40 why a separate config xml? Mar 24 14:51:43 danijoo: itemclick listener gives me only row position,how can i get clicked view from it ? Mar 24 14:51:54 there are two image views inside Mar 24 14:52:15 sci-fic, why not setting an onclicklistener for each view? Mar 24 14:53:05 inside adapter ? Mar 24 14:53:35 where else Mar 24 14:53:37 i have to detect which row clicked and which image view clicked Mar 24 14:53:59 i tried click listener for each img view and itemclick listener for listview Mar 24 14:54:02 i didnt work Mar 24 14:54:22 set some tag to it Mar 24 14:55:55 danijoo:http://paste.ubuntu.com/10669740/ Mar 24 14:56:47 only one listener is called on each click Mar 24 14:57:25 ok Mar 24 14:57:32 Any idea about how to make a WebView wrap all the content horizontally? I have I've been searching for a while but nothing seems to work :| Mar 24 14:58:12 it wraps the content but long links are not broken into pieces Mar 24 14:58:31 clicked view is....2131296342 and ...clicked view is....2131296341 all rows give me same id danijoo Mar 24 14:58:48 I should really try out rxjava.. Mar 24 14:58:59 to bad its so hard to integrate in running projects Mar 24 14:59:55 sci-fic, common... its not that hard. set an onclick listener to each image and add a tag indicating what position in the list this imageview belongs to Mar 24 15:00:27 than you have position by tag and part of the view by what listener is called Mar 24 15:00:29 ok :O Mar 24 15:07:13 is there a good quality "baby's first event bus" sort of tutorial for android? Mar 24 15:07:38 mrfu, read the introduction on otto bus Mar 24 15:09:11 hmmm is there a way to SQL query with dynamic grouping? Mar 24 15:09:44 such as SELECT * FROM USER u GROUP BY u.last_seen ORDER BY u.first_name Mar 24 15:09:55 I meant Mar 24 15:10:09 such as SELECT * FROM USER u GROUP BY u.last_seen < 30ORDER BY u.first_name Mar 24 15:10:15 such as SELECT * FROM USER u GROUP BY u.last_seen < 30 ORDER BY u.first_name Mar 24 15:11:07 everything thats possible with sqlite is also possible with android sqlite Mar 24 15:11:40 I mean I want to create buckets for users according to when they were seen lastly Mar 24 15:11:47 "GROUP BY u.last_seen < 30" Mar 24 15:11:51 meaning all the online users are in one bucket Mar 24 15:11:54 what does it mean ? Mar 24 15:11:55 all the idle ones after Mar 24 15:11:59 hey folks, question: Is the smart-body unlock feature yet been released into the public? Mar 24 15:12:08 and all the offline ones after that Mar 24 15:12:15 Looking for commits that could point to that Mar 24 15:12:16 but have every bucket ordered by name Mar 24 15:12:35 simar|on isn't that part of play services and not open source? Mar 24 15:12:54 memorion, oh I wasn't aware of that. I see. Mar 24 15:14:16 thepoosh: what does "GROUP BY u.last_seen < 30" mean ? Mar 24 15:14:35 don't you mean "GROUP BY u.last_seen HAVING u.last_seen < 30" ? Mar 24 15:14:58 blusky: might be, I'm missing something here I'm sure Mar 24 15:15:04 I'm trying to create buckets Mar 24 15:17:16 blusky: what I mean is that I need 3 different bucet Mar 24 15:17:19 *buckets Mar 24 15:17:32 and am not sure how to get them in one query Mar 24 15:17:43 what do you mean "3 buckets" ? Mar 24 15:17:55 do you have a sample of your DB, and an exemple of the result ? Mar 24 15:18:06 (of the query you want to build) Mar 24 15:18:24 google released a build system http://bazel.io/docs/FAQ.html Mar 24 15:20:26 memorion, interesting Mar 24 15:20:34 I thought they were working on Ninja. Mar 24 15:21:04 "Why doesn't Google use …? Gradle: Bazel configuration files are much more structured than Gradle's, letting Bazel understand exactly what each action does. This allows for more parallelism and better reproducibility." Mar 24 15:21:13 google is getting rid of Gradle? Mar 24 15:21:45 no idea Mar 24 15:22:18 example build script: https://github.com/google/bazel/blob/master/src/main/java/BUILD Mar 24 15:22:58 ugh Mar 24 15:23:02 that looks like a direct port of Gyp Mar 24 15:23:02 for the moment, it doesn't seem compatible with windows Mar 24 15:23:05 which is awful. Mar 24 15:23:14 the dependencies are interesting: "//third_party:gson", Mar 24 15:23:30 here are hackernews comments, some from googlers https://news.ycombinator.com/item?id=9256844 Mar 24 15:24:07 yeah, "googlers" wouldn't make me think of Google employees first. Mar 24 15:24:27 Besides, Google barely has any employees. It's like 99% contracters and interns. Mar 24 15:24:42 there used to be googlers here, occasionally Mar 24 15:25:05 I want to meet the person in charge of Google Play Mar 24 15:25:18 Leeds: yeah, that's the thing about "googlers", they don't last very long. Mar 24 15:25:29 now there's just CedricBeust_, who's a linkediner Mar 24 15:26:12 I'm trying to get a SearchView to give suggestions from the Google Places API, how would I adapt that API into a CursorAdapter for the SearchView's setSuggestionsAdapter() function? Mar 24 15:26:29 google docs only provide samples for using an ArrayAdapter with AutoCompleteTextView Mar 24 15:27:39 "A emphasis on automated testing and releases", but not an emphasis on grammar. Mar 24 15:28:12 liuwenhao, you can on I/O Mar 24 15:28:14 I think they're grammer good. Mar 24 15:28:19 android is on the roadmap for the beta Mar 24 15:28:23 liuwenhao, those people are usually always close to security though :/ Mar 24 15:28:48 haha, I'm just curious about a lot of the design decisions with Google Play Mar 24 15:29:55 in sqlite, is the order of an insert into statement important? e.g will this INSERT INTO newtable SELECT c1, c2 FROM oldtable; produce the same result as INSERT INTO newtable SELECT c2, c1 FROM oldtable; ? Mar 24 15:30:27 blusky: sorry, I was afk Mar 24 15:30:49 imaging a table with 2 columns Mar 24 15:30:54 name and last_seen Mar 24 15:31:02 and I have 3 categories of last seen Mar 24 15:31:17 active (between now and 30 minutes ago) Mar 24 15:31:24 idle (30 - 1 hour) Mar 24 15:31:26 and offline Mar 24 15:31:41 liuwenhao: "design decisions"? :) Mar 24 15:31:42 and I need to get them grouped by buckets and ordered by name Mar 24 15:32:32 memorion: does this mean they fixed the appcompat issue? Mar 24 15:32:51 thepoosh ? Mar 24 15:33:04 17:18 memorion: google released a build system http://bazel.io/docs/FAQ.html Mar 24 15:33:12 there was a lint issue with appcompat Mar 24 15:33:26 that sounds fun Mar 24 15:33:48 https://github.com/google/bazel/blob/master/docs/roadmap.md#beta-release-target-date-2015-06 android support planned for june and android studio support after that Mar 24 15:33:54 yes, someone in our team that upgraded had to delete the update Mar 24 15:37:32 well, i'll have to disable view reuse in the gridview because it's messing the first item when scrolling back Mar 24 15:40:53 Any recommendations or a free or priced sdk for Android (and possibly iOS) that lets you create Pano Tours Mar 24 15:41:15 android sdk maybe ^^ Mar 24 15:41:34 pano tours? Mar 24 15:41:47 you mean image sphere? Mar 24 15:42:00 photosphere maybe? Mar 24 15:42:14 yeah that’s waht I meant Mar 24 15:42:32 photosphere is on the N6, and S5 Mar 24 15:42:52 https://www.google.com/maps/about/contribute/photosphere/ Mar 24 15:47:23 does photo sphere return data to the calling app without storing it? Mar 24 15:47:27 if you know Mar 24 15:49:07 I haven’t played around with it but I would imagine that you would have to store it to disk to process the imaga/stitch it together Mar 24 15:49:20 or it does that automatically and procides you with an image to store yourself Mar 24 15:49:33 chekc the API i guess Mar 24 15:50:43 ok will do. Most require you to upload and get a stitched image back Mar 24 15:52:39 My application needs to authorize itself to a webservice at the start. This authorization will be used through everywhere. Where is the best place to put that code? Main Activity's onCreate? or somewhere on an extended Application class? Mar 24 15:53:04 maybe you want a login button to do that Mar 24 15:53:13 or a spash screen Mar 24 15:54:11 there is a separate login logic, this is just to auth for the api I am using, which you keep using for login stuff as well. Mar 24 15:57:00 I'll go with main activity now, and keep it somewhere I guess. Mar 24 16:12:34 i hope someone can help me...im trying to build ubuntu touch on top of cm sources. But when i run make i get errors in hardware/qcom/display/msm8960/libcopybit about missing header files...where do i have to specify them? Mar 24 16:14:18 Isotop7, I'd maybe try ask in #android-root Mar 24 16:14:41 quinnjn: okay thanks :) Mar 24 16:30:14 Hey guys. I want to make sure my receiving of data from the sensors does not block the main thread. Should I create a separate thread and register a SensorEventListener in there or should I register the SensorEventListener in the main thread and spawn a new thread whenever onSensorChanged is called? Mar 24 16:32:56 i would say the first one btu I’m curious to know what others say Mar 24 16:33:19 you’ll obviously have to watch out for concurency Mar 24 16:33:43 Yep, first one sounds better. I think that spawning a new thread will do multiple system calls which can slow things down Mar 24 16:34:00 Hmm, didn't consider concurency, thanks for mentioning int Mar 24 16:34:01 it* Mar 24 16:34:55 my concern would be that your onSensorChanged gets called so much you’ll be in thread hell Mar 24 16:35:34 the first way you have one thread handling all your sensor changed evenrs Mar 24 16:36:06 depending on what your thread is doing, you could jsut handle it all there.. in 1 thread Mar 24 16:36:13 alright, then I'll do it the first way Mar 24 16:37:32 That's assuming it matters from what thread you register the listener.. Mar 24 16:38:15 Which it probably doesn't Mar 24 16:58:55 If you are using Rx, you could debounce() these events. If not, you can debounce manually. Mar 24 17:03:41 CedricBeust_: you alive? Mar 24 17:04:11 CedricBeust_: in your article on rx java, in your user observable creation of the user, is that constructor correct? (id id) ? Mar 24 17:04:25 *not that really matters Mar 24 17:06:59 Thanks for the article, there really aren't countless rx intro android articles ;p Mar 24 17:18:21 anyone have a good Rx pipeline that implements caching: reading should return cached result if available, if not perform network call and cache. i was going to use Observable.amb() but seems like i'd wind up making the network call even on cache hit Mar 24 17:19:00 Yeah amb() will call both Mar 24 17:19:08 hmm maybe this will work http://stackoverflow.com/questions/27229709/rxjava-network-requests-and-caching Mar 24 17:19:51 Guava’s LoadingCache does this, should be trivial to add Rx on top of it Mar 24 17:20:01 thanks jaana Mar 24 17:20:28 in my case the request is bluetooth read ;) but should be mostly same Mar 24 17:21:31 is there a ROM/build centric android channel? I had a question related to the build process in AOSP. Mar 24 17:22:21 simar|on, maybe #android-root Mar 24 17:22:49 thanks quinnjn will try that Mar 24 17:39:43 hey guys. i've some doubts about android and the MVP pattern. I need the "presenter" to handle, among other stuff, sensor data, that the "view" layer (fragments) will display. I'm also pretty much concerned with power consumption (wearables), so I need the different presenters to be "active" only when the associated fragments are visible (i don't want to get GPS data and push it to a fragment that's not even visible). What do you think is the best wa Mar 24 17:39:43 y to achieve this? Does it make sense to use a Service as a presenter, and bind it to the relative fragment so that it gets destroyed when not needed? Mar 24 17:46:12 hey guys, has anyone here used cardboard? have everything working using custom rendering.. but i'm having a basic problem - the settings button (gear icon) isn't tappable Mar 24 17:46:59 I do have an onTouchEvent in my CardboardView Mar 24 17:48:16 so that's definitely it - the onTouchEvent is blocking it Mar 24 17:49:20 jacres: I saw something similar with GLSurfaceView. Never really solved it, I assumed it’s because of how it’s implemented (punching a hole through your view and putting a background on it, or something like that) Mar 24 17:53:21 jaana: hmm, that's too bad... If I comment out onTouch, so I'm not overriding the function, I'm fine.. maybe a super.onTouch()? Mar 24 17:53:38 err onTouchEvent Mar 24 17:56:06 yeah that worked.. calling super.onTouchEvent( ev ) to forward it on first.. and checking return value, returning true if needed, otherwise cascade down Mar 24 17:56:54 is it possible for .xml files in assets to reference say a color from either java or colors.xml? Mar 24 17:58:11 I'm using a system development kit, the Intrinsyc Open-Q 8084, and the update to lollipop has removed my ability to read and write to the SD card from my apps. Trying to figure out if some permissions changed from 4.4 to 5.0 Mar 24 17:58:35 previously I was able to directly read/write to /storage/sdcard1 from my apps (non-root) Mar 24 17:59:34 Hi Mar 24 18:06:57 Question: when I run "emulator-x86 -avd Nexus_5 -qemu -m 2047 -enable-kvm" Mar 24 18:07:28 I get "SDL init failure, reason is: No available video device" Mar 24 18:07:33 Any ideas? Mar 24 18:07:35 i guess i got a memory leaking reference to MainActivity with this: http://pastebin.com/yLW9LQVN even without clicking on the imageButton. if i outcomment all of it, i dont have it. Can anyone see why this could happen? Mar 24 18:08:46 No, there's no memory leak there Mar 24 18:10:03 hmmmm Mar 24 18:10:51 For a survey taking application we are currently storing everything in flat files. what are your thoughts on flat files vs Sqlite? Mar 24 18:12:07 SimonVT: if i make a dump after i restart my app, open MAT, open histogram, search for "com.package.name.MainActivity" and it shows to rows with MainActivity. that does mean there is one MainActivity leaking. doesnt it? Mar 24 18:12:45 also any thoughts on sqlite vs couchbase for Android Mar 24 18:13:59 android_sandwich: depends on how many foreign keys you would need Mar 24 18:14:48 android_sandwich look into realm Mar 24 18:14:56 Mavrik: hey man are you there? Mar 24 18:17:16 realm sounds interesting. Though not sure if I can use it for our Enterprise app. due to it's infancy Mar 24 18:18:09 it could suffer from sudden infant death syndrome Mar 24 18:18:11 Flat files sounds simpler, if you don't need what a database offers Mar 24 18:19:05 adkins: Maybe, you'll have to find gc roots Mar 24 18:20:00 Yes, your click listener has a reference to the Activity. The listener is being referenced by the imageview, which is being reference by the Activity. That's a circular reference, but nothing that will keep the Activity from being gc'd Mar 24 18:20:46 Question: I'm getting a blank screen when I load an AVD. I check the system monitor, the emulator is using less than 1% CPU. Any known reason why this may be happenning? Mar 24 18:21:36 SimonVT: ok thank you. if i do gc roots thats the first reference (the listener) Mar 24 18:22:42 hey Mar 24 18:29:30 how is it going gdrc Mar 24 18:30:24 heh gapps are so buggy; both gmail & play on occasion just show a blank whit screen when i press back Mar 24 18:30:34 g00s: I need to ask you something Mar 24 18:30:48 sure Mar 24 18:33:59 g00s: ! Mar 24 18:34:08 hey thepoosh ! Mar 24 18:34:14 im dead man Mar 24 18:34:17 if i have locked the orientation of an activity, is there a way to by notified in the user rotates the device? Mar 24 18:34:24 thepoosh you seem alive to me :) Mar 24 18:34:40 it'll pass Mar 24 18:34:42 thepoosh: outsource! Mar 24 18:34:59 lasserix: you can try gyroscope Mar 24 18:35:14 lasserix: we have already outsourced one guy Mar 24 18:35:21 some GDG Mar 24 18:35:28 or is it GDC Mar 24 18:35:42 don't remember the anagram Mar 24 18:38:23 shouldn't be safe to do a ArrayAdapter.clear (attached to a spinner)? i'm getting concurrentmodificationException. Mar 24 18:39:13 lasserix: http://stackoverflow.com/a/27617038/1056359 Mar 24 18:39:19 gdrc: Currently when I run """emulator-x86 -avd Nexus_5 -qemu -m 2047 -enable-kvm""" Mar 24 18:39:28 is there a particular reason why we can't rotate home screen by default? Mar 24 18:39:37 bitkiller: are you removing from the array? Mar 24 18:39:43 logcat? Mar 24 18:39:56 gdrc: I get """mulator: ERROR: Could not load OpenGLES emulation library: libOpenglRender.so: cannot open shared object file: No such file or directory Mar 24 18:39:57 """ Mar 24 18:40:19 o_O Mar 24 18:40:25 Hello all, anyone have any recommended resources on doing android game development? I already know Java, just never made a game before (my day job is a full stack software engineer). Mar 24 18:40:47 rexbutler: that's why I hate linux Mar 24 18:41:00 rexbutler: what about genymotion? Mar 24 18:41:01 puddy: looking to do opengl? Mar 24 18:41:07 puddy, you should probably use Unreal/Unity/Corona Mar 24 18:41:21 So much fun, have a video view in a view pager in an activity that needs to be able to control immersive visibility on rotation. argh Mar 24 18:41:26 groxx: uhhh maybe? i dont want to do anything too graphically crazy to be honest Mar 24 18:41:44 video view in a custom view in a scrollview in a view pager in an activity Mar 24 18:41:49 puddy: just checking :) Mavrik's sound good to me too, probably start off with a fairly rich stack. Mar 24 18:41:58 puddy: unless you want to make specifically for android, groxx has a point Mar 24 18:41:59 you can't even stop a view pager from paging! Mar 24 18:42:03 gdrc: OK I'll try genymotion Mar 24 18:42:08 I mean, most 3D stuff someone already wrote and tested against all possible fails of mobile GPUs Mar 24 18:42:12 (and there's ALOT of them) Mar 24 18:42:20 tbh i'm more interested in 2D Mar 24 18:42:20 rexbutler: or try with -gpu off Mar 24 18:42:23 iOS/Desktop/Xbox/PS compatibility is just a great bonus :) Mar 24 18:42:32 puddy if you want more control than those look at libgdx Mar 24 18:43:04 hm. anyone know how far you can get with just drawing to a canvas / surfaceview? maybe something relatively bare-bones would be a fun place to start... Mar 24 18:43:08 thepoosh: thanks Mar 24 18:43:24 groxx you can get as far as you want Mar 24 18:43:27 groxx, very far Mar 24 18:43:31 everything opengl does you can do Mar 24 18:43:32 i wasa always good with SO Mar 24 18:43:38 rendering on SurfaceView is very fast lately Mar 24 18:43:46 you just have to implement like breshen line finding, and matrix projections and all that Mar 24 18:43:52 well yeah, you _can_ do anything. I mean more of "is it reasonable". sounds like yeah. Mar 24 18:44:19 groxx: using matricies in opengl is the same as using matrices with a surfaceview Mar 24 18:44:21 i haven't done computer graphics since college, which was at least 4 years ago Mar 24 18:44:23 ultimatly its just the same math Mar 24 18:44:24 there's also libGDX which is a neat lib of gaming development stuff Mar 24 18:44:31 also portable :) Mar 24 18:44:35 thepoosh, this is what i'm doing: http://pastie.org/10050639 Mar 24 18:44:50 puddy: i think you'll have the most fun with libgdx since it's not a complete wrapper like unity corona Mar 24 18:44:58 lasserix: but is it stupidly slower / abandon hope, build a 2D openGL thing instead? Mar 24 18:45:05 bitkiller: where is the onStart and onCreate? Mar 24 18:45:17 groxx for 2d i think it is probably the same Mar 24 18:45:19 groxx, that's the catch, it IS 2d OpenGL :P Mar 24 18:45:20 lasserix: very interesting.. lots of options out there it seems, pretty cool Mar 24 18:45:38 puddy the author also wrote a book you can take a look at Mar 24 18:45:49 Mavrik: well, plus a translation layer, of I-dunno-how-deep :) Mar 24 18:45:57 thepoosh, it's working fine if i remove that statement. onCreate is creating the adapter with the initial values Mar 24 18:45:58 not deep at all Mar 24 18:45:59 beginning game development where he references that library but gives you the low down on all the basics (independent of the library) Mar 24 18:46:07 never tried to do high performance drawing, never had to look deeply into it. Mar 24 18:46:28 groxx the real difference is if you wanted to say implement shaders Mar 24 18:46:33 bitkiller: someone is adding information while you are trying to remove everything Mar 24 18:46:39 then you are definatly better of using opengl Mar 24 18:47:06 that reminds me - how well does renderscript work? Mar 24 18:47:11 otherwise as long as your surfaceview is hw accelerated then.. Mar 24 18:47:30 groxx, well enough, it's just painful to use Mar 24 18:47:36 and runs on CPU pretty much everywhere Mar 24 18:47:42 :( Mar 24 18:47:50 so you're usually better off just writing portable C/C++ Mar 24 18:48:16 lasserix: what's the book called? Mar 24 18:48:38 groxx, honestly I wish they'd give us more renderscript intrisics Mar 24 18:49:37 Mavrik: good to know Mar 24 18:49:59 I've just never really run into anyone who has used it Mar 24 18:50:22 that was mostly because integrating the compatibility library was utterly painful and didn't work with Gradle Mar 24 18:50:29 but I've seen alot of Google apps use it Mar 24 18:53:07 are there any good renderscript books ? Mar 24 18:53:46 hmm, doubt it, it's a really small API Mar 24 18:54:04 but any good book ok OpenCL / SIMD algorithms would be very useful Mar 24 18:56:53 and a C99 book too ;) Mar 24 19:02:11 Can anyone point me to an Android port of this? http://cocoamine.net/blog/2015/03/20/replacing-photoshop-with-nsstring/ Mar 24 19:02:22 C99 is required knowledge anyway :) Mar 24 19:03:23 puddy: http://www.amazon.com/Beginning-Android-Games-Mario-Zechner/dp/1430246774 Mar 24 19:03:31 you might check it out at a bookstore before buying it Mar 24 19:03:40 aye, that's what i plan to do Mar 24 19:03:48 its a few years old but most of the info is as current as its going to be Mar 24 19:04:25 Boom. Does anyone know if you HAVE to have Google Play services to register for GCM? Mar 24 19:04:38 Or if you can still have cloud messaging w/o the Play Services connection/ Mar 24 19:04:39 *? Mar 24 19:04:53 puddy here's the code if you can just work with that: https://code.google.com/p/beginning-android-games/ Mar 24 19:05:00 better grab it before google code comes a'tumblin down Mar 24 19:05:11 hwrdprkns, of course you have to, GCM handling is implemented in play services library Mar 24 19:05:22 I'm trying to disable the animation when hiding soft input, any idea? Mar 24 19:05:38 lasserix: ew, it's on svn and using eclipse :( but good enough anyway. thanks a bunch Mar 24 19:05:40 santywang7: the animation of the keyboard coming up? Mar 24 19:05:46 Mavrik: Cool, danke Mar 24 19:05:52 puddy: hehe like i said 2013 Mar 24 19:06:06 funny how things change so fast Mar 24 19:06:17 lasserix: the keyboard going down Mar 24 19:06:49 santywang7 https://github.com/johnybot/TestingKeyboard Mar 24 19:08:31 this is nice, I want to make system keyboard dismiss without any animation, is there anyway to do that? Mar 24 19:09:22 not sure, but if there were this probably wouldn't exist Mar 24 19:10:38 santywang7: doesn't seem possible Mar 24 19:10:45 santywang7: you can pour thru grep code Mar 24 19:10:52 maybe there is something in there Mar 24 19:12:02 I'll try that, thanks! Mar 24 19:21:03 uhh i switched my intent filter main / default to a dummy text / debug activity and now my app persists in launching to theprevious activity wtf is this Mar 24 19:22:07 not enough coffee Mar 24 19:25:51 I'm trying out Glide Mar 24 19:26:04 Glide library or app ? Mar 24 19:26:09 library Mar 24 19:26:35 thepoosh, found the solution. The problem was that the adapter was being filled with arraylist.subList, but subList method returns AbstractList. Creating new ArrayList using the subList return solves the problem Mar 24 19:26:44 faster, sure. but the quality of the image has like those little edges on it that appear with big images and disappear when you zoom in Mar 24 19:26:48 well they're not disappearing Mar 24 19:26:55 cool Mar 24 19:27:53 Odaym are you using argb_8888 ? Mar 24 19:28:27 sounds like it defaults to rgb565 Mar 24 19:28:30 no just replaced Picasso. with Glide. Mar 24 19:28:33 just to see Mar 24 19:28:47 Odaym ah then you should see this for some differences http://inthecheesefactory.com/blog/get-to-know-glide-recommended-by-google/en Mar 24 19:29:00 thepoosh, in fact, looking at the source code, subList returns SubAbstractList Mar 24 19:29:06 yea that's the post I read to find out about Glide Mar 24 19:29:52 i haven't used either. my app is unusual in that it doesn't use http or image loading :D Mar 24 19:30:09 mine's all about images Mar 24 19:30:14 which is 90% horsecrap for many apps Mar 24 19:32:54 your app is about horsecrap? Mar 24 19:33:04 link Mar 24 19:34:18 hay burning apps :) Mar 24 19:34:48 dont think anyone will get that unless they have horses Mar 24 19:34:57 WHy does Configuration not have REVERSE landscape/portrait Mar 24 19:35:28 tl;dr, glide supports gifs Mar 24 19:35:30 Use if you need that Mar 24 19:37:42 is it ok to start an activity with FLAG_ACTIVITY_NEW_TASK? Mar 24 19:38:05 I'm doing context.startActivity where context is the application context (not the activity context) Mar 24 19:38:19 I am not impressed honestly Mar 24 19:38:22 so the only way I found to make it was adding the flag FLAG_ACTIVITY_NEW_TASK Mar 24 19:38:56 I really like the callbacks and I don't see where you can have callbacks Mar 24 19:39:04 Hello, I am writing a custom camera activity and was interested to know how to crop the photo. My plan is to put the photo in a square in the middle of the screen so the idea is also to crop the photo within the boundaries of this square. Problem is that when I am using the size of the square, which is actually an ImageView, it turns out that its bigger than the original photo and ends up with an error that x+width must be <= original.width.   Mar 24 19:39:04 I was curious to know what am I doing wrong so that the original photo is smaller than the ImageView and how can I fix it? Mar 24 19:39:09 maybe I missed it Mar 24 19:40:50 plus it has something strange that when you load an image using Glide and say .error(error_image), it considers not receiving an image path to be an error Mar 24 19:41:11 it doesn't recognize an error as an official failure to load an image given its path Mar 24 19:41:30 this is in the adapter, where some items have images and some dont Mar 24 19:42:21 so you get the items who dont have an image all loaded with error images Mar 24 19:45:39 well that's all I had, later Mar 24 19:45:57 How can I use gradle w/ a custom Android.mk file for JNI? Mar 24 19:47:22 larzconwell look at the second answer http://stackoverflow.com/questions/21096819/jni-and-gradle-in-android-studio Mar 24 19:53:16 memorion: That doesn't seem to work, I've modified the Android.mk to fail but the build doesn't fail. Mar 24 19:53:32 seriousily f-ing andorid can't even know wheteher you are landscape or reverse landscape Mar 24 19:54:58 larzconwell http://www.gradle.org/docs/current/javadoc/org/gradle/api/tasks/TaskExecutionException.html not sure how to use that though Mar 24 19:55:07 I am using cardView (CardUI), and i have about 40 of them with the same layout just diff. text. Is there a way to create a layout once and just re-use it multiple times. I don't want to spend the rest of my day copy/paste-ing it and editing two textViews. Mar 24 19:55:47 Hi, what I want to do is to save data in database and move an Image associated with that data. Is convenient to create DAOs to do that work? I mean... a fotograph of a dog, with born date, name, etc and in the DAO object only have a "save( image, date, name )" method that do the save data and move image to a selected folder??? there is nothing already made for Android? ) Mar 24 19:56:19 nightwalkerkg: listview Mar 24 19:56:24 *or recycler view Mar 24 19:56:54 Hmmm, i did want to mess with recycler view. Mar 24 19:57:01 I guess i'll have a go. Mar 24 19:57:01 then use listview Mar 24 19:57:27 memorion: Oh whoops I read the wrong answer, trying the second one now; will let you know Mar 24 20:04:10 memorion: YES thank you! I've been trying to figure this out for so long. Mar 24 20:04:40 larzconwell happy to help :) Mar 24 20:06:33 Heyo Mar 24 20:07:55 anyone here uses android-studio, I reacently switched from eclipse with android-sdk and noticed a few changes that I'd like to figure out Mar 24 20:08:39 is this history in MAT: http://postimg.org/image/osisigwfr/ a proof for a leaking reference to MainActivity? Mar 24 20:12:18 How am I supposed to get the LatLngBounds needed for the Google Places API, I can get the devices location, but that is just one LatLng pair Mar 24 20:12:55 adkins: could be. right click it, "find shortest path to gc root", see what's holding on to it. Mar 24 20:14:04 Maybe this will be a better question: How can I relate between the actually photo size from the camera to the size of an ImageView on the phone? Mar 24 20:14:41 groxx: would you do right click and "MERGE shortest path to gc roots" on both of them directly? Mar 24 20:15:03 adkins: that might be it. I'm firing up MAT to see what the correct terms are at the moment :| Mar 24 20:15:27 groxx: thank you a lot Mar 24 20:16:14 groxx: i read in the web i should list all incomming references first and then do "path to gc roots" Mar 24 20:16:52 well i am just confused and dont know what i should really do Mar 24 20:16:54 ;) Mar 24 20:16:57 hmm so Display.rotation is absolute Mar 24 20:19:43 and MAT is crashing like mad. updating it :( Mar 24 20:20:25 how do you create a jar project in AS? Mar 24 20:21:19 groxx: i`m asking if this is a proof because of the second answer here: http://stackoverflow.com/questions/10633696/using-mat-in-eclipse-and-resolving-memory-leaks . He says "Objects should be one" . So i wonder if i shouldn have these two rows with MainActivity Mar 24 20:26:16 adkins: tbh I'm not sure. I never use the histogram :| Mar 24 20:27:01 groxx: what would you do to find out if there is a leak? Mar 24 20:27:04 adkins: it looks like that's showing you the _class_ instance, not instances of the class...? I'm not finding anything useful for my app, for instance. Mar 24 20:27:09 adkins: personally, I open the dominator tree Mar 24 20:27:24 search in there, find the instance(s), right click, "paths to gc roots -> exclude all weak/etc" Mar 24 20:28:07 that'll show you everything that's preventing your class from being garbage collected, and how much memory the instances use / implicitly retain Mar 24 20:28:50 the shortest path can sometimes be useful, but not always, and it hides other causes :| Mar 24 20:29:53 groxx: i opened the dominator tree, searched for my MainActivity and now having 14 Lines including this class. How do i know which one shouldnt be there= Mar 24 20:29:54 ? Mar 24 20:30:07 adkins: ah. I think I follow the screenshot now. the class is the static space used by the class, the "MainActivity$2" is an anonymous class in your main activity. Mar 24 20:31:02 adkins: you have 14 "com.whatever.MainActivity" lines? probably means you're leaking 13 of them. pick any. Mar 24 20:31:23 groxx: i restarted the app many times!! Mar 24 20:31:50 MainActivity$2 Mar 24 20:31:54 http://postimg.org/image/51bd3mdlr/ Mar 24 20:33:22 http://pastebin.com/yLW9LQVN Mar 24 20:34:10 adkins: pick one of the not-$2 things. those are anonymous classes in your main activity, not the main activity itself Mar 24 20:34:59 the $2 is a generated name-suffix because you didn't give it a name Mar 24 20:35:03 groxx: $2 means anonymous class? Mar 24 20:35:16 thank YOUUU Mar 24 20:35:17 ;) Mar 24 20:36:40 i thought these 2 would be the issue and wondered why they are gone if i outcomment that listener ;) Mar 24 20:37:00 _generally_ "ClassName$SomeSuffix$Whatever" is used for generated classes. in this case they seem to be the onClickListener, because saying "new SomeInterface() { }" makes a one-time-use class + instance. Mar 24 20:38:11 or, probably the compiler generates an inner class for you. I don't know exactly how it's represented, but yeah, that's how they're usually named. Mar 24 20:39:39 do these show up in dominator tree like "java.lang.string @0x8723587425.......com.example....MainActivity? Mar 24 20:40:22 because thats 6 of these 14 lines Mar 24 20:40:30 adkins: that's a string that has "MainActivity" somewhere in it Mar 24 20:40:34 there will be a lot of those Mar 24 20:41:19 14=6 start with packaName directly, 6 with these strings, 2 are system classes Mar 24 20:42:01 since you said i should forget the ones with $2 in histogramm, i thought i can forget one of the sixers in histogram too ? Mar 24 20:42:19 since you said i should forget the ones with $2 in histogramm, i thought i can forget one of the sixers in dominator tree too ? Mar 24 20:42:53 not sure what the "sixers" are. are there 6 "com.whatever.MainActivity" lines, no suffixes? Mar 24 20:43:24 I mean, there will probably be "com.whatever.MainActivity @ 0x7329287" or something. if there are 6 of those, they're 6 different instances Mar 24 20:44:49 yes and then i have 6 more starting with "java.lang.string @ 0x7329287 com.whatever.MainActivity ...." Mar 24 20:45:18 shall i gc root all 12 or just on of these six-packs ;) Mar 24 20:45:47 just pick one of the com.whatever.MainActivity :) and the other one you mentioned is a java.lang.string, so ignore those Mar 24 20:47:03 re: naming - Blah$1 for annoymous inner classes, Blah$MyInnerBlah for named inner classes, btw Mar 24 20:47:48 groxx: ok gc root on the first one shows me the references to the currently running activity......afaik -> ignoring Mar 24 20:48:16 adkins: yeah, one should be valid :) Mar 24 20:48:34 I have some code in my modules jni directory that depends on code outside of the application, how can I include it's Android.mk and Application.mk to build it's modules? Mar 24 20:48:46 four of these have a reference to a AppWidgetHost....... Mar 24 20:48:48 adkins: it looks like https://www.youtube.com/watch?v=_CruQY55HOk covers this reasonably well btw. at about half way through they start using the dominator tree, though the whole thing is likely useful Mar 24 20:49:43 groxx: should i destroy/release an AppWidgetHost in onDestroy? do you know that too? ;) Mar 24 20:51:01 adkins: dunno. does something keep the appwidgethost instance around? if there's no GC root (like a static variable, or a thread) pointing to it, it'll eventually get cleaned up. Mar 24 20:52:17 groxx: how do i know if something keepts them around? Mar 24 20:53:57 groxx: i restarted my app 6 times in a very short time. And all of these 4 are referenced to th AppWidgetHost. should i check the AppWidgetHost for something else in MAT? Mar 24 20:54:02 adkins: path to gc roots shows everything that refers to the instance Mar 24 20:55:11 adkins: if you're in the path to gc roots view, expand the appwidget host. it'll show things that are holding it. Mar 24 20:55:33 groxx: yes, hang on please. making a screenshot Mar 24 20:58:24 groxx: http://postimg.org/image/vwom46djp/ Mar 24 21:01:45 adkins: so two of those are implicit captures from anonymous classes. might not be them. what's in the audio manager? Mar 24 21:02:11 you can also right click any of those and get their paths to gc roots - not sure what it shows by default, but there can be more than it reveals apparently :| Mar 24 21:04:25 groxx: "so two of those are implicit captures from anonymous classes." because of the $0 ? Mar 24 21:04:34 yep Mar 24 21:04:39 hey guys, anyone here experienced with google cardboard? Mar 24 21:05:52 groxx: what does "implicit captures from anonymous classes" mean? Mar 24 21:05:56 adkins: they're callbacks that have captured the activity. so the AppWidgetHost instance has a callback that's pointing to your activity. something might be holding on to the AppWidgetHost instance(s), but that's where your chain ends there. Mar 24 21:06:27 adkins: it's like the click listener. because it's declared inline, it implicitly refers to everything it can "see", which includes your activity. Mar 24 21:07:09 adkins: basically, any non-static inner class will keep a reference to the "containing" instance Mar 24 21:08:16 would they be fine if nothing references them? Mar 24 21:10:20 if i do a gc roots on the audio manager i can see a reference to the appWidgetHost Mar 24 21:11:28 or rather to mContext, which points to MyAppWidgetHost and also a mContext which references the VoiceHandler Mar 24 21:20:14 I'm running into the an error when I run my app: "javalaunchhelper is implemented in both jdk1.7.0_75/bin/java and jdk1.7.0_75/bin/instrument.dylib. One of the two will be used. Which on is undefined." Does this have to do with my Java version? I didn't have this issue until I added Facebook SDK Mar 24 21:23:50 are all phones natural orientation portrait? Mar 24 21:24:43 g00s: in case you haven't seen it: http://beust.com/weblog/2015/03/23/android-rx-and-kotlin-a-case-study/ Mar 24 21:24:49 Can anyone provide a lead on how to implement SSL pinning on Android? Mar 24 21:24:57 bankai_ thanks ! Mar 24 21:25:22 espresso machine arrived in the office oh man Mar 24 21:25:44 I just found out NumberPicker can be used to pick strings. Wat. Mar 24 21:26:22 Got disconnected. Does anyone know what could cause the "JavaLaunchHelper" error? Mar 24 21:26:32 I'm kinda lost Mar 24 21:26:37 Any help would be appreciated Mar 24 21:28:05 Anyone have similar thing: so I have a videoview that needs to fullscreen: that is, when the user presses fullscreen or rotates the phone (into landscape, can't assume tho) the layout needs to change to make the videoview fullscreen. The problem I'm having is best way to determine fullscreen or not Mar 24 21:28:23 Otherwise, the activity is locked into portrait (or technically, natural orientation) Mar 24 21:28:51 Here is my JavaLaunchHelper error: http://pastebin.com/5q8GkgWL. This happens on run. Mar 24 21:30:13 Swanros if you use okhttp https://github.com/square/okhttp/blob/83090befcca69b44c257b96afb519ca66282ca63/okhttp/src/main/java/com/squareup/okhttp/CertificatePinner.java#L43 Mar 24 21:30:19 lasserix, you can override onConfigurationChanged to check if device changed to fullscreen Mar 24 21:31:28 when you guys say full screen, do you mean landscape? Mar 24 21:31:45 right now yes Mar 24 21:31:53 problem is how to distinguish between 0 90 1802 70 Mar 24 21:32:54 memorion: I'm working on an app where they did not use any library, they build everything from scratch Mar 24 21:32:55 why that? Mar 24 21:33:01 i dont think this is possible Mar 24 21:33:02 ... Mar 24 21:33:06 at least I dont kow how Mar 24 21:33:10 its gotta be possible to determine rotation Mar 24 21:33:21 yeah but it is a pain in the ass Mar 24 21:33:23 literally Mar 24 21:33:31 like you think you should be able to do getOrientation Mar 24 21:33:33 but no Mar 24 21:33:36 huh? its actually a oneliner Mar 24 21:33:39 you have to combine orientation and rotation Mar 24 21:33:52 danijoo_: no its not, not if you are concerned about distinguishing between REVERSE and not Mar 24 21:33:58 (ie REVERLANDSCAPE and LANDSCAPE) Mar 24 21:34:00 Swanros sorry can't help you then Mar 24 21:34:01 yeah than its not :) Mar 24 21:34:07 but why do you need that anyways Mar 24 21:34:14 so i have activity Mar 24 21:34:19 locked into natural orientation Mar 24 21:34:27 :/ Mar 24 21:34:29 why is it locked? Mar 24 21:34:31 Thanks Mar 24 21:34:32 if user plays a video, the video needs to expand to fullscreen such that the screen is w > h Mar 24 21:34:40 thats just the spec of how it is Mar 24 21:34:42 not my choice Mar 24 21:34:54 you dont need to know the orientation for that Mar 24 21:35:01 important fact is the video, if playing, needs to be able to goto fullscreen (ie match parent for w/h with w > h) Mar 24 21:35:07 but i need it to get back Mar 24 21:35:07 just add a layout-land file where its fullscreen Mar 24 21:35:11 no Mar 24 21:35:19 that interrupts the video playback Mar 24 21:35:21 can't do that Mar 24 21:35:36 then handle the config change manually Mar 24 21:35:45 does onConfigChange get called if the phone is locked in a orientation? I would say no cause you're locked in that orientation Mar 24 21:35:50 no Mar 24 21:35:52 it doesn't Mar 24 21:36:15 yeah, you're gonna have to go talk to who gave you that spec Mar 24 21:36:17 just add some flags resume the video immediatly Mar 24 21:36:30 and store the position at what you want to resume Mar 24 21:36:31 danijoo_: that's not how it works, because it has to buffer Mar 24 21:36:34 imo, allow rotation, get orientation for free. Mar 24 21:36:46 quinnjn: sure, but what if user goes 180 Mar 24 21:37:06 the whole point is that when video is not playing you are locked @ 0 Mar 24 21:37:27 didnt work much with videoview yet Mar 24 21:37:37 you cant buffer between orientation change? Mar 24 21:37:48 I did some work with videoview, pretty sure i kept the buffer during an orientation change Mar 24 21:37:56 checking Mar 24 21:38:08 if you override onconfi and prevent it from being destroyed Mar 24 21:38:13 that's not the problem Mar 24 21:38:46 yeah. seems like that is what the guys on SO are suggestiing Mar 24 21:39:33 what about locking orientation and just do orientation change on button clikc (full screen button) Mar 24 21:39:38 then you have everything under control Mar 24 21:39:54 or must it react to screen orientation by definition? Mar 24 21:40:06 danijoo_: yeah i wish Mar 24 21:40:11 no user can rotate screen and goto fullscreen Mar 24 21:40:37 problem is if you free orientation and have fullscreen button then what happens if you fullscreen button? Mar 24 21:40:42 does the screen goto and then come back? Mar 24 21:41:10 mh I think for this, free orientation really isnt an option Mar 24 21:41:12 like u said Mar 24 21:41:28 mostly because there seems to be no way to keep buffer across that Mar 24 21:41:46 what about a fragment? Mar 24 21:42:06 can you set fragment to not redraw on orientation change and make it free in actiivity Mar 24 21:42:10 so it just gets reattached Mar 24 21:42:15 that would preserve the buffer Mar 24 21:42:26 no Mar 24 21:42:30 Does anyone run Android Studio with JDK 8? Mar 24 21:42:35 this videoview, to complicate things, is like 10 layers deep Mar 24 21:42:45 codepete yes Mar 24 21:42:54 inside view pager inside scroll view inside refresh layout inside custom view Mar 24 21:43:09 memorion: I'm wondering if my JavaLaunchHelper error will be fixed if I up it to 8 Mar 24 21:43:11 codepete, I experienced AS to be much slower with java 8 compared to java 7 Mar 24 21:43:30 autosuggestions etc Mar 24 21:43:38 codepete: not really, designed for 1.7. Java8 _should_ support 1.7 but YMMV. Mar 24 21:43:44 also this is for sure not a j7 problem Mar 24 21:43:45 lmk how that works for you Mar 24 21:43:48 so i cannot auto rotate with fullscreen button Mar 24 21:43:50 awesome! Mar 24 21:43:55 awesome to the max Mar 24 21:44:03 codepete: and actually, 1.7 is really for kitkat and up Mar 24 21:44:13 lasserix, you would have to lock after fullscreen button then / Mar 24 21:44:26 danijoo_: but then how does user rotate back? Mar 24 21:44:27 Ah so running Java 8 wont fix this: http://pastebin.com/5q8GkgWL Mar 24 21:44:37 thats the problem ^^; Mar 24 21:44:40 mkjgore you're confusing the jdk android studio uses to run and the version it uses to compile Mar 24 21:44:41 no it wont Mar 24 21:44:58 codepete, OutOfMemory.. Mar 24 21:45:14 lasserix, checked my code. Gave up on keeping the buffer during rotation :) Kept the position on rotate and seek to it on resume. Mar 24 21:45:16 have you tried the usual stuff? turning it on and off again, rebuild, invalidate AS cache Mar 24 21:45:17 danijoo_: if you are in portrait and press fullscreen then you have to request layout but the user needs to be able to rotate so it cancels out and you're back in portrait Mar 24 21:45:17 danijoo_: ohhh this is a memory issue Mar 24 21:45:25 quinnjn: its a stream Mar 24 21:45:57 danijoo_: well crap. What are the solutions for this? Mar 24 21:46:10 did you try the 3 things i said? Mar 24 21:46:18 invalidate AS cache and restart Mar 24 21:46:22 then rebuild Mar 24 21:46:34 danijoo_: Didn't see that. Sorry. Mar 24 21:46:43 danijoo_: doing it now Mar 24 21:46:54 have to go unfortunatly. good luck with that! Mar 24 21:48:58 danijoo_: ok ty. Hopefully it'll help. Mar 24 21:59:52 If I call setSurface on a mediaplayer and change the videoview output will that interrupt the stream? Mar 24 22:02:20 If I don't have any experience with Databases should I start with SQLite or can I jump right into learning with Realm? Mar 24 22:05:26 Do you have an understanding of databases, e.g. normalisation, indexing, etc? Mar 24 22:05:41 I don't, this is my first touch Mar 24 22:05:42 If not, I'd look into that before just going ahead and creating a database. Mar 24 22:06:52 It would be like trying to put a car together without knowing anything about mechanics and what each bit does, how, and why. Mar 24 22:07:21 You might be able to manage somehow to put the car together so that it moves, but if something goes wrong, you aren't going to have a clue what, or how to fix it. Mar 24 22:07:32 Anthaas|afk well for realm you don't need an understanding of databases, you might hit some limitations with realm but you can use it Mar 24 22:07:34 Or make improvements, etc. Mar 24 22:07:49 mrfu: jump on in. it's still relational, but for most purposes that's just "this object refers to that object". Mar 24 22:08:28 I would say that creating the database is creating the car. Using realm would be like using a car. Mar 24 22:08:35 Don't know what is happening but you can still drive it :) Mar 24 22:08:36 Thats true, but understanding databases is going to be a very useful thing. Mar 24 22:09:13 not arguing that :) Mar 24 22:09:35 Absolutely, and I intend to. Just sometimes easier to learn by getting my hands dirty and reading at the same time. Mar 24 22:10:02 Oh no, I just think it'd be beneficial to start now, and create your database as you learn rather than doing something which hides what is going on whilst trying to learn. Mar 24 22:10:36 I have a dummy project that I'll use for it, so I wouldn't destroy anything important in my main app Mar 24 22:11:26 Fair enough, youll find everyone has a different opinion on things like this, as most things, but my opinion and suggestion would to start straight with SQLite after reading a bit about database design. :-) Mar 24 22:11:37 anyone ever have the problem when switching between VR enabled/disabled that your object rendering is half width in the stereo view? Mar 24 22:11:40 with google cardboard Mar 24 22:11:47 alrights thanks for the advice Anthaas|afk Mar 24 22:11:53 np :) Mar 24 22:15:09 Finally finished my app! Just some finetuning to do and then it's 100% done :D Backend werbservice included. Mar 24 22:15:17 webservice* Mar 24 22:15:31 nice! Mar 24 22:15:34 link when its live Mar 24 22:16:13 Will do, but it won't hit the playstore until the contest I made it for is over (April 9th) Mar 24 22:16:21 What is the contest for? Mar 24 22:16:39 it's a mobile app development contest hosted by my university and sponsored by state farm Mar 24 22:17:21 hey guys, i getting this error "java.lang.IllegalArgumentException: width and height must be > 0" right after call this activity http://pastebin.com/9cBV0FNg Mar 24 22:18:02 But afaik i'm not trying to repaint anything on main thread .-. Mar 24 22:22:30 abara: what's the full error + stacktrace? Mar 24 22:23:50 if you wrote an app that's only useful in one country would you make it available everywhere or only in that country? Mar 24 22:24:13 groxx: right after the last "echo" call on the "onCreate" method http://pastebin.com/W80X1nhA Mar 24 22:24:43 memorion: afaik it can be available Mar 24 22:24:56 memorion: not useful on japan at all, but it can be .-. Mar 24 22:25:07 abara: looks like it's at `ShowcaseView.java:169`. I'd guess you're creating a bitmap based on getWidth / getHeight? Mar 24 22:25:22 memorion, i used to work for a big app that only works in US/CAN. We made it available everywhere, and our analytics showed that people were legit using the app (reporting / submitting / searching) in "every country" Mar 24 22:25:38 abara yeah but I wonder if you'd get one star reviews because it doesn't provide information for every country Mar 24 22:25:44 groxx: i'm using this library, but not using it on the this activity in particular .-. Mar 24 22:25:49 so we assumed people wouldn't change their country or something. Or visiting CAN/US Mar 24 22:26:17 quinnjn ok thanks Mar 24 22:26:19 memorion: you can just look at an app with this same behavior and see it Mar 24 22:26:30 we never got any 1-stars based on it not being useful outside NA Mar 24 22:26:53 but our app was pretty geared to NA so maybe users weren't surprised.. Mar 24 22:27:02 well mine wouldn't be useful outside Germany :D Mar 24 22:27:19 abara: dunno. either the library is buggy, or you're not doing everything it requires you to do. Mar 24 22:27:54 i guess it depends. If your app was called like "Germany Oktoberfest Finder" I would assume I couldn't use it :) Mar 24 22:27:56 groxx: probably buggy. it works just fine on every other activity .-. Mar 24 22:28:47 quinnjn the name is more generic than that and the functionality would make sense everywhere I just don't have the data for other countries :/ Mar 24 22:29:30 abara: fwiw it's happening asynchronously, so it could be failing from pretty much anywhere :| it's not part of the stack trace. Mar 24 22:30:04 memorion, tough call i would say. If it's free, i'd allow anyone to use it. Mar 24 22:30:11 groxx: that's the saddest part. man wtf is this bug hahahaha. weird shit Mar 24 22:31:17 quinnjn ok, will probably do that plus I want to get feedback from here so limiting would complicate that Mar 24 22:31:41 abara: looots of things I've seen fail to remove their callbacks when they should. it could be doing something in your current activity, then you start a second, then the current-activity's-view event happens when it "shouldn't". Mar 24 22:32:00 so it works like 99% of the time, but not if the device is busy / you do something slightly different than they expected Mar 24 22:32:43 groxx: hum, may need to delay my startActivity call Mar 24 22:32:52 groxx: ok, thanks for the highlight Mar 24 22:38:08 lasserix, did you make any progress on that VideoView? Mar 24 22:41:14 sort of Mar 24 22:41:16 i have to lock it Mar 24 22:41:22 which means i have to use a sensor event listener Mar 24 22:41:36 i can't not let android do its own thing, because that is mutually exclusive with a fullscreen button Mar 24 22:41:56 so now i am trying to get a sensor to spit out absolute port land rever por and land Mar 24 22:42:32 groxx: yep. that is it. i delay the call and it worked .-. Mar 24 22:43:18 what is the best way to store an arraylist of custom objects so they will persist through application runtimes? Mar 24 22:43:38 the easiest way is probably realm Mar 24 22:43:45 turn them to gson and serialzie them Mar 24 22:46:08 lasserix: the object implements parcelable - would that cause issues there? SO seems to think so Mar 24 22:46:31 no Mar 24 22:46:37 it shouldn't Mar 24 22:46:43 but they solutions I'm finding are all prefaced with variations of "this is gross and hacky" Mar 24 22:46:45 gson just cares about your fields Mar 24 22:46:56 cool Mar 24 22:47:04 parcelable gets you problems with realm I believe, so use gson if that works Mar 24 22:47:04 *as far as have expirenced Mar 24 22:47:22 oh good to know memorion Mar 24 22:48:27 mrfu https://github.com/realm/realm-java/issues/878 Mar 24 22:49:22 Well that makes the choice much easier Mar 24 22:49:33 already have gson in the project as well for some other stuff Mar 24 22:50:17 realmobjects are pretty limited, they have to extend realmobject and can only define getters and setters for the fields Mar 24 22:50:54 mrfu: http://pastebin.com/M6Yscvbj Mar 24 22:51:20 i feel like that should be able to be made into a generic method set Mar 24 22:51:24 anyone know if can be done? Mar 24 22:52:36 guess you would have to implement getId function or something Mar 24 22:52:41 for the generic but other than that Mar 24 22:54:34 oh Mar 24 22:54:36 just use hashcode Mar 24 22:54:44 err Mar 24 22:54:45 nah Mar 24 22:54:54 needs to be unique and recollectable Mar 24 23:01:19 cool Mar 24 23:01:22 my first generic functions Mar 24 23:13:03 quinnjn: so finally got it, the one caveat is if the user presses full screen and you're in portrait you have to keep track of the fact, since you don't want to trigger go into fullscreen on rotate when they rotate into explicit fullscreen Mar 24 23:13:14 but the idea is you lock everything then listen for orientation changes and fix there Mar 24 23:18:52 JesusFreke there was a ST update yesterday Mar 24 23:20:44 annual update to convice us the project is still alive ;) Mar 24 23:22:50 g00s: heh Mar 24 23:23:02 g00s: also, an IDEA update Mar 24 23:23:18 which should have the change I submitted to allow for bytecode level debugging :D Mar 24 23:23:30 oh nice Mar 24 23:29:50 Camera question: how do I get the ratio between the actual layout on screen to the actual taken picture? Mar 24 23:30:26 decodejustinbounds on picture to get w/h Mar 24 23:30:34 then use your getw/h on your layout Mar 24 23:30:35 and compare Mar 24 23:31:07 what is 3android-devel? Mar 24 23:32:13 lasserix - get w/h on my layout and compare? what do you mean? Mar 24 23:32:29 pic has a w layout has a w Mar 24 23:32:39 picw/layoutw is the ratio you are looking for? Mar 24 23:34:33 basically I want to crop the picture so it will fit part of the screen but sizes are different (picture size might be smaller on some devices) so I am not sure how to relate between the picture size and the screen Mar 24 23:35:13 imageviews have center crop Mar 24 23:35:15 scale type Mar 24 23:35:16 layout_weight? Mar 24 23:35:21 will do that for you automatically Mar 24 23:36:56 lasserix this is my example: https://www.evernote.com/shard/s67/sh/cd93abb7-8b1a-4982-afa2-645f77c4c055/12ff843b253bb19c47e236c26838e0fa Mar 24 23:37:08 I want that the picture will fit the grid (which is an imageview) Mar 24 23:37:28 so your imageviews are all square but your pictures are not? Mar 24 23:37:34 look at imageView.scaleType Mar 24 23:38:11 actually the problem is that the grid(imageview) size is way bigger than the *real* picture Mar 24 23:38:15 sec checking i Mar 24 23:38:16 it Mar 24 23:38:52 Once using imageView.scaleType I can also save the cropped result ? Mar 24 23:44:51 gradle has stopped automatically asking to sync when I make changes, any reason why this would happen? Mar 24 23:45:59 lasserix - the problem with the imageView.scaleType is that it will work on the UI but not sure how to work with that regarding the actual saved file Mar 24 23:46:41 who is darkPT and why are they inviting me to #android-devel? Mar 24 23:46:50 hehe Mar 24 23:48:36 someone with chanop envy I bet Mar 24 23:50:07 could be they're just misspelling "android-devil" Mar 25 00:25:29 JesusFreke http://google-opensource.blogspot.com/2015/03/classp-classier-way-to-parse.html?m=0 Mar 25 00:28:28 g00s: needs more regex Mar 25 00:29:03 oh, I read that as "a classier way to parse html" Mar 25 00:29:08 from the url. lol Mar 25 00:32:02 I'd love to try that with smali. It has some pretty interesting ambiguities Mar 25 00:56:15 hmm http://philosophicalhacker.com/2015/03/24/how-to-keep-your-rxjava-subscribers-from-leaking/ Mar 25 01:01:01 sugru will fix any leak! Mar 25 01:01:20 is sugru the new duct tape? Mar 25 01:01:34 something like that :) Mar 25 01:01:59 JesusFreke i am unfamilar with sugru, please enlighten me ! Mar 25 01:02:13 g00s: https://sugru.com/ Mar 25 01:02:14 i really need to pick some up. it looks like fun. i've been eyeing it on adafruit for quite a while Mar 25 01:03:15 JesusFreke what other android things can sugru fix :P Mar 25 01:03:44 http://www.instructables.com/id/Add-Sugru-bumpers-to-your-phone-case/ Mar 25 01:03:46 i bet you could make a neat case for your phone Mar 25 01:03:55 oh hey, of course there's an instrucable for that Mar 25 01:04:40 think: silicone caulk, but in much easier-to-use putty form Mar 25 01:19:12 does anyone know how I'd go about embedding the default google widgets in a fragment? Mar 25 01:49:30 the whats Mar 25 01:57:16 CedricBeust_ get any good feedback on your post? Mar 25 01:57:43 rx/kotlin/android one Mar 25 01:58:32 g00s: Yes, and suggestions too Mar 25 01:59:02 CedricBeust nice. i was reading this today http://philosophicalhacker.com/2015/03/24/how-to-keep-your-rxjava-subscribers-from-leaking/ Mar 25 01:59:26 but it seemed familiar to a bug opening / discussion on rxjava between ben c / mttkay about this Mar 25 01:59:48 g00s: I'll take a look Mar 25 01:59:48 not sure if they ever resolved it, decided it would never work, or whatnot Mar 25 02:00:53 This might be a Java question but do I need to implement all methods in TextWatcher or can I choose which one I need? Mar 25 02:01:04 You have to implement them all. Mar 25 02:01:35 so is that a Java thing? Implement all abstract methods Mar 25 02:01:57 its been a while since I used Java Mar 25 02:01:57 java 8 has optional methods in interfaces but yeah, for us ;) Mar 25 02:02:05 rehat: Yeah Mar 25 02:02:10 gotcha thanks Mar 25 02:02:18 (interface default methods) Mar 25 02:04:26 I normally just say "// empty" for stuff I don't want to handle. Or if it's something that shouldn't happen then 'throw new AssertError("This should not happen");'. Mar 25 02:04:32 AssertionError* Mar 25 02:04:47 // This Should Never Happen (tm) Mar 25 02:04:54 (Though the latter doesn't apply to TextWatcher.) Mar 25 02:05:00 JesusFreke: :D Mar 25 02:05:25 which then pretty much guarantees that it will happen Mar 25 02:05:43 especially if you don't throw, yeah :) Mar 25 02:05:58 If you throw it won't happen. If you don't throw it will. :) Mar 25 02:08:14 I do much prefer to pepper my source files with non-ascii characters though. screws with editors that don't handle UTF properly :) // This Should Not Happen™です Mar 25 02:18:53 do I need google play services to use the weather widget? Mar 25 02:24:19 http://www.chupamobile.com/android-full-games/flappy-3d-first-person-control-cross-platform-3105 Mar 25 02:24:26 is this guy selling the unity source code? or java Mar 25 02:24:33 On the side it says Files included: .apk.dat.db.dex.java.know.xmlLayered PNGLayered PSD none of those are unity source files Mar 25 02:24:59 Is there a way to get elevation to work on pre API 21 devices? Mar 25 02:25:13 ViewCompat.setElevation seems to do nothing Mar 25 02:25:32 correct Mar 25 02:25:35 use a 9-patch Mar 25 02:25:47 JakeWharton: I've never worked with those. Any resources for those? Mar 25 02:32:45 do you guys notice in AS, if you have a bunch of methods folded / collapsed, and then start editing the file by adding new content, some of the unfolded methods expand ? Mar 25 02:33:13 g00s: Yeah, it's often unpredictable Mar 25 02:33:36 CedricBeust i thought i was going crazy, like in my peripheral vision something would change and i barely catch it ... Mar 25 02:34:27 that's probably what it wants you to think :| Mar 25 02:34:53 I think I've seen similar though, fwiw :) Mar 25 02:47:00 new-ish to android studio here.. trying to add a gradle dependency. I'm getting "Could not find com.android.support:support-annotations:22.0.0." and don't know where to go. Mar 25 02:48:13 it feels like something is out of date. Isn't 22 5.1 support? Mar 25 02:48:23 Just thought you should know: Google Fiber is coming to my city. Mar 25 02:48:28 *just FYI* Mar 25 02:48:45 also, in-your-faceee Mar 25 02:48:54 explodes: from all of us here, f*ck you. ;-) Mar 25 02:49:04 ;D Mar 25 02:49:06 but you have to live in Utah, so there. Mar 25 02:49:23 Yeah that's reason for permanent ban right there :) Mar 25 02:49:24 At least we can enjoy the world indoors now Mar 25 02:49:40 yes, but we have alcohol Mar 25 02:50:07 Booze, fast Internet, stores open on Sundays: pick one Mar 25 02:50:19 Ha,. Mar 25 02:50:30 It's illegal to sell a car on sunday here Mar 25 02:50:44 and the majority of people there were magic underpants Mar 25 02:50:48 Also, they built a Tesla showroom downtown SLC, they passed a law and now it has to shut down Mar 25 02:50:56 not that there's anything wrong with that, it's just odd. Mar 25 02:51:02 it's very odd Mar 25 02:51:30 Once you get past the politics and mormons, this place rules. The outdoorsy stuff here is top notch Mar 25 02:51:49 That Tesla thing makes me so mad though Mar 25 02:51:52 colorado sounds better Mar 25 02:51:55 They just finished building it last week Mar 25 02:52:03 plenty of good beer Mar 25 02:52:20 beer/snow/grass Mar 25 02:52:32 snow lasts for a few days Mar 25 02:52:42 I'm in the north east and haven't seen the ground for months Mar 25 02:53:10 lucky- this was the first season i bought a season pass Mar 25 02:53:17 and it's snowed maybe 10 times in the mountains Mar 25 02:55:31 does utah have a lot of fracking ? Mar 25 02:59:50 seems so, Uinta Basin. well as long as they drink their own water :) **** ENDING LOGGING AT Wed Mar 25 02:59:58 2015