**** BEGIN LOGGING AT Tue Dec 31 02:59:58 2013 Dec 31 03:00:02 Node: if just a minute later, why not reset Alarm manager or keep your activity active&do it? Dec 31 03:00:34 to set a snooze you'd need a UI......sooooo...... Dec 31 03:01:27 Yeah, so if my MainActivity is setting the AlarmManager, and starting a Service to pop the notifcation Dec 31 03:01:42 I am just confused what to call in the snooze button Dec 31 03:02:33 what i'm saying is, if an alarm is set that someone has to interact with then even using a notification is should react to an activity...do the snooze in your activity Dec 31 03:02:51 Start a broadcastreceiver that sets an alarm Dec 31 03:04:38 canvs2321: But then wouldn't clicking on the snooze open the activity? Dec 31 03:05:28 where is the snooze in the notification? if so can't you set handlers on that? Dec 31 03:06:12 basically if they have to scroll down the notification to set a snooze, are you creating extra steps? Dec 31 03:06:15 The notification can have three actions.. One of them is snooze Dec 31 03:06:46 make a popup or something, or load an activity for those 3 actions.... Dec 31 03:08:04 Ok thanks Dec 31 03:08:15 SimonVT: Thanks.. will try that as well Dec 31 03:18:50 why the heck do android colors have two extra characters in them? instead of a regular hex color code? Dec 31 03:19:19 for alpha Dec 31 03:19:27 sorry, alpha? Dec 31 03:20:18 transparency, approximately Dec 31 03:23:36 Hello! Is there any "nested fragments" sample out there? I cannot find an "official sample" if there is any Dec 31 03:27:40 http://developer.android.com/about/versions/android-4.2.html#NestedFragments Dec 31 03:29:48 bankai_: Yeah, I've read that. But I'm having an error with my current "solution" Dec 31 03:29:58 which error Dec 31 03:32:25 Apparently, the nested fragment is created, but when I rotate my tablet, the app crashes ("Unfortunately, NameOfApp has stopped") Dec 31 03:32:38 stacktrace Dec 31 03:33:20 bankai_: I may delay a bit to have that, I am just a beginner Dec 31 03:36:21 bankai_: I think now I understand why the app is crashing Dec 31 03:37:16 I used adb logcat and the message says I cannot instantiate a Fragment with a constructor that has parameters Dec 31 03:37:28 sweet, done and done :) Dec 31 03:37:58 Well, Thanks for your help. That suggestion was enough for me. Dec 31 03:38:16 I didn't know that was a restriction for Fragments. Dec 31 03:40:13 http://developer.android.com/reference/android/app/Fragment.html Dec 31 03:41:04 bankai_: Thanks again Dec 31 03:41:09 for the reference Dec 31 03:41:39 Sometimes, all I need is a little guidance (or a good pointer) Dec 31 04:09:36 damn it; KeyChain.choosePrivateKeyAlias() isn't showing me a list of installed certs. this isn't rocket science, what could i be doing wrong Dec 31 04:15:25 so android.provider.Settings.System.putInt(resolver,Settings.System.ACCELEROMETER_ROTATION, 0) works for me to disable auto rotation, but it always gets locked to landscape when it's disabled... is there a way i can make it lock to whatever orientation the user is in? Dec 31 04:22:38 hrmmm I may not have thought this through all the way Dec 31 04:22:53 if I have an activity...it doesn't load up anything to display...just starts another activity via an intent Dec 31 04:23:00 will that mess up the back button somehow? Dec 31 04:25:37 Does anyone have any experience with SpellCheckerServices? It's not the most well documented and I'm having trouble figuring out how some simple things (like which locale getLocal() passes is decided, or listing available languages in the text/input prefs) actually get implemented Dec 31 04:31:46 prgmmax, If you finish, it won't Dec 31 04:32:08 finish? Dec 31 04:56:28 heh Dec 31 04:56:29 quick questiong uys Dec 31 04:56:48 with the level of javascript learned in code academy, could one put together a decent app? Dec 31 04:57:01 just dont know what degree of js is taught etc Dec 31 04:58:09 javascript? oh dear .... Dec 31 04:58:33 is the "com.android.internal.view" stuff open source? Dec 31 04:59:29 maqr: I think generally com.android is open, com.google is closed Dec 31 04:59:57 ah ok Dec 31 05:00:56 oh sweet, i found it Dec 31 05:04:16 hmm, for some reason i can't import "com.android.internal" stuff Dec 31 05:14:50 maqr: there are defintely internal classes, they're open source but not part of the public api Dec 31 05:17:24 ... Dec 31 05:17:26 anyone? Dec 31 05:17:32 with the level of javascript learned in code academy, could one put together a decent app? Dec 31 05:17:35 f2prateek_: i think i got it, this is apparently what you use xposed for Dec 31 05:18:30 justdl: you mean java? Dec 31 05:18:38 yes Dec 31 05:19:35 no idea what that is or what you've learnt, so yeah, sure.. why not Dec 31 05:20:42 the question is sort of ill-posed, because if you put effort into learning as you go, then it doesn't really matter how much you know beforehand Dec 31 05:28:41 it totally worked, i added my feature :) Dec 31 05:29:56 anyone know of a way to present the user with a list of installed certificates? Credential storage has System / User, I want the user to pick a cert from "User" Dec 31 05:38:33 ugh Dec 31 05:38:37 im still looking for the motivation here lol Dec 31 05:40:48 if i'm submitting a pull request to a project, is it appropriate to modify just the english strings.xml? Dec 31 05:54:53 my git diff has some windows line endings and some not :/ Dec 31 05:58:30 ugh crap; so to install a cert on the system basicConstraints=CA:true Dec 31 06:35:56 <_genuser_> hello folks. trying to use a Navigation Drawer. Google docs talk about using DrawerLayout from the Support Library. Dec 31 06:36:04 <_genuser_> is this the only way to use the nav drawer? Dec 31 06:39:49 i'm sending my first android pull request, and part of the change i had to make was to change target=android-17 to target=android-19 to make it build... given that the branch is supposed to be aimed at kitkat, does that make sense to anyone? Dec 31 06:40:04 here's my commit, if anyone wants to look: https://github.com/maqr/GravityBox/commit/35140055518cca505b79d2b1c27c8feb957c1d30 Dec 31 06:40:13 i'm pretty sure i did everything else right, but i'm not sure about that Dec 31 06:42:15 _genuser_: yes Dec 31 06:44:15 <_genuser_> JakeWharton: thanks. :) I added teh v4.support lib to my project however, it fails to resolve import android.support.v4.widget.DrawerLayout. So now I am going thru the sample code to see what's the deal. Dec 31 06:44:29 do you have the latest revision of it? Dec 31 06:44:39 <_genuser_> of the support lib? Dec 31 06:44:49 <_genuser_> I have v9, whereas the sdk mgr says latest it 19. Dec 31 06:45:24 <_genuser_> I suppose if the demo doesn't work either, I'll have to upgrade it. I hate to do that, since last time I did that it broke everything lol. Dec 31 06:46:19 update it Dec 31 06:46:42 r9 is from like summer 2012 Dec 31 06:46:49 <_genuser_> alrighty then. Dec 31 06:47:02 <_genuser_> more excited about parsing an json object. :) Dec 31 06:47:06 <_genuser_> than implementing a drawer. Dec 31 06:48:29 make Gson do that for you Dec 31 06:48:44 <_genuser_> ok, that was it. when I copy teh android-support-v4.jar from teh sample project into my proj's lib, it resolves. Which means I should update the lib so it's done properly. Dec 31 06:49:58 <_genuser_> updating. Dec 31 06:50:13 <_genuser_> what's gson? android provider json parser? Or 3rd party? Dec 31 06:50:24 <_genuser_> *provided Dec 31 06:51:08 depends on your definition of third party Dec 31 06:51:19 it's a Google library Dec 31 06:51:34 <_genuser_> I see android.util.JsonReader is an option too. Dec 31 06:52:04 <_genuser_> 3rd party is somethign I have to download and save and bundle with my proj. google provided will hopefully be managed thru sdk mgr and will just work. Dec 31 06:52:08 JsonReader and anything in the org.json package is never an option Dec 31 06:52:24 <_genuser_> what's wrong with it? Is it pretty terrible? Dec 31 06:52:28 yes Dec 31 06:52:33 <_genuser_> check. Dec 31 06:52:35 it's terrible Dec 31 06:52:53 it makes you (the programmer) do the work that a computer should do Dec 31 06:53:08 <_genuser_> ugh the google-gson lib an separate download. Dec 31 06:53:29 99.9% of the libraries of any use are not provided in sdk manager Dec 31 06:53:31 <_genuser_> but gotta like it's goals: provide simple toJson() and fromJson() .... Dec 31 06:54:20 <_genuser_> well found it's project page. will download this google-gson-2.2.4-release.zip and let's see how it goes. Dec 31 06:54:29 <_genuser_> I assume it's a jar that goes in the /lib folder. Dec 31 06:54:57 correct Dec 31 06:55:22 <_genuser_> thanks. downloaded and will use this once the drawer is working. it's a simple app pullings stats from online. so should be straight forward. Dec 31 06:56:04 <_genuser_> your previous pointers regarding a swiping tab really helped me. Dec 31 06:56:10 <_genuser_> that app is running nicely on my phone. Dec 31 06:56:29 <_genuser_> so just saying that I appreciate your help. Dec 31 06:58:24 glad it helped! Dec 31 07:00:09 <_genuser_> :) Dec 31 07:09:36 in my emulator i have assigned webcam as the rear cam - when i open the camera application in the emulator it says "Unfortumnately camera has stopped".. when i view the logcat it sayas http://pastebin.com/uxNMgThG Dec 31 07:09:44 kindly provide some inputs to proceed Dec 31 07:09:49 hwtas going wrong here ? Dec 31 07:21:18 Need advice on uploading image using POST along with other strings. Dec 31 07:23:21 ok i waited some time so i can repost Dec 31 07:23:23 in my emulator i have assigned webcam as the rear cam - when i open the camera application in the emulator it says "Unfortumnately camera has stopped".. when i view the logcat it sayas http://pastebin.com/uxNMgThG Dec 31 07:23:27 kindly provide some inputs to proceed Dec 31 07:23:31 whats going wrong here ? Dec 31 07:27:10 damn this room is so silent ! Dec 31 07:27:16 everybody gone for new year parties ? Dec 31 07:27:49 or is my question so noobish ! Dec 31 07:28:57 solofight maybe try genymotion Dec 31 07:35:40 g00s: saw the video presentation - looks cool Dec 31 07:36:37 but looks like a proprietary tool ! Dec 31 07:37:04 it is Dec 31 07:37:11 free for personal use Dec 31 07:39:53 g00s: signed up, downloading now Dec 31 07:40:20 so all the shell commands and ways of logging it similar to the standard SDK ? Dec 31 07:41:01 how good is this compared to the standard (the video says you are in complete control of gyro, gps and stuff) but am new to development and not able to understand which pain points that this solves compared to the standard SDK Dec 31 07:41:13 can you please give me an idea about it ? Dec 31 07:41:48 its much faster Dec 31 07:42:25 the free one doesn't have all the fancy things Dec 31 07:42:40 the google emu is total crap Dec 31 07:43:55 g00s: total crap = = lacking what ? Dec 31 07:45:14 well on my mac haxm was causing problems, and without that - its too slow to use Dec 31 07:45:36 I got it working!! Mostly...kind of Dec 31 07:45:41 got a funky new problem Dec 31 07:46:03 I go to my browser, click a link that my app intercepts Dec 31 07:46:31 and then it appears to exist inside the browser app, not starting an instance of my app Dec 31 07:51:29 g00s: i need a cloud account to create a virtual machine with genny ! ? Dec 31 07:51:54 thats your account you used to register Dec 31 07:52:00 yeah its a pain Dec 31 07:54:03 whoop ! every VM instance has to be downloaded (170mb) Dec 31 08:04:20 I'm trying to use jplayer in a webview... it works great to play files from an online source, but I seem to be having trouble with local files. If I put them in main > assets > www > audio, within the html which is up a level I they would be in src="audio/sound.mp3", correct? Dec 31 08:12:45 I feel old when awesome WM is more familiar to me than Gnome 3 and Unity. Dec 31 08:15:26 Hello Dec 31 08:16:04 How would I proceed if I have about a hundred methods of which I need to call one based on some input from the user? Do you use reflection or something else? Dec 31 08:16:33 The method names are very similar/identical to what the user will select. Dec 31 08:17:17 what kind of input? Dec 31 08:17:22 how do the methods differ? Dec 31 08:17:31 By writing about a hundred different calls depending on the user's input. Dec 31 08:17:35 Or by keeping a lookup table. Dec 31 08:18:32 JakeWharton, From a spinner selection Dec 31 08:19:59 enum of choices, spinner adapter backed by enum.values() array, on selection getItem(position) to get enum value and then switch on that value, call the appropriate method Dec 31 08:20:47 Does it feel right to you? Having 100 cases? Dec 31 08:21:06 What's wrong with reflection in this case? Dec 31 08:21:08 it feels wrong having to switch at all Dec 31 08:21:20 I would potentially use reflection to invoke the method rather than long and elaborate switch-case Dec 31 08:21:37 having 100 different methods with a single spinner to choose sounds... non-optimal to me to start with Dec 31 08:21:43 there's also the argument that "if" statements, which switch is a type of, do not belong in object oriented programming, but this is a rather extreme opinion Dec 31 08:21:48 don't even need that, an enum can have a method interface Dec 31 08:21:55 Leeds, There are multiple spinners but that's not really relevant Dec 31 08:22:04 I'm taking selection based on three of them Dec 31 08:22:05 I find switch-case, or if-chains to be reasonable and clear way to encode some types of functionality. Dec 31 08:23:54 for instance, I'm currently writing a small OBD reader application for my car. OBD values are binary data, there's type of data and then data value. The interpretation depends on type. I could create classes to do the interpretation or just switch on the type. Dec 31 08:24:34 100 lines of code did the trick, I believe. I would have ended up with interfaces and around 10 classes if I had done it in some more purist way. Dec 31 08:26:25 but I found someone else's project who had done a class per data item type. It looks a lot like this: https://github.com/pires/android-obd-reader/blob/master/obd-api/src/main/java/eu/lighthouselabs/obd/commands/temperature/AirIntakeTemperatureObdCommand.java Dec 31 08:28:07 i should get one of those obdII dongles / apps for my truck. does the BT really go through the firewall ? Dec 31 08:28:10 In comparison, something very similar is accomplished by my method convert(): https://github.com/alankila/android-obd/blob/master/App/src/main/java/fi/bel/android/obd/util/OBD.java Dec 31 08:29:16 g00s: I do not understand. Firewall? Dec 31 08:29:21 alankila was a happy camper to switch on strings ;) Dec 31 08:29:38 alankila the wall separating the engine compartment and the driver Dec 31 08:29:41 I'm actually unhappy that I made pids strings. I will likely change it to integer Dec 31 08:30:15 heh, not firewall like iptables :P Dec 31 08:30:39 g00s: well, if that's where your OBD-II port is, then I guess it might be a problem. Usually it's in the cockpit Dec 31 08:31:04 ah, hopefully :| Dec 31 08:31:05 in many cars, it's in or near the fuse box, or under the driving wheel, or near the gas pedals, or something Dec 31 08:31:17 with emulator - i want to upload my picture in the sd card and use it inside my application. When i search for how to access my sd card inside my emulator - i find no materials Dec 31 08:31:20 is it not possible ? Dec 31 08:31:46 there are several which talks about accessing sd card with shell and eclipse but none within the emulator itself Dec 31 08:32:25 man..this is so weird Dec 31 08:32:53 why does my app appear in the browser? Dec 31 08:33:46 but it doesn't Dec 31 08:34:00 if I hold the hardware button down to see what other apps are running it doesn't show the browser (since this is the browser, not another app) Dec 31 08:34:01 android doesn't support remote embedding Dec 31 08:34:34 it's part of the browsers task stack, maybe Dec 31 08:34:36 and if I tap the hardware button to go home, I can then hold it again and see it in the list, under the name "Internet" (the name of the browser) Dec 31 08:34:58 hrmmm sounds like it is, yeah Dec 31 08:35:29 set launch mode Dec 31 08:36:05 googling that Dec 31 08:36:07 thx Dec 31 08:43:33 just tried android:launchMode="singleTop" in the manifest for that activity Dec 31 08:43:36 no luck Dec 31 08:55:45 hrmmm yeah, I'm not sure how to set the launch properties to fix this Dec 31 09:00:38 oh! Dec 31 09:00:45 I set it ="singleInstance" and that worked Dec 31 09:00:49 not sure why but it worked Dec 31 09:27:15 hrmmm actually, that single instance isn't 100% what I want. If the app already exists, it just bring it to the foreground...doesn't parse the new address Dec 31 09:29:01 onNewIntent is what you're looking for Dec 31 09:29:29 ah k Dec 31 09:29:35 phew, this is getting complicated :) Dec 31 09:29:42 always does Dec 31 09:35:36 hi Dec 31 09:35:39 anyone around Dec 31 09:36:00 i have two questions about textviews Dec 31 09:36:24 one about setting the text of a textview with different styles of text Dec 31 09:37:06 (to this question i have found people use Html.fromHtml() Dec 31 09:37:26 but i dont think that the likes of facebook messenger use this) Dec 31 09:37:49 and the second is that, if html is used how do I append content to the textView Dec 31 09:37:54 .append is not working Dec 31 09:40:32 hello? Dec 31 09:41:07 styles are accomplished by Spannables Dec 31 09:41:47 you can't append to a textview because it renders a static String/CharSequence. You can give it a new string to render, though. Dec 31 09:42:39 anyone else ever had an issue with action bar activity not being resolved when using app compat as a dependancy in gradle? Dec 31 09:42:53 it compiles and runs fine, but AS keeps complaining the class doesn't exist >.> Dec 31 09:43:59 JakeWharton: arent spannables bad since you have to specify text length. what if its like blog where the user post has a variable length. then what? Dec 31 09:44:19 CallumTaylor: refresh the gradle model in the gradle pane Dec 31 09:44:40 yeah i do that and it fixes it, but every now and then it goes back out of sync Dec 31 09:44:50 ah well as long as its still compiling i guess Dec 31 09:44:56 Rohan_Bhangui: then you get the length of the string and use that value Dec 31 09:45:10 okay and the second part of my question Dec 31 09:45:16 how come appends are not working Dec 31 09:45:33 textview has no append method Dec 31 09:45:44 and strings are immutable Dec 31 09:46:11 SpannableStringBuilder/StringBuilder has an append method Dec 31 09:46:19 okay Dec 31 09:46:23 onNewIntent is working Dec 31 09:46:27 CallumTaylor: any exmaple you can show me? Dec 31 09:46:28 thanks for all the help, Jake Dec 31 09:46:31 *example Dec 31 09:46:40 for which one, string or spannable? Dec 31 09:46:42 CallumTaylor: except you can't pass those to TextView. You pass an immutable string or charsequence. Dec 31 09:47:02 my new problem is my debugger seems to be detaching when I close the app, and so I can't debug when the browser launches it Dec 31 09:47:10 maybe if I just don't close it, though :)...will try Dec 31 09:47:24 you can pass a spannable string builder to text view Dec 31 09:47:31 CallumTaylor: well I need to append styled text Dec 31 09:47:32 so Dec 31 09:47:36 with string builder i think you have to .toString Dec 31 09:47:41 im building a sort of blog so Dec 31 09:47:52 i need a title style and content style Dec 31 09:48:29 does the content come back as a plain text block? or can you get it as html Dec 31 09:49:12 CallumTaylor: that was my problem, i dont know how to get the html form of the "text" within the textview Dec 31 09:49:30 if I can do that, then I can use setText and then "append" it Dec 31 09:49:44 you can't because the html gets converted to spannables Dec 31 09:49:49 when using Html.fromHtml Dec 31 09:49:57 aha! i thought so Dec 31 09:50:19 so how can I get the styled content back from the textView Dec 31 09:50:19 so you want to getText from textView, slap that into a spannablestringbuilder and then you can append to it Dec 31 09:51:27 ah k yeah, if I don't close it the debugger stays attached Dec 31 09:53:11 CallumTaylor: if I wanted to store the value of getText from the textView, what is var type Dec 31 09:53:39 charsequence Dec 31 09:53:59 http://developer.android.com/reference/android/widget/TextView.html#getText() Dec 31 09:54:28 CallumTaylor: but that is just a sequence, so it wont really get the styling, no? Dec 31 09:55:16 i guess I can use an arguement right? Dec 31 10:03:25 yeah you're right Dec 31 10:03:27 http://stackoverflow.com/questions/6064487/changing-styles-in-a-textview-can-you-call-gettext-and-then-setspan Dec 31 10:03:53 do you not have a reference to the text that gets added to the text view? Dec 31 10:04:11 you may have to modify that Dec 31 10:04:16 spannables are a bitch Dec 31 10:05:23 CallumTaylor: well how it works is i press a button in a menu on the main activity, this takes me to a second activity, I add some text into 2 inputs and then press post and what should happen is the existing styled text in the textview should be concattennated with the new content from the previous activity Dec 31 10:05:40 i've done spannables before and I'm fairly sure if i wanted to change anything, i'd rebuild the whole spannable from what ever strings/objects i have Dec 31 10:05:48 but its been a while Dec 31 10:06:40 ok so best thing to do is to pass the new content back, and rebuild the whole spannable from scratch with the content from the first activity and the new content from the second Dec 31 10:08:48 CallumTaylor: wont that consume lots of mem esp when the nubmer of posts increase (sry I am trying to wrap my head around this ) Dec 31 10:09:44 you'll only be keeping a reference of the raw string, not the spannable, so it shouldn't, unless you have a string with billions of chars in it Dec 31 10:10:26 no they are tweet length posts Dec 31 10:11:39 CallumTaylor: so basically id do something like this (for getting spannable text from the textView): http://pastebin.com/tXHkGtE2 Dec 31 10:13:02 oh oh! http://www.androidpolice.com/2013/12/30/multiple-developers-seeing-influx-of-unexplained-1-star-ratings-since-launch-of-play-stores-new-quick-rating-widget/ Dec 31 10:13:27 "Developers are understandably angry given the potentially catastrophic effect this can have on the high ratings some of them have achieved." Dec 31 10:13:43 well, gotta remember we are building on rented land :) Dec 31 10:13:48 Rohan_Bhangui: read http://stackoverflow.com/questions/6064487/changing-styles-in-a-textview-can-you-call-gettext-and-then-setspan Dec 31 10:14:00 even if you modify the span it won't update the visual style of the text view Dec 31 10:14:22 so your best bet is to create the spannable again from scratch and call setText Dec 31 10:14:40 g00s: doesn't matter if you don't have any downloads :0 Dec 31 10:15:10 i have downloads, but not many ratings. Dec 31 10:19:47 <_genuser_> argh!! Dec 31 10:20:27 <_genuser_> ListView.addHeaderView(View.inflate(this, R.layout.list_header, null)); crashes. Dec 31 10:24:19 <_genuser_> nm, fixed it. Dec 31 10:28:31 Alright, I think I've gotten it all figured out. Thanks so much for the help, everyone Dec 31 10:29:11 CallumTaylor: but regarding my pastebin, was that correct (i have set the buffertype of my textView through XML to spannable) Dec 31 10:29:44 yes Dec 31 10:30:06 okay Dec 31 10:43:44 JakeWharton: still around to answer a question Dec 31 10:43:46 http://pastebin.com/vHNRvEqm Dec 31 11:00:42 hey, question any ideas on how to increase the proformance of the android emulator? I have way more machine then the emulator should require yet it still boots super slow and I never use more then 5% of my ram and cpu pegs out at like 7% utilization. Why isnt the emulator trying to use more resources? Dec 31 11:01:18 and what can I try make it perform a little better Dec 31 11:01:26 dblosevn: good to see you Dec 31 11:01:40 Rohan_Bhangui: you too :-) Dec 31 11:01:41 * Rohan_Bhangui says hello from #jquery Dec 31 11:02:09 Ya I answer questions in #jQuery, and ask them in here lol Dec 31 11:03:42 dblosevn: probably you have a multi-core machine. 1/0.07 is 14. Perhaps 16 available execution threads? Dec 31 11:03:50 Its just nervwracking, I have a core i7 4770k quad 2.9ghz cpu and 32gb ram @ 1600mhz with a nvidia 5000k 3GB DDR5 gfx card. I wpuld expect it to perform much better Dec 31 11:04:01 8 threads Dec 31 11:04:30 anyway my guess here is that the emulator is largely single-threaded and last time I looked, it's the gpu emulation that's the hard part Dec 31 11:04:59 it runs even more crappy with gpu emulation Dec 31 11:05:03 *without Dec 31 11:05:06 I recommend getting any phone at all to run your code on, and throw the emulator to hell Dec 31 11:05:18 or alternatively try x86 android Dec 31 11:05:22 ya I usually do but I left my cords at the office Dec 31 11:05:27 there's virtualbox images that run on near-native speeds Dec 31 11:05:42 cords? try pairing by bluetooth, enable adb by network, connect to 192.168.44.1 Dec 31 11:05:46 or use wi-fi if you can Dec 31 11:05:46 and my phone is dead :-( I have android x86 in vmware Dec 31 11:05:59 but I couldnt ever get adb to connect to it Dec 31 11:06:22 bt is my favorite thing to do because I have that on at all times Dec 31 11:06:34 I use adb wifi religously on my phones/tablets so I would think it should be easy to get adb to connect to the vm Dec 31 11:06:49 ah yes. In bridged networking setup at the very least it should be very easy Dec 31 11:07:09 couldnt ever figure out how to get the vm to listen for adb Dec 31 11:07:45 dblosevn: mind aiding me in some easy android stuff Dec 31 11:07:46 I can ping the vm from the host machine, but adb connect x.x.x.x:5000 never worjed Dec 31 11:08:09 Rohan_Bhangui: if I can you know I will :-) Dec 31 11:08:35 ill paste you my code let me know what you think Dec 31 11:08:52 silently wishing to myself that there was a way to customize the ShareActionProvider a little better. Dec 31 11:09:04 when I run the emulator with gpu. system.ui.core constantly crashes :-( Dec 31 11:10:05 dblosevn, just download an x86 image Dec 31 11:10:53 dblosevn: http://pastebin.com/8eHrhNRz Dec 31 11:10:57 slightly commented Dec 31 11:11:13 As mentioned above I have one, I just cant get adb to connect to it :-( what do I need to do to make adb listen for connections in the x86 vm? Dec 31 11:12:07 I go into settings, developer settings menu, and enable adb over network there Dec 31 11:12:21 aight ill look for it Dec 31 11:12:26 dblosevn, you've got the intel x86 image, start it via the AVD or IDE? Dec 31 11:12:27 it prints IP address it uses if it can work it out by some rules like if wi-fi is enabled, but if not, it binds to all interfaces, usually port 5555 Dec 31 11:12:43 the developer settings menu may need a knocking action to enable Dec 31 11:12:55 you need to tap 7 times in the "About phone" screen's last entry iirc Dec 31 11:12:59 I tried the HAX emulator and it boots ultra fast Dec 31 11:13:23 like 8 seconds fast Dec 31 11:13:38 but system.ui.core constantly crashes and its basically unuseable Dec 31 11:14:35 what about the intel image provided in the sdk manager? Dec 31 11:14:50 thats what im talking about Dec 31 11:15:05 android x86 runs great in vmware Dec 31 11:15:21 ill play with it some more and see if i can get adb to connect to it again Dec 31 11:15:37 dblosevn, what is the point of running it in vmware? Dec 31 11:16:19 so I still have access to my pc Dec 31 11:16:23 At least I keep HAXM off because it interferes with virtualbox Dec 31 11:16:52 I tried it once and then realized that my collection of other OSes wouldn't be available concurrently so that put an end to that Dec 31 11:17:10 I guess hypervisors are jealous gods and you can only keep one installed at a time Dec 31 11:17:22 ya, virtualbox screwed up my vmware network settings so I gave on it Dec 31 11:18:03 dblosevn: still around Dec 31 11:18:05 I dont have a mac and use vmware to dev for ios Dec 31 11:18:26 Rohan_Bhangui: yep what you want me to look at I opened your paste not sure where to start though Dec 31 11:18:37 well Dec 31 11:18:40 here is where i am having issue Dec 31 11:19:09 here is the task: i need to have differnt styled text (one style for title and another for content) and it needs to be in 1 textview Dec 31 11:19:14 i am geting errors Dec 31 11:19:16 dblosevn: curious, I have a mac and all I did was use xcode and the simulator back when I made some iOS shit for customer Dec 31 11:19:53 the simulator was awesome, so incredibly fast. I think it was like 10 times faster than actual devices, so there was always the risk that what flew on my screen wouldn't do on the real thing Dec 31 11:20:16 I still don't understand what you are trying to do Dec 31 11:23:55 alankila: ya my mac os vm outperforms everybodys macbook pros I have seen Dec 31 11:24:18 not going to find a quad core mac with 32gb of ram :-D Dec 31 11:26:06 Oh Dec 31 11:26:21 I read "I have a mac" for some reason, not "I don't have a mac" Dec 31 11:27:58 dblosevn: any idea Dec 31 11:28:03 nope I dont have one :-) but my mac vm is beast on this machine gave it 10GB of ram and 2 cores cpu and 1GB video ram it screams Dec 31 11:29:10 Rohan_Bhangui: you never told me your issue I still have your paste open Dec 31 11:29:27 dblosevn: that stuff doesnt work Dec 31 11:29:44 errors talk about something like charsequence.length cannot find or somethign hold Dec 31 11:29:46 hold on Dec 31 11:30:04 reading error messages precisely is one of the first things a programmer must learn Dec 31 11:30:57 I know *way* too many people who seem to have a boolean understanding of error, it's either "working" or "not working", and even if the very first line spells out the cause of the error, they won't read it. Dec 31 11:32:19 alankila, there's people who can't read stacktraces and exceptions are obscure words :D Dec 31 11:32:23 I do consulting work for some people like that. It's good for me, though, as the more helpless your customer's representatives, the less actual competence you have to show to still awe them. Dec 31 11:33:45 I do remember when I first switched to a language that always generated proper stacktraces. I remember they were irritating and confusing to look at, but I think that lasted like the first 5 times. After that, I hate any language which doesn't render proper stack traces. Dec 31 11:34:42 that language is python by the way. One makes a number of newbie mistakes in it, like accidentally overriding builtins through assigning to 'map' or 'list' or similar variables, not realizing the consequence. It was those stacktraces that I struggled to understand back then. Dec 31 11:36:21 alankila, still can't live with that whitespace indention thing Dec 31 11:38:19 Rohan_Bhangui: long story short paste me the logcat of the error :-) Dec 31 11:38:57 dblosevn: hold on i almsot resolved it i think Dec 31 11:39:00 give me a sec Dec 31 11:55:30 Hi, anyone know why this: http://pastebin.com/aP8Byczn doesn't retrieve all the website data? Dec 31 11:55:54 I just cuts off after a while Dec 31 12:03:13 dblosevn: can you confirm something for me Dec 31 12:03:25 Rohan_Bhangui: what might that be :-) Dec 31 12:03:30 when I change to another activity is the previous activity destroyed by default Dec 31 12:03:39 no Dec 31 12:04:25 okay so i sohuld be able to access a textview's content from activity1 if i go to activity2 do some stuff and return to activity1 Dec 31 12:04:30 you can still go back to the prev activity in its last state by finishing the second activity Dec 31 12:05:10 well you cant access activity 2 from activity 1 Dec 31 12:06:26 and how are you going back to activity 1 are you finishing activity 2? if so I think the activity is destroyed, not positive on that Dec 31 12:07:07 well how my thing is working right now Dec 31 12:07:21 id switch back to activty 1 with extras and pass the values activity 1 needs in as extras Dec 31 12:07:26 is i press a menu button on activity1 Dec 31 12:07:30 and then it goes to activity 2 Dec 31 12:07:34 then i enter some stuff Dec 31 12:07:38 send an intent Dec 31 12:07:41 with input cotnent Dec 31 12:07:44 and return to activty1 Dec 31 12:08:04 how do you return to activty 1? Dec 31 12:08:05 then I need to access the content that WAS in activity Dec 31 12:08:11 using an intent Dec 31 12:08:22 ok so your not finishing activity2? Dec 31 12:08:22 Intent postIntent = new Intent(this, AddPostActivity.class); Dec 31 12:08:23 startActivity(postIntent) Dec 31 12:08:31 well i am when I press abutton Dec 31 12:08:35 which returns me to activity1 Dec 31 12:08:47 i send the data from activity2 to activity1 usign an intent Dec 31 12:10:25 dblosevn: any ideas? Dec 31 12:10:43 cause i need to get the existing content from the textview in activty1 Dec 31 12:10:58 Ive done that before, but I would have to rememebr how, I am relatively new to droid dev, I think I stored a reference to the activty2 context somewhere else that all activitys had access too Dec 31 12:11:53 well i can send the existing stuff to activity2 but i rather not Dec 31 12:11:57 there is no need too Dec 31 12:12:24 ya, I figured out a way to do it, just rrying to remember what my solution was Dec 31 12:13:02 please try to remember Dec 31 12:22:10 I want to upload multipart file to a server . can I use apache file upload lib? is there anything different I have to do in android from the desktop app? (I have done and used apache file upload in desktop apps) Dec 31 12:40:32 Hi, anyone know why this: http://pastebin.com/aP8Byczn doesn't retrieve all the website data? Dec 31 12:40:37 have you tried Android Studio? Dec 31 12:40:49 is it better/lighter than Eclipse? Dec 31 13:01:16 I don't think AS is lighter -- but it is usable for making android applications Dec 31 13:02:33 meisolsson: this is a pretty bad data reading approach imho... You should use byte[] format data and hand the HTML document to a parser capable of handling it, along with the Content-Type header because it may specify the charset to use for the page Dec 31 13:03:15 or if it's XML document that comes from that page, then to XML parser of course. Dec 31 13:04:30 in general XML parsers support reading document from inputstream -- though I personally dislike this because it causes debuggability issues. Suppose the XML document is invalid -- once the parser consumed it to a point there's usually no way to find out the bytes it consumed. For this reason, I generally copy the data to a ByteArrayOutputStream just so that I can, if I need to, show what the input was Dec 31 13:18:26 alankila: Thanks for the answer, gonna test that later Dec 31 13:28:07 I wrote an apps for Android. Where user can share dirty pictures. If i release it will it be violating Android app store terms and conditions please? if yes i wont if not i will move forward. Dec 31 13:39:29 Well - Snapchat seems to do fine. Dec 31 13:42:16 http://play.google.com/about/android-developer-policies.html Dec 31 13:42:30 Nudity and Sexually Explicit Material Dec 31 13:42:30 We don't allow content that contains nudity, graphic sex acts, or sexually explicit material. We also don't allow content that drives traffic to commercial pornography sites. Dec 31 13:43:24 uh, snapchat doesn't contain any nudity or graphic sexual acts, it's just an app that lets you send photos to people. Dec 31 13:44:07 (i think i read that out of context and confused myself please excuse me) Dec 31 13:46:13 SpeedEvil, Snapchat do not allow nude pictures i think, its violation in Android app store to have apps which does nude pictures. Dec 31 13:46:25 yeah Dec 31 13:46:42 And yes - I know in principle snapchat doesn't allow nudes. Dec 31 13:46:54 But - well - I'm aware of many people who use it basically for that. Dec 31 13:47:17 If you have an app which is specifically designed to serve porn - then no, you can't put that app on play. Dec 31 13:47:17 is this the part where I ask for your snapchat handle so we can trade Dec 31 13:48:11 There is apparantly an adult appstore. But I suspect it has near zero users. Dec 31 13:48:34 If your site is reputable enough, you could offer it for straight download. Dec 31 13:50:52 Nudity and Sexually Explicit Material Dec 31 13:50:52 We don't allow content that contains nudity, graphic sex acts, or sexually explicit material. We also don't allow content that drives traffic to commercial pornography sites. Dec 31 13:50:52 Google has a zero-tolerance policy against child sexual abuse imagery. If we become aware of content with child sexual abuse imagery, we will report it to the appropriate authorities and delete the Google Accounts of those involved with the distribution. Dec 31 13:53:16 Thank you SpeedEvil Dec 31 13:53:42 storkme, that is violation Dec 31 13:54:02 storkme, its like GPL (cross finger and guess if you are violating or not) Dec 31 13:54:05 * SpeedEvil is regrettably not a child anymore. Dec 31 13:54:40 IamTrying: Stroking someone lightly with a feather, and taking a picture of it may be erotica. Dec 31 13:54:45 Using the whole chicken is porn. Dec 31 13:56:18 Why SnapChat is not being charged for doing Google Play terms and condition violation? Dec 31 13:57:27 storkme, You are excused. :) Dec 31 14:01:59 Because they say that you shouldn't send nudes. Dec 31 14:02:20 SpeedEvil, But its a Violation of Google Play terms and condition. Dec 31 14:02:29 By the users. Dec 31 14:04:08 OK - i understand. But knowing its violation then why some of them are not being charged who is breaking the Google Play terms and conditions? SpeedEvil Dec 31 14:04:53 Snapchats official posision if presumably 'oh no, we had no idea our users were doing that, as we tell them not to, and we don't log any of the images' - or similar. Dec 31 14:05:20 Also - this is not a judicial process. It's entirely at Googles whim. Dec 31 14:07:35 SpeedEvil, this is legal appstore for adults? you mean? http://www.androidcentral.com/nsfw-android-adult-app-store-mikandi-bares-even-more-and-does-it-better-version-4 Dec 31 14:07:53 I diddn't look, presumably Dec 31 14:16:37 http://mikandi.com/ - is it powered by Google corporation? Are they legally licensed or authorized to be safe? Dec 31 14:39:52 does anyone know if the implementation of SharedPreference obtains the value from disk lazily? or when you call to obtain a SharedPreference does it load all preferences to memory? Dec 31 14:40:09 hmm, good question Dec 31 14:42:01 I'm trying to decide whether or not to store all my preferences in memory up front. If SharedPreferences already does this, that'd be great. Dec 31 14:43:55 alexfu, ok, checked source Dec 31 14:44:13 Mavrik: looks like it loads everything into a Map Dec 31 14:44:15 when you get shared preferences a background thread to load all prefs is started immediately Dec 31 14:44:30 and while that's running your reads will block Dec 31 14:44:39 see SharedPreferencesImpl.java :) Dec 31 14:45:48 http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/4.4_r1/android/app/SharedPreferencesImpl.java?av=f Dec 31 14:47:06 Yeah, when you first get the sharedpreferences it loads from disk.. After that it's just a hashmap lookup Dec 31 14:47:41 That's also why they added the apply method to the editor instead of commit. Apply puts the new value in the hashmap and spins up a thread that saves to disk.. commit saves to disk before returning Dec 31 14:52:13 <_genuser_> does the emulator have internet connectivity if my dev machine does? Dec 31 14:56:47 alankila: Could you send and example? Have not been working with web in too much Dec 31 14:57:13 _genuser_, yes, it should. Dec 31 14:57:55 SimonVT: good to know about apply, thanks Dec 31 14:58:19 <_genuser_> Mavrik: thx Dec 31 15:01:31 http://stackoverflow.com/questions/19738798/android-4-4-http-api-bugs so this is annoying. Anybody know if there's a way to parse a non-standard HTTP response without forking okhttp? Dec 31 15:03:57 guess I could just use HttpClient, but urgh. Dec 31 15:06:59 meisolsson: about parsing XML? just hand the InputStream you get from URLConnection to some XML parser Dec 31 15:08:34 alankila: Ok Dec 31 15:09:58 alankila: But which would be the best option for getting the Inputstream, Apache HTTP or anything else? Dec 31 15:10:09 URLConnection is just fine Dec 31 15:10:18 android has deprecated the apache httpclient Dec 31 15:10:26 Ok Dec 31 15:11:21 the code can be as simple as someXmlParserFactory.parse(new URL(foo).openConnection().getInputStream())) though this is probably leaving something to be desired Dec 31 15:15:55 excuse me, does anyone know what the null return value of a long type from the content providers is? Dec 31 15:23:59 Looking at the retrofit samples, I don't see the interfaces actually implemented anywhere. Is it possible to use an annotated retrofit interface in a different class? Dec 31 15:28:44 I assume the implementation is created by the annotation, so I don't know how one would include the retrofit implementation without copying it to another class? Dec 31 15:31:41 The implementations are generated at compile time Dec 31 15:33:58 I believe Dec 31 15:34:16 Either way, the idea is that you just define an interface and set up RestAdapter.. Then it handles the implementation for you Dec 31 15:46:58 anyone know if you can still use apache httpclient in 4.4+ or has it been switched out for okhttp like httpurlconnection? Dec 31 15:48:10 SimonVT: Is there any way to include the implementation in another class? I'd love to be able to define my interfaces in one spot and include them? Dec 31 15:48:20 SimonVT: I mean include the interface. Dec 31 15:48:38 uh Dec 31 15:48:43 what implementation? Dec 31 15:48:57 we were discussing retrofit interfaces Dec 31 15:49:12 I don't understand the question Dec 31 15:49:37 hi, i'm using the fullscreen immersive mode in kitkat and it's working fine, but when the user presses the volume buttons, the button bar shows up and never goes away.. any way around this? Dec 31 15:49:41 SimonVT: Is there a way to define the retrofit interfaces in one class and include them in another? Dec 31 15:49:50 What does include mean Dec 31 15:50:18 SimonVT: I mean that I want to use the interface from another class. Dec 31 15:50:28 Yeah, still not making sense Dec 31 15:50:31 clear Dec 31 15:50:34 lol whoops Dec 31 15:50:37 Do you mean implement? Dec 31 15:50:39 not the terminal Dec 31 15:50:48 No, you can't implement it in another class Dec 31 15:51:04 Do you mean use? Create an instance RestAdapter Dec 31 15:51:06 SimonVT: I want to be able to make retrofit calls through a RestAdapter against the interface from a different class. Dec 31 15:52:30 I'm honestly lost Dec 31 15:52:43 You obviously can't make RestAdapter calls from your interface Dec 31 15:52:47 So it kinda has to be in another class Dec 31 15:53:28 I am having issues getting an OnClickListener to register a single tap on an ImageView to hide an ActionBar, AND implementing the PhotoView library to allow pinch zooming and panning at the same time since I cannot have multiple onclicklisteners registered for the same imageview at once Dec 31 15:53:35 SimonVT: I want to make a RestAdapter call from one class to use the interface defined in a different class. Dec 31 15:53:42 I have a post on StackOverflow if anyone wants to check it out http://stackoverflow.com/questions/20859732/override-single-tap-of-photoview Dec 31 15:53:54 Does anyone have any tips on querying all the mime data on contactscontract.RawContact.Entity for performance? Dec 31 15:55:39 So the interface is an inner class Dec 31 15:55:42 Sure, you can do that Dec 31 15:55:46 SimonVT: yes Dec 31 15:55:53 But you should put it in its own java file Dec 31 15:56:06 yiati just handle the single tap yourself in the touch listener Dec 31 15:56:11 pass it along if it's not a single tap Dec 31 15:57:44 lasserix: Yeah I guess my issue is that the PhotoView library calls requestDisallowInterceptTouchEvent(true). Is there anyway that I can have the parent TouchListener say no to that if it's a single tap? Dec 31 15:58:15 SimonVT: Got it. I was needlessly using an inner class. Dec 31 15:58:30 SimonVT: Thanks for the help. Dec 31 15:58:50 modify the photoviewer library code? Dec 31 16:13:15 so from googling, it seems creating a jdbc adapter is stupid Dec 31 16:13:21 so I need to create a webservice Dec 31 16:13:27 should I do http rest or json? Dec 31 16:14:05 and which lib to use then? the app will need to lookup data in remote postgresql and update the local sqlite Dec 31 16:14:51 also I have to somehow create a registration for users in later versions Dec 31 16:19:19 hilarious having an app that works on every version of android except 4.4 Dec 31 16:23:38 <_genuser_> guys a question: asynctasks, are they supposed to be inside the fragmentactivity class for which they'll do background work? Dec 31 16:24:17 Happy new year people from gmt +8 Dec 31 16:26:25 DarkSlay3r: 26 minutes ago! Dec 31 16:27:25 i was fashionably late Dec 31 16:28:19 #freenode-newyears Dec 31 16:30:01 I was there, I ran Dec 31 16:30:37 Why is there a channel for just new years Dec 31 16:30:49 What happens there every other 364 days of the year Dec 31 16:30:56 they plan for the next one? Dec 31 16:31:26 it's a completely unregulated channel, as an attempt to keep things like ascii art fireworks out of other channels Dec 31 16:32:10 Hang on let me get my ascii art fireworks for you guys Dec 31 16:42:39 Any idea why Retrofit would put my POST request body JSON underneath another object called nameValuePairs? Or how to stop this behavior? Dec 31 16:44:33 ColinTheShots, thanks, retrofit is just what I need Dec 31 16:45:01 My output looks like {"nameValuePairs":{"password":"test","email":"test@test"}} Dec 31 16:45:15 MindfulMonk: np Dec 31 16:55:07 Okay, I switched from passing a JSONObject to passing a Java object and Gson did the rest (pun intended). Great stuff! Dec 31 16:56:58 Unless you set another converter gson always does the rest Dec 31 17:06:11 SimonVT: I think the problem was that the JSONObject used a Converter that added the nameValuePairs part when I used it with the Body annotation Dec 31 17:07:05 If you literally passed a JSONObject instance, then it was passed through gson to create the json output Dec 31 17:07:08 Like any other java class Dec 31 17:07:17 I mean the TypedOutput for a JSONObject wasn't equal to the string version Dec 31 17:07:26 So I started rolling my own custom PinchZoomImageView for the ImageViews in my ViewPager, and and am getting OOM errors once I get so many images into my ViewPager (probably because the memory required to store the matrix transformations is big for a custom PinchZoomImageView). How can I destroy the PinchZoomImageViews whenever their Fragment in the ViewPager is not visible. Right now I am just saying "pinchZoomImageView = null" in onDestroyV Dec 31 17:07:27 iew for the fragment, but I am not sure if that is the proper way to destroy an ImageView. Dec 31 17:07:29 that would explain it Dec 31 17:07:40 tl;dr What's the proper way to destroy an ImageView when a Fragment isn't visible Dec 31 17:09:35 Here is my custom PinchZoomImageView that I took from a stackoverflow post https://gist.github.com/caseykulm/8199677 Dec 31 17:10:36 Null out your views in onDestroyView Dec 31 17:11:29 SimonVT: Alright, that's what I'm doing. Dec 31 17:11:57 SimonVT: Still seem to be getting OOM errors though, and it's definitely something to do with these new custom ImageViews Dec 31 17:11:58 Ah, the iew in onDestroyView wrapped to a new line Dec 31 17:15:07 Nulling them out just leaves them there for GC to come along and pick them up I would assume, which means if GC isn't quick enough and I keep swiping through the pager, then me nulling them out isn't going to stop the OOM Dec 31 17:15:14 That's what I think is the issue? Dec 31 17:17:37 Pretty much yeah Dec 31 17:18:27 Dafuq do I deal with this?? lol I guess I should try to write a better custom pinchzoom imageview Dec 31 17:19:32 I'm getting fairly frustrated with android Dec 31 17:19:53 let's say I have a fragment that may or may not be visible. How would this fragment send broadcasts or start services? Dec 31 17:20:03 it may or may not be attached to an activity, that is a problem Dec 31 17:20:18 Do I simply tuck ApplicationContext into some static variable so that I have some context to call these methods on? Dec 31 17:22:26 I guess so. That's what I will do. Dec 31 17:27:32 yiati: before application hits OOM, every attempt to free memory is made, including some stuff that tries to free native resources Dec 31 17:29:05 I was having no issues at all with memory before, but now I am having tons with my custom imageview, so I am going to try and do my best to make it less wasteful Dec 31 17:29:57 you may be decoding images as larger bitmaps than necessary, or may be keeping too many in memory at once. Dec 31 17:30:29 there's always largeheap though before resorting to that, it's likely a good idea to check if there isn't a memory leak type thing somewhere first Dec 31 17:30:47 fragmentation may also be an issue, meaning there is memory available but not at the allocation size requested within the heap Dec 31 17:31:29 I imagine it might hit at least pure java code, not sure if native has the same issue -- I guess it depends on if there's a fixed breakpoint in heap or if it's mmap'd Dec 31 17:32:14 how do I decode it as a smaller bitmap? Dec 31 17:32:29 just reduce the amount of zoom allowed? Dec 31 17:32:31 but really, I'm truly confused about fragments. I have a fragment that manages connection to a bluetooth device -- it is the UI that user interacts with. There are things like status display in it, and when connection occurs it kicks the ball forwards by starting a service that begins polling the device at the other end of the connection Dec 31 17:32:52 now if fragment is not attached to activity, this rips it off the context... but also, if fragment is not attached to activity it can't use a callback design either because there's nothing to callback Dec 31 17:33:19 I'm just kinda not understanding how to write applications in android that use any of these platform-managed objects, they have this inconvenient habit of vanishing when I want to use them Dec 31 17:33:50 now if android didn't eagerly detach the fragment from activity I wouldn't have a problem but I guess it does that as side effect of back button press that rolls back the fragmenttransaction that brought it into view Dec 31 17:34:14 I just ... don't understand how to work with this. I always seem to need static shit because all the platform crap just isn't there when I need it Dec 31 17:35:21 anyway if applicationcontext usage isn't too clumsy or weird then that solves the problem, I can just set that up in the activity and then, hopefully, forget all about problems like this Dec 31 17:36:13 yiati: well you have to use the bitmapfactory's options stuff to determine decoding bounds and scale Dec 31 17:36:40 yiati: the bitmap is likely always completely decoded in memory even if you only showed a small thumbnail of it unless you are actively taking care of issues like this Dec 31 17:39:28 * alankila would *really* appreciate it if fragments were contexts. Or if there was a static context you could always use that would support the most basic shit like startService, sendBroadcast, etc. It's just plain weird that there is *no* static context provided for things that are truly static like the assetmanager. Enough ranting though. I'll just try to get by via hacking. Dec 31 17:39:56 but stuff like AssetManager.getInstance() would be nice. Dec 31 17:41:46 can't you just call getActivity or whatever Dec 31 17:42:00 I would, but the fragment may not be attached to the activity when something happens in the bluetooth connection Dec 31 17:42:36 I guess it's my fault of putting any logic in the fragment at all, but then again I'm not sure *what* should be managing the connection. A service? It's all just a jumble in my mind at this point Dec 31 17:42:38 you can have a fragment up without an activity? Dec 31 17:42:48 no Dec 31 17:42:59 Well the fragment is created and retained in memory, it sometimes exists without an activity attached to it Dec 31 17:43:09 erm Dec 31 17:43:11 that seems wrong Dec 31 17:43:12 for instance if a screen rotation occurs, the activity goes away, the fragment stays, a new activity attaches to it Dec 31 17:43:15 like a service should be doing that Dec 31 17:43:17 but I could be wrong Dec 31 17:43:19 alankila is right Dec 31 17:43:46 I see Dec 31 17:43:49 that's a weird situation Dec 31 17:44:24 it's just mighty inconvenient that if something happens when the fragment happens to be detached, the fragment has no activity to call anything on Dec 31 17:44:47 the idea is, I guess, that fragments don't receive commands from e.g. background threads they have started which force them to react outside user input Dec 31 17:45:27 so maybe I should create a service and remove any logic from fragment... I don't know. I really hate working with android. Dec 31 17:45:47 Is it possible you can make it happen in the Activity and pass any knowledge needed for UI changes down to the fragment Dec 31 17:46:03 It might be possible but then I have to implement the state saving stuff also in the activity Dec 31 17:46:11 fragment, being retained, is always the same instance, so it's more convenient Dec 31 17:46:35 it sounds like what you really want it a layer that's essentially always available, even though your fragment might not be (rotation events or whatever) ? Dec 31 17:47:05 storkme: kinda, but fragments *are* that. They can be retained and reattached, which makes them infinitely superior to activities in my mind. Dec 31 17:47:26 it's just that while not connected to an activity, they don't naturally have any context at all, so if something happens then I have a problem Dec 31 17:47:41 I was under the impression that if the activity holding a fragment was killed, the fragment itself is destroyed and recreated. Dec 31 17:47:54 careful about your words. killing is a task-level operation Dec 31 17:48:00 nothing in the task survives that for sure Dec 31 17:48:10 storkme, there are cases when fragment code will execute after it was detached from activity Dec 31 17:48:19 (e.g. poorly designed callbacks) Dec 31 17:48:22 point taken, I mean destroyed&recreated. Dec 31 17:48:30 getActivity() will return null in that case Dec 31 17:48:45 anyway, I don't really understand this part of android. Every time I write application I run into trouble and then I kludge around mindlessly and eventually have something that no longer crashes Dec 31 17:48:56 it's dirty and doesn't do things as it should, and that's been every application I've ever made Dec 31 17:49:08 it gets easier, I think... Dec 31 17:50:05 to ensure that fragments are retained, I'm actually not leaving that up to android. All the fragments I have are in a static List that is independent of the activity. As long as the task is alive, every fragment is certainly the same. I love this shit. Dec 31 17:50:14 alankila, using message-bus design and clear separation of concerns usually does really well in those cases :) Dec 31 17:50:26 ^ Dec 31 17:50:37 Mavrik: I've tried something like that but one of the problems with android is that if your broadcast receiver is not running then the message vanishes up the thin air Dec 31 17:50:39 the way I'm currently writing apps is by treating ui components as completely transient. All asynchronous data is delivered to *something else*, and that something else forwards the data to the fragment when the fragment tells it "i'm available" Dec 31 17:50:47 there is no reliable queue in android, unless you count sticky intents Dec 31 17:50:55 the 'something else' usually ends up being the Otto event bus Dec 31 17:50:58 and android punishes you by requiring permission for them Dec 31 17:51:23 my general feeling with android is that *every* route to sane application design is blocked. It just doesn't mesh with the way I write shit. Dec 31 17:52:01 It isn't the easy path no Dec 31 17:52:10 storkme: okay, that might work, but it sounds like a pile of extra code just to work around something that shouldn't even be a problem imho Dec 31 17:52:42 I'm not gonna argue with you there, every time I do it I sort of thing to myself ".... really?" Dec 31 17:52:58 would be interested to know if somebody has any better suggestions Dec 31 17:53:38 alankila, hmm, I think there's something rather fundamentally problematic in your app design Dec 31 17:54:03 the transience of Activity vs. Fragments can be a minor annoyance Dec 31 17:54:17 It's just the way android doesn't keep activities, fragments, or views around statically like a sane thing, but rather insists on creating and destroying them willy-nilly, making everything doubly hard for no really good reason Dec 31 17:54:27 but I really wouldn't go so far as to call that "prevents sane application design" :) Dec 31 17:55:22 alankila, hmm, I've never found that to be a serious problem Dec 31 17:55:30 rule one of android development: if you're not strictly on the main thread, never trust a UI component to be there when you want it to. Dec 31 17:55:42 All my own stuff I can manage, it's just that whenever I hit android's platform-managed objects, it's just instantly becoming a hit and miss. I end up rewriting same trivial pieces of functionality several times trying to find a way it's supposed to be done and I don't think I've ever found out how it's supposed to be done Dec 31 17:55:43 ^ Dec 31 17:55:51 there are only a few times when you really need an Activity as a Context, other times the Application context does way better Dec 31 17:56:15 it took me a very long time to learn that and I wish somebody had just slapped me in the face with it when I started Dec 31 17:56:18 but yeah a static applicationcontext fixes all my problems Dec 31 17:56:20 it's just weird Dec 31 17:56:36 well, all problems at this point of time Dec 31 17:56:37 It would be bad is they kept activities, fragments, or views around statically by default. You can opt to do it yourself statically, but eventually asynchronous stuff will catch up to you, and it's not worth it Dec 31 17:56:39 no doubt I'll run into more Dec 31 17:57:01 I usually end up overriding Application (but really that's just a preference thing, it's basically just a singleton) Dec 31 17:57:02 wait, do I need to be slapped in the face? when I'm in an activity and someone asks me for a context, I always pass this. is that bad? Dec 31 17:57:12 alankila, e.g. like your Bluetooth example: I usually solve that by having a dedicated class that only managed bluetooth and has an Application context reference Dec 31 17:57:19 durka42: no, that's just fine. Activities work just that way Dec 31 17:57:23 durka42, depends. Dec 31 17:57:30 lol Dec 31 17:57:31 durka42: if that somebody is going to be executing in a new thread, then yes. Dec 31 17:57:32 Mavrik: right. It sounds like what I should do. Dec 31 17:57:40 durka42, if you're leaking Activity reference, you should be slapped on the hand :P Dec 31 17:57:50 ah yes, don't leak activity references and never store them anywhere Dec 31 17:57:56 hmm Dec 31 17:58:03 I might be leaking an activity reference Dec 31 17:58:06 that's another rule of android, never store anything anywhere if you can avoid it... with the possible exception of some simple view-related classes Dec 31 17:58:09 alankila, for app-related events I use either EventBus or Otto where I can just unregister when Fragment detaches which solves most of my "event happend after Fragment has been detached" issues Dec 31 17:58:12 somebody get the glue Dec 31 17:58:20 oh noes Dec 31 17:59:30 I guess I'll work on the shit some more... but that's on another day Dec 31 17:59:34 I think I'll drink some wine now Dec 31 17:59:39 :)) Dec 31 17:59:51 happy new year! :) Dec 31 17:59:59 fwiw, this is the gist of my Application class http://pastie.org/8590118 Dec 31 18:00:00 you too Dec 31 18:00:04 and just come here to get ideas how to kick Android in submission ;) Dec 31 18:00:36 from anywhere in the app I just call MyApplication.get(this).getWhatever() Dec 31 18:01:18 storkme: what an odd person. I'd just have Db9Application.get() or something Dec 31 18:01:29 there's a "getApplicationContext()" on every context :) Dec 31 18:01:51 storkme: what use case would be that useful for? Fragment has references to Activities already and Activities have references to application already as well... Dec 31 18:02:07 alexfu: fragments can't reference activities *at all times*. They may be detached from an activity. Dec 31 18:02:25 it's not *useful* per se, it's just a lot less verbose than doing ((MyApplication)getActivity()).getApplication() Dec 31 18:02:37 (s/a lot/a tiny bit/) Dec 31 18:02:43 just make your application class a singleton Dec 31 18:02:48 and then just MyApplication.getInstance() Dec 31 18:03:10 alankila: he/she is doing frag.getActivity() anyway Dec 31 18:07:51 I have never experienced my fragments being without an activity.. not yet, anyway. Dec 31 18:10:13 Then you either do proper non-static Android programming passing context and all, or you don't do much async stuff Dec 31 18:12:33 fragments can be without an activity anytime before/after onAttach/onDetach Dec 31 18:20:36 http://pastebin.com/86MxZbpK Dec 31 18:21:10 can someone take look at this.. I am trying to return to a fragment from another intent ( qrcode scan )... but I get returned to the parent activity Dec 31 18:21:24 actually, parent activity and fragment Dec 31 18:48:48 how come when I do: adb logcat org.my.app.package:D Dec 31 18:48:52 it prints everything Dec 31 18:48:56 instead of filtering to just my app Dec 31 18:59:31 i wonder if anyone can help me Dec 31 19:00:05 i'm trying to get a string from resources in Application.onCreate, but I'm getting some bug reports from some users where there's a null pointer exception because the Resources returned are null Dec 31 19:00:19 are you supposed to not access the resources in Application.onCreate? Dec 31 19:02:54 anyone here with some clue on how to use fragments... I am calling an intent from a frag, but when it returns, it goes to the very first fragment. Dec 31 19:03:03 I detail question and code here... Dec 31 19:03:05 http://pastebin.com/86MxZbpK Dec 31 19:09:39 IrishGringo: from the looks of it you're probably not adding the fragments correctly Dec 31 19:09:48 when the activity starts, how do you add the fragments? Dec 31 19:10:29 when done correctly, the activity result will be returned to the fragment that calls startActivityForResult Dec 31 19:11:14 if it's being sent to a different fragment there's a bug in how you are handling the fragments Dec 31 19:12:18 IrishGringo: looking at your code, it looks like you are calling setContentView for the second fragment? Dec 31 19:12:47 this is the incorrect way to do this. If you have multiple fragments you're showing, one after the other, you would get the FragmentManager and add the fragments in a transaction Dec 31 19:12:49 yes... I call setContentView from the second view Dec 31 19:13:19 ahhh... ok... I will look at this. Dec 31 19:13:22 that's probably your issue Dec 31 19:13:49 read up here: https://developer.android.com/guide/components/fragments.html Dec 31 19:14:13 well... just fyi... I am doing a connect the dots kind of system... in steps... with back buttons... Dec 31 19:14:18 what you would do is add a view to the activity that's just a container Dec 31 19:14:29 so, when the activity first starts and it's not resuming state Dec 31 19:14:58 you would call getFragmentManager().beginTransaction().add(fragment, containerId).commit(). Dec 31 19:15:05 when you add the second fragment, you would do Dec 31 19:15:37 I'm looking for sample code Dec 31 19:16:05 getFragmentManager().beginTransaction().addToBackStack(null).replace(containerId, secondFragment).commit() Dec 31 19:16:18 what that does is replaces the current fragment with your second fragment Dec 31 19:16:24 and also adds it to the back stack Dec 31 19:16:35 so when the user clicks back it'll "undo" that transaction Dec 31 19:16:42 which would just bring it back to the first fragment Dec 31 19:16:50 so when I return from the Scanning intent, it will return to the last fragment? Dec 31 19:17:10 it returns to the fragment which called startActivityForResult Dec 31 19:17:22 That is exactly what i need then Dec 31 19:17:42 your issue was that you were calling setContentView twice, and you just got a weird result Dec 31 19:17:59 the fragmentmanager assigned the same id to both fragments, so it returned the result to the first fragment Dec 31 19:18:05 this was just a coincidence Dec 31 19:18:35 for containtID, can I use this? Dec 31 19:18:48 you need to use the view id for the view you're placing it in Dec 31 19:21:26 this is my router code I have so far... perhaps you could give me another hint.. http://pastebin.com/RE1PQB0S Dec 31 19:21:27 for instance, you could make your main layout http://pastebin.com/kNEgBspU Dec 31 19:21:41 in your activity onCreate Dec 31 19:22:01 you would call setContentView(layout_id) Dec 31 19:22:08 layout_id is the name of the layout file Dec 31 19:22:17 which if you use android's default, would be R.layout.main Dec 31 19:22:31 the framelayout there is your fragment container Dec 31 19:22:34 these names are the best ever Dec 31 19:22:41 __v01__s11 Dec 31 19:22:54 I guess like 11th step of the first view. So descriptive. Dec 31 19:23:07 I remember once debugging a script called EN0019b.pl Dec 31 19:23:09 for what i said, containerId would be R.id.fragmentContainer if you were to use the layout code i pasted Dec 31 19:23:13 yep... that is the idea... and it gets much messier Dec 31 19:23:32 which would be the english-language view 19 b, though I later learnt that the screens were numbered like that in the original and thus the programmer had justification for it Dec 31 19:24:03 IrishGringo: basically, the fragment is placed inside the FrameLayout by passing the id for that, so all the fragments content will be inside that FrameLayout Dec 31 19:24:42 what's the easiest way to parse HTTP headers? i.e. keep reading string data until you hit "\r\n\r\n" but don't over-read because the rest of the data could be binary. Dec 31 19:25:14 IrishGringo: remove the setContentViews and replace it with the fragmentManager stuff Dec 31 19:25:28 lagann: so in your example, the fragmentID ( aka container ) fragmentContainer Dec 31 19:25:47 yeah, that's the view that the fragment will be put into, hence, a container Dec 31 19:26:52 storkme: easiest? that is a little bit of a challenge. I guess a BufferedReader could do it. Just stop on the first line that has just \r Dec 31 19:27:00 or maybe BR can be setup to use a different line separator Dec 31 19:28:02 doesn't work, as far as I can tell the BufferedReader is reading in too much data even after I stop calling readLine() Dec 31 19:28:09 looks like BufferedReader is smart, it can handle any line termination sequence Dec 31 19:28:15 oh it has shit buffered in it Dec 31 19:28:15 the data I need is stuck in its internal buffer Dec 31 19:28:20 you're stuck with that abstraction once you take it Dec 31 19:28:44 I don't think BR is right abstraction to be honest Dec 31 19:28:58 the main problem is that you have to provide charset for it before you know what charset to use Dec 31 19:29:18 IrishGringo: do you get it? Dec 31 19:29:32 it's not too difficult a concept once you look at it Dec 31 19:29:50 I can't think of anything better except read everything into a bytearray and then look for the 0d0a0d0a sequence in it Dec 31 19:29:53 then split it there Dec 31 19:30:12 yeah, that's what I'm thinking about doing. Dec 31 19:30:21 would rather not though obviously Dec 31 19:31:05 lagann: I am experimenting with your code... Dec 31 19:31:38 lagann: I remember seeing some stuff about fragman last week... so I need to figure this out anyway Dec 31 19:35:05 lagann: http://pastebin.com/3d5q1xm0 I am doing something wrong Dec 31 19:43:09 is "adb logcat packagename:D" broken? Dec 31 19:43:13 it doesn't seem to actually filter anything out Dec 31 19:44:57 that working depends on device firmware really Dec 31 19:45:05 doesn't work on most :- Dec 31 19:47:00 lagann: I am thinking that I need to add a Frame for the fragment for this activity. My code is diff from your example as there is no android:id="@+id/fragmentContainer" Dec 31 19:47:03 android:layout_width="match_parent" Dec 31 19:47:05 android:layout_height="match_parent" /> Dec 31 19:54:54 Hi, i'm trying to change a Fragment that works to a ListFragment, but I keep getting a strange error: "you must have a ListView whose contents has R.id.list" even though I do. Here's the XML: http://pastebin.com/AzGnNcRk here's the java: http://pastebin.com/snRDxCm9 and here's the stacktrace: http://pastebin.com/f9qXqtKH Dec 31 20:00:20 se_busca_ayuda: @+id/list is not the same as android.R.id.list Dec 31 20:00:33 goddamn android studio. It seems to have forgot how to deploy the app to android device Dec 31 20:00:47 yep, have had that problem Dec 31 20:01:05 durka42: holy crap, are you serious? no wonder i've been getting null pointer exceptions Dec 31 20:01:21 i mean runtime exceptions Dec 31 20:01:39 se_busca_ayuda: yes, android.R.id is for android.R.layout stuff and like. Dec 31 20:02:14 so what do I do? Dec 31 20:02:22 http://stackoverflow.com/questions/7082888/what-is-better-android-r-or-custom-r Dec 31 20:02:31 besdies going back to the documentation XD Dec 31 20:02:40 so bizarre, now I can't deploy app from android studio at all Dec 31 20:02:58 se_busca_ayuda: I think you just want to do android:id="@android:id/list" Dec 31 20:03:16 okay I think I just had to create a new deployment configuration ... Dec 31 20:03:24 wonder what the hell happened with the old one Dec 31 20:03:41 probably corrupted by cosmic rays Dec 31 20:04:52 durka42: that says "error: Error: No resource found that matches the given name (at 'id' with value '@id/list')." Dec 31 20:05:06 @+id/list may be the right thing Dec 31 20:05:16 this thing sucks pretty much totally, but it is what it is Dec 31 20:05:35 oh was I completely wrong Dec 31 20:05:42 I thought @+id/list would create a new entry in your app's R Dec 31 20:05:47 @+ does Dec 31 20:05:51 that's the point of it Dec 31 20:06:20 I still don't understand why it's even necessary. IDs have never been difficult, what the hell is wrong with android when something like is not enough Dec 31 20:06:32 durka42: i'm trying to use the hex code for R.id.list brb Dec 31 20:06:48 alankila: yep. the current system allows for IDE autocompletion though Dec 31 20:07:08 Well figured out the issue with the intel emulator, now I got anohter question, is there a way to pick which gpu is used for acceleration? Dec 31 20:07:10 se_busca_ayuda: well that seems it can't be the solution Dec 31 20:07:50 se_busca_ayuda: http://stackoverflow.com/questions/14205540/listfragment-runtimeexception-android-r-id-list-missing-resolved Dec 31 20:08:16 It seems the emulator is using my integrated gpu but Im not sure I would rather it use the nvidia card instead Dec 31 20:08:29 dblosevn: I bet that's totally up to the OS Dec 31 20:08:31 Can anybody help me with some camera image orientation issues? My preview image orients itself fine, as do the generated thumbnails on the filesystem. However, the image data itself seems to be stuck in portrait mode, and every way I try I can't seem to tell it not to do that Dec 31 20:08:51 Camera.setRotation seems to have no effect all Dec 31 20:08:52 durka42: hold on, reading the listfragment doc again Dec 31 20:08:58 these switching systems in general are transparent to applications. Dec 31 20:09:06 I wish I could just turn off the integrated one :-( but then I cant have 4 montiors Dec 31 20:09:16 Here's my code: http://pastie.org/private/9jajqzraffqe5puyul4w Dec 31 20:09:32 dblosevn: heh. It must be amazing to you that I work with a single 11" laptop. Dec 31 20:09:36 fuck kitkat for real. Dec 31 20:09:59 I'm so made about them breaking HttpUrlConnection Dec 31 20:10:07 storkme: what, did they break it again? Dec 31 20:10:13 alankila: this is a laptop :-) 17.3 inch 10 point multi touch display and 3 23" IPS panels Dec 31 20:10:25 durka42: now i'm receiving a different error. using the hex code seems to have worked Dec 31 20:10:47 seems like a fragile hack though Dec 31 20:10:50 se_busca_ayuda: don't use the hex codes manually, they get regen'd all the time, that's brittle. You should just reference the right R.id constant Dec 31 20:10:57 whether android.R.id or your own R.id Dec 31 20:11:29 i'll make a final int = 0x0102000a Dec 31 20:11:41 lol some peoples kids Dec 31 20:12:30 that's just as bad Dec 31 20:13:08 right ok, i'll take care of that Dec 31 20:13:17 I kinda hate the whole R.string.foo being a number. I end up doing these R.string.class.getField(foo).get(null) things way too often Dec 31 20:13:44 providing a dictionary from String to the number would be appreciated, at least by me Dec 31 20:13:50 getStringResource? Dec 31 20:13:52 I want a small laptop though Dec 31 20:14:04 well there is a method for it, I know it... but I forget what it's called every time I need it Dec 31 20:14:13 this is a beast to try to take on a plane Dec 31 20:15:09 11lbs and huge, and doesnt fit really in the seats Dec 31 20:16:28 but it is a powerhorse, 2.9ghz core i7 quad with 32gb ram and still manages 4 hours on battery :-) Dec 31 20:17:14 I've decided that even the lowest end laptop is basically powerful enough so I value portability and battery life now Dec 31 20:17:26 got 7-8 hours out of the macbook when in light programming-like usage Dec 31 20:17:44 at the lowest display brightness though Dec 31 20:17:57 the thing weighs like 1.1 kg Dec 31 20:18:04 ya I dim mine halfway when I know im going to be away from power for a while Dec 31 20:18:15 the laptop bag I carry it in weighs more than the actual laptop Dec 31 20:18:21 and have an extra battery on standby lol Dec 31 20:18:40 I still cant find a bag this fits in :-( I carry it in my suitcase lmao Dec 31 20:19:14 I often wish I had a bag that was tailor made for 11" laptop with just a small pouch to hold the power adapter, but I haven't found anything suitable Dec 31 20:19:19 Ive tried like 4 of them that swear they fit a 17.3 inch machine but it never fits Dec 31 20:19:52 the more accidents I have with laptop bags, the more picky I get with the bag I can trust. I lost a good laptop to rainwater because one didn't have a proper covering and the water seeped into the machine through the exposed zip Dec 31 20:20:08 I nearly lost two computers when the carrying strip broke and the bag fell to the ground corner first Dec 31 20:20:53 so now I have a bag that has several folds' worth of protection against water falling down on it and a carrying strip that circles the bag all around rather than being sewn to it Dec 31 20:21:02 just broke the strap on my bag a couple weeks ago, landed face first on the compartment my android tablet and ipad were in in the nasty snow and ice Dec 31 20:22:21 the metal part of the strap got so cold it just snapped sitting in the trunk of the car, when I picked it up after it broke I barely put any pressure on it and it broke again Dec 31 20:27:14 it's weird that android doesn't really show good examples of adding fragments to views with frames Dec 31 20:28:54 my question is about ListActivity that has TextEdit and ListView, i want to change ListView at runtime deppending upon what is entered in TextEdit. how i can do this? Dec 31 20:29:15 update the adapter for the listview Dec 31 20:29:23 then do a .notifyDataSetChanged() Dec 31 20:30:23 jaynewstrom, ic, thanks for nice, quick answer Dec 31 21:01:58 hi Dec 31 21:02:15 when installing my app on a nexus 5, I have "INSTALL_FAILED_UID_CHANGED" error Dec 31 21:02:58 im using eclipse, app was already installed and eclipse offered to uninstall it for me (different signatures due to multiple dev stations) Dec 31 21:09:30 using adb logcat I found a warning "No content provider found for permission revoke: file:///data/locale/tmp/xxx.apk Dec 31 21:12:35 So i ran into another problem. My listView adapter is giving me a NullPointerException. I think i'm missing something basic about Java here. Here's the java: http://pastebin.com/GH7cNveM here's the stacktrace: http://pastebin.com/rjAmTe1d Dec 31 21:19:27 am I understanding the docs correctly, that I could put a subclass of SurfaceView in my layout xml, and calling setVisibility will correspond to surfaceCreated/surfaceDestroyed? Dec 31 21:21:02 durka42: iirc xml layouts are permanently constructed Dec 31 21:23:57 well that was a MAJOR pain in the ass. i got the NDK code working right and after removing all the java code it replaces i got all the other code working with the native lib... Dec 31 21:26:24 well thers still one bug that i know of but meh whose counting :P Dec 31 21:26:55 what's a bug or three hundred between friends Dec 31 21:27:48 exactly! Dec 31 21:28:05 if i could have done this in forth like i wanted to it would have been done long before now :/ Dec 31 21:30:58 Day 22 of youtube player api hard crashes. Supplies running low, google documentation nonexistent. Dec 31 21:31:13 Don't know much longer we can survive. Dec 31 21:31:27 Ok, but seriously. Does anybody have experience working with the youtube player api? Dec 31 21:31:33 chinese helicopters on the way Dec 31 21:37:50 desmin88: how is morale with the troops? Dec 31 21:38:03 lol Dec 31 21:38:07 morale extremely low. Dec 31 21:38:25 infighting, everyone's on edge Dec 31 21:39:01 mhm Dec 31 21:40:26 i heard a captain lost control of his men, and now they're a roving band of viruswriters Dec 31 21:40:31 lol Dec 31 21:41:12 considering google has limited docs on this, nobody knows what the library is really, and the only thing on the net is people getting the error but not solving it Dec 31 21:41:45 i may have to just provide a thumbnail/play button to open it in a browser or yt app Dec 31 21:42:02 * se_busca_ayuda nods Dec 31 21:42:14 thats what intents are for. now if only you can figure out what the intent callsign is... Dec 31 21:43:06 when you figure it out, you can add improvements and change it to be the way you originally wanted. the users will hail you as a hero. they'll carry you on their shoulders and cry "huzzah" Dec 31 21:43:23 women will swoon, men will chant your name with spittle flying from their mouths Dec 31 21:43:39 lol Dec 31 21:49:24 use Dec 31 21:49:28 intent intercept Dec 31 21:49:49 *the app Dec 31 22:13:14 welp, I've just had to implement my first workaround for a newer version of android :) Dec 31 22:13:28 heh Dec 31 22:13:32 for HttpUrlConnection? Dec 31 22:13:47 aye Dec 31 22:14:07 use okhttp! Dec 31 22:15:45 doesn't work Dec 31 22:15:52 that's where the problem came from Dec 31 22:16:39 oh. Dec 31 22:16:44 I'm just gonna go ahead and blame you for this JakeWharton (okhttp doesn't non-standard http responses (like shoutcast streams)) (I'm so mad at you) (just kidding please fix it I love you) Dec 31 22:17:12 doesn't what Dec 31 22:17:21 support** Dec 31 22:17:24 excuse me. Dec 31 22:17:31 hehe ;) Dec 31 22:17:47 How many of you test on the nexus 5 ? Dec 31 22:18:01 not me Dec 31 22:18:03 i do Dec 31 22:18:24 I have a 4.4 device, and 4.0 device and a 2.2 device then i fill in the gaps with my emulator Dec 31 22:19:52 storkme: wat Dec 31 22:20:23 storkme: elaborate Dec 31 22:20:43 JakeWharton: shoutcast servers return ICY as the protocol instead of HTTP/1.1 Dec 31 22:21:12 also they have slightly non-standard headers, but in all other respects they conform to HTTP Dec 31 22:21:50 Sound dumb. What's the benefit? Dec 31 22:22:12 the benefit is not having to write your own http parser Dec 31 22:22:50 Wouldn't that be a benefit of using HTTP directly? Dec 31 22:23:24 How to other clients consume? Dec 31 22:24:03 holy what the hell Dec 31 22:24:14 im talking to a guy who doesnt use more than 1 activity or fragment. Dec 31 22:24:21 you're right yeah that'd be a pretty huge benefit from where I'm sitting :p the regular android HttpUrlConnection was fine with these non standard responses (it would return statusCode -1 and statusMessage null) but with OkHttp (or android 4.4 since that uses okhttp(?)) it throws an error Dec 31 22:24:33 he has a 3000 line layout xml file, where he hides and displays different parts of the views as needed. Dec 31 22:24:58 desmin88: I use one activity and no fragments Dec 31 22:25:10 yeah but do you do the second part Dec 31 22:25:12 is what i meant Dec 31 22:25:41 storkme: interesting. Yes 4.4 uses okhttp under the hood. Dec 31 22:25:46 I'd be happy to submit a bug report if it's something you care about at all. Dec 31 22:25:56 desmin88: no! Dec 31 22:26:08 storkme: yes. Please Dec 31 22:26:17 hithub page for okhttp? Dec 31 22:26:28 square/okhttp Dec 31 22:26:39 I mean, I'm not asking where it is, I'm asking if that's where you want me to submit the report. Thanks. Dec 31 22:26:47 On mobile or I'd link Dec 31 22:26:55 Oh, yeah Dec 31 22:27:05 much appreciated. Dec 31 22:28:08 desmin88, if you're gonna work with him you're off to a great new year's start :) Dec 31 22:28:22 lol no Dec 31 22:52:59 Whats the best way to tell my webview to scale images/text into the screen width to prevent horizontal scrolling Dec 31 22:53:08 now that single column/narrow column is deprecated Dec 31 22:53:52 does anyone have some good examples of how to swap one fragment for a second fragment in an intent? I have been studying the docs and its not very clear. Dec 31 22:54:09 or perhaps sugest which one of the samples I should look at Dec 31 22:54:23 apk/samples Dec 31 22:54:52 You want to use an intent to tell an activity to change fragment1 out for fragment2? Dec 31 22:54:54 JakeWharton: if you're still about, https://github.com/square/okhttp/issues/386 (if not have a good new years or whatever, please feel free to get in touch over github or irc if you need more details) Dec 31 22:55:09 desmin88: yes... Dec 31 22:55:25 i saw it. thanks. Jesse will probably jump on it since he's been down working on that part of OkHttp over the last few days Dec 31 22:55:28 I want to click a button, and swap frag1 for frag2 Dec 31 22:55:33 So you could include something like a boolean 'change', if its true, then change out your fragments Dec 31 22:55:37 I am looking at the fragman docs now Dec 31 22:55:47 or you can use an event bus to tell the activity to do that (otto!) Dec 31 22:56:46 actually, in my situation, I have one intent, and about 15 fragments... but I only want to show one frag at a time. and I want the frags to change onCLick of a button Dec 31 22:57:29 All of the docs seem to refer to an older style of Eclipse of Android studio... My AS is setting up the Intents and fragmetns different.. Dec 31 22:57:51 Do you cycle through these fragments? Dec 31 22:57:59 I found the big nerd ranch's book a good starting point - they explain fragments right from the start. they've also got a lot of examples you can download at http://www.bignerdranch.com/book/android_the_big_nerd_ranch_guide Dec 31 22:58:03 or can you be on fragment 10, and click the button and you want to move to fragment 8 Dec 31 22:58:16 JakeWharton: thanks again. Big fan of square :) Keep trying to push my management to be more like you guys :p Dec 31 22:58:49 desmin88: No stack is required. I would prefer to go in a random path. Dec 31 22:59:04 so frag 4 could goto frag15 Dec 31 22:59:15 then just include some value in your intent telling the activity which fragment to switch too Dec 31 22:59:15 kind of like a tree path Dec 31 22:59:17 not very hard Dec 31 22:59:50 ok... and I would put that in a button click... but what does the code to switch the fragment look like? Dec 31 23:00:01 wat Dec 31 23:00:06 there are so many examples online Dec 31 23:00:13 find one Dec 31 23:00:56 desmin88: ahhh... I think I know what you are saying... but I am guesisng I have to add a fragment container to my layout files and that is not clear to me... just experimenting Dec 31 23:01:11 find a tutorial online Dec 31 23:01:13 there are plenty of good ones Dec 31 23:01:48 there are pretty much zero good tutorials for ANYTHING android on the net Dec 31 23:01:53 including the google documentation Dec 31 23:02:05 hah, what? Dec 31 23:02:50 desmin88: and i have looked at the stuff online... but they are all differnt from what Android Studio is doing now. Dec 31 23:02:56 they are either only 45% complete and leave the rest to your imagination or they give a full blown space invaders game with opengl and multi threaded sound effects and music just to show a "hello world" example Dec 31 23:03:41 AS is not adding a frame... I think AS has a method to handle doing separate frags now that is dif from the tutorias of a couple months back Dec 31 23:03:44 google's entire example source tree is guildy of the latter Dec 31 23:04:11 tbh a lot of the documentation sucks Dec 31 23:04:18 but for things like basic fragment switching Dec 31 23:04:21 there are plenty Dec 31 23:04:28 lars vogel i belive has a good writeup Dec 31 23:05:26 I have many database leaks in my application, what is the good way to handle database opening / closings ? Dec 31 23:05:32 i'll keep looking, but what i would like to find is an example that is using the latest version of Android Studio Dec 31 23:05:42 should I open the database in my activity onCreate and close it on onDestroy ? Dec 31 23:06:06 Estragon: using it as an application singleton usually works well for me Dec 31 23:06:26 so you never close it while app is runing ? Dec 31 23:07:22 IrishGringo: if you still want some help with switching fragments, i've got some code up at the moment which might help that I can walk you through. Dec 31 23:07:39 nijntje: please.... Dec 31 23:08:19 nijntje: even if your just switching between two frags from a buttonclick... that would be preferct Dec 31 23:08:50 ill get the spoon Dec 31 23:09:54 IrishGringo: can you do private message? would that be easier? Dec 31 23:09:59 jaynewstrom: the application singleton solution looks good, thanks Dec 31 23:10:30 you bet. you don't have to close it in that case. when the application/process dies, it disappears Dec 31 23:10:46 how do i stop this stupid E/TrafficStats debug message from spamming my log? Dec 31 23:11:23 jaynewstrom: just not sure it's the state of the art but it should be enough in my case :) thanks Dec 31 23:11:43 it's followed in quite a few places actually Dec 31 23:12:06 okay, nvm then :) Dec 31 23:13:26 12-31 17:12:58.640 1635-2291/? E/TrafficStats? [QCTMM]tryAll index=2 Dec 31 23:13:41 how do i stop a constant SPAM of that error message in my logcat? Dec 31 23:14:15 you dont Dec 31 23:14:18 you accept it Dec 31 23:14:20 and move on Dec 31 23:14:35 what is it? Dec 31 23:14:40 not sujre Dec 31 23:14:42 what is trafficstats Dec 31 23:16:56 I440r you create a logcat filter Dec 31 23:17:43 g00s ill rtfm that Dec 31 23:17:46 ty Dec 31 23:18:56 here is mine ^(?!OpenGLRenderer|EGL_emulation|libEGL|dalvikvm|Choreographer|IInputConnectionWrapper) Dec 31 23:19:22 and i have it set to my package also Dec 31 23:21:09 If I can't control the html I'm given, can I make a webview scale the text/images to fit the width Dec 31 23:21:15 freenode doesn't have an active java channel? Dec 31 23:21:21 its ##java Dec 31 23:21:47 I mean instead of just zooming out the webview so it all fits, scale the image down and text stay the same Dec 31 23:22:01 thanks ## channels dont show up in xchat search for some reason Dec 31 23:22:07 beware Dec 31 23:22:11 that channel is a shit hole Dec 31 23:22:15 For onMarkerClick when on a google map, is there any way to get the size of the InfoWindow dimensions? Dec 31 23:22:28 regreddit also, note their topic : no android Dec 31 23:22:36 yep Dec 31 23:22:38 so pretend like, uh, you're using java Dec 31 23:22:43 :) Dec 31 23:22:52 I am in this case Dec 31 23:23:00 head straight, look forward, you get the drill Dec 31 23:23:24 just tell them you're using Apache Harmony Dec 31 23:23:28 regreddit don't look at the woman in red Dec 31 23:24:00 lol JakeWharton Dec 31 23:24:06 HAH Dec 31 23:24:32 unless you guys want to answer a noob-ish java question Dec 31 23:24:53 shoot Dec 31 23:24:57 there is no fun police here Dec 31 23:25:51 oh god i the urge is real Dec 31 23:26:19 I have a class that has two signatures: MyPair(String name, String value) and MyPair(String name, double value) but now I need getters, and java complains Dec 31 23:26:30 setters work fine, since the parameters are typed Dec 31 23:26:57 but with the getter, the return type evidently isnt part of the signature Dec 31 23:27:43 so setValue(String val) and setValue(double val) work fine Dec 31 23:28:03 but String getVal() and double getVal() do not Dec 31 23:28:06 regreddit there already is a Pair class Dec 31 23:28:13 Pair Dec 31 23:29:14 http://developer.android.com/reference/android/util/Pair.html Dec 31 23:29:16 yeah, I saw that, but for whatever reason the android dev I hired on Elance didnt use it Dec 31 23:29:54 I initially implemented that, but I think he may have a bit of "not invented here", so I'm trying to clean up a bit Dec 31 23:30:14 I'd rather use anonymous types Dec 31 23:30:21 solves everything Dec 31 23:30:44 you can study the code for the class Dec 31 23:31:06 yeah I am, it's all of 60 LOC Dec 31 23:31:09 see how the getters are generised Dec 31 23:31:10 So the webview shrinks to fit the image, not the other way around. http://gyazo.com/9d5487196555f2a4f0412430f26be855 Dec 31 23:31:23 oh you mean the Pair class Dec 31 23:31:41 good idea Dec 31 23:34:09 one valid reason he had was that we're implementing a name/value pair implementation of spinners, checkboxes, etc and the overrides for the ArrayAdapter get kind of complex if all the values arent Strings Dec 31 23:34:30 I have the same problem as this guy : https://code.google.com/p/android/issues/detail?id=63788 any idea why ? Dec 31 23:34:32 ie you dont have to override the ArrayAdapter at all if your values are strings Dec 31 23:35:22 but if I load an Array Adapter with an array of pairs ve an Array of anonymoues types, i got to handle every case of the type Dec 31 23:35:42 s/ve/vs/ Dec 31 23:36:18 I keep using the term Anonymous - crap Generics Dec 31 23:36:31 s/Anonymous/Generics/ :) Dec 31 23:36:53 why is hexchat not rendering the names until i mouse overthe Dec 31 23:47:26 #hexchat Dec 31 23:51:37 htank you JakeWharton Dec 31 23:52:09 i was only joking. is it a real channel? Dec 31 23:52:54 yep lol Dec 31 23:59:48 Happy New Year from GMT +1 (Munich, Germany) Jan 01 00:03:30 just turned 12 in London Jan 01 00:05:26 happy new year lesleh Jan 01 00:05:35 cheers :) Jan 01 00:05:56 the time of year we all pretend to remember the lyrics to auld lang syne Jan 01 00:06:19 great resolution: help Eeeeeee with all his development problems lol Jan 01 00:06:32 hah Jan 01 00:06:44 never heard it, sounds like a new years bar chant lol Jan 01 00:07:48 it's Scottish, so yeah, that'd make sens Jan 01 00:07:51 sense* Jan 01 00:08:21 http://www.youtube.com/watch?v=rId95N2teUc that one Jan 01 00:08:51 even *they* sound like they barely remember the words Jan 01 00:20:31 my custom view has references to some bitmaps. How can I recycle those bitmaps when the view is "destroyed" ? Jan 01 00:20:55 should I put code on the activity onDestroy to ask the custom view to cleanup ? Jan 01 00:20:56 haha i immediately imagined a bar full of drunken english people singing in unison anyway... that how any bar in europe looks in movies though lol Jan 01 00:26:20 Estragon: as long as nothing else references them the GC will clean them up eventually Jan 01 00:26:45 well, the view has a reference to it Jan 01 00:26:57 I have a bitmap[] field on my custom view Jan 01 00:27:56 well if nothing references the view anymore then you'll be fine Jan 01 00:29:22 the view is obviously only referenced on my activity but im not sure if the activity ever disapear as it stays on the stack Jan 01 00:29:25 not sure if im clear Jan 01 00:30:21 my activity has reference to custom view which has bitmap[] attribute. By loading many times the same activity (startActivity inside the activity) I manage to get a outofmemory error Jan 01 00:30:34 activities retain their windows (which retain the entire view hierarchy) Jan 01 00:31:28 but aren't the activity supposed to be destroyed to free memory if they are not longer on foreground ? Jan 01 00:43:07 yes, but in practice that (almost) never happens Jan 01 01:36:01 Hi, just updated to 4.3 on a Galaxy S4. Now getting this spewing up in the LogCat constantly: http://pastebin.com/JvNshWsg - Anyone know which app would be causing this? I have nothing opened, this appears after boot Jan 01 01:40:37 Smashcat, kill running programs/services one at a time til it stops spamming. Jan 01 01:40:57 the last one you kill is the one you should clear data on. Jan 01 01:41:14 Fenny: Yes, I'm trying to do that at the moment. Unfortunately not all of them can be shutdown on the S4... Jan 01 01:42:19 the other option is root, titanium backup then start wiping data for apps one at a time. >:) Jan 01 01:43:37 Damn Facebook app just respawns after it's shutdown. Have to uninstall it Jan 01 01:43:47 Buuut if you have updated to 4.3 without root, rooting would burn an efuse. Jan 01 01:44:33 Fenny: Yeah I can't root this - I use it for app development. Jan 01 01:45:08 KNOX has a nasty efuse that was activated with the new 4.3 bootloader on tye s4. Jan 01 01:45:55 I dont think I would be very effective developing on a device which I DIDN'T have root on. Jan 01 01:46:53 if you had root you could install strace and see which process was making the calls. Jan 01 01:46:54 Fenny: Well I like to have the same environment as the end users, so I keep it standard. Don't have any problems usually Jan 01 01:49:35 Going to uninstall everything I think. Man I shouldn't have allowed it to do an update! Jan 01 02:20:14 how can I adjust the width of a view inside a relativelayout? Jan 01 02:24:12 Heh, S4 was screwed. Even after a factory reset it was spewing errors. So I "accidentally" dropped it down the stairs. Should get another one from work tomorrow - hehe! Jan 01 02:26:46 well that's one way Jan 01 02:28:11 Heh, they have a cupboard full of them :) Jan 01 02:29:32 ah, that stuff was free Jan 01 02:29:45 Think there was a hardware fault with it anyway (certainly is now :) ) Jan 01 02:30:00 indeed! Jan 01 02:30:17 I think there's a t-mobile ad with this script Jan 01 02:30:22 I can't just get the child's relativelayout.layoutparmas, change the width and set it again Jan 01 02:30:31 the width variable in the layoutparams is unused? Jan 01 02:30:40 why is changing the width of a view so hard Jan 01 02:30:45 unused, or set to match_parent/wrap_content? Jan 01 02:31:03 no, I have it set to an @dimen/something in the layout Jan 01 02:31:12 but in code I would like to change the width at some point Jan 01 02:31:40 inspecting the layoutparams for the child, it has a width of -3438473 or something Jan 01 02:32:00 strange Jan 01 02:32:07 but has some mLeft/mRight properties which look like they are the left/right positions Jan 01 02:32:14 but I can't get at those Jan 01 02:33:58 what about View.getWidth? Jan 01 02:36:35 the view's mMeasuredWidth is 300 Jan 01 02:36:40 which looks sensible Jan 01 02:36:56 I assume getWidth would return 300 Jan 01 02:40:44 wabz: why are you wanting to change the width? and if you are wanting to do that, why would you need to know current width before changing? Jan 01 02:41:49 what the fuck? because I want the width of this view to shrink, and because I want to change it by a relative amount Jan 01 02:42:19 wabz: basically i'm saying you haven't given any detail or code......sooooo, quit being an idiot? Jan 01 02:42:30 I've given plenty of detail Jan 01 02:42:52 since 21:20 all you said was [21:20] how can I adjust the width of a view inside a relativelayout? Jan 01 02:43:09 so learn to google Jan 01 02:43:16 you're doing it wrong Jan 01 02:43:24 I did, and I can't find anything, that's why I'm asking here Jan 01 02:43:44 but what i'm saying is you are asking wrong. Where's your code? Jan 01 02:43:47 and I've said much more than that sentence Jan 01 02:43:48 Happy New Year to everyone :) Jan 01 02:44:00 i just got here :) Jan 01 02:44:09 You're probably trying to measure the width before the view has been rendered. That's why it's giving strange values Jan 01 02:44:15 Happy new year Jan 01 02:44:17 no, that's not correct either Jan 01 02:44:23 is it a custom view? Jan 01 02:44:25 this is far after the view has been rendered Jan 01 02:44:29 nope, it's just a listview Jan 01 02:45:01 why are you wanting to shrink it? Jan 01 02:45:12 who cares? Jan 01 02:45:16 bleh Jan 01 02:45:32 details are key, you'll learn when the doors stay locked Jan 01 02:45:51 why I want to change the width of the view is completely irrelevant to the question though Jan 01 02:46:01 wabz: have fun Jan 01 02:46:20 the question is really simple - how is one supposed to change the width of a view in a relativelayout? Jan 01 02:46:32 simple, change the fucking width and update Jan 01 02:46:38 how? Jan 01 02:46:39 but you give no details, so.... Jan 01 02:46:46 RelativeLayout.LayoutParams lp = (RelativeLayout.LayoutParams)foo.getLayoutParams(); Jan 01 02:46:54 lp.width -= bar; Jan 01 02:46:57 why are you getting params!!!!! Jan 01 02:47:01 Well without knowing anything about your code, you're probably measuring the wrong element, or interpreting it wrong. It's pretty straight forward to resize a view really. Jan 01 02:47:12 foo.setLayoutParams(lp); Jan 01 02:47:20 what is bar Jan 01 02:47:26 an int value Jan 01 02:47:26 wabz: learn to be more open Jan 01 02:47:36 wabz: guess what bar to me is not shit! Jan 01 02:47:50 canvs2321: why not get params? Jan 01 02:47:55 how else do you set the width? Jan 01 02:48:00 wabz: Just put the code on pastebin Jan 01 02:48:18 bar means ppl drinking and maybe some daterape, but your obfusication(sp?) keeps me thinking you are giving drugs Jan 01 02:48:30 because you want to set params Jan 01 02:48:38 I think oyu have no idea how to change the width of a view Jan 01 02:48:48 and you saying getting the current width doesn't matter but you are getting it isn't helping Jan 01 02:49:26 wabz: i'm pretty sure you should just find some lighter fluid, pour it on your computer&android device, light it, melt some marshmellows, eat them then sleep Jan 01 02:51:31 I use layoutParams to move views about too, btw. Jan 01 02:51:43 i have a question. I want to change the size of an image. Why&how doesn't matter but i don't want to know the size of the current view but i want to shrink it. to what size doesn't matter, i just want to know the current size and -= an random variable then adjust. How can i do that? and this is using a crayon&sand Jan 01 02:53:10 wabz: i really am a straight to the point kinda IRC user, you are just making it difficult to help :) let us in your mind :P Jan 01 02:54:14 I don't think you're reading what I'm writing Jan 01 02:54:26 i never learned to read :/ Jan 01 02:54:36 you're asking why I'm getting the layoutparams Jan 01 02:54:44 wabz: Where's the pastebin link? Jan 01 02:54:44 but that's how you set the width of a view!! Jan 01 02:54:45 i like pictures&pastebins of pictures with pictures of pictures Jan 01 02:55:17 no getting a layoutparam is getting current settings, setting is different Jan 01 02:55:23 you don't need to read to set Jan 01 02:55:29 if you know what size you want Jan 01 02:55:38 based on some value system you created Jan 01 02:55:52 I don't know the size I want Jan 01 02:55:58 I'm adjusting the current width Jan 01 02:56:05 that's what .width -= does Jan 01 02:56:20 this is what i'm saying, how can you set a width based on current width if you have NO IDEA WHAT YOU WANT Jan 01 02:56:25 so I get the current layoutparams, adjust the width, and set the layoutparams again Jan 01 02:56:37 I know the delta value Jan 01 02:57:09 what I want the width to be doesn't matter - I'm saying that this method of setting the width has no effect Jan 01 02:57:48 so I'm asking what the correct way to adjust the width of a child view in a relativelayout is Jan 01 02:57:57 wabz: basically, you need to spend an hour, or 7 to 10months evaluating what you want based on phone or tablet, then come back with a real question and tested code where you tried A to B but you get C etc..... Jan 01 02:58:01 wabz: As said, you're not measuring the view properly. You can set thewidth/height with LayoutParams Jan 01 02:58:01 what code I currently am using doesn't even matter!! Jan 01 02:58:25 you've shown 0 code Jan 01 02:58:40 why do I need to show code ot ask how to adjust the width of a child view in a relativelayout? Jan 01 02:59:01 because it's a simple task Jan 01 02:59:02 wabz: Sorry dude, but you're beyond help. If you won't show your code (like I haven't seen millions of lines of code) and you're evasive about what you're doing, then go and work it out yourself. Jan 01 02:59:57 gotta put the washing out **** ENDING LOGGING AT Wed Jan 01 02:59:58 2014