**** BEGIN LOGGING AT Mon Jan 27 03:00:00 2014 Jan 27 03:01:56 {"a":["apple", "banana"], "b":["google", "banana"]} <------ in this json structure, how can i get 'banana'? perhaps : String emelemt = jsonobject.toJsonObject("a").getJSONArray(1); Jan 27 03:03:31 help me. plz Jan 27 03:07:41 which banana? Jan 27 03:07:43 it appears twice Jan 27 03:07:53 gson :) Jan 27 03:16:48 I have an i7 w/ 4 GB of ram... is that not sufficient to run the android emulator at full speed? Jan 27 03:17:35 "full speed" ? Jan 27 03:18:18 bankai_: as fast as my device Jan 27 03:18:25 i doubt that'll ever happen Jan 27 03:18:38 bankai_: coming from ios dev... it just boggles my mind that i can run an iOS simulator at full speed on my computer and debug apps but not an android one Jan 27 03:18:42 no one ever said the emulator was fast and it shouldn't be used for performance testing Jan 27 03:18:45 I'm using android studio with the x86 images and haxm Jan 27 03:18:51 you're comparing a simulator to emulator Jan 27 03:19:23 bankai_: so testing on the device is pretty much the norm in android world? Jan 27 03:19:39 you'll always need to, iOS is no different Jan 27 03:19:53 well of course... but for minor things and while quickly iterating you can't beat the sim Jan 27 03:20:06 i agree Jan 27 03:27:06 myke: first banana Jan 27 03:30:48 {"a":["apple", "banana"], "b":["google", "fine"]} <------ in this json structure, how can i get 'banana'? perhaps : String emelemt = jsonobject.toJsonObject("a").getJSONArray(1); Jan 27 03:31:47 help me Jan 27 03:33:07 try&see? Jan 27 03:41:56 how can i transform string to array? Jan 27 03:42:47 '["name1", "name2"] ----> ["name1", "name2"] Jan 27 03:42:59 huh? Jan 27 03:48:41 can anyone point me to the right direction dealing with potential site blocking within china? What kind of response would i be getting if I try to access a site that's blocked? would i even get a response? thanks Jan 27 03:53:47 you have to get through the great wall of china Jan 27 03:55:33 oh no Jan 27 03:55:38 insufficient storage error Jan 27 03:56:49 fly2web: use gson Jan 27 03:57:34 bankai_: i got it like this : String atomicNumber = parent.getJSONArray("a1").getString(5); Jan 27 03:57:49 thanks Jan 27 03:57:51 bankai_: Jan 27 04:00:43 fly2web: atomic banana? you understanding things? not good practice to hardcode strings...you just testing waters? Jan 27 04:01:34 water? canvs2321 Jan 27 04:01:37 what water? Jan 27 04:02:15 water water everywhere, but not a drop to drink kind of water Jan 27 04:02:37 :) just curious if you are just testing how things work with android and java, or if you are trying for a serious app Jan 27 04:03:08 Anyone here using Android studio? I'm trying it out and cannot get something simple to work...a silly textview. I create one in fragment_main.xml then in the onCreate() in MainActivity.java I do the usual tv1 = (TextView)findViewById(R.id.textView); but when I tv1.setText("TEST"); it crashes the app with a nullpointer @ setText() line. Jan 27 04:03:36 I am banging my head trying to find out why its doing this...am I missing something blatently obvious? I've never had a issue like this with Eclipse. Jan 27 04:04:10 do you have a textview with that id in your layout ? Jan 27 04:04:37 bankai_: i test my app now. Jan 27 04:04:51 almost 40 % progress. Jan 27 04:05:03 http://pastebin.com/X0GGTuus Jan 27 04:05:09 Hey guys, I'm trying to invalidate a canvas to clear the writing from it in order to draw on it a second time, but when I call invalidate(), ondraw() never initialises and I just end up with a black box. Jan 27 04:05:18 bankai_ Yea Jan 27 04:05:25 Any advice on where to go from here? Jan 27 04:08:23 Immaterial: you have a custom view? paste some code Jan 27 04:08:37 Righto, momento. Jan 27 04:09:21 This makes no sense to me... Jan 27 04:09:58 http://hastebin.com/bicotoxoku.avrasm Jan 27 04:10:09 canvs2321, that's the customview. Jan 27 04:10:58 I call SignatureView sigview = (SignatureView) findViewById(R.id.signatureView1); Jan 27 04:10:59 sigview.clearSignature(); from the main activity. Jan 27 04:11:43 Immaterial: in your init you set mPaint to black, then in ondraw you use that paint to draw your bitmap. does that factor in? just after quick glance Jan 27 04:12:35 I'm new to it, I assume setting the mPaint variable to black would just mean black draw. Jan 27 04:13:29 you said you are getting a black box, maybe try changing the init() mPaint to a different color and see what happens Jan 27 04:13:51 Alright. Jan 27 04:14:01 you draw bitmap&path with mPaint. just a check Jan 27 04:17:25 Nope, the whole thing still goes black. Jan 27 04:21:16 Besides, mPaint would be the line colour, no? Jan 27 04:21:35 Well. Jan 27 04:21:42 The colour attribute, anyway. Jan 27 04:35:20 HAH, so it resets now. Jan 27 04:35:33 But the canvas goes from white to black, and stays black. Jan 27 04:36:07 ya sure youre not using alpha Jan 27 04:37:18 ? Jan 27 04:38:16 well for example if youre painting with any color but with alpha of 0, it wont show Jan 27 04:38:41 Oh. It shows the first time, it's just after I clear everything and invalidate for redraw. Jan 27 04:39:03 And after I changed the background paint from transparent to white, I could see myself drawing on the canvas, but it was still black. Jan 27 04:39:37 you mean whats drawn is always black? Jan 27 04:39:52 No, I mean what I'm drawing on is always black. Jan 27 04:39:58 ok Jan 27 04:40:00 Well, after I clear it the first time. Jan 27 04:40:07 It's white to begin with. Jan 27 04:40:40 sounds like data got reset but dunno Jan 27 04:41:02 So I should redefine is in signatureclear, or? Jan 27 04:41:03 Or ondraw. Jan 27 04:43:24 unfortunately not expert here Jan 27 05:16:31 interesting, that the sample code created by AS for a Settings Activity calls registerOnSharedPreferenceChangeListener in onCreate, but never unregisters it Jan 27 05:16:54 when i read android code, i wonder - is that a nice trick, its handled for me? or did they fuck it up Jan 27 05:28:57 They let it get gc-ed? Jan 27 05:29:26 i would think it would leak the activity Jan 27 05:31:29 unless internally (have to check) they are using weakreferences Jan 27 05:33:25 yah Jan 27 05:35:15 * capella got one bug left outstanding ... can't get excited enough to knock it out Jan 27 05:35:49 imange it as black widow and on your shoulder Jan 27 05:35:54 stamp that bug out Jan 27 05:35:59 :P Jan 27 05:36:40 It's just adding an option to a screen .... but my reviewer threw me a scope creep and wants to create a whole new menu Jan 27 05:37:00 fun Jan 27 05:37:09 I just want the extra option, not the extra project Jan 27 05:37:56 gonna try to finesse the current patch in ... do the menu as a follow up Jan 27 05:39:09 Wait until there's more than one item to put onto a whole new menu Jan 27 06:00:11 capella no weakrefs, just looks like a bug in the AS template :D Jan 27 06:00:34 now you have a bug in a code template, and thats pretty funny Jan 27 06:01:12 Wait? the listener I thought was in a weakref Jan 27 06:01:24 maybe I dont understand your point Jan 27 06:02:34 its not a weakref; i'm looking at Preference.java. Jan 27 06:03:15 just say no to code templates Jan 27 06:04:09 i thought it was just going to create a class that extended from PreferenceActivity :) Jan 27 06:04:13 Im doing too much all at once again ... looking at SharedPreferencesImpl.java Jan 27 06:04:14 id made a lot more Jan 27 06:06:41 g00s: did you file it? Jan 27 06:08:03 for added protection against memory leaks, WeakReference> Jan 27 06:10:10 canadiancow are you looking at http://developer.android.com/reference/android/preference/Preference.html#setOnPreferenceChangeListener%28android.preference.Preference.OnPreferenceChangeListener%29 ? Jan 27 06:10:11 Hey, I'm looking to build my first application and spinning up the virtual android device doesn't seem to be working Jan 27 06:10:19 its been at the loading screen for ~7 minutes now Jan 27 06:10:31 Do these things usually take awhile to boot? Jan 27 06:10:38 g00s, no, im making a stupid joke about weakreferences Jan 27 06:10:48 canadiancow hehe Jan 27 06:10:49 sontek, yes Jan 27 06:10:55 my advice: buy a real device Jan 27 06:11:00 nexus 7 is good and cheap Jan 27 06:11:07 and as an added bonus, you can use it for other things too! Jan 27 06:11:27 my favorite app on my n7 is Play Books Jan 27 06:11:33 but i read epubs from oreilly :) Jan 27 06:12:41 i can't read on my tablet, except something for reference like manuals for things, fiction is a no go Jan 27 06:12:48 if only there was a 15+ fps eink display Jan 27 06:12:51 it takes a while to boot Jan 27 06:13:06 improve performance by using an x86 image Jan 27 06:13:12 And haxm Jan 27 06:13:33 x86 images perform about equally to a physical device for me Jan 27 06:15:30 hey guys Jan 27 06:15:33 canadiancow: yeah, I have a nexus 5 as well, just wanted to make sure I had all the VM stuff working as well Jan 27 06:16:04 Quick question! Can I use the In-app billing API on an application that isn't on the google play store? Jan 27 06:17:32 somehow i doubt it Jan 27 06:17:37 just a hunch Jan 27 06:18:53 anyone know for sure? Jan 27 06:20:59 iggykrajci just fire up any emu without play services and try it :) Jan 27 06:21:09 i think you'll find out pretty quickly Jan 27 06:21:33 fast answer, no Jan 27 06:25:35 is there an easy to way to get the users distance from the nearest intersection ? Jan 27 06:25:47 and also get the names of the 2 streets of the intersection ? Jan 27 06:27:10 My eclipse keeps crashing with this output: http://paste2.org/j32DmUN1 doesn't seem detailed enough to know why Jan 27 06:27:19 but I'm using openjdk, so maybe I should switch to oracle? Jan 27 06:27:44 sontek: I'm using openjdk without issues Jan 27 06:29:02 sontek: what version of openjdk and eclipse ? Jan 27 06:29:04 sontek@beast$ (git::sprint46.5) java -version Jan 27 06:29:06 java version "1.7.0_51" Jan 27 06:29:17 I'm using the eclipse from the adt bundle, I just run it directly from there Jan 27 06:30:09 sontek: hm I'm still using build 25 Jan 27 06:30:09 It help -> about it shows "Android Developer Tools Build: v22.3.0-887826 Jan 27 06:30:15 sontek: I'll upgrade to 51 to see if I have the same issue Jan 27 06:30:23 there's a log in.eclipse Jan 27 06:30:50 that output paste is not a crash Jan 27 06:32:11 eclipse completely restarts, so thats the only log output I get Jan 27 06:35:11 in the.eclipse dir Jan 27 06:35:16 there is a log Jan 27 06:37:24 Whats the best way to parse a JSON string into a JSONObject? Jan 27 06:37:42 pfn: http://paste2.org/cvGsab2y thats all the files with log in the name that I see Jan 27 06:39:16 that's not the.eclipse dir Jan 27 06:39:29 .eclipse Jan 27 06:42:55 I have a ~/.eclipse/org.eclipse.platform_793567567_linux_gtk_x86_64 dir Jan 27 06:42:59 Is GSON best for parsing JSON into a Object? Jan 27 06:43:15 depends on your definition of best Jan 27 06:43:21 it's perfectly suitable Jan 27 06:43:27 I just have a JSONString that I want into a JSONObject Jan 27 06:43:40 you shouldn't use those crappy APIs Jan 27 06:44:08 Gson is best for create concrete class instances from JSON Jan 27 06:44:50 So if I have a json string, which library should I be using to convert that into an object that I can access values via their key names? Jan 27 06:45:03 it saddens me that you would even want to do that Jan 27 06:45:17 you don't want to convenience and type safety of real objects? Jan 27 06:45:32 You should use Gson, you just need to play with it a bit more to realize all the awesome it has to offer Jan 27 06:45:57 * New to Android dev, just have json being returned from an API that I am trying to get values from Jan 27 06:47:36 JakeWharton: so when using a external library in my app, do I just take the .JAR file and link it in the libs foldeR? Jan 27 06:47:42 yep. Jan 27 06:47:46 just drop it in Jan 27 06:47:55 i'm trying to find a simple Gson example somewhere but they're all crap Jan 27 06:48:26 Would it be faster to draw a string or draw a chopped up bitmap if I have a spitesheet for a font ? Jan 27 06:48:43 using the rect part of drawBitmap that is. Jan 27 06:48:51 Hope I structured that sentence right Jan 27 06:51:39 Zypho: this isn't bad: http://www.java-n-me.com/2010/11/gson-json-in-just-two-lines-of-code.html Jan 27 06:51:53 i was trying to find something to showcase how you can go from JSON to object Jan 27 06:51:59 which the second part of that code snippet does Jan 27 06:53:23 basically, create an object (or objects) whose structure and field names match those of the JSON and Gson will create instances of that object from the JSON string Jan 27 06:53:39 this means you never have to access it like a map, but rather as an object Jan 27 06:54:31 And is the only benefit to this because you're using proper getters? Jan 27 06:56:03 and the object is typed so no casting Jan 27 06:56:16 which is a big deal when you have nested objects (as most JSON does) Jan 27 06:58:34 hey, if i have a series of activities, and i want the final one to finish all of them, is there a way to destroy the activity stack from that last one? or do i need to make return with intent, back down the stack Jan 27 07:02:23 erdos intent.setFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP); Jan 27 07:02:43 might need something in the manifest too, i forgot Jan 27 07:03:13 so i apply that to each intent i create along the way? Jan 27 07:03:18 or just the last one? Jan 27 07:03:37 no, at the end, startActivity(your home activity) with that flag Jan 27 07:03:51 is it possible to donload apk from google play? Jan 27 07:04:07 nope Jan 27 07:04:14 ah i see, thanks :) Jan 27 07:04:18 not officially anyway Jan 27 07:04:35 if you google it, there are some workarounds Jan 27 07:04:56 they mostly involve installing apps to your phone which will in turn dl the apks Jan 27 07:05:10 or some browser extensions Jan 27 07:05:28 genymotion used to have the Play Store Jan 27 07:05:38 not any more :) Jan 27 07:06:50 just drag it in Jan 27 07:06:57 same as CM Jan 27 07:07:50 I am getting an if(output == null) evaluating to true, when output is certainly NOT false. screenshots: http://imgur.com/a/9Gn9U Jan 27 07:07:57 I have cleaned and rebuilt my project, updated to the latest AS, restarted my phone and computer, and reinstalled the app on my phone, yet still this is happening Jan 27 07:08:07 I asked this question last friday but was unable to resolve the issue, so I figgured I'd try asking just once more :) Jan 27 07:08:27 anyone know what is going on? Jan 27 07:09:30 have you invalidated ? Jan 27 07:09:40 ah no. thats a great idea Jan 27 07:09:45 invalidate caches and restart Jan 27 07:10:10 yep. doing now Jan 27 07:10:24 ive only ever done it once before, but it was easy to find :) Jan 27 07:11:09 no official way you can download to emulators and get the apk from them but only for free apps Jan 27 07:11:15 oops soz :) Jan 27 07:11:48 "soz"? Jan 27 07:11:53 Anyone know if drawBitmap is faster than drawText ? Jan 27 07:12:06 soz(1) - alias "sorry" Jan 27 07:12:12 for the line i put there didn't mean to post that in the channel was supposed to be a private msg Jan 27 07:12:27 ah right Jan 27 07:12:55 so its wokring zzxx ? Jan 27 07:17:01 oops sorry got distracted for a sec.... Jan 27 07:17:04 checking now Jan 27 07:17:42 no! Jan 27 07:17:44 it is not Jan 27 07:17:48 wtheck Jan 27 07:17:54 i had my hopes up Jan 27 07:17:55 :P Jan 27 07:20:29 anyone know if the geocoder.getfromlocation method will return 2 streets if the user is on an intersection ? Jan 27 07:24:07 sorry zzxx thought that might help you i had a similar issue a while back and that fixed it for me Jan 27 07:25:31 lemonxah: Thanks for trying anyways. My search for an answer continues.... Jan 27 07:25:49 the quest of all quests Jan 27 07:25:51 heh Jan 27 07:26:30 qwee: well that's where planning comes in. will anything have damage ? will anything else need a takedamage method ? Jan 27 07:39:32 Is it easy to take a project created in ADT and open / run it in Android Studio ? Jan 27 07:39:51 Zypho, I believe so yes Jan 27 07:39:53 There is an importer Jan 27 07:40:05 and it also explains it on the help site Jan 27 07:43:21 Hey Guys, Setting the theme of activity to android:theme="@android:style/Theme.NoDisplay". Back key is not finishing the activity Jan 27 07:44:05 Any idea why back key is not finishing the activity when activity theme is Theme.NoDisplay. Jan 27 07:53:29 anyone know a good place to ask next about my faulty if statement evalutaion? I dont really know where to go from here. Perhaps a popular android dev forum, or other irc chat room....? Jan 27 07:54:37 Here Jan 27 07:54:41 zzxx: what faulty if statement ? Jan 27 07:55:03 http://imgur.com/a/9Gn9U Jan 27 07:55:53 razor-: I have asked here twice. no one seems to know. I have had many helpful suggestions, but nothing to successfully find the problem Jan 27 07:56:27 I have a String var coming back as "full_image" but when I run if (var == "full_image") the condition isn't met? Jan 27 07:56:50 You can't compare strings like that Jan 27 07:56:54 you have to use .equals Jan 27 07:56:57 Zypho: comparing strings needs .equals or .contains Jan 27 07:56:58 shit Jan 27 07:56:58 right Jan 27 07:57:02 dammit Jan 27 07:57:13 4am facepalm Jan 27 07:57:14 == compares the objects, and since strings are immutable, they will be different instances Jan 27 07:57:36 zzxx: is that == null the faulty if statement ? Jan 27 07:57:44 yes. Jan 27 07:57:58 you can see in the var inspector below that it is not null Jan 27 07:58:53 zzxx: but it's still making the toast ? Jan 27 07:59:01 indeed. Jan 27 07:59:06 zzxx, was at any point in time, that if statement inverted ? Jan 27 07:59:27 or different in a way that might cause the result to be true ? Jan 27 07:59:45 zzxx so is the toast showing ? Jan 27 08:00:01 indeed. Jan 27 08:00:07 yes, i even changed the code and recompiled, with a != instead, and it still executed into the if block Jan 27 08:00:21 g00s, yes Jan 27 08:00:22 It's possible that the != stuck Jan 27 08:00:30 Do a full clean and rebuild of the entire project Jan 27 08:00:36 Remove the application from the device you're testing on Jan 27 08:00:49 Redeploy and test again Jan 27 08:01:44 haha. yes that was one ofthe first suggestions when i first asked. I have done a clean and rebuild. uninstalled and reinstalled, reboooted my phone, rebooted my computer, invalidated caches in AS, and even upgraded AS to the latest release Jan 27 08:01:49 still no luck though :/ Jan 27 08:01:55 Wow Jan 27 08:01:57 Okay Jan 27 08:02:07 Go to watches Jan 27 08:02:09 Add Jan 27 08:02:11 output == null Jan 27 08:02:16 what does it evaluate to ? Jan 27 08:02:38 znxx: did you try without the try{ } Jan 27 08:02:56 Wait Jan 27 08:02:57 hangon Jan 27 08:03:03 There is something wrong here Jan 27 08:03:10 null is underlined for Weather Jan 27 08:03:11 is output shadowed by something else Jan 27 08:03:13 at the definition at the top Jan 27 08:03:48 zzxx, what is the prompt(error/warning) for null being underlined at the definition of output ? Jan 27 08:03:52 Just above try Jan 27 08:04:01 "null initializer is redundant" Jan 27 08:04:10 so a warning not an error Jan 27 08:04:14 Eugh Jan 27 08:04:16 oki Jan 27 08:04:31 Honestly I thought I was on to something. Jan 27 08:04:37 i dont use watches much.... or at all really Jan 27 08:04:42 but ill try it Jan 27 08:05:51 it always says watch = undefined Jan 27 08:05:58 ...if i am using it right Jan 27 08:06:08 Watch might not do what I think it does Jan 27 08:06:13 I thought it could evaluate expressions Jan 27 08:06:14 Perhaps not Jan 27 08:06:24 zzxx do you have another variable 'output' in the outer scope ? Jan 27 08:06:50 g00s, How would that make a difference ? Jan 27 08:06:55 The trace is showing the current scope Jan 27 08:07:09 yeah, i guess you would have to say this.outer Jan 27 08:07:18 yep Jan 27 08:07:18 g00s, i thought of that too, even renames the variable to definatelynotusedelsewhere Jan 27 08:07:21 still no luck Jan 27 08:07:46 renamed* Jan 27 08:08:30 and no proguard ? Jan 27 08:08:50 what is proguard? Jan 27 08:09:04 Obfuscation software Jan 27 08:09:08 Also minimilizes bytecode Jan 27 08:09:10 I assume no Jan 27 08:09:13 no is the answer to that Jan 27 08:09:32 no is the answer Jan 27 08:09:39 Wow this is a doozy, I like this problem Jan 27 08:09:47 lol i aim to please Jan 27 08:09:50 and infuriate Jan 27 08:09:53 You have Jan 27 08:09:59 i wonder if dvm / jdwp / eclipse are just not on the same page Jan 27 08:10:09 That's what I was thinking Jan 27 08:10:12 But the toast still displays Jan 27 08:10:20 Which indicates that the source is different to how it looks Jan 27 08:10:25 And he's rebuild from scratch several times Jan 27 08:10:25 zzxx you'll have to add more logging :) Jan 27 08:11:02 I have a function that returns a string. That string is then used in a widget. That string is somehow being magically changed between it being returned, and then being displayed in a widget. how is that possible ? Jan 27 08:11:19 It's not Jan 27 08:11:28 Can you describe the change ? Jan 27 08:11:46 from Morley Dr to State Route 76 Jan 27 08:12:02 hmmm i have an idea..... im going to take a quick sec to test something Jan 27 08:12:04 I have a log statement right before the function returns the text, and the returnText variable is showing the correct thing Jan 27 08:12:21 actually...no it's not. Jan 27 08:12:23 Could the invalid text be an old value ? Jan 27 08:12:31 Falteckz: it is indeed an old value Jan 27 08:12:45 so it's being changed within the try/catch statement Jan 27 08:13:07 or within the if/else statement. Jan 27 08:13:11 i'm so confused. Jan 27 08:13:11 zznx: doesn't try need a finally somewhere? Jan 27 08:13:23 I define returnText within the if statement, then the returnText variable changes... Jan 27 08:13:39 razor1101, try catch finally but finally is optional if catch is specified Jan 27 08:13:41 zznx == zzxx? Jan 27 08:14:04 zzxx: yes Jan 27 08:14:26 SirLagz, have you defined a returnText anywhere else ? Jan 27 08:14:31 If so you have a scope issue Jan 27 08:14:38 only at the beginning of the function Jan 27 08:14:42 You probably did not mean to redefine it in the try but instead set it Jan 27 08:14:43 Yup Jan 27 08:14:46 Don't redefine it Jan 27 08:14:57 String returnText; try { String returnText Jan 27 08:15:00 the second is a different instance Jan 27 08:15:05 and only exists inside the try Jan 27 08:15:23 I don't redefine it withing the try Jan 27 08:15:34 Can you screenshot or pastebin the function ? Jan 27 08:15:37 pastebinning it now Jan 27 08:15:41 Thanks Jan 27 08:16:32 Falteckz: http://pastebin.com/7PTUWtKk Jan 27 08:17:10 razor1101: to close the input stream? yes, i just hand not written it before that screenshot Jan 27 08:17:31 Falteckz: CurrentStreet seems to be redefining itself somehow but I have no idea how =/ Jan 27 08:18:01 Umm Jan 27 08:18:02 I see Jan 27 08:18:19 if(CurrentStreet.contains("State Route")) { Jan 27 08:18:24 Which it does Jan 27 08:18:26 so it resets it Jan 27 08:18:33 yes... Jan 27 08:18:44 Or did you mean before/after that Jan 27 08:18:50 after that Jan 27 08:18:53 it seems to work past there Jan 27 08:19:21 the CurrentStreet variable does get updated Jan 27 08:19:25 but then I use it in returnText Jan 27 08:19:42 so it must be changing somehow between when I set it and when I return it... Jan 27 08:20:23 Are either of the suburb if statements being invoked Jan 27 08:20:51 about to put some logging in to make sure they are. But I'm pretty sure they are as returnText is "waiting on location" until those 2 suburb if statements Jan 27 08:21:21 It should be set before that Jan 27 08:21:34 returnText should be set before that ? Jan 27 08:21:36 right after if(addresses.size() > 0) and the if that folows Jan 27 08:21:39 *follows Jan 27 08:21:55 returnText would be set there after waiting on location Jan 27 08:22:00 before current street is resolved Jan 27 08:23:12 i see Jan 27 08:23:35 Only thing I can think of is that neither the last if or else if are being fired Jan 27 08:23:40 so right after List
addresses ? Jan 27 08:23:41 So the result you have is that first assignment Jan 27 08:23:55 LIne... 12 Jan 27 08:23:57 on the pastebin Jan 27 08:24:08 but then the first assignment should still use the updated CurrentStreet Jan 27 08:24:22 why ? Jan 27 08:24:30 also I need to set it before addresses.isEmpty() Jan 27 08:24:55 What if CurrentStreet is a State Route Jan 27 08:24:56 because I update CurrentStreet before that ? Or am I getting confused now...? Jan 27 08:25:04 I'm not quite sure Jan 27 08:25:07 But I can see an issue I think Jan 27 08:25:12 If CurrentStreet is a state route Jan 27 08:25:18 if currentStreet is a state route, it should use the 2nd address, which is the normal name of the street Jan 27 08:25:19 it gets reassigned to a value that resultText doesn't have Jan 27 08:25:26 zzxx: is that condition testing units_mode being null? Jan 27 08:25:27 YUes Jan 27 08:25:39 SirLagz, But when does that new value get assigned to resultText ? Jan 27 08:25:42 Only in those two ifs Jan 27 08:25:45 So if neither of them are true Jan 27 08:25:50 the new value is never assigned to resultText Jan 27 08:25:54 That's the only thing I can think of Jan 27 08:26:17 Falteckz: I've put some more logging in to see what's happening now... Jan 27 08:26:21 okidoke Jan 27 08:26:29 dagnabbit, have to cook dinner too...but i wanna finish this bit off lol Jan 27 08:26:47 Protip :) Jan 27 08:26:58 returnText = bla " - " CurrentStreet Jan 27 08:27:05 Put that in java, in the current street if Jan 27 08:27:09 and see if everything is happy Jan 27 08:27:41 returnText = addresses.get(0).getLocality() + " - " + CurrentStreet; after Log.e Jan 27 08:27:46 in the if(CurrentStreet... Jan 27 08:28:02 razor1101: units_mode? where do you see that? Jan 27 08:28:05 That way there is a fallback value if none of the if's below that fire Jan 27 08:28:13 Falteckz: ahhhh DERP Jan 27 08:28:15 alternatively you put it in an } else Jan 27 08:28:21 Falteckz: I think i figured out what I'm doign wrong Jan 27 08:28:30 but i gotta cook dinner now. so after dinner i'll get back onto it Jan 27 08:28:35 Awesome Jan 27 08:28:38 Highlight me when you're back Jan 27 08:28:41 Falteckz: sure thing Jan 27 08:28:42 (Say my nick) Jan 27 08:28:44 Sweet Jan 27 08:28:51 zzxx: as a value inside output Jan 27 08:28:51 Falteckz: I didn't realise line 12 sets returnText until just then Jan 27 08:28:59 Falteckz: blind me lol. I know what it's doing now Jan 27 08:29:07 Haha yes Jan 27 08:29:10 Good :) Jan 27 08:29:11 Falteckz: anyways, thanks for the help, I'll ttyl Jan 27 08:29:16 ttfn Jan 27 08:30:27 is the if condition on line 169 testing that? nope. Jan 27 08:30:34 maybe i dont understand what you are asking Jan 27 08:31:49 zznx: about your second pic showing units_mode=null Jan 27 08:32:03 zzxx* Jan 27 08:32:20 yes, i see that. What condition are you asking about though? Jan 27 08:33:07 The if(output==null) one Jan 27 08:34:26 right, no, that condition is testing if the Weather object output is null Jan 27 08:34:36 have i overridden the = opperator? no Jan 27 08:34:50 overloaded* Jan 27 08:35:05 You can overload the == operator in Java 6? Jan 27 08:35:07 Or java for that matter ? Jan 27 08:35:42 i have no idea, never tried Jan 27 08:38:19 Probably not Jan 27 08:38:55 http://stackoverflow.com/questions/1686699/operator-overloading-in-java Jan 27 08:39:45 kjeldahl: :) Jan 27 08:43:07 zzxx did you add a log statement that printed what output was ? Jan 27 08:46:01 i'm sure the rubber duck knows whats going on Jan 27 08:47:19 the rubber duck? adding more logging now Jan 27 08:49:10 that would be funny if this was a concurrency problem :) Jan 27 08:51:11 lol..... no nothing else should be touching output Jan 27 08:51:17 so uhhhh.... .http://imgur.com/TWWLibO Jan 27 08:51:32 _uniquename added just to ensure no naming conflict Jan 27 08:53:15 Weather class does not implement toString - im just trying to use the system provided one. Jan 27 08:54:15 is this AS or eclipse? Jan 27 08:54:39 looks like AS. is it recent 0.4.3 / Jan 27 08:55:03 yeah, AS does dumb stuff like that quite often Jan 27 08:56:00 Falteckz: stole away from the cooking for a second, added a else and removed that line12 that sets returnText, all working now :D thanks for the help Jan 27 08:57:24 android is incredibly far from ios Jan 27 08:58:09 Is there any reason why when I specify layout_below on a textview, it just bunches up on top of want I want it to be under? Jan 27 08:58:16 This is incredibly frustrating. Jan 27 08:58:38 And it looks fine when I render it in eclipse. Jan 27 08:59:36 anyone use modelgoon in eclipse with android? Jan 27 09:02:22 lasserix pretty safe to assume, in this whole entire world … no Jan 27 09:02:33 heh Jan 27 09:02:47 just noticed the class diagrams it generates only works for methods that return standard java type Jan 27 09:03:11 do you happen to know something i can use to generate uml as eclipse plugin? was hoping to get some sleep tonight Jan 27 09:03:29 generate uml from ? Jan 27 09:03:40 package explorer? Jan 27 09:04:36 lasserix its Bundles all the way down, what UML is needed for that ? Jan 27 09:04:43 ? Jan 27 09:04:59 :) Jan 27 09:05:21 did you mostly just want Visual Package Dependencies Analysis Jan 27 09:05:29 yeah Jan 27 09:05:36 you can probably find a DSM tool Jan 27 09:05:37 ok, what the hell..... this is so bizzare. I added a log.d call before an after the if statement and i get a nullpointerexception trying to read the output Weather object...... then I remove the logging statements, recompile, and the debugger shows output as holding a valid weather object, with properly instantiated innards. Jan 27 09:05:38 have to explain the source to boss and new coworker Jan 27 09:05:45 anyway it is passed my bed time Jan 27 09:05:51 * alex_PP hates bundles Jan 27 09:05:54 http://en.wikipedia.org/wiki/Design_structure_matrix Jan 27 09:05:59 thank you all for your help tonight Jan 27 09:06:11 "what type does this method take???" "bah, bundles..." Jan 27 09:06:34 Bundles of Bundles ! Jan 27 09:06:44 i think of that Oprah Bees thing, but Bundles Jan 27 09:06:57 que? Jan 27 09:07:19 http://beesbeesbees.com/ Jan 27 09:07:28 s/bees/bundles Jan 27 09:08:46 lasserix there were a few tools that showed package deps, but maybe not as a dag Jan 27 09:09:02 goign to try : http://www.objectaid.com/class-diagram Jan 27 09:09:29 fairly tired been at it for 14 hours so far.. :! Jan 27 09:09:57 ha Jan 27 09:10:05 one thing i still miss from eclipse is the xml editor ordering all my attributes Jan 27 09:10:07 i'm guessing that didn't really happen Jan 27 09:10:18 hehe, its a joke from Conan Jan 27 09:10:32 miss that too i Jan 27 09:11:03 Ah ha! TO anyone who would like to generate class diagrams using an eclipse plugin : http://www.objectaid.com/ Jan 27 09:11:17 lasserix honestly ... Jan 27 09:11:24 ? Jan 27 09:11:33 uml class diagrams are for noobies Jan 27 09:11:38 what do you use? Jan 27 09:11:49 the most interesting part is the dynamic Jan 27 09:12:00 object interaction Jan 27 09:12:06 that's what i am for :) Jan 27 09:12:39 i just wanted to quickly get some print outs so i dont have to sketchout the architecture, just explain its interaction Jan 27 09:12:41 what's a good 'standard' way of organizing an open-source android library? Jan 27 09:12:44 and i never used UML ex nihilo Jan 27 09:13:02 when communicating, its important to know who and what Jan 27 09:13:16 honestly i just want a diagram of the classes as a print out :p Jan 27 09:13:19 some stakeholders want to see a certain part of the model Jan 27 09:13:31 just a /lib/ library with the java code, and a /samples/ with sample apps? or... just the project root? but then that kind-of restricts it to eclipse/AS Jan 27 09:14:13 assuming this is on github or something that uses git, so cloning it brings in the entire repository Jan 27 09:15:45 otiose see how Square does theirs Jan 27 09:15:58 look at dagger maybe Jan 27 09:16:06 i saw them do it a couple different ways (the two i mentioned) Jan 27 09:16:11 but don't stare directly into it Jan 27 09:16:11 :/ Jan 27 09:17:48 oh look, its JakeWharton, who has the last commit on the master branch on Dagger Jan 27 09:20:02 well they're all pretty similar, seems like a decent model to follow Jan 27 09:20:27 /library, /sample, /website, textfiles, pom.xml Jan 27 09:20:30 thanks Jan 27 09:21:03 i wouldn't use library/ and sample/ Jan 27 09:21:09 i'd do foo/ and foo-sample/ Jan 27 09:21:45 ah, you mean like the picasso project? Jan 27 09:21:58 yeah Jan 27 09:22:16 plays nicer with IDEs, matches the actual artifacts that are produced Jan 27 09:22:25 that makes a lot of sense Jan 27 09:22:47 and i see you're .gitignoring most of the IDE files, so its IDE agnostic Jan 27 09:22:49 which is nice Jan 27 09:23:08 I'm using GCM for sending push notifications. Even though message is getting delivered I still get an error "Could not wake device" Jan 27 09:24:30 I believe delay_while_idle is by default, some the notification should be waking the device up Jan 27 09:38:05 I want save state of my fragment, but onSaveInstanceState method called only if parent activity status changed, which I don't need Jan 27 09:38:22 What can I do? Jan 27 09:47:20 Flank_Y320-U30, You want to save state across Orientation Changes? Jan 27 09:53:29 brickhead, this case too. Using preferences now, it's slowly for my application (one activity - many fragments) Jan 27 09:53:43 why is Html.fromHtml(string) escaping my quotations? Jan 27 09:55:53 brickhead, actually I changing fragments in vertical orientation now, and when I call another fragment, I need to save state of current fragment Jan 27 09:58:18 finally got instrumentation tests working :o Jan 27 10:07:42 Flank_Y320-U30, have you tried setRetainInstance() Jan 27 10:14:32 where is the default installation folder of apk on the android file system? Jan 27 10:15:28 brickhead, I writed setRetainInstance(true); at the beginning of the method onCreateView Jan 27 10:17:12 yes that should save your fragments instance across Orientation changes Jan 27 10:18:02 aloah Jan 27 10:18:19 brainv, you can find it at data/data/com.YOURAPPLICATION.NAME Jan 27 10:18:56 but I got your question, you want to swap fragments and want them to save their instances across Jan 27 10:19:09 yes Jan 27 10:19:12 Why is reloading them fresh is so expensive for you? Jan 27 10:20:18 Do you think that using a Handler + Looper is an efficient way to process sensordata? (send Messages inside onSensorChanged() ?) Jan 27 10:20:51 brickhead, this is conception of my app. I don't know another way to load new screen with visual interface so fast Jan 27 10:24:08 Flank_Y320-U30, Try doing a transction.show () instead of replace http://stackoverflow.com/a/13088867/1042963 Jan 27 10:33:09 Uh. Jan 27 10:33:10 Guys? Jan 27 10:34:11 hola Jan 27 10:34:21 Hey mactar. Jan 27 10:34:31 shutdownhook works on application crash ? Jan 27 10:41:54 could anyone point me to information about how to handle sensordata processing without loosing information? I dont quite understand how to efficiently use a new thread inside onSensorChanged Jan 27 10:43:20 is there an iBeacon library for android? Jan 27 10:44:13 Ankhwatcher: haven't heard of one. They are just Bluetooth, though Jan 27 10:44:52 p_l: yeah my boss is an iOS guy with a big hard-on for iBeacon Jan 27 10:45:06 How can I view all the TRAVEL_AND_LOCAL applications in Google Play Store sorted by number of downloads or by number of ratings? Jan 27 10:46:00 Ankhwatcher: personally given how iOS-oriented iBeacon appears, I kinda don't see it getting far :P Jan 27 10:47:26 p_l: sadly, it will in this company. Jan 27 10:48:37 this https://play.google.com/store/apps/category/TRAVEL_AND_LOCAL ? but what is the sorting criteria ? Jan 27 11:10:52 Hi guys, im a littlebit confused with the aapt tool. Why is it only creating the R.java for the main package and not for the others??? Jan 27 11:11:58 what do you mean others Jan 27 11:12:04 as in other packages in your application? Jan 27 11:12:05 well Jan 27 11:12:15 or other packages in library projects Jan 27 11:12:22 like code with other package name in same project Jan 27 11:12:32 only 1 R will be generated with everything in it Jan 27 11:12:48 R is generated from things under res/ Jan 27 11:12:49 hhm but its actualy missing stuff Jan 27 11:13:09 like what, ids? Jan 27 11:14:48 is there any android wysiwyg editor except for eclipse? I don't use eclipse normally so it would be great if there where any alternatives that works for simple layouts Jan 27 11:14:51 Does anyone else have a problem with their Nexus 4 restarting a few times a day? Jan 27 11:15:03 I'm wondering if mine is starting to wear out Jan 27 11:15:11 CallumTaylor : like any resource string etc. Jan 27 11:15:21 never had that problem with mine - logcat it :) Jan 27 11:15:23 its like Jan 27 11:15:24 whats the name of your string resource file Jan 27 11:15:29 it occassionally restarts while I'm taking pictures or using it as a flashlight Jan 27 11:15:37 in eclipse i have a project with serveral packages Jan 27 11:15:48 and eclipse would create a R.java for each Jan 27 11:15:57 Ankhwatcher: you running some weird custom ROM ? Jan 27 11:15:59 but aapt aint Jan 27 11:16:33 asfdd: intellij or android studio ? Jan 27 11:16:39 it should only generate 1 r.java for each main package in every project you have linked to your app Jan 27 11:17:06 bankai_: nope, unrooted completely stock Jan 27 11:17:27 I was so happy with stock I didn't want to touch it Jan 27 11:18:09 just there the phone restarted while I was taking screenshots Jan 27 11:18:46 weird ... i'd plug it in and try to make it crash and check logcat Jan 27 11:23:38 Hey ... when I use a ListFragment in a ViewPager ... when I scroll to the right listFragment I want to update the list .. but the getListAdapter(); returns null Jan 27 11:23:47 please help me :) Jan 27 11:24:54 I try getListAdapter() in the onPageSelected() of the ViewPager Jan 27 11:31:29 Sirolf, quite hard to help u without viewing the code. Jan 27 11:39:15 I'm getting an error when trying to run Gradle with the Android plugin: "Could not download artifact 'com.android.tools.lint:lint-api:22.5.0:lint-api.jar'". Anyone seen this before, any ideas? Jan 27 11:40:16 Hi, anyone knows how i should find out what causes a ClassNotFoundException ? Jan 27 11:41:06 when a class wasn't found Jan 27 11:42:36 hhm i understand :) but it should be availble.. Jan 27 11:44:05 you sure you haven't spelt the class name wrong, or not included the full package path? Jan 27 11:44:13 Anyone know if there's a channel for xda-developers? Jan 27 11:45:49 yes Jan 27 11:45:50 "#xda-devs" Jan 27 11:47:18 aaah, my classes.dex is not recieving the right classes i think.. Jan 27 11:51:04 * alankila toys with the idea of building android project with just maven and without adt Jan 27 11:51:47 alankila: the idea is feasable, I've done it in the past for a medium size project Jan 27 11:52:26 I'm not sure how much sense it makes, other than that being able to build project from command line sounds useful and while it's obvious to wonder why maven and not gradle, suffice just to say that I'd prefer a single tool Jan 27 11:54:27 not fond of gradle puking files all over the project and frequently needing to be updated. How hard can it be to build something anyway? I'm almost tempted to build a project entirely from scratch just to see what short of minimal shell script could handle most android apps. Jan 27 11:56:31 is there any documentation for fest-android? javadocs or something? Jan 27 12:33:43 I'm getting compiler errors while trying to build the project `yaaic` using android-studio. http://paste.ubuntu.com/6825950/ Jan 27 12:36:08 It's clear the test packages cannot import the application packages. I exported the project using the Gradle build option of eclipse. Had to do some project-fu on the versions in the various build.gradle files Jan 27 12:36:57 I'm still learning the android workflow, so it is very likely something simple I am missing/overlooking Jan 27 12:44:15 anyone knows what this is in catlog: 01-27 01:27:42.971: E/Sensors(576): sensors_poll_context_t::pollEvents, line 202: receive event #### i=2, nb=0 Jan 27 12:44:28 fires around every second Jan 27 12:51:21 jaDule https://gitorious.org/xdandroid/device_xdandroid/source/fef368f7e6d4ec82a7eeae39cc85b556cae58014:msm/libsensors/nusensors.cpp Jan 27 12:52:24 unfortunately this does not tell me much :( Jan 27 12:52:56 yay .. finally after 6 months of development we went live with the new version of our app .. 100% Android Studio and gralde (didn't start off that way but we converted back on AS 0.1) Jan 27 12:53:09 now just waiting for everyone to upgrade Jan 27 12:53:16 1m-5m installs on old version Jan 27 12:53:34 What app is that? Jan 27 12:53:35 kinda awesome :) and a big relief heh Jan 27 12:53:38 mxit Jan 27 12:53:48 social network / chat app Jan 27 12:54:00 been around since 2004 Jan 27 12:54:15 this http://www.mxit.im/l/login.aspx?AspxAutoDetectCookieSupport=1? Jan 27 12:55:17 You arrived late in the market with those features? Jan 27 12:55:24 yes no kidding :/ Jan 27 12:55:31 i have been fighting on this side Jan 27 12:55:35 but they kept saying nah Jan 27 12:55:37 nah .. nah Jan 27 12:55:48 and then finally they listened so we redid the app Jan 27 12:56:16 lost a lot of users initially hopefully brand loyalty will help us not loose more ppl that upgrade form j2me to android Jan 27 12:56:31 You need to be more "exclusive" Jan 27 12:57:09 first phase .. get on par with other chat apps .. phase n .. be the better more exclusive :) Jan 27 12:58:04 That'll take more time with whatsapps 450 million up ahead Jan 27 12:58:11 yeah no kidding Jan 27 12:58:24 and we had 50million users before whatsapp started Jan 27 12:58:34 mainly on j2me though Jan 27 12:58:59 So you guys have the app on all platforms? Jan 27 12:59:01 this company was a bit late and the more i tell them we lost the race before we started they didn't want to listen .. Jan 27 12:59:05 but you know management Jan 27 12:59:08 yes all Jan 27 12:59:26 android, bb, wp, j2me Jan 27 12:59:39 iOS? Jan 27 12:59:39 lemonxah send me the official website pls Jan 27 12:59:42 yes iOS Jan 27 13:00:15 know i was missing one just couldn't remember which one Jan 27 13:00:50 the WindowsPhone client is a bit outdated but we have one on there that works, and have a new version on the way Jan 27 13:02:12 it seams very nice, good job~ Jan 27 13:02:17 thnx Jan 27 13:03:48 I'm gonna try the beta Jan 27 13:03:52 i already post on my twitter Jan 27 13:04:51 razor the beta is older Jan 27 13:04:54 its 1143 Jan 27 13:05:00 the release we just made is 1168 Jan 27 13:05:14 beta will get updated with new features again in a week or 2 Jan 27 13:05:18 :) Jan 27 13:05:34 ok, the stable for now then Jan 27 13:05:51 :) Jan 27 13:05:55 You have a share option right? Jan 27 13:05:57 yes Jan 27 13:06:03 yes we do Jan 27 13:06:47 heh thnx fBirD Jan 27 13:07:11 you can invite me if you want :) Jan 27 13:07:15 when an activity with fragments changes screen orientation ... what happens with the fragment instances? Jan 27 13:07:28 Sirolf, they get recreated Jan 27 13:07:36 well no Jan 27 13:07:42 the fragment manager stores them Jan 27 13:07:48 but they get paused and resumed Jan 27 13:08:07 ah Jan 27 13:08:26 before the pause the onSaveInstanceState is called Jan 27 13:08:39 which you can use in the onCreateView(..) to restore state Jan 27 13:09:59 okay thanks Jan 27 13:10:12 no worries Jan 27 13:11:51 They get recreated unless you call setRetainInstance Jan 27 13:12:49 If I have a project that references an older Build Tools version. Is it better to install the older version via my SDK manager, or to update the .gradle file(s) android:buildToolsVersion to the most recent version? Jan 27 13:13:30 SunPowered, as long as you dont use the new features in the tools you can use the old versions of the build tools Jan 27 13:13:43 but xxxhdi resources doesn't work in older build tools Jan 27 13:13:54 just one example of features that gets added Jan 27 13:14:44 lemonxah: ic, so it would be version-dependent if I manually forced a newer build tools version. i.e. 17->19? Jan 27 13:15:25 what do you mean version-dependent? Jan 27 13:15:31 what would be dependent? Jan 27 13:15:36 whether it would compile or not? Jan 27 13:15:45 not to the newer ones Jan 27 13:16:03 newer tools are backwards compatible Jan 27 13:16:33 ah, so it is better to increase the buildToolsVersion in the projects' build.gradle Jan 27 13:16:47 but build tools 17 or 18 wont build if there is a resource folder for xxxhdpi Jan 27 13:16:59 yes generally Jan 27 13:17:09 right, decreasing the version can lead to compatibility issues. Jan 27 13:18:14 it felt wasteful to have to have all these legacy versions hanging around Jan 27 13:27:43 lol just realized .. 1168 builds, it took 1168 builds for us to reach a live client .. that is alot Jan 27 13:31:22 lol I'm up to > 8800 builds and my app is still in beta Jan 27 13:31:39 heh :) that is also alot Jan 27 13:31:53 although i count running to a device a 'build' Jan 27 13:31:57 well we did a complete rewrite of the old version and 1168 is only since the rewrite started Jan 27 13:32:06 I'm on my third app re-write :/ Jan 27 13:32:11 heh Jan 27 13:32:18 ours is just CI build counts Jan 27 13:32:29 CI? Jan 27 13:33:32 Continuous integration Jan 27 13:33:39 ah Jan 27 13:33:48 teamcity or jenkins(hudson) Jan 27 13:39:50 so lemonxah .. what if I call a public method of a ListFragment from the Activity ... ? I find that all the members of the fragment are null :S Jan 27 13:41:14 I mean ... in the ListFragment method I try updating the listAdapter ... but for some reason it's gone Jan 27 13:41:23 Sirolf, you should not instantiate the Fragment with a constructor Jan 27 13:41:41 cause the fragment manager can recreate your fragments when ever it sees fit Jan 27 13:41:58 so you should pass the information in with a bundle using .setArguments Jan 27 13:42:07 and .getArguments in the onCreateView Jan 27 13:42:12 it's not a constructor Jan 27 13:42:36 and then all subsequent data should be store in the onSaveInstanceState and then repopulated in the onCreateView Jan 27 13:43:28 so for example you have a int val in oncreateview you have to check if instanceState != null and then get the int val from it instanceState.getInt("MyKEY") Jan 27 13:44:00 best is for you to show code Jan 27 13:44:10 cause i dont exactly know what you are doing Jan 27 13:44:11 yeah I know ... maybe we'll make up a pastebin Jan 27 13:44:47 but the thing is there is a getAdapter() method in a ListFragment right? Jan 27 13:45:11 i have not worked a lot with ListFragment but there should be Jan 27 13:45:26 well ... it gives back null after rotating the screen Jan 27 13:45:30 should be called getListAdapter Jan 27 13:45:39 yes that one ;) Jan 27 13:45:59 but that is based on the activity not the fragment Jan 27 13:46:18 getListAdapter() Jan 27 13:46:18 Get the ListAdapter associated with this activity's ListView. Jan 27 13:46:22 http://developer.android.com/reference/android/app/ListFragment.html Jan 27 13:46:37 hmm Jan 27 13:46:49 Hi. Is possible to define a color which is inherited from another color ? (EG: @color/ltgray) Jan 27 13:46:55 so how do you update the list then? Jan 27 13:47:08 just pastebin the code and the stacktrace please Jan 27 13:47:35 okay I'll see what I can do ... not my own code Jan 27 13:47:36 :) Jan 27 13:48:04 yes shineworld Jan 27 13:48:22 using this definition I've got an error Jan 27 13:48:44 just tested it in my values files Jan 27 13:48:51 have not started the app Jan 27 13:48:53 ok... I will check for bug Jan 27 13:49:02 do you have a stacktrace? Jan 27 13:49:35 might not be possible i dont see mention of it in the documentation Jan 27 13:49:43 It's possible Jan 27 13:51:33 thanks now works Jan 27 13:51:51 shineworld, what did you change? Jan 27 13:52:11 cause it works for me from the start what did you change to make it work? Jan 27 13:52:51 was a bug in another resource which stopped the evaluation of resource in edit Jan 27 13:52:55 lemonxah the problem seems to be that after rotating the screen .. there are new fragment instances ... but there's no way to access them .. only getFragmentByTag() or smth would be possible but the tag can't be set through a ViewPager it seems Jan 27 13:53:00 happens with Eclipse Jan 27 13:53:15 but always hard to understand what happen Jan 27 13:54:17 Sirolf, the fragment manager should handle that for you thats why i was asking to see the files to find out what it is that is causing it Jan 27 13:54:40 yes the fragment manager handles it fine ... it can find the fragments Jan 27 13:54:50 but we ourselfs can't access it's methods Jan 27 13:55:09 anyway ... I know it's hard to help without the code Jan 27 14:00:36 is there a shortcut in intellij to jump from an @id+ xml section in the layout to the code which might construct the java instance? Jan 27 14:01:34 yes Jan 27 14:01:37 alt-f7 Jan 27 14:02:09 will show all usages Jan 27 14:02:16 then you can click on the one you want to see Jan 27 14:02:21 In what ide? Jan 27 14:02:34 intellij / android studio Jan 27 14:03:00 Hi, it's possible to see or download the auto backup? I use android 4.2.. Jan 27 14:03:08 is the IntelliJ IDEA deafult keymap Jan 27 14:03:28 mocas i dont understand your question Jan 27 14:03:44 I have an entry on definitions "Backup and restore" Jan 27 14:04:02 I would like to see what backups I have on google account Jan 27 14:04:31 For where are made the backups? google drive? Jan 27 14:05:28 mocas i am not sure i have not used that function on the phone .. you could ask in #android as this channel is for android-development Jan 27 14:06:43 ok, thks Jan 27 14:08:04 alt-7 isnt really what I wanted but thanks anyway - it works but interrups flow with a grep like output needing navigating. cheers. Jan 27 14:09:13 read again rgr Jan 27 14:09:17 its alt-f7 Jan 27 14:09:34 yes, I mean that. thanks. Jan 27 14:09:37 I use that before. Jan 27 14:09:40 typo Jan 27 14:09:40 oh ok Jan 27 14:10:00 what did you mean then? Jan 27 14:10:15 do you want to see the java code that instantiates that item Jan 27 14:10:31 ie. to new TextView(..) ? Jan 27 14:11:50 cause something like that doesn't exist Jan 27 14:11:52 the cleverness of the auto completion in intellij continues to amaze me. fantastic. Jan 27 14:12:14 and yes, thats what I was hoping for. but no worries. m-F7 does it too. Jan 27 14:12:33 (M===Alt in my emacs speak) Jan 27 14:13:57 LayoutInflater uses reflection to create the objects Jan 27 14:14:03 yes Jan 27 14:14:28 there is now .. "design.java" for screens in android Jan 27 14:15:45 no** Jan 27 14:15:46 lol Jan 27 14:15:51 confusing am i Jan 27 14:18:24 oh I see with the inflater. nice. all new to me. Jan 27 14:20:06 lemonxah : http://pastebin.com/4AcyCw19 Jan 27 14:23:10 Sirolf, do you only want to access the current fragment? Jan 27 14:23:15 I want to develop hybrid apps and looking for the right tools, environment and quick start guide. Can't find something straight to the point. Any suggestions for a good tutorial? I have already played with with Android SDK in Eclipse and already built a simple working native app, but can't get it to build a hybrid app. Jan 27 14:23:35 whats a hybrid app? Jan 27 14:24:44 you mean multi platform (as in os) or just device? or both? Jan 27 14:24:48 hybrid as in NDK and SDK mixed? Jan 27 14:25:19 rgr: this --> http://blogthinkbig.com/en/web-apps-versus-native-apps-versus-hybrid-apps/ Jan 27 14:25:51 rgr: basically, mobile app and native app in one app Jan 27 14:26:15 so a web app in a native frame, like phonegap or jquery mobile Jan 27 14:26:19 there is no standard. Except maybe javascript ... ;) Jan 27 14:26:28 mobile app .. on an android which is mobile is native .. sry just Jan 27 14:26:33 don't use web apps, they are bad! Jan 27 14:26:37 ^ Jan 27 14:26:47 webapps = worst apps int he world Jan 27 14:26:56 just use webservices with native apps Jan 27 14:26:58 rgr: a mobile app is simply put just a html5 script, but since it can't access the phone functions they introduced the hybrid app which has more access to phone functions. Jan 27 14:26:59 Any web apps you know? Jan 27 14:27:09 no matter what people say about html/js apps, they are bad Jan 27 14:27:17 most of the major webapps turned to native because webapps are too slow Jan 27 14:27:18 some fullfile their requirements. you cant get some very powerful webapps. Its silly to discount them. Jan 27 14:27:29 s/cant/can Jan 27 14:27:40 see you later. thanks again for the help. Jan 27 14:27:44 html/js .. on android not a good cool Jan 27 14:27:49 yes lemonxah Jan 27 14:27:54 especially with the new web view update... Jan 27 14:28:10 i've seen nothing but bad experiences with the chromium web view on KK Jan 27 14:28:18 Html on android seems easy Jan 27 14:28:23 I don't want to build web apps. Instead I want to build hybrid apps. Jan 27 14:28:34 how about php on android? Jan 27 14:28:45 but I can't find good useful info on how to build hybrid apps. Jan 27 14:28:50 all a 'hybrid' app is, is a web app that just has some addition native functionality like accessing GPS/camera Jan 27 14:28:57 Sirolf, have you tried adapter.getItem(position) ? Jan 27 14:29:10 html app are good for multi plataform and dont required to much process power Jan 27 14:29:10 razor-, you mean like php to build a web page on android? or actually do php scripting -> java Jan 27 14:29:10 as far as i gathered from your link Jan 27 14:29:26 razor-: php on android? How does that work? That's just a web app which can't access the phone functions, and I need to access phone functions. Right? Jan 27 14:29:28 Sirolf, http://developer.android.com/reference/android/support/v13/app/FragmentPagerAdapter.html#getItem(int) Jan 27 14:29:29 fBirD, even if it requires just a tiny bit of animation it typically fails Jan 27 14:29:33 i've always known a hybrid app to be, content made using html/js with content injection, and list views written natively Jan 27 14:29:38 jonc-1: A web page on android Jan 27 14:29:39 lemonxah yes... at line 14 Jan 27 14:29:51 you can't php on android (afaik) Jan 27 14:29:52 razor-, then you are talking a web app Jan 27 14:29:53 oh lol soz my bad Jan 27 14:29:57 ;-) Jan 27 14:30:28 jonc-1: yes, but without html Jan 27 14:30:46 ok Sirolf problem is that you cant have state in your fragments Jan 27 14:30:57 so the getItem should return a new instance of that fragment Jan 27 14:31:07 Like facebook maybe, even though it's way too slow Jan 27 14:31:12 when building a webpage with php you output html / have php sections inside of html Jan 27 14:31:18 CallumTaylor: well, that's what I need. A web app with additional native functionality. It needs to access for example the phone call history & stuff. Not going to do any fancy graphics stuff. Jan 27 14:31:19 and use savedInstanceState to keep state Jan 27 14:32:00 well you can't go from html->js so you'd have to get that data natively (using java) and pass it to the web view as you load it Jan 27 14:32:08 doge_wow2, then why not just make it native? Jan 27 14:32:11 hmm Jan 27 14:32:15 CallumTaylor: pure web app is not something I can use Jan 27 14:32:15 Sirolf, look at this example Jan 27 14:32:16 http://developer.android.com/reference/android/support/v13/app/FragmentPagerAdapter.html Jan 27 14:32:20 in the class overview Jan 27 14:32:25 the way I used to do it was to call webView.loadUrl("javascript:some_function()") Jan 27 14:32:34 which would execute the javascript in the webview Jan 27 14:32:51 hmm Jan 27 14:33:02 the .newInstance(int position) thing Jan 27 14:33:12 it creates a new fragment of said type Jan 27 14:33:22 and does a .setArguments(new bundle) Jan 27 14:33:26 jonc-1: because 1) I've been struggling with native since december, still on page 25 and 2) hybrid app will work on all platforms, so I don't need to specialize in iOS apps. Jan 27 14:33:32 I've worked on webapps and the headache involved with animations and even creating a decent sized list without slowing the system down is pretty terrible Jan 27 14:33:36 that is the pattern that google is driving Jan 27 14:33:56 doge_wow2, you will still have to specialize all the native code (getting phone history etc) Jan 27 14:34:22 jonc-1: yeah, that's true Jan 27 14:34:34 and android and iOS both have different UI best practices, it is best to give the user the experience they are used to Jan 27 14:34:35 its a bit of a schlep to set it up propper but unfortunately there is no other decent way to do it without causing memory leaks Jan 27 14:34:36 jonc-1 like i said for complex app the html app aren't a good solution Jan 27 14:34:57 and what does go wrong in my code now then? Jan 27 14:35:02 for small app the html is a cheap solution for companies Jan 27 14:35:09 doge_wow2, if i install an app and its a web-app / hybrid .. i uninstall immediately Jan 27 14:35:12 fBirD, if it is anything more than a form, don't do webapp Jan 27 14:35:14 and remember: you get what you pay for Jan 27 14:35:15 cause of slow behaviour Jan 27 14:35:46 animations are horrendous in webapps, the lists aren't optimized like a listview is (recycles views) Jan 27 14:35:59 jonc-1 more than a form is a bit drastic, but yes the user experience with html app are very bad Jan 27 14:36:07 the adapter gets recreated most probably Sirolf Jan 27 14:36:15 which makes the fragment = null again Jan 27 14:36:16 lemonxah: do you have an example of a simple web-app / hybrid which is slow? The simplest app without any fancy graphics Jan 27 14:36:27 you can get one good with top phones, but the others is painfull Jan 27 14:36:43 doge_wow2, fancy graphics = better designed art, the images aren't really the issue Jan 27 14:36:54 yes RSG radio sonder grense made an app its hybrid install from play store but SUPER slow and anoying Jan 27 14:37:05 lemonxah: what makes the hybrid / web-app so slow? Jan 27 14:37:10 javascript Jan 27 14:37:10 javascript Jan 27 14:37:13 Sirolf, just take out the initialization on the local vars Jan 27 14:37:17 but lemonxah ... the getItem() gives new instances right? Jan 27 14:37:19 dont make them = null Jan 27 14:37:27 its adding an extra layer of abstraction to the already slow java Jan 27 14:37:32 yeah I know they're wrong Jan 27 14:37:55 Sirolf, mChartManagerPagerAdapter = new ChartManagerPagerAdapter(fm); creates a new adapter the whole time Jan 27 14:38:02 so? Jan 27 14:38:17 which means the getItem() after rotate will always return a new fragment Jan 27 14:38:29 cause it checks mChartSetsFrament if its null Jan 27 14:38:40 and a new adapter = null fragments Jan 27 14:38:51 if you rotate the screen oncreate on activity is called again Jan 27 14:38:56 so do this Jan 27 14:39:06 hmm Jan 27 14:39:09 javascript and manipulation of dom really Jan 27 14:39:10 its a semi fix dont use for release Jan 27 14:39:25 ok Jan 27 14:39:32 if (mChartManagerPagerAdapter == null) mChartManagerPagerAdapter = new ChartManagerPagerAdapter(fm); Jan 27 14:39:57 and take out the = null; from ChartSetsFragment mChartSetsFragment = null; so that you have ChartSetsFragment mChartSetsFragment; Jan 27 14:40:01 a lot of the UI elements are optimized for android (listview recycling views for the list) whereas you don't get that for web pages (unless you code all the optimizations in the webapp yourself) Jan 27 14:40:21 in which case its no point you may as well just do it in java Jan 27 14:40:22 should get you what you want but its not the best solution Jan 27 14:40:31 the getItem should always just return a new instance Jan 27 14:40:51 cause getItem is only called from the fragment manager if there is no item at that position Jan 27 14:40:59 every company I've worked with / talked to employees of that started with a webapp, ended up changing to native Jan 27 14:41:11 okay Jan 27 14:41:12 after wasting months on a webapp Jan 27 14:41:51 i know a company who did the same Jan 27 14:41:52 jonc-1 i have the same experience in company that i alredy worked Jan 27 14:41:55 spent like years doing it Jan 27 14:41:59 but you can try what i have suggested for a quick solution but it will still have bugs if the fragment manager kills the fragment Jan 27 14:42:03 i think they were called Facebook or some shit Jan 27 14:42:21 has anyone ever seen an "Unable to execute dex: Java heap space" dialog error when using Eclipse + ADT to launch? Jan 27 14:42:28 doge_wow2, its slow cause the entire ui comes from the web Jan 27 14:42:53 so in countries like mine where its slow to start off with .. you click on something and it appears to not do anything Jan 27 14:42:59 and then all of a sudden something happens Jan 27 14:43:03 it can come from the phone lemonxah, but dom manipulation is slow (and can even be a bottleneck on desktops) Jan 27 14:43:32 if you get the html from the phone itself .. then why have it html .. for cross platform? Jan 27 14:43:58 sry i am just .. if its not native then i dont want it Jan 27 14:43:58 that's why a lot of people initially go webapp, yes Jan 27 14:44:04 I am the same way Jan 27 14:44:18 initially till they find out its more of a hassle Jan 27 14:44:22 meh .. Jan 27 14:44:25 sry i am just .. if its not native then i dont want it, so true xD Jan 27 14:44:38 agreed, that is what we are all saying, webapps are not worth it Jan 27 14:45:24 if you really want to do android and iphone Jan 27 14:45:26 having a webview in a native app for certain things isn't terrible (we used it for our terms of service / privacy policy so we didn't have to update the app to update them) Jan 27 14:45:29 look at something like xamarin Jan 27 14:45:39 and code it in C# then you have 2 native apps Jan 27 14:46:10 How to save/restore fragment state using bundle? onSaveInstanceState doesn't called Jan 27 14:46:32 lemonxah won't the screenrotation always set all members of the activity to null? Jan 27 14:46:43 Mornin'! Jan 27 14:46:46 no Jan 27 14:47:01 just calls it's own onCreate then? Jan 27 14:47:21 but not the onDestroy? Jan 27 14:47:26 yes unless the app was dormant for a while wich will recreate it from scratch Jan 27 14:47:40 in which case the adapter will be null and the oncreate will recreate that Jan 27 14:47:44 hmm... okay. I will continue with native apps then. But I need some help because it's quite difficult. I have built so far a native app which can switch between activities, but passing data between the activities is already a little bulky. I wouldn't call it a challenge though, but whenever I need to pass data between activities I have to look this up in the book again. Jan 27 14:47:49 okay Jan 27 14:48:18 doge_wow2, with the intent.setArguments(bundle) Jan 27 14:48:24 doge_wow2: just remember, intents are used for starting activities and what not Jan 27 14:48:42 well this is strange Jan 27 14:48:45 and use bundle.setInt/setString/setParclable( .. ) Jan 27 14:48:46 you use the bundle class to pass data, if you type new Bundle().put it will suggest all the different things you can parse Jan 27 14:48:51 doge_wow2, I found it easier to learn fragments Jan 27 14:49:12 then you can call startActivity(intent) Jan 27 14:49:22 single activity for an app Jan 27 14:49:34 +1 jonc Jan 27 14:49:38 lemonxah: CallumTaylor: yes, I use the bundle stuff to transfer data, but I can't do it by heart. I need the book's example whenever I want to build an intent and set the flags for the intent. Jan 27 14:49:44 I'm testing on three devices, I uninstalled on all three of them, then I reinstalled and switched to the map view, on two of the devices a map loaded. But on my Nexus 4 the map didn't load or center on my location Jan 27 14:49:53 doge_wow2, we all started there Jan 27 14:50:00 you don't really need to set flags, you'll get used to it though Jan 27 14:50:07 the autocomplete helps Jan 27 14:50:38 CallumTaylor: I need to set the flags for the stack, otherwise it will increase the stack and cause problems in the end. Jan 27 14:50:50 you don't need to worry about the stack Jan 27 14:51:01 CallumTaylor: autocomplete sure helps, that's true. I'm using Eclipse. Jan 27 14:51:11 ctrl+space is your friend Jan 27 14:51:18 oki Jan 27 14:51:29 if you are manually manipulating the stack doge_wow2 then you are doing something wrong and not part of the android design guidelines Jan 27 14:51:39 lemonxah ... the PagerAdapter always seems to be set to null again after rotation Jan 27 14:51:51 I will continue with native apps and ask you guys for help with specific problems. Jan 27 14:52:06 (with the check if == null) Jan 27 14:53:27 lemonxah: in the example from the book, they started off with a simple example (no stack manipulation), but then when you switch between activities 10 times, you need to press "back button" 10 times to exit the program. That's default behaviour and usually not desirable. Jan 27 14:53:51 should not be using 10 activites Jan 27 14:54:02 that is what fragments are for Jan 27 14:54:06 has anyone ever seen an "Unable to execute dex: Java heap space" dialog error when using Eclipse + ADT to launch? I tried the solution in this question (http://stackoverflow.com/questions/5943712/conversion-to-dalvik-format-failed-unable-to-execute-dex-java-heap-space) but that isn't helping. It seemed to start after I included the ShowcaseView library, not sure if that is coincidence or not. About to try without it. Jan 27 14:54:13 lemonxah: no, only 2 activities and switching between those 2 activites a few times. That's what I mean. Jan 27 14:54:20 the fragment manager does the rest for you and you can doa .popBackstack() on fm Jan 27 14:54:45 Sirolf, what state does your fragments need to keep? Jan 27 14:54:55 is it possible to create new instances rather? Jan 27 14:54:56 doge_wow2 use startActivityForResult(); Jan 27 14:54:57 lemonxah: I need a fragment to switch between activities? You mean use fragments instead of intents? Jan 27 14:55:11 Sirolf: oki, thnx! Jan 27 14:55:12 and let the fragment manager handle the getItem as it needs it Jan 27 14:55:31 doge_wow2, 1 activity can contain multiple fragments Jan 27 14:56:36 think of a fragment as a mini activity Jan 27 14:56:37 Sirolf, did you write that code cause the fragment state was lost? or did you write it because you were afraid of state loss? Jan 27 14:56:41 lemonxah ... I don't care about the state ... I just need to access the actual fragment from the activity ... so i can call mFrag.updateChartList(); in onPageSelected() Jan 27 14:57:10 Sirolf, then just return a new instance from getItem Jan 27 14:57:13 but there is a fragment manager that can take care of replacing, keeping track of the stack, adding etc fragments to your app Jan 27 14:57:36 and you can have more than 1 fragment active at a given time Jan 27 14:57:51 i think my issue is that i dont know why you want to call something on the fragment from the activity could you give an example Jan 27 14:58:21 well Jan 27 14:58:30 jonc-1: I am looking up fragments now with google. Are you saying a fragment is a kind of tab within 1 activity? Jan 27 14:58:46 doge_wow2, not a tab but a view component Jan 27 14:58:49 when you slide to the second fragemtn ... which is a listfragment ... you want to update the listadapter inside that fragment Jan 27 14:58:54 it can be part of tabs Jan 27 14:58:58 doge_wow2, a fragment is a PITA Jan 27 14:58:58 ^ Jan 27 14:59:17 OH .. :) Sirolf you shouldn't update that list from the activity Jan 27 14:59:21 I find fragments much easier, and creates cleaner code than having activities Jan 27 14:59:25 that is why we were talking past eachother Jan 27 14:59:26 then how? Jan 27 14:59:30 hehe Jan 27 14:59:36 ok each fragment should be self contained Jan 27 14:59:40 yes Jan 27 15:00:03 so in the fragment's onCreateView get the listadapter and update it from there Jan 27 15:00:03 but the listadapter in the fragment can't create a new listadapter because it needs a context from activity right? Jan 27 15:00:10 lemonxah: oh okay... I already looked into swyping and it seemed so difficult, but I guess swyping needs to be done with fragments then. And after you swype from 1 fragment to another fragment, you will still be in the same activity? Jan 27 15:00:28 a fragment contains code to deal with itself and to transistion to the next part of an app (the next fragment) if any. That is how I design all of my fragments Jan 27 15:00:31 your fragment will then have a .newInstance method that will build up the bundle that will be set as the .setArgument Jan 27 15:00:34 GNUton: never heard of a PITA, lemme google that Jan 27 15:00:46 PITA = pain in the ass Jan 27 15:00:50 that way even on rotate the fragment known what data it should get and it should get its own data Jan 27 15:01:02 the activity should only be a container not a controller Jan 27 15:01:30 yes doge_wow2 you will be in the same activity Jan 27 15:01:31 so I should get the items for the listadapter in the fragment through that bundle? Jan 27 15:01:42 yes Sirolf Jan 27 15:01:56 like from a SQLite db Jan 27 15:02:11 damn ... seems awful Jan 27 15:02:15 or how ever you get the data but the fragment should be selfcontained Jan 27 15:02:21 not really Sirolf cause look at it this way Jan 27 15:02:31 fragments that are self contained can be used in any activity Jan 27 15:02:36 that's true Jan 27 15:02:40 or even in a widget Jan 27 15:02:50 and all you have to do to get it to work there is Jan 27 15:02:51 hmm Jan 27 15:02:58 okay lemme try it Jan 27 15:03:15 do a fragment transaction and add a MyFragment.newInstance(bundle) Jan 27 15:03:24 and it handles its own drawing and what not Jan 27 15:03:28 makes sence? Jan 27 15:04:47 hope it makes sense :) Jan 27 15:05:09 lemonxah, how to save/restore fragment state using bundle? onSaveInstanceState doesn't called Jan 27 15:05:34 or not by bundle Jan 27 15:07:01 Flank_Y320-U30, the onSaveInstanceState is called by the system to ask the fragment to save its current dynamic state Jan 27 15:07:17 this correspons to the activity.onSaveInstanceState Jan 27 15:07:24 and that bundle gets saved Jan 27 15:07:52 so that later when your fragment gets recreated you have to restore the state(the restore is not automatic) Jan 27 15:07:59 lemonxah, yes, but I changing fragment without touching activity Jan 27 15:08:08 1 activity - many fragments Jan 27 15:08:22 its fine just saying the fragment will call it by itself Jan 27 15:08:32 if you change the fragment manually the state will be lost Jan 27 15:08:52 onSaveInstanceState is only used by the system to save state Jan 27 15:09:09 for example on rotate or if the system dicides to kill your fragment Jan 27 15:09:13 then its called Jan 27 15:09:25 if you replace fragments in your app with code then the state is lost Jan 27 15:09:38 you will have to manually handle state loss in such an event Jan 27 15:10:00 im using MediaStore.ACTION_IMAGE_CAPTURE to send user to the camera & get the taken photo in a bitmap via onActivityResult; but how can i make a File from that returned bitmap? Jan 27 15:11:50 Flank_Y320-U30, does that make sense? do you change the fragments? or is your state lost after rotating or after the phone sleeps for a while? Jan 27 15:12:54 Hey! I need to draw a line on a Fragment (I'm using tabs with achartengine). I get an x value which was touched and want to draw a vertical line over the whole view. Any idea how to do that? Thanks. Jan 27 15:13:49 in layout you can just make a Jan 27 15:13:58 KNUBBIG, first thing that comes to my mind would be to take the fragment and have it be a relative layout, and then have what your UI actually is inside of that Jan 27 15:13:58 ontop of the other view :) Jan 27 15:14:17 lemonxah, yes it is. I replacing fragment manyally, see that pls http://pastebin.com/Ym23gyVW Jan 27 15:14:20 And I use onPause to save state and onResume to load state Jan 27 15:14:20 and then just possition that view relatively Jan 27 15:14:23 when the user presses the X add a "View" with a background color that is Xpixels wide to the relative layout Jan 27 15:14:42 The problem is I know how to load state, but can't save it Jan 27 15:15:01 jonc-1: lemonxah thanks, I'll try that Jan 27 15:15:56 lemonxah ... if I try to make the fragment selfcontaining ... how do I know when it's about to be selected? Jan 27 15:16:10 in a viewpager? Jan 27 15:16:16 there is no onPageSelected() like in the viewpager Jan 27 15:16:29 yes Jan 27 15:16:37 you dont need to know when its about to be selected what do you want to do before its selected? Jan 27 15:16:50 update the items in the list :) Jan 27 15:17:11 dont need to know if its going to be selected or not Jan 27 15:17:32 no but I want it to be updates everytime it's selected right? Jan 27 15:17:45 in onCreateView you inflate the view Jan 27 15:18:40 that one is called every time? Jan 27 15:18:44 it's shown? Jan 27 15:19:12 yes Jan 27 15:19:25 so in onCreateView you inflate your layout if you have one Jan 27 15:19:27 and in onViewCreated(View view, Bundle savedInstanceState) Jan 27 15:19:36 you can bind your data like populating your list Jan 27 15:19:51 that gets called each time it gets selected Jan 27 15:20:01 ah okay Jan 27 15:20:27 fragments are really cool but takes some time to understand completely Jan 27 15:21:00 fragments are not perfect, but they are 1000x better than using a bunch of activities Jan 27 15:21:40 fragments has come a long way and i think they do well for what they were intended Jan 27 15:21:54 lemonxah, have you seen my small code? Jan 27 15:22:33 lemonxah fragments realy help a lot, but for beginners in android its kind a complex Jan 27 15:22:39 the management :) Jan 27 15:23:05 fBirD, agreed, but I'd argue that it is easier than managing Activities, so you should learn it early Jan 27 15:23:06 i have Flank_Y320-U30, what kind of state do you want to save when the fragment dies? Jan 27 15:23:48 jonc-1, it took me a few months to wrap my head around how exactly they are supposed to be used and i still learn something new about them every day Jan 27 15:24:06 so i have a fairly good understanding but its by far not a perfect understanding :) Jan 27 15:24:09 lemonxah, I want save TextView text and selected dropdown values Jan 27 15:24:33 1 TextView, a few dropdowns Jan 27 15:25:44 My first experience with fragments has in a company that use a big framework developed by them, and de complex meter has like x10 Jan 27 15:26:08 my first week its like my head its gonna blow up Jan 27 15:26:09 xD Jan 27 15:26:23 fBirD, so I take it they didn't make the fragments self contained Jan 27 15:26:58 Flank_Y320-U30, you will have to store that info somewhere i know you know that :) but i have not yet had to cater for something like that maybe store it in a headleassfragment Jan 27 15:27:03 headlessfragment Jan 27 15:27:15 fBirD, today is the first day of the third week for me and I guess I'll have to work with them for the first time D: Jan 27 15:27:16 then from the other fragments you can just query the data from the headlessfragment Jan 27 15:28:24 lemonxah, is that way fatster than using preferences? Jan 27 15:28:43 Flank_Y320-U30, it stores it in memory not on disk so its faster than preferences Jan 27 15:28:55 the first experince with fragments has in this https://play.google.com/store/apps/details?id=com.jumia.android app Jan 27 15:29:04 its also more correct in that you are not saving non preference data in preferences Jan 27 15:29:19 thank you, I'll google what is headlessfragment Jan 27 15:29:29 i always like to think of .. if a user cant change it .. it doesn't belong in sharedprefferences Jan 27 15:29:37 fBirD, looks really clean Jan 27 15:30:10 jumia its like amazon for african continent Jan 27 15:30:34 the struct of this projects its fucking uge Jan 27 15:30:40 haha Jan 27 15:30:46 fBirD, you are in africa? which country? Jan 27 15:30:53 portugal Jan 27 15:30:57 the project I am working on is actually fairly clean Jan 27 15:31:16 oh .. :) Jan 27 15:32:05 guys and gals thnx for listening to me rambling on .. :) and i am glad that what little knowledge i have might have helped some of you :) but i need to head home its quiting time Jan 27 15:32:08 in this project the biggest problem is heap memory overflow Jan 27 15:32:19 because has lot of images Jan 27 15:32:42 and with universal loader for images in some phones the memory runs out Jan 27 15:33:07 fBirD, check out picassa Jan 27 15:33:22 fBirD, yeah that is a problem with my app also, the only problem is I am only trying to load like ~7 images, they are just nearly fullscreen Jan 27 15:33:30 I have even tried recycling the bitmaps Jan 27 15:33:37 but that doesn't work Jan 27 15:33:56 lemonxah .. i put the updateChartsList() in the onViewCreated() of the fragment ... but it never gets in the onViewCreated() except for the first time Jan 27 15:33:57 (always errors out even though all images are the same size, format, even set the dpi the same) Jan 27 15:34:01 i mean picasso Jan 27 15:34:11 lemonxah i will check Jan 27 15:34:14 JakeWharton 's baby .. hehe its really well done Jan 27 15:34:41 https://plus.google.com/+JakeWharton/posts/VbGWfbUTdTt Jan 27 15:35:18 What is the common way to push data to a thread (e.g. for storing on disk or uploading to server)? Jan 27 15:35:36 hmmm getLaunchIntentForPackage says it throws an exception when a package isn't found, but the sources don't have a throws property Jan 27 15:35:45 Sirolf, cause after that its in the fragment manager its not been recreated yet Jan 27 15:35:58 jaDule, will the thread be running before hand? or will you be starting a new thread? Jan 27 15:36:14 new thread Jan 27 15:36:27 only if the fragment manager runs out of memory or the system tells the fragment manager to destroy it will it be recreated Jan 27 15:36:37 Sirolf, check out fragment lifecycle Jan 27 15:36:41 it will help a lot Jan 27 15:36:42 then make a class that implements runnable and send it through the constructor Jan 27 15:36:45 lemonxah i will try the lib when i arrived home ;) Jan 27 15:36:59 i give you the feedback latter ;) Jan 27 15:36:59 i have the UI Activity - from there i start a service extednging SensorEventListener... and i want to fill a buffer with sensor data which should be processed by a thread once buffer is filled Jan 27 15:37:43 so using runnable is best practise there? Jan 27 15:38:24 Sirolf, if you want to "refresh" the data everytime Jan 27 15:38:28 that you view it Jan 27 15:38:33 i was thinking having one dedicated thread running where u can pass new data to once buffer is filled Jan 27 15:38:33 then check out the onResume() Jan 27 15:38:37 is the last thing to get called Jan 27 15:38:45 before a running fragment Jan 27 15:38:52 jaDule: yeah I recommend use of something like LinkedBlockingQueue Jan 27 15:38:58 so in your onViewCreated you put the inital data binding Jan 27 15:39:04 or maybe fire uImagine you had an over-sized hardcover book on your coffee table. On the modern and matte dust jacket is a picture of you. Underneath that image is a piece of brilliant looking and easy reading typography that elegantly proclaims one word: “SELFIES." Jan 27 15:39:08 shit Jan 27 15:39:09 and put the refresh code if you want into the resume Jan 27 15:39:20 cause at that point you know the view is created and bound Jan 27 15:39:23 anyway Jan 27 15:39:24 i have to run Jan 27 15:39:26 copy-paste error. I meant to say: fire up an asynctask per buffer Jan 27 15:39:28 they are lightweight Jan 27 15:39:50 thanks for all the help lemonxah :) Jan 27 15:39:54 no worries Jan 27 15:40:03 asynctask mhh Jan 27 15:40:11 hope this new path of enlightenment teaches you all the wonders of fragments :) Jan 27 15:40:12 guys, I thank you for your help. I will hang around in here some more to learn from you. Jan 27 15:40:13 cheers Jan 27 15:40:34 np Jan 27 15:40:47 * lemonxah doesn't teach cause he is still learning Jan 27 15:40:49 jaDule: the asynctask approach can work because there's a single thread in the default execution pool waiting for work items, so you can in theory just set up a task to handle it and let it go through the queue when it has a chance Jan 27 15:41:11 where to create the queue? Jan 27 15:41:31 and how to pass data to the asynctask Jan 27 15:41:49 public class sensordataprocessor extends asynctask<...> { } Jan 27 15:42:04 pass data objects need in constructor. Jan 27 15:42:27 and then i just need one instance and can use that for all jobs? Jan 27 15:42:42 no? I'm saying, make a task whenever you have a full buffer to process Jan 27 15:43:08 making an asynctask doesn't actually create a thread or anything like that. It's basically just some futuretask that goes into an executorservice. Jan 27 15:43:45 so in my sensor thread i would have something like new SensorProcessingTask(buffer) Jan 27 15:44:09 and it would do its thing and die afterwards Jan 27 15:44:58 that is it, though it doesn't "die", it is simply a work item for an executorservice. Jan 27 15:46:07 anyway this is just one method. If you like to roll your own, by all means set up a linkedblockingqueue and then queue items there and have a thread sleeping on take() waiting for work to do. Jan 27 15:46:33 this matches a more ordinary producer-consumer model Jan 27 15:46:47 jaDule, start by reading the book, java concurrency in practic Jan 27 15:46:50 but the asynctask is really kind of the same thing. Jan 27 15:46:50 come back after Jan 27 15:47:25 ok - thank you Jan 27 15:47:31 pfn - will have a look Jan 27 15:47:55 there's also intentservice, another alternative given by android for doing producer-consumer things. Depending on use case it may be better fit. Jan 27 15:48:17 they key consideration is that intentservice is fairly suitable for ui-less background processing tasks that take a long time. Jan 27 15:48:36 I have an EditText that won't lose focus once the user is done with it. Jan 27 15:48:42 technically they are not ui-less, but the intentservice works in the notification bar area Jan 27 15:48:42 it's the only one on the page Jan 27 15:49:32 So having a service polling sensordata and then starting asynctasks for writing to disk is rather stupid? Jan 27 15:49:45 polling is stupid Jan 27 15:49:46 no Jan 27 15:49:48 I added another EditText and focus sticks to the one last used. Jan 27 15:49:49 unless there is no way to do it Jan 27 15:50:04 is there a way i can drop focus once the user stopped entering values? Jan 27 15:50:06 use of service should be considered when continuous application behavior without foreground activity is desired Jan 27 15:50:16 that is all services are good for Jan 27 15:50:23 i think in a sensordata collection scenario that is given Jan 27 15:50:32 which sensor data is a a good service task Jan 27 15:50:42 sensor data collection doesn't require polling Jan 27 15:50:47 polling like pfn said is bad unless that is the only way to do it Jan 27 15:50:53 tho i noticed a service started from UI blocks UI.. why its not a thread by default Jan 27 15:51:03 because services are not threads Jan 27 15:51:16 you create a thread in your service to do the work Jan 27 15:51:21 all android callbacks occur on the main thread Jan 27 15:51:30 services also need to take wakelocks and they may need to setup foreground service notifications to prevent android killing service abruptly, or device going to sleep inconveniently. Jan 27 15:51:32 but if you are using BLE I suggest crying, because it has major issues in android 4.3 and 4.4 Jan 27 15:51:35 if you need threading, you must use it explicitly Jan 27 15:51:39 but as the purpose of a service is to do task in the "background".. Jan 27 15:51:47 jaDule, no, it isn't Jan 27 15:51:54 it's to provide lifecycle management outside of foreground activities Jan 27 15:52:07 * alankila has to underscore that IntentService is an exception to general rule because it does maintain a single thread that handles intents in a service context. Jan 27 15:52:13 Hi, In my app, the user must have the possibility to take a picture and I need that picture with a fixed width/height. What's are the possibilities to do this? Take image in app or with camera intent? Jan 27 15:52:27 it is designed as a kind of serial executor with some wiring premade for you Jan 27 15:52:58 mh ok then i dont really get the benefit of the service over creating a new thread and do the work there Jan 27 15:53:05 besides having lifecycle functions Jan 27 15:53:07 a service is lifecycle management Jan 27 15:53:12 which is /important/ Jan 27 15:53:13 as I said, service is *for* doing things when no activity is visible. Jan 27 15:53:22 a thread has no lifecycle management Jan 27 15:53:28 if that's something your application needs to do, a service is what you want Jan 27 15:53:36 android cannot control when a thread starts/stops Jan 27 15:53:39 => bad Jan 27 15:53:44 and if you don't understand why => bad Jan 27 15:53:50 :) ok ok Jan 27 15:54:06 service can contain members and methods which can be accessed by any bound activity ... so it saves alot of passing through work Jan 27 15:54:23 Sirolf: that particular use case has never worked for me though Jan 27 15:54:37 i will go with the asynctasks for now Jan 27 15:54:42 using bound activities without ipc is useless Jan 27 15:54:44 though it feels hackish Jan 27 15:54:45 why is testing on android still really shit Jan 27 15:54:47 s/activities/services Jan 27 15:54:49 it has for me ... in some caes Jan 27 15:54:50 Asynctasks aren't that great either Jan 27 15:54:51 cases Jan 27 15:54:55 really shit? testing on android works fine... Jan 27 15:54:55 the primary problem being that it is not possible to bind to a service synchronously. If you know you need to call a service method, like, right now, you have to do the bind dance and then wait for the callback to fire and can only then do the stuff Jan 27 15:54:59 by default they are serially threaded Jan 27 15:55:18 alankila, there is no reason to use a binder with a service if you'rfe not doing ipc Jan 27 15:55:21 Sirolf: this means that you need asynchronous apis when working with services. Jan 27 15:55:32 your best bet is to control the threading yourself with ExecutorServices Jan 27 15:55:49 making asynctasks execute concurrently is easy Jan 27 15:56:02 executeOnExecutor(AsyncTask.THREAD_POOL_EXECUTOR,...) Jan 27 15:56:05 it is, you pass an executorservice to it :P Jan 27 15:56:09 pfn: oh, I fully agree. I'm just basically discouraging having activities talk to services, I guess. Jan 27 15:56:19 it's just made too difficult in the vanilla android style Jan 27 15:56:25 alankila, I don't agree with that, I would prefer to expose the service as a singleton Jan 27 15:56:37 and activities can talk to services that way, provided ipc is not a concern Jan 27 15:56:53 pfn: okay, but it seems kind of "dirty". Not that I care very much. Jan 27 15:56:54 I need to store max 10 images from the camera (300x300px), what's the best, internal or external storage? (speed is important too) Jan 27 15:56:59 it seems pretty terrible to me. Jan 27 15:57:25 alankila, not particularly dirty, using a binder is dirty... Jan 27 15:57:35 pfn: he he, fair enough Jan 27 15:57:59 using a service as a singleton is regular java, assuming you obey all the usual lifecycle rules Jan 27 15:58:05 I mostly just use an event bus for service > activity stuff Jan 27 15:58:08 FrancescoV: internal storage is at least as fast as external Jan 27 15:58:11 Intents the other way Jan 27 15:58:43 e.g. that's how Context.systemService() treats every service Jan 27 15:58:44 as a singleton Jan 27 15:58:52 you don't have to go through service binding bullshit to use any system service Jan 27 15:59:07 what is the proper way to include the support library in your project along with other 3rd party libraries that also depend on the support library? Im using pull-to-refresh along with ShowCaseView, but adding ShowCaseView made my project go haywire. I am pretty sure it is because two of the same dexfiles were being generated, both the support v7 library. Jan 27 15:59:10 (although, they're all bound in the background) Jan 27 15:59:22 FrancescoV: 300x300 images seem tiny assuming jpeg or similar compression. Are we talking even 10 kB here? You should be able to write the stuff in like milliseconds provided you can live with kernel syncing the data to disk with delay. Jan 27 15:59:37 theblang, don't include it in your project, because it's included transitively Jan 27 15:59:55 pfn but what if two 3rd party libraries use it? Jan 27 16:00:09 theblang, then remove it from one of the 2 3-rd parties Jan 27 16:00:17 either that, or change your dex rule to exclude one of them Jan 27 16:00:30 as for AsyncTask - is it given that if i start 2 tasks in the same thread they are processed sequentially? Jan 27 16:00:43 jaDule: there's a long and sad tale about google dithering on the matter Jan 27 16:00:45 alankila, The user must take max 10 images (300 x 300) and I need those images later Jan 27 16:00:53 the answer is, they are serially executed on most devices. Jan 27 16:00:55 jaDule, on api14+ if you don't specify the executor, they are sequential Jan 27 16:01:12 ok Jan 27 16:01:16 good Jan 27 16:01:20 * pfn hates asynctask Jan 27 16:01:22 * pfn shrugs Jan 27 16:01:45 so verbose, and non-composable Jan 27 16:01:52 then again, my futures are verbose and non-composable Jan 27 16:01:56 er, verbose, but composable Jan 27 16:04:03 might seem like a strange Q but hopefully you'll get my gist : is there an intellij feature or plugin to hilite code so I can see "in place" if something is a direct method, inherited method etc without needing to bring up the type or method hierarchy on the right? Jan 27 16:04:35 rgr: java has an annotation called @Override which I'd recommend putting everywhere inheritance is intended. Jan 27 16:04:41 Hi guys. Anybody developring with Android rootfs on NFS here? I'm having a problem on Android 4.3 because of this patch: https://github.com/android/platform_dalvik/commit/9907ca3cb8982063a846426ad3bdf3f90e3b87c2 Jan 27 16:04:46 rgr, quick-inspect Jan 27 16:04:47 eclipse at least can auto-add that annotation Jan 27 16:04:51 I always get "Unable to find mount point for /system", because indeed my system is just a folder inside /, not a mount point. Anybody has already dealt with this problem? Jan 27 16:05:05 rgr, quick definition Jan 27 16:05:19 * pfn binds it to ^I Jan 27 16:05:21 * pfn shrugs Jan 27 16:05:28 ^I for definition, ^J for javadoc Jan 27 16:05:42 oh, ^D for javadoc (doc mnemonic) Jan 27 16:05:59 meh, no wonder I couldn't launch debug with ^D, heh, I made it ^G Jan 27 16:06:27 (mnemonic: -g flag in javac and cc) Jan 27 16:06:43 yeah I know wuick inspect. thats a totally different thing I think. It brings up a model dialog needing one to actually trigger it. I was thining more of something in the editor itself but cheers anyway. javadoc is C-q by default too. Jan 27 16:06:59 yeah, wtf does ^Q mean... Jan 27 16:07:00 jeepers my typing's getting worse. Jan 27 16:07:08 * pfn boggles at some default keybindings Jan 27 16:07:17 it's quit in many apps.... Jan 27 16:07:33 anyway, quick inspect doesn't need triggering to tell you if it's override or locally defined Jan 27 16:07:45 true but handy in the context of the IDE. Jan 27 16:07:58 and why would you need to trigger it, hit escape to clear it Jan 27 16:08:03 you don't need to trigger it Jan 27 16:08:17 ? You said you use ^i Jan 27 16:08:25 or are we at cross purposes? Jan 27 16:08:30 yeah, to pop it up in the ide Jan 27 16:08:37 how else do you want to see it Jan 27 16:08:39 in the editor? Jan 27 16:08:45 write a plugin if it's not syntax highlighted for you already Jan 27 16:08:59 lol.... ok... Jan 27 16:09:10 assuming syntax highlighting is what you want Jan 27 16:09:16 maybe someone's already written such a plugin Jan 27 16:09:38 erm, yes, thats what I was asking. Thanks for your suggestion to write one myself anyway.... ;) Jan 27 16:10:09 well, what do you expect, this isn't #intellij Jan 27 16:10:18 pfn I am still a bit confused, because if I remove the support library from the third party library then it throws compile errors. So they both need it, but then I can't launch because there are two of them. Jan 27 16:10:56 pfn I guess the thing to do is remove it from my own project, and then my own project will grab it from the library that has it? Jan 27 16:10:57 theblang, remove it from your dex command Jan 27 16:11:05 yes, you remove it from your own Jan 27 16:11:10 every time my tests crash, gradle just hangs indefinitely until i kill the emulator process. great. Jan 27 16:11:12 you can make one of the libraries depend on the other Jan 27 16:11:16 is services' onDestroy called reliably? Jan 27 16:11:23 Zaba, depends on what you call reliably Jan 27 16:11:32 onDestroy is never guaranteed to occur Jan 27 16:11:39 because a process may always be killed Jan 27 16:11:44 hm Jan 27 16:12:10 pfn this is really making me appreciate build systems like Maven and Gradle. I am considering moving to Android Studio for the Gradle system. I'm noticing that all the third party libraries I download have gradle files with them Jan 27 16:12:35 pfn, makes sense, thanks Jan 27 16:14:28 theblang, so switch already Jan 27 16:15:02 storkme, and gradle sucks, of course... Jan 27 16:15:12 gradle is alright Jan 27 16:15:38 not for running rests, apparently Jan 27 16:15:54 works fine for me in intellij and elsewhere Jan 27 16:15:59 the state of testing on android is pretty grim. Jan 27 16:16:09 hey all. i am a beginner with java (1st prog lang), and would like to build apps under android studio (intellij) . I have been in admin/net/sec for 20 years. Does anyone know of a good resource for a beginner learning java for android dev? thanks. Jan 27 16:16:36 ^^ i want to understand concepts and coding, not just the ide Jan 27 16:16:43 grim in what sense, works ok, and plenty of tools like robotium Jan 27 16:17:01 sideone, learn java first Jan 27 16:17:18 read thinking in Java and jcip Jan 27 16:17:27 is there a good resource for learning java with a path to android? Jan 27 16:17:58 No, jumping into android without knowing java is a recipe for fail Jan 27 16:18:36 pfn; agreed. the most i have done with scripting/programing is some perl and powershell Jan 27 16:18:38 you can, but all you end up writing will be crap Jan 27 16:18:42 pfn; is that the book? http://www.goodreads.com/book/show/71672.Thinking_in_Java Jan 27 16:18:57 i haven't tried robotium.. I did try roboelectric for a while but it was no good (spent too long trying to find workarounds for issues with gradle). Jan 27 16:19:03 it'll work well enough Jan 27 16:19:12 thanks pfn Jan 27 16:19:39 robotium is for UI testing ala selenium Jan 27 16:19:57 basic unit testing in android is solid Jan 27 16:20:05 is it easier to get set up than plain old instrument tests Jan 27 16:20:09 robolectric is unnecessary Jan 27 16:20:24 robotium runs atop instrument Jan 27 16:20:56 and setting up instrument test is ridiculously easy... Jan 27 16:21:25 i must be ridiculously stupid Jan 27 16:22:10 No comment ;) Jan 27 16:22:30 cunt. Jan 27 16:23:38 can't get mockito working :/ dependency issues. Jan 27 16:26:19 * pfn generally avoids mocks Jan 27 16:26:38 how do you, uh, 'mock' then? Jan 27 16:27:00 if I have to mock it's too much effort for testing Jan 27 16:27:08 wow Jan 27 16:27:35 what exactly are you mocking Jan 27 16:27:47 trivial things just write it out... Jan 27 16:27:57 or write a simple proxy Jan 27 16:29:34 i have a config object that gets passed into my fragment, the fragment uses this object to uhh.. configure itself. Jan 27 16:30:43 so just stub it out Jan 27 16:30:55 or actually load it Jan 27 16:31:44 that's a damn shame Jan 27 16:31:51 mockito is such a neater solution Jan 27 16:31:54 or would be ifi t worked Jan 27 16:33:06 "Multiple dex files define Lorg/hamcrest/Description;" Jan 27 16:33:31 then fix that in your build Jan 27 16:33:58 that's a nice idea, yes. Jan 27 16:34:57 how does one go about fixing that? dig through my dependencies, find out where the conflict is, then what? Jan 27 16:35:25 filter it out from the dex cimmand Jan 27 16:37:21 Why can't I get id or path from Picasa images in gallery ? Jan 27 16:41:49 should I use ExpandableListAdapter or BaseExpandableListAdapter? Jan 27 16:42:25 I don't really see the difference between them Jan 27 16:46:12 One is an interface the other is an abstract class Jan 27 16:46:30 The class provides implementation for e.g. notifyDataSetChanged Jan 27 16:47:50 http://developer.android.com/reference/android/widget/ExpandableListAdapter.html Jan 27 16:47:53 http://developer.android.com/reference/android/widget/BaseExpandableListAdapter.html Jan 27 16:48:04 the big diference is what SimonVT said Jan 27 16:48:38 Base class for a ExpandableListAdapter used to provide data and Views from some data to an expandable list view. Jan 27 16:51:42 so how do i exclude jars from the dex process using gradle? Jan 27 16:54:04 hey guys, any idea what could suddenly make my NativeActivity not work with the r9c NDK and the API Level 19 SDK? Jan 27 17:02:25 well *:* to my logcat helped a lot... Jan 27 17:07:13 hi all Jan 27 17:07:25 i have a question about loaders and URIs Jan 27 17:07:39 storkme, damned if I know, find the dextask and modify the inputs to it Jan 27 17:08:06 storkme, or just use mockito-core and let gradle manage dependencies, assuming you're pulling mockito-all Jan 27 17:08:39 suppose I have a base URI content://com.my.package/foo Jan 27 17:08:50 and a descendent URI content://com.my.package/foo/42 Jan 27 17:09:59 if i use ContentResolver.notifyChange(baseUri), will observers on the descendent URI also be notified? Jan 27 17:11:02 also, same question in reverse (notify change on descendent URI, will observers on base URI be notified?) Jan 27 17:12:19 i can't pull in mockito-all because mockito all has 'hamcrest' built in, one of the other libraries included is 'hamcrest' Jan 27 17:13:56 karakuri, documentation should spell that out Jan 27 17:14:22 karakuri, and if it doesn't, write a test case Jan 27 17:19:51 Hey guys, I've read through the docs and apparently we need to use smallestWidth selectors to design for different screen sizes. I'm confused about the whole thing. How do I know the smallest width? I've been designing and testing for the S3 but I want it to look the same on other devices e.g. nexus 4 and 5 and possibly tablets Jan 27 17:20:57 tablets are generally sw600dp Jan 27 17:21:13 CallumTaylor, what about s3 and nexus 4? How could I work it out? Jan 27 17:21:21 there's a graph somewhere, sec Jan 27 17:21:44 http://developer.android.com/guide/practices/screens_support.html Jan 27 17:22:09 so 600dp is 7" i believe Jan 27 17:22:32 Looks good on a 7" Jan 27 17:23:14 where exactly is the graph? :S Jan 27 17:23:23 down to "Configuration examples" Jan 27 17:23:30 Hey all Jan 27 17:23:33 they don't have specific devices though Jan 27 17:24:09 pfn: I cannot find documentation that answers this specific question Jan 27 17:24:18 I am integrating the Google+ Sign in my android app. I am getting Internal Error Message. Jan 27 17:24:36 pfn: if you've seen it somewhere, perhaps you can find a link to it? Jan 27 17:24:41 Anyone know why it so. I am using correct keystore file Jan 27 17:24:43 CallumTaylor, It looks like they've put anything that isn't 7" or above into 320dp :S Jan 27 17:25:11 do you need to match specifically nexus 5 and 4? or just the screen size Jan 27 17:26:11 http://android-developers.blogspot.tw/2011/07/new-tools-for-managing-screen-sizes.html Jan 27 17:26:14 Well, I've only tried the app on a nexus 4 and some of my buttons are a bit too low Jan 27 17:26:39 really doing sw matches is for massive layout changes Jan 27 17:26:49 rather than tweaks to make things fit on set devices Jan 27 17:27:11 CallumTaylor, oh I see, so what should I be doing instead? Jan 27 17:27:13 your layouts should be fluid enough that it will scale on devices with similar sizes (n4 and n5 are similar) Jan 27 17:27:25 I'm assuming you're using either px or dp for view sizes? Jan 27 17:27:45 I've created a progress bar (for battery life), and I want the content area of the background to be the progress bar, so I created a layer-list, set the background, but at progress = 100 the background is drawn over in an area where content is not supposed to be Jan 27 17:27:48 any ideas? Jan 27 17:27:55 CallumTaylor, yes dp Jan 27 17:27:56 rather than do that, use things like weights in LinearLayout, or use relative layout to make things fill spaceing Jan 27 17:28:43 the only time you should really use dp is when you're sure something should be a set size. For example in my app almost everything is either wrap_content or match_parent, with the exception of a couple views (such as a users' avatar) Jan 27 17:30:02 CallumTaylor, I see, but I can use dp for padding and margins right? And so, unless I'm designing for tablets, the only things I should be working on is this and the different image resources? Jan 27 17:30:20 yeah paddings and what not have to be a dimension, usually best to stick with multiples of 4dp Jan 27 17:30:29 in a perfect world, correct Jan 27 17:30:50 CallumTaylor, ahh awesome, *phew* why multiples of 4dp? Jan 27 17:30:54 with tablets though its not unusual to have a completely different layout to phones (which you can do using sw-600dp-land) Jan 27 17:31:08 i find it's generally a lot nicer than multiples of 5 Jan 27 17:31:29 also it rounds nicely with devices with 1.5px to the 1dp Jan 27 17:31:55 my authenticate(username, password) method returns a Boolean, however if there is a network error, it should throw an exception, right? Jan 27 17:32:20 Really just multiples of 2.. 4 made more sense when ldpi was a thing Jan 27 17:32:29 yeah Jan 27 17:32:35 That makes sense, and with regards to the different resource images, I've been using the xhdpi for my images ( I think it's correct?) How should I adjust for the different resolutions? Jan 27 17:32:37 How do I throw an Exception? and What exception should I throw? Should I throw a standard exception, or a predefined exception, or my own custom exception? Jan 27 17:32:46 i (personally) feel like anything < 4dp is a waste of time Jan 27 17:32:57 Different classes might handle .5 pixels differently Jan 27 17:33:06 I generally do xxhdpi and then scale down to the respective densities Jan 27 17:33:13 but only because I own and develop using a nexus 5 Jan 27 17:33:44 and what scale factor do I scale them down by Jan 27 17:33:54 ideally you have all your assets as a vector stored in _pre_production under your drawable folders, so you can resize them to any size without loss of quality Jan 27 17:34:14 https://github.com/asystat/Final-Android-Resizer this might help Jan 27 17:34:14 smallfoot-: how to throw an exception? `throw new Exception("You broke it!") Jan 27 17:34:16 so If I had an image that was x pixels for example is there Jan 27 17:34:19 ah Jan 27 17:34:54 hwrdprkns, I see, should I just throw "Exception" or should I throw "MyException", or is there some "NetworkException"? Jan 27 17:35:34 CallumTaylor, that's handy thanks, but just so I know what I'm doing is there a standard scaling factor for different resolutions? so x pixels divided by y Jan 27 17:35:58 smallfoot-: Pick an exception from https://developer.android.com/reference/java/io/package-summary.html Jan 27 17:36:01 http://developer.android.com/images/screens_support/screens-densities.png Jan 27 17:36:09 Forget about resolutions, it's all screen size and density Jan 27 17:36:31 smallfoot-: There is no general "Network exception" because that's pretty general. Though you can make one if it really helps you out. Jan 27 17:36:41 Hey guys... Why would I be getting an error like this: E/memtrack( 3612): Couldn't load memtrack module (No such file or directory Jan 27 17:36:51 hwrdprkns, thanks Jan 27 17:36:57 smallfoot-:np Jan 27 17:37:01 karakuri, api docs are always the source Jan 27 17:37:08 hwrdprkns, is it best to try use a existing exception or create a custom exception? Jan 27 17:37:08 Also, No JNI_OnLoad found in libnativehelper.so 0x0, skipping init ... Jan 27 17:37:13 hmm. intellij. Ive the cursor on a member variable which is a reference to an instance of class X. Whats the most convenient way of showing the methods available on this reference (ie same as triggering auto complete with C-space but in a pane). C-h is for the enclosing class. Type declaration comes close but it takes me to the class definition of the reference too - something I dont want. I just want to see the available methods Jan 27 17:37:13 without needing to trigger auto completion. Is this possible? Jan 27 17:37:21 smallfoot-: Existing, but that's just my personal preference Jan 27 17:37:27 hwrdprkns, I see Jan 27 17:37:38 CallumTaylor, So what I'm gathering is say my baseline which I believe is xhdpi, I'd have to make it two times smaller for mdpi? Jan 27 17:37:49 pretty much Jan 27 17:38:06 and then times that mdpi by 1.5 for hdpi Jan 27 17:38:07 cool :) Jan 27 17:38:11 okay i think I've got it Jan 27 17:38:13 hwrdprkns, if no existing exception is suitable, should I use the general "Exception" exception (the root of all exceptions) or create an own? Jan 27 17:38:23 create your own Jan 27 17:38:28 and throw RuntimeExceptions Jan 27 17:38:35 unless you have an absolute need that your users must catch Jan 27 17:38:46 fuck me what a load of shit Jan 27 17:39:38 thanks CallumTaylor Jan 27 17:39:51 np Jan 27 17:40:02 btw. asked this before: did anyone come across this: E/Sensors(576): sensors_poll_context_t::pollEvents, line 202: receive event #### i=2, nb=0 Jan 27 17:40:17 is this Android related or caused by my code :< Jan 27 17:40:59 jaDule, are you using bluetooth low energy? Jan 27 17:41:14 or just using the built in sensors? Jan 27 17:41:30 builtin 3dacc Jan 27 17:42:02 pfn: as I stated previously, I have looked at the documentation provided and cannot find an answer to this question Jan 27 17:42:26 if it doesn't say, then your question is answered Jan 27 17:42:31 it behaves as documented Jan 27 17:42:51 ... Jan 27 17:43:00 i can't tell if you are being serious or not Jan 27 17:43:28 Setting my spinner's width to wrap_content isn't working? What should i do? :S Jan 27 17:43:42 http://developer.android.com/reference/android/content/ContentResolver.html#registerContentObserver(android.net.Uri, boolean, android.database.ContentObserver) Jan 27 17:43:45 can you not read? Jan 27 17:44:02 If I try call any UI thing from a AsyncTask, will my app crash? Jan 27 17:44:28 smallfoot-: no, but you can't do UI things from doInBackground Jan 27 17:44:32 smallfoot-, do not call any UI from doInBackground Jan 27 17:44:39 any onXXX can call UI Jan 27 17:44:47 also you can't hold any references to any views or such from asynctask and expect them to still be current by the time you try to use them Jan 27 17:45:04 pfn, I called 'toast' from doInBackground, I think my app crashed. Is that why? Jan 27 17:45:11 maybe Jan 27 17:45:14 read the crash and see Jan 27 17:45:25 smallfoot-: the general answer is to update some global state cache variable, and send intent which you listen to. When you create a view, it can look up state from the global state cache, and if it is alive it can update itself from the intent. Jan 27 17:45:58 iirc Toasts aren't permissible from doInBackground. Jan 27 17:46:08 nothing on the UI is Jan 27 17:46:12 they are in general bad idea I guess, anyway. Too easy to miss. Jan 27 17:46:16 doInBackground* Jan 27 17:46:35 you can publish results from doInBackground to run things on the UI thread though Jan 27 17:47:03 publishProgress should be able to do the trick Jan 27 17:48:30 "Setting my spinner's width to wrap_content isn't working?" Anyone? Jan 27 17:49:51 Doesn't look like anyone is in the mood for play 20 questions Jan 27 17:50:11 What? Jan 27 17:50:41 You provide no information Jan 27 17:51:34 "My app doesn't work, any suggestions?" Jan 27 17:51:46 have you tried turning it off and on again? Jan 27 17:52:08 funny Jan 27 17:52:13 well i fixed it anyway Jan 27 17:52:16 I have a videoview in my fragment and the video is loaded in createView (and onResume), but if I go back from the backstack and then back to the videoview fragment, it is empty Jan 27 17:52:18 i was just being stupid :P Jan 27 17:52:21 what was the issue Jan 27 17:52:24 any idea? Jan 27 17:52:48 Can a Fragment do toasts? Jan 27 17:52:50 I had it aligning to something else on both left and right Jan 27 17:52:59 smallfoot-: yes Jan 27 17:53:09 smallfoot- yes Jan 27 17:53:12 I see Jan 27 17:53:24 I also have the same issue with ImageViews Jan 27 17:53:32 fragment is not a context, so I guess I'd say fragment can't do toasts Jan 27 17:53:32 but I cant call it with MainActivity.this, not with MyFragment.this, so I guess I should call it with getContext() ? Jan 27 17:53:47 you use getActivity Jan 27 17:53:53 I see Jan 27 17:54:18 smallfoot-: note that if you are working with asynctask, there exists a chance that getActivity returns null Jan 27 17:54:25 fragments are not always attached to an activity. Jan 27 17:54:28 hmm, so the fragment manager is not call onResume Jan 27 17:54:42 alankila, I see Jan 27 17:55:23 anyway I guess getApplicationContext() solves many issues that are too boring-to-tears to deal with otherwise Jan 27 17:55:51 at least that context doesn't go away and if whatever you do works with it, by all means go nuts with it Jan 27 18:03:25 When i do : Mainthread : Fill Buffer -> asynctask (buffer) -> do something with buffer Jan 27 18:04:00 how can i clear the buffer without communicating with async Jan 27 18:04:10 alankila, getActivity() is preferred over getApplicationContect() ? Jan 27 18:04:11 jaDule: new buffer[] Jan 27 18:04:13 let it go to gc Jan 27 18:04:37 good catch Jan 27 18:04:41 smallfoot-: I'm not sure in which situations activity is a better context than application Jan 27 18:05:05 I guess the rule of thumb is to always use the most specific context in case it supplies some useful bit of guidance to android framework or something Jan 27 18:05:22 smallfoot-: it depends on who you're asking Jan 27 18:05:24 but stuff like sending intents, I do on applicationcontext. It doesn't seem to matter. Jan 27 18:06:31 * alankila sees android as a wild rushing river. I know a few stepping stones that seem safe, and they're about enough to get work done. So, that's how I do it. Jan 27 18:07:15 to actually grasp how to use this pile of shit is to read the largely nonexistent manual, or the very existing but brain-hurting source code Jan 27 18:07:22 neither is very practical Jan 27 18:07:36 mh but new AsyncTask(buffer) buffer = new buffer would also interrupt the asynctask - the buffer cannot be anonymous i assume Jan 27 18:07:47 alankila: no one is forcing you to dev for android Jan 27 18:08:00 jaDule: java copies by reference. For sake of argument, let's say byte[] buffer is the tye. Jan 27 18:08:11 it doesnt mean he cant criticise it. It's not your mum. Its a professional tool. Jan 27 18:08:16 new FooTask(buffer).execute(); buffer = new byte[123456]; is just fine Jan 27 18:08:34 the "buffer" reference is copied by the asynctask constructor, and can be safely modified now. Jan 27 18:09:00 so then buffer.clear would also be no problem? Jan 27 18:09:04 or am i missing something Jan 27 18:09:19 jaDule: well that would be. It depends on what your buffer implementation is, but if you share it then you run into trouble Jan 27 18:09:33 I generally make new objects and let the GC deal with the garbage Jan 27 18:09:33 So the issue is ViewPager does not call onResume Jan 27 18:09:34 ArrayList Jan 27 18:09:53 jaDule: well I'd suggest making a new arraylist once you hand batch of work to the task to do Jan 27 18:10:24 so buffer = new ArrayList.. has different effect than buffer.clear inside the asynctask? Jan 27 18:10:28 thats odd Jan 27 18:10:36 jaDule: the arraylist type is not thread safe, so it can't be simultaneously validly used from where you collect data and consume data, unless you protect it by synchronized and are generally careful. It's just the wrong datastructure. Jan 27 18:10:59 jaDule: inside the asynctask? I think you do not understand what I suggested you to do. Jan 27 18:11:28 jaDule: my suggestion is: hand a buffer for asynctask to work with, and *forget* that buffer in your ui thread. Just make a new empty list and collect future work items there Jan 27 18:12:17 yes i got that right i just wondered why after passing the buffer in Task constructor i cannot do buffer.clear and start refilling. Jan 27 18:12:30 you can imagine that you pass the "responsibility" of the buffer forwards, from the sensor-reading and collecting part to the processing part. You can probably just forget the reference later on once you have processed it, and that "finishes" the reference. Jan 27 18:12:55 because you shouldn't share the same list where you collect data and process data. Jan 27 18:13:35 yes i get that problem but i did not know that a copy will still exist in the Task if i just kill the reference Jan 27 18:13:46 *in main thread Jan 27 18:13:58 ah. Well, java has no delete operation. Jan 27 18:14:07 interesting Jan 27 18:14:22 reference exists as long as it can be reached somehow. Once it can't be found anymore, it is called garbage and collect by the automatic memory management. Jan 27 18:15:06 ok makes it clear Jan 27 18:15:16 sweet image Jan 27 18:15:30 also all complex objects in java pass by reference. Only the simple primitives like byte, short, int, char, long, float, double pass by value. You can tell these from having lowercase leading letter in their name. Jan 27 18:15:54 :) Jan 27 18:16:37 then objects should make sure they have a reference somewhere otherwise big GC will come and wipe them when he goes round next time Jan 27 18:17:01 technically, even the references pass by a copy. It's just a number, after all, a handle for particular object, though java hides it from you. Jan 27 18:17:03 not having a reference to an object is bad, that's a memory leak Jan 27 18:17:21 (if GC wasn't collecting it) Jan 27 18:18:03 jaDule: that is an odd way of thinking. If you have no reference to an object, that object is worthless. It doesn't exist from a semantic point of view, because it can't be reached. Jan 27 18:18:26 ^ Jan 27 18:18:30 thats cruel.. Jan 27 18:18:34 (many objects represent resources like file handles, network connections, etc. these have extrinsic resources attached to them. The picture is a bit more complex here.) Jan 27 18:18:39 -> object just lost its last reference Jan 27 18:18:39 http://st.depositphotos.com/1037178/2168/v/950/depositphotos_21688097-Smiley-Vector-Illustration---Scared-Face.jpg Jan 27 18:20:54 ok asynctask seems working now Jan 27 18:21:06 indeed i read that its just meant for UI interaction -.- Jan 27 18:23:24 JakeWharton: you left OkHttp? Jan 27 18:23:32 http://corner.squareup.com/2014/01/meet-jake.html Jan 27 18:23:33 no? Jan 27 18:23:38 ? Jan 27 18:23:44 what's to leave? Jan 27 18:24:03 idk, he said he works there Jan 27 18:24:10 and then I read this Jan 27 18:24:44 OkHttp is a library Jan 27 18:25:06 lol Jan 27 18:25:50 hmmm Jan 27 18:26:02 thought it was a company, what do I know?! Jan 27 18:28:18 Can anyone here help me for integrating Google+ in the android app? Jan 27 18:28:28 Anyone uses Google+ ? LOL Jan 27 18:28:38 its googles facebook "me too" lol Jan 27 18:28:50 i use facebook and i think it fucking sucks Jan 27 18:29:03 but why the hell would i wanna use g+? its same thing as facebook Jan 27 18:29:13 it just changes my pimp from facebook to google Jan 27 18:29:15 im still a whore Jan 27 18:29:18 and both wanna be my pimp Jan 27 18:29:36 TGMCians: any questions? Jan 27 18:29:43 Yup Jan 27 18:29:44 what are you trying to do? Jan 27 18:29:50 the docs are pretty good Jan 27 18:30:17 I integrated the Google+ Sign button in the android app. I am using the correct package name and correct keystore file to sign the app Jan 27 18:30:24 ok Jan 27 18:30:35 But I am getting Error "Internal Error Occur" Jan 27 18:30:51 hmmm Jan 27 18:30:58 smallfoot-, if you use android, might as well use g+ Jan 27 18:31:03 because it's tightly integrated and works well Jan 27 18:31:05 unlike facebook Jan 27 18:31:16 can't even share in facebook without writing your app with their sdk Jan 27 18:31:18 lame shit Jan 27 18:31:22 #thepoosh, any idea of my issue? Jan 27 18:31:24 is your device G+ and play services updated Jan 27 18:31:24 nobody uses g+ Jan 27 18:31:25 ? Jan 27 18:31:29 smallfoot-: stfu Jan 27 18:31:38 Yup, I have Google Plus and updated Google Play Service Jan 27 18:31:55 try debugging and see the response you get from the SDK Jan 27 18:31:59 thepoosh, stfu u before i suck ur cock Jan 27 18:32:07 wut?! Jan 27 18:32:14 you heard me Jan 27 18:32:22 faggot Jan 27 18:33:42 #thepoosh, here is my logs http://pastebin.com/DPVKYaff Jan 27 18:34:15 I think you didn't configure it correctly in the Google admin pannel Jan 27 18:34:44 I configured well, start the Google+ API and using same keystore file which I used to get SHA Jan 27 18:35:17 he started it :( Jan 27 18:35:51 #thepoosh, Can you let me know any other thing which I missed Jan 27 18:35:52 I don't care, keep it out of this channel Jan 27 18:36:15 guys, how I can change something on android? I mean go to root mode Jan 27 18:36:25 stefkos: #android-root Jan 27 18:36:33 I must add one line to: /etc/udev/rules.d/99-android.rules Jan 27 18:36:46 oh thx Jan 27 18:37:58 TGMCians: did you set the scopes on the PlusClient? Jan 27 18:38:30 Where I have to set it? Jan 27 18:38:37 I only set in my java code Scopes.PLUS_LOGIN Jan 27 18:39:58 mPlusClient = new PlusClient.Builder(this, this, this).setActions("http://schemas.google.com/AddActivity”).build(); Jan 27 18:40:00 try this: Jan 27 18:40:02 TGMCians: Jan 27 18:40:08 Okay Jan 27 18:40:12 worked for me Jan 27 18:40:27 use the default values of scopes Jan 27 18:41:29 Can somebody help me get a bitmap to show up in my imageview? This is what I have so far: http://pastebin.com/GjffPnpM Jan 27 18:41:38 ive tried as a drawable, as a non-drawable... Jan 27 18:41:59 im just trying to take a picture and then have the taken picture show up in the space where the preview is/was Jan 27 18:42:05 thepoosh, I have still same issue Jan 27 18:42:13 same error? Jan 27 18:42:22 is you account logged in on the device? Jan 27 18:42:25 Yup Jan 27 18:42:51 weird Jan 27 18:43:00 hmm Jan 27 18:43:01 AphelionZ: you should use BitmapFactory Jan 27 18:43:19 TGMCians: SO is full with similar questions, start digging Jan 27 18:43:30 thepoosh: I tried that and I tried using one of the bitmaps ive already created there... Jan 27 18:43:31 I did but nothing worked for me Jan 27 18:43:49 weird stuff Jan 27 18:44:05 TGMCians: same thing happens when you add setScopes to the builder? Jan 27 18:44:06 That why I came here last to discuss Jan 27 18:44:14 yup Jan 27 18:44:34 AphelionZ: http://stackoverflow.com/a/15323921/1056359 Jan 27 18:44:50 i need a small hint. i have a fragmentactivity with two listfragments. one of those listfragments has an onitemclicklistener which removes the entry from my service. but i can't get it two automatically refresh the list, i tried "adapter.notifyDataSetChanged()" (adapter is my arrayadapter for that list) Jan 27 18:45:00 thepoosh: thanks, I'll try that and report back Jan 27 18:45:02 is this the correct approach or am i missing something? Jan 27 18:46:12 mrhanky: removing an item from the datastore doesn't mean it's removed from the adapter Jan 27 18:46:40 so i have to do something like "adapter.remove(object)" ? Jan 27 18:46:47 and then notify? Jan 27 18:47:04 thepoosh, Can you guess anything more for my issue? Jan 27 18:47:29 notifyDatasetChanged will always refresh, but unless you change the adapter dataset nothing will change in the UI Jan 27 18:47:49 TGMCians: I looked in my code, that works, and that is what I did Jan 27 18:48:02 Well Jan 27 18:48:30 TGMCians: did GooglePlayServicesUtil.isGooglePlayServicesAvailable(Context context) return true? Jan 27 18:48:46 thepoosh, but i can remove and add items to the arrayadapter list like a regular list, right? Jan 27 18:48:51 Yup, it exist Jan 27 18:48:58 I checked it manually in my application Jan 27 18:49:00 i want to prevent fetching all data on action Jan 27 18:49:08 Any guy who work for Google here on Google+ project (Integrating the Google+ in Android) Jan 27 18:49:37 Thanks thepoosh Jan 27 18:49:38 nvm thepoosh Jan 27 18:49:39 mrhanky: the adapter already has a copy of that data Jan 27 18:49:42 k Jan 27 18:49:52 think i got it, just had to looka t the api Jan 27 18:52:23 thepoosh: in your example, http://stackoverflow.com/a/15323921/142951, what kind of object is person_object? Jan 27 18:52:34 nevermind, found it Jan 27 18:52:49 thepoosh: Google Play Service version is 4.0.34 Jan 27 18:54:48 what path should I use if i want to access a file in res/raw? Jan 27 18:55:11 and can I use java.io.File or should I use something else? Jan 27 18:55:57 Resources has methods for reading raw files Jan 27 18:56:35 Syzygy: http://developer.android.com/guide/topics/resources/accessing-resources.html#ResourcesFromCode Jan 27 18:57:07 or even better Jan 27 18:57:09 http://developer.android.com/reference/android/content/res/Resources.html#openRawResource(int) Jan 27 19:02:34 My /emmc has 8gb, if I resize it to say 1gb using mke2fs in adb, would this allow me to add the equivalent freed up space to /data, or would this only change the size of the /emmc and /data folder and not the partitions themselves? Jan 27 19:08:35 thanks thepoosh Jan 27 19:08:44 Syzygy: pleasure Jan 27 19:09:15 Now I just need to figure out where I can get an instance of Resources from Jan 27 19:09:59 the code is called from a differen project, so I assume I can't just pass the context (since it's a different context) Jan 27 19:11:37 I'm trying to switch to Android Studio from Eclipse ADT. I did the export project option to generate a build.gradle file. I followed the instruction to use customizable gradle wrapper. I get a Resolve error that says Gradle version 1.6 is required. Current version is 1.9. The line of my gradle file throwing the error is apply plugin 'android'. Any suggestions for what I might could do to correctly import to Studio? Jan 27 19:12:18 ah well, time's over for today, going home. Jan 27 19:15:01 is it normal that the android emulator raises multiple errors if just starting? Jan 27 19:15:36 something like this: http://pastebin.com/79BJQCp2 Jan 27 19:16:09 i also have many of those: 52-129/? E/﹕ GraphicBufferAlloc::createGraphicBuffer(w=328, h=546) failed (Invalid argument), handle=0x0 Jan 27 19:16:24 mrhanky: sounds like google has added useful new warning, and they haven't got around to fixing all the old bugs yet Jan 27 19:17:10 so just ignore it? Jan 27 19:17:48 I would. Jan 27 19:17:52 okay :) Jan 27 19:17:57 it's not like you did anything to cause those things Jan 27 19:18:04 or that's what I expect Jan 27 19:18:26 theblang: its all over google that one. You need to modify the wrapper I think. I had that before dumped AS and went to intellij CE. Jan 27 19:19:36 problem/complexity being of course you need to get an inkling of what gradle is and how ti works. It using maven and downloading oodles of stuff doesnt help the confidence either. Jan 27 19:21:30 I had a moderately good experience on one simple project just by using intellij's built-in android builder Jan 27 19:22:07 no renderscript support there though, would have to go to gradle for that. I found it so poorly documented that I went back to eclipse and opened a bug about my frustrations in telling the renderscript compiler which version to target Jan 27 19:28:39 thepoosh: I tried that and I don't have a byte encoded string. I don't understand why I cant take the bmp variable from line 29 and use that inside of imageView.setImageBitmap http://pastebin.com/GjffPnpM (which I tried and didnt work) Jan 27 19:34:01 mrhanky: buy a second hand device. the emulator simply sucks. And I dont say that lightly. Its slow, buggy, and even freezes my linux desktop at times. Jan 27 19:34:22 yeah, it really sucks... Jan 27 19:34:58 but a phone just for doing some small university apps? nope Jan 27 19:35:32 What's a good approach to updating ImageViews in a viewpager after I get an onSuccess with the Bitmap Jan 27 19:36:01 Just setting the imageView.setImageBitmap(bitmap) doesn't seem like enough Jan 27 19:36:18 This is async Jan 27 19:42:44 actually it seems like just calling stopPreview gives you a nice enough sampling of what the image looks like... Jan 27 19:42:49 i think i can just leave it at that Jan 27 19:43:21 yiati, you mean with handling whether a fragment is being shown vs the image loading after someone has moved away from it? Jan 27 19:43:45 I think yeah Jan 27 19:44:05 it won't even show up for the first fragment Jan 27 19:44:48 Has anyone used Spoon to run Android unit tests? It looks like it's mostly used for acceptance tests, but it would be nice to run unit tests on multiple devices... Jan 27 19:44:54 I created an image caching system to load images and which you registered a callback for when it was loaded Jan 27 19:45:38 automatically saved images to the harddrive and had a priority queue of image to uses Jan 27 19:46:15 Right, I have a callback and it is successfully getting into it, and I am setting the imageView with .setImageBitmap but the page is still blank. Jan 27 19:51:44 thepoosh, When I do not have any scope then I am getting this error http://pastebin.com/dTqs6ENZ Jan 27 20:04:52 has anyone successfully migrated to Android Studio from Eclipse ADT? Jan 27 20:09:58 theblang: yep Jan 27 20:11:06 MrMaffen how did it go? Jan 27 20:11:30 theblang: like a charm actually .. android studio still has its glitches and bugs, but its way better than eclipse imo Jan 27 20:11:51 I had been using IntelliJ for quite some time though Jan 27 20:12:07 so my transition was: eclipse -> intellij -> android studio Jan 27 20:12:27 gradle rocks though :> Jan 27 20:14:18 MrMaffen yeah, I really like Gradle. And intelliJ is so awesome, been using PyCharm for Django development. Im running into soooo many problems trying to convert though, lol Jan 27 20:15:37 theblang: hm yea you should probably look into how to write a basic build.gradle file, so that you can resolve all the dependencies you need Jan 27 20:16:04 the great thing for me was, that it was super easy to directly pull all my dependencies from maven central Jan 27 20:16:20 so yeah. it's pretty much a one-click IDE setup process now Jan 27 20:17:00 I'm curious, was there no way to handle dependencies before Gradle? The instructions for Eclipse always say import the project as a library, unless of course it is just a jar. Man, that gets unwieldy fast. Jan 27 20:17:15 sorry, in the context of Android. Jan 27 20:19:23 there's a maven plugin, too Jan 27 20:19:58 the context of android? we only talk about ios here Jan 27 20:19:58 yea. before gradle you would work directly with maven through configuring your pom.xml Jan 27 20:21:05 theblang: you should first look up if any (or all) of your current dependencies are uploaded on maven central. If that's the case, configure your build.gradle file to pull those in. But there are great tutorials for that stuff. You'll figure it out ;D Jan 27 20:22:46 wall of text inc Jan 27 20:22:48 I'm currently working on a kind of omni-directional viewpager implementation. I do want to have a vertical viewpager inside a horizontal viewpager. The problem I currently have is the following. In my vertical viewpager I have a listview (so basically its a listview within a vertical viewpager, within a horizontal viewpager). But obviously with that many layers of touchable/manipulatable views, I have to manually resolve TouchEvent Jan 27 20:22:48 conflicts. I do that by returning "isEnabled && super.onInterceptTouchEvent(event);" in the onInterceptTouchEvent methods of my views. However, I now ran into a problem which I'm unable to figure out a solution for. The listview is correctly getting the TouchEvent through all those layers, but it doesn't seem to update its view. It'll only update its view, if the complete view tree refreshes. But I obviously also want it to update Jan 27 20:22:48 , whenever the user tries to scroll within the listview. Any ideas what I might be doing wrong? Or how I can tell the listview to refresh whenever it scroll state changes? Jan 27 20:25:00 I overided textView so that I can have this cool looking UserInitialsTextView. Kinda like the the thing that google uses in Gmail (the colorful boxes with a letter in it). Everything works perfectly, and it's seriously dead simple, but My letter isn't 100% centered. Any idea why this could be? Jan 27 20:25:33 Hey! Jan 27 20:28:06 Having a strange problem that Im not figuring out. I have my main activity that implements Actionbar tabs. When I navigate to other actvities (where I dont set up these tabs) there appears an empty space where the tabs where in the main activity. Really strange, anyone know how I could fix this? Jan 27 20:40:21 any clue why i cannot start a service from fragment with this: getActivity().startService(new Intent(getActivity(), SensorService.class)); Jan 27 20:40:33 from mainactivity it works.. Jan 27 20:40:41 Any idea why android emulator is not working? https://dpaste.de/Pazi ? Jan 27 20:40:46 You can Jan 27 20:41:47 jaDule, try getSupportActivity() Jan 27 20:41:47 that works fine Jan 27 20:42:02 lets see Jan 27 20:42:46 he asks me to change getSupportActivity() to getActivity.. Jan 27 20:42:54 doesn't matter Jan 27 20:43:02 startService works on any context Jan 27 20:43:40 :> getSupportActivity is not a known function so i cant compile Jan 27 20:44:14 That's because the method doesn't exist Jan 27 20:44:23 yes i figured that :P Jan 27 20:44:35 from fragment cannot call startService directly Jan 27 20:44:57 :/ Jan 27 20:45:09 What you pasted earlier works fine for everyone but you :) Jan 27 20:45:51 :/ Jan 27 20:48:18 Somebody please help me debug this, the app is not working using usb device. https://dpaste.de/ZeBc Jan 27 20:57:22 if anyone that knows Gradle has a second, could you look at this pastebin and tell me if any mistakes jump out at you? http://pastebin.com/09TxUECR Jan 27 20:59:28 You should explicitly declare dependency versions Jan 27 21:01:33 SimonVT Okay. Currently it is having a problem with the joda-time entry, though I think I tried with the explicit version a moment ago Jan 27 21:01:50 theblang: why did you add those dependencies to buildscript { ... } ? Jan 27 21:02:18 It's not wrong, I just prefer knowing what versions I use Jan 27 21:02:40 So my build doesn't suddenly break because they decided to change the api Jan 27 21:02:42 MrMaffen ahh, okay, let me change that and see what happens Jan 27 21:02:48 SimonVT yeah, I understand that Jan 27 21:03:45 theblang: afaik you should only add dependencies under dependencies { ... } directly Jan 27 21:03:50 at least that's what I've done Jan 27 21:04:30 for me there's just the "classpath 'com.android.tools.build:gradle:0.7.+'" entry Jan 27 21:05:33 mrMaffen when you migrated your project to Studio did you use the customizable gradle wrapper? Jan 27 21:06:16 mrmaffen which seems to be a bundled gradle , rather than one you have to set up Jan 27 21:06:47 Yeah, use gradle wrapper Jan 27 21:06:47 The Service was not in my Manifest.. Jan 27 21:09:36 Which is preferred IDE for android development? Eclipse or IntelliJ? Jan 27 21:09:53 theblang: yea you should definitely use the gradle wrapper Jan 27 21:10:12 jita: try Android Studio .. it's based on IntelliJ Jan 27 21:10:17 jita: Ask an IntelliJ developer and an Eclipse developer :> Jan 27 21:10:44 jaDule: uhm no Jan 27 21:10:59 MrMaffen: what do you use? Jan 27 21:11:35 Whats the benefit of Android Studio Jan 27 21:11:36 jita: Android Studio, still has some glitches but overall it works great for me. If you can't stand the glitches, use IntelliJ. Eclipse was always a major pita for me. Jan 27 21:11:38 in one word! Jan 27 21:12:01 jaDule: Cheesecake Jan 27 21:12:07 mhh Jan 27 21:12:18 with dried grapes and nuts? Jan 27 21:12:27 MrMaffen: what is the difference between IntelliJ and android studio ? Jan 27 21:12:53 jita: better integration with the android sdk. like ui preview and gradle Jan 27 21:13:06 jaDule: yes, sir Jan 27 21:14:34 MrMaffen: if i am just beginning out android development, should i try intelliJ or android studio ? Jan 27 21:15:12 jita: android studio Jan 27 21:15:18 ok thanks MrMaffen Jan 27 21:15:22 np Jan 27 21:16:20 When I run a test on the emulator I get following error: Test run failed: Permission Denial: starting instrumentation Jan 27 21:16:21 ComponentInfo{com.test/android.test.InstrumentationTestRunner} from Jan 27 21:16:21 pid=277, uid=277 not allowed because package abc.def does not have a Jan 27 21:16:21 signature matching the target ghi.jkl". Jan 27 21:16:28 jita I can tell you this from my experience. I love IntelliJ, more than Eclipse. But I personally have had a heck of a time trying to get Android Studio working. Granted, I am trying to migrate over. Maybe it will be better starting from scratch. Jan 27 21:16:32 whats weird is that it works great on a physical device Jan 27 21:17:02 Hi guys, can someone advise how to do some safe points for user in app ? For example if he click to submit button, i check if he is connected on wifi, if he is not, i want him to move back or OUT of the method BACK before submit method so when he enable wifi he can click again Jan 27 21:17:08 does anybody have experience with this or a hunch? Jan 27 21:17:31 i dont want to switch another activity or anything, just okay, you dont have wifi on, go back, enable it than click again, i am totally out of my mind of this ? Jan 27 21:17:37 theblang: Does android SDK integrate well with IntelliJ just like eclipse ? Jan 27 21:18:13 jita i haven't tried IntelliJ personally, only the Android Studio Jan 27 21:19:05 theblang: you just said you love IntelliJ so i assume you use it for something other than android development ? Jan 27 21:19:25 jita yeah, I use PyCharm for Django development Jan 27 21:19:58 theblang: ok Jan 27 21:20:11 MrMaffen what is the best way to set the sdk.dir attribute? Currently getting an error when trying to apply plugin: 'android' Jan 27 21:21:11 Can do AsyncTask throw an Exception in a doInBackground() and then I catch it outside the AsyncTask? Jan 27 21:21:31 SimonVT, nah, using wildcard dependencies is generally wrong, you end up with non-repeatable builds Jan 27 21:21:43 and there are asshats that make api breaking changes in minor/patch revisions Jan 27 21:22:49 oh yeah, I need to upgrade my intellij, got my ultimate license :) Jan 27 21:22:58 theblang: you shouldn't have to. android studio comes bundled with its own android sdk Jan 27 21:23:16 theblang, by setting ANDROID_HOME in your environment Jan 27 21:24:03 MrMaffen yeah, I was hoping for that. but that is the error I am getting. pfn, my Windows environment or are there environment variables within Android Studio? Jan 27 21:24:40 environment variables Jan 27 21:25:01 gradle doesn't run exclusively in android studio... Jan 27 21:25:09 why should gradle know anything about android studio Jan 27 21:25:11 pfn right, got ya Jan 27 21:26:58 Guys i am catching exception when logging on ftp server, and i am now testing how it acts when server is offline, and First time the exception is caugh and Toast is on screen telling you that you cannot connect, but when you hit second time the button which calls the connect method, second time even though there is exception the whole app crashes, anyone know how ? Jan 27 21:27:26 pfn, it was in the context of mistakes in his build.gradle.. But yes, I agree Jan 27 21:31:18 MrMaffen, pfn so as long as mavenCentral() is declared inr epositories, under buildscript, then gradle should look there for a dependency I declare if it doesn't find it locally right? Jan 27 21:32:25 theblang: here's the build.gradle file I'm currently using https://github.com/tomahawk-player/tomahawk-android/blob/master/build.gradle Jan 27 21:32:27 hope that helps Jan 27 21:32:46 it resolves all its dependencies via maven central Jan 27 21:32:50 also has NDK support Jan 27 21:33:13 and it tries to get the current version tag with git to rename the output file Jan 27 21:33:32 MrMaffen ahh, I bet I know my problem. mavenCentral is declared for repositories under buildscript, but, it also needs to be declared for the other dependencies block Jan 27 21:33:51 also looks for a file "signingconfig.gradle" in your project's root folder, and tries to sign the apk if such a file is present Jan 27 21:34:03 but obviously only if you're building a release version (not a debug one) Jan 27 21:37:48 did anybody try to use a single instance of an adapter for multiple listviews? Jan 27 21:38:25 short UI question. If i get a button via findViewById(R.id.button1); and then set a new Text .. how to make it permament when fragment is paused / resumed? Jan 27 21:41:55 Can AsyncTask throw an Exception in a doInBackground() and then I catch it outside the AsyncTask? Jan 27 21:42:05 If I wrap asynctask.execute() in Try/Catch? Jan 27 21:44:45 smallfoot-: no Jan 27 21:44:51 I see Jan 27 21:45:08 my AsyncTask connects to a server to authenticate Jan 27 21:45:35 it returns boolean true if authorization is accepted and boolean false if password is wrong Jan 27 21:45:45 What should I do if the network connection fails to connect Jan 27 21:45:54 or if the service replies OMGWTFBBQLOL Jan 27 21:46:13 first off, don't use async task :p Jan 27 21:46:30 look into RxJava, it's good at handling stuff like that Jan 27 21:46:31 I thought I was supposed to use AsyncTask, because that is what the LoginActivity template used Jan 27 21:46:56 and I've been told to use AsyncTask for network access so I don't stall the UI thread Jan 27 21:47:13 RxJava I've never heard of... I don't think its part of Android Jan 27 21:47:26 yeah, you can't do network stuff on the main thread. but there are other ways of doing things on other threads Jan 27 21:47:27 When I do new LoginActivity, then the template that Google wrote uses AsyncTask Jan 27 21:47:43 it's a library build by the guys at Netflix. if you use gradle/maven it's easy to bring in Jan 27 21:49:01 smallfoot-: commonsware to the rescue: http://stackoverflow.com/a/1739676 Jan 27 21:49:21 MrMaffen, pfn thanks so much for your help! Just successfully deployed with Studio Jan 27 21:49:36 smallfoot-: look into SafeAsyncTask.java in the roboguice repository. Easy to swap in for your regular AsyncTask. Jan 27 21:49:53 theblang: sure :) Jan 27 21:50:26 f2prateek, but if Google wanted me to use that, then they would have used that Jan 27 21:52:26 hey all, why would the compiler be unable to find "findViewById"? Jan 27 21:52:28 f2prateek, that onException seems pretty nice in safeasync tho Jan 27 21:52:31 i have android.view.View imported Jan 27 21:52:35 hyderagood, thanks Jan 27 21:52:59 smallfoot-: I would try/catch and handle the exception in the same thread that threw it Jan 27 21:53:57 hyderagood, I see Jan 27 21:54:23 hyderagood, then call return new AsyncTaskResult(anyError); ? Jan 27 21:54:58 hyderagood: not always, you may want to inform the user of that error on the main thread. Jan 27 21:55:06 if you want to be able to handle the error on the UI thread, do what commonsware said Jan 27 21:55:14 "hold onto the Throwable or Exception in the AsyncTask instance itself and then do something with it in onPostExecute()" Jan 27 21:56:06 in your AsyncTask instance: private Exception myException; Jan 27 21:56:11 ... } catch (Exception e) { myException = e; } Jan 27 21:56:19 then do cool stuff in onPostExecute() Jan 27 21:56:51 anyone? Jan 27 21:57:02 And that's exactly the boilerplate that SafeAsyncTask saves you from writing Jan 27 21:57:35 f2prateek: I'm not familiar with SafeAsyncTask, looking at it now Jan 27 21:57:39 Guys, my asyncTask work like this, it is sending files to ftp. If something wrong occurs (ftp server goes ofline) it will warn user in onPostexecute. However i want to user be able to click on button which open asynctask again, but then i got fatal error, because asynctask can be only run once Jan 27 21:58:27 dcope: it's probably more the ID it can't find, not the method call... unless you're doing it in a fragment Jan 27 21:59:23 hyderagood, but commonsware showed no code. Is it what 'Cagatay Kalan' posted? Jan 27 22:00:23 bankai_: ah yes, i am using a fragment. Jan 27 22:00:49 hyderagood, I see Jan 27 22:00:56 dcope: getView().findViewById(R.id.blahblah); Jan 27 22:01:28 bankai_: thank you :) Jan 27 22:01:29 careful though, getView() will return null in some lifecycle callbacks Jan 27 22:02:24 hyderagood, should I do as your code said above, or should I do as 'Cagatay Kalan' posted in the stackoverflow link you mentioned? Jan 27 22:04:13 smallfoot-: I think commonsware's is simpler. Just hang onto the Exception reference in the AsyncTask Jan 27 22:04:24 the SafeAsyncTask that f2prateek suggested looks good too Jan 27 22:04:45 I see, thanks Jan 27 22:08:48 Anyone here using Android studio? I'm trying it out and cannot get something simple to work...a silly textview. I create one in fragment_main.xml then in the onCreate() in MainActivity.java I do the usual tv1 = (TextView)findViewById(R.id.textView); but when I tv1.setText("TEST"); it crashes the app with a nullpointer @ setText() line. Jan 27 22:09:15 It makes no sense to me :( Jan 27 22:09:32 http://pastebin.com/X0GGTuus Jan 27 22:10:18 Am I missing some step? Jan 27 22:10:44 DOSP yeah, you have to instantiate a new AsyncTask Jan 27 22:11:41 okay iam done with that one, now i need to know why it is showing me error (but doesnt stop anything, everything goes as it should) when uploading data in for looop in AsyncTask in doInBackground Jan 27 22:11:52 hey guuuys :) Jan 27 22:12:23 DOSP in doInBackground, if the error condition occurs, do you return? Jan 27 22:13:06 well i do return everything, but it just shows me that error, but my app is running fine, and is uploading everything fine as it should Jan 27 22:13:12 smallfoot-: commonsware included an example here https://github.com/commonsguy/cw-lunchlist/blob/master/15-Internet/LunchList/src/apt/tutorial/FeedActivity.java Jan 27 22:13:19 i got a png icon with a black color, i want to change this color, i tried with porterdufffilter multiply, but it want work :/ Jan 27 22:13:29 DOSP what is the error again? Jan 27 22:13:38 just a sec Jan 27 22:13:48 hyderagood, thanks, I didn't see it Jan 27 22:15:22 okay seems the error is gone, I am more woried about how do i prevent crashing application when it is doing somethign in asyncTask and user close the application (with home button) then after you re-opens it crashes Jan 27 22:16:34 by fixing your bug Jan 27 22:16:47 okay just a sec iam gonna check what it says Jan 27 22:17:22 http://pastebin.com/dHXHDjSr Jan 27 22:17:25 thats the error Jan 27 22:17:44 propably because UI thread is locked by asynctask idk Jan 27 22:18:48 DOSP can you show me your async task? Jan 27 22:19:10 ffs. intellij just hanging on Make *again*. Aargh. Jan 27 22:20:03 DOSP: also: use a Service component for long-running tasks (ex. file uploads), not Activity Jan 27 22:20:18 any osx users of android studio here? Jan 27 22:20:22 http://pastebin.com/XEm4T8G2 Jan 27 22:20:29 hm service? Jan 27 22:20:35 iam afraid of using those :d Jan 27 22:21:03 hyderagood, do I have to attach the Activity in the AsyncTask, in order to call the AlertBuilder from onPostExecute? Jan 27 22:21:46 DOSP: Services can't hurt you Jan 27 22:22:01 DOSP: kill the AsyncTask when the Activity pauses Jan 27 22:22:07 smallfoot-: yeah Jan 27 22:22:15 damn :( Jan 27 22:22:17 how do you exactle KIll asynctask ? Jan 27 22:22:24 i thought that they live forever Jan 27 22:22:33 taskRef.cancel(true) Jan 27 22:22:41 ? wow Jan 27 22:22:42 live forever sounds like another name for "memory leak" Jan 27 22:22:49 this asynctask is tricky... :s Jan 27 22:22:49 http://developer.android.com/reference/android/os/AsyncTask.html Jan 27 22:22:57 have to attach activities and stuff :s Jan 27 22:24:32 rager: would you want to kill your file upload whenever the user navigates away from the Activity that started it? Jan 27 22:24:45 no, but then again I wouldn't do it on an AsyncTask Jan 27 22:26:44 in AsyncTask's own documentation, it says that AsyncTask is not well suited to operations taking more than a few seconds Jan 27 22:27:47 oh :s Jan 27 22:29:31 rager: you'd prefer a Handler? Executor? or straight Thread Jan 27 22:30:06 I set up a thread pool on the application - maybe not the best way to do this kind of thing Jan 27 22:30:45 I throw runnables on the thread that hold references to delegates that actually deal with the results of long-running operations Jan 27 22:30:52 *on the thread pool Jan 27 22:30:57 it's an exectutorservice Jan 27 22:32:02 the pool I use has a hard cap on threads set to [number of cores] Jan 27 22:32:11 AsyncTask implementation uses ThreadPoolExecutor Jan 27 22:32:31 not a terrible alternative for an Android/Java novice Jan 27 22:32:55 kinda Jan 27 22:33:07 but not for this task Jan 27 22:33:11 agreed Jan 27 22:33:35 I'd use a pipeline thread for uploading Jan 27 22:33:47 a single thread with Looper and on the other side, a Handler to communicate with it from Activity/UI thread Jan 27 22:33:59 or Service Jan 27 22:35:03 I really like the use of LocalBroadcastManager for letting the rest of the app know when things like "file just got uploaded" happen Jan 27 22:35:51 I'm pretty sure I've got a good bit of room for improvement in how I multi-thread stuff Jan 27 22:36:04 I've only been doing this android thing for a couple years Jan 27 22:36:07 yeah BC's are great Jan 27 22:37:05 *local broadcasts Jan 27 22:38:28 smallfoot-: 'attach an activity' just means that you give the AsyncTask a reference to the Activity that started it... either using the constructor or an attach() method Jan 27 22:38:48 hey all Jan 27 22:39:08 i have a drawer application (android studio) and i've created a fragment with a grid view. how can i get that fragment on the first container in the drawer view? Jan 27 22:40:23 explain? Jan 27 22:41:08 rager: me? Jan 27 22:41:48 hyderagood, I see. But http://developer.android.com/reference/android/os/AsyncTask.html#onPostExecute%28Result%29 says it runs in the UI thread, so then I should be able to call AlertDialog directly from onPostExecute() ? Jan 27 22:42:42 dcope: you've got a Fragment that you're trying to add to the ListView that you've got in your DrawerLayout Jan 27 22:42:43 is this correct? Jan 27 22:43:00 smallfoot-: yep, but you still need a Context to create the AlertDialog Jan 27 22:43:03 rager: well i want to add it to the view that the list view item represents Jan 27 22:43:06 (Activity is a Context) Jan 27 22:43:07 I forgot my password for my release keystore. So each time I try to get a hash I'm entering a password and it gives me a different hash for each attempt I try.. How can I find out which one is the correct one? Jan 27 22:43:16 in the drawer template it is just a single activity that shows the index of the selected list item Jan 27 22:43:40 CocoStorm oh oh, thats the end Jan 27 22:43:55 could someone explain how to get the AOSP Email project to build? https://android.googlesource.com/platform/packages/apps/Email Jan 27 22:43:55 oh dear Jan 27 22:44:05 trying to get it set up in Eclipse but I'm not sure how to resolve the dependencies Jan 27 22:45:31 rager: does that make sense? Jan 27 22:46:11 dcope: why not just add the Fragment to the ListView? Jan 27 22:47:08 rager: when a user taps on the item in the drawer then it'll show on the content view? Jan 27 22:47:09 I'm creating a new project and Import > File structure from Email/src as well as emailcommon/src and emailsync/src directories Jan 27 22:47:11 if i do that? Jan 27 22:47:25 dcope: so you're not trying to put something in the drawer Jan 27 22:47:46 rager: correct Jan 27 22:47:59 you're instead trying to take an action (show the given Fragment in the main content pane) when a user clicks on the corresponding action in the nav drawer? Jan 27 22:48:00 im trying to put something on the main view so a user can tap between things and see different content Jan 27 22:48:09 rager: exactly! Jan 27 22:48:30 i'm checking out the onCreateView in MainActivity right now Jan 27 22:49:42 some imports like com.android.emailcommon.internet.MimeUtility cannot be resolved... it appears that they don't exist in this repository Jan 27 22:51:36 well, shoot Jan 27 22:51:39 Also, I'm trying to develop for different screen sizes and nexus 4 is supposedly similar enough to the samsung s3 that I don't need to create a different layout. However, when I test my app out on a nexus 4 the height is an issue. I think it may be beacuse it has the soft buttons at the bottom that's part of the system ui that makes the keyboard appear higher. Is there a way to adjust the app f Jan 27 22:51:39 or it? Jan 27 22:51:45 if anyone could help :) Jan 27 22:51:47 I'm not totally sure how we do it in our app... I thought it was one way Jan 27 22:51:52 and then it was completely dismantled Jan 27 22:52:07 rager: i think i got it Jan 27 22:52:46 Can I use try-with-resources on Android? Jan 27 22:54:52 some people replaced what had been there before with a 16-item switch/case statement Jan 27 22:55:00 with the cases as follows: Jan 27 22:55:11 0, 1, 2, 3, 4, 5, 6, 7, 8...16, default Jan 27 22:55:26 could anyone advise how I could get around height issues developing for nexus 4? Jan 27 22:56:11 CocoStorm: if you're using dp and sp you shouldn't have problems like that Jan 27 22:56:38 bankai_, I'm using dp :S it's strange Jan 27 22:56:44 I will take screen shots Jan 27 22:56:49 brb Jan 27 23:05:48 how can i get a frame layout in an activity when i'm in a fragment? Jan 27 23:06:41 nvm Jan 27 23:12:42 i made a CounterListFragment.java with a fragment_counter_list.xml and i have a grid view in the xml... when i try to access the grid view in the list fragment i get a null pointer exception. Jan 27 23:12:51 is there a way to "link" the xml file with the java file? Jan 27 23:14:05 usually you do this with setContentView (if i remember correctly) Jan 27 23:14:17 and if you want to access views in the file, use findViewById Jan 27 23:14:39 hephaestus_rg: yep, i'm doing findViewById(R.id.gridview) Jan 27 23:14:45 but i get Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'android.view.View android.view.View.findViewById(int)' on a null object reference Jan 27 23:17:25 smallfoot-, no Jan 27 23:17:40 smallfoot-, if you have minsdk=api19 then yes Jan 27 23:20:26 so im taking a look at http://developer.android.com/guide/topics/ui/layout/gridview.html Jan 27 23:20:45 when they create the image adapter they pass a "Context" to the constructor... can you pass a Fragment? Jan 27 23:30:46 pfn, I see. Thanks Jan 27 23:36:59 Hi anyone know how I can get a reference to the main window from within a custom asynctask (i.e. so I can call findViewById() ) ? Jan 27 23:41:08 pass the view you want to the asynctask? Jan 27 23:41:46 you can't do UI manipulation on a non-ui/main thread Jan 27 23:42:03 hello Jan 27 23:42:16 What kind of architecture do I need Jan 27 23:42:55 a good one Jan 27 23:42:56 jonc: Thanks, I'm changing a view in the onPostExecute() method, so it should be back in the main thread at that point Jan 27 23:43:12 Having a REST service using Retrofit , some in memory database , and some controller logic to delegate some retrofit calls Jan 27 23:43:59 jonc: I'm passing the context in, and storing that, but unsure how to get the View from the context. Jan 27 23:44:05 and a always running thread to retry sending some stuff using consumer producer pattern Jan 27 23:44:44 pass it as an activity Jan 27 23:45:15 Wish Java had multiple inheritance. Would make things so much easier at times... Jan 27 23:45:56 jonc: Ah, so I could pass both the activity and context in, yeah, that should work thanks Jan 27 23:46:13 you can just pass the activity in, I believe an activity is also a context Jan 27 23:46:20 but a context does not have to be an activity Jan 27 23:46:52 jonc: So if I pass (this) in, it'll pass the activity, and I can cast that to the context as needed? Jan 27 23:47:03 yes Jan 27 23:47:10 as long as this is an activity Jan 27 23:47:13 jonc: Cool thanks Jan 28 00:14:58 Im having the exact same problem as this guy Jan 28 00:14:59 http://stackoverflow.com/questions/21138560/actionbar-navigation-mode-standard-leaves-empty-white-space-at-top Jan 28 00:15:16 anyone had this problem before? Been trying to fix this for half a day now >< Jan 28 00:17:21 <|0xD34D|> gulli: that doesn't look like a problem, it looks like the ActionBar itself Jan 28 00:17:34 its the tabs Jan 28 00:17:49 <|0xD34D|> not according to that stack overflow you linked Jan 28 00:17:50 the space they would otherwise occupy is still there Jan 28 00:18:16 well in that example he has removed the actionbar too Jan 28 00:18:25 in mine I have it still there Jan 28 00:18:51 so there is an empty space between my actionbar and my imageview Jan 28 00:19:08 I cant seem to get rid of it Jan 28 00:19:21 <|0xD34D|> no he didn't remove the actionbar he removed the tabs by setting the navigation mode to NAVIGATION_MODE_STANDARD Jan 28 00:19:22 if I enable the tabs then they fill that empty space Jan 28 00:19:34 yes that iswhat I did too Jan 28 00:19:41 but he has fullscreen Jan 28 00:20:00 <|0xD34D|> so the tabs go away but that space they occupied is left empty instead of the view filling it in? Jan 28 00:20:16 exactly >< Jan 28 00:20:49 ive used methods such as .removeAllTabs and .hide Jan 28 00:20:59 hide hides the actionbar though Jan 28 00:21:03 <|0xD34D|> what about forcing your content view to relayout? Jan 28 00:21:42 invalidate(); ? Jan 28 00:21:45 <|0xD34D|> requestLayout() Jan 28 00:22:03 Also, I'm trying to develop for different screen sizes and nexus 4 is supposedly similar enough to the samsung s3 that I don't need to create a different layout. However, when I test my app out on a nexus 4 the height is an issue. I think it may be beacuse it has the soft buttons at the bottom that's part of the system ui that makes the keyboard appear higher. Is there a way to adjust the app f Jan 28 00:22:04 or it? Here is a picture of the screenshots to show you what I mean http://oi40.tinypic.com/1zmo9jc.jpg Jan 28 00:22:19 ok, Ill check it out, that might actually work Jan 28 00:22:24 s/also/Hey guys Jan 28 00:22:26 please, in Google Places API, whats the difference between a /place/SEARCH/json?params and a /place/NEARBYSEARCH/json?params ??? Jan 28 00:22:41 <|0xD34D|> gulli: worth a shot since it sounds like for some reason the view is not wanting to take up that extra space Jan 28 00:23:34 Anyone here use android annotations Jan 28 00:24:19 jkbbwr: You might want to be a little more specific :) Jan 28 00:24:30 Hello Jan 28 00:25:00 Should I use final instance objects from application class ? Jan 28 00:25:07 to have a global object? Jan 28 00:25:15 yawn Jan 28 00:26:05 hm ? Jan 28 00:26:08 @Baluse: A better way might be a static class, so you don't have to override Application Jan 28 00:26:31 actually I need to know when it is created to init some stuff Jan 28 00:26:54 that are expensive to be init at each activity Jan 28 00:26:54 Anyone know what the issue is with the layout? Jan 28 00:27:50 @Baluse: Sounds like a singleton pattern. Have the first Activity's call do the init, and subsequent activities get the cached instance Jan 28 00:29:34 bankai_, I've got those screenshots :) Jan 28 00:34:06 can anyone help? Jan 28 00:34:09 pleasee Jan 28 00:34:49 Okay Jan 28 00:35:16 Im using android annotations to build a @Rest client, I declare @Get but how do I add a query string to that, without definding every posibility as a seperate method Jan 28 00:35:42 e.g. @Get("estimateHours") ASHEFilterInfo GetEstimateHours(int soc, boolean coarse, String filters, String breakdown); Jan 28 00:36:06 where the url would build into estimateHours?soc=222 ...etc Jan 28 00:36:52 JesusFreke ^ Jan 28 00:38:01 jkbbwr: I don't think those are android-related annotations Jan 28 00:38:46 jkbbwr: oh, do you mean http://androidannotations.org/ ? Jan 28 00:38:58 JesusFreke: yes. Jan 28 00:39:20 It might be a good idea to be more clear about that :) Jan 28 00:39:33 I've never heard of it, and have no clue, sorry. Jan 28 00:39:36 Fml Jan 28 00:39:36 Lol Jan 28 00:51:25 Hey guys, I'm trying to develop for different screen sizes and nexus 4 is supposedly similar enough to the samsung s3 that I don't need to create a different layout. However, when I test my app out on a nexus 4 the height is an issue. I think it may be beacuse it has the soft buttons at the bottom that's part of the system ui that makes the keyboard appear higher. Is there a way to adjust the a Jan 28 00:51:25 pp for it? Here is a picture of the screenshots to show you what I mean http://oi40.tinypic.com/1zmo9jc.jpg Jan 28 00:54:12 (pure java question, trying java in a different thread ;) WHY am I getting non-deterministic results in this simple multi-threaded example, where each thread is immediately "joined" http://pastie.org/8673749 Jan 28 00:56:41 explodes: it looks like it should be deterministic to me Jan 28 00:57:29 Right! Jan 28 00:57:31 But its not!! Jan 28 00:58:02 JesusFreke, do you know why the layout is different for the two devices? Jan 28 00:58:17 results: http://pastie.org/8673765 Jan 28 00:58:32 CocoStorm: I generally try to avoid layouts and UI in general, if at all possible :) Jan 28 00:58:46 JesusFreke good answer Jan 28 00:58:48 oh :P Jan 28 00:59:10 g00s, do you know why they are different? lol Jan 28 00:59:18 I can paste the layout if it helps Jan 28 00:59:26 but I'm only using dp in everything Jan 28 00:59:34 CocoStorm no Jan 28 00:59:54 cocostorm: dp is display pixels, not percent of the screen or anything. each device has different dimensions to fill, which is the bane of the android programmer Jan 28 01:00:25 so what should I do Jan 28 01:00:32 get it as close as you can; Jan 28 01:00:44 you can have different layouts for different screen densities Jan 28 01:00:59 you can use linearlayouts and use the "weight" functionality Jan 28 01:01:33 [linearlayout with 3 items with android:width="0dp" and android:weight="1" will each take up exactly 1/3 of the screen, in width] Jan 28 01:02:39 hmm Jan 28 01:03:00 I've pretty much got all that Jan 28 01:03:04 explodes: that might be a good stackoverflow question Jan 28 01:03:11 if you find the answer, I would be curious to know why Jan 28 01:03:27 yea, me too Jan 28 01:03:29 i'll make it Jan 28 01:04:54 explodes: fwiw, it seems to be deterministic on my machine Jan 28 01:05:02 explodes code again ? lost the snippet Jan 28 01:05:14 I always get 1 2 2 for the 3 output lines Jan 28 01:05:17 http://stackoverflow.com/questions/21394994/why-is-this-code-non-deterministic Jan 28 01:05:43 i'm not sure if A.join() is doing what you think it is Jan 28 01:06:02 Oh Jan 28 01:08:54 well, now i'm confused too Jan 28 01:09:10 i thought maybe A and/or B finished before join() call Jan 28 01:10:57 also, maybe access around a should be synchronized Jan 28 01:13:18 right, you could almost certainly fix it with synchronization. but I'm curious why it doesn't work as-is. As far as I can tell, it should. Jan 28 01:13:40 it might be 2 problems confounding; synchronization and buffering Jan 28 01:13:51 b(of the stream) Jan 28 01:14:55 if the order printed is wrong, i would wonder about buffering Jan 28 01:15:01 if the values are wrong i would wonder about sync Jan 28 01:15:18 fixed: I wasn't compiling the correct code Jan 28 01:15:45 explodes: *facepalm* Jan 28 01:15:45 explodes between you and that guy from last night with if (output == null) Jan 28 01:15:50 making us go mad Jan 28 01:16:11 heh Jan 28 01:16:14 sorry everyone Jan 28 01:16:38 the answer is that that code IS deterministic... Jan 28 01:16:44 when built correctly; Jan 28 01:18:51 Has someone ever tried some reverse engineering on some APKs and has found an utility from it ? Jan 28 01:19:04 Mang0z0r: #smali ;) Jan 28 01:19:42 Oh, I see. Jan 28 01:25:55 Hello, I have a relative layout with a textview and an imageview inside it. The relativelayout is one component of a larger page. What I want is the relativelayout to be centered vertically, such that the textview and imageview will be centered in the available space at the top of the page. Generally speaking it is doing this correctly. Jan 28 01:26:15 However, I have found that if I have both the text and image, the imageview is overlapping the textview Jan 28 01:27:34 lemonxah was helping me with this a few days ago :) Jan 28 01:28:14 What crash reporting service do you guys recommend? I am currently using HockeyAPP, which is pretty affordable, but has no native code symbolication. Crittercism has it, but it's 100 dollars a month. Maybe there is another service that provides native code symbolization at a better price. Jan 28 01:29:13 i think crashlitycs Jan 28 01:29:17 (sp) Jan 28 01:29:25 thanks I'll check it out Jan 28 01:29:29 i haven't used it out of privacy concerns (of my users) Jan 28 01:29:39 oh Jan 28 01:29:49 pretty much anything owned by twitter, FB, is out of the question Jan 28 01:30:33 ok you scared me off Jan 28 01:30:43 plus I notice it's totally free which is a red flag Jan 28 01:31:01 yeah, somebody wants your anonymized data :) Jan 28 01:31:36 which probably isn't anonymous ;) Jan 28 01:31:48 yeah Jan 28 01:32:06 once its been rinsed ;) Jan 28 01:33:35 then there was ACRA … but they totally fucked up on their SSL implementation and were sending bunches of shit cleartext Jan 28 01:33:45 maybe they fixed that Jan 28 01:33:47 dumbasses Jan 28 01:34:25 What's the standard way to version an android app? eg. when to bump major, minor, patch, etc.? Jan 28 01:34:38 I generally use semantic versioning but it doesn't really make sense for an android app Jan 28 01:34:54 yeah Play doesn't care about semver Jan 28 01:35:28 Random.nextInt() + "." + Random.nextInt() + "." + Random.nextInt() Jan 28 01:35:43 g00s: plus semver is better suited for libraries Jan 28 01:35:45 JesusFreke: lol Jan 28 01:36:20 bricker`LA well, if there is versioning of the schema for your content provider Jan 28 01:36:34 in that way, your app behaves like a library i guess, just ipc Jan 28 01:37:10 but yeah, it doesn't really matter, other than as a visible string for users Jan 28 01:37:24 most probably dont even look at it anyhow Jan 28 01:37:29 the only one that matters is the version code Jan 28 01:37:36 yeah Jan 28 01:39:14 Hi all, Good Morning Jan 28 01:39:28 morning Jan 28 01:41:53 where can I get good help on JAX-WS and ojdbc? Jan 28 01:42:46 how can I speed up AVD ? in android studio? Jan 28 01:43:17 the emulator is slow ... very slow ... try the x86 image Jan 28 01:44:45 advx genymotion is very fast too Jan 28 01:49:29 don't say "the emulator is slow" the arm emulator is slow Jan 28 01:49:36 because the x86 emulator is not the least bit slow Jan 28 01:53:06 If you have two views inside a (vertical) relativelayout, in my case a textview and an imageview, and one of them may be hidden (ie. the imageview can be set to visibility=gone), how do you get it so that if the imageview is hidden the textview takes up all available height in the relativelayout, but if it is not hidden then the textview takes up the minimum amount of room (wrap_content) and the imageview takes all available hei Jan 28 01:55:48 how to get x86 emu? Jan 28 01:59:43 just do eeet! Jan 28 02:00:01 you don't have to ask for anyone's permission Jan 28 02:02:38 advx http://www.infinum.co/the-capsized-eight/articles/is-your-android-emulator-just-too-slow Jan 28 02:02:48 that guy looks like John Petrucci, so he must know what he's doing Jan 28 02:05:56 ok thanks g00s Jan 28 02:07:59 is there a method that gets called on a fragment when the activity is drawn on the screen? Jan 28 02:08:06 like a fragmentDidAppear()? Jan 28 02:09:41 oh onStart(); Jan 28 02:16:01 Hi, does anyone know how to make http://stackoverflow.com/a/5406244 work - BUT if the image button height is not known (ie in the case of a TextView that make take up multiple lines you don't know what the height will be at compile time). I think that's essentially what I need to get my thing working Jan 28 02:31:39 bye 4 now, all, Thanks for help... **** ENDING LOGGING AT Tue Jan 28 02:59:59 2014