**** BEGIN LOGGING AT Wed Mar 18 02:59:58 2015 Mar 18 03:53:55 any help http://stackoverflow.com/questions/29113819/the-right-expected-geomagnetic-field Mar 18 04:14:21 java.lang.RuntimeException: Unable to start activity ComponentInfo{MainActivity}: java.lang.NullPointerException Mar 18 04:14:56 I get this only when i init a class that isn't even an Activity and i can't seem to fid any logical reason behind it Mar 18 04:28:52 hey all, i am at my wits' end trying to get my app wired up to get data from Readability's API. I've followed too many tutorials; I have followed too many paths without sticking to one and seeing it through. i have been trying on my own for 2 weeks now. If someone could guide me toward the best method of learning OAuth/xAuth with AccountManager + retrofit, I'd really appreciate it. Mar 18 04:35:29 bankai_: how is the performance ? Mar 18 04:35:57 can you compile it to any native code (linux) or just to ios / mac devices ? Mar 18 04:37:05 used to be able to do linux, but i don't think it supports that anymore, main purpose is iOS. You can do OS X, but not UI stuff, but it's functionally possible Mar 18 04:37:18 https://medium.com/@harrycheung/mobile-app-performance-redux-e512be94f976 some stats if you're interested Mar 18 04:38:56 noobie question: why can't i place a compile dependancy in the global build.gradle file? Mar 18 04:39:19 it only works in the app build.gradle Mar 18 04:39:21 fuck i misread the vector values for geomagnetic and magnetic sensors hehe Mar 18 04:41:29 Is there a way I can find out another package's min SDK version (as specified in the AndroidManifest.xml) using PackageManager? Mar 18 04:41:43 ParmesanCaesar: the Project build.gradle file sets global config, like the version of gradle itself. the Module gradle.build script refers to the java imports. it's just the way gradle was designed. Mar 18 04:42:29 (the Module build.gradle has the capability to do a great deal more, but that's a decent way to conceptualize it at first) Mar 18 04:44:00 a more concise answer is that the outer script refers to a larger scope than the inner script, which serves primarily to import libraries. Mar 18 04:46:05 Can I delete an app from google play developer console or just unpublish it? Mar 18 04:48:30 john carmack is writing stuff in racket eh Mar 18 04:51:34 duncannz i hope so O.o Mar 18 04:52:00 I can't find a way, g00s Mar 18 04:53:03 i cant compile a kernel with DRM support Mar 18 04:53:20 drivers/gpu/msm/kgsl_drm.o Mar 18 04:53:26 is the google location services down? Mar 18 04:53:29 its the file failing Mar 18 04:53:31 on247 wrong channel, see topic Mar 18 04:53:39 oh Mar 18 05:01:06 pfn: thought you would be interested https://github.com/databricks/scala-style-guide Mar 18 05:06:10 okay, let me rephrase as a yes/no question: is it possible to consume Readability's API, which only accepts OAuth and xAuth requests, using only retrofit + gson ? Mar 18 05:07:52 I've only implemented OAuth with low level http calls, never with retrofit, but since retrofit lets you tweak headers and handles redirects, no reason it wouldn't work Mar 18 05:07:58 However, I'm not sure I'd use retrofit for that still Mar 18 05:08:28 You'd be better off putting that in an OkHttp interceptor, most likely Mar 18 05:08:57 Though I'm not quite sure which xAuth and OAuth are... they all blur together. Mar 18 05:09:29 Retrofit shines for straight REST calls, OAuth is very little straight URL call and a lot of redirects, extracting responses and tweaking headers Mar 18 05:10:42 JakeWharton: your response just gave me great hope. i have been so daunted by this process. it's like i'm a freshman in college all over again. Mar 18 05:11:07 thanks, all. that feedback is enough to keep me hacking away at it without feeling like a complete moron :) Mar 18 05:11:24 treelzebub: Look into a library to help you through the oauth insanity, e.g. Scribe. It's not that hard once you spend some time understanding it Mar 18 05:12:44 well, the added rub is that Readability's API doesn't seem to support OAuth2.0, which is not back-compatible. OAuth1.0(a) requires a WebView to authorize. that's not a viable option for me. Mar 18 05:13:32 ugh OAuth 1 Mar 18 05:13:50 yeah. so my only other option is xAuth, which is aka OAuth 1 Mar 18 05:13:52 :P Mar 18 05:14:45 gordon_, nothing particularly interesting there Mar 18 05:19:20 How can I handle an intent in an existing activity instead of a fresh activity? Mar 18 05:20:04 knapper_tech: You mean a singleTop or singleTask? Override onNewIntent() Mar 18 05:20:47 CedricBeust, I'd like to handle arbitrary intents from external applications that match my filter, using existing activity if possible. sounds like onNewIntent() Mar 18 05:20:59 Is there a way to get height of application (without height of taskbar and anything else taking the space)? Mar 18 05:21:37 astroduck, just ask the root layout Mar 18 05:21:45 I tried using getLayoutParams().width for RelativeLayout but I get -1 :/ Mar 18 05:21:59 *.height Mar 18 05:22:10 astroduck, sounds like view isn't created yet or that particular layout isn't attached etc Mar 18 05:22:33 -1 is just the "wtf? you're asking the wrong layout" return value as in C-style errors Mar 18 05:22:50 knapper_tech: I do this in onCreate after setContentView Mar 18 05:22:57 Should I do it in onPostCreate? Mar 18 05:23:17 yeah, do some stuff in a fragment or the view itself and call back Mar 18 05:23:32 Why I like fragment lifecycle methods Mar 18 05:23:42 knapper_tech: check out onNewIntent() Mar 18 05:24:27 knapper_tech: ignore me, i am behind on the conversation :D Mar 18 05:41:14 com.android.dex.DexException: Multiple dex files define Landroid/support/v4/accessibilityservice/AccessibilityServiceInfoCompatIcs; Mar 18 05:46:21 ok nm Ifound it, Android Studio thought it was a good idea to throw in another version of the support library :\ Mar 18 05:47:24 could the android 5.1 system update be the reason why my google location api was not working on my nexus Mar 18 06:34:52 hmm https://medium.com/@harrycheung/mobile-app-performance-redux-e512be94f976 Mar 18 06:35:49 gotta take things with grain of salt, but these all seem plausible Mar 18 06:40:26 I'm trying to do what I would have thought would have been very simple: change the color of section of the screen. I'm currently using a View and setting the background property to a res color value. This works fine. If I should use an ImageView instead I can change, but a standard View should suffice (at least that's how I'd do it on iOS). However, using the setColorFilter option on the view, I see no results. How ca Mar 18 06:40:27 n I change the color? Mar 18 07:04:44 hmm Mar 18 07:16:34 thepoosh ! Mar 18 07:17:39 g00s: ! Mar 18 07:17:44 elections are done here Mar 18 07:17:49 time to go back to work Mar 18 07:18:06 thepoosh oh boy i read about that a little - kinda scary :) Mar 18 07:18:17 thepoosh staying out of trouble with irc at work XD Mar 18 07:18:20 why scary? Mar 18 07:18:20 ? Mar 18 07:18:22 lol Mar 18 07:18:28 my boss is not here yet Mar 18 07:19:16 I have quite a few friends on Facebook feeling pretty down today Mar 18 07:20:12 Leeds: status quo was kept Mar 18 07:20:19 they shouldn't feel too bad Mar 18 07:20:27 they were hoping for change... Mar 18 07:20:52 in any case, there was such a large negative campaign against the PM that it forced a lot of people to vote for him as a response Mar 18 07:21:12 the opposition leader is lame Mar 18 07:22:25 thepoosh, are you from israel? Mar 18 07:22:31 yep Mar 18 07:22:37 oh, nice Mar 18 07:22:45 so we're both ****ed Mar 18 07:23:07 idk, we'll wait and see Mar 18 07:23:17 hope i'm wrong Mar 18 07:23:37 i wouldn't worry too much Mar 18 07:25:56 Hello. I'm trying to make a drone that runs android on it. Do you think I should make android services to control the drone? Mar 18 07:27:08 hm, not sure if android is drone worthy Mar 18 07:27:33 malfunction -> falling from sky -> possibly injuring people Mar 18 07:27:58 but you are from stanford :) Mar 18 07:29:12 what would be the point of running Android onboard? Mar 18 07:29:36 anyone can make drone apps easily Mar 18 07:31:20 if it has android on it Mar 18 07:31:22 but are those apps going to run on the drone without remote control? Mar 18 07:31:39 you don't need to run Android to be controlled by Android Mar 18 07:32:22 you don't need to, but this drone will have LTE, wifi, bluetooth, gyro, compass, accel, cameras, microphone and all the shit a regular android phone has Mar 18 07:32:35 so it's way easier to use the existing android APIs instead of making our own OS Mar 18 07:33:07 or I think it might be easier than reinventing the OS on top of linux, again. Mar 18 07:33:35 there is stuff out there ... Mar 18 07:33:37 https://www.openpilot.org/products/openpilot-Revolution-platform/ Mar 18 07:33:42 lots of stuff Mar 18 07:34:03 https://www.dronecode.org/ Mar 18 07:35:28 you're making a drone use android OS? Mar 18 07:37:11 those are shit, g00s, because they only stabilize the drone and get RC input. They are microcontrollers. A phone processor can do way more. Mar 18 07:37:15 jutsi, yes. Mar 18 07:37:29 omg that's awesome Mar 18 07:38:10 g00s, a phone processor can actually allow a developer to make android apps with all android APIs, thus allowing for easy computer vision, JSON connections, networking, microphone access, etc Mar 18 07:38:35 I'm guessing you'll have to change the kernel (or atleast modify it)? Mar 18 07:38:39 jutsi, we want to allow android developers to make drone apps as easily as they do for phones Mar 18 07:38:47 jutsi, the linux kernel? Mar 18 07:38:55 cool Mar 18 07:39:06 thats great and all, but android isn't a RTOS which seems necessary for those things Mar 18 07:39:26 like reliable flight, etc Mar 18 07:39:33 stable and optimal control Mar 18 07:39:33 Yeah a "past flights" that uses google maps API and drawing would be pretty cool. Especially if you're a real enthusiast and travel a lot Mar 18 07:41:10 Well the android OS HAS been known to be a bit slow, though i suspect that is samsungs fault for packing lots of bloatware along with their phones. I guess a "pure" version of android wouldn't have those issues? Mar 18 07:41:29 jutsi, how about google nexus devices? Mar 18 07:41:44 g00s, are you sure that's necessary? People have made android phones fly Mar 18 07:41:53 using an android app as flight controller Mar 18 07:41:59 i can make a paper airplane fly Mar 18 07:42:07 .. Mar 18 07:42:34 g00s, using 4 rotors and an android to control them with PID Mar 18 07:42:40 Yeah i think it's standard for quite a few drone models to be run through phones. Mar 18 07:42:57 jutsi, really? i've only seen one Mar 18 07:43:07 i mean the phone being the brain. the flight controller Mar 18 07:43:15 not just a remote controller Mar 18 07:43:27 Well i was looking at ordering drones some time ago and some of them had phone control Mar 18 07:43:30 ah that i don't know Mar 18 07:43:42 they probably use phones as a remote controller Mar 18 07:43:47 yeah Mar 18 07:43:59 but I'm trying to make a drone have android itself Mar 18 07:44:05 so it can be autonomous Mar 18 07:44:14 When making a nested AsyncTask, when should I pass object in to and out of the doInBackground using and ? And when it is allright to just access the members of the parent-class? I mean, do things get copied when passed around? Or does AsyncTask work on the reference like java/android normally does? Mar 18 07:44:41 you could try using parent.tostring() ? Mar 18 07:44:54 or generally just tostring() to figure out what you're dealing with? Mar 18 07:45:19 wait no, read it wrong Mar 18 07:46:11 There's always this DownloadBitmapAsyncTask example where the URL is sent to doInBackground(URL...) and the downloaded Bitmap is returned to onPostExecute(Bitmap). But can't these be Void if the URL and Bitmap are accessible though the DownloadBitmapAsyncTask's parent class? Mar 18 07:46:24 For better control you might be better off using threads. Mar 18 07:48:05 they should not be accessible as members from the parent class Zta Mar 18 07:48:24 g00s, you think android as PID is slower than the other microcontrollers that are used for drones? Mar 18 07:48:30 those Void and other things are the params that each of the 3 overridden methods inside an AsyncTask take as parameters Mar 18 07:48:43 That's not what I'm asking for. If anything, I want *less* control. I'm not interested in making a generic DownloadBitmapTask that can be reused from anywhere in my app; I'm making a nested private DownloadBitmapTask that's only supposed to be used one particular place by one particular class. Mar 18 07:49:00 then great, that's what you have Mar 18 07:49:23 stanford_drone i'd probably have a dedicated rtos for flight control, and maybe and android system with higher level functionality integrate with that Mar 18 07:49:49 But yeah usual way of passing stuff through is using params. Then calling them as an array within the asynctask Mar 18 07:49:56 I'm asking if there are any caveats. Is it wrong to instantiate and modify the parent's members from an AsyncTask's doInBackground? Mar 18 07:50:06 yes Mar 18 07:50:14 OK =) Mar 18 07:50:15 you will get an exception Mar 18 07:50:20 No. Mar 18 07:50:30 It works as intended for the time being. Mar 18 07:50:31 yea you will, try modifying an edittext in there Mar 18 07:50:43 all that stuff should be either in post or preExecute Mar 18 07:51:07 g00s, we tried doing that, but then we need duplicate gyro+accel (for the microcontroller and for the android processor). also the interfaces to communicate to these devices are shit Mar 18 07:51:16 Ah, right. Views cannot be modified by other threads that the one that created them. Mar 18 07:51:43 But it's not Views that I'm working on. (Maybe I should have explained that, sorry). Mar 18 07:52:04 It really sounds like you should be using threads instead :) Mar 18 07:52:24 Android studio, when trying out my app, gives this error: "Error: Could not access the Package Manager. Is the system running? Mar 18 07:52:24 " what is it? Mar 18 07:52:27 if you find that you want to save anything that the doInBackground has fetched into a member class, then that thing to store should be the return type of the doInBackground so that onPostExecute can receive it Mar 18 07:52:46 I'm making a VideoHelper class that contains a Camera and MediaPlayer. These are slow, blocking objects to instantiate and setup, so I use AsyncTasks. But these AsyncTasks are kept inside my VideoHelper. Mar 18 07:52:46 into a member var* Mar 18 07:52:58 you should be using threads for that case Mar 18 07:53:02 not asynctask at all Mar 18 07:53:15 The Google Android example uses AsyncTask.. Mar 18 07:53:28 for the exact same example you've given? Mar 18 07:53:31 ..for initializing the camera. Mar 18 07:53:37 Yes sir. Mar 18 07:53:41 well then I dont know Mar 18 07:54:10 In my experience threads are a lot faster than asynctask, though admittedly i've never fiddled with the camera Mar 18 07:54:34 Ok, let me rephrase the whole question: Does AsyncTask do some special object copying when returning objects from doInBackground to onPostExecute ? Mar 18 07:55:06 Not that im aware off, no Mar 18 07:55:09 how it passes them around I dont know Mar 18 07:55:14 Zta: no Mar 18 07:55:26 appel1: Thanks. Mar 18 07:55:29 Good, then I'm safe =) Mar 18 07:55:35 lol, when some questions appear, strange people appear Mar 18 07:55:47 like that scene in Inglorious Bastards Mar 18 07:55:50 in the pub :P Mar 18 07:57:29 Odaym i just looked through some nordic semi code for the BLE app, omg terribad ! Mar 18 07:57:44 i would have thought , those guys knew what they were doing ;) Mar 18 07:58:53 Odaym: The Bierstube where the Mexican standoff appears? Mar 18 07:59:01 Haha... Mexican standoff Mar 18 08:03:14 yea Zta where the commander detects that the guy's accent is strange Mar 18 08:03:26 usually here some guy like that appears when you ask certain kinds of questions :P Mar 18 08:09:40 stanford_drone from today http://www.gizmag.com/percepto-open-source-drone-apps/36595/ Mar 18 08:11:47 loving the random package imports that override ImageView Mar 18 08:26:09 when there is an error in a block of code, AS turns the background some funky gold color - i can't see shit Mar 18 08:26:14 darcula Mar 18 08:28:12 whats the easiest way to use google maps in an app? Mar 18 08:33:25 Glad to hear there are still lots of reasons to stay with Eclipse ;) Mar 18 08:47:32 anyone here tried this thing called xamarin? Mar 18 09:08:14 git st Mar 18 09:08:20 argh.. Mar 18 09:13:39 Hi, how do you make the scrollview snap when scrolling vertically, is it built-in? I can only see the customized horizontal scrollview snapping Mar 18 09:18:55 I don't understand why the latest AS update allows me to open XML files in 4 different browsers only to view that same XML in the browser? Mar 18 09:22:40 Krisg i think you need to create some sort of gesture detection for that or something. Calculate like when its x% away from target it "snaps". Mar 18 09:23:01 I've got an issue opening a socket from my Glass to a server on the local network. I can telnet from the adb shell to the server successfully. However connecting from within my app yields 'java.net.SocketException: socket failed: EACCES (Permission denied)'. I have declared the 'android.permission.INTERNET' permission as required in the ApplicationManifest.xml. Any assistance appreciated. Mar 18 09:25:36 thanks, I thought it was built-in XD Mar 18 09:26:25 try this http://developer.android.com/training/animation/screen-slide.html Mar 18 09:26:33 Krisg Mar 18 09:27:29 wow thanks mate Mar 18 09:29:51 ugh, my fragmenpageradapter code looks pretty ugly.. Mar 18 09:49:02 Does support library v7 have PreferenceFragment? Mar 18 09:49:10 I can't seem to find it Mar 18 10:12:08 Has anyone got any links to any interesting android litterature? I like to stay current :) Mar 18 10:21:45 hi.. i am new to android app development and i was trying to code an app which would connecto to a microsoft sql server. Could anyone point me to a link or so regarding this ? Please help. Mar 18 10:22:11 You never connect with an app directly to remote SQL server. Mar 18 10:24:41 Mavrik: i see. i read about creating a web service and then passing the queries to the sql server using that. Is that the right approach ? Mar 18 10:25:48 yes, usually you have a RESTful interface which minimizes amount of data and requests passed to the app Mar 18 10:25:56 remember, celluar networks arent reliable or fast. Mar 18 10:26:37 Mavrik: oh. In my case, the connectivity would be through wifi.. Mar 18 10:26:49 No, it wouldn't be. Mar 18 10:26:53 Don't ever rely on that. Mar 18 10:27:22 Could you explain why ? :) Mar 18 10:31:15 Because that's one of those assumptions that make shitty software. Mar 18 10:31:22 Even Wifis aren't fast. Mar 18 10:32:06 Code defensively or what's it called :) Mar 18 11:01:21 Do you guys think android is a good platform for apps that do not use a User Interface? Or would you prefer a unix/linux terminal and scripting languages for those? Mar 18 11:02:13 stanford_drone: that don't use a user interface? like a service / background job? Mar 18 11:04:23 phix, yes, exactly Mar 18 11:06:44 yeah that is perfectly fine Mar 18 11:09:51 stanford_drone assuming you mean apps for your drone, can't you make it link up to android devices for UI? i.e if you want to tune your drone, you can link it up to a device and do it? Mar 18 11:10:58 jutsi, yes, that can be done with or without android on the drone. I'm trying to find out if you think android is more useful than just linux on the drone. Mar 18 11:12:42 stanford_drone right right. What would be the advantages of android on the drone vs linux? Mar 18 11:13:00 first, what do you think they would be? Mar 18 11:13:44 I guess the language for one. Mar 18 11:15:41 Where is PreferenceFragment? I can't find it in any support library Mar 18 11:27:30 how can i tell android studio to include the gdbserver built by ndk? Mar 18 11:55:42 how do you guys reduce the size of an image? Mar 18 12:02:59 Hi Mar 18 12:03:22 jutsi, the language? you can make java apps on linux too, right? Mar 18 12:06:15 stanford_drone im not at all familiar wiht linux Mar 18 12:06:18 I already build android apps on linux Mar 18 12:06:20 o.O Mar 18 12:09:58 hi, how can i get the primary color of the material theme in code? Mar 18 12:10:32 SheikhAman, i mean JUST linux shell. Mar 18 12:13:28 Hello. My app is making many HTTP requests. I have all of them in a class but this design pattern is probably getting out of hand. there is a lot of repeating code (Like to check and handle authorization) Mar 18 12:14:03 stanford_drone, haha okay. but i had done that as well, while creating a custom system which used to build templates Mar 18 12:14:06 How do you people handle it? Mar 18 12:14:18 SheikhAman, so what's your point? Mar 18 12:14:23 vedu, use any library such as Volley, it uses an http queue Mar 18 12:14:38 stanford_drone, nothing exactly bro, I think I missed the longer part of conversation in that part Mar 18 12:15:29 SheikhAman: I am using volley. Each method sends a request. But all such methods have a lof of similar code Mar 18 12:15:30 yeah hahah Mar 18 12:16:34 :D Mar 18 12:16:50 vedu, if the code is similar, can you move it to a central place? Mar 18 12:17:54 SheikhAman: Yes I have it in a class that has a request queue. Mar 18 12:18:11 I am dealing with JSONs so I end up having a lof of try-catches Mar 18 12:18:47 So I'm making a drone run android, SheikhAman Mar 18 12:19:03 I was wondering is there is design pattern that large apps follow for an app constantly communicating with the server Mar 18 12:19:15 stanford_drone, thats quite evident from your chat handle here :D Mar 18 12:19:47 vedu, if you have control over json on the web server, try to change the architecture that you don't have to catch so many things Mar 18 12:20:32 vedu what do you mean similar code? Mar 18 12:20:42 like adding headers and such? Mar 18 12:21:18 SheikhAman: yes its my server. Most of the catch blocks do not do anything. But if I dont have them, code doesn't compile Mar 18 12:21:36 oh oh Mar 18 12:21:51 jvrodrigues: yes I have to add a header in every request Mar 18 12:21:52 vedu, Then if your app is so dependent on web service, try giving retrofit a try Mar 18 12:22:16 will take some time to get up and running with it, but once done, it will hugely benefit you Mar 18 12:22:41 vedu you can create a method that builds headers Mar 18 12:22:42 stanford_drone, so how does the drone communicate with android phone (assuming the controlling is an android phone) Mar 18 12:22:44 I am making a class that extends Volley's JSONRequest that adds the required header by default Mar 18 12:22:56 stanford_drone, or does the drone itself is an android system? Mar 18 12:23:25 vedu, if your app uses online data for most of its functions, have a look at a reactive framework, then you can map that in a abstact way to your views, to get a bunch of different functions from the same code base. Mar 18 12:24:20 SheikhAman, the drone itself will run android on it Mar 18 12:24:37 vedu, something like http://reactivex.io/ Mar 18 12:24:38 SheikhAman, do you think that's more useful than having a drone run a regular linux shell? Mar 18 12:25:07 stanford_drone, I think running android will be more useful in terms of easily programming your logic on the drone Mar 18 12:25:29 SheikhAman, why is that? any examples? Mar 18 12:25:36 stanford_drone, but it may also have a pitfall of being too easy for people to break into it and control your drone, since a lot of people already know how Android works :D Mar 18 12:26:16 asperon: thanks. seems interesting Mar 18 12:27:11 vedu, haven't used it myself, but i heard a lecture from one of the guys behing, i think, the tumblr app, and it sounded like a good approach when the app is mostly a reactive api client Mar 18 12:31:56 SheikhAman, ? Mar 18 12:33:16 stanford_drone, can I get back to you in an hour, need to rush home Mar 18 12:33:45 SheikhAman, i'm gonna sleep Mar 18 12:36:11 stanford_drone, any other place where we can talk? twitter etc? Mar 18 12:36:16 stanford_drone, I am @amanalam on twitter Mar 18 12:36:32 stanford_drone, although I am not an expert in drones and android, but I can surely tell you my opinion :) Mar 18 12:36:52 I'll come back to this channel often Mar 18 12:36:58 talk to you next time :) Mar 18 12:39:15 Hmm... I wonder when my Nexus 5 will be allowed to upgrade its OS OTA. Mar 18 12:45:02 I have a GNex here running 4.3, I've turned off automatic date & time, and set time Mar 18 12:45:20 but when I open my app time is set back (if there is a network connection) Mar 18 12:45:32 does Google Play Services change date & time? Mar 18 12:50:42 has anyone seen something like this before? Mar 18 13:03:45 I think daylight savings makes a difference somehow Mar 18 13:03:57 if I choose a date before daylight savings it doesn't reset Mar 18 13:07:32 Ankhwatcher: automatic tz? Mar 18 13:08:02 automatic time! Mar 18 13:08:34 on my nexus 5 I have separate settings for automatic time and automatic time zone Mar 18 13:23:30 Hi there. Mar 18 13:25:00 I created oauth api and now I would like to use it with android client. Any recommendations on reading? AFAIK android nativelly supports oauth? I found this http://developer.android.com/google/auth/http-auth.html but it is for google api. Any more "generic" documentation out there that you recommend? Mar 18 13:31:41 im downloading an APK with this code, but it wont open… help? http://paste.ofcode.org/gPgMStwXKiuhRyj3PMcGbK Mar 18 14:07:37 do you all include app/app.iml in your source control for android studio projects? Mar 18 14:08:31 shekibobo: I do. But I dont know why Mar 18 14:09:25 well, it seems to me like it's supposed to act kind of like a Gemfile.lock (if you are familiar with ruby) Mar 18 14:09:36 but it does other stuff besides just dependencies Mar 18 14:10:12 I just get annoyed because sometimes it will add or delete the same stupid chunk of code and I can't figure out which way it should go Mar 18 14:10:44 also test-report and test-results Mar 18 14:19:37 this is awesome: http://www.parcelabler.com/ Mar 18 14:30:57 i'm trying to debug with android studio and get this Mar 18 14:31:11 Connected to the target VM, address: 'localhost:8622', transport: 'socket' Mar 18 14:31:26 what should I do Mar 18 14:47:02 Hi, we are using Erlang to Couch on Android and we are hitting max file descriptors issue on Android Mar 18 14:47:22 Erlang calculates allowed max fds using the following code Mar 18 14:47:47 https://github.com/erlang/otp/blob/maint/erts/emulator/sys/common/erl_poll.c#L2308-L2320 Mar 18 14:49:34 to paste inline Mar 18 14:49:35 #if !defined(NO_SYSCONF) Mar 18 14:49:37 max_fds = sysconf(_SC_OPEN_MAX); Mar 18 14:49:38 #elif ERTS_POLL_USE_SELECT Mar 18 14:49:40 max_fds = NOFILE; Mar 18 14:49:41 #else Mar 18 14:49:43 max_fds = OPEN_MAX; Mar 18 14:49:44 #endif Mar 18 14:49:46 #if ERTS_POLL_USE_SELECT && defined(FD_SETSIZE) && \ Mar 18 14:49:47 !defined(_DARWIN_UNLIMITED_SELECT) Mar 18 14:49:49 if (max_fds > FD_SETSIZE) Mar 18 14:49:50 max_fds = FD_SETSIZE; Mar 18 14:49:52 #endif Mar 18 14:50:06 I see that on Android, it's using max_fds = sysconf(_SC_OPEN_MAX); and resulting in 256 max_fds Mar 18 14:50:28 This is very less for our App and I would like to increase it. Is there anyway I can do it on Android? Mar 18 14:51:57 btw ^ should probably go into pastebin or something, irc peeps tend to go crazy when you copy paste tons of lines in chat Mar 18 14:52:03 hey guys, im trying to download an APK but after download it wont open: http://paste.ofcode.org/59ewC7HjskKwTEvVvVxDNj can i get some help? Mar 18 14:54:01 mmh100_, don't ever paste directly in channel Mar 18 14:54:34 @ravilov - I am sorry. Mar 18 14:54:47 hey all Mar 18 15:00:50 Is OPEN_MAX defined as 256 on Android? Mar 18 15:15:59 stanford_drone okay great! Mar 18 15:16:05 if you make a new version of an app - is there a way to alert users of the old app to install the newer version of the app? Mar 18 15:16:24 if they arent the same apk that is Mar 18 15:16:40 netw1z: you would have had to build that functionality into the old app Mar 18 15:17:17 ahh - send a update to it that says when they open it to download a new version witha button or something? Mar 18 15:18:14 netw1z: well assuming you have some kind of backend (network) component, you could version your API such that if a newer API is available just show a screen about downloading the new version and link to the store Mar 18 15:18:36 netw1z: Google Play will also notify of new versions and automatically update unless the user has turned that off. Mar 18 15:19:09 netw1z, PlayStore APK already does that for you - app updates Mar 18 15:19:14 otherwise you'll have to build something in the app Mar 18 15:19:28 netw1z: correct - it notifies them but doesn't FORCE the update Mar 18 15:20:00 i changed the app name with big updates, but i have to leave the old app name resource url to update the APk and keep the same users. Mar 18 15:20:43 netw1z: why would you change the app name? that just makes it painful for your users to update. Mar 18 15:21:20 i scored an awesome domain name and rebranded it Mar 18 15:22:27 netw1z: why not just keep the old package name and rebrand everything user visible? Mar 18 15:22:57 yes thats the course im gonna take - im kinda a perfectionist - so i needed some validation about keeping the old package name Mar 18 15:24:48 don't force the users Mar 18 15:25:07 make it easy for em? Mar 18 15:25:09 the ones which don't keep up with the progress of your app, you don't need them anyway (for quality purposes) Mar 18 15:26:12 that makes sense thanks guys. Mar 18 15:31:40 YAY Mar 18 15:31:46 after MONTHS of Android Studio CONSTANTLY hanging and me having to go into the console practically every couple of minutes and hit CTRL+Z then do fg over and over about 10 times to get it to unfreeze I FINALLY fixed my problem! Mar 18 15:32:07 My desktop has two ethernet ports and a wifi device. I went into the UEFI settings and disabled one of the ethernet ports and the wifi device, leaving a single ethernet port enabled. This has 100% solved any issues with Android Studio hanging. Mar 18 15:32:14 Obviously something very funky was going on. Mar 18 15:35:18 all your sehternets are belong to android Mar 18 15:36:28 probably a bad route Mar 18 15:36:44 hanging over the disconnected interface Mar 18 15:36:50 maybe Mar 18 15:36:52 gradle hung too Mar 18 15:37:00 when it did mergeResources it just hung Mar 18 15:37:07 almost every time Mar 18 15:37:32 shouldn't be using internet for merge res Mar 18 15:37:46 but yeah, same deal, bad route Mar 18 15:37:54 how can I go about autoincrementing my build number and version in Gradle and then referencing it in-app for display in a settings screen? Mar 18 15:37:56 it shouldn't, but it still was fixed by doing this simple fix Mar 18 15:38:31 probably could have fixed it in os w/o disabling in uefi Mar 18 15:38:50 how do you get the md5 of a string in Android? all codes on the internet are 10+ lines, wtf? Mar 18 15:39:14 Mattx, write a function that makes it 1 line Mar 18 15:39:45 pfn, it's not acceptable, there must be a simpler way Mar 18 15:39:55 thats too bad Mar 18 15:39:58 keep looking Mar 18 15:39:59 in onCreate of my fragment the actionbar is obtained just fine, but then after rotation the action bar is null (in oncreate). Why is that? Mar 18 15:40:03 ie, not writing my own md5 function Mar 18 15:40:17 include a lib that has md5 Mar 18 15:40:52 myke: just use the MessageDigest from java? http://www.codejava.net/coding/how-to-calculate-md5-and-sha-hash-values-in-java Mar 18 15:41:19 that's better, thanks g1bbs! Mar 18 15:41:36 that;s still 10 lines... Mar 18 15:42:20 3 lines Mar 18 15:43:10 for the digesting itself Mar 18 15:43:37 you still need to getbytes on string and to base16 the result Mar 18 15:44:16 however many lines it is, *thats* the way you should be doing it :P Mar 18 15:44:24 pfn: yeah? i had a hunch it was something network related but i screwed with some stuff in the OS to no avail Mar 18 15:45:18 not to mention, thats a slow way to hexify bytes Mar 18 16:02:49 is there a way I can peek at a function in android studio similar to the way i can do it in visual studio? Mar 18 16:03:03 peek? Mar 18 16:03:11 quick-inspect Mar 18 16:03:33 kinda, in window, without leaving the current location in the code Mar 18 16:04:05 cmd+mouseover? Mar 18 16:04:39 ctrl + mouseclick kinda does it, except i lose my position in the code. Mar 18 16:05:30 in visual studio it basically integrates a small window in the code that shows the other code. Mar 18 16:06:21 tried ctrl + mouseover? don't know what cmd + mouseover is on windows/linux Mar 18 16:09:01 oh both ctrl/cmd + mouseover do the same thing on osx, but I don't quite know what you expect to see as result Mar 18 16:10:30 not the method definition in any case. Mar 18 16:10:35 well not just Mar 18 16:24:50 Hello I'm trying to implement simple panning and zooming functionality in an imageView. I have the following: http://pastie.org/10035484 and panning is working, but it is very slow. I can pan the image, lift my finger and then it takes a moment before the image is moved to that position. Any ideas how to improve this so it is more smooth? Mar 18 16:35:07 Guys, I want to Fill View as a background layer (I need to stretch View in RelativeLayout container), but It doesn't work, If I do: View height - match_parent Mar 18 16:35:08 :( Mar 18 16:35:48 I want something like html's css: { display: block; width: 100%; height: 100%; } but in layout xml rules Mar 18 16:38:21 I updated to the last Android SDK version and now my APK generate is named : MainActivity.apk, I added MyAppName but it does not change a thing Mar 18 16:43:04 F1skr: https://github.com/jasonpolites/gesture-imageview Mar 18 16:44:02 woozly: doesn't work *how* Mar 18 16:44:23 g1bbs: what do you mean? Mar 18 16:44:31 woozly: what about it doesn't work Mar 18 16:44:43 woozly: you just want a background color? Mar 18 16:44:57 g1bbs: I want to add some 'layer' under my content in RelativeLayout Mar 18 16:45:10 and play with its alpha in code Mar 18 16:45:25 but it want not to fill parent :( Mar 18 16:46:51 woozly: Having a relativelayout with width="match_parent" and height="match_parent" should work assuming it is the root view Mar 18 16:47:08 and View too, right? Mar 18 16:47:15 width, height = match_parent Mar 18 16:47:21 but It doesn't work :(( Mar 18 16:47:28 hey guys, im trying to download an APK but after download it wont open: http://paste.ofcode.org/59ewC7HjskKwTEvVvVxDNj can i get some help? Mar 18 16:47:30 woozly: pastebin what you have? Mar 18 16:49:00 g1bbs: http://pastebin.com/Su1kUcpv Mar 18 16:49:26 I want that "sl_Registries2_background_overlay" will fill whole RelativeLayout Mar 18 16:49:32 but It doesn't help :( Mar 18 16:49:42 this layout for ListView row Mar 18 16:50:22 visibility I turned on in code Mar 18 16:51:52 Android 4.4 :/ Mar 18 16:54:05 g1bbs: I've got it by wrapping RelativeLayout into LinearLayout Mar 18 16:54:09 g1bbs: thank you Mar 18 16:55:19 woozly: ah sorry just saw you pasted. You probably don't want to wrap another viewgroup around it Mar 18 16:55:50 g1bbs: but how then? ( Mar 18 16:55:54 woozly: you may want to consider *just* using a LinearLayout Mar 18 16:56:09 woozly: orientation flag on RelativeLayout is not needed Mar 18 16:56:10 g1bbs: I need some floating ImageViews Mar 18 16:56:19 oops Mar 18 16:58:10 woozly: Oh I see you are trying to do like a subscripted image? Mar 18 16:58:55 g1bbs: sorry, can't understand what you mean by 'subscripted' image :/ (I have bad english) Mar 18 16:59:11 I want to fadeView (its alpha) in code Mar 18 16:59:15 I want to highlight row Mar 18 16:59:19 and fade it out Mar 18 16:59:22 luist, won't open? or won't install? you are just showing download code,so if the download is successful you should post the next code that is failing Mar 18 16:59:55 whatitis: the downloaded apk has the same size but different md5 i think Mar 18 17:00:02 woozly: Difficult for me to see the larger goal here so if you got it working with nested layouts that might be the way to go :P Mar 18 17:00:15 whatitis: i try to open it through the file manager and it happens the same as the intent Mar 18 17:00:32 g1bbs: :)) okay! Thank you for your help and attention!!! Mar 18 17:00:40 what do you mean open? it is a zip file, are you just trying to look inside it, or install it Mar 18 17:01:12 is it ok to call textView.setVisibility(View.VISIBLE) in the click listener of a button in an activity? the view is not updated, I tried with .invalidate() Mar 18 17:07:12 meh, so I can't fully go all-in with retrolambda yet :( Mar 18 17:09:08 whatitis: zip file? its an APK :P Mar 18 17:09:47 whatitis: how can i make sure that the download was successful? i think its not Mar 18 17:12:10 whatitis: theres something weird… my android file browser shows the downloaded APK in the downloads folder, but my host machine cant find this file while browsing the android download folder Mar 18 17:13:55 APK is just a zip file, just open it up, or install it, but if the checksums are matching, then something may have gone awry Mar 18 17:14:12 arent* Mar 18 17:18:16 guys, any idea? I'm updating a TextView and setting View.VISIBLE to a LinearLayout but screen is not updated Mar 18 17:20:24 good article (UI, apps) http://www.theverge.com/2015/3/17/8103593/golden-krishna-best-interface-is-no-interface-excerpt Mar 18 17:28:05 Wixy, post some code Mar 18 17:31:30 Hi, can I accept that ssl/tls certificates trusted by the build in browser are also accepted by my own application unless I use the https client? Mar 18 17:45:32 hey is g00s around? Mar 18 17:45:39 hi jareddlc Mar 18 17:45:56 sorry a few days ago you were asking me stuff and i was quiet busy at work, wasnt sure if i ignored anything? Mar 18 17:47:12 jareddlc ah - no worries - i think i was just asking, if you connected to multiple devices simultaneously - and noticed sometimes that all devices disconnected at the same time (out of the blue) Mar 18 17:47:19 but I did want to ask, if it is possible to use the same connection to connect again to the same device? I've always had this issue with attempting to reconnect and failing, and no longer being able to connect until i close the app and relaunch. Mar 18 17:47:58 right Mar 18 17:48:17 what i do is close() the blutoothgatt instance and create a new one with connectGatt. i dont try to reuse them - blutoothgatt.connect() uses indirect connecting so it can take a very looong time Mar 18 17:48:33 like 20 seconds Mar 18 17:49:45 alright Mar 18 17:50:07 yeah since i copied the example connect, i get the message attempting to connect with already used connection or something like that Mar 18 17:50:24 i figured i would fix it down the road, and now its time to fix. Mar 18 17:50:34 :) Mar 18 17:50:54 seems there is only one true path that barely gets things to work :D Mar 18 17:51:23 hahaha Mar 18 17:51:46 Anyone know how like ripple view /drawable library works with selector states? Mar 18 17:51:56 im at work, btu before i forget here is my code for connecting, https://github.com/jareddlc/TurquoiseBicuspid/blob/master/TurquoiseBicuspid/src/com/jareddlc/turquoisebicuspid/BluetoothLeService.java#L212 Mar 18 17:52:05 So with Dagger if I have a @Provides method that has dependencies, do I just add those through the injects field of the @Module annotation? Mar 18 17:52:14 no Mar 18 17:52:18 use method parameters Mar 18 17:52:32 so line 219 i should close the gatt and create a new one then Mar 18 17:53:04 JakeWharton: Right I have the @Provides method dependencies as method parameters atm, but where does it get those dependencies from? Mar 18 17:53:12 wut Mar 18 17:53:33 it gets them from the graph Mar 18 17:54:09 they have to be provided to the graph like any other dependency Mar 18 17:54:44 jareddlc yeah generally, but there is a lot going on with this code Mar 18 17:54:50 How is DebugAppContainer added to the graph in provideAppContainer(DebugAppContainer debugAppContainer) for https://github.com/JakeWharton/u2020/blob/master/src/debug/java/com/jakewharton/u2020/ui/DebugUiModule.java Mar 18 17:55:05 it has an @Inject constrcutor Mar 18 17:55:29 np g00s now would be the time i'll be making revisions. the app was a proof of concept when i startedand now i need to fix things. thanks Mar 18 17:56:23 JakeWharton: The inject field in the @Module for DebugUiModule? Mar 18 17:56:55 no, DebugAppContainer has a constructor with @Inject on it Mar 18 17:58:10 https://speakerdeck.com/jakewharton/android-apps-with-dagger-devoxx-2013?slide=86 Mar 18 17:58:21 using constructor injection implicitly makes the type available in the graph Mar 18 17:58:24 (last bullet) Mar 18 17:58:52 hmm okay, did not remember thank, thanks JakeWharton Mar 18 17:59:01 s/thank/thanks/ Mar 18 17:59:22 sure thing. internet is slow today, took a while to find the slide. Mar 18 18:01:20 Anyone have a good method for handling shadows for lolli/pre lolli? Mar 18 18:01:48 like use a layered list and in pre lolli use a png drop shadow and on lolli have that be transparent / none existent and just elevation? Mar 18 18:02:30 http://i.imgur.com/zmPtKHC.png the iarc thingy (rating certificates..) Mar 18 18:02:32 LOL Mar 18 18:06:39 adq: i love .NET error pages Mar 18 18:14:25 <_genuser_> so found an old phone. thinking about rooting it, since it has no other use atm. Mar 18 18:14:26 The cats are taking over: http://i.imgur.com/Gfjoy5r.jpg Mar 18 18:14:50 <_genuser_> ugh are you searching the internets for cats? Mar 18 18:15:34 <_genuser_> TacticalJoke: wish I could say I'm finishing my project. but I'm also just killing time. Mar 18 18:16:03 That's from /r/pics. Yeah, my brain isn't working well enough to make any progress right now; wasting time on reddit. Mar 18 18:17:33 can I accept that ssl/tls certificates trusted by the build in browser are also accepted by my own application unless I use the https client? I mean they are using the same trust manager? Mar 18 18:43:39 e-Ra, yes Mar 18 18:43:48 well, chrome might have additional certs in its trust list Mar 18 18:45:20 Hi, I need some help with RelativeLayout's layout_below in [https://dpaste.de/VM8u]. At line 30 it says "Cannot resolve symbol". Any idea why? Mar 18 18:46:30 PS: I just changed my app's package name, i it possible that it broke something? Mar 18 18:46:53 @id/arc Mar 18 18:47:01 missing + Mar 18 18:47:14 That's not it Mar 18 18:47:20 Has anyone used ripple view library? it works for 14+ ? Mar 18 18:47:23 Ashiren: But arc is defined above Mar 18 18:47:28 @id/arc is correct Mar 18 18:47:39 really? Mar 18 18:47:56 Ashiren: Line 11 Mar 18 18:47:57 i always used @+id with above/below Mar 18 18:47:59 means that id has been already defined Mar 18 18:48:11 Ashiren: No need to redefine. Just reference. Mar 18 18:48:17 @id references an already existing id Mar 18 18:48:26 :o Mar 18 18:48:28 @+id creates an id Mar 18 18:48:28 You only need to use + when the referent is coming later. Mar 18 18:48:34 (Then you shouldn't use + the second time. Mar 18 18:48:35 ) Mar 18 18:48:44 Both works :) Mar 18 18:49:10 Ashiren: at any rate don't see why that wouldn't work Mar 18 18:49:28 well he said line 30 is wrong and this is only thing Mar 18 18:49:36 astroduck: Clean build Mar 18 18:49:53 So, is it possible that renaming package foo.bar.baz to foo.bar.flop could cause that. SimonVT: Did that, no luck :( Mar 18 18:50:06 did it work before Mar 18 18:50:13 yes, its an old project Mar 18 18:50:46 What error do you get when building? Mar 18 18:50:50 So I just noticed that layout_below has stopped working in every layout file. Only layout_below, everything else is fine Mar 18 18:51:19 It builds fine, but layout in app is all messed up Mar 18 18:51:25 and nothing useful in logs too Mar 18 18:52:25 You get "Cannot resolve symbol", though? Mar 18 18:52:37 Yes Mar 18 18:52:42 If it builds fine, then it's your ide acting up Mar 18 18:53:26 Otherwise it'd complain that it couldn't find the id or something like that Mar 18 18:53:32 I built it just before renaming the package and all was fine, it broke after renaming Mar 18 18:54:25 Sounds like either you or your ide messed something up when renaming package Mar 18 18:55:00 If you messed up, you'd likely get build errors Mar 18 18:56:19 Do you think if I do a git reset and again rename the package, it'll work? Mar 18 18:56:53 Renaming package is safe right? Its not like one of those tabooed thing Mar 18 18:57:02 well Mar 18 18:57:03 I've done it loads of times without issue. Mar 18 18:57:15 usually i end up making new project with new name Mar 18 18:57:18 and copying files Mar 18 18:57:32 I don't understand your description. You're saying you're getting "Cannot resolve symbol" but that you're not getting any build errors. Mar 18 18:57:33 not always Mar 18 18:57:38 Isn't that a build error? Mar 18 18:57:53 Ashiren: That's way overkill just to rename a package. Mar 18 18:58:27 Well, unless you're renaming the entire app. Then I guess it's not overkill (because things can get complicated in IntelliJ when renaming the app, AFAIK). Mar 18 18:58:38 No, it just makes that part red and on hover it says "Cannot find symbol" but it builds fine Mar 18 18:58:57 I did change applicationId in gradle file, is that bad? Mar 18 18:59:12 TacticalJoke: well i meant the app package Mar 18 18:59:25 Okay. Yeah. I think I did the same last time. Mar 18 19:00:30 hey all, I have a problem with my button in my button bar not responding to onclick Mar 18 19:00:49 i used ObjectAnimator to move it but that shouldn’t be the issue as all the other buttons respond. Mar 18 19:01:16 when I use the same click listener for another button it responds Mar 18 19:01:55 ^guess he insta-solved that Mar 18 19:03:06 hehe, good for him Mar 18 19:03:40 astroduck: Did you rename the project as well as changing the application ID and package structure? Mar 18 19:04:38 Hi I am trying to synchronize the asynchronious takePicture callback. Mar 18 19:04:54 oops? Mar 18 19:05:00 But I receive a deadlock. It seems like if I let the thread wait after takePicture the takePicture callback is never called Mar 18 19:05:04 somehow closed window Mar 18 19:05:18 I tryed it both with a countdown latch and a cyclic barrier Mar 18 19:05:37 http://pastebin.com/chsKenPn Mar 18 19:05:41 tokam, is the callback supposed to be called after wait? Mar 18 19:05:56 I do not know, I think no! Mar 18 19:06:11 TacticalJoke: yes I did Mar 18 19:06:16 http://developer.android.com/reference/android/hardware/Camera.html#takePicture(android.hardware.Camera.ShutterCallback, android.hardware.Camera.PictureCallback, android.hardware.Camera.PictureCallback, android.hardware.Camera.PictureCallback) Mar 18 19:06:35 http://developer.android.com/reference/android/hardware/Camera.html#takePicture(android.hardware.Camera.ShutterCallback, android.hardware.Camera.PictureCallback, android.hardware.Camera.PictureCallback, android.hardware.Camera.PictureCallback) Mar 18 19:06:45 its the commas Mar 18 19:07:05 hello once again everyone. i did a bit more reading on http://developer.android.com/guide/practices/screens_support.html#ConfigurationExamples is it correct that if i use EG: sw600dp on a layout i dont need to use layout-land-sw600dp because sw600dp will take width acording to orientation ? Mar 18 19:07:09 takePicture → Triggers an asynchronous image capture. Mar 18 19:07:21 astroduck: Hmm, I'm not sure, but the thing Ashiren referred to might be relevant. The last time I renamed my entire project, it ended up so messy that I just created a new project and manualy copied the files over. Mar 18 19:07:33 It seems that Android Studio doesn't actually support (cleanly) renaming a project, no matter what you try. Mar 18 19:07:46 I don't know for certain whether that'd fix your issue or not, though. Mar 18 19:08:14 tokam: I hate to be *that guy* but... why would you want this? Mar 18 19:08:37 astroduck: Rename package, delete ide files, reimport.. Solves all your issues Mar 18 19:08:41 I like to have a method that returns a picture as a Mat Mar 18 19:08:55 Or, since I'm assuming you're using eclipse, switch to android studio and gradle Mar 18 19:08:59 g1bbs: Ok I could give my function a callback to execute as parameter too. Mar 18 19:09:01 Also, on a side note, you're using "android:orientation" and "android:layout_gravity" in a RelativeLayout, and as far as I know those take effect only in a LinearLayout. Mar 18 19:09:24 (Which could be causing the positional weirdness.) Mar 18 19:09:32 tokam: I think working with the async nature is your best bet. When the callback is fired you can still do your Matrix read Mar 18 19:09:38 g1bbs: I like to stay with functional programming. And not change my program structure only to one asynchronious android thing Mar 18 19:09:39 SimonVT: Worth a try, let's see ... and I am on Studio 1.1 Mar 18 19:10:07 Anyone tried 1.2 in canary? is it useable? Mar 18 19:10:23 g1bbs: I think working with the async nature leads to a fully changed program structure. Mar 18 19:10:25 1.2 Preview 1 didn't support unit testing here. I haven't tried Preview 2 yet. Mar 18 19:10:58 astroduck: so far it's working for me. not doing much fancy with it though. minor improvements across the board, I think, though it may be using more memory (hard to say personally) Mar 18 19:11:36 astroduck: it does recommend you install it as a separate app though, not override your current. so I'd recommend doing that :) Mar 18 19:12:00 Have you tried the new debugging thing, groxx? That looks awesome. (The variable values being shown inline.) Mar 18 19:12:08 I didn't try that before uninstalling. ;| Mar 18 19:12:09 TacticalJoke: ah, I have not. will do so though. Mar 18 19:12:17 groxx: Did they fix the logcat? In 1.1 logcat doesn't show logs sometimes for some reason, at least for me Mar 18 19:12:39 astroduck: Did you see what I said about RelativeLayout? That could be causing issues for you. Mar 18 19:12:41 eclipse for the win Mar 18 19:12:59 astroduck: seems roughly the same to me. sometimes you have to restart the logcat connection, sometimes it takes a while to get it to display anything (e.g. when there's a lot of output), etc. no significant improvement, I suspect, at least. Mar 18 19:13:06 tricknology: Android Studio is better now. :D Mar 18 19:13:33 TacticalJoke: Oops, missed that Mar 18 19:13:40 I hate the LogCat delay. Throws me off sometimes. Mar 18 19:14:25 TacticalJoke: nifty. kinda slow, but nifty. http://cl.ly/image/2L2b3s0E0z3x Mar 18 19:14:48 greeeeat... Mar 18 19:14:52 Is it slow to update? Mar 18 19:15:22 everything flashes as you step through. same as the variables / frames / etc views do :| Mar 18 19:15:31 Ah. Mar 18 19:16:14 but more in-context stuff is generally a good thing, imo. Mar 18 19:16:23 Yeah. Seems way easier. Mar 18 19:16:24 and it shows variables that change (different color on that line), etc Mar 18 19:17:26 TacticalJoke: No, sorry. Removing orientation and layout_gravity didnt work Mar 18 19:17:38 tokam: Not sure why that wouldnt work then. May have reached the end of my usefulness :/ Mar 18 19:17:47 So, renaming project breaks it, not renaming package or applicationID Mar 18 19:18:11 g1bbs: why does android not call my callback if I call await Mar 18 19:18:11 This is the weirdest and stupidest thing I've ever encountered Mar 18 19:18:12 Well, one thing I found was that renaming my project (with automation) didn't update the project title and stuff. Mar 18 19:18:24 I mean "the title shown in the title bar". Mar 18 19:18:26 Any idea why AS doesn't want to launch from the already running emulator? It just keeps creating new ones every time I compile d: Mar 18 19:18:41 And that alone gave me a "something's not right" feeling. Mar 18 19:19:06 I moved it now in a new thread and check what happens. Mar 18 19:19:16 astroduck: What SimonVT said is the easier way to get a new bunch of project files generated. Mar 18 19:19:38 it's nothing that happens :( Mar 18 19:19:39 s/project files/IntelliJ files/ Mar 18 19:20:48 I was going for the same, I don't want to make a new project. I don't want to lose all these precious commits :P Mar 18 19:21:04 You wouldn't lose commits either way (your Git repository is entirely separate). Mar 18 19:21:19 * astroduck is crazy for git commits Mar 18 19:22:09 The version-control system is like a god looking down upon its creation. Ever present. Mar 18 19:22:12 If I make a new project and copy all files there, I will lose the commits. correct me if I'm wrong Mar 18 19:22:41 Does anyone have recent experience either giving or taking an Android interview? I've been trying to hire for a junior role and my interview normally consists of a code exercise they have to complete in an hour. So far results have not been stellar and I'm beginning to wonder if that's a good idea. Mar 18 19:23:21 I'm not sure why you think that, astroduck. Git repositories are separate from IntelliJ/AS projects. (Is there some AS Git plugin that tries to create a new Git repository when the user creates a new AS project that I don't know about?) Mar 18 19:23:46 g1bbs: giving a few. code exercises seem to be the best identifier we've found. what's the project, out of curiosity? Mar 18 19:24:00 g1bbs: some class named looper starts it but with my call of await I do block that looper Mar 18 19:24:52 I try to call Looper.loop(); before await Mar 18 19:25:18 works ;) Mar 18 19:25:37 but with a cyclic barrier it were not working because I do have no separate threads. Mar 18 19:25:38 tokam: ha. Interesting. I don't have much experience using those constructs but seems cool Mar 18 19:26:05 g1bbs: I think I synchronized it now, but because I know too less about the internals it is a risky thing. Mar 18 19:26:23 fanno: not sure if anyone has answered you yet, but: yes, sw600dp covers both portrait and landscape the same. if you want different layouts _within_ that "smallest width" restriction, you can still do -land, but it's not necessary as a "this is a tablet" restriction. Mar 18 19:27:50 groxx: Project is a social app leveraging some anti-screenshot IP along with a few other *novel* approaches to messaging. I'm based in Chicago and am restricted to hiring fulltime on-site talent. It has not been pretty so far! Mar 18 19:28:07 TacticalJoke: I also use command line git like you do (guessing) and I know it all lives in .git folder and if I make a new project and copy all java and xml files that I created, I will loose the commits, but well if you mean that I resume my git repo from the new project and commit all changes of the new project in a commit, then well I guess yeah I'll retain the commits, Mar 18 19:28:32 Didn't think about resuming git repo from new project, maybe I need sleep now :P Mar 18 19:28:42 Why would you lose any commits? Mar 18 19:29:00 It doesn't matter to Git that your IntelliJ project has been renamed. Mar 18 19:29:09 It doesn't even matter if huge directory changes have happened. Mar 18 19:29:28 g1bbs: ah, sorry, I meant the interview exercise :) we usually do a simple todo-list thing, and if they seem promising we'll have another round with some async behavior. Mar 18 19:30:23 TacticalJoke: Yes, I get it now. But I'll still try Simon's advice first Mar 18 19:31:52 groxx: ah Ok. The exercise involves being able to correctly initialize Fragments with data, and showing two Fragments on a screen. They have to be added dynamically given the nature of the problem. There is also a Listview and simple ListAdapter involved Mar 18 19:32:00 pfn, thank you. But app developers can still decide whether the certificate fullfills their demands such as strict_hostname_verifier? Mar 18 19:33:53 When to call stop preview after taking an image? Mar 18 19:34:03 g1bbs: I might say an hour is a bit tight for that, though it depends on the person. main concern with "build a simple app" interviews is that it favors people who have done that recently :| for our single-screen todo list app, most people seem near an hour, some about 1.5 (we also have them address rotation/config change if there's time, ask other Mar 18 19:34:04 questions, etc) Mar 18 19:34:58 e-Ra, sure, write your own trust manager Mar 18 19:35:10 g1bbs: Do you know when in my code I should call stopPreview? (without any synchronization, calling the stopPreview in the takePicture method leads to a deadlock Mar 18 19:35:29 pfn, but this still works with default android trustmanager too? Mar 18 19:35:49 I might have been wrong. Mar 18 19:35:57 using ObjectAnimator, if I move a button or layotu outside of its regular bounds, do I have to adjust the layout bounds? the button is becoming unclickable except for the very bottom part (i moved the buttom up) Mar 18 19:36:15 if i use “show layout bounds’ in dev options I see that the layout is not moving with the button Mar 18 19:36:20 groxx: so I let them ignore rotation and the use of Fragments is particuarly important for our app. Granted, I *wrote* the exercise but I was able to do it in about 40 minutes. Mar 18 19:36:22 the only part that is clickable is within those bounds Mar 18 19:36:34 groxx: I like the TODO list but would still probably have them use a ListFragment :) Mar 18 19:36:56 g1bbs: Ok I know now.. calling the looper does never terminate :D Mar 18 19:36:58 e-Ra, huh? the default trust manager isn't configurable, it does what it does and that's it Mar 18 19:37:37 hello Mar 18 19:38:04 oh well.. lunch time I guess Mar 18 19:38:24 TacticalJoke SimonVT: Hey! It Worked! git clean -xfd and reimport! Awesome! Mar 18 19:38:47 I have a question about SlidingTabsLayout by Google, anyone familiar with it? Mar 18 19:38:57 Awesome. :) Mar 18 19:39:07 g1bbs: yeah, and at this point I'd expect that junior devs interviewing for android would know fragments :) but typically when hiring junior devs we're looking for people who _can learn_, not ones which already know what we want them to know. fragments aren't that hard to pick up. Mar 18 19:39:30 g1bbs: we design it explicitly to avoid ListActivity/Fragment as an option :) more layout complications that way. Mar 18 19:39:59 pfn, yes ok thx Mar 18 19:40:31 g1bbs: basically, we try to keep it simple, and leave a large variety of ways to do more than the barest-basics / demonstrate that they're aware of X, Y, Z, or at least give areas to discuss about. Mar 18 19:41:00 g1bbs: but that's ours. far from perfect, no doubt, but we're reasonably happy with it. Mar 18 19:41:51 So I understand the theory behind specifying font sizes in controls using SP. We do that. However, I am finding that the apparent visual fonts sizes varies wildly between devices anyway. Mar 18 19:42:22 For example, on a Nexus 5 our standard “body” font size is very readable. On a Galaxy S5 Mini it is easily 40% smaller (and totally unreadable) Mar 18 19:42:27 adamblock: not only that, the user can set their device's font scale. ya gotta assume flexibility. Mar 18 19:42:29 I was finding if I dynamically set a current tab that the slidingtab strip wouldn't scroll. Mar 18 19:42:36 Has anyone used the Recyclerview-StickyHeaders library before? http://eowise.github.io/recyclerview-stickyheaders/getting-started.html Mar 18 19:42:40 groxx: I understand, but this is out of the box behavior Mar 18 19:42:59 I assume **most** people don’t in fact change the defaults Mar 18 19:43:12 adamblock my mom does Mar 18 19:43:21 memorion: besides her :) Mar 18 19:43:27 https://developer.android.com/samples/SlidingTabsBasic/project.html - I think I found onResujme() does't help me but ViewTreeObserver does Mar 18 19:43:40 memorion: That sounds like the punchline of a confused comedian. :D Mar 18 19:43:45 either way, I would like to start users with something sensible. Why might the SP approach be failing? Mar 18 19:43:50 So my questions i basically should I add it to the control or to my given fragment? Mar 18 19:44:00 most apps look pretty horrible with the big font setting :D Mar 18 19:44:25 adamblock: could the N5 vs S5 have different fonts? e.g. is the S5 an older OS version and has to use some fallback? Mar 18 19:45:28 groxx: possible? we are using the system fonts in nearly every case I believe Mar 18 19:46:29 adamblock: what's the font size, btw? if it's below ~11 or 12, I've found quite a lot larger variation in behavior (and low(er) screen density makes it unreadable) Mar 18 19:47:16 AS 1.2 Preview 3 is out Mar 18 19:47:59 wat Mar 18 19:48:18 * groxx updates Mar 18 19:48:48 lol - the patch mechanism is fucked Mar 18 19:48:58 * groxx has to go change the studio.vmoptions AGAIN... Mar 18 19:53:10 Anybody here actually respond to questions? Mar 18 19:53:18 Gh0sted no Mar 18 19:53:21 lol Mar 18 19:54:04 groxx: yes, the smaller ones are more of a problem. I’m not really sure Mar 18 19:54:18 Ok, well, I'm just starting app programming. I'm seeing that people recommend using a middle point between an actual remote sql server and the app... Is this best practice? Mar 18 19:54:49 I think what is going to be best practice for us is to be responsive to the system font size (i.e., use SP) for blocks of text Mar 18 19:54:51 Like, should I set up a page on our server that makes the sql requests and outputs json, and the app would send requests to those webpages Mar 18 19:54:57 Gh0sted: probably because having an explicit API is generally a good idea, and exposing an SQL server directly is rarely done safely Mar 18 19:55:07 I like to synchronize an async operation on android, which is called by the looper. Mar 18 19:55:22 I tryed to do so with a countdown latch and failed and now need some help Mar 18 19:55:29 for for UI elements like button labels, etc, use fixed pixels and scale them using the screen scale, but don’t incorporate the user’s font settings Mar 18 19:55:42 Ok, so for a simple app maybe just make a tiny "api" to check usernames and pull latest data from our website Mar 18 19:55:48 Thanks groxx Mar 18 19:56:13 Gh0sted: not here to push an agenda but if you are just starting you might look at Realm Mar 18 19:56:26 our experience with the Android ORMs has not been great Mar 18 19:58:36 not sure realm is all that much better there :) the API is certainly nice, but it has some very strange quirks, some of which are _really_ poorly adapted for android (e.g. you essentially have to do all your db operations on the main thread, which is disk access, which is not a good idea) Mar 18 19:59:00 my first app is done! well, done enough for my first try. Mar 18 19:59:09 newbQ: What is it? Mar 18 19:59:23 if that's alright, and you don't need database migrations, realm seems speedy and convenient. I still won't recommend it for anything important though :| needs more maturity. Mar 18 19:59:39 Yeah, Realm looks like it's another option for housing a database on the android. I'm more curious about getting the latest info from our website Mar 18 19:59:40 Doing DB operations on the main thread? That's a-paddlin'. Mar 18 20:00:11 err, website's database Mar 18 20:00:13 TacticalJoke: just a simple timeclock tracker thing. you use it to clock in and out and it tells you your hours for the week. Mar 18 20:00:53 I'm sure the code is so bad that it would get me fired if this was for a job Mar 18 20:00:54 it's either that, or do the Realm operations on a background thread, and _copy_ the relevant data to pass it to a different thread. there are lots of breathless "omg realm is so threadsafe" quotes, but it achieves that by _not being threadsafe_. queries, results, _everything_ only works on a single thread. Mar 18 20:01:04 but it's a start Mar 18 20:01:26 That's great, newbQ. You can check "Make an Android app" off your bucket list. Mar 18 20:01:34 you won't _corrupt_ the db by doing things on multiple threads, but that's all they can claim Mar 18 20:01:49 Next is "Make an award-winning Android app". Mar 18 20:02:21 I'd like to thank everybody here who has tried helping me and dealt with me being a bumbling fool. I really appreciate it Mar 18 20:02:43 android turns everyone into a bumbling fool Mar 18 20:03:04 newbQ: Are you uploading it to Google Play? Mar 18 20:03:45 TacticalJoke: oh heck no. it's way too unpolished for that. Mar 18 20:05:54 if anybody wants a laugh, I can upload the source somewhere Mar 18 20:06:28 It can't be as bad as this: http://jeff-relf.me/X.CPP Mar 18 20:08:31 wow. yeah, mine's not that bad. but its still really bad Mar 18 20:08:35 AS is smart enough to see my cut and paste errors Mar 18 20:10:28 TacticalJoke: wtf does that even do? print "hello world"? cure polio? start world war 3? Mar 18 20:10:33 That guy used to post on the C++ newsgroup. I think he had serious mental illness. Mar 18 20:10:38 comp.lang.c++ or something. Mar 18 20:10:48 I think it's an NNTP reader as well as a few games. Mar 18 20:11:09 that is pretty funky Mar 18 20:11:19 er. is it working? Jeff-Relf.Me/X.PNG Mar 18 20:11:58 newbQ: gj! Mar 18 20:12:29 groxx: lol Mar 18 20:12:38 i'm in the same boat, spent last week learning android and published my little app yesterday on play store =P Mar 18 20:12:47 One-Man-Bucket: thanks Mar 18 20:13:55 One-Man-Bucket: what app is it? Mar 18 20:14:25 newbQ: https://play.google.com/store/apps/details?id=com.snuskollen Mar 18 20:14:40 newbQ: it's for keeping track of snus (snuff/tobacco) habits Mar 18 20:15:35 thats interesting. Mar 18 20:16:33 thats kinda Mar 18 20:16:34 gross Mar 18 20:16:45 How to synchrnoize the mPictureCallback? Mar 18 20:16:47 Warning: may cause gum diseases and tooth loss. ;o Mar 18 20:16:58 + cancer and death Mar 18 20:17:27 well, at least it helps me in keeping track of how much of the stuff i use =P Mar 18 20:17:59 the other apps i found were all about kicking the habit completely, which is fine i suppose, but i want to start by tracking it Mar 18 20:18:08 i dont see the appeal to tobacco Mar 18 20:18:54 unsolicited advice -> what if you let the user change "SNUS" to user input, so they can track whatever they want. and let them track multiple things? free version lets you track 3 or 5 things, paid version lets you track as many as you want? Mar 18 20:19:03 after nexus, what phone has the currently biggest developers community? Mar 18 20:19:37 newbQ: yeah, a friend uses it to track coffee :) but i want to add some snus specific stuff later on so i'm keeping it Mar 18 20:19:56 newbQ: plus there's probably a zillion generic "thing tracker" apps out there already Mar 18 20:20:01 groxx what did you change in studio.vmoptions? Mar 18 20:20:52 i have Xmx set to 750, i think i need to lower it Mar 18 20:23:15 On this page, under usage, the example shows "public VH onCreateHeaderViewHolder(ViewGroup parent);"... where is the VH coming from? I'm trying to include that method in my Adapter, and I can't find anything with a VH. Mar 18 20:23:16 https://github.com/timehop/sticky-headers-recyclerview Mar 18 20:23:38 what is the single item choice button color style attribute called? Mar 18 20:23:57 lol, another victim of the android theming attribute madness Mar 18 20:24:34 lasserix gotta just have a few vims up with attrs.xml, styles.xml, and themes.xml for constant perusal Mar 18 20:24:35 g00s: Xmx is 1536 for me. I regularly hit ~600-700, if I have less than a gigabyte it starts to slow waaaaaay down. Mar 18 20:24:37 Can I somehow prepare a Looper so that takePicture adds it's callback to the new looper? Mar 18 20:25:07 groxx oh wow, wish i could put it that high Mar 18 20:25:14 g00s: also I bumped Xms to 256 because I never use less than 200mb, no need to force it to go through a heap growth cycle or two. Mar 18 20:25:18 I call Looper.prepare(); mCamera.takePicture(....); and than Looper.run(); but my callbacks are not called. Mar 18 20:25:42 g00s: are you talking to me? Mar 18 20:25:56 t0astt no :) Mar 18 20:26:46 g00s: seems like android has a lot of madness inside Mar 18 20:26:56 its all madness Mar 18 20:27:14 lasserix oh then you need those 3 files opened up from the support lib Mar 18 20:27:27 so 6 files permanently up to peel through ;) Mar 18 20:27:29 *peek Mar 18 20:28:21 Is there a way arround using the callbacks all the time in android? Mar 18 20:28:52 tokam you can use rxjava for some relief Mar 18 20:29:04 ? Mar 18 20:29:23 ! Mar 18 20:29:54 how does it help me? https://github.com/ReactiveX/RxJava Mar 18 20:30:16 it helps with concurrency Mar 18 20:31:58 tokam: asynchronous can be converted to synchronous. if the callback pattern itself bothers you, you can wrap it to look like anything you want. Mar 18 20:32:10 how? Mar 18 20:32:41 I only like to synchronize one function call. I know about the java concurrent packe, but android does not seem to use real threads Mar 18 20:33:04 it does Mar 18 20:34:09 it just has higher-level abstractions like handler + looper, and other things to avoid creating new threads all the time, because creating new threads is expensive. you don't notice it as much in other java code because it's typically on a desktop / server, but it matters on mobile devices. Mar 18 20:34:10 groxx you will probably know this. is thread 1 sets some reference like Object foo = new Object(), and thread 2 comes along and says new Bar(foo) - with that ctor assigning foo to a final reference, is that happens-before ok ? Mar 18 20:34:12 Can someone help me with implementing this library? I'm just having trouble understanding how to... set it up, I guess? https://github.com/timehop/sticky-headers-recyclerview Mar 18 20:35:26 g00s: unless the assignment to foo is otherwise ensured to be happens-before between the threads, i would assume no. Mar 18 20:35:40 ok, guess i should be safe Mar 18 20:35:42 thanks Mar 18 20:37:33 groxx: but how does it do it? if it is not native it shuold be doable without rxjava Mar 18 20:37:46 tokam: how does it do what? Mar 18 20:37:52 or, what does what? Mar 18 20:37:54 synchrnoize async callbacks Mar 18 20:37:58 rxjava Mar 18 20:38:41 not sure what rxjava does, but in principle you can always build a blocking latch of some kind, and use that to convert async to sync. Mar 18 20:39:00 tokam: This discussion has nothing to do with native Mar 18 20:40:04 if it can be done by a java which uses java methods, I should be able to do it without the library too Mar 18 20:40:23 Of course, it’s just more complicated without Rx Mar 18 20:40:40 groxx: that's what I thought but it only works, only if there are two real threads Mar 18 20:40:54 Real thread? There is no other kind. Mar 18 20:41:14 the concurrent package in java has that functionality. but android does not do a real async call. Mar 18 20:41:32 tokam: What makes you think andorid doesn’t do a real async call? Mar 18 20:41:40 I observed in a debugger, that something called Looper is responsible for starting my assync function. Mar 18 20:41:44 tokam: I'm not sure where you're getting that idea from. it's wrong. Mar 18 20:42:31 I see so many issues related only to Android 4.0.4 (API Level 15) Mar 18 20:42:33 http://pastebin.com/chsKenPn Mar 18 20:42:36 Little small issues Mar 18 20:42:39 tokam: that's part of a message queue system. Mar 18 20:43:00 tokam: What about that pastebin? Mar 18 20:43:06 looper loops forever and reads from the queue in that thread. Mar 18 20:43:08 the callback is supposed to be called. But if the code reaches the await() the callback is never called. Mar 18 20:43:52 jaana: it is an old example of how I tried to synchrnoize the callback and my function which passed the callback to the takePicture function (which uses native code) Mar 18 20:43:56 tokam: You need to understand how threading on Java works before going further Mar 18 20:44:36 what makes you think that I do not know how threading works? Mar 18 20:44:57 The code you just gave us Mar 18 20:45:02 Now I come up with weird stuff, which does not yet work. http://pastebin.com/wwhUUF0u Mar 18 20:45:28 Now this looks a bit better Mar 18 20:45:36 jaana: I do not know what takePicture does. Mar 18 20:45:54 Yeah, you need to read some docs. Well, a lot of docs. Mar 18 20:46:04 async callback seems to indicate that the callback is called in it's own thread, which is started by takePicture. Mar 18 20:46:54 You should display the thread id in all your print statements, it will make more sense then Mar 18 20:47:17 The pastebin never reached my callback. But when I called Looper.loop(); before the await, I was able to get into the callback but unfortunately Looper.loop(); never terminated. I was not allowed to call Looper.myLooper().quit() in the callback. Mar 18 20:47:41 You should never do that Mar 18 20:47:53 tokam: the callback puts a message in the main thread queue. by blocking the main thread, you're ensuring that the queue cannot be processed, so the callback cannot happen. Mar 18 20:48:01 how can i synchrnoize the callback with the function which passed the callback? Mar 18 20:48:19 groxx: right, that's what I assumed by the debugger. Mar 18 20:48:22 why do you want to synchronize it anyway? Mar 18 20:49:09 that doesn't mean android doesn't use threads. it means you're not understanding *how*, and you're trying to control it. problems are pretty much guaranteed. Mar 18 20:49:16 By what I got now I tryed to solve that. I assumed Looper.prepare(); might lead to my own queue. And Looper.loop(); might execute that queue(); unfortunately the takePicture callback was not inside of it ! Mar 18 20:49:59 I would like to synchronize it because I provide an API. If I do not synchronize I will have many many callback-classes and who calls my Api must work with a callback too. Mar 18 20:50:52 you can't achieve that on the main thread without causing lots and lots of problems Mar 18 20:51:15 ok - how can we achieve that with problems? Mar 18 20:51:30 does takePicture always write in the queue of the main thread? Mar 18 20:52:07 tokam: dunno. read the docs. usually it's "yes" or "calls back on the thread that called the parent function" Mar 18 20:52:58 sometimes my taskExecutor.execute, executes but sometimes it is blocked by my await() Mar 18 20:53:09 so execute does not lead to imediate execution. Mar 18 20:53:25 the docs would have told you that, yes Mar 18 20:53:27 groxx: read the docs is a so generic answer! Mar 18 20:54:38 it is, but your problems are very generic, and heavily imply that you have not done so. Mar 18 20:55:25 I think I am specific if I say that I like an synchronious takePicture method. Mar 18 20:57:12 which can be solved by normal threaded programming. nothing android specific is necessary. so you want someone to explain how to do multi-threaded programming. typically people either read stuff, or pay someone else to teach them. Mar 18 20:57:18 why must I fucking use an async function, if I anyways need to wait until I get my data Mar 18 20:57:51 groxx: I also tryed to run takePicture in it's own Thread! Mar 18 20:57:59 and synchrnoize them. Mar 18 20:58:21 I support the community, so I think I can ask? Mar 18 20:58:48 maybe at some point you will come up with "it is not possible?" :D Mar 18 21:00:21 If I increase the minSDK on an update of my app, will the old version with the lower minSDK still be available to users on that API Level? Mar 18 21:01:44 tokam: it's possible. but because the main thread should not be blocked for a large number of good reasons, you'll be forcing your users to run on a different thread. which may be convenient, there are good reasons to want that. to build that, honestly, it's just normal java threading - read up on it. Mar 18 21:02:20 at best, someone here could give you a one-off solution, but the source of the problem is that you want to do something you don't understand. there's only one way to fix that. Mar 18 21:03:10 Hi. I have the stupidest question ever, bear with me: I am writing for a custom device that runs Android. It's a smartwatch. According to the datasheet, runs "Android 4.4.2", but it doesn't say explicitly "Android Wear", though I strongly suspect so. Now - suppose I'm wrong. Could Android Wear be installed on such a device out of the box? Does Android Wear have special requirements? Does it run on anything that runs "standard android"? Mar 18 21:03:51 groxx: so the trick is that my api must be called in it's own thread to avoid blocking the main thread? Mar 18 21:04:10 theblang: Your existence in the app store is entirely defined by your most recent AndroidManifest. The old version of your app ceases to exist on the store once you upload your update. Once Google play pushes the update everywhere - your app will be restricted to your new SDK level Mar 18 21:04:27 groxx: please stop assuming that I know nothing -.- Mar 18 21:05:27 tokam: that's a big part of it, yes. and because of the way that callback is executed, it's required. though it would be true for _any_ same-thread callback system, and the docs should have been enough to infer that. Mar 18 21:06:09 currently I am reading about AIDL Mar 18 21:07:07 g1bbs http://stackoverflow.com/a/11374600/1747491 Mar 18 21:07:13 g1bbs has this changed? Mar 18 21:07:57 groxx: how can someone than use my api, if he has functionality in the main-thread, which needs it? Mar 18 21:08:48 tokam: unless the takePicture + callback can run on a different thread, they can't. or, they'll need to start up a thread themselves somehow. Mar 18 21:08:49 theblang: wow my bad - apparently it IS possible. ewwww. I suppose I've never had more than one active APK on the store Mar 18 21:08:59 theblang: interesting. You'll just have to try and find out I guess Mar 18 21:09:49 groxx: you realized in my code that I did not call wait() on a random object but await on a CountDownLatch? Mar 18 21:09:55 groxx: you do know what a CountDownLatch is? Mar 18 21:10:12 tokam: the docs are unfortunately unclear on the camera's threading requirements :| generally that means main-thread-only, but it's hard to say without testing. Mar 18 21:10:31 tokam: yep, I know. Mar 18 21:10:34 my test's indicate that it is on the main-thread Mar 18 21:10:42 http://stackoverflow.com/questions/3919089/do-callbacks-occur-on-the-main-ui-thread Mar 18 21:11:35 tokam: that's a super super super broad question and answer. a) aidl has nothing to do with what you're doing, and b) nothing really of value can be inferred from that question Mar 18 21:12:13 _most_ of android's methods are main-thread only, and in general they're documented if that is not the case. they're not 100% reliable about that though. Mar 18 21:12:42 if it were called in a new thread that would solve my issues anyways ;) Mar 18 21:12:57 I am having problems because of that MainThread handling and how I try to deal with it Mar 18 21:14:20 otto bus? Mar 18 21:15:58 groxx: If I do not block the main-thread to synchronize the data, the one who likes to use my data from that main-thread get's the same synchronization problem. Mar 18 21:17:09 groxx: I could internaly use thread, but at the starting point of my interface, expect a callback. Mar 18 21:18:05 if they want to use it from the main thread, that's basically the only option, yeah. which is what the takePicture + callback already does. Mar 18 21:19:35 that might be the case because of the android architecture Mar 18 21:22:14 In this code snippet, how is a String being returned as a long? Mar 18 21:22:14 http://pastebin.com/LA505X62 Mar 18 21:22:15 tokan from which thread do you call PICTURE_TAKEN.await()? Mar 18 21:22:20 g1bbs it looks like you can http://developer.android.com/google/play/publishing/multiple-apks.html Mar 18 21:22:45 toast ---> chars are also ints which are also longs Mar 18 21:22:46 g1bbs reason I am curious is that I got permission to drop ICS support, but I definitely needed the last version to work on older devices Mar 18 21:23:54 theblang: It gets weird as you add features though no? Mar 18 21:24:13 tokam: from reading through the source a bit, you may be able to .open() the camera on a different HandlerThread, and avoid the main thread entirely: http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/5.0.2_r1/android/hardware/Camera.java#Camera Mar 18 21:24:15 tokam: to block from an async you need to spawn an intermediate thread to block on since you can't block the main thread Mar 18 21:24:22 g1bbs well no, because users on API 11 and 15 will just never get an update. or a new user on API 11 or 15 will only see my app's last version Mar 18 21:24:46 g1bbs I had originally gotten permission to drop API 11, but also API 15 has caused a lot of weird issues Mar 18 21:25:26 theblang: Interesting. Well now I know! Sorry for misleading you lol Mar 18 21:25:40 g1bbs: no worries man! We both know now, haha Mar 18 21:26:02 g1bbs: It makes it such an easier sell to the bosses if our last version can still be installed after an update that increases minSDK Mar 18 21:26:33 groxx: letting my code run in it's own thread but having the camera spawned in the MainThread helped to avoid the deadlock. Mar 18 21:27:07 theblang: For sure. I'm lucky enough to be working ICS+ but I suspect it will be a while before I can drop ICS progress altogether Mar 18 21:27:29 groxx: if I understand you right, we might be able to create the camera in it's own thread and than be able to let run my api in the main thread? Mar 18 21:27:45 g1bbs: Altogether, do you mean for all your projects? Mar 18 21:27:46 minSdk = 16 , soon 17 or 18 :D Mar 18 21:27:55 tokam: you still shouldn't be blocking the main thread. the camera isn't instant, and lots of important things happen on the main thread all the time. Mar 18 21:28:05 g00s 17 will probably still be awhile Mar 18 21:28:16 g00s I did get permission to go to 16 though, woohoo Mar 18 21:28:22 \o/ Mar 18 21:28:23 yes it is not instant. I might get race-conditions. Mar 18 21:28:25 tokam: you need to create a thread off the main thread, and block on that for your async call back to complete, then callback to your mainthread Mar 18 21:28:42 that's what I do! Mar 18 21:28:42 like, it's not just "I wouldn't recommend this". it's "this may cause your app to be buggy, maybe even freeze, showing an error dialog" Mar 18 21:29:11 tokan from which thread do you call PICTURE_TAKEN.await()? Mar 18 21:29:14 I dislike this callback war, at least we now managed to reduce it a bit. Mar 18 21:29:29 tokam: this is perfect for reactive java btw Mar 18 21:29:41 groxx di dyou ever use the StateMachine for your camera thing ? Mar 18 21:29:42 lasserix: now a new one. taskExecutor.execute(new Runnable() { .... Mar 18 21:30:02 t0astt: I think chars are ints? and it's not a _String_, it's a _char_. Mar 18 21:30:02 lasserix: Word. The camera example is perfect for Rx Mar 18 21:30:05 it's my camera thing - if groxx does not have an other one. Mar 18 21:30:16 tokam so you can block on that one, and when it unblocks (from the callback coming through), just callback to your main thread Mar 18 21:30:20 groxx: yep, I see taht now :) Mar 18 21:30:32 easiest way to do that is Handler h =new Handler(Looper.getMainLooper()); h.post(new Runnable ... } Mar 18 21:30:56 g00s: not yet. still haven't rebuilt that part of the app :) Mar 18 21:30:59 ExecutorService taskExecutor = Executors.newFixedThreadPool(2); Mar 18 21:30:59 taskExecutor.execute(new Runnable() { Mar 18 21:31:01 that's wrong? Mar 18 21:31:12 g00s: the tower of wtf on top of it means fixing it is non-trivial :) Mar 18 21:31:13 thats is fine Mar 18 21:31:20 hehe Mar 18 21:31:51 tokam concurrency is a big topic, might be good to put things down and study it Mar 18 21:31:54 g00s: not only that, there's wtf-fixing code that has to be understood and unravelled. and it keeps growing. Mar 18 21:32:04 noooo Mar 18 21:34:07 well the documentation for takePicture did not say anything about the Main-Thread, so I asked here. Mar 18 21:34:42 I know how to use the classes in the concurrent package. But without threads obviously they won't work ;) Mar 18 21:35:36 Can the Looper of the Main-Thread interrupt posts, which have been made? Mar 18 21:36:20 seemingly not, otherwise the await(); had not crashed my application. Mar 18 21:38:40 g00s: I do not see how you do start a new Thread with your Handler code? Mar 18 21:43:07 Hey guys, is there a method to json encode a string? Mar 18 21:43:24 I have a list, and I did .toString() but I need the string to be in JSON format Mar 18 21:43:34 well then use a JSON encoder. Mar 18 21:43:41 Class? Mar 18 21:43:58 JSONWriter Mar 18 21:44:22 I suspect JSONArray has a constructor that accepts a List or Object[]... Mar 18 21:44:41 ok then I could just do .toString on that Mar 18 21:45:04 as long as all the objects have a useful .toString() value, yeah Mar 18 21:45:28 Thanks Mar 18 21:48:59 Is there any way to use the Android USB connection to project my phone's display onto my computer screen? Mar 18 21:55:19 AndreasL: you can take screenshots, that is about it Mar 18 21:55:31 AndreasL: If your phone supports HDMI then you can use that Mar 18 21:56:18 you could record into an MP4 stream and transfer that via USB and display on the computer Mar 18 21:56:27 there's probably an app for that already, though Mar 18 21:56:44 AirDroid does it among other things, just not over USB Mar 18 21:57:06 adb forward ? Mar 18 21:57:12 I just need a good way to make a live demonstration of an app running on a phone up onto a large screen Mar 18 21:57:26 emulator :D Mar 18 21:57:27 oh then hdmi/mhl if supported by the device Mar 18 21:57:27 get a smart tv and do screen mirroring ;) Mar 18 21:57:38 or a chromecast and cast your screen Mar 18 21:57:39 AndreasL, I'm afraid there isn't any Mar 18 21:57:47 AndreasL, can you record the video ahead of time? Mar 18 21:57:59 (If you're doing a talk, you should. ) :) Mar 18 21:58:09 Mavrik, that's what I usually would do, but for this specific demonstration we want feedback, so if it's live it's much more useful Mar 18 21:58:28 yeh :/ Mar 18 21:58:33 there are some apps that do it, but nothing built-in afaik Mar 18 21:58:40 My test phone is a Nexus 5, so it can do screen mirroring... Mar 18 21:59:02 * Chainfire 'd go either MHL or ChromeCast in that case Mar 18 21:59:14 oh, Nexus supports that? Mar 18 21:59:21 Nexus has Slimport Mar 18 21:59:24 the 5 Mar 18 21:59:27 but yes Mar 18 21:59:28 yeah, probably. does mhl-mirroring require app support though? Mar 18 22:00:01 AndreasL, basically your mirroring options are: Chromecast (via Wifi), Slimport (USB -> HDMI), Miracast (wireless link) Mar 18 22:00:02 oh, yeah, Nexus5 has slimport instead of mhl but should be similar in effect... adapter to HDMI ? Mar 18 22:00:49 Is there any Linux software that could act as a receiver? I know there is Miraclecast, but I can't find any references to whether or not it works well (I would have to compile it, and I'm a bit short on time, so I'd prefer not to go down many blind alleys...) Mar 18 22:01:04 None of those will work on Linux laptop. Mar 18 22:01:07 Casting to a ChromeCast via WiFi is slower, has more artifacts, etc, but if you aren't trying to show off the animations themselves it should be fine mostly Mar 18 22:01:52 bankai_: isn't that a samsung thing? Mar 18 22:02:00 Slimport would probably be the best option then. But I need it by tomorrow and I don't have the time to go out and buy it (no nearby local shops that would carry it, afaik) Mar 18 22:02:12 phix: probably... and 'smart' is a very generous term :/ Mar 18 22:02:13 phix, the "Samsung thing" is Miracast Mar 18 22:02:21 just branded and probably incompatible :P Mar 18 22:03:12 Mavrik: ah Mar 18 22:03:52 I have screen mirroring on my samsung :\ Mar 18 22:07:02 AndreasL: in KK+ (iirc), you can do "adb screencast". And I think there's a way to make it stream the encoded video to STDOUT, which you could then theoretically decode on the fly and display on your host machine Mar 18 22:07:15 "adb shell screencast" rather Mar 18 22:07:24 oh, screenrecord, not screencast Mar 18 22:07:29 Does anyone use a Nexus 6 with hierarchy viewer? Mar 18 22:08:25 hey guys, i`m doing some crazy (testing) stuff: adding the same image to 1080 imageButtons ;) gives me outOfMemory-Error. What should i do to avoid this? Mar 18 22:08:48 don't add it to 1080 imageButtons? :D Mar 18 22:09:27 heh. yeah, adapterview or something. Mar 18 22:09:42 JesusFreke: Well this is something which probably wont happen in real use-case but theoretically my app supports it Mar 18 22:09:43 adkins - .recycle and set stuff to null adn garbage collect? Mar 18 22:10:45 i had an app that choked after a few uses b/c the bitmaps weren't completely cleared. Mar 18 22:11:46 rgvneil: i tried something like this. can you be more precise about this? like should i do something before/after bitmap=cretaeScaledBitmap(....); and before/after img_btn.setImageBitmap(bitmap); Mar 18 22:12:02 adkins asking for trouble having more than 150-200 views on the screen at once Mar 18 22:12:17 just in general, nm bitmaps Mar 18 22:12:29 so you have no option but to use an adapterview Mar 18 22:13:24 g00s: nm Bitmaps? Mar 18 22:13:34 nm = nevermind Mar 18 22:13:41 what else? Mar 18 22:14:32 any way to animate elevation? Mar 18 22:16:22 > 5.0 Mar 18 22:16:39 put things into as small of a function as you can, have a local variable, then recycle *and* set to null *and* system.gc Mar 18 22:16:54 Other than that I'd have to hunt up my old code, which might be cool... Mar 18 22:17:33 does AS’ layout editor show material things like elevation? Mar 18 22:17:46 largeHeap Mar 18 22:17:59 (also, largeHeap dies cross-process, stupid bug) Mar 18 22:18:19 tricknology: translationZ I think? Mar 18 22:18:25 ty groxx Mar 18 22:18:43 tricknology: as I understand it, "elevation" == "permanent location", "translationZ" == "temporary modification / for animation" Mar 18 22:19:17 though I can't tell how I feel about taps _raising_ the elevation :S seems like they should be pressed. Mar 18 22:19:38 pjh that’s in the ObjectAnimator Mar 18 22:19:43 which is cool btw.. Mar 18 22:19:58 Chainfire: does the other process not have largeheap then? or do you need to declare it twice somehow? Mar 18 22:20:00 translationY and translationX are also params Mar 18 22:20:12 JesusFreke, apparently someone made a utility that seems to be based on screencast: http://droid-at-screen.ribomation.com/ Mar 18 22:20:38 groxx I've never been able to get largeHeap to work for a secondary process Mar 18 22:20:52 it's just ignored and GC'd as a non-largeHeap process Mar 18 22:21:04 Chainfire: that's pretty bleh. I suppose the theory there is that you can just start up more if necessary? D: Mar 18 22:21:20 yeah it is pretty bleh Mar 18 22:21:58 the cases where I've encountered it, I was doing all the rendering work in a separate process to a surface displayed by the first process, that way the first process could always stay responsive Mar 18 22:22:13 so the secondary process was actually the one with the high memory requirement... but alas... Mar 18 22:22:19 JesusFreke, ok, that solution was really bad. It just takes lots of screenshots. The screen you see has like 1 FPS! Mar 18 22:23:27 Chainfire: I've also heard of issues with the secondary process not getting killed and restarted when the app is updated, and a few other weird things :[ seems enough to scare me away from multiprocess until absolutely necessary Mar 18 22:23:50 I have not run into that specific issue Mar 18 22:24:09 though one annoying thing is that SharedPreferences do not get synchronized properly Mar 18 22:24:20 at least they warn you about that now. but yeah Mar 18 22:25:04 too bad though Mar 18 22:25:23 it could have been great :) Mar 18 22:25:49 those sound like growing-pain kinda bugs, stuff that should have been fixed in android 1.1 or 1.2 Mar 18 22:25:59 not stuff in 5.0 of an OS Mar 18 22:26:02 AndreasL: i was thinking of writing one of those.. using the new Lollipop api Mar 18 22:27:08 g00s welcome to Android ... :) Mar 18 22:27:42 perpetual sophomore OS Mar 18 22:28:08 what does that make iOS? one of the Heathers? Mar 18 22:29:11 iOS you just grab memory until it says no more, no need to split into multiple processes (last i recall) Mar 18 22:29:19 300mb should be no problemo Mar 18 22:29:23 500mb hmm Mar 18 22:29:32 700mb ... probably won't get it Mar 18 22:29:42 thats how the VM works Mar 18 22:30:01 to be fair, a native language like ObjC doesn't have much of the overhead memory wise that Java has Mar 18 22:30:22 also I miss refcounting at times :( more predictable behavior. Mar 18 22:30:47 post ARC, that is. manual refcounting sucks. Mar 18 22:30:47 I used to do exlusively native code, but if I have to choose between ObjC and Java I'd still pick Java :D Mar 18 22:32:05 I waffle. there are pretty big "I wish I had..."s going either direction. Java's static analysis is pretty dang nice though. Mar 18 22:32:16 xibs though. THAT I'm glad to leave behind. Mar 18 22:32:16 You waffle? Mar 18 22:32:45 waffle > pancake, yeah. if legit Q: I can't really tell which I like better :) Mar 18 22:33:17 groxx https://www.kickstarter.com/projects/1304060422/the-keyboard-waffle-iron Mar 18 22:33:45 well Java on Android isn't so much just the language being obnoxious Mar 18 22:33:57 you need to know and tinker with too much code Mar 18 22:34:03 how tall is the keyboard in do? Mar 18 22:34:03 (or use a library) Mar 18 22:34:05 dp Mar 18 22:34:10 g00s: lol, yeah, I'd use that if I actually ate waffles with any frequency :) Mar 18 22:34:18 i find the apis abnoxious, not java really Mar 18 22:34:23 tricknology: trick question. it is both indeterminate and fluctuating. Mar 18 22:34:30 for example something like a Navigation Drawer... pretty much should be a two-liner to implement Mar 18 22:35:05 but the amount of code you need to write for it is redonkulous... they pretty much just tell you how it could be done if you were building such a thing from scratch, rather than provide a ready to use component, bam, done. Mar 18 22:35:28 need something more? subclass. dont? works great as is Mar 18 22:35:39 Chainfire yeah, provide menu.xml, done - stuff in drawer, auto switching fragments, etc Mar 18 22:35:56 and this sort of stuff is all over the place with Android Mar 18 22:36:08 it could have just worked like Preferences, where you give headers and fragments Mar 18 22:36:19 they didn't provide a FAB implementation because it was so easy to make. Now we have 20 different libraries which all fail in different spectacular ways Mar 18 22:36:33 tricknology: I'd be VERY interested in what others do, and if anyone knows of caveats, but personally I calculate keyboard height by - . there are some strange surprises there if you use orientation listeners, and it doesn't handle split-window rationally at all, but it seems reliable otherwise. Mar 18 22:36:55 right g00s Mar 18 22:37:15 urg. but preferences have their own issues. Mar 18 22:37:24 well let me ask you this.. how do you resize your scrollviews when a keyboard pops up? Mar 18 22:37:25 I wouldn't call that a good API personally. Mar 18 22:37:26 groxx Mar 18 22:37:47 tricknology: I don't. the window resizes, layout occurs, scrollviews updated. Mar 18 22:37:48 well yes, preferences have their own issues, but at least you have something of a starting point Mar 18 22:38:07 groxx yeah i agree, but some xml that just maps nav drawer items to fragments, and takes care of the back stack, switching, etc Mar 18 22:38:14 not when animatinos occur Mar 18 22:38:43 a declaration and perhaps a few lines of code to connect an adapter or callback should by all means be all there is to it Mar 18 22:38:52 ya Mar 18 22:38:55 say I have a scrollview that is layout_above something.. i animate the something out of the way, the scrollview syays the same size Mar 18 22:39:00 I spent almost an entire day implementing it the first time Mar 18 22:39:23 getting it to work how I wanted across various layouts, always open in landscape tablets, etc Mar 18 22:39:24 ridiculous Mar 18 22:39:29 i've spent an entire 2 mos getting the BLE apis to work reliably. it was such an adventure, i'll probably try to talk about it at some conference Mar 18 22:40:06 yikes Mar 18 22:40:11 I remember you complaining about that I think Mar 18 22:40:24 i do wish i had a whole bunch of similar devices, i would like to do some stress testing Mar 18 22:40:28 still using BLE is somewhat rarer Mar 18 22:40:35 tricknology: not sure that really applies to keyboard, since it changes your window height and isn't animated (unless you change the soft input mode). but unfortunately I don't really have a good way to resize scrollviews - I just do it, and let the framerate drop a bit due to the layout calls. Mar 18 22:40:38 well, stores have them :) Mar 18 22:41:38 basically, I have a numpad that animates out of the way, and since the scrollview is wrap_content, when the keyboard pops up, the scrollview is cut off, the window doesn’t resize Mar 18 22:43:00 maybe I’ll play with the SOFT_INPUT_ADJUST_RESIZE.. params Mar 18 22:43:09 aaaand that was it Mar 18 22:43:10 SOFT_INPUT_ADJUST_RESIZE Mar 18 22:43:30 in onCreate. setSoftInputMoce(WindowManaget.LayoutParams.SOFT_INPUT_ADJUST_RESIZE) Mar 18 22:48:49 AS keeps trolling me with 'this can be a lambda' Mar 18 22:49:02 lower the language level? :) Mar 18 22:49:11 they should have put a trollface there in the popup Mar 18 22:49:14 groxx its 1.7 Mar 18 22:49:14 lol Mar 18 22:49:26 and it's recommending lambdas? weird Mar 18 22:49:31 yeah Mar 18 22:49:40 1.1 didn't do this, just 1.2 Mar 18 22:50:21 groxx and the project structure dialog says source / target compatibility are 1.7 Mar 18 22:50:43 maybe this is heads up that lambdas are coming :D Mar 18 22:50:58 hopefully :) Mar 18 22:51:33 fwiw it isn't doing that to me, though my source/target are still the default no-value-set values. Mar 18 22:52:02 I actually can't find any explicit 1.6 vs 1.7 value set anywhere... hm. meh, doesn't matter for now. Mar 18 22:52:18 i have 1.7 set in the build.gradle files, don't you ? Mar 18 22:52:27 thought so, but apparently not Mar 18 22:53:05 really, so do we not have to say compileOptions { sourceCompatibility JavaVersion.VERSION_1_7 ..... etc } ? Mar 18 22:53:18 i have a java 8 jdk so i think i need that Mar 18 22:53:33 nope. we have very little even 1.7 code yet, but studio does recommend 1.7 changes to me Mar 18 22:53:39 8 sdk here too Mar 18 22:53:53 let me check the awesome gradle docs Mar 18 22:54:21 works-down-to-gingerbread 1.7 just doesn't offer us much. it's possible we haven't even switched to 1.7, lol Mar 18 22:58:31 FrameLayout#setForegroundGravity <- what. Mar 18 23:09:42 groxx: what about it? Mar 18 23:10:13 why does it exist? it's a weird thing to bake into an otherwise very minimal viewgroup Mar 18 23:10:20 not really Mar 18 23:10:37 groxx: FrameLayout supports a foreground Drawable Mar 18 23:11:21 Napalm: yeah, but then why don't all viewgroups? why framelayout but not relativelayout, for instance? Mar 18 23:11:32 groxx: not sure when it first came in I've been using since v1.5 and its original platform use was for windowContentOverlay Mar 18 23:13:28 but only on framelayout + subclasses? and why not on Window? Mar 18 23:14:24 because Window is not a view Mar 18 23:14:25 lol Mar 18 23:15:00 :P well sure, but if you support a _window content overlay_, why would you expect that to be on and not Window? Mar 18 23:15:29 erm, because the window decor contains a FrameLayout for the content Mar 18 23:15:29 especially since the whole thing can be faked with framelayout relatively easily by .addView() Mar 18 23:15:42 i suspect its initial use was only for that one thing Mar 18 23:15:57 aaah. still weird, but at least fitting. Mar 18 23:16:13 (weird because why not make a hidden class for that, they do elsewhere) Mar 18 23:16:32 because hidden classes didnt exist back then Mar 18 23:17:13 hidden classes have been a thing since at least 1.0 Mar 18 23:17:32 @hide was introduced later if i remember correctly. Mar 18 23:17:43 think it was 2.0/2.1 Mar 18 23:18:12 I don't think so, but I could be mis-remembering Mar 18 23:19:48 https://android.googlesource.com/platform/frameworks/base/+/donut-release/core/java/android/database/AbstractCursor.java Mar 18 23:19:56 that was donut, so... 1.6 Mar 18 23:21:10 yep. https://android.googlesource.com/platform/frameworks/base/+/54b6cfa9a9e5b861a9930af873580d6dc20f773c/core/java/android/database/AbstractCursor.java Mar 18 23:21:13 that was 1.0 Mar 18 23:23:28 I stand corrected Mar 18 23:23:49 * Napalm awards +1 respect to JesusFreke Mar 18 23:24:00 * groxx tosses some internets in the bucket too Mar 18 23:32:34 Hi :) Mar 18 23:34:21 do you guys have any idea how to use external USB cameras on Android? Can't find anything that works online :( Mar 18 23:36:16 Does android studio have issues pulling device screenshots from emulators? Mar 18 23:36:48 Can anyone tell me why Volley requires you to use ImageLoader and pass in an LRU cache for default memory caching of images.. I'm not making any claims as to what should or shouldn't happen, I am just looking to understand.. Shouldn't you be able to provide an LRU cache to volley, and caching be done based on the cache headers of the http response? Mar 18 23:38:21 timusus: are you just using volley for image loading? Mar 18 23:38:36 No, for all kinds of network requests. Mar 18 23:38:44 oh Mar 18 23:39:31 desmin88: I was unable to get a screenshot from the emulator using Android Studio the last (and only) time I tried. I just got blackness. Mar 18 23:39:34 I'm kinda.. in this discussion with my superior about caching. We use a sort of wrapper around Volley for 'code parity' between iOS and Android. And that wrapper only allows for a normal HttpRequest, no ImageRequests and such, Mar 18 23:39:36 I assumed it was just me. Mar 18 23:39:49 It also means they'd prefer me to use the wrapper methods than say.. an ImageLoader Mar 18 23:39:59 groxx: Everyone is doing your "¯\(ツ)/¯" thing lately. You should've patented it. Mar 18 23:40:26 ¯\_(ಠ_ಠ)_/¯ live and learn. Mar 18 23:40:29 :D Mar 18 23:40:50 I'm trying to make an argument for extending our wrapper to support ImageLoader style batch-requests and an LRU cache, but my boss says 'this stuff doesn't belong in a networking library' Mar 18 23:40:54 android device monitor says the screen isnt available Mar 18 23:41:21 desmin88: Ah. I wasn't getting that. Mar 18 23:41:35 Anyway, it got me thinking. Why can't we just provide Volley with a.. generic LRU memory cache, and it use that (if the response headers allow caching), as well as the disk cache? Mar 18 23:44:23 timusus: does kinda make sense. though arguably most requests aren't as static as images... Mar 18 23:45:21 does volley seem kinda unfinished tyo anyne else? Mar 18 23:46:22 felt that way a while ago, especially due to the massive lack of documentation. I haven't looked at it since the d.android.com documentation appeared, though Mar 18 23:48:02 But most requests also aren't anywhere near as large as images, so would it matter? Mar 18 23:48:49 How funny, apparently with "Use Host GPU" you cant take screenshots, but w/o that checked my emulator doesnt work Mar 18 23:49:31 use adb Mar 18 23:54:36 We can haz Preview 3 release notes? Mar 18 23:54:51 Though I guess there's not much to say. Mar 18 23:59:11 ./r/androiddev is full of it: "The problem with Android is that it's possible for a user to exit an application and immediately restart it without the OS having had a chance to clean the memory at the process level. If that happens, then the OS simply reuses the memory instead of reallocating the entire process." Mar 18 23:59:26 Despite "exit an application" being inaccurate, that comment got +8. Mar 19 00:17:32 This has to be the ugliest and hardest-to-read issue tracker ever: https://youtrack.jetbrains.com/issues/ Mar 19 00:20:23 TacticalJoke "Graphical glitching when fullscreen using OS X Yosemite (with Apple JDK!)" Mar 19 00:20:33 Java desktop sucking, news at 11 Mar 19 00:22:37 argh Mar 19 00:22:41 snackbar + keyboard fails. Mar 19 00:25:49 haven't noticed graphical glitching on my mac... Mar 19 00:25:54 not on the rare occasions I run intellij there Mar 19 00:26:13 lasserix: What are you using snackbars for? Just curious. Mar 19 00:26:15 pfn wait wut, you have a mac ?!?! Mar 19 00:26:22 I've had a mac for years Mar 19 00:26:23 I just don't use it Mar 19 00:26:25 For my app, I'm using TextViews for error conditions (though you might not be dealing with error conditions). Mar 19 00:26:27 TacticalJoke: error messages on login Mar 19 00:26:42 I hate it Mar 19 00:26:49 have a mbpr w/ 512gb ssd and shit Mar 19 00:27:02 lasserix the latest versions of nispok let you anchor the snack to arbitrary views, ot to the top of the screen Mar 19 00:27:12 oh cool Mar 19 00:27:13 thakns Mar 19 00:27:40 I mostly use it for skype... heh Mar 19 00:27:47 since I refuse to install skype on my pc Mar 19 00:29:29 pfn does it misbehave or something ? Mar 19 00:29:38 not like its written in java :) Mar 19 00:30:18 TacticalJoke http://www.reddit.com/r/androiddev/comments/2zh9m6/build_apps_smarter_with_archiva_and_gradle/ Mar 19 00:30:24 ah shit, wrong link Mar 19 00:30:37 http://www.reddit.com/r/androiddev/comments/2zivr4/storio_modern_api_for_sqlitedatabase_and/ Mar 19 00:32:01 not sure why anyone would downvote that, /r/androiddev is retarded Mar 19 00:35:31 I wonder whether reddit's vote fuzzing is a factor there. Mar 19 00:35:53 As far as I know, reddit automatically messes with a submission's votes to make it harder to tell whether someone's vote bot was successful. Mar 19 00:36:03 So they might add two upvotes and two downvotes. Mar 19 00:36:49 If I'm right, it's possible that that article has 3 upvotes and 0 downvotes. Mar 19 00:37:06 With fake upvotes and downvotes added by the fuzzing system. Mar 19 00:38:16 This is a quick summary: http://www.reddit.com/wiki/faq#wiki_how_is_a_submission.27s_score_determined.3F Mar 19 00:40:59 lol... Mar 19 00:41:07 I have a textview that is just going wherever it wants Mar 19 00:41:19 its in a linearlayout vertical with siblings.. Mar 19 00:41:22 its going mobile :) Mar 19 00:41:24 err horizontal Mar 19 00:41:32 yeah it’s moving fromleft to right Mar 19 00:41:52 Woop woop, app 90% done http://imgur.com/a/lZSed Mar 19 00:42:36 nice desmin88 Mar 19 00:42:45 thx Mar 19 00:43:01 good thing i dont see the luther insults in there :D Mar 19 00:43:13 lol Mar 19 00:43:18 Dag gummit. reddit is 503ing on basically all direct comment links right now. Mar 19 00:43:20 luther insult IAP Mar 19 00:43:33 as he was probably insulting catholic bishops, priests, etc Mar 19 00:45:10 This is a better explanation: http://www.reddit.com/r/explainlikeimfive/comments/mzbqn/eli5_why_are_votes_fuzzed/ Mar 19 00:48:30 umm.. with a linearlayout, items appear in the order that they appear in the XML, right? Mar 19 00:48:43 tricknology: all layouts Mar 19 00:48:51 a linearlayout Mar 19 00:48:55 tricknology: Anything you can post? You got me curious. Mar 19 00:49:05 unfortinately, no :( Mar 19 00:49:07 tricknology: im saying yes, for all layouts Mar 19 00:49:16 oh i see.. Mar 19 00:49:28 could changing things from Visible to Gone mess with that order? Mar 19 00:49:30 the xml is parsed top-to-bottom and views added Mar 19 00:49:37 tricknology: no Mar 19 00:50:11 well then.. tv0 is where it should be, tv1 is where tv2 should be Mar 19 00:50:19 tv2 is where tv1 should be Mar 19 00:50:41 tricknology: only if you call View.bringToFront(); or addView/removeView not including addViewInLayout/removeViewInLayout Mar 19 00:50:52 i am calling BringToFront Mar 19 00:50:57 that will change the order Mar 19 00:51:06 i assumed that only changed z order Mar 19 00:51:13 so i have to call those in the correct order then.. nice Mar 19 00:51:14 the z order is the child order Mar 19 00:51:25 if you want to change the z translation thats something else Mar 19 00:51:30 had no idea that would change the horixzontal order in a linearlayout Mar 19 00:51:51 tricknology: its the same in pretty much all UI toolkits Mar 19 00:52:00 TIL Mar 19 00:52:05 TIL? Mar 19 00:52:09 thanks, Napalm Mar 19 00:52:14 Today I learned Mar 19 00:52:16 ahj Mar 19 00:52:36 It’s actually your sliding views that inspired this Mar 19 00:52:46 ..this hell I’m in.. Mar 19 00:52:50 ^.^ Mar 19 00:52:51 which one? Mar 19 00:52:51 lol Mar 19 00:53:11 one of the ones you showed me, i forget Mar 19 00:53:14 ah Mar 19 00:53:20 i still need to work on my new sliding layout Mar 19 00:53:23 but I didn’t know you could do that until then Mar 19 00:54:24 Napalm what is the new sliding layout ? Mar 19 00:54:42 g00s: just some code I've been working on Mar 19 00:56:15 g00s: http://pastebin.com/usGCtaGL Mar 19 00:56:26 think of any other features you think it should have.. let me know Mar 19 00:56:40 cool, perfect. The dcs are little misleading because it says that it is to change the z order… but then “This ordering change may affect layout, if the parent container uses an order-dependent layout scheme (e.g., LinearLayout)" Mar 19 00:56:43 tricknology: That doesn't apply to everything (e.g., RelativeLayout). The documentation for View.bringToFront says this: "This ordering change may affect layout, if the parent container uses an order-dependent layout scheme (e.g., LinearLayout)." Mar 19 00:56:52 haha Mar 19 00:56:58 jinx Mar 19 00:57:04 lol Mar 19 00:57:10 relativelayout i already know will change the x-order Mar 19 00:57:11 TacticalJoke: RelativeLayout does have a z-order Mar 19 00:57:29 It has a z-order, but the vertical/horizontal order are independent of it. Mar 19 00:57:29 but since LinearLayout doesn’t it will shufle things around Mar 19 00:57:38 TacticalJoke: that is to say it respects the xml ordering Mar 19 00:57:45 unless you have something that is alignParentX Mar 19 00:58:06 the things that was didn’t move in my case Mar 19 00:58:10 thing* Mar 19 00:58:14 TacticalJoke: thats just measure/layout drawing is still affected Mar 19 00:58:33 Napalm is it a bottom sheet thing like https://github.com/soarcn/BottomSheet Mar 19 00:58:53 Drawing is still affect, but that's not what tricknology is talking about. He's talking about horizontal/vertical position. Mar 19 00:59:41 apparently im cretaing data files in /data/data/com.company.app/files/Data Mar 19 00:59:47 g00s: its just a layout.. you can do that type of thing if you want Mar 19 00:59:47 is there a way for me to browse this? Mar 19 01:00:02 i sort of want to see what my application is doing Mar 19 01:00:10 DrBenway: You can browse via "adb shell". Mar 19 01:00:21 i thought things went in /Android/com.company.app Mar 19 01:00:26 that bottom shieet thing doesnt look so bad Mar 19 01:00:34 ObjectAnimator the layout Mar 19 01:00:37 donezo Mar 19 01:00:37 Then just "cd", "ls", etc. Mar 19 01:00:49 ok Mar 19 01:00:50 sounds good Mar 19 01:01:14 im also curious of the difference why a lot of apps seems to put their data in /Android/ Mar 19 01:01:18 You might have to use "run-as com.company.app". Mar 19 01:01:29 TacticalJoke: that wont work unless you are rooted Mar 19 01:01:37 i'd prefer to have my data there to be honest Mar 19 01:01:37 What won't? Mar 19 01:01:48 browsing application data directories Mar 19 01:01:59 Napalm: That's not true -- I've never rooted any device and I can do it with no problems. Mar 19 01:02:05 great i get permission denied Mar 19 01:02:08 You have to use "run-as packagename" in such cases. Mar 19 01:02:23 run-as did it Mar 19 01:02:47 DrBenway: You can even use Tab completion in this shell. Mar 19 01:02:56 Though it doesn't look like it. Mar 19 01:03:08 yeap it's almost nice Mar 19 01:03:23 why isn't this visible from whatever linux just mounts? Mar 19 01:03:39 my filebrowser can see some of the files on the device Mar 19 01:04:13 but not those ones... Mar 19 01:04:14 I guess because of the fact that you have to use run-as to view stuff? I don't know. Mar 19 01:04:41 sounds very secure.... Mar 19 01:04:51 "you have to know the name of the package" Mar 19 01:04:55 I think it works only on "debuggable" apps. Mar 19 01:05:02 yeah, debuggable only Mar 19 01:05:07 k Mar 19 01:05:23 still it doesn't answer my question Mar 19 01:05:31 can i chose between that and something visible to the filebrowser? Mar 19 01:05:45 DrBenway: so other apps on the device cannot read your apps private files ofc Mar 19 01:05:56 i use context.getFilesDir() to get my file path Mar 19 01:06:05 hmmm... Mar 19 01:06:09 each app corresponds to a user, each permission to a group Mar 19 01:06:15 actually now that i think about it... that might be useful Mar 19 01:06:25 in my case anyway Mar 19 01:06:54 DrBenway: you can just use the file-browser built into the tools Mar 19 01:06:57 i dont mind reading... writing would suck Mar 19 01:07:34 DrBenway: Are you asking how to run a normal shell to access your /data/data/ thing? Mar 19 01:07:55 Because I can't see it working without adb and run-as magic. Mar 19 01:08:21 DrBenway: click on the "Android Device Monitor" in Android Studio toolbar and then go to the File Explorer tab Mar 19 01:08:37 you can upload and download files from there Mar 19 01:12:33 thats nice but you're missing my question Mar 19 01:13:07 i want to know why and how some application write to something that looks like a "private location" and others write to a "public location" which can be seen just by mounting the device's filesystem Mar 19 01:13:08 g00s, no, I just hate skype Mar 19 01:13:36 DrBenway: that all depends on the directory you get Mar 19 01:13:48 DrBenway: since each app runs under its own uid Mar 19 01:13:52 i use context.getFilesDir() Mar 19 01:13:59 that gives me the "private" Mar 19 01:14:01 yes Mar 19 01:14:05 what would be the "public" one? Mar 19 01:14:05 filesDir for your Context Mar 19 01:14:27 Context.getExternalFilesDir Mar 19 01:14:35 i thought that was the sd card Mar 19 01:15:01 DrBenway: it's generally on the sdcard _partition_, but the physical location depends. Mar 19 01:15:14 i want it on /Android Mar 19 01:15:47 it will be Mar 19 01:15:50 not sure what /Android is. there's an "/sdcard/Android" on many devices. or "/mnt/sdcard/Android" or a variety of others. Mar 19 01:15:50 ok Mar 19 01:16:03 DrBenway: the external storage is emulated.. see Environment.isExternalStorageEmulated Mar 19 01:16:09 when if i connect my device, it automatically mount as "internal storage" Mar 19 01:16:13 I know that we shouldn't have more than 3 views one above other cause the overdraw of the pixels. What if I have to stack a dozen of them for an animation effect ? Mar 19 01:16:22 and there's a /Android folder which seems to store files for all the apps that i have installe Mar 19 01:16:29 omg Mar 19 01:16:31 but sounds like it's the same thing Mar 19 01:16:32 ffs Mar 19 01:16:33 lol Mar 19 01:16:46 DrBenway: use Context.getExternalFilesDir Mar 19 01:16:56 will do Mar 19 01:28:12 Chainfire_ are you going to i/o this year ? Mar 19 01:28:53 g00s, i believe i/o is a lottery so no-one knows yet for sure Mar 19 01:29:03 ah, k Mar 19 01:29:59 dragorn sent this the other day, not sure you got it http://blog.sei.cmu.edu/post.cfm/enhanced-tool-securing-android-apps-075 Mar 19 01:33:05 dragorn it got cold again :| Mar 19 01:33:49 g00s: tl;dr on that page? Mar 19 01:36:41 groxx a set of tools / techniques for analyzing data flow & leakage of private info between source and sink Mar 19 01:36:52 modifications to the OS, etc Mar 19 01:37:26 hmm, i cant decide on wether to use multiple source-sets or gradle modules to seperate my mobile/tv code base.. kinda feels like modules is correct yet source-sets seems nicer to visualise in the editor Mar 19 01:38:00 groxx definitely not my area of expertise, but dragorn is expert in this stuff ;) Mar 19 01:38:27 Napalm i think modules Mar 19 01:38:37 like tv, watch, mobile Mar 19 01:38:41 soon car :( Mar 19 01:39:28 then hud, shoe, pencil, satellite, kite, etc Mar 19 01:39:54 * groxx waits for Android Tweezer™ to be able to tweet what I twoze Mar 19 01:39:58 yeah and you can have fee paid versions of all those :) Mar 19 01:47:29 nice i want one http://www.gizmag.com/speck-indoor-air-monitor/36575/ Mar 19 01:52:57 I'm using Guava Collections. Is there any way to reduce the verbosity of predicate/function definitions for the collection operations? Mar 19 01:53:18 I guess I'm asking here, because with regular Java, the answer would involve lambdas Mar 19 01:54:47 you could try retrolambda if you find the risks acceptable Mar 19 01:56:56 fwiw I've had zero problems with retrolambda. stack traces are readable, debugging works predictably, no spurious errors. plus when I decompile the code I can see that it's doing a more efficient process than I would by hand D: Mar 19 01:57:31 not to claim it's risk-free of course. but at least it's relatively mechanical, so undoing the lambdas in the future if necessary is pretty simple (if annoying) Mar 19 01:57:52 I agree with groxx, +1 for everything mentioned Mar 19 01:58:18 Hey guys! Mar 19 01:58:30 hey Mar 19 01:58:52 Eventually, the best solution might be "Switch to Kotlin". Mar 19 01:59:02 how do I update a view from a button? I'm doing myLinearLayout.setVisibility(View.VISIBLE) in onClickListener, but the view doesn't change Mar 19 01:59:03 s/Eventually, t/T/ ? Mar 19 01:59:14 heh, maybe :) Mar 19 01:59:17 I already tried running .invalidate and .postInvalidate but nothing happens Mar 19 01:59:57 Mattx: weird. should work, I would think. any other code changing its visibility? Mar 19 02:00:12 Mattx: the simple answer.. your modifying a different view Mar 19 02:00:42 is it necessary to call invalidate or postInvalidate? Mar 19 02:00:55 or should it work without it? Mar 19 02:01:01 it will work without Mar 19 02:01:02 should work without it Mar 19 02:01:07 weird Mar 19 02:01:24 i just said.. verify you are actually modifying the correct view Mar 19 02:01:50 I am, because when I rotate the screen and the view is updated the content changed Mar 19 02:01:58 no Mar 19 02:01:59 groxx, I encountered 1 dealbreaker with retrolambda so far Mar 19 02:02:00 TacticalJoke, does Kotlin work well for Android these days? Mar 19 02:02:06 groxx, I mean, absolute blocker, cannot continue Mar 19 02:02:10 the activity has android:configChanges="keyboardHidden|orientation|screenSize" in the manifest Mar 19 02:02:14 thanks groxx, appreciate the input Mar 19 02:02:25 https://github.com/orfjackal/retrolambda/issues/44 Mar 19 02:02:31 Mattx: your activity and layout are being recreated.. it still doesnt mean you are setting the visibility of the correct view Mar 19 02:02:38 unless you want to develop exclusively on linux Mar 19 02:02:54 Mattx: thats not enough.. your activity is being recrated "probably" Mar 19 02:02:57 Napalm, there is 0.001 prob I'm doing it on another view, but let me check again Mar 19 02:03:04 *recreated Mar 19 02:03:15 groxx, I mean, I suppose the option here is to not run retrolambda on dependencies Mar 19 02:03:19 AndreasL: I'm not sure. I'm waiting for Kotlin to hit 1.0 before seriously considering it, but it looks very promising (from what I've seen, anyway). Mar 19 02:03:19 Mattx: drop a few breakpoints and verify Mar 19 02:03:30 but that's kind of ugly... Mar 19 02:03:49 TacticalJoke, yeah, I've peeked at it. I like the looks of it. Mar 19 02:04:05 (btw, the button concept was a simplified version of the problem, the code runs on a runnable on the ui thread, should be the same right?) Mar 19 02:04:23 my bad if it's not the same Mar 19 02:04:57 Mattx: is there a not-visible parent view maybe? Mar 19 02:05:07 I guess I can write a PR to do the jar-to-jar processing I mentioned... Mar 19 02:05:13 but then you can't do incremental retrolambda anymore :( Mar 19 02:05:18 I'm checking that Mar 19 02:05:36 Mattx: you'll want to add smallestScreenSize|screenLayout to your configChanges btw Mar 19 02:05:54 sure? why? Mar 19 02:06:47 Isn't the configChanges thing a bad idea in general? Mar 19 02:06:50 yes Mar 19 02:06:56 but im sure Mattx knows that Mar 19 02:07:04 :| Mar 19 02:08:23 why? google uses it in its ads AdActivity activity for example Mar 19 02:09:27 yes they have to Mar 19 02:09:35 Mattx: For one thing, you should be handling activities being destroyed/recreated regardless of screen rotation. Mar 19 02:09:57 For example, Android will destroy your activities sometimes when your app is running in the background and memory is getting low. Mar 19 02:10:09 The user gets a bad experience if you're not handling this properly. Mar 19 02:10:20 hmn, I'll have to check that later Mar 19 02:10:55 (Depending on the app. I guess there are some apps that don't need to worry about this.) Mar 19 02:11:09 worst case scenario? Mar 19 02:11:20 When someone says "HeaderViews aren't being recycled", in terms of RecyclerViews, what do they mean? Because I'm using this library (https://github.com/timehop/sticky-headers-recyclerview/issues/1), and I'm having an issue where the headers it adds are showing blank spaces underneath them when I attach a new adapter to the RecyclerView. I'm just not sure if it's THAT bug that's affectin gme. Mar 19 02:12:16 For the thing I'm talking about, the worst-case scenario is that some entered data is lost (e.g., the contents of a ListView). Mar 19 02:18:52 t0astt: sounds like its going to affect you if your using a "sticky-headers-recyclerview" library Mar 19 02:19:25 But what exactly does it mean if a recyclerview isn't being recycled? Mar 19 02:19:28 that's what I don't get Mar 19 02:19:51 the headers that stick inside the recyclerview.. are not being recycled Mar 19 02:19:51 aha! got the error :) Mar 19 02:19:53 Because when I add a new adapter it adds blank spaces... so my hacky fix for my deadline is just to recreate the fragment :'( Mar 19 02:19:59 Mattx: what was it? Mar 19 02:20:04 im so close to being completely done with my app i can smell it! Mar 19 02:20:12 it was trowing an exception that was captured and silenced in another place Mar 19 02:20:16 Nice DadFoundMy_! Same with me :) Mar 19 02:20:18 this is about to be my first time ever finishing any programming project! Mar 19 02:20:26 "Only the original thread that created a view hierarchy can touch its views." Mar 19 02:20:32 I'm just waiting on VenMo to get back to me on whether or not they'll let me use their API Mar 19 02:20:36 DadFoundMy_: congrats Mar 19 02:21:02 Mattx: your trying to modify the view hierarchy off the Main thread Mar 19 02:21:37 new Handler(context.getMainLooper()).post(callback); Mar 19 02:21:40 t0astt: i would have guessed their api is public from the little i know of them Mar 19 02:21:40 pfn: interesting. yeah, I'd think not dependencies, and is there either a) a way to tell proguard to use a single case, or b) run it before proguard? Mar 19 02:21:44 I'm running the callback like this ^ Mar 19 02:22:02 this is a ui thread, I suppose not the correct one (?) Mar 19 02:22:02 pfn: I'm pet sure I've run it against an obfuscated build, but I should verify that... Mar 19 02:22:11 pet -> pretty Mar 19 02:22:13 DadFoundMy_: You need to create an account to use their API, and in the account you need to describe how your app will use it Mar 19 02:22:29 ohh Mar 19 02:22:35 that makes sense actually Mar 19 02:22:43 t0astt: it baffles my mind why that sticky headers library is so large Mar 19 02:22:55 Napalm: Why's that? Mar 19 02:23:03 "Using the API to take payments for drugs and weapons" Mar 19 02:23:28 DadFoundMy_: They thought my app is being used to sell goods/services, which it is not Mar 19 02:23:40 Mattx: use Looper.getMainLooper() Mar 19 02:23:46 DadFoundMy_: so, coffee and ball-point pens? :) Mar 19 02:24:05 JesusFreke: you caught me :( Mar 19 02:24:22 although i think im going to go with mechanical pencils Mar 19 02:24:28 Mattx: do you have multiple processes? Mar 19 02:24:59 t0astt: because it doesnt need to be that complicated or large Mar 19 02:25:20 Napalm: Do you know of any better libraries? Because this is the easiest one I found to implement Mar 19 02:25:27 Napalm, same problem with Looper.getMainLooper() I guess it is the same as context.getMainLooper() so nothing changed Mar 19 02:25:41 Mattx: are you using multiple processes? Mar 19 02:25:49 Mattx: what is the context? Mar 19 02:26:22 the activity that created the view is the context Mar 19 02:26:33 and this code is executed in an AsyncTask Mar 19 02:26:58 :| Mar 19 02:27:11 what happens? smile! Mar 19 02:27:12 :P Mar 19 02:27:31 activity -> asynctask.execute -> new Handler(Looper.getMainLooper()).post(callback); Mar 19 02:28:12 log your mainLooper before you start your Async task and after when you try and run it and verify they are the same object. Mar 19 02:29:36 I'm doing so now, thanks Mar 19 02:31:17 I swear, I must've almost DoSed reddit about five times during the making of this app. Mar 19 02:31:29 groxx, not super important to me right now, but I can work around it if I ever want to use lambdas and have a problem with obfuscation Mar 19 02:31:36 Okay, kidding, I don't have enough bandwidth. But it sure must look dodgy from their end. Mar 19 02:31:43 since I own the build system... Mar 19 02:33:20 Napalm: Does this library look better? https://github.com/eowise/recyclerview-stickyheaders Mar 19 02:34:21 pfn: yeah. but thanks, didn't know about that one :) Mar 19 02:34:29 what an idiot! I was calling callback.run(); before this handler looper thing gets executed -.- Mar 19 02:35:23 Napalm, thanks, checking the hashCode of the loopers was a good idea Mar 19 02:37:31 Looper.myLooper() == Looper.getMainLooper() should work Mar 19 02:37:46 lol checking hashcodes O.o Mar 19 02:38:15 g00s: he knows he want on the main thread.. he wasnt trying to do that Mar 19 02:38:26 ah Mar 19 02:51:26 This is awesome: http://i.imgur.com/WRrFUTi.jpg Mar 19 02:51:40 Reminds me of that "Find x" thing. :D Mar 19 02:52:52 This, I mean: http://1.bp.blogspot.com/_c1juWoVTEcs/SEi8Rau1S6I/AAAAAAAABgc/znSC4PcHi2A/s400/findx.png Mar 19 02:52:54 'come up with some working code when 16 <= api <= 22 Mar 19 02:53:02 Oops, that's cut off. Mar 19 02:53:36 g00s: can't be done. best give up 😱 Mar 19 02:55:13 TacticalJoke those stinkers never gave up release notes for preview 3 Mar 19 02:55:25 *us Mar 19 02:55:41 that's a poorly specified question Mar 19 02:56:41 Doh. Mar 19 02:56:51 I'm just gonna wait till RC1, TBH. Mar 19 02:57:53 TacticalJoke, i mean technically its correct, the best kind of correct **** ENDING LOGGING AT Thu Mar 19 02:59:58 2015