**** BEGIN LOGGING AT Tue Jun 09 02:59:58 2015 Jun 09 03:00:31 But I look at the source and see no mention. ;o Jun 09 03:00:48 i'm removing it to see if it cancels the behavior Jun 09 03:01:27 TacticalJoke, you're correct Jun 09 03:01:31 it just does nothing - the check box is there regardless Jun 09 03:01:34 lol Jun 09 03:01:57 that doesn't explain why creating checkboxes in java does not provide any clickable drawable Jun 09 03:05:09 nevermind, it creates them. they are just black on dark gray so I couldn't see them Jun 09 03:12:40 any idea what might could cause this when using Retrofit + RxJava? https://gist.github.com/mattblang/fab26f471a2a13a18ce5 Jun 09 03:15:21 doing a pretty straight forward call https://gist.github.com/mattblang/8c95d5e5fe973db3a5cc Jun 09 03:21:15 g00s were you the one who told me about timeseries dbs Jun 09 03:21:40 that sounds like a good name for a book series. Jun 09 03:40:05 ron_frown opentsb yeah Jun 09 03:40:15 What is called you when you have a fragment that sits on top of your other frag UI or Activity. Like it covers up other stuff and perhaps leaves a shadow Jun 09 03:43:12 looks cool https://luckymarmot.com/paw (for crafting REST requests) Jun 09 03:43:13 almost like you opened a new mini window on your fragment? i need it to be like " hey you got the answer correct" kinda thing Jun 09 03:43:41 NateRiver hm, i typically do floating window with activities Jun 09 03:43:50 or you can use dialogfragment Jun 09 03:45:16 okay i still want to be able to click buttons on the original fragment tool so idk if dialogfragment would work because it makes everything unclickable Jun 09 03:48:41 like this example http://1.bp.blogspot.com/-jQX21z8i72k/VP4-KR_SnlI/AAAAAAAAB8E/ne_2FxwsmlQ/s1600/Duolingo%2B(5).jpg Jun 09 03:54:34 NateRiver hm, you could look at PopupWindow - its a bitch though Jun 09 03:55:21 for example, PopupWindow can't have Spinners (because, they use PopupWindows for theit PopupList) - pretty crappy system Jun 09 03:56:51 ok thanks Jun 09 03:57:09 <_genuser_> what's shakin' people? Jun 09 04:00:01 uhh Jun 09 04:03:56 Meth heads are shakin' people. Jun 09 04:05:23 g00s what about making it invisible and then showing it after transaction Jun 09 04:05:31 like an invisible view Jun 09 04:06:33 yeah you can do that, look at the new support lib framelayout Jun 09 04:06:38 it even has weights Jun 09 04:17:10 g00s: how are you doing asserts? Jun 09 04:17:19 i'm not Jun 09 04:17:44 not even "assert()"? Jun 09 04:18:00 nope Jun 09 04:18:24 but you probably dont want to do what i do :D Jun 09 04:20:13 throw new AssertionError("Assertion failed."); Jun 09 04:20:28 pressing Ctrl+Space brings up the popup as well as the Documentation window. How to stop Documentation window from comming on? Jun 09 04:20:35 Android Studio Jun 09 04:21:03 do what TacticalJoke does, he has good taste :) Jun 09 04:21:57 thats actually super easy, even relative layout just flops right on top of anything Jun 09 04:22:37 g00s: https://developer.android.com/samples/BasicTransition/src/com.example.android.basictransition/BasicTransitionFragment.html Jun 09 04:22:45 line 54 Jun 09 04:23:08 huh Jun 09 04:23:13 assert after inflate Jun 09 04:23:47 squ maybe ask CedricBeust since he does a lot of testing stuff Jun 09 04:24:00 i thought assert didn't work as expected on android Jun 09 04:24:14 I don't do testing stuff, I write frameworks to do the testing stuff for me Jun 09 04:24:21 lol Jun 09 04:24:29 he does stuff Jun 09 04:24:38 you got enough experience so that your opinions matters :) Jun 09 04:26:53 is this still needed ? adb shell setprop debug.assert 1 Jun 09 04:27:36 squ http://stackoverflow.com/questions/6176441/how-to-use-assert-in-android Jun 09 04:28:06 which is what TacticalJoke said Jun 09 04:28:13 I'll tell you how this works in ios Jun 09 04:28:22 CedricBeust: so how do you design your android app for testing ? Jun 09 04:28:35 Dagger Jun 09 04:28:48 other than that, I don't have a lot of experience with testing on Android I have to say Jun 09 04:28:53 Yeah, I'm not sure that `assert` is a great idea. Jun 09 04:29:13 NSAssert((boolean)true/false, "printf", printf_param); Jun 09 04:29:14 CedricBeust: eh.. too bad, was waiting for some advices Jun 09 04:29:49 this macro is switched off when DEBUG is set to false, for non-debug/testing builds, for production Jun 09 04:29:50 squ did you look at swift 2 ? they got exceptions :P Jun 09 04:30:06 wonder if they got any of the nifty stuff like c# exception filters Jun 09 04:30:22 something like that in android? Jun 09 04:31:42 squ: yup, Kotlin Jun 09 04:31:52 g00s: no, I don't like new languages :) Jun 09 04:32:04 Learning is hard yo Jun 09 04:32:06 COBOL fo lyfe. Jun 09 04:32:29 screw that, Ada FTW ! Jun 09 04:32:44 they seem to appear once in a half-year for no reason Jun 09 04:33:13 which must be banned by Human Rights Watch Jun 09 04:33:17 There are plenty of reasons Jun 09 04:33:21 they don't appear often enough if you ask me Jun 09 04:33:40 main reason is because they can Jun 09 04:33:48 Yup, that's one of the awesome reasons Jun 09 04:34:15 CedricBeust what doesn't appear often enough ? Jun 09 04:34:19 not following Jun 09 04:34:27 languages Jun 09 04:34:29 New languages Jun 09 04:34:36 he wants more of them Jun 09 04:34:43 lol there are languages all over the place. the language is easy, the standard library is hard Jun 09 04:35:00 If your language runs on the JVM, the library is kinda taken care of Jun 09 04:35:11 hmm Jun 09 04:35:18 if you are kotlin i guess :) Jun 09 04:35:24 depends on the level of interop Jun 09 04:35:41 I can't think of a recent JVM language that doesn't interoperate with Java Jun 09 04:35:46 how about NSAssert-like debug macro? Jun 09 04:35:47 jruby, nashorn, etc dont call into java nicely Jun 09 04:35:50 They don't all do it as well as each other, but it's one of their design goals Jun 09 04:36:27 don't knock cobol. :P Jun 09 04:36:31 isn't calling java easy, but its going from java to newfangled language that is harder ? Jun 09 04:37:22 I'm not familiar with Android (Wear) dev; anyone know if there's a way to activate the screen of a watch as if it had been woken up? Jun 09 04:37:38 I'm not seeing anything browsing through google's api page Jun 09 04:38:39 ok, time to watch best comedy Jun 09 04:40:32 gordon_: what is best comedy? Jun 09 04:40:40 apple's wwdc :D Jun 09 04:41:28 It's sensible to be skeptical about new languages, but from what I've seen many people are outright closed minded. Jun 09 04:41:37 Sometimes a new language is just way better. Jun 09 04:43:52 I don't really care if new languages are way better, they very often aren't. What's important is looking at all its functionalities and learning new things from it,. Jun 09 04:55:19 gordon_ didn't seem like anything big today (wwdc) if anything, apple playing catch up Jun 09 04:55:50 i'm sure they are hating writing software for android heh Jun 09 04:55:54 windows snapping to screen sides - everyone is clapping and shouting like it would be... Jun 09 04:55:59 I dont know Jun 09 04:56:09 g00s: The Verge would agree with you http://www.theverge.com/2015/6/8/8749005/apple-wwdc-catch-up Jun 09 04:56:10 after ios, android is pain Jun 09 04:56:19 gordon_ i use moom for that Jun 09 04:56:28 I use linux for that Jun 09 04:56:46 my screen isn't large enough for it to be usful though Jun 09 04:57:19 I use it often Jun 09 04:57:37 I've been using window snapping regularly for years Jun 09 04:57:50 especially for left and right, very useful Jun 09 04:58:38 next release they will allow to snap 4 windows like in kde? ;) Jun 09 04:59:11 I think they'll start adding more animations, like Windows 7 did five years ago Jun 09 04:59:17 MacOS looks so antiquated and old Jun 09 05:02:44 hopefully el capitan improves the USB stack :P Jun 09 05:10:12 good that I'm using thinkpad ;) Jun 09 05:11:02 gordon_ did you uninstall the special lenovo software :) Jun 09 05:11:24 deleting windows was the first thing I did sir ;) Jun 09 05:22:19 Hi all. Quick question. Does anyone here have experience adding a "restore in-app purchase" button in their apps? Is it really necessary? Jun 09 05:34:59 !ask Jun 09 05:37:02 I like one thing - two buttons scroll on ipad keyboard Jun 09 05:37:44 but when I think about it, I dont need it :D Jun 09 05:42:30 https://code.google.com/p/android/issues/detail?id=32621 anybody care to comment on this again? Jun 09 05:42:36 on the last few comments Jun 09 05:43:07 Seems to be this big deal that DHCPv6 can't be implemented in Android Jun 09 05:47:01 Hello, I am making an app that should start on boot. I have registered a receiver for this but it doesn't work. Help needed Jun 09 05:48:37 permissions? Jun 09 05:50:00 Asiren: yes everything has been set Jun 09 05:51:32 Ashiren, I have given proper permision, the official documentaion says after Android 3.0 we need to start the activity once and it wont start on boot. But then how does apps like whatsapp and swiftkey start on boot Jun 09 05:56:00 and moreover it receives BOOT_COMPLETE intent only when it is running/minimized (Tested through adb shell ) Jun 09 05:56:12 So i updated AS this morning Jun 09 05:56:18 Now i can't build my project Jun 09 05:56:20 @NotNull method com/android/tools/idea/model/MergedManifestInfo.getManifests must not return null Jun 09 05:56:27 Anyone else encountered and found a solution? Jun 09 05:57:20 AS-141.1989493 Jun 09 06:03:16 kevel: use stable version Jun 09 06:07:12 AS/gradle is slow in sync when you have a problematic build.gradle file, then if you want to stop the background sync/indexing process, it fucking 'stopping...' forever. Jun 09 06:10:09 rrr: i changed channels but now it doesnt degrade lol Jun 09 06:10:16 rrr: ffs Jun 09 06:10:40 I need helo with starting application on boot , I know how but it wont happend. here is snippet http://paste.bradleygill.com/index.php?paste_id=966311 Jun 09 06:10:48 in the end i have to restart AS to stop 'stopinng...' Jun 09 06:11:28 kevel: degrade? Jun 09 06:12:36 nonsense Jun 09 06:13:28 is it normal for the emulator taking several to 10 minutes to finally show up? Jun 09 06:13:31 android doesn't pick my drawables Jun 09 06:13:39 I tried clean, reabuild Jun 09 06:13:54 it uses cached value, uninstall doesn't help too Jun 09 06:13:55 rrr, Yes very normal use snapshot Jun 09 06:14:22 blackbox: snapshot? Jun 09 06:15:31 rrr, when you start you get a checkbox for snapshot , if you use that next time when you start it will start quickly (Still takes time, so the secret is once started do not close) Jun 09 06:22:23 what is diff between 'make project' and 'rebuild project'? Jun 09 06:22:49 AS menu does not make much sense Jun 09 06:30:24 have you ever had a problem where GenyMotion virtualbox gives error when trying to start it Jun 09 06:32:37 what is "goto definition" shortcut for AS? Jun 09 06:41:08 did you even try it? Jun 09 06:45:12 rrr: ctrl+click? Jun 09 06:46:13 kevel: thanks Jun 09 06:47:17 kevel: i want to map it to F3 same as in eclipse Jun 09 06:51:41 I have a textfield called mobilenumber. Is there an easy way to check if its over 8 Digits? Jun 09 06:54:03 if (mobilenumber > 9999999) { - "can not be applied to android widget edittext,int" Jun 09 06:54:50 yeah, dosent that work? Jun 09 06:55:21 Operator > - "can not be applied to android widget edittext,int" Jun 09 06:55:39 Is there another way to do that check? Jun 09 06:56:25 i think theres a way to convert it to string and then check if it matches a format like ###-#### Jun 09 06:57:36 ohh yeahh the .matches thing http://stackoverflow.com/questions/5958665/validation-for-a-cell-number-in-android/5959341#5959341 Jun 09 06:57:48 I have an Activity for doing some sandbox testing. I have it set up to run the test manually and get a result back. Can espresso watch the text in a view or do I need to use onView and add the view I'm watching for inside the Activity? Jun 09 07:05:14 how can i scroll a recyclerview to bottom when the user open the soft keyboard? Jun 09 07:09:22 mmarklar, Hey how are you? Jun 09 07:10:26 Datasmurfen, how do you expect to be able to numerically compare a view object with a primitive number? Jun 09 07:17:48 hey guys Jun 09 07:18:10 why is it when i try to get the getText().toString() of an edit text it gives me this [ 06-09 00:12:11.078 196: 848 D/audio_hw_primary ] Jun 09 07:18:55 not the text itsself? Jun 09 07:19:11 show some code Jun 09 07:19:36 http://hastebin.com/iwiqufalup.avrasm Jun 09 07:21:20 that's not enough Jun 09 07:22:36 http://hastebin.com/fusewacuse.avrasm Jun 09 07:25:44 is there a way to reference keys from preference xml? Jun 09 07:26:06 redengin: afaik no Jun 09 07:26:11 or do I need to hardcode the key into java? Jun 09 07:26:30 joroci ive been working away for an hour or so i cant figure it out Jun 09 07:26:35 liftedbronco: for the love of god, please use ButterKnife Jun 09 07:26:52 try the xml Jun 09 07:26:57 lol kevel that way my thought too Jun 09 07:27:19 pretty sure butterknife won't actually help with this issue Jun 09 07:27:49 wont help with the issue, but will help with my sanity wakelock Jun 09 07:28:06 liftedbronco, this seems overall inefficient, trying to parse the number and then parsing "for real"... Jun 09 07:28:52 ok but why isnt the getText().toString() working?? Jun 09 07:29:04 hard to tell Jun 09 07:29:17 what exactly are you entering into it? Jun 09 07:29:35 when i try to get the getText().toString() of an edit text it gives me this [ 06-09 00:12:11.078 196: 848 D/audio_hw_primary ] Jun 09 07:29:51 that is hardly possible Jun 09 07:30:00 http://hastebin.com/iwiqufalup.avrasm Jun 09 07:30:04 maybe show the layout? Jun 09 07:30:19 no point pasting things you already pasted Jun 09 07:30:52 http://hastebin.com/ojefaxomop.xml Jun 09 07:30:58 layout joroci ^^ Jun 09 07:31:01 Hey guys... my Program worked until I tried a custom adapter ... it it has an error " error: contructor CustomArrayAdapter in class CustomArrayadapter cannot be applied to given types; "http://pastebin.com/zNg3MCEv Jun 09 07:31:07 butterknife looks pretty sweet Jun 09 07:31:28 a buttery android *slurp* *slurp* *slurp* Jun 09 07:31:53 eww Jun 09 07:32:16 wasnt something like butterknife talked about in the i/o 2015? soon its gonna be automatic finding ? Jun 09 07:32:57 setting the text is fine hto Jun 09 07:33:44 cart_man, where exactly is this error? Jun 09 07:35:06 dang what is my issue :/ :/ Jun 09 07:35:07 cart_man, nevermind. look closely at your constructor definitions. surely you'll figure it out Jun 09 07:35:14 getting the text shudnt be this freaking hard Jun 09 07:35:24 are you sure this is what yuo get? Jun 09 07:35:25 you Jun 09 07:35:45 yeah something is definitely messed up Jun 09 07:36:15 what .getText() allegedly returns looks more like a line from logcat Jun 09 07:37:02 yea i saw this line before Jun 09 07:39:01 ok if i try to do http://hastebin.com/avodusaveq.avrasm Jun 09 07:39:06 it gives me a java.lang.NumberFormatException: Invalid int: "" Jun 09 07:39:40 but i thought i was checking if its invalid or not Jun 09 07:41:05 :/ Jun 09 07:41:39 I think yor concept is all wrong Jun 09 07:41:49 look, can you help me fix the issue at hand lol Jun 09 07:42:09 ill change it to butterknife after i figure out why its not working Jun 09 07:42:46 I never said your problem is not using butterknife Jun 09 07:42:56 what was the problem Jun 09 07:43:03 and why is it not working the way i have it now Jun 09 07:43:53 omg Jun 09 07:43:59 do you even realize what you're doing? Jun 09 07:44:02 I just realized Jun 09 07:44:13 wakelock, Is it because of the Array of Strings that I am passing throughinstead of a List? Jun 09 07:44:14 wow Jun 09 07:44:21 cart_man, no... Jun 09 07:45:01 liftedbronco, what exactly do you think happens when you call .setText() with an int argument? Jun 09 07:47:14 liftedbronco, just fyi, I have the solution ready and waiting, but me doing it for you will teach you nothing Jun 09 07:47:16 wakelock just changed it to Jun 09 07:47:17 pennyText.setText(String.valueOf(Integer.parseInt(pennyText.getText().toString()) + 1)); Jun 09 07:47:26 so does it work now? Jun 09 07:47:27 still doesnt work Jun 09 07:47:37 hm Jun 09 07:48:00 what if you remove .toString() ? Jun 09 07:48:06 its an Editable Jun 09 07:48:23 ? Jun 09 07:48:49 pennyText.getText() returns an editable Jun 09 07:48:51 not a string Jun 09 07:48:56 hmm Jun 09 07:48:59 so i cant add 1 to it Jun 09 07:49:37 ok yeah, apparently you have to call .toString() Jun 09 07:51:30 so if you try to print out whatever pennyText.getText().toString() returns anywhere, you get that strange hw_audio line Jun 09 07:51:33 correct? Jun 09 07:52:29 well in logcat Jun 09 07:53:12 how do you know that is really your line in logcat? Jun 09 07:53:25 try this: http://hastebin.com/onikayimum.avrasm Jun 09 07:54:51 tht works!! Jun 09 07:54:52 amazing Jun 09 07:55:05 thanks wakelock Jun 09 07:55:10 I told you your concept is wrong Jun 09 07:55:34 (I'd remove the log line now) Jun 09 07:55:36 oh you meant the conversion method Jun 09 07:55:48 I meant the concept Jun 09 07:55:50 but okay Jun 09 07:56:01 as in, your approach Jun 09 07:57:49 hey wakelock how do i detect when a edittext is change Jun 09 07:57:57 is there an OnTextChanged method? Jun 09 07:59:05 wakelock, Ugh I feel like a total moron now :S Jun 09 08:02:34 liftedbronco, http://developer.android.com/reference/android/widget/TextView.html#addTextChangedListener%28android.text.TextWatcher%29 Jun 09 08:02:42 it's all in the docs, dude... Jun 09 08:02:52 cart_man, did you figure it out finally? :p Jun 09 08:05:53 wakelock, Oh lol no not the entire time... I was actually running out the office the whole time...when I came to sit down I was like....Ughhhhhhhhhh FACEPALM Jun 09 08:06:09 but I am new to the Android Studio though but still hahah Jun 09 08:07:04 ok maybe wakelock can figure my problem out Jun 09 08:09:58 I have to make a marquee textview become wrapped with HorizontalScrollView so the user can override the auto scrolling with their finger and when they let go it goes back to auto scrolling by me dynamically removing the HorizontalScrollView and setting X position again Jun 09 08:11:45 or no I can't set an X position can I Jun 09 08:12:30 after removing the wrapping HSV Jun 09 08:21:03 shmooz, this is quite tricky actually Jun 09 08:21:35 wakelock: it's such a good feature though I have to get it done somehow Jun 09 08:22:13 it should have been built into the marquee of textview itself, something like user_overridable Jun 09 08:24:12 like being able to hold a scrolling newsticker and make it go faster or slower even with your swipe speed Jun 09 08:24:39 shmooz, tried android:scrollHorizontally="true" on TextView? Jun 09 08:24:39 in my case it's the meta info bar for my media player Jun 09 08:26:01 I know someone's come across this situation before but I don't remember what happened Jun 09 08:26:38 I have in user settings if the user wants it to auto scroll or not incase they find it distracting Jun 09 08:27:23 there is also .setHorizontallyScrolling(true); Jun 09 08:27:25 but I would also allow them to override auto scrolling by touching and manually interrupting the auto scroll Jun 09 08:28:46 wakelock: yes I already had scrollHorizontally=true Jun 09 08:29:16 but that didn't allow the user to override it Jun 09 08:30:10 then use the method call Jun 09 08:30:30 when I wrap the autoscrolling marquee textview in a HorizontalScrollView, I get the desired effect of it being scrollable by user, but I have to make it dynamic so it happens onTouch and keeping the X scroll position would be nicer Jun 09 08:37:07 So, doing some RXJava stuff Jun 09 08:37:56 Whats the best way to fetch stuff from an API, do some device side processing, then dump result into an adapter Jun 09 08:38:18 the main issue being, not wanting to do the processing on the ui or main thread Jun 09 08:48:22 is it hard to put like 1000+ soundclips in an app? Jun 09 08:48:55 good luck fitting that on a low end phones internal SDCard Jun 09 08:49:06 basically what im trying to do is similar to a pronunciation for each word in dictionary Jun 09 08:49:26 why would it be "hard"? Jun 09 08:49:36 depends on the size, samplerate, etc Jun 09 08:50:27 like wouldnt i need to make download data as needed Jun 09 08:50:48 whats that called Jun 09 08:50:53 "stream" Jun 09 08:50:56 but not necessarily Jun 09 08:51:34 you can do it any way you want Jun 09 08:51:41 none of it is "hard" as such Jun 09 08:52:38 NateRiver: download the clips you need and cache them Jun 09 08:52:54 NateRiver: people generally have a set of words they use frequently, and talk a specific way Jun 09 08:53:21 NateRiver: probably 90% of the words stored on the device wont even be used Jun 09 08:53:41 NateRiver: let the data grow depending on the users vocab Jun 09 08:53:51 so like onAttach(){download fragments cache of sound clips} Jun 09 08:54:15 what exactly are u trying to do? Jun 09 08:54:30 like a dictionary or something? Jun 09 08:55:44 im making a database of every quote from a movie, and ive got the quotes cut up and ordered by quote each with its accompaying sound clip Jun 09 08:56:31 maybe you could simply use the speech2text engine Jun 09 08:56:36 I would make the user download the quoted voice clip when they press play, or the detail view or something Jun 09 08:56:50 adq: think he wants the actual clip from the movie Jun 09 08:56:55 which also takes care of many languages (pronunciation is different from a languageto another) Jun 09 08:57:16 kevel, i think he was pretty clear Jun 09 08:57:21 basically what im trying to do is similar to a pronunciation for each word in dictionary Jun 09 08:57:44 but then he said he has the quotes cut up and ordered with accompaying sound clip Jun 09 08:57:52 assuming its the actual clip Jun 09 08:58:00 i think the clips are formants Jun 09 08:58:03 or i thought Jun 09 08:58:04 who would want a quote from a movie, in not the actual movie clip lol Jun 09 08:58:18 i can read, i dont need some text2speech to read for me Jun 09 08:58:24 thx fuck Jun 09 08:58:26 the* Jun 09 08:58:27 and i dont think others would either Jun 09 08:58:48 NateRiver: tell us morer about these sound clips Jun 09 08:58:58 adq: i bet you 5 salts that its the actual clip Jun 09 08:59:27 it's not realistic to store clips of quotes Jun 09 08:59:50 it's realistic to store formants to recompose any speech Jun 09 09:00:23 yeah theyre like 5-20 sec clips and the app will give you a quote with its data: time in movie/quote/speaker/context and then i was thinking a play button for playing the quote Jun 09 09:01:33 theyre seperated into lessons, so each lesson only has 20-30 quotes so i could just load all of a lessons quotes as soon as its started like you said kevel Jun 09 09:02:03 adq: 5 salts please! Jun 09 09:02:49 lol as you wish Jun 09 09:05:56 Hi, does somebody have experience with the getTextBounds method of a Paint? I need to calculate the needed width / height for a text to be drawn on a canvas. But the canvas is scaled. Currently the return Rect isn't correct Jun 09 09:06:52 FrancescoV, how is it not correct? Jun 09 09:07:57 hello devs, i need to ask a question.. when we first boot a rom, there is plenty of things which is already set. like defualt font size = normal, brightness is auto, sleep time is 2 minutes, daydream etc.. i need to change that size from normal too default.. any idea where these settings are in? where to look jar aur any apk? thanks.. Jun 09 09:08:19 gotnut, read the channel topic Jun 09 09:08:39 right, so its a custom rom question :/ Jun 09 09:08:40 sorry! Jun 09 09:09:32 redengin: the width and height is bigger than the text area if I draw the rect (rect from getTextBounds Jun 09 09:10:30 FrancescoV, how much bigger? are we talking a few pixels? Jun 09 09:11:21 redengin: +- *2 Jun 09 09:11:51 can this be something with the screen density? Jun 09 09:11:56 then just do it enough times and it will average out to no difference! Jun 09 09:12:46 FrancescoV, can you post your code? its probably screen density vs font Jun 09 09:15:34 redengin: something like this: http://pastebin.com/vbP2zDAH Jun 09 09:16:26 Anyone know how to get RxJava to run map on a set of threads? Jun 09 09:16:38 I thought this was default but testing shows otherwise :D Jun 09 09:18:10 FrancescoV, can you post with comments on the expected values? Jun 09 09:18:28 knapper_tech, a set? Jun 09 09:18:49 Hello i would to know something about android architecture. I would like to know if it's possible to start an activity from a controller instead of an other activity Jun 09 09:19:14 danijoo, Schedulers.io() etc run by default on a threadpool but I'm showing that items are emitted sequentially .. Jun 09 09:19:29 and all running on just one thread instead of on many threads Jun 09 09:20:13 knapper_tech, im pretty new to Rx too, but theres Observable.toSync(). Maybe this is what you need? Jun 09 09:20:29 eraindil, certainly you cant start an activity, what do you mean by controller? Jun 09 09:20:44 Observable.synchronize* Jun 09 09:20:51 i'll keep poking around. I've got some test code I can gist if it doesn't magically happne. gotta get out of here pretty soon. Jun 09 09:21:48 when i'm saying controller i mean from a conceptyual view. Like you got you activity and you export activity logic inside a controller and i would like this controller to start other activities if needed Jun 09 09:22:52 eraindil, I think you are talking about mvc, under the android guidance, activities would pass to another controller Jun 09 09:23:38 eraindil, its still possible to handle activities in the same class/context if thats what you need Jun 09 09:25:06 well, i would like to handle creation of activities from a dedicated place like a "activities" factory in fact. meaning i don't want an activity to handle creation of other activity Jun 09 09:25:23 eraindil, you only need a context Jun 09 09:25:29 context.startActivity() Jun 09 09:26:03 ok Jun 09 09:26:07 thank you Jun 09 09:26:26 I usually have a static class that handles activiy transitions for me Jun 09 09:26:41 static void startActivityX(Context context) Jun 09 09:27:16 eraindil, I don't think you understand activities if you are trying to make a factory Jun 09 09:27:48 maybe not Jun 09 09:28:04 what is your use case? Jun 09 09:28:06 i thought that activities were view + context Jun 09 09:28:37 activity = one screen Jun 09 09:28:37 activities are "things to do based upon intent" Jun 09 09:28:44 it holds a view and is a context Jun 09 09:28:56 but it is no view + context Jun 09 09:29:43 ok when i mean factory i should more speak about a controller that will redirect or create an activity according to the logic Jun 09 09:29:48 ok Jun 09 09:30:23 so basically just bunch of static methods to remove duplicates in your intent creation? Jun 09 09:30:31 eraindil, can you give me a quick ide of what you want to do? Jun 09 09:31:02 err. s/ide/idea :) Jun 09 09:31:24 i want to seperate everything in fact Jun 09 09:31:43 i don't want to implement logic inside activities Jun 09 09:32:20 how so, won't an activity need logic? if you're talking about reuse, you can generalize methods Jun 09 09:32:53 do you mean that activities are sort of controller? Jun 09 09:33:21 eraindil, its like a method call, it's triggered from an intent to do something Jun 09 09:33:46 hum ok. Jun 09 09:34:14 eraindil, it'd really help if you gave me a use case Jun 09 09:34:15 so if i got a button to save a cake, the event is catch by the activity. Jun 09 09:34:55 i would like to redirect this event catch to a controller or service that will have the save logic Jun 09 09:35:10 eraindil, no, the "save a cake" intent will happen outside of your app, you need to define what "save a cake" means to your app Jun 09 09:35:23 other apps could do other things with the "save a cake" Jun 09 09:35:49 ok Jun 09 09:35:59 we have a model cake. Jun 09 09:36:14 the view display some information about the cake Jun 09 09:36:24 the cake is save inside a json on the phone Jun 09 09:37:03 the view possess a save button to register cake modification (suppose we have field about the cake llike for his name) Jun 09 09:37:29 when i pressed "save", the json bject will be update and fluch into the file Jun 09 09:37:59 with some controll logic to asure that the field are well filed. Jun 09 09:38:37 then you can handle that without activities (external inputs) Jun 09 09:38:39 does the activity handle this logic or can make a "service" or a "controller" that could handle all this logic? Jun 09 09:38:44 i'm looking for a service that i can use to store some data on a cloud for a simple practice app i'm doing. really small strings of text and few calls to the server. Jun 09 09:39:25 NateRiver, isn't your idea breaking many copyrights there? Jun 09 09:39:37 eraindil, no, the activity does not, you could use Preferences, but you're likely going to need an internal store Jun 09 09:40:13 James0r, what is "the cloud" that you are referring to? Jun 09 09:41:15 wakelock, sounds like fair use to me Jun 09 09:41:53 redengin https://creately.com/diagram/iap4ztzr1/i1DDfdi1zwOGEuGZHc5HD8Y%3D Jun 09 09:42:21 The diagram you requested doesn't exist or the link you entered is invalid Jun 09 09:44:46 redengin can you see the uml diagram? Jun 09 09:50:25 eraindil, nope Jun 09 09:51:10 well, drop it. i can't use this tool in fact. i cna't add method nor field Jun 09 09:52:16 eraindil, just give a text synopsis, it sounds like you want to persist some state (of a cake) Jun 09 09:53:05 the real app is about an app to manage magic card deck Jun 09 09:53:36 the user start the app he get on a screen that display some news and top deck of the month. Jun 09 09:53:57 after that he can go manage his own stuff (meaning profile or deck list) Jun 09 09:54:31 when he goes to his own deck list we have to check if the user is connected Jun 09 09:54:44 if not we have to display a login screen Jun 09 09:55:00 if not we goes to the destination screen. Jun 09 09:55:32 i want to seperate logic from display Jun 09 09:56:04 the patter use is the mc-mcv Jun 09 09:56:10 mc is server side Jun 09 09:56:12 "Carefully explaining your problem is half the solution." Jun 09 09:57:04 i use to make webservice and i would like as in ws, seperate display from business logic Jun 09 09:57:42 so i wonder if it's possible to make activities delegate logic to controller and service? Jun 09 09:57:50 including activities creation Jun 09 09:57:55 where is the trust of the deck? Jun 09 09:58:09 the trust? Jun 09 09:58:17 sorry i don't understand that word Jun 09 09:58:28 in this context Jun 09 09:58:29 how do you know that the player's deck is authentic? Jun 09 09:58:43 because of connexion. Jun 09 09:58:58 the server contain already the data about the deck and the user. Jun 09 09:59:13 the user can perfor CRUD from the android app on the deck Jun 09 10:00:34 do you want to allow the user CRUD to persist locally or require server synchronization? Jun 09 10:02:34 both Jun 09 10:02:50 the user can work locally Jun 09 10:03:32 but when the connexion is on the app synchronize with server Jun 09 10:04:30 eraindil, then you don't need activities, but a service that monitors connectivity to sync Jun 09 10:05:00 yep Jun 09 10:05:15 but about managing navigation through activities? Jun 09 10:05:33 i would like to centralized that Jun 09 10:06:11 I don't think you need activities, you're talking about managing a ui based on a deck right? Jun 09 10:06:36 don't you just need a db of the deck and crud methods? Jun 09 10:07:15 then just sync that db when connectivity appears? Jun 09 10:07:36 yes Jun 09 10:07:47 but the deck can be save locally Jun 09 10:08:00 and of course we got several screen Jun 09 10:08:04 eraindil, thats the db Jun 09 10:08:37 hum. Jun 09 10:08:45 to render the screens you'd query the db Jun 09 10:08:51 yep Jun 09 10:09:47 to perform the crud on this deck ok but if the user want to go to profile setting how can i manage to redirect there Jun 09 10:10:12 does the "profile" activity has to be launch from the previous one activity? Jun 09 10:10:20 eraindil, are you asking how to change to a profile screen? Jun 09 10:10:38 yep the navigation throught the different screen Jun 09 10:10:58 eraindil, no, preference screens are just a guidance, you can change to a new layout anytime you want Jun 09 10:11:36 ok. so we start an intent to make the "profile" activity, right? Jun 09 10:12:21 eraindil, no you just make a linkage (button, or whatever) that transfers to the new view Jun 09 10:13:09 eraindil, if you want that linkage reusable, certainly use an intent, but its the same process Jun 09 10:13:53 so in the view i can define the navigation directly? Jun 09 10:14:29 and about some navigation logic like redirect to the login page if the user want to acces profile screen and he's not connected? Jun 09 10:16:26 eraindil, http://stackoverflow.com/questions/2072244/android-what-is-better-multiple-activities-or-switching-views-manually Jun 09 10:17:27 I gotta go to bed, good luck Jun 09 10:17:41 thank you Jun 09 10:17:46 good night Jun 09 10:17:56 got to go too Jun 09 10:17:58 :) Jun 09 10:18:00 see you Jun 09 10:18:03 quit Jun 09 10:18:03 how could I implement a spinner like the one in contacts app of lollipop in the add new contact activity? Jun 09 10:18:12 you forgot / Jun 09 10:19:20 how do you make animation like in WhatsApp add attachment popup? Jun 09 10:22:54 Any help with this: http://stackoverflow.com/questions/30615983/android-java-lang-securityexception-despite-having-declared-uses-permission Jun 09 10:26:04 Hey! Jun 09 10:27:51 I need some help ^^ Jun 09 10:29:01 http://imgur.com/jacoj Jun 09 10:29:05 ask instead of asking to ask.. if anyone know it, you will get answer. Jun 09 10:29:20 Hey, im considering setting up Picasso as a singleton. Any pro's / con's towards memory-usage with a singleton? Jun 09 10:29:22 ok ^^ Jun 09 10:29:38 chrisaardal, Picasso is already a singelton Jun 09 10:29:41 lol Jun 09 10:29:49 Picasso.from(context) will always return the same instance Jun 09 10:30:04 so my problem is: I would like to like polyline in google maps knowing that I'll note use google maps in my app, I would like to draw with animation a line then circle then line then cercle .. Jun 09 10:30:48 danijoo, despite which context im passing to it? Jun 09 10:30:55 yes Jun 09 10:31:02 ah okay Jun 09 10:31:03 ty Jun 09 10:31:07 it will use context.getApplicationContext() internally Jun 09 10:31:32 noureddine: in my experience, Google Maps is very limited in regards to drawing on the map, and very slow. Jun 09 10:33:04 oiZo: what I would to say is just a concept of polyline Jun 09 10:37:46 how can i call startIntentSenderForResult from a fragment? Jun 09 10:47:12 So have anybody used QT to write an android app? Jun 09 10:47:17 or Qt` Jun 09 10:50:04 someone even wrote a library for it Jun 09 11:01:27 hello, how do i fix "The project is using an unsupported version of the Android Gradle plug-in (0.12.2). The recommended version is 1.2.3" error ? Jun 09 11:02:16 im trying to move some project from eclipse to android studio Jun 09 11:04:42 Candyman: update the dependency in your build.gradle http://stackoverflow.com/questions/24599785/android-studio-unsupported-version-of-gradle-plugin Jun 09 11:16:52 hi I have Layout with fragment and ListView in it. Than I have BaseActivity, ToolsActivity(returnsArrayAdaptare with data for ListView), and ListFragment. I need to repopulate that listView with new data based on data and features from ToolsActivity. Jun 09 11:16:52 In BaseActivity - I made "public static ToolsActivity toolsActivity;" and in in ListFragment tried to use toolsActivity, but there is unknown. I did that according to answer from "Parag Chauhan" from http://stackoverflow.com/questions/10265352/pass-arraylist-from-activity-to-listfragment Jun 09 11:16:52 How would you repopulate listView in such app layout? Jun 09 11:21:07 bolovanos, without reading all of that, you can swap adapter or the underlying list and then call notifyDataSetChanged() om the adapter Jun 09 11:24:50 danijoo, now i have some generic data that i am passing to listView in class extending listFragment. First of all i need to pass data to that class Jun 09 11:25:46 notifyDataSetChanged() seems to be part of BaseAdapter(), so you suggest to use BaseAdapter instead of ListFragment? Jun 09 11:26:02 without ()... Jun 09 11:26:10 you can get the listfragments adapter. listFragment.getAdapter() Jun 09 11:26:33 is it possible to build android 5 (more specifically 5.1.51) with openjdk 1.8 ? most linux distributions do not have openjdk 1.7 in their repos. Jun 09 11:26:47 cauchy1, yes Jun 09 11:31:59 is ACTION_PICK is a good idea? Jun 09 11:32:06 anyine familiar with mediamuxer? i put frames to mediacodec then to mediamuxer. it works on most devices but not on motorola moto g :s Jun 09 11:32:54 to throws illegalstateexception when stopping muxer Jun 09 11:33:16 also some error from native(?) like 06-09 13:32:57.956: E/MPEG4Writer(28508): Missing codec specific data Jun 09 11:33:26 danijoo: thanks. trying with EXPERIMENTAL_USE_JAVA8=1 Jun 09 11:33:44 i'd just install oracles java Jun 09 11:33:58 you can build/get it for every linux os Jun 09 11:33:58 Ashiren: it can't play the media type you want to use, i suppose Jun 09 11:33:58 tried it and it failed Jun 09 11:34:08 danijoo, did not get it - have you red my question? Jun 09 11:34:31 bolovanos, yes. but i think you are lacking the basics of the android framework Jun 09 11:34:59 And i dont have the time for huge explanations right now, so somebody else must fill ;) Jun 09 11:35:05 ok Jun 09 11:35:26 fill a pint of beer? Jun 09 11:37:03 Has anyone else updated to OSX 10.11 El Capitan? There currently is no sub pixel anti-aliasing anymore in Android Studio for me :/ https://i.imgur.com/ol19Bb6.png Jun 09 11:37:49 Hey guys do someone how create his own Chronometer? Because if I have a look at the Source Code of the normal Chronometer there is this annotation @RemoteView and @android.view.RemotableViewMethod Jun 09 11:37:56 know* Jun 09 11:38:14 which I cant use at my own Chronometer Jun 09 11:39:52 mrfreemanblack, there is a Chronometer View if that's what you're asking. Jun 09 11:40:25 yeah i looked at it, if I just extend my customView with Chronometer Jun 09 11:40:31 I got a inflation error Jun 09 11:40:52 I use the Chronometer for a notification Jun 09 11:41:03 I've created a new app listing on the Play Store and uploaded an APK into the Production channel without yet publishing, can I at this point then upload a higher version build into the Beta channel and only have the Beta channel go live when I hit the publish button? Jun 09 11:41:27 or will it push Production as well as Beta out there? Jun 09 11:41:55 If I use the normal Chronometer via xml and set my NotificationView with the normal Chronometer Class Jun 09 11:41:57 everything is working good Jun 09 11:42:21 only if I try to create my own, then I got a ClassnotFoundException Jun 09 11:42:51 could it be because of the Annotations --> @android.view.RemotableViewMethod Jun 09 11:43:08 which I cant access Jun 09 11:43:10 I have an URI with content://com.google.android.apps.photos.content/ but with getContentResolver().openInputStream(myURI); i get a FileNotFoundException, is anybody as experience such thing? Jun 09 11:50:28 i have a layout with in it an image and some textviews. I want the user to be able to click the entire thing and have a ripple show up while i handle the click. How can i get this ripple? Jun 09 11:50:49 osxorgate, set it as foreground Jun 09 11:51:49 danijoo: what is 'it' in this case? Jun 09 11:52:19 the ripple Jun 09 11:52:27 preferrably a 'standard' ripple thing from the appcompat lib Jun 09 11:52:44 appcompat has no ripple Jun 09 11:52:51 NOOOOO Jun 09 11:52:54 danijoo: sup? Jun 09 11:53:07 hey thepoosh :) Jun 09 11:53:22 danijoo: for example i have a listview with a standard ArrayAdapter, it shows ripples without me doing anything Jun 09 11:53:40 osxorgate, there is no ripple before android lollipop. Jun 09 11:53:52 so i would have to make my own xml file with a ripple in it, and set it as android:foreground on the enclosing viewgroup ? Jun 09 11:53:52 its not part of support lib Jun 09 11:54:07 osxorgate, yes but you have to check if its a 5.x device before that Jun 09 11:54:14 you can set ripple if its not Jun 09 11:54:53 cant* Jun 09 11:55:21 okay.. but if i do it in the layout xml it should work regardless of os version, amiright? Jun 09 11:56:04 what is the default permission of normal google play apps? Jun 09 11:56:10 osxorgate, no Jun 09 11:57:18 it will give you a ClassDefNotFound because it cant inflate the RippleDrawable on 4.x Jun 09 11:58:07 ok so i should do something with /drawable-v21 Jun 09 11:58:11 yep Jun 09 11:58:23 aight.. and for <21 ? some placeholder maybe? Jun 09 11:58:43 some kind of default selector Jun 09 11:58:54 like changing color on click or overlaying with an alpha color Jun 09 12:02:13 ok thanks Jun 09 12:17:43 "Please note, we'll do our best to respond to your request within 2 business days. This depends heavily on the complexity of your app transfer request, and the completeness and accuracy of the information you've provided. In addition, please expect delays during holidays. We appreciate your patience while we process your request." I just tried https://support.google.com/googleplay/android-developer/answ Jun 09 12:17:43 er/6230247?hl=en Jun 09 12:17:48 will see :)) Jun 09 12:18:53 transfering an app to another acc? Jun 09 12:19:01 indeed Jun 09 12:24:45 fg Jun 09 12:25:05 surf2b1, your implementation worked Jun 09 12:25:13 and I'm done with my app :) (sort of) Jun 09 12:25:17 Thank you Jun 09 12:25:21 Vercinger: good to hear :) Jun 09 12:26:19 Is there a way to import app_Settings and frameworks_base into Android Studio ? Jun 09 12:28:17 guys, does anyone have an example of the serachView widget(so I'm talking about the one that's in the action bar) that shows suggestions in a listview like a Jun 09 12:28:24 popup Jun 09 12:28:36 likefor example how the google play looks like Jun 09 12:29:44 luci1093, https://github.com/ppamorim/Cult Jun 09 12:29:46 This should help. Jun 09 12:35:45 Hi guys. I have an application where I need to check some info on the server in a certain time period all the time application is running. I guess I have to create a Service and do it there. My question is should it be bound Service or not? I check some info on the server and depending on result I have to start some activity, can I do it in a "started" Service? Jun 09 12:36:34 AlexBerdnikov, use a syncadapter or alarmmanger Jun 09 12:37:10 or JobScheduler Jun 09 12:37:45 danijoo, Can you please briefly explain why alarmmanager fit more for such a task? Jun 09 12:38:06 AlexBerdnikov, an alarm manager runs the job every X time and then stops until it has to run again Jun 09 12:38:14 a service would run forever and consume battery Jun 09 12:38:27 I have a question, i am using this library : https://github.com/nightwalkerkg/MaterialViewPager and i would like to replace all these cardViews with a custom one for each tab. Jun 09 12:38:31 Any ideas how to do it ? Jun 09 12:41:14 dex2goat, jobscheduler is api level 21 and it does not check network connection before running. Thats why I would suggest a sync adapter Jun 09 12:42:16 well there's this guy: https://github.com/evant/JobSchedulerCompat Jun 09 12:42:47 and you can use this: https://developer.android.com/reference/android/app/job/JobInfo.Builder.html#setRequiredNetworkType(int) Jun 09 12:42:49 danijoo, so alarmmanager or syncadapter? I'm noob in Adnroid and not sure what fits more... Jun 09 12:42:54 Warning this project is not maintained! ^^ Jun 09 12:43:11 ow Jun 09 12:43:19 AlexBerdnikov, read the documentation on both and decide Jun 09 12:43:28 Ok, thanks mate! Jun 09 12:43:49 well actually GcmNetworkManager seems nice Jun 09 12:45:58 wee after some brain damaging i finally managed to get the mediamuxer working Jun 09 12:47:13 Nightwalkerkg, I'll look into it, thanks Jun 09 12:48:03 Guys, is there a way to make RecyclerView only inflate one layout that will not replicate constantly as i scroll ? Jun 09 12:48:37 I have an app that is just a single activity. I want to now add a settings page. Should I make the settings page as an activity which I launch with startActivity? Jun 09 12:49:29 johnflux, that or use a settings fragment Jun 09 12:49:37 Nightwalkerkg: When you inflate layouts you get views. The RecyclerView is recycling these views so they actually don't get replicated constantly as you scroll, just being cycled through a stack. Jun 09 12:49:41 its up to you Jun 09 12:49:56 danijoo: oooo Jun 09 12:50:32 danijoo: are you referring to PreferenceFragment ? Jun 09 12:50:37 i do Jun 09 12:51:25 danijoo: thank you very much - that's awesome :0 Jun 09 12:54:12 how do devs ussually seperate mvc in android? Just with naming? Jun 09 12:54:48 real mvc is pretty hard to accomplish in android.. Jun 09 12:59:11 dex2goat: did you get DexClassLoader working for your project? Jun 09 12:59:19 yes Jun 09 13:01:06 it was a minor issue at the end, the JAR I was loading from /sdcard/wherever/myfile.jar was not readable by the app due to filesystem permissions, and the stacktrace for the IOException did not indicate that in any way, only when checking new File("/..../myfile.jar").isReadable() I realized that was the problem. Jun 09 13:01:39 brb Jun 09 13:04:37 Hey, I'd like to create another strings file..... i've created an XML resource folder and a resource file in it with a string resource... how can I access that string? R.xml.myfile.string? Jun 09 13:07:47 viran: Just create another file in res/values and name it whatever.xml. Any string will be added to R.string Jun 09 13:08:30 Am looking for a uniqe ID (That will not change) to save to Parse. With some other info. That will stay the same either the user re-install the app and so on. Any clues? I have thught about Secure.ANDROID_ID but it looks like it's depricated ? Jun 09 13:13:23 Datasmurfen, what do you want to do wiith it? Jun 09 13:14:05 android device ID can change if user updates the system or makes a factory reset Jun 09 13:14:20 Save it to Parse.com (cores) to be able to log information, and see what the last user input is. Jun 09 13:15:00 I see someone talk about IMEI number Jun 09 13:15:05 TM.getDeviceId() Jun 09 13:15:09 To be a solution Jun 09 13:15:16 Datasmurfen, tablets have no imeu Jun 09 13:15:17 imei Jun 09 13:16:02 i thin android id is fine Jun 09 13:16:12 the number does not change a lot Jun 09 13:16:26 The app is only for phones.. SO i think IMEI number is a good option Jun 09 13:16:46 Datasmurfen, i think some roms block imei access though Jun 09 13:17:12 and users can activly revoke imei access when android M is ou Jun 09 13:17:13 out Jun 09 13:22:57 Hey guys. I need some help here. If someone can take a look -> http://stackoverflow.com/questions/30627223/views-not-wrapping-content-inside-card-view Jun 09 13:23:10 don't track things with IMEI. It makes privacy-concious users angry. Jun 09 13:23:27 if you have to track devices somehow, just make a random number and assign it to the device. Jun 09 13:24:45 http://pastebin.com/RVqs3zeg - getBaseContext & getContentResolver - Can not not resolve method. Any clue how to declare or inialize this parameters? Jun 09 13:25:03 Question: It doesn't seem like there is any devices running Android SDK v14 according to my Google Analytics, and I found a SO comment saying Google was pushing SDK v15. Is there a good reason for this, is there problems with v14? Jun 09 13:26:00 the reason for question, is I want to bump minSdkVersion Jun 09 13:26:49 oiZo, its just that api 15 was a pretty small upgrade Jun 09 13:27:09 most manufactures adopted it so kinda all devices received an update from 14 to 15 Jun 09 13:28:02 so it's not due to any problems with v14? Jun 09 13:28:03 also there where only 2 month between release of 14 and 15 Jun 09 13:28:21 no. Jun 09 13:28:50 14 has some bugs that were fixed in 15. but nothing device breaking Jun 09 13:28:56 danijoo: users won't be able to block android ID when android M is out? Jun 09 13:29:07 Mac_Weber, they would Jun 09 13:29:23 they can block pretty much everything then Jun 09 13:29:46 danijoo: then there will be no reliable way to get an id? Jun 09 13:29:49 super, thanks. It just seemed a bit odd that i didn't have any session from that version, so obviously I just wanted to make sure I wasn't missing anything Jun 09 13:30:01 Mac_Weber, you can get it with user permission :) Jun 09 13:30:14 g'morning all Jun 09 13:30:27 oiZo, i dont have any too. with more than 500k installs ^^ Jun 09 13:31:26 danijoo: I hope M comes to Note 4 soon =D Jun 09 13:38:18 * danijoo cant wait to remove all permissions except internet from facebook.apk.. Jun 09 13:39:27 I opted out of FB app years ago :-) Jun 09 13:39:56 I need it for stuff like app promotion Jun 09 13:46:29 Hey everyone! Jun 09 13:46:35 good afternoon Jun 09 13:46:41 I have a question regarding Android development Jun 09 13:46:59 hi Bavilo, whats up? Jun 09 13:47:49 I am currently working on an App which is basically a Tabbed view. In one tab I need to establish a Bluetooth Connection to a module, in another Tab I want to collect data from the input stream and plot this data against time Jun 09 13:47:52 now.... Jun 09 13:47:57 where do I put what? Jun 09 13:48:04 where do I put the bluetooth connection stuff Jun 09 13:48:09 the programming I mean Jun 09 13:48:23 Right now I have the bluetooth connection along in MainActivity Jun 09 13:48:45 how is this normally handled? Jun 09 13:49:07 I have opened a question on stackoverflow which gives a bit more information and some of the code Jun 09 13:49:08 http://stackoverflow.com/questions/30697305/android-tabbed-activity-with-bluetooth-and-graph-plotting-how-to Jun 09 13:49:39 The MainActivity on that link doesn't contain the bluetooth connection Jun 09 13:51:11 this is my current MainActivity.java http://pastebin.com/UCfsGKvX Jun 09 13:56:27 seems like it would make sense to put it in the fragment that is displaying the bluetooth stuff Jun 09 13:56:45 it either that or you have to surface all of that function from the activity into the fragment Jun 09 13:57:31 right now I have done it like this Jun 09 13:57:42 for instance, the blueooth tab fragment will have a connect button Jun 09 13:57:47 it works like so: Jun 09 13:57:49 btn_connect.setOnClickListener(new View.OnClickListener() { Jun 09 13:57:49 public void onClick(View v) { Jun 09 13:57:50 ((MainActivity)getActivity()).connectToDevice(); Jun 09 13:57:50 } Jun 09 13:57:50 }); Jun 09 13:59:35 http://i.imgur.com/h7Sh9wN.png is the fab concept looks OK? please ignore my poor Photoshop skills. Jun 09 13:59:43 but lets say I put the connection stuff into the bluetooth tab fragment, I will also have to access some of those methods from the graph plotting fragment Jun 09 14:00:07 so no matter where I put it, I have to access it from all over the place Jun 09 14:00:13 but what makes the most sense? Jun 09 14:00:23 danijoo: got a close approximation project I can mimic? Jun 09 14:04:22 gmail on tablet (landscape) has 2 fragments, a list and content. It also has a search button in the toolbar, aligned with the right part of the left fragment. How is this done? Jun 09 14:04:49 Bavilo: does the graph uses bluetooth as well? Jun 09 14:04:59 what free mapping software out there supports 3D objects in android? something like Nutiteq's HelloWorld3D Jun 09 14:05:39 the graph has to get its data from bluetooth, it will then take this data and plot it against time Jun 09 14:06:04 hey guys, when developing for android TV, if I set / hit a breakpoint the OS kills the app after 5 seconds. I guess this has to do with the TV os being stricter about app responsiveness/stability. anyone know how to get around this? Jun 09 14:06:29 i would put either in activity or bluetooth tab Jun 09 14:06:50 if activity, simply put reference to activity Jun 09 14:07:26 you mean MainActivity? Jun 09 14:07:54 yes Jun 09 14:08:04 MainActivity activity in tabs Jun 09 14:08:14 yoavst, no it's not ok, you can follow some guidelines here: http://www.google.fr/design/spec/components/buttons-floating-action-button.html Jun 09 14:09:31 Ok I have no placed the bluetooth connection stuff into the bluetooth fragment Jun 09 14:09:38 it works fine, and makes everything a little cleaner Jun 09 14:09:40 Bavilo, i'm not sure if i understood your case, but, have you thought about using Service? Jun 09 14:10:06 Im sorry I am very new to android, what do you mean by this? Jun 09 14:10:19 this app is not supposed to be highly professional Jun 09 14:10:25 but I want to get the hang of it Jun 09 14:10:33 I know the guidelines. The only part is violate is "Use the circle-shaped icon consistently to enforce the primary action pattern across apps.", but it is still a circle Jun 09 14:11:06 in this lib attempt, i use service to do everything related to bluetooth, and callback the activity or send broadcasts: https://github.com/ecdpalma/bluetoothlib Jun 09 14:11:36 ^ (no warranties of any kind, etc, etc) Jun 09 14:12:18 oh good point, service would be better Jun 09 14:12:22 I understand too little for now :( Jun 09 14:12:29 no Idea what that is doing Jun 09 14:12:41 what is the advantage? Jun 09 14:12:46 well, stick with the bluetoothchat demo first Jun 09 14:13:10 Bavilo, if you expect to maintain a persistent connection (like a rfcomm/spp bt connection), you need to put the connection and the network code in a service. Otherwise if the user switches to another app, rotates the phone, etc, you lose your bt state. Jun 09 14:13:33 really? o.o Jun 09 14:13:36 ^ exactly Jun 09 14:14:09 hmm, when I start my app, and connect to the module Jun 09 14:14:20 and then switch to another app the connetion is still active... Jun 09 14:14:27 the module is still connected Jun 09 14:14:44 only when I really close my app, the module is not connected anymore Jun 09 14:14:56 not 100% guaranteed because android can still kill the process Jun 09 14:15:20 well maybe I should explain what I need this for... Jun 09 14:16:41 basically I have one tab to establish a connection to a bt module, on another tab I will have some drop down menus to adjust some values, I will submit these values, perhaps a byte array with those values, to the bt module, to a arduino Jun 09 14:16:53 the arduino will take the data and do something with it... Jun 09 14:17:11 at the same time, the arduino will also send data, in the same manner Jun 09 14:17:28 on the android side, it will also need to collect this data, and do something with it.... Jun 09 14:17:40 i.e. plot a graph, display temperatures, display times, etc... Jun 09 14:18:14 now, let's say the process has been started from my phone, and I lose connection to the BT module, the arduino will still do its thing... Jun 09 14:18:35 Bavilo, nice. you certainly would need to get things in background Jun 09 14:18:38 so once I reconnect to the bt module, I need to collect the arduino data again, and continue to display values Jun 09 14:19:09 basically the phone is only really needed once to set the initial values, and press start Jun 09 14:19:18 after that I want to use the phone only to monitor Jun 09 14:19:27 and PERHAPS change a value or two and resubmit Jun 09 14:19:40 i would try to understand how the services way work. in fact, it was what i did Jun 09 14:19:45 would this work the way I am doing it now? Jun 09 14:19:53 hmm ok Jun 09 14:20:23 could you point me to some place where I can read up on this? Jun 09 14:21:35 Bavilo, you can do in the activity, using asynctask or other thing (threads), but if the activity is recreated, you lose the reference to activity objects Jun 09 14:22:15 i'm not sure, as i always do background work in services, but maybe fragments can be set keep the references Jun 09 14:22:45 bitkiller, for services, you should start with android docs Jun 09 14:22:45 oh another thing Jun 09 14:23:07 the arduino will submit some data, such as: Jun 09 14:23:38 Should I use PreferenceActivity or PreferenceFragment ? Jun 09 14:24:05 5, 66, 60, 65, 72, 78, 58.98, etc........ Jun 09 14:24:12 it will do this permanently Jun 09 14:24:23 and I need to fetch this on the android side Jun 09 14:24:32 what would be the best way to submit this data? Jun 09 14:24:39 arrays? a long string? Jun 09 14:24:42 i think my lib attempt linked above may serve as a reference too, though it only writes Jun 09 14:25:02 Bavilo: just as a numbers Jun 09 14:25:04 Bavilo: just as numbers Jun 09 14:25:07 you'll be dealing with sockets, thus byte arrays Jun 09 14:25:19 well its also some floats Jun 09 14:26:02 you'll have to convert them Jun 09 14:26:34 hmm Jun 09 14:26:58 float in 4 ints technically Jun 09 14:27:04 ops Jun 09 14:27:11 1 int* Jun 09 14:27:45 so convert the float to int on arduino? Jun 09 14:27:52 submit array with ints Jun 09 14:28:00 then receive on android Jun 09 14:28:06 and convert the int back to float Jun 09 14:28:12 or maybe the streams used by bluetoothsocket in android have some convenience method Jun 09 14:28:12 anyone experienced with reverse SSH? how to set the auth public key for the reverse connection? (non rooted device) Jun 09 14:28:14 Bavilo: no, just output as a float Jun 09 14:28:14 in java there is something like Float.intValue() Jun 09 14:28:26 Bavilo: you don't need to convert to an int Jun 09 14:28:36 ah ok, I was thinking about Float.parseFloat() Jun 09 14:29:00 Takes a String Jun 09 14:29:18 Cant you just cast it? Jun 09 14:29:28 or you can convert the stream to DataOutput/InputStream Jun 09 14:29:31 so Float.intValue() will return an int? or float? Jun 09 14:29:33 int intValue = (int) myFloat; Jun 09 14:29:57 it will be int but it will be much different Jun 09 14:30:02 eh well I need to go the other way around dont I? Jun 09 14:30:02 it will be ieee something Jun 09 14:30:10 http://developer.android.com/reference/java/io/DataOutputStream.html Jun 09 14:30:10 on the arduino the temperature is a float Jun 09 14:30:14 https://en.wikipedia.org/wiki/IEEE_floating_point Jun 09 14:30:21 in order to submit all the data at once I need to set up an array of ints Jun 09 14:30:25 but i think java would handle it internally Jun 09 14:30:28 so I need to convert the float to int first? Jun 09 14:30:43 http://stackoverflow.com/questions/15421476/outputstream-to-dataoutputstream-for-bluetooth-communication Jun 09 14:30:59 Bavilo: void writeFloat(float f) { byte * b = (byte *) &temp; Serial.write(b[3]); Serial.write(b[2]); Serial.write(b[1]); Serial.write(b[0]); } Jun 09 14:31:13 Bavilo: that's how you write a float as a series of 4 bytes Jun 09 14:31:26 ah ok... Jun 09 14:31:32 Bavilo: it depends how much precision you need Jun 09 14:31:40 just 2 places Jun 09 14:32:01 Bavilo: so we could multiply by 100, and send as an int? Jun 09 14:32:22 Don't write a float as raw bytes unless you're positive the other end of your ocmmunication uses exactly the same representation and endian-ness Jun 09 14:32:27 hmm that would be easy...yea! Jun 09 14:32:36 dragorn: well he's writting the other end, so of course he'll have same endian-nes Jun 09 14:32:37 has anyone here used OSMdroid? Jun 09 14:32:44 Bavilo: if you multiplied by 100, would the number still be less than 255? Jun 09 14:32:50 johnflux, assuming it's android to android Jun 09 14:32:57 johnflux, android to microcontroller with bluetooth, absolutely not Jun 09 14:32:57 emm no Jun 09 14:32:57 dragorn: no, not assuming anything Jun 09 14:32:59 it would not Jun 09 14:33:16 I would need an int Jun 09 14:33:18 dragorn: oh, wait, yes, you're right with the code I wrote :-D Jun 09 14:33:26 dragorn: I usually do it endianness agnostic sorry Jun 09 14:33:47 johnflux, heh; yeah for anything but float send it in network endianness and be happy. Floats are a bitch cross-platform Jun 09 14:34:00 Bavilo: would be less than 65535 ? Jun 09 14:34:11 dragorn: yes, sorry Jun 09 14:34:20 I usually do your method - multiply by the practical precision and ship as a network-endian int Jun 09 14:34:21 so basically: Jun 09 14:34:21 Float tempF = 72.51 Jun 09 14:34:22 int tempI = 72.51 * 100 Jun 09 14:34:22 on Android side: Jun 09 14:34:22 Float temp = tempI / 100 Jun 09 14:34:35 ./ 100.0 Jun 09 14:34:36 Bavilo: yes, but how many bytes do you need for this Jun 09 14:34:50 Bavilo: when you multiply by 100, will the value always be less than 65535 Jun 09 14:34:55 yes less than 65535 Jun 09 14:34:59 okay, then: Jun 09 14:35:05 if it's a temp in F i'd assume yes :) Jun 09 14:35:33 Bavilo, also if you're reading off a temp sensor, usually they report in integer (for the same reason, shipping float is hard), so you can maybe just ship the raw value and convert to float once Jun 09 14:35:51 Serial.write(templ >> 8); Serial.write((byte)templ); Jun 09 14:36:02 Yea I could check the sensor for this Jun 09 14:36:09 dragorn: did I make any mistake there? ^^ Jun 09 14:36:30 Serial.write((byte)(templ >> 8)); Serial.write((byte)templ); Jun 09 14:36:36 Then on the android side: Jun 09 14:36:42 johnflux, I wouldn't bother just to get 2 bytes myself Jun 09 14:36:49 bluetooth is plenty quick enough to not care :P Jun 09 14:37:00 dragorn: android doesn't have a "write long" function though Jun 09 14:37:07 so either way you have to do this manually Jun 09 14:37:24 er, arduino I mean Jun 09 14:37:35 yea this doesnt have to be quick at all Jun 09 14:37:48 it would be more than enough if the data comes in every 5 seconds Jun 09 14:37:50 or so. Jun 09 14:37:57 it is just for monitoring Jun 09 14:38:38 Bavilo, sounds like some stuff I've written Jun 09 14:38:59 really? Jun 09 14:39:18 actually I just got my PCBs back for rigging up a network of rfmb modules for monitoring 433mhz temp sensors Jun 09 14:39:35 Ah I just checked my arduino sketch again, the temperature is a double Jun 09 14:39:35 but I'm going to shove them over TCP to a central server since it's easier than getting networking on arduinos Jun 09 14:39:36 Bavilo: if you don't care about speed Jun 09 14:39:39 Bavilo: just do: Jun 09 14:39:43 not sure if a double is neccesary... Jun 09 14:39:44 Bavilo: Serial.print(templ) Jun 09 14:39:59 Bavilo: horrible inefficiency, but very easy to read and debug Jun 09 14:40:05 ok Jun 09 14:40:13 so that sends the value as a string Jun 09 14:40:23 yup. converting it to a string and back again works fine. For something that's going to report that intermittently you're fine. Jun 09 14:40:24 so it would send literally "343" Jun 09 14:40:43 Bavilo: but do still do the *100 and casting to an int Jun 09 14:40:52 yea thats how I do it right now Jun 09 14:41:11 for instance Jun 09 14:41:33 from android I sent a string like this "1:400" Jun 09 14:41:38 on arduino I would do this Jun 09 14:41:56 data = bluetooth.readStringUntil('\n'); Jun 09 14:41:56 state = splitString(data, ':', 0).toInt(); Jun 09 14:41:56 frequency = splitString(data, ':', 1).toInt(); Jun 09 14:42:04 yup Jun 09 14:42:37 well I could concatenate all the values to one big string Jun 09 14:42:38 Bavilo: btw, are you using low energy bluetooth? Jun 09 14:42:44 submit that, and do it like I did before Jun 09 14:42:46 no Jun 09 14:42:54 its an HC-06 Module Jun 09 14:42:58 okay Jun 09 14:43:01 no, btle is weird, he wouldn't be doing simple rfcomm with it Jun 09 14:43:09 hi guys, I've a colleague doing a "mastermind" app for practicing, he has 4 buttons, on button click sets the button background using button.getBackground().setColorFilter(), it works fine in lollipop but on JB on button UP it becomes gray (not the color he sat) until you press another button Jun 09 14:43:13 Bavilo: I've been trying to switch to ble but failing. it's hard Jun 09 14:43:18 I see Jun 09 14:43:20 it can kind of fake spp, but it's weird Jun 09 14:43:22 I will skip it then for now :D Jun 09 14:43:22 dragorn: yeah I've been hitting that problem :-( Jun 09 14:43:24 is that a button state or something else? I've tried to add button.invalidate() but nothing changed Jun 09 14:43:45 so you guys think I could just concatenate all values together to one string? Jun 09 14:43:51 sure its not very efficient... Jun 09 14:44:18 Bavilo, I used the same series of bt modules... http://kismetwireless.net/screenshot/kisbee-02-00B.png Jun 09 14:44:34 yea its similar Jun 09 14:44:39 Bavilo, and http://kismetwireless.net/screenshot/kisbee-assembled.jpg ... can see it peeking out the bottom Jun 09 14:44:55 this is the one I have http://img02.taobaocdn.com/imgextra/i2/12774208/T2gb4kXfJOXXXXXXXX_!!12774208.jpg Jun 09 14:44:56 Bavilo, they're decent, I just wish they were more consistent Jun 09 14:45:14 ok nvm yours is more beefed up :D Jun 09 14:45:29 Bavilo, yup. The PCB is my own; the hf06 is soldered directly onto it Jun 09 14:45:35 ah nvm that IS the hc-06 Jun 09 14:45:40 now I see it on the bottom Jun 09 14:47:09 hmm ok so lets say I have multiple ints some floats, etc, how can I easily put them all in one string? Jun 09 14:47:13 and just send that one string Jun 09 14:47:32 just make the equivlaent of a csv Jun 09 14:47:34 and parse it Jun 09 14:47:49 not the most efficient as you say, but if you're doing it at 1hz or whatever, who cares Jun 09 14:48:30 hmm, equivalent of a csv, how do to that? Jun 09 14:48:35 ah sorry for asking so much :( Jun 09 14:48:59 value,value,value Jun 09 14:49:33 lets just say I have: Jun 09 14:49:34 int val1 = 10; Jun 09 14:49:34 int val2 = 20; Jun 09 14:49:34 flaot val3 = 45.67; Jun 09 14:49:34 how to put them together Jun 09 14:50:31 "Your transfer is complete!" following the apk transfert I talked/made above Jun 09 14:51:26 well actually..... Jun 09 14:51:58 hmm no. Jun 09 14:52:22 Bavilo: String foo = String.format("%d,%d,%f", val1, val2, val3); Jun 09 14:52:58 ah nice, I didnt know that was possible Jun 09 14:53:00 thanks Jun 09 14:53:33 any thoughts on this http://stackoverflow.com/questions/30627223/views-not-wrapping-content-inside-card-view ? Jun 09 14:53:42 hi guys, I've a colleague doing a "mastermind" app for practicing, he has 4 buttons, on button click sets the button background using button.getBackground().setColorFilter(), it works fine in lollipop but on JB on button UP it becomes gray (not the color he sat) until you press another button Jun 09 14:53:57 I've tried to set focusable to false but nothing changed Jun 09 14:57:06 alex88, show the code Jun 09 14:57:08 @surf2b1 how would I do this on the arduino side? Jun 09 15:02:28 Anyone ever worked with altbeacon library? Jun 09 15:02:44 danijoo: as simple as https://gist.github.com/alex88/99cd1337c1f7feb63b57 Jun 09 15:03:40 I think it's the color of the pressed state (since focusable is false) Jun 09 15:05:52 how important is it for onPrepareActionMode to return whether the menu was updated? Jun 09 15:06:00 alex88, I cant see where you remove the color Filters before setting a new one Jun 09 15:06:13 you will and with infinit color filters overlaying each other Jun 09 15:06:21 danijoo: I don't, it doesn't replace? Jun 09 15:06:56 alex88, not sure Jun 09 15:06:59 btw, you think that's the problem? Jun 09 15:07:00 i dont think Jun 09 15:07:29 it should be AddColorFilter if it doesn't replace, anyway, I think the problem is some kind of state Jun 09 15:07:55 maybe with the OS UI, since on lollipop it works fine Jun 09 15:08:00 anyone knows about parse on android i've been trying to figure this out for a while now, i keep getting a null object reference at line18 and 19 i thought parse sdk was not linked properly but i'm able to log into the app using parse user and on another activity i'm able to add data and upload to parse http://pastebin.com/ZFPQf9wQ Jun 09 15:08:02 problem is just on JB Jun 09 15:08:12 hm.. Jun 09 15:08:12 What does Atom mean here in the SDK manager system images? http://i.imgur.com/xSmRs9H.png Jun 09 15:08:16 since after click, before any other button click, it's gray Jun 09 15:09:08 hert: token is never even declared Jun 09 15:11:53 token is declared in the class Jun 09 15:12:33 droidian, intel atom is a CPI class Jun 09 15:12:36 CPOU* Jun 09 15:12:37 arg.. Jun 09 15:12:39 CPU Jun 09 15:13:19 danijoo: atom emul runs faster than regular x86 emul? Jun 09 15:13:25 have you tried? Jun 09 15:13:35 hert: You said you're getting a null object reference. So where is token initialized? Jun 09 15:13:40 xgearx, i dont use the AVDs Jun 09 15:13:52 even genymotion? Jun 09 15:14:05 thats not an avd :) Jun 09 15:14:09 yes i use genymotion Jun 09 15:14:16 xgearx: faster? there is only an intel atom option and an arm option, not regular x86 option i can see Jun 09 15:15:17 GodOfNaps at the top of the class before the onCreate Jun 09 15:16:08 in Android Studio ive lost that window where you can drag gui components into the designer, anyone know how to get it back? mighty frustrating Jun 09 15:16:21 danijoo: genymotion is emulator, avd is emulator too Jun 09 15:16:38 i asked about emulators, not only avds) Jun 09 15:17:22 so, nevermind Jun 09 15:17:38 hert: you should probably just paste the whole class. Jun 09 15:18:04 Is there a lib that's not deprecated to implement ImageView zoom and swipe left/right functionality ? Jun 09 15:18:25 damn this is absolutely silly, been looking for the window for 30 mins, grrr Jun 09 15:18:30 xgearx, ok. so I only used x86 emulator since 1 year. happy now? :) Jun 09 15:19:01 asked earlier maybe people can pitch in. There seems to a refusal from google to implement a DHCPv6 client in android for various reasons. Jun 09 15:19:05 GofOfNaps here's the whole class http://pastebin.com/RD8BWWca Jun 09 15:22:07 https://code.google.com/p/android/issues/detail?id=32621 just can't understand for the life of me why they are saying no Jun 09 15:22:12 hert: token is *never* initialized. You declare it, and then you try to use it, but you never do "token = new Token()" or the like. Jun 09 15:24:13 danijoo: ended up using touch listeners and making the button unclickable Jun 09 15:28:09 GodOfNaps yes you're right it wasn't Jun 09 15:28:17 thnaks Jun 09 15:45:35 anyone going to E3? Jun 09 15:46:00 I wish I could Jun 09 15:46:09 <3 Fallout 4 <3 Jun 09 15:46:24 I have never played any of the fallouts… guess It’s time to get with it.. Jun 09 15:46:39 burn him! Jun 09 15:46:53 hey, so getting a PackageManager from Context requires no special permissions whatsoever ? Jun 09 15:46:56 JakeWharton: in u2020, you have picasso in the dependency graph getting built with the Application context. Would it be more appropriate for that to be using the activity context in a smaller scope instead? Jun 09 15:47:08 emilsp, yep Jun 09 15:47:14 I was introduced to Fallout 2 when I was young so i'll always have a love for that game. I don't think it aged well though. Jun 09 15:47:18 it always uses the application context no matter what context you pass it Jun 09 15:47:23 danijoo, so I can create shit apps, spam people, and gather data about installed applications ? Jun 09 15:47:25 ahh, okay Jun 09 15:47:38 thanks Jun 09 15:48:22 emilsp, there is an error in this Jun 09 15:48:25 noone installs shit apps Jun 09 15:48:26 :D Jun 09 15:48:42 danijoo, yes, but essentially you are giving up your installed app data to facebook, not just google Jun 09 15:49:21 essentially, even if you push your app onto f-droid, open sourcey and privacy-conscious people can still get tracked Jun 09 15:49:22 emilsp, look at what permissions facebook requests Jun 09 15:49:39 danijoo, yes, I know, they require rights to your firstborn Jun 09 15:49:42 no reason to be feared about packagemanager if they get anything anyways :p Jun 09 15:50:00 danijoo, it's just rather useful from an attack point of view Jun 09 15:50:09 and without those extra permissions, packagemanager data is from no use Jun 09 15:50:22 because you just now that installed some apps Jun 09 15:50:33 you need further permissions to make valueable data out of it Jun 09 15:51:03 danijoo, really, all you need is to correlate different apps and there's valuable data right there, so apps can cross-advertise, if their business model is applicable Jun 09 15:51:28 for sure Jun 09 15:51:41 if you have Tinder, Happn, and OK Cupid, Facebook can advert dating sites to you Jun 09 15:51:42 and really, why is the package manager avialable to anyone anyway ? I'd rather that be an explicit permission rather than just something everyone gets by default Jun 09 15:51:49 of your app can Jun 09 15:51:52 or* Jun 09 15:51:57 exactly Jun 09 15:52:22 Hi, I'm trying to use Picasso with a custom OkHttpClient that contains an Authenticator to pass up authentication requests headers. For some reason, the authenticator doesn't seem to be working / headers aren't modified. Not sure if this is possible? Jun 09 15:52:29 if you have other apps already installed, why would you need to correlate Jun 09 15:52:38 you already have one app in place that can gather the data Jun 09 15:52:40 not for your reference Jun 09 15:52:57 but yeah. Jun 09 15:53:03 facebook might use strategies like that Jun 09 15:53:07 google might too Jun 09 15:53:11 thats their business model Jun 09 15:53:17 google knows all Jun 09 15:53:37 they’re pretty good about being slick about it though, at least it’s not invasive Jun 09 15:53:56 meh, I wish they respected the O in AOSP Jun 09 15:54:10 a few targeted ads here and there… really wish I hadn’t looked up those gas powered toothbrushes though Jun 09 15:54:32 relevant: http://mysocialsherpa.com/the-ultimate-retaliation-pranking-my-roommate-with-targeted-facebook-ads/ Jun 09 15:55:10 why is initializing a Canvas causing the app to go ANR? Jun 09 15:55:32 because you are doing it wrong i think Jun 09 15:57:03 razzledazzle: can you provide the class snippet Jun 09 15:57:19 razzledazzle, you need to exit the canvas context so it can actually draw something every 1/60th of a second Jun 09 15:57:22 how can we check the integrity of file uploaded to server using jsch for example we locally have md5 check sum ? Jun 09 15:57:38 s9iper1, send checksums Jun 09 15:57:52 s9iper1, and don't use md5, use sha1 at least Jun 09 15:58:28 emilsp, i could not find any example for md5 or sha1 for jsch for remote file any suggestions ? Jun 09 15:58:52 quinnjn, emilsp: the code below the canvas doesn't run at all Jun 09 15:59:11 s9iper, do you have access to the server side code ? Jun 09 15:59:42 s9uper1, if not, then there truly is no way to check the integrity of the data. And anyway, if you're using TCP, you shouldn't worry too much Jun 09 16:00:29 s9iper1, the way this works is that the client sends both the file and the checksum and the server compares it's own checksum with your checksum, if it doesn't match, the upload failed. Jun 09 16:01:11 quinnjn: Its simply this: Canvas canvas = new Canvas(bitmap); Jun 09 16:01:22 i have the access of server... but i still want to check its integrity so every thing goes fine.. i want to upload a file and than check the checcksum of both if its successful than i delete my local file and keep the remote Jun 09 16:01:42 server doesnot have the file already Jun 09 16:01:46 just trying to draw on a Bitmap to a file, btw, not on the screen Jun 09 16:01:51 emilsp, Jun 09 16:02:07 anyone know of any (free) Android OCR libraries or is Tesseract the way to go? Jun 09 16:02:24 s9iper1, then you send the file first, in whichever way you want to, and send a checksum as well Jun 09 16:02:51 i want to upload a file before uploading i am getting checksum and when file is uploaded than i want to check the check sum again so that i can match both and delete my local file emilsp Jun 09 16:02:52 s9iper, before you send the file, create a checksum from it using the same hash algorithm you'll be using on the serverside Jun 09 16:03:01 upload the file, check the md5, upload the md5, check md5 on server. if server md5 == uploaded md5, answer with 200, else answer with 4xx Jun 09 16:03:17 what danijoo said Jun 09 16:03:42 danijoo, how can i get the checksum on serve using jsch ? Jun 09 16:03:49 jsch ? Jun 09 16:04:04 jsch library to upload on sftp server Jun 09 16:04:09 s9iper, you read the file and pass it's contents to the hashing function Jun 09 16:04:12 sftp protocol Jun 09 16:04:15 no idea what jsch is but nearly every langauge has an implementation to check checksums Jun 09 16:04:26 ok Jun 09 16:04:29 if you're using sftp, then you shouldn't worry about hashing, sftp does it for you, for every chunk Jun 09 16:05:34 s9iper1 http://serverfault.com/a/499034 Jun 09 16:06:43 emilsp, so i dont need to worry about checksum with sftp ? Jun 09 16:07:24 s9iper1, yes, sftp protocol does it for you Jun 09 16:07:59 if you experience data corruption, it will most likely retry for a bit, and if it persists to fail, you'll get an error Jun 09 16:08:18 hi,what is the best way of using custom fonts ? Jun 09 16:09:48 sci-fic: Typeface.createFromAsset(context.getAssets(), "fonts/" + fontName); key is this snippet Jun 09 16:09:58 Is there a way to attach custom headers in Picasso? :| I think there used to be a way, but it seems the newer version of Picasso changed a little. Jun 09 16:11:01 ty razzledazzle Jun 09 16:12:03 sci-fic: be sure to make a font cache Jun 09 16:13:43 so weird, how can initializing Canvas cause an ANR :\ Jun 09 16:13:49 use calligraphy Jun 09 16:14:23 razzledazzle, you were asked for code.. Jun 09 16:14:31 I did provide it Jun 09 16:14:42 you provided a line Jun 09 16:14:56 nothing below that line runs Jun 09 16:15:14 ... Jun 09 16:15:22 well Jun 09 16:16:41 here it is guys http://pastebin.com/7NVFTmjk Jun 09 16:20:24 AdamJB, you could add an interceptor to add the header. Add the interceptor to the OkHttpClient, then pass that to the OkHttpDownloader, then to the Picasso builder. Jun 09 16:21:52 ok, I've been trying to use the Authenticator, which adds the auth headers in my other requests. That bit doesn't seem to work with picasso. I'll try the interceptors, thanks. Jun 09 16:39:03 I know that I can get the top fragment of a backstack, but is there a way to get where popping that fragment will take me? Jun 09 16:39:11 Does anyone know how to use CursorTreeAdapters to populate an expandable listView? My database has a DateTime column, then a category column and a content column. I want to populate the listview with entries from a certain date, with the groups being the hours in that day, and the children being a layout with 2 textviews, one forcategory and one for content Jun 09 16:44:58 6 months later my N6 battery is starting to show signs of fatigue Jun 09 16:45:02 or I’m using it more. Jun 09 16:45:28 tricknology try to keep it between 40-80% :( Jun 09 16:45:52 i wish all gadgets let you select that as a charging option Jun 09 16:45:56 that’s aobtu where it is all the time Jun 09 16:45:57 hi, friends Jun 09 16:46:04 what’s the benefit of taht range? Jun 09 16:46:13 less chemical stress? Jun 09 16:46:19 deep discharges are bad for lithium Jun 09 16:46:37 its better to keep it 100% than 0% though Jun 09 16:46:57 *see lithium dendrite formation Jun 09 16:47:17 I did work on Lithium Sulfur batteries Jun 09 16:47:17 i have a first activity with a navigation drawer, in this navigaton drawer i have a list of items, when click i change the fragment. When i need create a new activity? in details of post(example) ? Jun 09 16:47:22 research lab Jun 09 16:47:28 just make your battery's electrodes perfectly smooth and there's no issue Jun 09 16:47:53 zinx, impossible, because of electroplating.stripping Jun 09 16:47:59 i know, that was the joke :) Jun 09 16:48:01 :P Jun 09 16:48:18 that’s where a lot of research goes too.. electrolytes that promote that bejhavior Jun 09 16:48:29 t0th_-_: whenever you want Jun 09 16:48:37 probabyl when you dont need the drawer Jun 09 16:48:46 if you want the drawer all the time then keep switchign fragments in your main Jun 09 16:48:53 hmmm Jun 09 16:48:57 add to backstack for back button function Jun 09 16:48:58 now i made this Jun 09 16:49:25 stratCtivity and fragments Jun 09 16:50:52 so i a m supposed to be in by 930 but due to an arguement with my roomate i had to use "12 inches of some what same excessive force" to get him to drive me to work. i am 12 minutes law, breaking curfew. Jun 09 16:51:00 how can I disable this: http://i.imgur.com/cn4SEmj.png on the emulator? I cant seem to find the option anywhere in the AVD settings Jun 09 16:51:31 should i just assume i'm fired and take off or wait till some boss man pulls me into a room to notify me? Jun 09 16:52:07 *law - late Jun 09 16:52:14 droidian: switch to Genymotion. It doesn't have that big control panel + other benefits Jun 09 16:52:35 Genymotion is not an option for me Jun 09 16:52:43 why? Jun 09 16:53:13 I am at work, and my bosses will not allow a budget for the emulator Jun 09 16:53:30 android dev is not our primary line of work. Jun 09 16:53:45 it was enough of a stretch to get them to let me work on it at all :/ Jun 09 16:54:19 droidian: In Android Studio when you use the AVD manager to create an emulator, there's a little checkbox on the bottom "Enable Device Frame", check that and it's gone. Jun 09 16:54:36 poor soul Jun 09 16:56:05 dex2goat: hmmm. nope. sorry. That is uncheked, and it is still showing up (isnt that the graphic that makes it look the the emulator is the screen of deviceXYZ ?) Jun 09 16:56:08 setting the Bitmap causes the ANR. Canvas canvas = new Canvas(); canvas.setBitmap(bitmap); ANR; why? :| Jun 09 16:56:31 it should be checked :) Jun 09 16:57:06 razzledazzle, try to trace it Jun 09 16:57:07 dex2goat: ah! ok ill give it a shot Jun 09 16:57:08 thanks Jun 09 16:57:31 oh right Jun 09 17:04:45 danijoo: thanks for that, an IllegalStateException somehow lead to ANR. Jun 09 17:19:06 can anyone tell me what the algorithm is that android uses to get from a real DPI to a choice from one of the sparce bins. In particular, I will have mdpi, xhdpi and xxhdpi. For a given phone that isn’t in one of those bins how does android pick which one to use? Jun 09 17:22:28 the closest one Jun 09 17:22:48 so an HDPI would probably go in the XHDPI bin Jun 09 17:23:18 s73v3r: ah, i just found this: https://github.com/android/platform_frameworks_base/blob/master/libs/androidfw/ResourceTypes.cpp#L2291 Jun 09 17:23:42 yeah. what that link said :p Jun 09 17:24:02 s73v3r: “saying that scaling down is 2x better than up” so not quite closest? Jun 09 17:24:23 price is right rules: generally closest without going over Jun 09 17:24:47 i guess the opposite: closest without going under Jun 09 17:27:39 thanks Jun 09 17:40:23 What's the difference between a SimpleCurorTreeAdapter and a CursorTreeAdapter Jun 09 17:46:40 b2zeldafreak: As the name suggests it's supposed to be a simplified version of it. CursorTreeAdapter is an abstract class, SimpleCursorAdapter is a concrete implementation of it and has a default implementation for the required stuff (also via ResourceCursorTreeAdapter. Jun 09 17:54:16 thanks Jun 09 17:55:10 np Jun 09 17:55:47 Some would argue about it's simplicity, though. https://github.com/android/platform_frameworks_base/blob/master/core/java/android/widget/SimpleCursorTreeAdapter.java#L72-L177 Jun 09 18:00:42 Anyone on 5.1.1 have the issue that the "Allow USB debugging?" dialog (ex: http://i.imgur.com/UrlAtYU.png ) keeps coming back, and will not remember my decive even if I check "Always allow from this computer" ? Jun 09 18:00:52 it was never an issue untill i installed 5.1.1 Jun 09 18:10:55 <_genuser_> alright folks, if someone says you should be able to do e2e development. Do you take it to mean "end to end", a complete system, from input components to output, etc. etc. Jun 09 18:11:23 generally that means going from the frontend (app, website, etc) to the backend (server) Jun 09 18:11:23 <_genuser_> or do you take it to mean end to end the design pattern, where you focus on putting the works on end nodes instead of on network (internal nodes). Jun 09 18:11:44 <_genuser_> yeah, that's what I'm thinking, I just got a little curiuos due there being a design pattern named e2e, also. Jun 09 18:11:47 it’s a huge crock of shit, and unless the app is really trivial, the employer is trying to cheap out on labor Jun 09 18:12:15 <_genuser_> little supervision. basically they're saying come in here, man up, take ownership, and deliver what we need. Jun 09 18:12:42 <_genuser_> I'm perfectly fine with that, that's how I do most of my work. Now to call teh recruiter and see if she likes my hourly rate, lol. Jun 09 18:13:00 make sure to raise the rate, as you’re doing the job of two or more people Jun 09 18:13:59 <_genuser_> as I'm transitioning from full-time to contractor, my friend who have done this before are advising me to just start at a middle rate of 75/hr and after a little experience work it up. Jun 09 18:14:17 so i generally take runOnUIThread to be an unsafe method due to activity config changes. is it ever safe to use? Jun 09 18:15:16 depends. Jun 09 18:16:05 groxx: i can’t think of any situation it is safe to use Jun 09 18:16:12 the user can config change ur app at any time Jun 09 18:16:38 i suppose if you were getting an async change that you might later be able to requery then it would be ok… ? Jun 09 18:16:39 runOnUiThread should only be used to run very fast tasks Jun 09 18:16:48 where you dont have to care about config changes Jun 09 18:16:54 config changes don't allow handler events (e.g. runonuithread runnables) to run between onDestroy and onCreate (I forget if it also protects through onStop/onStart or onPause/onResume, but whatev. it's documented somewhere.). so it's not _quite_ as yolo as it seems Jun 09 18:17:17 danijoo: you always have to care about config changes right? by the time your runnable is run your acitivity may be long gone Jun 09 18:17:21 _genuser_ one reason doing e2e is tough is because of the security aspects; you're going to have to be a sys admin and security pro setting up the server stuff, the web services, etc Jun 09 18:17:24 groxx: Only between onDestroy and onCreate. Jun 09 18:17:42 _genuser_ which ... should really be left to people who know that stuff Jun 09 18:18:01 groxx: TacticalJoke so its basically never safe Jun 09 18:18:02 but yeah, in like 99% of the cases people actually use it for, it's not safe. config changes, hitting 'back', etc. Jun 09 18:18:10 ok Jun 09 18:18:19 samskiter, if you do something like if(!isFinishing()) setListAdapter(mAdapter) its safe Jun 09 18:18:25 samskiter: Why not safe? Jun 09 18:18:43 because whatever you ran might never have any effect Jun 09 18:18:48 that would mean an onclicklistener whould never be safe too Jun 09 18:18:52 so if you care about what you are running, then don’t use it Jun 09 18:18:55 if what you're doing just has to reach the main thread, and isn't activity / view related work, then it's fine. but I don't see code do that as often as "runOnUiThread( () -> { someView.setText("blah"); })" Jun 09 18:19:02 All it does is call Handler.post if not on the main thread: https://android.googlesource.com/platform/frameworks/base/+/master/core/java/android/app/Activity.java#5282 Jun 09 18:19:03 danijoo: not true, it’s run on the main thread Jun 09 18:19:14 ^ which is actually _safe_, because it doesn't need the context to do anything, but it's _wrong_ either way. Jun 09 18:19:14 main thread == uithread Jun 09 18:19:31 <_genuser_> g00s: I think being the code-monkey for an e2e would be tough for the reasons you mentioned. But as lead engineer or lead architect, I have brought in other engineers before to ask them concerns in certain components and then delegated that work to appropriate people to get it done properly. Jun 09 18:19:44 <_genuser_> you can't be an expert at all those things. that would just not work. Jun 09 18:20:03 groxx: precisely Jun 09 18:20:08 samskiter: My app easily handles config changes and Handler.post. Jun 09 18:20:17 The Runnable that's posted sends stuff to the correct Activity. Jun 09 18:20:22 And the Activity does stuff correctly too. Jun 09 18:20:41 groxx: (that was Re: “if what you're doing just has to reach the main thread…”) but why would you want to touch the main thread if not to touch UI stuff. Jun 09 18:20:43 The fact that no messages will be posted between Activity.onDestroy and Activity.onCreate also keeps things simple. Jun 09 18:21:16 so the fact that no messages are posted doesnt help Jun 09 18:21:24 Wat. Jun 09 18:21:27 you still made a runnable referencing the old activity Jun 09 18:21:34 so anything it does will be lost Jun 09 18:21:36 Nope. Jun 09 18:21:43 If you do things right, that is false. Jun 09 18:21:44 huh why should it be Jun 09 18:21:55 you can still save it "somewhere else" Jun 09 18:21:55 samskiter: some libraries require it, and it's an easy way to e.g. cause changes to a shared data-model-thing that activities _use_. e.g. if you have an in-memory cache, updating it even after your activity is gone is probably fine, but updating it on the wrong thread may not be. Jun 09 18:22:00 or send it via a bus Jun 09 18:22:02 sth like that Jun 09 18:22:12 groxx: fair enough Jun 09 18:22:24 TacticalJoke: your runnable references the activity implicitly Jun 09 18:22:33 its the same reason most people screw up asynctask Jun 09 18:22:33 No. Jun 09 18:22:49 only if my runnable is an inner class Jun 09 18:22:53 I'm not even using an inner class (which seems crazy here to me). Jun 09 18:23:02 Don't use inner classes for this stuff. Craziness. Jun 09 18:23:06 danijoo: true. Jun 09 18:23:13 samskiter: but yeah. there used to be a few bugs in the android view framework because they didn't unregister runnables that they posted with runOnUiThread / post / postOnAnimation. they seem to be (a lot) better about that now, but there may just be others I haven't seen yet. Jun 09 18:23:14 so what are you refering to from the runnable? Jun 09 18:23:21 if its not, its just a posted runnable on the mainthread Jun 09 18:23:29 My Activity subscribes to the downloader-thing in onCreate and unsubscribes in onDestroy. Jun 09 18:23:38 that could do anything for example with application context Jun 09 18:23:48 TacticalJoke: where do you use runonuithread though? Jun 09 18:23:49 or with app logic that does not need contexr Jun 09 18:23:50 My Runnable always accesses the most recent Activity. Jun 09 18:23:58 I don't use Activity.RunOnUiThread. Jun 09 18:24:06 TacticalJoke: i think you came into this VERY late Jun 09 18:24:11 Because my downloader thing knows nothing about Activities. Jun 09 18:24:16 scroll up. this conversation is about runonuithread being unsafe Jun 09 18:24:21 Nah, I understand what you're talking about. Jun 09 18:24:25 :P Jun 09 18:24:30 Activity.runOnUiThread just calls Handler.post in this context. Jun 09 18:24:36 Handler.post is what this discussion is about. Jun 09 18:25:00 yeah. this all would also account to everything being posted via Handler.post or Handler.postDelayed Jun 09 18:25:16 how about "runOnUiThread is misleadingly simple / encouraged, leading to subtle bugs that should instead be prevented by design" Jun 09 18:25:20 samskiter: In case you didn't see my link before: https://android.googlesource.com/platform/frameworks/base/+/master/core/java/android/app/Activity.java#5282 Jun 09 18:25:23 which means everything is fine unless you use a context. and if you do, you can still check if activity is finishing before doing something Jun 09 18:25:23 TacticalJoke: so you use handler.posrt Jun 09 18:25:45 ? Jun 09 18:25:47 Yes. Jun 09 18:25:57 In my case, using Activity.runOnUiThread would be terrible design. Jun 09 18:26:03 That'd require that my downloader thing knew about Activities. Jun 09 18:26:15 TacticalJoke: how do you get hold of the handler in the activity? Jun 09 18:26:29 or are you making and maintaining your own handler? Jun 09 18:26:40 It's sufficient to instantiate a Handler on the main thread. Jun 09 18:27:03 You can use `new Handler(Looper.getMainLooper())` to be certain, though. Jun 09 18:27:16 just another thing thats so much easier with Rx... subscribeOn(AndroidShedulers.mainThread()).doStuff :) Jun 09 18:27:37 alternatively: doStuff(mainHandler)? Jun 09 18:27:56 indeed. activity.runonuithread is what im taking issue with and i think is something you should never need Jun 09 18:28:20 danijoo: that looks good! Jun 09 18:28:20 it's also odd to me that runOnUiThread is synchronous in some cases, async in others. another source of subtle bugs! Jun 09 18:28:37 danijoo: that would save me so much boilerplate :D Jun 09 18:28:50 samskiter, learn it ;) Jun 09 18:28:56 Yeah, it's weird, groxx. Jun 09 18:28:57 i just started with it too.. Jun 09 18:29:05 I can't think of a good use case for Activity.runOnUiThread, to be honest. Jun 09 18:29:11 danijoo: no time unfortunately atm. Rx is in the 6+ month bucket.... Jun 09 18:29:20 Why would you have an Activity reference and not know whether you're on the main thread? Seems like bad design to me. Jun 09 18:29:27 TacticalJoke, well.. it might be handy from a custom thread Jun 09 18:29:28 yea, exactly Jun 09 18:29:32 that’s what im driving at Jun 09 18:29:38 heh. I might rewrite an app with rx, to get a feel for it. gotta finish it first though :) Jun 09 18:29:42 basically everywhere where you post on main, you can just use that method instead Jun 09 18:29:43 it's not about whether you know if you're on the main thread - it's just a convenient way to run something on the main thread when you're not Jun 09 18:29:45 the clickbaity blogpost shall be created! :p Jun 09 18:30:03 it saves you from having to create your own main threda handler and sending a message to it Jun 09 18:30:04 and I've gotta profile it, because it needs to be acceptable on crappy Gingerbread devices, and all those throwaway objects in Rx make me :| Jun 09 18:30:09 for example if you use threads instead of asynctasks Jun 09 18:30:17 JesusFreke: you should never need to use it. you might lose whatever your runnable does Jun 09 18:30:17 you can use that to post back to the mainthread Jun 09 18:30:26 samskiter: what? Jun 09 18:30:33 JesusFreke: scroll up Jun 09 18:30:35 Yeah, but isn't it basically always bad design for some background-task thing to be coupled with an Activity (rather than a "listener" or something)? Jun 09 18:30:36 groxx, simple, if on ui thread, run immediately, else post Jun 09 18:30:41 groxx, is what runOnUiThread does Jun 09 18:30:49 thats like saying "you should never need onPostExecute in asynctask" Jun 09 18:30:51 TacticalJoke: oh yea, you definitely drame the activity as a listener Jun 09 18:31:10 danijoo: well actually, that’s not so bad, provided you can adjust thelistener on your asynctask Jun 09 18:31:12 pfn: yeah. and blending async and sync behind the same API is a nice easy way to cause subtle bugs Jun 09 18:31:35 samskiter, its the same strategy. async stuff and then posting on mainthread Jun 09 18:31:39 groxx, eh, not really, it just says "run this on ui thread", if currently on ui thread, it's obviously a noop Jun 09 18:31:42 given the name Jun 09 18:31:46 doesnt matter if its packed in a seperate class or not Jun 09 18:31:50 samskiter: The key thing here is to unregister the activity in onDestroy (or whatever). Jun 09 18:31:59 danijoo: im talking specifically about the method on an activity: runonuithread Jun 09 18:32:02 In my case, I cancel downloads in onPause if we're finishing, and I unsubscribe in onDestroy. Jun 09 18:32:06 (Regardless.) Jun 09 18:32:08 samskiter, me too Jun 09 18:32:12 TacticalJoke: actually, I always unregister in onpause Jun 09 18:32:13 pfn: so basically, "I don't know which thread I'm on, because I didn't keep track of it, figure it out for me!" Jun 09 18:32:19 groxx, yes Jun 09 18:32:27 and this is code we should encourage? Jun 09 18:33:03 danijoo: in a config change you can unregister to an asynctask as you pause and re-register as you resume from your new activity. whereas runonuithread won’t be transferred to your new activity Jun 09 18:33:10 groxx, I never encourage runOnUiThread Jun 09 18:33:25 im not going to allow this MR to go through if it contains runOnUiThread Jun 09 18:33:33 pfn: that's basically what this whole conversation has been circling around. that runOnUiThread isn't a good thing. Jun 09 18:33:39 I see Jun 09 18:33:55 api level 1…. yea.. it should be deprecated Jun 09 18:36:02 reason I particularly care is because I think android multitasking will be based around config changes. if you look at how iOS splitview works, its just doing that Jun 09 18:36:42 the splitview makes me literally lol. iOS practically encourages non-flexible layout. Jun 09 18:36:50 I can't imagine how many apps are going to break with it Jun 09 18:37:10 groxx: yea, depends who has used size classes Jun 09 18:37:38 it’s using the new size class thing. I imagineyou wont be able to resize an app unless it supports a particular size class. but yes, breakage incoming Jun 09 18:37:45 I lol’d hard Jun 09 18:38:07 ah, I don't think I've seen the size class stuff. I'll have to peek at it. Jun 09 18:38:12 is it any good? Jun 09 18:39:29 groxx: yes. you can have constraints only apply to certain size classes Jun 09 18:39:33 essentially they have dealt with it Jun 09 18:39:43 combination of autolayout constraints and size classes sorts it Jun 09 18:39:54 its old though, suprised you haven’t heard of it.... Jun 09 18:40:02 I just read through the discussion about runOnUiThread. My conclusion would be that if I am using runOnUiThread from within an Activity, be it in a method or inner class, then I can just replace that with running that code directly, for example in onPostExecute. Jun 09 18:41:26 barq: well UI changes aren’t guaranteed to come through in any timely fashion if you do them on the background thread. so alot of devs use runonuithread to get the changes through Jun 09 18:41:35 samskiter: ah, maybe it just didn't come up much with autolayout at the time. I got out of iOS about when autolayout emerged from the "wtf, how do we use this" stage and into "omfg goodbye xib, though this is still kinda weird". Jun 09 18:41:56 I keep a very passive eye on what they're doing, because they do some good / interesting stuff, but I haven't read the docs for over two years, I think Jun 09 18:42:17 groxx: fair enough. the size classes are very much from the nib/storyboard editor Jun 09 18:42:35 samskiter: But onPostExecute is on the UiThread already, isn't it? So using runOnUiThread there would be redundant. Jun 09 18:42:38 my colleague is a whiz. you basically enable different constraints in different size classes Jun 09 18:43:14 barq: yes. but we weren’t saying “using runonuithread from a call from onpostexecute” is bad. we were saying “runonuithread is always bad” which is a little more of a complex topic Jun 09 18:43:34 but i think is true Jun 09 18:44:02 because you either fall into the “im already on the main thread” category, or the “why the hell aren’t you calling this method from the main thread” category Jun 09 18:44:05 So also doing any Ui operations from onPostExecute would be bad, since you don't know when doInBackground will be finished executing in order for onPostExecute to be run. Jun 09 18:44:07 Personally: "always a bad sign" + "it's bad API design and it shouldn't exist" Jun 09 18:44:26 barq: onpostexecture is called after doinbackground Jun 09 18:44:35 groxx: :) Jun 09 18:44:54 Yes. But you don't know when doInBackground is finished, so you don't know in what order the Ui operations will be performed if you have multiple AsyncTasks. Jun 09 18:45:21 ah i see what you mean. well onpostexecute is fine, provided it uses some listener that can be changed at any time. Jun 09 18:46:20 the classing mistake is passing your activity in as the listener and never unsetting it, causing a leak Jun 09 18:46:39 classic* Jun 09 18:46:40 samskiter: What do you mean by some listener that can be changed? Jun 09 18:46:56 i mean myAsyncTask.setTaskListener() Jun 09 18:47:11 I do that all over the place :) pretty much every asynctask use I've done has had finite lifespans (even if it's a few seconds (yes I know this is a bad idea)), and leaking an activity for a few seconds really doesn't matter Jun 09 18:47:23 I have this problem in one of my Activities that has many dependencies between the data contained in spinners that depend on each other. In order to keep it from crashing I needed to use hacks like postDelayed. Jun 09 18:47:25 i stopped using asynctask and started using futuretask Jun 09 18:47:50 but maybe im coming around to changing that..... Jun 09 18:48:12 asynctask is the suck Jun 09 18:48:21 samskiter: have a link? if nothing else, I've been thinking for a while now that building everything in terms of futures might be a pretty big improvement. Jun 09 18:48:27 i use some long living singleton to manage my futuretasks and listeners Jun 09 18:48:41 rx being sorta the 'next level' beyond everything-is-a-future Jun 09 18:48:59 Hey all, I’m trying to update an old app built with Eclipse to use Android Studio, however it has an expansion file and I get the dreaded “resources cannot be found” error. Is there any logical way to debug this? I’m this close to hosting the assets on s3 and having the client download them without the auth check... Jun 09 18:49:06 gross. futuretask is java. just make an executor and post your task to it Jun 09 18:49:28 the boilerplate is a bit messy Jun 09 18:49:29 but some of that is just that I've become increasingly annoyed with "async only" APIs. if they'd just give me a future, I could block if it were convenient. Jun 09 18:49:51 samskiter: aah, part of the concurrency package? Jun 09 18:50:06 groxx: yea Jun 09 18:50:07 import java.util.concurrent.FutureTask; Jun 09 18:50:25 bascially you pass a runnable to super. and then you override done() and call get Jun 09 18:50:40 and wrap that in a try Jun 09 18:50:54 and you get 3 types of exception. interrupted, execution and cancellation Jun 09 18:50:59 its so boiler plate :9 Jun 09 18:51:00 :( Jun 09 18:51:01 so probably not as buggy as AsyncTask :) Jun 09 18:51:09 asynctask is buggy? Jun 09 18:51:18 i just thought PEBCAK Jun 09 18:51:23 Ah you use Java, I was wondering where to find this in Android. Jun 09 18:51:38 barq: whaa? Jun 09 18:51:42 probably technically depends on where you draw the line at "bug". I personally call it a bug, and it's fixed in newer OSes, which IMO supports my claim. Jun 09 18:51:42 setTaskListener Jun 09 18:51:56 samskiter: bug is: you can cancel() on the main thread, and then receive onPostExecute() Jun 09 18:51:56 barq: no, i made that method up Jun 09 18:52:09 http://docs.oracle.com/javase/7/docs/jdk/api/javac/tree/com/sun/source/util/JavacTask.html Jun 09 18:52:13 groxx: oh. :( Jun 09 18:52:42 barq: never seen that before Jun 09 18:52:43 I mean, arguably that could be useful behavior. but no - you document that, or it shouldn't exist. Jun 09 18:53:08 groxx: i mean thats just the same as your cancel not getting through in time Jun 09 18:53:16 but i see what you mean i suppose Jun 09 18:53:37 it got through before onPostExecute. it was cancelled, by all memory-observability arguments. Jun 09 18:54:07 if I call menuItem.setChecked(true) in OnNavigationtemSelected(menuItem) the menu item becomes selected, alright! However if I call setChecked(false) it has the same effect. I can see the logic, but it feels weird Jun 09 18:54:11 im not so worried about that as i let the callbacks like ‘cancelled’ and ‘finished’ drive the ui. so if someone hits cancel at the same time as the task finishes, then its just the same as they hit it after is finished Jun 09 18:54:17 you see crashes on people canceling asynctasks in onStop / onPause, for instance, because the message is still in the queue. then the activity is destroyed because they hit back, and _then_ the callback happens. Jun 09 18:54:49 groxx: then you should unregister for the callback in onPause Jun 09 18:54:49 So if you have many dependencies between Spinner configurations, how would you implement them. AsyncTask is a very hacky option. Jun 09 18:54:53 that goes without saying right? Jun 09 18:55:03 samskiter: that's the point of cancel(). and it's fixed in 4.something. Jun 09 18:55:34 groxx: ah, so if you call cancel it won’t call onpostexecute? what does it call? anything? what if i want to know my task was cancelled Jun 09 18:55:36 asynctask _is_ the callback holder, there's no way to unregister it without redoing its work Jun 09 18:56:17 samskiter: if you pass true, it'll .interrupt() the thread. otherwise it just stops onPostExecute from being called. and no, there's no "canceled" callback or anything like that, which is also an annoying API choice :| Jun 09 18:56:31 well, and it'll stop it from running if it was canceled before it was started Jun 09 18:56:38 before doInBackground was started, that is Jun 09 18:56:40 groxx: asynctask isnt a callback holder Jun 09 18:56:46 You use FutureTask.get if you have dependencies between Spinners then? Jun 09 18:56:47 then what's onPostExecute? Jun 09 18:56:58 a method where you read your listener Jun 09 18:57:13 samskiter if you are using asynctask, do it like hackbod describes here http://stackoverflow.com/questions/3357477/is-asynctask-really-conceptually-flawed-or-am-i-just-missing-something Jun 09 18:57:17 you implement the listener system in your subclass of asynctask Jun 09 18:57:25 samskiter: Yeah, I'm not a huge fan of AsyncTask. Jun 09 18:57:36 It feels like it gives me a very specific abstraction and doesn't really buy me much. Jun 09 18:57:40 so rather than onPostExecute { doStuffWithResult() } you use { if (listener != null) { listener.doStuffWithResult() } } ? then why even have onPostExecute? Jun 09 18:57:40 or barq, not following too closely Jun 09 18:58:03 g00s: hmmm that uses deprecated stuff Jun 09 18:58:04 I don't use FutureTask in my app, though. I just give Runnables to a ThreadPoolExecutor. Jun 09 18:58:17 this is why i "always" avoid asynctask Jun 09 18:58:24 g00s: yeah, but that's referring to memory leaks. that's just normal threading concerns. Jun 09 18:58:42 groxx: yes. what are you calling doStuffWithResult on? are you confusing asynctasks implementation with what you get for free with a nested class? Jun 09 18:58:49 no guarantee to have a valid context if onPostExecute (which runs on UI thread...) is called while the app was destroyed or worse Jun 09 18:59:23 g00s: we’re in deeper than that ;) Jun 09 18:59:36 it's really a weird design, highly advocated, and the little remark/notice is about it should be used for few seconds of threading... Jun 09 18:59:38 Background tasks and inner classes seem like bad design to me. Jun 09 18:59:40 i never use asynctask either Jun 09 18:59:43 (like avoid asynctask for network) Jun 09 18:59:52 I AM MAD BRO Jun 09 19:00:30 samskiter: ah, I think I see the disconnect now. no, I mean that with an inner class, the asynctask _is_ the callback. and there's no ".setListener(null)" except ".cancel()". if you're using only static asynctasks, yeah, you would have to make another object + add a setter + manage that. Jun 09 19:00:36 I see AsyncTask as a concurrency tutorial that's a little odd. Jun 09 19:00:43 im fully on the futuretask bandwaggon. im basically reimplementing asynctask. :P Jun 09 19:01:11 samskiter: Why do you need futures? Just curious. Jun 09 19:01:14 groxx: yea. im not into the inner class thing because of code reuse, yadda yadda Jun 09 19:01:25 Are you happy to block the main thread in some cases? Or do you need the cancel thing? Jun 09 19:01:29 TacticalJoke: asynctask is basically futuretask. it even says it on the docs ;) Jun 09 19:01:43 what is futuretask Jun 09 19:01:44 can’t block main thread when doing network Jun 09 19:01:46 personally I usually make asynctasks abstract, and define onPostExecute in the class that needs it. so I call `new CustomTask() { onPostExecute() { useThing } }.start()` and .cancel() it when it's no longer relevant Jun 09 19:02:02 goos lmgtfy ;) Jun 09 19:02:06 nah, did Jun 09 19:02:33 samskiter: Yeah, but why do you need futures? Jun 09 19:02:33 ok, i dont use that stuff either ;) Jun 09 19:02:44 samskiter: How do you use FutureTask then? Say I have a Spinner A that relies on SpinnerEntryB being selected. Then you run the data for SpinnerB in a FutureTaskB and have A wait for that to finish by donig FutureTaskB.get? Jun 09 19:02:49 i'm sticking to regular Thread class Jun 09 19:03:10 adq: wat. not a ThreadPoolExecutor? for shame :P Jun 09 19:03:21 TPE is a Heaven-send. Jun 09 19:03:23 :'D i rarely need many Jun 09 19:03:25 Though its quirks are annoying. Jun 09 19:03:34 TacticalJoke: because they support cancellation. can be passed to an executor. handle exceptions. Jun 09 19:03:49 futures are a very reasonable concurrency primitive. Jun 09 19:03:53 Having, for example, a thread pool with a single thread and queuing (and, ideally, thread timout) is an awesome way to avoid complexity and bad performance. Jun 09 19:03:53 barq: not sure what you mean Jun 09 19:04:02 at least Guave ListenableFuture Jun 09 19:04:09 all these Future things basically suck Jun 09 19:04:20 TacticalJoke: yea, thats me Jun 09 19:04:21 samskiter: Why do you need cancellation? FutureTask.cancel only calls Thread.interrupt. Jun 09 19:04:46 In my app, for example, Thread.interrupt will not cancel downloads. I have to use Socket.close. Jun 09 19:04:55 In what way is FutureTask superior to AsyncTask if in my current AsyncTask implementation I have several BackgroundTasks running in order to initialize Spinner data that depends on each other? Jun 09 19:04:59 groxx, once you get into java8, sure Jun 09 19:04:59 Thread.interrupt stops some things, but they have to play ball. Jun 09 19:05:22 pfn: true, some of the stuff there is pretty appealing Jun 09 19:05:27 alas android Jun 09 19:05:29 TacticalJoke: very true. i’ve basically adopted one pattern for everything background Jun 09 19:05:29 (I mean `futureTask.cancel(true);`, to be clear.) Jun 09 19:05:32 keeps things simple in my head Jun 09 19:05:34 groxx, but futures are sucky before java8 Jun 09 19:05:45 eh, so extend them. Jun 09 19:06:04 barq: You don't even need FutureTask. Jun 09 19:06:06 https://github.com/pfn/android-futures Jun 09 19:06:06 :p Jun 09 19:06:08 the semantics haven't changed (afaik?), they've just gained some supporting subclasses / executor-like services. Jun 09 19:06:29 Hello guys! Jun 09 19:06:43 TacticalJoke: Then what do I need instead? Jun 09 19:06:47 barq: It's possible to avoid AsyncTask by simply using a ThreadPoolExecutor (perhaps via the ExecutorService or the Executor interface) and submit tasks, and then use Handler.post to get back to the UI thread if needed. Jun 09 19:07:20 AsyncTask just maintains its own thread pool (via ThreadPoolExecutor) and takes care of posting back to the main thread. Jun 09 19:07:32 Hi. I'm trying to include a native google library (webrtc) in my android example app (i'm using android studio) but when starting the App, the log shows "java.lang.UnsatisfiedLinkError: dalvik.system.PathClassLoader". I included the .so library into "src\jniLibs\" where is armeabi-v7a, armeabi, mips and x86. Any thoughts? I'm noob in Android btw but I have used JNI in Java Jun 09 19:07:36 Will that make sure the order of executions is deterministic? I thought posting does not guarantee this. Jun 09 19:08:10 so for networking: I use a singleton to hold my retrofit service. this has a single thread TPE. It has a whole bunch of tasks it can perform. When you perform the task, it make a future with itself as the listener and submits it to the TPE. separately it also can accept listeners of the same kind with a add/remove listener type interface. it keeps track of these lists of listenevers. when the future finishes and calls back to th Jun 09 19:08:11 singleton, the singleton posts to the main thread and then dispatches the event on to all the listeners Jun 09 19:08:12 post order is deterministic. completion of a task in a thread pool is not. Jun 09 19:08:48 well, unless you use postAtFrontOfQueue. but if you do that, you're a bad person. Jun 09 19:09:00 the .so library is about 30mb... i'm not sure where Android studio generates the test apks, but I saw some apks files with the name of my app and with size less than 100kb, so first thought is that gradle is not included the .so file into my apk, but I dunno, there are too many points I'm not sure about Jun 09 19:09:10 So I would need to wait for one AsyncTask to complete before starting the next if I need it to be deterministic (one relies on the other)? Jun 09 19:09:39 damiox: is the .so file being included in the apk? Jun 09 19:09:45 ah, apparently not. Jun 09 19:10:06 groxx: i use newSingleThreadScheduledExecutor() which is deterministic Jun 09 19:10:21 damiox: I'm sure there are other ways, but you can also make sure the file is "lib.so" and it'll be copied automatically. the lib prefix is required though. Jun 09 19:11:16 TacticalJoke: sounds like we are doing something very similar tbh, i just have the added complexity of futuretask that is probably useless TBH, but gives me future options for cancellation Jun 09 19:11:40 the biggest problem i have is with maintaining all the listeners in the singleton. its allll boilerplate. i think OTTO is probably the way to go... Jun 09 19:12:00 Yeah, an event bus can help. Jun 09 19:12:13 Though sometimes it's possible to keep things simple and neat without one. Jun 09 19:12:44 hmmm i can’t guarantee all my listener callbacks have the same signature. and i want strong type safetyu Jun 09 19:12:45 I usually end up writing the singleton :| it's like 20 lines of java. though yeah, if you do that a lot, it's a pain. Jun 09 19:12:52 groxx, i will check where android studio generates the apk files (i'm noob at android) and check that. The lib is "lib.so" and the code is doing System.loadLibrary("whatever"); I got the .so from the android webrtc example project, but that project is using ninja (apparently a build tool used to build Chrome) instead of Android studio... Jun 09 19:13:21 samskiter: have you considered making a ListenerPool factory, and just instantiating new typed versions as you need them? Jun 09 19:13:51 groxx: hmm how would that work? Jun 09 19:14:32 my activity is the listener and needs to come in to the singleton and say “hey, i want to hear about this” and “hey, i dont want to hear about this any more” (it obvs is doing this in onpause and onresume) Jun 09 19:15:05 samskiter: What if some download finishes after Activity.onPause? Jun 09 19:15:43 TacticalJoke: itll finish, tell the singleton and the singleton with post to the main thread (on itself) and then pass the message on to all of its listeners Jun 09 19:16:01 samskiter have you looked at rxjava ? Jun 09 19:16:04 But the activity won't be listening anymore, right? Jun 09 19:16:14 This is why I hold on till onDestroy. I don't wanna miss an event. Jun 09 19:16:27 And no event will happen between onDestroy and onCreate. Jun 09 19:16:35 TacticalJoke: ah, i just remembered about why i wanted cancel. cancel code will still be called even if the work technically finished, allowing me to define that path of code explicitly Jun 09 19:16:44 g00s: no. i hear good things though Jun 09 19:16:51 TacticalJoke: yes it will Jun 09 19:16:56 groxx, I think android studio is putting my apk in "app/build/outputs/apk/" inside there there are some apks corresponding to the android arch I defined, but they are 30kb... and my .so lib is 27mb... so I think it's not being included Jun 09 19:17:00 if its a config rotate Jun 09 19:17:04 the new one will be up and running Jun 09 19:17:41 config changes are executed in a single, sequential block on the main thread. so you will always either be one side of a config change or another Jun 09 19:17:54 samskiter: What about this: screen rotation --> onPause --> stop listening --> download finishes --> (onStop, onDestroy) --> onCreate --> [no evidence of the download] Jun 09 19:17:57 i spent some time grokking the android code base to determine that Jun 09 19:18:15 samskiter: I'm not sure that's true. The only guarantee we have is that no message will be processed between onDestroy and onCreate. Jun 09 19:19:00 What if they simply turn the screen off? You get onPause, you stop listening, the download finishes, and they come back to nothing. Jun 09 19:19:27 TacticalJoke: onpause -> stop listening -> download finishes and singleton dispatches to main thread -> ondestroy -> oncreate -> onresume -> start listening -> dispatch arrives on main thread -> listener called Jun 09 19:19:54 TacticalJoke: yes. that’s the same as a cancel. it depends on the type of operation. i generally clear up in on pause Jun 09 19:19:55 its amazing in 2015 we still talk about things that plagued many in 2009 Jun 09 19:19:58 samskiter: something like https://gist.github.com/Groxx/dd688724e0020b5b7dc5 Jun 09 19:20:15 TacticalJoke: if i really care, i can detect whether it’s a config change or not Jun 09 19:20:18 have done this in the past Jun 09 19:20:24 u think google would be up on my ass? cuz i made this for me app? http://i.imgur.com/sgDESCK.png Jun 09 19:20:29 compile-time ensuring you can only register / post the right types to that pool. Jun 09 19:20:40 if its a config change, i can leave any state up. if its not, i cancel everything and remove all state regarding an ongoing action from the ui Jun 09 19:21:44 TacticalJoke: well i’ve never seen that guarantee re oncreate and ondestroy. i’ve looked through the source thought and im pretty convinced. alex lockwood is also pretty clued up on this Jun 09 19:21:47 damiox: yeah, that's the right place (usually). you can rename the .apk to .zip and then unzip it if you want to see the contents :) Jun 09 19:21:58 damiox: unfortunately I haven't used jniLibs before, I'm not sure if it has special rules :| Jun 09 19:22:28 groxx: i had a look. im confused. callbackpool is just a list? Jun 09 19:22:32 groxx, hey thanks anyways... I'll let u know if I'm able to fix this Jun 09 19:22:34 Alex Lockwood mentions that guarantee in a few posts. Jun 09 19:23:03 samskiter: basically. plus you can pretty easily enforce threading / synchronization as you need, in a single place. Jun 09 19:23:04 groxx: i could jsut provide public access to my list of listeners Jun 09 19:23:06 guys u reckon i should risk it and add my custom video icon on me app? http://i.imgur.com/sgDESCK.png Jun 09 19:23:14 or is it too similar to youtube's? Jun 09 19:23:40 DarkChaoz, just risk it Jun 09 19:23:43 "A new instance of the activity will always be immediately created after this one's onDestroy() is called. In particular, no messages will be dispatched during this time (when the returned object does not have an activity to be associated with)." Jun 09 19:23:50 only thing that could happen is not being approved Jun 09 19:23:52 not similar Jun 09 19:23:54 then you change it back Jun 09 19:23:54 It's mentioned here: http://developer.android.com/reference/android/app/Activity.html#onRetainNonConfigurationInstance() Jun 09 19:23:58 groxx: ah i see, the post bit is good. i generally like to have separate callbacks, not just one post though. like “onTaskFailed()” “onTaskSuccess()” but i see Jun 09 19:23:59 and i also dont see similarities Jun 09 19:24:05 that doesn't look like youtube Jun 09 19:24:16 theres no trademark on a cricle and a triangle :P Jun 09 19:24:24 aight, thanks.. Jun 09 19:24:27 haha xD Jun 09 19:24:35 DarkChaoz, i dont think they care, theres a million plat icons out there Jun 09 19:24:47 play* Jun 09 19:24:54 already using Microsoft trademark crap in my app.. which i have to be careful Jun 09 19:25:03 samskiter: yeah, in which case you can add a wrapper object with multiple callbacks, or make a bigger callback interface, or whatever. but it does get less boilerplate-removing as you go down that route, which does suck, because it does have advantages. Jun 09 19:25:04 need to abide by their policy and that Jun 09 19:25:21 TacticalJoke: i think the intention is the same. it doesn’t exclude the immediacy between onpause and ondestroy Jun 09 19:25:44 groxx: thanks. i might look at integrating somehow Jun 09 19:26:17 This is what Alex Lockwood said: "Activity events (such as config changes that ultimately relaunch the Activity) execute lifecycle methods in batches, so it isn't possible for the AsyncTask's callback methods to intertwine between onDestroy() and onCreate()." Jun 09 19:26:25 https://plus.google.com/u/0/+AlexLockwood/posts/etWuiiRiqLf Jun 09 19:26:31 samskiter: I've been using otto lately. it's pretty convenient, especially if you already have a base Activity / Fragment instance (just register / unregister in the base class). I do very much miss type safety though. Jun 09 19:26:34 I guess what you say could be true, too. I just don't see it documented anywhere. Jun 09 19:27:00 TacticalJoke: you might notice my comments on the bottom of that ;) Jun 09 19:27:32 ah thats not the exact thread i was thinking of.... Jun 09 19:28:51 samskiter: what username? /me has curious. my initial reaction though is "ugh fragments" and "holy memory use batman" Jun 09 19:29:04 Hmm, you may be right. I notice that they've updated the Activity documentation with "The guarantee of no message handling during the switch to the next activity simplifies use with active objects. For example if your retained state is an AsyncTask you are guaranteed that its call back functions (like onPostExecute(Result)) will not be called from the call here [in onRetainNonConfigurat Jun 09 19:29:05 ionInstance] until you execute the next instance's onCreate(Bundle)." Jun 09 19:29:27 groxx, just setup rx observables everywhere :p Jun 09 19:29:27 TacticalJoke: that would be a great citation, where did you find that Jun 09 19:29:32 http://developer.android.com/reference/android/app/Activity.html#onRetainNonConfigurationInstance() Jun 09 19:29:44 I know that's deprecated, but it's the exact topic. :D Jun 09 19:29:57 groxx: Sam Duke. but im actually thinking about another thread where i chatted about activity config change sand batched with alex lockwood Jun 09 19:30:17 groxx: are you referring to the retained fragment pattern? android recommend it Jun 09 19:30:28 yeah, but I can't figure out why anyone would willingly use more fragments Jun 09 19:30:38 and fragments aren't exactly light-weight objects Jun 09 19:30:47 On a side note, using Fragment.setRetainInstance for some non-UI thing to outlive the activity life cycle? Eww. Jun 09 19:30:47 groxx: they are actually a neato way of doing compositiony type stuff Jun 09 19:31:04 i made a fragment to pop up a dialog if you didnt have BT turned on the other day. it was super easy to drop onto any of my activities Jun 09 19:31:05 http://blog.airsource.co.uk/2014/09/10/android-bound-services/ Jun 09 19:31:17 heres an indepth look into bound services and retained fragments Jun 09 19:31:20 TacticalJoke: yeah, that's my reaction too. and does it have any different guarantees than onRetainNonConfigurationInstance? because that method is simple as hell. Jun 09 19:32:17 TacticalJoke: its genuinely the android-stamp-of-approval way now :( onretainnonconfigurationinstance is documented and says to do it that way Jun 09 19:32:20 Some of the Android APIs are just weird. Are people writing this stuff on meth? Jun 09 19:32:49 TacticalJoke: lol GOOGLE!!!!! Jun 09 19:33:20 Consider Activity.getPreferences. How could someone think that was a good idea/ Jun 09 19:33:22 ?* Jun 09 19:33:33 There's no universe in which that makes sense. Jun 09 19:33:33 huh? Jun 09 19:33:46 samskiter: A method that ties a preferences-file name with an activity name. Jun 09 19:34:03 So if you change activity name then your preferences are lost. Jun 09 19:34:10 oh no Jun 09 19:34:11 Or hard to recover. Jun 09 19:35:15 damiox: aah. yeah, using fragments as self-contained state management makes some sense. it's still a lot of unnecessary allocation for that use though, since you don't need view-related things like the mEnterTransition values (and a fair number of other related things) Jun 09 19:35:39 damiox: bah. sorry, I meant samskiter Jun 09 19:35:53 "da" is too close to "sa", and uses more dominant fingers :| Jun 09 19:35:56 groxx: i guess. Jun 09 19:35:57 lol Jun 09 19:36:11 groxx, don't worry... lol, I worked it out... I had jniLibs in src/ instead of src/main ... after fixing that path issue, it stopped throwing the link exception. Thanks Jun 09 19:36:38 damiox: d'oh. sorry, I probably shoulda noticed that :) glad it's working though! Jun 09 19:37:14 samskiter that blog - pretty close to what ive been doing for the past few years Jun 09 19:37:21 g00s: nice! Jun 09 19:37:35 i remember asking dianne if it was OK :D Jun 09 19:37:38 re-reading it, i reminded myself of the asynctask+retainedfragment pattern i thought of Jun 09 19:37:52 back then , it wasn't obvious if fragments should bind to services Jun 09 19:38:04 ooh nice Jun 09 19:38:18 but that also led me to discover the first bug i found with support fragments - they juxtaposed onPause and onStop Jun 09 19:38:22 it was interesting trying to work out if boundservice ref counted Jun 09 19:38:29 oh dear lol Jun 09 19:38:32 so you actually got onStop, onPause, onDestroy Jun 09 19:38:35 lol Jun 09 19:38:38 will you ever be able to write android apps in swift? Jun 09 19:38:49 maybe. Jun 09 19:39:23 probably after .net Jun 09 19:39:29 lol Jun 09 19:39:40 .net already here with xamarin right :P Jun 09 19:39:53 lol Jun 09 19:39:56 my prediction has come true! Jun 09 19:40:56 samskiter what would be nice is somehow wrapping the async serviceConnection callback in Rx .. Jun 09 19:41:11 maybe an AsyncSubject Jun 09 19:41:58 so onConnect would publish the service binder to the AsyncSubject Jun 09 19:41:58 what is \x04 in link-level packet protocol Jun 09 19:42:00 ? Jun 09 19:42:11 "4 great justice"? Jun 09 19:42:16 and all the code in the activity / fragment would get the asynCsubject and be unaware of the timing Jun 09 19:42:30 4 great injustice is where I am right now.. Jun 09 19:42:32 I feel like there is more room for improvement in framework itself then language Jun 09 19:43:05 g00s: im afraid you lost me cos i dont use RX Jun 09 19:43:08 x04? sounds like IP... Jun 09 19:43:09 hello everyone Jun 09 19:43:17 * Ashiren lost Jun 09 19:43:34 tricknology: where do you see that 0x04? Jun 09 19:43:49 this is in a totally different project :P Jun 09 19:43:53 not android related at all Jun 09 19:44:03 tricknology were you the music guy ? Jun 09 19:44:07 tricknology: (╯°□°)╯︵ ┻━┻ Jun 09 19:44:11 tricknology: we don't serve your kind here Jun 09 19:44:14 I make music, yes Jun 09 19:44:16 I was hoping someone here would know how to manually repartition a device. the device is so shot that you cannot even boot into downloadmode (lg), but I do have the firmware extracted and a blueprint of the partitions and their sector locations. Jun 09 19:44:20 :P Jun 09 19:44:34 RSRazer try #android-root Jun 09 19:44:41 well it will work with Android once it’s done, if that helps.. but Android doesn’t care about the \x04 at all Jun 09 19:44:48 * samskiter leaves after weekly rediculous android activity lifecycle chat Jun 09 19:45:08 samskiter: if it steps up to daily, does that mean you'll pop in daily? Jun 09 19:45:36 groxx: im basically always online during british working hours (and, as you can see, after) Jun 09 19:46:23 pfn is the one who mentioned hiding bind() behind a future - still thinking about how to do that :) Jun 09 19:46:26 but if the chat steps up to daily, i’d never get anyting done Jun 09 19:46:30 lol Jun 09 19:46:43 I'll just try to remember that https://github.com/xxv/android-lifecycle is your bat-signal / kryptonite. Jun 09 19:46:55 hnggggggg Jun 09 19:47:10 oh my god, how have i never seen that Jun 09 19:47:13 really?! Jun 09 19:47:41 yup Jun 09 19:48:07 meh i have most of that all in my head anyway. Jun 09 19:48:30 What is good practice for versionCode and Name for beta versions? Just increment both, i.e. code = 10 and version = 1.0.10? and then code = 11 and 1.0.11? Jun 09 19:48:31 yeah. and I'd love it to be way more detailed. but it's quite linkable for when people need something beyond onResume / onPause Jun 09 19:48:47 one of the recent chet haase articles admonished not to think much about android components (activity, service) when designing your app - or not to design around them Jun 09 19:48:54 but they are so intrusive, its hard not to Jun 09 19:48:55 groxx. bookmarked….. on both my google accounts Jun 09 19:49:01 and starred Jun 09 19:49:09 and i might fork it to our internal repo ;) Jun 09 19:49:16 lol, careful in case it changes Jun 09 19:49:38 samskiter, better book an appointment with the nearest tattoo parlour as well Jun 09 19:50:16 quinnjn: great idea. i might also leave it on a monitor for a few months to screen burn it in for others Jun 09 19:50:50 just occurred to me that diagram looks like the flow chart to registering my vehicle out of state Jun 09 19:51:01 g00s: way too simple Jun 09 19:51:06 TacticalJoke: where di you find that documentation about activities executing config changes in a block Jun 09 19:51:23 also it needs Thread.sleep(like a billion milliseconds); thrown randomly between everything Jun 09 19:51:33 heh Jun 09 19:51:50 groxx: HERE COME THE GC TRAIN Jun 09 19:52:31 Do A and wait for 1 billion ms, then proceed to B. B must be completed before C, but C must be done within 0.5 billion MS of A Jun 09 19:52:45 Which one, samskiter? I think I linked to everything. Jun 09 19:52:48 do not pass go. do not collect $200. Jun 09 19:52:55 dont print that unless you have really long paper.. looks like shyte Jun 09 19:53:01 out of interest, does turning off config changes for your app reduce memory use and decrease GC? are people “going it wrong” creating better apps? Jun 09 19:53:15 I would assume less thrashing Jun 09 19:53:20 TacticalJoke: when you said the docs are updated to include onpause through to onresume in one sequential block Jun 09 19:53:26 it certainly causes rotation to happen visibly quicker Jun 09 19:53:31 Oh, no, I don't think that's the case. Jun 09 19:53:37 I mean "I don't think the documentatin says that". Jun 09 19:53:43 It only says about onDestroy -> onCreate. Jun 09 19:54:47 ah ok Jun 09 19:54:51 Actually, I think it said about no messages going between onRetainNonConfigurationInstance and onCreate. Jun 09 19:54:53 http://developer.android.com/reference/android/app/Activity.html#onRetainNonConfigurationInstance() Jun 09 19:55:00 ah, there Jun 09 19:55:10 But that doesn't guarantee anything about onPause, which IME is called a little before onStop and the rest. Jun 09 19:55:19 i suppose the point is. if you’re doing anything after onpause, its pointless anyway. you’re gonna loseit. Jun 09 19:55:49 samskiter: I sometimes turn off my screen while my app is downloading stuff. Jun 09 19:55:57 onPause happens and I definitely don't want to lose it. Jun 09 19:56:12 TacticalJoke: I don't think that guarantees onRetain -> onCreate, just onDestroy -> onCreate.... but it's slightly ambiguous :| Jun 09 19:56:13 oh i see. for that case i suppose…. you *might* lose it though.... Jun 09 19:56:37 groxx: yea it was me saying that onretain->oncreate is guaranteed, not TacticalJoke Jun 09 19:56:47 yeah. I try to keep data-related stuff between start/stop, when it's sane to doso Jun 09 19:56:51 i need to dig out my post where i found that to be the case... Jun 09 19:57:04 nono keep it between onpause/onresume Jun 09 19:57:14 What is the groupTo and childTo in SimpleCursorTreeAdapter? Jun 09 19:57:20 onstop is after onsaveinstancestate Jun 09 19:57:30 I think it does guarantee from onRetainNonConfigurationInstance to onCreate: "The guarantee of no message handling during the switch to the next activity simplifies use with active objects. For example if your retained state is an AsyncTask you are guaranteed that its call back functions (like onPostExecute(Result)) will not be called from the call here until you execute the next instance's Jun 09 19:57:30 onCreate(Bundle)." Jun 09 19:57:40 here = onRetainNonConfigurationInstance Jun 09 19:57:57 samskiter: yeah, but that just means that you _might_ lose the state if the process dies. if that happens, then they probably didn't see it anyway, and you can just show the old data as you refresh it. Jun 09 19:58:32 I usually try to build displays to be lossy-friendly, so it doesn't matter if it's saved or not, since it can be recreated. obviously that's not always correct, but it's nice when you don't have to even think about it. Jun 09 19:59:10 TacticalJoke: yea thats it. if you scan the source you will see its confirmed from onpause. there basically a method that does “getmetothisstate(newstate) and its one block Jun 09 19:59:21 samskiter: Ah, okay. Interesting. Jun 09 19:59:28 I'll stick with onDestroy, though, because that's documented. :D Jun 09 19:59:28 yeah, in (support) fragments Jun 09 19:59:32 Actually, I think I did check this once. Jun 09 19:59:34 groxx: watch out for the fragment manager blowing up then if you ever show a dialog ;) Jun 09 19:59:55 Also, unsubscribing in onPause means missing out when they turn the screen off, press the Home button, etc. Jun 09 20:00:01 TacticalJoke: worth us pushing for google to document/guarantee this Jun 09 20:00:04 support fragment lifecycle is pretty reason-able (as in, "can be reasoned about", not "I think this is an acceptable way to build a fragment") Jun 09 20:00:36 samskiter: yeah :| hates the manager, I does. Jun 09 20:00:45 its a mess Jun 09 20:00:45 no win Jun 09 20:00:58 sadface Jun 09 20:01:05 how do I get Java to realize that a literal 6 can be interpreted as a Long? Jun 09 20:01:07 reasoning about ONE activity / fragment is easy, but throw in a few fragments bound to services and its a mess Jun 09 20:01:17 And do it in such a way that it can be used in a switch statement? Jun 09 20:01:32 s73v3r: Can't you say 6L? Jun 09 20:01:42 im hungry now. good chat guys. there’s no right answer! :( Jun 09 20:01:59 it’s a boxed Long Jun 09 20:02:09 TacticalJoke’s way is great except for if you show a dialog. allowing stateloss BS. Jun 09 20:02:39 s73v3r: Not sure I understand your question. Jun 09 20:04:10 i have a Long, not a long. I want to use it in a switch statement. One of the cases is the literal 6, because right now we don’t have a name for it. Java doesn’t like this, and also cannot use Long.valueOf() in a case statement Jun 09 20:05:29 s73v3r: you should be able to do something like 'final long literal = Long.valueOf()' Jun 09 20:05:30 s73v3r: .toString()! then you can compare "6" Jun 09 20:06:21 and people say Java is verbose Jun 09 20:07:12 s73v3r: hm. can you switch on Long? or just long? Jun 09 20:07:19 just long Jun 09 20:07:23 We can switch on only ints, I think. Jun 09 20:07:25 Can't switch on longs. Jun 09 20:07:36 I'm in java 6 land, unfortunately, maybe 7 adds it? Jun 09 20:08:00 pretty sure you can switch on all primitives except for boolean Jun 09 20:08:08 Long isn't primitive though Jun 09 20:08:19 You can't switch on Long, long, etc. Jun 09 20:08:22 what Jun 09 20:08:27 yeah I was wrong, can't do long Jun 09 20:08:43 oh wow, can't do long at all. weird. Jun 09 20:08:44 oh wow you can't do long Jun 09 20:08:45 char/byte/short/int Jun 09 20:08:55 also string, in 7 Jun 09 20:09:02 right Jun 09 20:09:15 which is omg convenient sometimes Jun 09 20:09:25 when I switch on the Long, the warning studio gives me is: “ Requires char, byte, short, int, Character, Byte, Short, Integer, or an enum" Jun 09 20:09:38 yh Jun 09 20:09:49 huh. studio doesn't give me the capitalized versions. Jun 09 20:10:09 meh. /me returns to code Jun 09 20:14:05 s73v3r, are you using the full capacity of a long value? why the choice of using long instead of something smaller? what are you switching on? Jun 09 20:14:29 I’m not the one who made it a Long, and at this point it would not be worth trying to change Jun 09 20:14:40 it’s an id used on many, many, many objects Jun 09 20:15:25 seems wasteful use of memory if not actually needing the size Jun 09 20:16:03 s73v3r: in "when all you have is a hammer" style, you could split the long into upper and lower bytes as ints, and split on that :) Jun 09 20:16:21 or just use if/else instead of switch :P Jun 09 20:16:36 wow, java doesn't allow switching on a long ? TIL Jun 09 20:16:46 yeah, I didn't know that one either Jun 09 20:16:47 yeah I feel like we all learned something today Jun 09 20:16:51 i ended up using the if/else for now, because I only have a handful of cases i need to worry about in this situation Jun 09 20:17:38 it makes sense though - the dalvik bytecode encode the keys as ints. Jun 09 20:17:41 mmarklar: bah! use the hammer! Jun 09 20:17:50 and I assume something similar for java bytecode, of course Jun 09 20:18:04 groxx: my bad :) Jun 09 20:18:08 although, I guess a compiler could produce nested switches for longs Jun 09 20:18:09 thats just the principle of must surprise though Jun 09 20:18:11 *most Jun 09 20:18:13 No problem in Kotlin. :D Jun 09 20:18:25 when (longNumber) { 5L -> doStuff() } Jun 09 20:19:06 In fact, apparently you can switch on *anything* in Kotlin. Jun 09 20:19:13 \o/ Jun 09 20:19:16 when (someObject) { someOtherObject -> doStuff() } Jun 09 20:19:47 * groxx is sold, Kotlin4evah Jun 09 20:20:13 does anyone know where I can find a sample project with recent gradle/buildtools and the LVL licensing library? I feel like I’m wasting an insane amount of time trying to get this working and a working build.gradle would help tremendously Jun 09 20:20:21 Kotlin rocks Jun 09 20:20:29 I want google official support Jun 09 20:20:51 g00s, well, #1, I would advise against bound services to begin with Jun 09 20:21:20 g00s, and what's to think about, do all operations on bound service in Future context Jun 09 20:21:24 or Observable, as the case may be Jun 09 20:22:06 g00s, I find it odd that you keep insisting on bound services when the use case is not there Jun 09 20:22:15 IPC is the only reason to ever use a bound service Jun 09 20:23:31 pfn if something in your service is doing work outside of the activity lifecycle, and it arrives at a state where either (1) it should pause if the UI is up or (2) quite if the UI is not up, how would you handle that? atm i check if the service is bound. Jun 09 20:23:39 that's pretty much how i feel about them :| though I can see using it as a simple "keep my process alive" handle, with an empty service + all your useful code somewhere else. Jun 09 20:24:06 g00s, use entry/exit calls into the service Jun 09 20:24:47 pfn i can't picture it, do you have an example , maybe qicr is like that ? Jun 09 20:24:54 of course qicr is like that Jun 09 20:25:08 but it's only a single activity, but the way it works is the same regardless Jun 09 20:25:44 what is enter/exit, some kind of reference counter / flag? Jun 09 20:26:00 sure Jun 09 20:26:24 looking at https://github.com/pfn/qicr/blob/master/common/src/com/hanhuy/android/irc/LifecycleService.scala Jun 09 20:27:28 i guess you have an event bus listening for activities starting and stopping , and if they stop you see if a ircManager is running Jun 09 20:27:39 sure Jun 09 20:28:12 instead of the event bus, i'm just binding to the service. atm i'm not using the service through the binder Jun 09 20:28:23 moved all the shit to statics Jun 09 20:28:55 the framework is doing the reference counting knowing which activities / fragments are bound to it Jun 09 20:29:32 gdrc: Yeah, I wish they'd make a commitment. Jun 09 20:29:38 Kotlin is probably safe regardless, but I like guarantees. Jun 09 20:30:13 has anyone here used open science map (mapping software that supports 3D)? I cant seem to find a library to implement into my own project Jun 09 20:31:22 g00s, then in that case, you shouldn't care about the ServiceConnection at all Jun 09 20:32:14 pfn yeah ... this is a recent change. what is happening at line 13 ? Jun 09 20:32:30 can't read scala Jun 09 20:32:34 because i don't know it :D Jun 09 20:32:57 ooh. AS 1.3 preview 3. Jun 09 20:33:18 i guess i see object X and class X which confuses me Jun 09 20:33:49 groxx are you a canary :P Jun 09 20:33:50 g00s, object = singleton, that's all Jun 09 20:34:18 scala doesn't have the silly concept of 'static' Jun 09 20:38:22 Right - its about time I try and get retrofit working finally :( Jun 09 20:38:43 wooo~~ Jun 09 20:39:03 I know my script that I am calling works, because I tried it with PostMan, and it did exactly as I expected it to do. Jun 09 20:39:56 Creating a call which uses an object of objects seems to be a bit of a challenge. Jun 09 20:42:43 g00s: I'm not dead yet! send in the others! Jun 09 20:45:45 groxx how do i know thats not a recorded message :D Jun 09 20:46:34 AS 1.2 has been mostly fine - i'll wait until 1.3 final or will it be 1.4? Jun 09 20:46:51 would be funny if groxx now repeated the same thing :) Jun 09 20:48:58 hello friends. i want to create a custom motionevent from a service that is transmitted to the current activity. how can i do this? Jun 09 20:49:41 Im not your friend, buddy! Jun 09 20:49:48 oh ok! Jun 09 20:49:58 Ok - you don't get South Park references haha Jun 09 20:50:22 still, the question remains asked Jun 09 20:51:25 g00s: I'm dead yet! send in the ! Jun 09 20:51:31 does motionevent involve touching, or just like tilting/moving device? if touching how are you doing that in service and not in activity? Jun 09 20:52:09 * sir_galahad_ad_ waves Jun 09 20:52:29 canvs2321: i receive the users events via bluetooth and want to transmit them to the current activity Jun 09 20:52:45 Galahad! Jun 09 20:52:58 What is the best way to implement some sort of exponential back off when attempting to do some networking process? Jun 09 20:53:01 gruelfin lazy was is use something like an event bus Jun 09 20:53:11 And is anyone on hand to give me some hands on help with Retrofit? Jun 09 20:53:27 ask specific questions Jun 09 20:53:44 g00s: i did not understand this, can you explain what you mean? Jun 09 20:53:44 Anyone know why my ExpandableListView using SimpleCursorTreeAdapter would be making a duplicate group for every child? Jun 09 20:54:02 man, how do people manage aars for testing :/ Jun 09 20:54:09 is there a free library i could use to implement 3D objects onto a mapping software? something like opensciencemap Jun 09 20:54:34 like if my coworker and I are working on this library and testing it out. Do we just manage our own aar repositories until we're ready to merge? Jun 09 20:54:56 gruelfin see https://github.com/tehmou/rx-android-architecture ; replace JsonApi with your Bluetooth stuff. Jun 09 20:55:21 Anthaas, I'm not your buddy, pal! Jun 09 20:55:45 Anthaas could be worse, wakelock could be your mate Jun 09 20:56:04 gruelfin, you should also state whether you need help with just sending data to your activity, or if you are trying to pass an emulated/faked touch MotionEvent to your activity and you need help with both Jun 09 20:56:06 wakelock: Im not your pal, guy! Jun 09 20:56:34 Anthaas to be safe : 'area man' Jun 09 20:57:01 Its not a specific question regarding Retrofit's capabilities or anything - I would just like some help getting one interaction between retrofit and my REST API working - from there I can obviously do the rest. Jun 09 20:57:17 g00s: Why you disrespecting me, brah? Jun 09 20:57:28 canvs2321: i want to pass an emulated motionevent to any activity that is in the foreground. i'm not the creator of the activity Jun 09 20:57:51 gruelfin, probably not gonna happen, but i'm not sure Jun 09 20:57:52 Anthaas, I think he doesn't RESPECT YOUR AUTHORITAH Jun 09 20:57:56 g00s: this does not seem to be something i need for achieving my task Jun 09 20:58:24 gruelfin, so you are trying to create somekind of bluetooth mouse or something? Jun 09 20:58:36 gruelfin sure it is; you are trying to figure out how to get info from BT to UI Jun 09 20:58:37 canvs2321: i thought it was possible creating a custom IME, but there is no way of creating a motionevent, only keydown events Jun 09 20:58:49 canvs2321: yes this is what i want Jun 09 20:58:53 Boooooo wakelock, boooooooooooooo Jun 09 20:59:16 g00s: the bluetooth connection works already Jun 09 20:59:23 dunno if that is possible, think there is some way to send commands using adb to fake commands, but not sure if root was needed Jun 09 20:59:29 oh i missed the bit about BT mouse Jun 09 21:00:09 strangely i cannot find information on the web about this Jun 09 21:00:10 http://stackoverflow.com/questions/4386449/send-touch-event-from-adb-to-a-device maybe something like that Jun 09 21:00:22 Anthaas: I do like that https://gist.github.com/mlatu/4c4209010e66452dbf2e https://gist.github.com/mlatu/59143e2ef85306bddb5a Jun 09 21:00:37 but dunno if you can do something like that without root and without an android api, seems like a security risk of sorts Jun 09 21:01:07 Anthaas: easy to modify so delay would increase exponentially Jun 09 21:01:32 How does GROUP BY work in SQL? Jun 09 21:01:38 icedp: Oooh thats brilliant! Thanks! Jun 09 21:01:57 canvs2321: i want to do it without adb, i dont have a computer connection all the time Jun 09 21:02:07 Whats good about Timber in comparison to things like Log? Jun 09 21:02:13 i.e. Timber.d / Log.d? Jun 09 21:02:26 timber dont need a tag :p Jun 09 21:02:33 gruelfin, well it's beyond me, but seems you'll have to try to find some good search terms and narrow down if it is even possible Jun 09 21:02:34 and can log to web for example Jun 09 21:02:54 injecting motion events is only possible from outside the android framework Jun 09 21:03:03 wakelock: so i need root for it? Jun 09 21:03:11 ... Jun 09 21:03:21 how in the world did you get that conclusion Jun 09 21:03:57 icedp: Thanks for that - just need to modify it to work with Android Jun 09 21:04:09 wakelock: because root will let you interact with the linux subsystem, aka outside the android framework? Jun 09 21:04:18 wakelock: i never did something that required root Jun 09 21:04:30 :O Jun 09 21:04:46 mmarklar, you don't need root to interact with the underlying system Jun 09 21:04:58 true, but to write those files you should Jun 09 21:05:00 Anthaas: I use Timber because it's easy to do this: https://gist.github.com/mlatu/383b8e3020d6a5aa4f79 Jun 09 21:05:18 my point was just that this is not feasible with a simple android app Jun 09 21:06:44 Anthaas: modify for Android how? Jun 09 21:06:56 Doesn't that have Java 8 parts to it? Jun 09 21:07:01 e.g. Func1? Jun 09 21:07:11 it's RxJava Jun 09 21:07:16 it's from Android app Jun 09 21:07:46 Looks like I should now though! Jun 09 21:19:26 Hi everyone, i'm having issues with the Android YouTube player API. When running the app in debug everything works, but when signed ... it doesnt load the YT player an i get an "Unknown_Error" from the API. I tried removing / changing the key but nothing worked. That's really wierd Jun 09 21:22:59 So tired of stuff like this in Java: `if (listener != null) { listener.whatever(); }`. In Kotlin it's just `listener?.whatever()`. Jun 09 21:28:00 what if it is null Jun 09 21:28:12 Then `whatever` isn't called. Jun 09 21:29:13 http://kotlinlang.org/docs/reference/null-safety.html#safe-calls Jun 09 21:29:46 try{ listener.whatever;} Jun 09 21:29:58 if you don't care Jun 09 21:30:31 Wrapping an NPE in a try/catch… Jun 09 21:30:41 lol Jun 09 21:31:05 not a catch just a try, not like it'll hurt it, if all he wants is a smaller code Jun 09 21:31:29 i was waiting for 'haha, just kidding" but i think canvs2321 is serious Jun 09 21:31:31 That's not even legal syntax. I guess you're joking. Jun 09 21:31:33 I want efficient code too, throwing an exception each time this is null is a terrible idea Jun 09 21:31:55 and… yeah, you’re going to need a catch Jun 09 21:33:51 JakeWharton, looking at Timber a little, is there any specific reason you prefer "for (x; y; z)" over "for (member : list)" for looping over lists? Jun 09 21:34:05 doesn't allocate an Iterator Jun 09 21:34:06 Avoids creating an iterator Jun 09 21:35:14 lol “Hell is other people’s code” Jun 09 21:35:49 That’s something Sartre could have said Jun 09 21:35:50 ah I see, interesting. I've been reading on some Java guidelines some time ago and it said there is virtually no difference (performance-wise) between the two. guess they forgot to mention impact on other resources. Jun 09 21:36:06 TacticalJoke: no such construct for argument thought e.g. if (a != null) do(a); Jun 09 21:36:43 what do you recommend me to use if I want to make a cross-platform app? Jun 09 21:37:01 wakelock: i wouldn't do it for application code. in libraries we want to have zero overhead above the absolute minimum thus we bend over a bit to avoid things like allocations, repeated field/method lookups, etc. Jun 09 21:37:52 ah, so in your opinion "for (member : list)" is generally fine for app usage? Jun 09 21:38:15 darn, I was just about to convert all my million loops to index loops :p Jun 09 21:38:43 Lose a tiny bit in performance, gain in abstraction Jun 09 21:38:54 where is RetrofitError in github :/ Jun 09 21:38:59 I don't think it matters at all unless that code is being called a lot. Jun 09 21:39:07 (The code containing the iteration.) Jun 09 21:39:26 Outside of library concerns, of course. Jun 09 21:40:17 I have a lot of loops in a lot of places, I guess I'd have to investigate the utilization of each individually Jun 09 21:40:55 JakeWharton did you guys get rid of RetrofitError class in master? Jun 09 21:41:04 yes Jun 09 21:43:17 JakeWharton ookay, just using Throwable instead? Any reason? Jun 09 21:43:58 jaana, I agree abstraction is nice, however I was under the impression the two variants are virtually identical in most aspects so I converted most loops into member loops some time ago. now I feel I need to go back and recheck the actual impact on performance and resource utilization. Jun 09 21:44:17 JakeWharton, thanks Jun 09 21:45:53 Afzal: yes, among some other mechanisms Jun 09 21:46:21 Cool, thanks! Jun 09 21:46:34 * Afzal will just work around it Jun 09 21:47:02 * wakelock throws a Throwable at Afzal Jun 09 21:47:55 try { } catch (WakelockThrowable t) { Timber.e("Wakelock threw a throwable"); } Jun 09 21:51:07 oh shiiiiit. Just found out about cmd+[ in AS Jun 09 21:51:17 was missing that one shortcut! Jun 09 21:51:57 oh, it's opt+cmd+left for the rest of you Jun 09 21:52:11 both work actually Jun 09 21:52:15 nice Jun 09 21:52:40 cmd+shift+ -/+ is pretty nice also Jun 09 21:53:24 oh yeah cmd+ -/+ works for me Jun 09 21:53:40 rabbit simulator http://digg.com/video/rabbit-goes-about-its-business-in-spite-of-avalanche Jun 09 21:53:42 woop Jun 09 21:53:45 correct Jun 09 21:53:46 :) Jun 09 21:57:12 wakelock: There is such a tiny difference. I think the default, for applications, should be to use the enhanced-for syntax. Even this artcile (which is pretty strict) says this: http://developer.android.com/training/articles/perf-tips.html#Loops Jun 09 21:57:46 Hey everyone. I'm looking to learn Android development as a reasonably experienced developer on other platforms, including iOS. What book or books are recommended? Looking for stuff that includes Android M changes especially. Are the official docs sufficient? Jun 09 21:58:15 docs for M are incomplete Jun 09 21:58:18 and the API is subject to change Jun 09 21:58:26 google dont waste their time with docs Jun 09 21:58:29 It would be best if you focus on the basics first Jun 09 21:58:30 haha Jun 09 21:58:30 Having said that, that article seems wrong (e.g., "for other collections the enhanced for loop syntax will be exactly equivalent to explicit iterator usage"). Jun 09 21:58:36 That has been my experience with other Google platforms Jun 09 21:58:36 they need it to release half finished stuff :p Jun 09 21:58:38 Oh, sorry, I misread. Jun 09 21:58:39 I think I'll try mass-converting all loops to standard index loops, just for kicks, to see if there's any difference at all Jun 09 21:58:40 Never mind. Jun 09 21:58:49 danijoo, Jun 09 21:58:50 :) Jun 09 21:58:54 :p Jun 09 21:59:03 you wont find much about M changes Jun 09 21:59:14 its hart to find lollipop stuff at some time Jun 09 21:59:21 Though the thing about the performance of two() relative to that of one() doesn't seem accurate. Jun 09 21:59:32 official docs should get you started. books are too fast outadated Jun 09 22:00:23 for-each on an an array is fine Jun 09 22:00:24 danijoo, Yeah that is unfortunately true for iOS as well, especially Swift Jun 09 22:00:49 it's just sugar for an indexed loop Jun 09 22:00:49 * wakelock goes to write The Ultimate Android Guide. page 1: "go read official google docs." page 2: "the end" Jun 09 22:00:52 But at least Xcode is 100% integrated and so on Jun 09 22:00:56 immediatly start with kotlin instead of java and you will be ahead of others :p Jun 09 22:01:02 pretty sure that won't get outdated anytime soon :p Jun 09 22:01:21 wakelock, Experience has tuaght me to not have that much faith in Google documentation for their platforms, especially in the face of rapid change Jun 09 22:01:43 Oh, true, they are talking about an array at the bottom (I should stop multitasking and read stuff :D). Jun 09 22:01:48 they just give up and dont write them anymore ^^ Jun 09 22:01:51 I still have PTSD from chrome app development Jun 09 22:01:55 mdeboard: use the d.android.com site, it covers things better than most. especially the earliest tutorials / guides. Jun 09 22:01:56 mdeboard, faith in alternative guides or paperbacks seems even less wise Jun 09 22:02:11 having faith* Jun 09 22:02:23 hehe Jun 09 22:02:24 mdeboard: biggest hurdle/surprise for you (aside from Java) will probably be the lifecycle, because it's dramatically different than iOS Jun 09 22:02:26 Can't argue Jun 09 22:02:40 I'm fine on Java Jun 09 22:02:58 groxx, Would like to hear more, is this written down in the official docs somewhere? Jun 09 22:03:09 Or passed down as oral tradition from one generation to the next Jun 09 22:03:17 I guess I'm going to write some for/foreach benchmarks Jun 09 22:03:38 mdeboard: then http://developer.android.com/guide/components/fundamentals.html and http://developer.android.com/reference/android/app/Activity.html cover a lot. plus http://developer.android.com/guide/topics/resources/runtime-changes.html Jun 09 22:04:17 the lifecycle is the reason for a lot of seemingly-strange patterns in Android. learn it, learn it well, you'll be interacting with it all the time. Jun 09 22:04:21 > The Android operating system is a multi-user Linux system in which each app is a different user. Jun 09 22:04:23 mdeboard have you messed around with xcode 7 yet ? Jun 09 22:04:24 That's interesting Jun 09 22:04:28 g00s, I have not Jun 09 22:05:05 I heard M has major changes to permissions, so am hoping the official docs have been updated to reflect Jun 09 22:05:12 (would hate to learn wrong thing) Jun 09 22:05:38 M isn't released yet :) Jun 09 22:05:57 also, the M stuff is primarily accessible at d.android.com/preview Jun 09 22:06:04 excellent Jun 09 22:06:09 groxx, thank you, extremely helpful Jun 09 22:06:39 mdeboard not many changes in M beside Doze, permissions - given that its in flux i'd just focus on 5.1 Jun 09 22:07:06 the new permission api isn't more than 10 minutes to grock either Jun 09 22:07:17 Alright Jun 09 22:07:34 yeah. it's pretty simple. minus perhaps the rearrangement they're hinting at (dunno details there) Jun 09 22:08:28 mdeboard: keep http://developer.android.com/guide/index.html handy, and look stuff up as you approach it. the official docs are pretty good for the most part, though there are a number of gaps as you dive in deeper (and then you can just check the source code) Jun 09 22:09:00 mdeboard: oh, that too! you can read the source code. in android studio you can just go to the definition of framework stuff and read it, it'll answer most questions far faster than StackOverflow. Jun 09 22:09:13 I'm planning on just using IntelliJ Jun 09 22:09:20 since i use that for java/scala/clojure shit already Jun 09 22:09:24 s/shit/stuff Jun 09 22:09:25 sorry :) Jun 09 22:09:40 makes sense. I dunno how well IntelliJ is integrated, but I mostly assume it's pretty close to android studio? Jun 09 22:09:44 From what i udnerstand that shouldn't be a problem Jun 09 22:10:41 Yeah I'm kind of torn, not sure if I should just go with Android Studio, i.e. if it's as neatly integrated with devices as xcode Jun 09 22:10:59 you will be missing on features such as the (quite recently) integrated SDK manager. Jun 09 22:11:25 mdeboard: nope :| xcode's integration is better. Jun 09 22:12:09 Yeah but that's ok. They kind of have that whole vertical integration/lock-in thing on the Apple side :) Jun 09 22:12:20 things might be arranged a bit differently than Android Studio, and yeah, no SDK manager, but I think almost everything else works out of the box... hard to say though, I haven't used plain IntelliJ for more than like 20 minutes Jun 09 22:12:32 yah Jun 09 22:13:04 What will life be like without an SDK manager? Jun 09 22:13:08 since otherwise you'll wonder why anyone develops for android: install haxm, and use intel emulator images, or the emulators will be painfully slow. Jun 09 22:13:18 Is SDK manager like cocoapods or something? Jun 09 22:13:22 ah, sorry. you'll still have the sdk manager, android studio is just getting a nicely integrated thing. Jun 09 22:13:46 it's no real loss. in fact, if they don't make other changes, I'll probably stick to using the "old" manager :| more fine-grained downloading of stuff. Jun 09 22:14:15 Also you don't have the memory/CPU profiling visualizers on the raw IntelliJ IDE. Jun 09 22:14:15 sdk manager is like xcode's "download iOS / emulator / docs" Jun 09 22:14:27 ahhh Jun 09 22:14:31 gradle is cocoapods (via maven, primarily) Jun 09 22:14:53 gradle is also the entire build / project configuration / etc / etc / omg it does everything system, for good or bad :) Jun 09 22:15:20 mostly I find it obtuse, but way more flexible than most alternatives, and when you find the magic incantation to make it work it's remarkably simple. Jun 09 22:15:54 Does "Each process has its own virtual machine (VM)" mean its own *JVM*, or Linux VM? Jun 09 22:15:58 surely the former Jun 09 22:15:59 not sure how the Android-specific lint checks work outside Android Studio. Jun 09 22:16:37 mdeboard: jvm. technically not "j"vm because it's not running java class files (they're converted prior to .apk packaging), but close enough. Jun 09 22:16:44 Ok Jun 09 22:16:58 then surely all of IntelliJ's profiling tools/add-ons can be used here right? Jun 09 22:17:13 mdeboard: and it goes a bit further, where you're basically forking a "hot" vm with the framework already in memory, and then it just starts your code. so you don't use the 'main' method, you use the component lifecycle callbacks. Jun 09 22:17:25 I see Jun 09 22:17:30 Abstractly, anyway Jun 09 22:17:38 yeah. it'll make more sense eventually :) Jun 09 22:19:22 iOS/Xcode is pretty damn awesome, I just don't own any iDevices, so this product idea i"ve got makes sense to prototype on Android. Jun 09 22:19:32 storyboard is sick. Jun 09 22:20:06 android has something similar, but last time I touched it, I regretted it :) I think it's referred to as the "navigator" or something? unless someone else disagrees, I wouldn't recommend using it. Jun 09 22:20:42 I wonder what's the ratio of Xcode/AppCode adoption. Jun 09 22:20:45 Alright. I didn't plan on seeking anything out, I figured it'd be a mess Jun 09 22:21:15 hi Jun 09 22:21:22 So an android os running app could set up all the lens/(micro-)mechanical aspects of the smartphone camera? Exposure, shutter speed, zoom, aperture? Jun 09 22:21:25 camera.aperture = 2; camera.shutterSpeed = 1; ? Jun 09 22:21:27 is that true? Jun 09 22:21:34 ha groxx, are you referering to the pathetic thing that Eclipse has? Jun 09 22:21:36 android tools are a bit of a hodgepodge right now :) bunch of random stuff in separate tools that haven't been updated in years (which sometimes matters, sometimes doesn't). Android Studio is part of a bigger process to merge everything into the IDE :) Jun 09 22:21:51 I use that to very roughly drag and drop things onto the layout, then go straight to XML Jun 09 22:21:54 tricknology: dunno if Eclipse has it... it was definitely in Android Studio though Jun 09 22:22:13 like.. did it DESTROY your relative layouts when you move a button around? Jun 09 22:22:15 oh, the layout editor. no, I mean something like "navigation editor", which is pretty obviously trying to be Storyboards for Android™ Jun 09 22:22:20 aah i see Jun 09 22:22:31 http://tools.android.com/navigation-editor Jun 09 22:22:36 not recommended. Jun 09 22:22:45 anyone? :/ Jun 09 22:23:04 groxx, Yeah if it's not a first-class feature of the editor it seems like it'd be a mess. Jun 09 22:23:13 mdeboard may as well look thse over too http://www.reddit.com/r/androiddev/comments/396dux/developing_for_android_ix_tools/ Jun 09 22:23:20 iChatter: it depends on the device, but I think Camera2 reliably offers roughly that level of control. that's only on Lollipop and newer though. Jun 09 22:23:47 it's technically a first-class feature? but when I poked at it, it was garbage. possibly it has changed, but I haven't heard anything about it, so I doubt it. Jun 09 22:24:17 groxx: so an app could be written to use the Camera2 api and control these features? Jun 09 22:24:20 *theoretically Jun 09 22:24:57 mdeboard also, i recommend only using Stable channel not betas, etc ... you'll see this a lot otherwise http://www.reddit.com/r/androiddev/comments/396umt/fix_for_those_using_updated_buildtools_version_23/ Jun 09 22:27:33 iChatter: http://developer.android.com/guide/topics/media/camera.html Jun 09 22:27:55 thanks Jun 09 22:28:01 groxx: ^ Jun 09 22:29:16 iChatter: the old camera API _can_ be capable of manual controls, but iirc it's all vendor-specific. so e.g. you'll have to see what Samsung uses for their http://developer.android.com/reference/android/hardware/Camera.Parameters.html keys, and LG, and HTC, and etc etc etc. there might be some semi-standard ones, I'm not sure Jun 09 22:29:41 g00s: stable channel for what? Jun 09 22:29:54 mdeboard all the tools Jun 09 22:29:56 sorry switched IRC machines here Jun 09 22:29:58 mdeboard: for build tools / android studio Jun 09 22:30:05 Ah no problem there Jun 09 22:30:18 I tend to stick to stable stuff Jun 09 22:31:24 mdeboard: if you get the itch to browse more versions of source code, try grepcode http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/5.1.0_r1/android/app/Activity.java#Activity or android xref http://androidxref.com/5.1.0_r1/xref/frameworks/base/core/java/android/app/Activity.java :) Jun 09 22:31:45 well, or pull the AOSP repo. but that's huge. Jun 09 22:36:11 Hopefuly intelliJ will open most of those doors for me as I need them Jun 09 22:36:18 but if they don't I'll kno where to look, thanks Jun 09 22:37:44 So IntelliJ definitely popped up a thing called SDK manager that is installing a bunch of crap it says I need Jun 09 22:37:47 to start an Android project Jun 09 22:38:16 /shrug Jun 09 22:38:21 this is excite Jun 09 22:38:26 Ok I'll stop live-streaming, soryr. Jun 09 22:38:37 it will trick you into loading way to much :p Jun 09 22:39:35 hehe Jun 09 22:39:43 It's the Java(tm) way! Jun 09 22:41:08 "Downloading Android TV ARM EABI v7a System Image, Android API 22, revision 1" ... ¯\_(ツ)_/¯ Jun 09 22:42:09 thats what i mean ^^ Jun 09 22:42:36 because everyone needs that TV emulator to start android dev. obvisously, right? Jun 09 22:43:20 Well, duh Jun 09 22:44:13 and an ARM one, so you can get the full experience of running android TV on an 8088. Jun 09 22:44:29 ^^ Jun 09 22:44:37 That is exactly the spec of this idea I hav Jun 09 22:44:38 e Jun 09 22:45:04 I want to be able to hit the Turbo button on my TV Jun 09 22:45:18 what could be simpler Jun 09 22:45:36 everything needs a turbo button Jun 09 22:45:47 No JDK 8 for Android yet? Jun 09 22:46:01 I dn't know enough to discern between IDE problem and actual limitation of platform Jun 09 22:46:27 nm I see in the docs Jun 09 22:46:31 JDK 7, bummer Jun 09 22:47:32 ll /opt Jun 09 22:53:07 kotlin > java 8 :0 Jun 09 22:53:59 danijoo * > Java 8 Jun 09 22:54:05 So I updated Android Studio, and now I am getting an error in styles.xml about "Theme.AppCompat.Light.DarkActionBar" not being found. Jun 09 22:54:12 danijoo > java 8 :) Jun 09 22:54:16 Oh yeah I heard about this Jun 09 22:54:19 Kotlin, I mean Jun 09 22:54:36 Also I am far from an expert Java user, but people I greatly respect are super excited about Java 8 Jun 09 22:54:45 come to the dark site, we have lambdas! Jun 09 22:54:47 Anyone familiar with the MVP implementation in the Square anti-fragments blog post? https://corner.squareup.com/2014/10/advocating-against-android-fragments.html Jun 09 22:54:57 There are people not using Java 8 yet? Jun 09 22:55:15 I guess there are still people using Java 6...and people still using i386 machines... Jun 09 22:55:43 Java 8 has lambdas? Jun 09 22:55:47 s/?// Jun 09 22:55:55 yep Jun 09 22:56:01 mdeboard best right now to get in your mind, Android is not Java Jun 09 22:56:04 oh, thought you were referring to Kotlin Jun 09 22:56:22 its worse :D Jun 09 22:56:29 g00s, I have that in my mind, but what do you mean specifically Jun 09 22:56:35 Linux isn't Java either Jun 09 22:57:05 I'm trying to wrap my head around how the onBackPressed and showItem in SinglePaneContainer will work for more then the MyDetailsView. Wouldn't the is get quite messy with handling navigation between multiple views? Jun 09 22:57:08 is coffee java? Jun 09 22:57:18 mdeboard it will become clear over time, if that is in the background of your thoughts :) Jun 09 22:57:25 how can java be real if our compiler doesn't real? Jun 09 22:58:23 its usually a good idea, when you need a java library, to ask whether the authors support android. or find an android specific one Jun 09 22:58:31 Ah ok Jun 09 22:58:40 rxjava guys say, we support android so its \o/ Jun 09 22:58:51 well, partly that's just that "proper" java code is horrifically inefficient in a mobile context Jun 09 22:58:57 Quasar guys, don't support android yet, so it /o\ Jun 09 22:58:58 i sometimes feel like there are more andorid libs than java though Jun 09 22:59:07 g00s, Are you saying Android only supports a subset of JDK 7 APIs? Jun 09 22:59:14 g00s, but androidRx feels so incomplete :/ Jun 09 22:59:21 mdeboard yes Jun 09 22:59:29 Ahso Jun 09 22:59:32 no javax for one Jun 09 22:59:36 hm Jun 09 22:59:39 I literally hat to write 3 new observable for my first rxjava activity Jun 09 22:59:42 had* Jun 09 23:00:05 SearchView, menuitem clicks and OnItemLongClick Jun 09 23:00:49 So I assume all the javax namespace things are implemented for native Android usage? Jun 09 23:00:57 or what Jun 09 23:01:01 like why aren't they supported Jun 09 23:01:17 You guys are super helpful btw, worth the $24.99 I didn't pay for a book :P Jun 09 23:01:31 mdeboard, we accept paypal :) Jun 09 23:01:32 I appreciate the willingness to explain stuff, as well, instead of "rtfm" Jun 09 23:01:40 mdeboard also, you will find standard java stuff like TransferQueue which are API 21. If your minSdk=21 you are fine, otherwise ... can't use it Jun 09 23:01:55 I just started a project with sdk 22 Jun 09 23:01:57 ha! and Long.compare - only APIv19+ Jun 09 23:03:44 though I think the most heinous backwards-compatibility-fail is that SQLiteCursor gained the Closeable interface somewhere along the lines, but the tools don't warn you about that. so you can compile it fine as long as targetSdk supports it, but when it _runs_ on a too-old device, you'll get an exception if you try to give it to a Closeable-accepting Jun 09 23:03:44 method. Jun 09 23:03:58 ahhhh Jun 09 23:04:06 ok g00s I found a SO answer that explains what you mean Jun 09 23:04:12 http://stackoverflow.com/a/16811778 Jun 09 23:04:43 yeah pretty much Jun 09 23:05:16 every time I visit SO, it reminds me that this old crappy question of mine has earned _yet more_ points, because so many other people (still!) have the same problem. it's depressing D: Jun 09 23:05:33 Android Runtime Jun 09 23:05:34 so libraries that generate bytecode at runtime generally won't work like parboiled Jun 09 23:05:38 not Dalvik any longer Jun 09 23:06:05 groxx perpetual internet awards :) Jun 09 23:06:27 does Android have the full NIO.2 stuff yet ? Jun 09 23:06:28 g00s: yeah :| it occasionally wins awards too. Jun 09 23:06:56 hell, I think half my badges are from that one question, slowly percolating through the years Jun 09 23:07:06 lol Jun 09 23:08:30 its not common, but some classes have added behavior to the standard java ones, like DecimalFormat Jun 09 23:10:09 Interesting read about ART/Dalvik Jun 09 23:11:10 SO I gather the only JDK 7 APIs that have support on Android are the ones for which there are JVM->ART bytecode translations? Jun 09 23:11:45 probably stuff google had time to code themselves, or borrow like from jsr-166y Jun 09 23:12:28 they probably used doug lea's stuff from there without rewriting it Jun 09 23:12:57 mdeboard: the only real source is http://developer.android.com/reference/packages.html :) Jun 09 23:13:47 groxx, Yar Jun 09 23:14:06 Anyone here done any work with the Wikitude SDK? Jun 09 23:15:56 Hi Jun 09 23:16:14 hi Jun 09 23:16:24 Can anybody help me with problems running facebook on android x86 on virtualbox? Jun 09 23:17:09 or suggest another channel? Jun 09 23:17:29 whats the prob? Jun 09 23:17:30 Sorry, I'm a huge newb, no help here Jun 09 23:18:08 "Unfortunately, Facebook stopped" Jun 09 23:18:24 have you installed google play services Jun 09 23:19:16 Thanks danijoo, I'll try that Jun 09 23:19:37 I cant download anything right now but i'll let u know tomorrow Jun 09 23:20:33 Anyone able to help with this http://stackoverflow.com/questions/30744081/overriding-libs-ontouch-listener/30744185#30744185 Jun 09 23:20:41 What about this: when I hold click on the background and click wallpapers it says "Unfortunately, Trebuchet stopped" Jun 09 23:24:10 I have a table used to keep track of some magazine names and it has also a id. The basic premisses for this table is the magazine names shouldn't get duplicated. So I wonder if I really need this id column? Jun 09 23:26:44 Hi everyone, i'm having issues with the Android YouTube player API. When running the app in debug everything works, but when signed ... it doesnt load the YT player an i get an "Unknown_Error" from the API. I tried removing / changing the key but nothing worked. That's really wierd and i'm out of idea :( Jun 09 23:26:45 how can I generate methods for a class at compile time? Jun 09 23:27:40 PuercoPop, like with annotations? Jun 09 23:28:44 ircfox, you do Jun 09 23:29:02 or you should Jun 09 23:29:49 danijoo: why? Jun 09 23:30:01 ircfox: if you set `id integer primary key` (which seems like you could be using) it'll automagically a) not use an extra column (because it'll just take over the rowid), and b) ensure you don't have duplicates. Jun 09 23:30:14 ah, + "not null" Jun 09 23:30:45 PuercoPop: with annotations: not really. you can't modify existing classes, only generate new ones, no exceptions. Jun 09 23:30:54 PuercoPop: the exception is to use something like lombok Jun 09 23:31:05 I think the "convention" for android is to name it _id Jun 09 23:31:23 yeah, if you want to use it with a CursorAdapter / Loader, _id is slightly better. Jun 09 23:31:33 you can always "select id as _id" to get around that thoguh. Jun 09 23:31:35 groxx: because a table needs a rowid anyway? Jun 09 23:31:52 ircfox: generally. I don't remember which version allows "without rowid" tables, but I don't think all androids support it. Jun 09 23:32:07 groxx: lombok? So if annotations are not what am I looking for then what is? The Compiler java.lang is a stub according to the docs Jun 09 23:32:26 PuercoPop: not sure what you're looking for. what do you want to do? Jun 09 23:33:02 ircfox, if you work with that rows in your app, an id field is nice to have Jun 09 23:33:05 groxx: but my Java code won't even notice this rowid will exist, I should worry only with the name column. Jun 09 23:33:24 for example if you want to pass your object to another activity, its better to just pass an integer id than the whole object or some string Jun 09 23:33:25 ircfox: d'oh. sorry, I missed that the names should be unique Jun 09 23:33:43 Anyone successfuly made an app that uses the YouTube API (player) ? Jun 09 23:34:04 I'm stuck on my problem for a week, i'm going crazy :x Jun 09 23:34:13 also _id integrates nicely in andorids cursor/adapter stuff Jun 09 23:34:41 groxx: ...and b) ensure you don't have duplicates. ? Jun 09 23:34:54 ircfox: you can set the column as "name text primary key", or "name text unique". I forget how far you can go with constraints on unique indexes, but you'll want to watch out for "A != a" Jun 09 23:36:15 groxx: basically this table will keep track of a FragmentList with names. Jun 09 23:37:15 I have some partial fields on POJO and a link to fetch the full fields. What I want to do is when any of the missing fields are requested, fetch the data and keep it on an private and use delete field access to it afterwards. Because this 'cache' getters are boilerplate I want to generate them at compile time. Jun 09 23:38:41 PuercoPop: for android, you're probably better off writing the boilerplate, or if you really want to generate it, look at what e.g. @AutoValue does to generate code via annotations. Jun 09 23:38:50 PuercoPop, It will cost you much more work to write a processor that generates them at compile time then just write the boilerplate Jun 09 23:39:07 what book dopeple recommend Jun 09 23:39:12 danijoo: I am a bit lost here with this database, because I am loading it inside a ListFragment but I have another Activity where I register new names and I don't know if I should be opening the database again in this case. We already discussed here to implement a single connection database but I still not implement it. Jun 09 23:39:13 to learn about android programming Jun 09 23:39:14 PuercoPop: there are way more complex code generation projects out there, like Dagger / Dagger 2, but @AutoValue is simple enough to understand, and I mostly like the technique. flexible and light on memory. Jun 09 23:39:32 bubbely: d.android.com Jun 09 23:40:01 otherwise I keep hearing decent things about the BigNerdRanch book, and I have liked their past ones. dunno how recent it is though, maybe someone else here does. Jun 09 23:41:38 groxx: I'll look into it. Thanks. I've looked at dagger 2 an plan to start using it at some point. Jun 09 23:57:51 just saw the message about the BNR book. It’s a couple years old, but the info is still pretty relevant Jun 09 23:58:00 they put an emphasis on fragments Jun 10 00:01:43 I was searching at SQLiteDatabase class methods to find a way to obtain the next auto-increment value from a column but it seems I will have to do it programatically. Jun 10 00:01:56 As : SQLiteDatabase api Jun 10 00:02:11 ups, as : SELECT last_insert_rowid() AS rowid FROM table_name LIMIT 1 Jun 10 00:02:49 ircfox: there is a special table with values SQLITE_SEQUENCE Jun 10 00:04:38 Napalm: the problem is this column doesn't contain auto-increment property. Jun 10 00:07:31 ircfox: so add it? Jun 10 00:09:51 Hi everyone, i'm having issues with the Android YouTube player API. When running the app in debug everything works, but when signed ... it doesnt load the YT player an i get an "Unknown_Error" from the API. I tried removing / changing the key but nothing worked. That's really wierd and i'm out of idea :( If you don't know maybe you could poin me to semwhere they might :/ Ty Jun 10 00:10:12 point* somewhere* Jun 10 00:13:39 Enyxx: generate a new key in the google developer console based from your release signing key and use that in your app. Jun 10 00:14:10 Enyxx: you also cant use YT api in Genymotion without the Play Services installed Jun 10 00:21:15 hi Jun 10 00:27:31 ircfox: generally you shouldn't need to do that. e.g. when you insert, it'll return the id of the inserted row Jun 10 00:28:31 Napalm: thanks for the answer i just tried regenerating and same issue, it works, then i sign, then it doesnt work /: I'll take a look at Genymotion but i hate when i cant find the bug and fix it >< Jun 10 00:30:02 timber does nothing if the tree isn't planted? Jun 10 00:30:07 maybe it should call an exception :/ Jun 10 00:31:34 Afzal plant as many trees as possible, they are carbon sinks ! Jun 10 00:32:10 or make a TREE_OF_IGNORANCE that just noops all the methods Jun 10 00:32:25 aaaanyway. What's the correct way of posting back to a callback on the main thread after some operation on a new thread? Jun 10 00:32:45 right now I do new Handler(Looper.getMainLooper()) but I remember Mavrik saying that wasn't okay Jun 10 00:32:48 or something Jun 10 00:34:35 Afzal we had a big lifecycle and threading discussion earlier Jun 10 00:34:40 :( Jun 10 00:34:42 only one of those allowed per week Jun 10 00:34:49 you'll have to wait until next week Jun 10 00:34:50 that'll work. there's no need to make multiple main-handlers though, since they're all operating on the same queue Jun 10 00:34:59 oh look, AsyncTask does the same Jun 10 00:35:10 kinda Jun 10 00:35:36 groxx is there a main handler? Jun 10 00:35:50 or do you mean I should make one Jun 10 00:36:47 you still have to make one, but you can just share a singleton instance across your app if you're just posting runnables Jun 10 00:36:58 cool, yeah that'll work :) thanks! Jun 10 00:39:10 can i add a view to a v7 Toolbar in XML? Jun 10 00:39:41 s73v3r I believe so Jun 10 00:39:51 oh yeah, did that two days ago Jun 10 00:39:52 yup Jun 10 00:40:22 how do I position views inside of it? Like if I want something on the right hand edge? Jun 10 00:40:53 s73v3r just like normal, using gravity Jun 10 00:40:55 it probably handles layout_gravity? Jun 10 00:41:19 says right here: https://developer.android.com/reference/android/widget/Toolbar.html Jun 10 00:41:27 well, that's for not v7 but same thing Jun 10 00:41:40 here's v7: https://developer.android.com/reference/android/support/v7/widget/Toolbar.html Jun 10 00:41:41 so it does. Thanks Jun 10 00:42:38 groxx: thank you! Jun 10 00:43:52 Napalm: thank you! Jun 10 00:44:14 your welcome Jun 10 00:46:45 first time with mock context!! Jun 10 00:47:16 ircfox I always imagine Rick Fox when I see your username Jun 10 00:47:40 Napalm: I can't seem to find why the YT player is still not workin, do you know if there is anything else required beside an API key and the player installed and up to date ? (OAuth ?) Jun 10 00:49:04 Afzal: are you his fan? Jun 10 00:49:10 no lol Jun 10 00:49:23 He's alright, I didn't watch NBA in those days Jun 10 00:50:13 If it makes you happy go ahead. Jun 10 00:50:32 is there a relatively simple way to filter a list of json objects in an array? Jun 10 00:50:50 lol Jun 10 00:50:59 it's just an observation :) Jun 10 00:54:45 I can't mock Context with Mockito and run it in Junit? o.O Jun 10 00:55:06 using guava, Lists.filter(Arrays.asList(anArray), new Predicate<...>() { ... }) Jun 10 00:55:11 ^ nomat Jun 10 00:56:19 man you guys weren't kidding about that SDK manager encouraging you to download a LOT of unnecessary stuf Jun 10 00:56:26 ty Jun 10 00:56:59 by default yeah. i only dl a few things Jun 10 00:57:54 I only ever download one or two platforms, and the m2 repos Jun 10 00:58:26 What's "MNC" stand for? Jun 10 00:58:26 ah, so that's what robolectric does Jun 10 00:58:30 well shit Jun 10 00:58:35 "revision MNC" Jun 10 00:58:41 g00s: when you developed BLE app, what was the BLE peripheral's communication method? (UART, GPIO.. etc. for example) Jun 10 00:58:43 Multi-National Corporation? Jun 10 00:58:57 whoa, when did importing robolectric become a one-line affair?! Jun 10 01:00:23 So a question about Java inheritence... Jun 10 01:00:23 I have a two classes, let’s say ChildA and ChildB, and they both extend a class Base. If I construct a ChildA, and then try to cast it to a ChildB, will an exception be thrown? Jun 10 01:01:00 FlyingJester yes. Jun 10 01:01:22 afaik...(just to cover my ass) Jun 10 01:02:33 lol, i got an update 'stability and performance improvements' ... that was really just new Adds Jun 10 01:02:42 A ClassCastException? I ask because everything complains when I don't mention exceptions thrown, but apparently not that kind. Jun 10 01:03:01 FlyingJester http://ideone.com/rGyrjH Jun 10 01:03:16 and the best part about it, the first thing is an interstitial add which crashes the app Jun 10 01:03:30 that's because the compiler doesn't know that they aren't compatible Jun 10 01:04:02 Right. If I say first cast it to the Base class, though. That's what is happening for me. Jun 10 01:04:20 actually wait Jun 10 01:04:27 the compiler knows that condition Jun 10 01:04:48 you cast it to Base, that's fine Jun 10 01:04:54 then you cast it to ChildB? Jun 10 01:05:00 you can't "upcast" Jun 10 01:05:34 OK. I have an object of a base class, and I know it is actually of a class that extends that base class. And the base class is basically useless (I didn't write the library it's from). Jun 10 01:05:59 I assumed I was supposed to try to cast it, and catch an exception if it I was casting it to the wrong type. Jun 10 01:06:02 FlyingJester see how this succeeds Jun 10 01:06:02 http://ideone.com/rGyrjH Jun 10 01:06:28 because even though the ChildB object is referred to as Base, it's still ChildB so it can be casted Jun 10 01:06:55 but you can't just cast ChildA to ChildB, otherwise you'd be able to cast everything to everything else since everything extends Object Jun 10 01:07:48 Afzal I can't on a language level, or on an "it will throw an exception" level? Jun 10 01:08:09 there's only two levels. Compilation and Runtime Jun 10 01:08:56 FlyingJester read the top answer there Jun 10 01:08:56 http://stackoverflow.com/questions/4862960/explicit-casting-from-super-class-to-subclass Jun 10 01:09:44 but don't pepper your code with instanceof Jun 10 01:09:53 Ok. I didn't know about instanceof. Jun 10 01:10:00 * bhans slaps FlyingJester around a bit with a large trout Jun 10 01:15:25 Do I use Robolectric if I wanna mock Context? Or is there something simpler? Jun 10 01:25:37 mdeboard: did it actually download mnc support? Jun 10 01:41:03 groxx: It was, before I cancelled the download Jun 10 01:41:14 groxx: What is it? Jun 10 01:42:49 I have an onScroll event where I'm trying to compare Y to the screen height; in 4.4 it works as I'd expect, Jun 10 01:43:07 mdeboard: pre-release software support :| seems like something you don't really want (or need) by default. Jun 10 01:43:11 but in 2.3, when I'm at the bottom of the screen, y = 128 but the screen height is 533. Jun 10 01:44:09 Actual pixel height should be 800 pixels, so where are those 128 and 533 coming from? and can I get the real numbers? Jun 10 01:45:28 The onScroll is from my activity, which extends OnGestureListener. The screen height was from getWindowManager().getDefaultDisplay().getMetrics(metrics); Jun 10 01:48:26 by "y" you mean the scrollY or the y position of a view, or...? Jun 10 01:49:16 The scroll y, getY() from the second motion event passed in to onScroll. Jun 10 01:50:07 I want the y coordinate where my finger was at the end of the motion, in the same units as screen height. Jun 10 01:50:27 groxx: remember the multiwindow discussion we had a while back? what was the final outcome of that? i don't recall ever seeing what changes you ended up making, but i recall it only requiring manifest changes, am i correct? Jun 10 01:51:31 groxx: Gotcha. Jun 10 01:51:50 Anyone used the Wikitude SDK? It's ... not quite what I thought it was. Jun 10 01:52:20 akk: I forget if "getY" is based on the view you're touching or not. try getRawY though, see if that's what you want. Jun 10 01:52:24 Afzal, https://github.com/pfn/android-sdk-plugin/issues/171 Jun 10 01:52:41 Afzal, there's a mockable jar task in gradle Jun 10 01:52:41 lewellyn: multiwindow... samsung specifically? Jun 10 01:52:45 Thanks, groxx, I'll try it. Jun 10 01:52:51 Afzal, use it, no robolectric necessary Jun 10 01:52:52 lewellyn: otherwise I think I'm not remembering Jun 10 01:53:08 yes. :) Jun 10 01:53:31 i recall saying i'd follow up later to see what you did, exactly, but i don't think i ever did. :P Jun 10 01:53:50 lewellyn: yeah, samsung has you add something to your manifest (meta-data, I think) declaring that you support it. I ended up not supporting it, because it makes it impossible to detect keyboard state :| Jun 10 01:53:55 reliably detect, that is Jun 10 01:54:22 groxx: i'm still curious what manifest changes you did. all the methods i know require more than just manifest changes. :S Jun 10 01:56:11 lewellyn: http://forum.powerampapp.com/index.php?/topic/4394-multi-window-feature-of-samsung-galaxy-devices/ looks like what I remember (contents, not that forum in particular) Jun 10 01:56:12 but if you don't have the notes/apk/whatever anymore, no big deal. Jun 10 01:56:17 ok. thanks. :) Jun 10 01:57:33 so that requires dimens.xml changes too. ok. so i must be misremembering that you did it only via the manifest. :) Jun 10 01:57:43 ah, finally found it. there's also http://developer.samsung.com/galaxy#multiwindow which is the "full" support. Jun 10 01:58:36 lewellyn: it's possible we're misremembering or something. but if you look further down, they also have an "android:value='123dip'" example Jun 10 01:58:43 yeah. i'm quite familiar with the actual sdk. :) Jun 10 01:59:05 the dips go in dimens.xml though Jun 10 01:59:20 lewellyn: http://cl.ly/image/0F2I2n3L1f1W Jun 10 01:59:51 yeah. read a bit further down. :) Jun 10 02:00:07 er, up. Jun 10 02:01:14 lewellyn: yeah. two modes, one for resources (which lets you define based on portrait / landscape, probably) and one for explicit value. makes sense? Jun 10 02:01:19 ah well. i was hopeful for a quicker and easier way than i was aware of, and that's the way i was aware of. there are limits to how much you can get around an sdk, i guess. ;) Jun 10 02:01:20 not sure what you're looking at Jun 10 02:01:38 thanks. Jun 10 02:01:46 "Pizza Hut made a pizza box that transforms your phone into a projector" O.o Jun 10 02:02:11 i was looking at hopefully doing it with only changes to the manifest, not touching dimens.xml Jun 10 02:02:11 g00s: wut Jun 10 02:02:19 http://phandroid.com/2015/06/08/pizza-hut-box-projector-smartphone/ Jun 10 02:02:34 g00s: that's because their pizza is so greasy, it makes the cardboard transparent! ;) Jun 10 02:02:38 groxx: getRawY() was exactly what I needed -- thanks! Jun 10 02:03:17 lewellyn: that's kinda what I was thinking too xD couldn't figure out if that would result in smudges, or make it actually work... Jun 10 02:03:21 maybe use a drop of grease as a lens? Jun 10 02:04:08 i guess i'll wander to try to find food so i can ignore the idea of pizza hut's fake food. ;) Jun 10 02:04:11 groxx: thanks for your time. Jun 10 02:04:20 lewellyn: good luck :) Jun 10 02:06:29 yeah, but once your phone is in the box ... comes out covered in grease and sausage Jun 10 02:10:39 I can't think of many things that would be worse than a) a lens that floats over Pizza Hut's river of steaming hot grease, combined with b) you stick your phone on the thing that was stabbed _into_ that river of steaming hot grease. Jun 10 02:10:55 this wikitude sdk is ... weird. I was not expecting it to be Jabbascript Jun 10 02:11:05 ho ho ho Jun 10 02:30:39 if i make an app that copys content like a movie, but it only gets like 100 downloads and it has features to unlock for a doller is there really any chance of getting legal action against me? Jun 10 02:31:25 do it for science ! Jun 10 02:32:32 you will probably get suspended from the app store, if you publish the app there. Jun 10 02:32:39 play store* Jun 10 02:35:03 Should I add the gradle directories to .gitignore? Jun 10 02:35:16 and other gradle-related ballyhoo Jun 10 02:36:01 gradlew, gradlew.bat (I'm on Linux), build.gradle, gradle.properties, fried gradle, jumbo gradle, gradle cocktail, coconut gradle. I know all about gradle, Forrest Jun 10 02:39:27 mdeboard: for android studio, personally I add .idea and *.iml to gitignore. it'll configure itself entirely from the gradle files, and they're _way_ more developer-agnostic than the intellij stuff Jun 10 02:39:48 the intellij stuff changes semi-randomly as you change settings / actually build things once. the gradle stuff are all static files. Jun 10 02:40:33 Word Jun 10 02:41:53 I really don't understand how you can build an IDE and not have a clean separation of local and remote-able configuration. not after CVS, anyway, and _especially_ not since distributed systems gained popularity **** ENDING LOGGING AT Wed Jun 10 02:59:59 2015