**** BEGIN LOGGING AT Sun Feb 15 02:59:59 2015 Feb 15 03:00:09 lasserix_: depends on what you mean by later Feb 15 03:00:30 TacticalJoke: i dont know how i can do that. with debugger? Feb 15 03:00:39 with the display list system it's not going to help you much unless you actually destroy the views and unload their data Feb 15 03:01:05 john67: Are you using Android Studio? Feb 15 03:01:15 TacticalJoke: yeah Feb 15 03:01:15 romainguy: ah ok thanks Feb 15 03:01:53 john67: Just remove all filters. Then you can perhaps type "exception" in the search bar to make it easier to find the exception stack trace. Feb 15 03:11:19 Hmm, I wonder whether we'll be ever able to use JUnit 4 for instrumentation testing. Feb 15 03:11:32 (Or TestNG!) Feb 15 03:14:29 romainguy: if i have to persist the data of a bunch of views (mostly just text) what's the best way to persist the data? is there something closer than dumping into an sqlite table I can do (closerto the view hierarchy mechanics like what on save instance state does) Feb 15 03:15:10 eg, i have weather updates. the views should always show the most recent weather update (even if it days old) Feb 15 03:16:16 right now i have a ds that is just java that allows the views to bind to the raw data, which i can stow in a table or whatever, but was wondering if there is something in the sdk that is closer to the view hierarchy mechanics that i can use to persist that would be faster or more efficient Feb 15 03:16:49 (since parcels and bundles for save/restore instance is just for within an app cycle, not between) Feb 15 03:19:36 lasserix_: Did you see this (although it's 21 only)? http://developer.android.com/reference/android/app/Activity.html#onRestoreInstanceState(android.os.Bundle, android.os.PersistableBundle) Feb 15 03:20:01 ahh that's awesome but need 16+ Feb 15 03:22:36 wow, an N6 will be mine xD Feb 15 03:30:08 hey tacticaljoke you told me that one fragment calling on each other directly is bad design, you mean nested fragments not transitioning from fragment to fragment via activity manager, correct? Feb 15 03:34:12 err TacticalJoke: Feb 15 03:40:06 well... one fragment calling another could have surprises, given async fragment transactions (you could be calling an old one, for instance). but if the fragments don't change / that's just not possible due to other parts of your app, it seems like it should be fine? worth testing pretty thoroughly at least. Feb 15 03:43:32 TacticalJoke: I’m so very sad about the state of testing Feb 15 03:43:55 oh hi romainguy :) Feb 15 03:54:30 how would I apply the kexec-hardboot patch to franco kernel? Feb 15 03:54:49 for the nexus 7 2012 Feb 15 03:57:53 #android-root Feb 15 03:58:23 p_l: thats not a root question though... Feb 15 03:59:03 it's not in an .apk and it won't work on a normal non-rooted / non-modified device -> #android-root Feb 15 03:59:07 codebam: well, it's the closest generic channel to the topic involved. Here is mostly about application developement Feb 15 03:59:36 p_l: okay thanks Feb 15 03:59:42 groxx: okay Feb 15 03:59:45 thanks Feb 15 04:14:33 TacticalJoke still there ? Feb 15 04:24:22 can i hide left and right elevation on card view? Feb 15 04:34:43 cbeust: hey :) Feb 15 04:48:46 g00s: Yeah. Feb 15 04:49:08 TacticalJoke figured it out, no worries Feb 15 04:49:10 thx Feb 15 04:49:20 cbeust: Yeah, it's not great. I'm glad the Gradle plugin now supports JVM unit testing, though. Waited so long for that. :) Feb 15 04:52:19 wow ho i think i finally got the answer to that damn interview question Feb 15 04:52:35 Which one? Feb 15 04:52:53 how would you answer "what is object oriented programming? Feb 15 04:53:13 my answer did not satisfy me so i've spent the last couple of weeks trying to come up with a single statement that would satisfy me Feb 15 04:53:44 Yeah, I'm not satisfied with my answer, either. Not sure how much weight to give polymorphism, for example. Feb 15 04:53:57 that's being too specific i think Feb 15 04:54:05 so there is a great answer by steve jobs on quora Feb 15 04:54:14 steve ? Feb 15 04:54:20 and then the creater of c++ in a paper entitled what is object oriented programming Feb 15 04:54:24 I guess talking about state and behaviour is important? Feb 15 04:54:50 points to the fact what really defines oo is the fact an object can know its local behavior in refrence to its general behavior Feb 15 04:54:58 yeah Feb 15 04:55:11 so dont laugh but here's my answer: "Object oriented programming is a technique of writing code that encapsulates complexity by enumerating Feb 15 04:55:11 data structures with an intrinsic implementation so that they can generally interface." Feb 15 04:55:21 hehe Feb 15 04:55:29 O.o Feb 15 04:56:12 Using 'interface' as a verb... hmm. Feb 15 04:57:19 OO is a method of coding ontology Feb 15 04:58:45 Sometimes, the most natural things are the hardest to define. Feb 15 05:03:24 lasserix_ you could also go with kay http://userpage.fu-berlin.de/~ram/pub/pub_jf47ht81Ht/doc_kay_oop_en Feb 15 05:03:36 "OOP to me means only messaging, local retention and protection and hiding of state-process, and extreme late-binding of all things." Feb 15 05:03:36 I was just reading that page. haha Feb 15 05:03:41 Just about to paste that. Feb 15 05:03:48 state-prcoess is probably actor model Feb 15 05:04:23 I kinda like Mozilla's summary: "Object-oriented programming is a programming paradigm that uses abstraction to create models based on the real world." Feb 15 05:04:26 Though it doesn't say much. Feb 15 05:04:35 lasserix_ fwiw, back in the 90's when OO was a big thing, there was a gathering ... haha ... where they tried to pin down a definition. nobody really agreed on anything. but a few things did come out as common ground Feb 15 05:05:01 they like booch, rambaugh, paje-jones, etc Feb 15 05:05:33 This is an key point: "Object-oriented programming may be seen as the design of software using a collection of cooperating objects, as opposed to a traditional view in which a program may be seen as a collection of functions, or simply as a list of instructions to the computer. " Feb 15 05:05:41 not that OO failed, but seems like the trend now is mixing OO + functional Feb 15 05:05:58 s/an/a/ Feb 15 05:07:20 Hey, drose379. I was AFK earlier. Feb 15 05:07:40 What did I say? I forget Feb 15 05:08:03 Something like "Hey, TacticalJoke". Feb 15 05:09:10 Ah, ok Feb 15 05:09:12 No prob, whats up? Feb 15 05:09:36 Not much. Just deferring sleep for some reason. Feb 15 05:10:02 Im really tired too Feb 15 05:10:12 Sl Feb 15 05:10:15 Oops Feb 15 05:10:26 Any progress with the app? Feb 15 05:10:42 is there any way for changing the white menu background in android 5.0.2?? Feb 15 05:10:44 I only did a little refactoring today. Was so tired. Feb 15 05:11:08 XxOblivionxX: Which menu? Feb 15 05:11:31 main menu. Feb 15 05:11:57 The overflow menu of a Toolbar? Feb 15 05:12:20 I meant the main menu that shows apps Feb 15 05:12:51 I think it's the "app drawer", but I'm not sure. Feb 15 05:13:24 yeah. that's it.I didn't know how it was called Feb 15 05:13:31 g00s yeah espicailly with what rx java is all about Feb 15 05:13:42 is there any way for that brother?? Feb 15 05:14:09 XxOblivionxX: you mean you want to customize your rom? Feb 15 05:14:18 thats probably an android-root question Feb 15 05:14:46 Another option would be to use a custom launcher, I guess. But, yeah, it's not really this channel's topic. Feb 15 05:15:08 ok.thank you for the information. Feb 15 05:15:18 There is #android and #android-root, I think. Feb 15 05:15:25 oh yeah custom launcher is easier choice Feb 15 05:15:37 drose379: How 'bout you? How's the app coming along? Feb 15 05:15:39 oh nice link g00s thanks Feb 15 05:16:08 Oh, there's a tiny bit of Fragment-versus-View drama on /r/androiddev. Feb 15 05:16:17 TacticalJoke not bad, changed around a few of the icons today and ive been trying to get the tag feature implatmented Feb 15 05:16:44 http://www.reddit.com/r/androiddev/comments/2vvv6q/how_do_you_reuse_components_without_using/ Feb 15 05:16:49 Nice. I love the tag idea. Feb 15 05:17:08 You do? Feb 15 05:17:53 Yeah, tags are a powerful grouping mechanism. Feb 15 05:18:15 Cool, thank you Feb 15 05:18:19 Hi Feb 15 05:18:34 hi Feb 15 05:19:25 drose you going to use a denormalized db to handle your tags? Feb 15 05:19:37 Is there any good docs on how to do simple tabs? Feb 15 05:19:43 denormalized? Feb 15 05:19:47 s/Is/Are Feb 15 05:19:54 Trying to access my string resources from a non-activity class. There's a million people on stackoverflow telling me to "just pass the context" and one guy who says, it shouldn't be done by passing the context because that's bad style. What's recommended? Feb 15 05:20:27 static application context Feb 15 05:20:32 teegee: I think the best approach depends on the nature of your class. For example, you could pass the Resources object. Feb 15 05:20:34 each table is self contained, you don't shove all your data into a central table. that way you have a table of tags, whose primary keys you can use as foreign keys in another table, and create a mapping.. so like lessons table will have column, tags, which you can look up and vica versa Feb 15 05:20:49 Or you could pass the string(s) itself/themselves. Feb 15 05:20:55 TacticalJoke: it's a FragmenPagerAdapter Feb 15 05:21:04 Yeah lasserix_ thats how I have it set up so far Feb 15 05:21:14 Lessons in one table, Subjects in another, tags will be its own table Feb 15 05:21:27 teegee you could use a static class you just initialize on application class oncreate, just pop all your strings into it and then you can access them anywhere Feb 15 05:21:44 drose379: yeah thats the idea Feb 15 05:22:16 Cool, thanks lasserix_ Feb 15 05:22:37 lasserix_: It's sad that you received this question in an interview, not sure what the interviewer was looking for Feb 15 05:22:41 TacticalJoke: i just wish there was a view backstack library Feb 15 05:22:55 deuteros__: tbh he was kind of a dick/ condescending the whole interview Feb 15 05:23:02 AS doesn't show you empty folders in Android view. If I have to create a folder then I have to switch back to other view like Project. Is that how it works? Feb 15 05:23:27 i don't have a degree i think the entire team there did so... Feb 15 05:23:29 g00s: I would not go with Kay for the definition of OO, he's been trying to redefine the meaning ever since he came out of his cave and decided he cared about OO after not caring for several decades :) Feb 15 05:24:05 lasserix_: :\ that's sad. interviews should be fun, IMO Feb 15 05:24:15 i actually like paje-jones definition the most, i just can't find it Feb 15 05:24:16 nah it was a serious interrogation Feb 15 05:24:52 lasserix_: doesn't surprise me Feb 15 05:24:55 lasserix_: is there an easy way to clone my strings into a static class by deriving it from something or do I have to populate everything manually? Feb 15 05:25:21 teegee: there might be a way to iterate over all your string resources, not sure Feb 15 05:25:36 that counts as manual :) Feb 15 05:25:49 ok, I'll go with the static class. thanks Feb 15 05:26:09 teegee: Do you have a link to the SO questions? Just curious Feb 15 05:26:25 Is it correct though, that the context shouldn't be passed around unless there's a better reason? Feb 15 05:27:03 lasserix_ you could also look at bertrand meyer's definition Feb 15 05:27:27 teegee, no Feb 15 05:27:34 g00s link? Feb 15 05:27:40 TacticalJoke: http://stackoverflow.com/questions/7666589/using-getresources-in-non-activity-class Feb 15 05:27:49 it's in the comments Feb 15 05:29:18 lasserix_ well, its probably burried in http://en.wikipedia.org/wiki/Object-Oriented_Software_Construction ... which nobody would buy in 2015 :D Feb 15 05:29:43 It's sad to hear Alan Kay say that he finds type systems "painful" Feb 15 05:29:53 you can tella lot by the programming <-> software construction ;p Feb 15 05:30:05 TacticalJoke: what he suggests sounds very much like the "copy stuff in static class" approach to me Feb 15 05:31:33 "You will have to pass a context object to it" is just wrong. The OP could alternatively pass a Resources or an XmlPullParser (lol) or the end product of whatever operation is going on. Feb 15 05:33:57 Although since we're talking about an adapter, is passing a Context to it such a bad idea? Adapters are very UI-related. Feb 15 05:34:54 I pass Contexts all the time to my list adapters, and they do stuff such as extract LayoutInflaters from them. Feb 15 05:34:56 TacticalJoke: The risk is that a Context might be an Activity or an Application (odd inheritance choices) and if you end up holding one to it somehow (e.g. storing it in a static field), memory leak Feb 15 05:35:29 also passing in the wrong context if you are using it to pull a theme/style can screw you up Feb 15 05:35:44 This kind of leak shows up pretty quickly in a memory profile dump, though Feb 15 05:36:15 TacticalJoke, certain adapters already have built in getContext() functions Feb 15 05:36:26 like http://developer.android.com/reference/android/widget/ArrayAdapter.html#getContext() Feb 15 05:37:16 yiati: wouldn't that require you had already initialized it with a context? Feb 15 05:37:23 Yeah, in the constructor. Feb 15 05:38:03 lasserix_ certain adapters such as ArrayAdapter will not allow you to instantiate one without a context Feb 15 05:41:27 Im out for now TacticalJoke Feb 15 05:41:30 Talk to you later Feb 15 05:41:50 Later. Feb 15 05:54:43 how long should it take to compile the android ndk? (yes ndk, not sdk) Feb 15 05:55:24 a while. it's got to compile gcc at least twice. Feb 15 05:56:04 does this code look like an efficient alternative to sharedpreferences for Lists? or is there a better way to store lists via sharedpreferences? https://github.com/kcochibili/TinyDB--Android-Shared-Preferences-Turbo/blob/master/TinyDB.java Feb 15 05:56:54 oh nvm I can use a friggin set Feb 15 05:57:20 TheKarlBrown: What are you trying to achieve? Feb 15 05:57:30 storing favorites locally Feb 15 05:57:40 do not use that Feb 15 05:57:41 and set is actually BETTER than a list for that purpose Feb 15 05:57:42 wow karl thats pretty cool Feb 15 05:57:54 You're using SharedPrefernces internally, how can this be more efficience than SharedPReferences? Feb 15 05:58:13 deutros what? Feb 15 05:58:18 lasserix is that sarcasm Feb 15 05:58:26 (and returning 0 if you can't parse a string into a number? Terrible idea) Feb 15 05:58:51 + Feb 15 05:59:05 oh its sp not sqlite Feb 15 05:59:17 okie, so set it is then Feb 15 05:59:21 Also line 45 Feb 15 05:59:24 mContext = appContext; Feb 15 05:59:33 mContext = appContext.getApplicationContext() Feb 15 05:59:34 lewellyn: like more than half an hour on a sandybridge i5? Feb 15 05:59:56 lasserix I'll be using sqlite later I thinks Feb 15 06:00:30 codebam: probably. Feb 15 06:00:38 If you're using sqlite, you can be certain it won't be "more efficient" than SharedPreferences Feb 15 06:00:56 cause my pc has stopped responding altogether for the past half hour Feb 15 06:01:02 will not be for preferences Feb 15 06:01:12 TheKarlBrown, make sure that whatever Context you store in there is application context, and not an activity context by calling .getApplicationContext, or you are asking for crazy memory leak Feb 15 06:01:26 will be for processing filters for data pulled from a mysql database Feb 15 06:01:52 yiati are you talking about the code I linked or when I'm using shared preferences Feb 15 06:02:04 The code you linked Feb 15 06:02:26 because currently I grab it in mainactivity then reference it in fragments by getActivity().sharedPref Feb 15 06:02:49 code I linked was instaveto'd Feb 15 06:02:57 ? Feb 15 06:03:05 after rejection by hivemind + discovery of ability to save sets which does it better than planned Feb 15 06:05:34 i am trying to understand this data / presentation / domain pattern, what is in domain in android context? Feb 15 06:06:20 what? Feb 15 06:06:38 What's the data/presentation/domain pattern? Feb 15 06:06:46 Model View Controller? Feb 15 06:06:49 for instance http://fernandocejas.com/2014/09/03/architecting-android-the-clean-way/ Feb 15 06:06:52 no Feb 15 06:07:01 ~ not exactly Feb 15 06:08:04 lewellyn: I'll leave it on overnight then and it should be done by morning... right? Feb 15 06:08:34 hey TacticalJoke you here? Feb 15 06:09:42 codebam: likely. Feb 15 06:10:14 lasserix_: looks like according to that article that "domain: A java module without android dependencies." Feb 15 06:10:47 so it doesn't seem likey domain has anything to do with Android context Feb 15 06:11:20 i dont mean context Feb 15 06:11:24 i mean in android programming Feb 15 06:11:37 i dont mean "android context" i mean in the context of android Feb 15 06:11:42 sorry Feb 15 06:11:43 ah lol Feb 15 06:12:06 Given the context of this irc channel it's hard to tell with context Feb 15 06:12:17 which* Feb 15 06:13:22 thank you Feb 15 06:14:20 Well you can make plenty of code that processes data, whether it's models or even controllers that don't necessarily know anything about Android so in the context of Android anything that fits those criteria would be in the "domain" in this architecture Feb 15 06:15:40 but the point is to bridge the data and presentation with the domain? Feb 15 06:16:25 so like if i am building a weather app, the data from the web servers goes into the data, presenting it goes into presentation with its views, and verifying whether a report is still valid is the domain? Feb 15 06:17:48 looking at the code it looks like he just uses it to to do hypothetical test cases Feb 15 06:17:52 lasserix_ sounds right to me Feb 15 06:18:43 getting a nice clean presentation layer always seems to be the tricky part to me Feb 15 06:19:18 thats what i mean, it looks like you can bridge data - presentation by just using a presenter buffer between data and view Feb 15 06:20:19 Ah are you saying you don't understand why domain is necessary? Feb 15 06:20:27 no more like what it is Feb 15 06:20:37 that's why i was asking about the weather example Feb 15 06:20:44 Well in that article they are saying it's the business logic Feb 15 06:21:14 yeah your weather example sounded right to me Feb 15 06:22:18 Hey everyone, I'm trying to add tabs to my app. I've converted it based on this howto ( http://www.androidhive.info/2013/10/android-tab-layout-with-swipeable-views-1/ ) but I can't see the actual tabs. I can see the fragments in the tab, and I can swipe between them, but the actual tabs are missing Feb 15 06:23:42 lasserix_ thanks for that link I will have to read into more later Feb 15 06:28:02 later Feb 15 06:28:18 night Feb 15 06:28:19 thanks Feb 15 06:28:32 anyone seen a library for making animation drawable sequence controllable like a media player? Feb 15 06:36:57 Hey guys how do you communicate from an app to a database securely? I've never done anything like this. My friend told me something about using jwt? Any commments? Feb 15 06:38:50 Database on the client or server? Feb 15 06:39:28 deuteros__, communicate to a server Feb 15 06:39:44 if you make avd via command line, how do you make the avd manager in androidStudio find it? Feb 15 06:39:52 deuteros__, not locally.. is that what you meant? or did I misunderstand? Feb 15 06:40:12 gopar: Then you need a server and you communicate with it with something like json (or protobufs Feb 15 06:55:44 would /storage/emulated/0/Download/lol be the location of lol in downloads in my sd card? Feb 15 06:59:59 nvm crazy question for some reason files didn't appear until I rebooted zee phone Feb 15 07:05:55 not flushed? Feb 15 07:09:49 gopar: ! Feb 15 07:09:52 g00s: ! Feb 15 07:11:30 thepoosh, im guessed you called the wrong person? Feb 15 07:11:38 yeah, sorry mate Feb 15 07:11:43 but HI!!! Feb 15 07:12:08 thepoosh, ha HI :D Feb 15 07:12:23 * thepoosh is sorry for the hastle Feb 15 07:13:17 napster: hi dude Feb 15 07:13:31 oh hey thepoosh :) whazzup? Feb 15 07:13:36 mmmkay Feb 15 07:13:45 ordered a OnePlus One last week Feb 15 07:13:55 I'm setting up a mail server here! Feb 15 07:13:59 OnePlus cool Feb 15 07:14:17 mail server?! Feb 15 07:14:18 Sleek phone isn't it? Feb 15 07:14:42 yep, had one domain, so working out a postfix-dovecot-webmail setup Feb 15 07:14:57 hey thepoosh Feb 15 07:15:05 09:13 thepoosh: ordered a OnePlus One last week Feb 15 07:15:12 here comes the legend g00s :) Feb 15 07:15:23 lol Feb 15 07:16:30 I will need to develop an IMAP client on android Feb 15 07:16:49 thepoosh hows the device? Feb 15 07:17:00 shipping Feb 15 07:17:09 API-21 right? Feb 15 07:17:16 shipped yesterday from CA to Chicago Feb 15 07:17:27 and then will start shipping to Israel Feb 15 07:17:32 will be Feb 15 07:17:37 it runs CM Feb 15 07:17:46 I see Feb 15 07:17:48 Are the onePlusOne officially on sale now? Feb 15 07:18:14 I thought it run stock android Feb 15 07:18:23 nah Feb 15 07:18:33 deuteros__: on Teusdays Feb 15 07:18:39 but i got an invite on FB Feb 15 07:20:54 will be interesting to see what fruit comes of MS investing in CM Feb 15 07:20:58 someone needs to introduce collapsing/expanding text blocks in html rendering Feb 15 07:25:18 MS invested in CM?! Feb 15 07:25:29 70M Feb 15 07:25:34 defaq! Feb 15 07:25:44 well, to put their apps on there probably :D Feb 15 07:25:48 they know they cant do hw so they are angling for software integration Feb 15 07:26:07 you Feb 15 07:26:23 you'll probably get a subscription to cm with ms with your cell phone contract ;p Feb 15 07:51:04 CM? Feb 15 08:04:16 phix: http://www.cyanogenmod.org/ Feb 15 08:04:51 hi, I want to start an intent that requires permissions from adb, for example "adb shell am start -a android.intent.action.SET_ALARM". How can I tell him that he has the permissions to do this from adb? (Currently it fails with SecurityException: Permission Denied" Feb 15 08:05:39 thepoosh: ah that one, yeah I have that on my tablet Feb 15 08:06:49 meital: adb grant permission Feb 15 08:08:25 thepoosh: I can't see it in the help...what is the exact syntax? Feb 15 08:08:49 CM is better in power management on my GNex, it lasts for more than one day on GNex. Feb 15 08:10:42 meital: adb pm grant Feb 15 08:12:21 http://www.jasonwhaley.com/blog/2015/2/13/irc-as-a-hiring-filter Feb 15 08:18:57 lasserix_ lol, did you read the 1st comment Feb 15 08:19:07 "eat my a.." Feb 15 08:19:19 hehehe Feb 15 08:24:34 http://blog.heyzap.com/post/110844026853/the-future-of-mobile-app-development Feb 15 08:25:38 youtube for apps ? isn't that like Play Store ? Feb 15 08:25:41 O.o Feb 15 08:26:09 if there isn't enough commitment to dl through play, it should be a webapp that isn't installed :) Feb 15 08:26:33 "iOS is where the revenue and early-adopters are" Feb 15 08:26:48 wait i'm on android using java 6-7, aren't i an early adopter :D Feb 15 08:27:35 lasserix_ the idea of swift on android is interesting though Feb 15 08:27:44 yeah Feb 15 08:27:50 tho ive heard some parts of swift are a pos Feb 15 08:28:09 like you have to cast elements out of a collection and such or something like that Feb 15 08:28:55 Did you see this? http://arxiv.org/abs/1502.01410 Feb 15 08:29:05 95% of java code on bickbucket sampled is redudent Feb 15 08:30:21 yeah, getters and setters, etc Feb 15 08:30:24 "Shah: Greater and more flexible UI controls on Android would be very helpful." Feb 15 08:30:30 man i've been saying this for years Feb 15 08:30:51 have you seen view flow or flowvie? Feb 15 08:30:59 but what do you mean UI controls? Feb 15 08:31:55 still reading, once sec. " That’s why almost all of the top 100 Android apps use the Android NDK to optimize their app. " wonder if that is true Feb 15 08:32:24 yeah Feb 15 08:33:48 all those guys said build for apple watch Feb 15 08:34:11 not sure Feb 15 08:34:13 lasserix_ when i did ios dev a while back , the catalog of UIKit widgets was >> Android's Feb 15 08:34:19 ahh Feb 15 08:34:43 google proabbly suspected android devs would publish more libraries since open source Feb 15 08:34:56 but they should encoruage it and make a whole subsection Feb 15 08:35:06 devoted to dependencies for devs by devs for ui ;p Feb 15 08:35:23 probably also helped along by e.g. cocoapods. we've been stuck with Eclipse until recently :| Feb 15 08:35:26 not great for code-reuse. Feb 15 08:35:33 oh yeah Feb 15 08:35:35 definatly Feb 15 08:36:02 hi everyone Feb 15 08:36:35 g00s --> apple phone because you could probably make a killing on some car related widget Feb 15 08:36:46 whena pple releases their car or whatever auto it is theyare doing Feb 15 08:37:47 `gradle build` fails with error: package R does not exist. but mvn package does his work well. R has links to all variables and templates. How to force gradle understand this ? Feb 15 09:03:43 this https://appetize.io infact is pretty good I think Feb 15 09:04:40 if they release a home launcher (with all the apps available in their... so called store...) one can start using apps right away. Feb 15 09:05:01 without downloading none. Feb 15 09:16:34 I've got 2 tabs (fragments) in a ViewPager in my main activity. When I change from one tab to the other, is the currently shown fragment object destroyed and the new one created? Feb 15 09:16:49 Or do they survive once they're created Feb 15 09:17:56 one left, the current and the right are 'cached' Feb 15 09:18:10 so in your case they shouldnt be destroyed Feb 15 09:18:42 good Feb 15 09:19:33 depends Feb 15 09:19:37 on which adapter Feb 15 09:19:51 if it contains the word state in the adapter name then it is alwasy destroyed Feb 15 09:19:55 now, when I change a setting in my SettingsActivity, I'd like to pass the new value to both objects. What's the best way to do that? Feb 15 09:19:56 and recreated Feb 15 09:20:17 abstract the view state and present it Feb 15 09:34:17 hi there Feb 15 09:34:38 I have an issue with a menu on a viewpager Feb 15 09:35:31 when I go to another fragment, and click on back button to return to pager fragment Feb 15 09:35:43 the menu disappear although the toolbar seems to be populated Feb 15 09:35:43 lasserix_: I'm not sure I know what you mean. I can get the Fragment from the FragmentManager but I can't cast it to my specific class so I can call methods on it Feb 15 09:36:03 fragment has a call present Feb 15 09:36:07 which takes whatever data Feb 15 09:36:08 and presents it Feb 15 09:36:22 oh, ic Feb 15 09:36:56 you implicetly generally do this onCreateView or whatever, but if you make a dedicated method (or interface) to state invalidation for your views Feb 15 09:37:18 then you can always have a solution to things like user changes display preferences without respect to which detail Feb 15 09:39:42 what am I doing onCreateView? Load stuff from the settings? Feb 15 09:39:55 umm Feb 15 09:39:56 i dont know Feb 15 09:40:07 but usually people set up their view references, and load whatever initial data they want to display Feb 15 09:40:19 yes Feb 15 09:40:39 i am just saying if you give your fragment a present() command, then it should take whatever it is responsibility for showing, and update its state accordingly Feb 15 09:40:55 my fragment doesn't offer a present() Feb 15 09:43:50 this is the android.app.Fragment you're talking about or the android.support.v4.app.Fragment? Feb 15 09:44:08 no Feb 15 09:44:10 you add it Feb 15 09:44:14 but oyu asked how to transfer data Feb 15 09:44:20 so im asnwering the wrong question Feb 15 09:44:30 but you can just pass it as a buncles arguement Feb 15 09:44:35 but how can I call it if I don't have the specific class object? Feb 15 09:45:14 if a setting is changed then it means the fragment will have to be redisplayed Feb 15 09:45:42 oh Feb 15 09:45:42 http://developer.android.com/reference/android/content/SharedPreferences.OnSharedPreferenceChangeListener.html Feb 15 09:45:45 you could use that Feb 15 09:46:54 i dont know how you start your settings activity Feb 15 09:46:59 but you could use activityForResult Feb 15 09:47:25 yes, I've got the onActivityResult overwritten Feb 15 09:47:39 this is where I'm trying to call my Fragments' methods Feb 15 09:48:03 so you go activityA with tabs to activityB with settings, then you return from B to A? Feb 15 09:48:12 and thats when you are trying to call your fragments? Feb 15 09:48:28 that's why i am saying add a method present which makes the fragment updates its view state Feb 15 09:49:10 can an activity have both settings and tabs? Feb 15 09:49:16 sure Feb 15 09:49:24 good, that's what I'm trying to do :) Feb 15 09:49:49 so I'm not changing activities, just changing tabs Feb 15 09:50:05 one tab is settings? Feb 15 09:50:12 oh Feb 15 09:50:14 i see Feb 15 09:50:20 the settings are a new activity Feb 15 09:50:31 so yes, you were right :) Feb 15 09:52:12 so I've added a method to my fragment. Let's call it update() Feb 15 09:52:56 and in main main activity, which has the tabs, I've gotten hold of the fragment from the fragment manager Feb 15 09:54:07 but because the fragment manager returns a Fragment class, and not a MyFragment class which extends the Fragment class, I can't call .update() Feb 15 09:54:23 and it won't let me cast it Feb 15 09:54:43 am I thinking the wrong way? Feb 15 09:55:53 yes you can cast it Feb 15 09:56:06 just make sure you have it referenced correctly ie Feb 15 09:56:19 Fragment mFragment = fragMang.et(TAG) Feb 15 09:56:40 you need to MyAwesomeFragement f = (MyAwesomeFragement) fragManager.get(TAG) Feb 15 09:57:00 \\\\\\\\ Feb 15 09:57:07 hm, I used findFragmentById Feb 15 09:57:43 nj\wahatever it doesnt matter does it\\ Feb 15 09:58:04 that was just an example Feb 15 10:00:08 work? Feb 15 10:00:14 Ah, I'm mixing the support.v4.app.FragmentManager and the android.app.FragmentManager. that's why it doesn't work Feb 15 10:02:55 what's the difference? Feb 15 10:03:48 it is recomended you always use support.v4 fragments Feb 15 10:03:49 it's just maintaining backwards compatibility, isn't it? Feb 15 10:03:55 essentially Feb 15 10:04:07 people say the support is more stable / reliable and should always be used Feb 15 10:04:31 hm, so main main activity extends the v7 actionbaractivity Feb 15 10:04:54 that's why the fragmentManager returns the "wrong" type Feb 15 10:06:16 but I need the actionbar Feb 15 10:06:27 no Feb 15 10:06:30 they are different Feb 15 10:06:35 you probably have the wrong imports Feb 15 10:06:41 delete thema ll and reimport them Feb 15 10:06:50 just make sure you are consistent Feb 15 10:07:42 there is only one ActionBarActivity on offer Feb 15 10:07:50 Anybody using viewpagers here? Feb 15 10:07:54 yeah thats not the problem Feb 15 10:08:01 teegee can you post your activity code Feb 15 10:08:07 h4k1m: sure Feb 15 10:08:31 teegee: your inability to case the fragment is not because of your importing actionbaractivity Feb 15 10:08:56 its probably because you are doing like Fragment fragment = (MyAwesomeFragment) fragmentManager.get Feb 15 10:09:07 see the problem? Feb 15 10:09:24 no, I'm not doing that ;) Feb 15 10:09:41 can you post your code? Feb 15 10:10:11 lasserix_: I have issues with the android back button when I click on it to return to a viewpager, it's menu disappear Feb 15 10:10:29 anyone has encoutered this bug? Feb 15 10:10:40 say that again, which menu dissapears? Feb 15 10:10:47 return from where? Feb 15 10:11:15 when you click back, it usually closes menus that are open, that is what it is typically used for... Feb 15 10:12:20 lasserix_: all of both classes or just the casting? Feb 15 10:12:22 lasserix_: ok so I'm on the viewpager fragment, then I go to a new fragment... when I try to go back to the viewpager (with the back button), it's menu disappear Feb 15 10:12:37 both classes Feb 15 10:13:17 h4k1m: what menu? Feb 15 10:13:59 lasserix_: viewpager's menu Feb 15 10:14:07 the menu present on viewpager's fragments Feb 15 10:14:20 what menu? Feb 15 10:14:40 there is no default menu on viewpager fragments Feb 15 10:15:38 lasserix_: I actually I'm attacking a toolbar to the viewpager Feb 15 10:15:49 and the menu is inflated in the toolbar Feb 15 10:16:28 yeah you have to save the state of it somehow and reopen it Feb 15 10:16:30 lasserix_: http://pastebin.com/GkML3buj and http://pastebin.com/b880x1a8 Feb 15 10:16:58 lasserix_: it's a mess. I was in the middle of a rewrite Feb 15 10:17:08 whats the line of code with error? Feb 15 10:17:14 lasserix_: I'm kind of a noob, how do I save the state of the toolbar menu please? Feb 15 10:17:23 oh i see Feb 15 10:17:26 h4k1m: google it Feb 15 10:17:48 l 82 Feb 15 10:18:06 lasserix_: thanks I'll google it, hope that's the reason Feb 15 10:19:28 teegee you have to use support fragments Feb 15 10:19:30 with viewpager Feb 15 10:20:02 what do you mean? Feb 15 10:20:12 import android.support.v4.app.Fragment; Feb 15 10:20:15 oh, those Feb 15 10:20:23 I am Feb 15 10:20:28 no you are not Feb 15 10:20:32 I was :) Feb 15 10:21:16 see the old imports Feb 15 10:22:16 that means I also have to use support FragmentManager Feb 15 10:22:24 doesn't it? Feb 15 10:22:37 getSupportFragmentManager()? Feb 15 10:22:46 aHA Feb 15 10:23:03 there's a method I wasn't aware of :) Feb 15 10:23:21 that fixes it. thank you Feb 15 10:24:11 does that work? Feb 15 10:24:25 i didn't think the fragmentpager uses fragment manager but i guess it does Feb 15 10:24:43 the squiggely lines go away. no idea if it actually works Feb 15 10:25:02 not ready to run it just yet Feb 15 10:27:23 do you set their id somewhere? Feb 15 10:27:53 the fragments'? Feb 15 10:28:46 you mean to make sure the R.layout.fragment_tab_abs works? Feb 15 10:30:19 So what do you guys use when you want to determine the actual usable screensize of an activity ? Feb 15 10:30:25 ( not full screen size ) Feb 15 10:33:01 wow, it didn't crash! Feb 15 10:33:49 ah, now it did Feb 15 10:35:10 how can i find my android hostname ? Feb 15 10:38:35 lasserix_, no you don't, you can use whatever you want with view pager Feb 15 10:39:09 hmm, my fragment is null :( Feb 15 10:43:27 pfn he was using fragmentpager Feb 15 10:43:40 teegee yeah you have to set an id or tag Feb 15 10:43:45 its pretty easy Feb 15 10:44:07 just in getView of the adapter do setTag(position) then do find fragmetn by tag(position) or something along those lines Feb 15 10:44:08 laa Feb 15 10:44:21 lasserix_, of course, using the wrong adapter is a different story Feb 15 10:44:38 can you use fragmentmanager to pull fragments created by fragment pager adapter? Feb 15 10:50:02 so I worked out that I have to set the tag of the fragment by using the fragmentTransation.add() method Feb 15 10:52:09 lasserix_: I overwrote the getItem method in my ViewPagerAdapter. This is where I create the new fragments, but it won't let me do setTag() Feb 15 10:54:55 lasserix_: or can I just set an android:tag in my fragment.xml, which is a ScrollView Feb 15 10:55:13 can anyone assist next error: Error:Class org.hamcrest.BaseDescription has already been added to output. Please remove duplicate copies. Feb 15 11:10:41 teegee you can maybe call notifydatasetchanged on the adapter Feb 15 11:10:48 itll force the getview/createview to be called again Feb 15 11:10:58 so your fragment can auto redisplay from oncreateview being called again Feb 15 11:11:46 lasserix_: I'm just trying to figure out how to use the transactions Feb 15 11:12:00 teegee: the thing is teh adapter does stuff for you Feb 15 11:12:13 so normally you wouldn't do that i think (use frag manager and fragment pager adapter) Feb 15 11:12:35 i dont know what you mean wont let me set the tag Feb 15 11:12:42 don't I have to use the adapter to get my tabs? Feb 15 11:12:49 but you can and once you figure out how you can proabbly get the fragment that way Feb 15 11:12:52 i dont know Feb 15 11:14:10 if all you are trying to do ismake your fragment redisplay you can just call adapter.notifydatasetchanged Feb 15 11:14:16 after coming back from settings Feb 15 11:14:32 you might be able to call invalidate on the view pager Feb 15 11:18:21 if you look at the last comment you can get the fragment by tag Feb 15 11:18:29 apparently it is autocreated by the fragment pager adapter: http://stackoverflow.com/questions/16089152/update-fragment-view-within-fragmentpageradapter-in-sherlockfragmentactivity Feb 15 11:18:33 but now i got to goto bed goodluck! Feb 15 11:19:04 hmm Feb 15 11:24:50 I can call notifyDataSetChanged() but the view doesn't refresh. is there a method I have to overwrite? Feb 15 11:28:12 I have an activity with 3 attached fragments and I'm trying to implement SDK 4 of Analytics but get 'cannot cast to to Analytics' on tracker = ((Analytics) getApplication()).getTracker(Analytics.TrackerName.APP_TRACKER);. I have that line in the MainActivity. What am I doing wrong? Feb 15 11:28:23 teegee: http://alexfu.github.io/blog/2013/06/17/notifying-viewpager-fragments/ Feb 15 11:29:52 lasserix_: thanks :) Feb 15 11:30:00 the Analytics class is just the sample from Google, like this: http://pastebin.com/U45FtuKR Feb 15 11:32:27 android.app.Application cannot be cast to com.x.x.Analytics Feb 15 11:51:43 Hello everyone. I'm trying to let an Android websocket application (running on Genymotion, using VirtualBox instance) connect to a websocket server connection that is hosted on my Tomcat 8 instance (Windows). What IP should I use to connect to my server? 192.168.1.x or the IP from the virtual machine's network adapter? Feb 15 11:52:26 try the 192.168... Feb 15 11:53:02 I receive the error: de.tavendo.autobahn.WebSocketConnection﹕ fail connection [code = 4, reason = WebSockets protocol violation Feb 15 11:53:21 I get that error with both IP's tried. Feb 15 11:54:57 I also get this: RSV != 0 and no extension negotiated Feb 15 11:55:02 have you tried devic Feb 15 11:55:03 e Feb 15 11:55:08 Device? Feb 15 11:55:39 real device, not emulator Feb 15 11:57:30 the ip probably works, but server or the client might be misconfigured Feb 15 11:58:06 I don't have a real device. Feb 15 11:58:35 Well, actually I do. Feb 15 11:59:01 nite all Feb 15 11:59:14 or have you tried connecting to ws://echo.websocket.org Feb 15 12:00:24 Ok I'll try that. Feb 15 12:01:38 What.. Feb 15 12:01:49 Ashiren, ws://echo.websocket.org works perfectly! Feb 15 12:02:00 So the problem seems to be either server or client side.. Feb 15 12:04:09 Would you say it's a server or client side problem? Feb 15 12:04:28 yes Feb 15 12:04:47 Which? Feb 15 12:04:58 i dont work much with websockets Feb 15 12:05:02 at least with server side Feb 15 12:05:07 Ok. Feb 15 12:05:27 i know they websockets can be really pain sometimes Feb 15 12:07:13 They can indeed. Feb 15 12:22:11 is there anything like wget in the android cli that lets me download a single file via a batch script? :/ Feb 15 12:31:15 day, maybe there is curl? Feb 15 12:33:24 Other than urlconnection, what other way to download a file as a respose to a post request? Feb 15 13:04:16 q: what max java version android is using ? Feb 15 13:18:58 Hi guys , please how to connect Android Wear Emulator to Genymotion Emulator , I have a long time searching for it but not found , please any help ? Feb 15 13:52:37 Hi guys , how to connect Android Wear Emulator to Genymotion emulator ? Feb 15 14:02:56 Hi Feb 15 14:04:37 How does google SHA1 certificate fingerprint works? Feb 15 14:04:59 In developers console. I have created any app and map APIs Feb 15 14:05:08 It's working prefectly. Feb 15 14:05:23 But, how does it exactly know that is my application? Feb 15 14:07:29 iraycd, the API probably sends the fingerprint of the app with request Feb 15 14:07:45 How are they sending? Feb 15 14:07:51 That is what i want to know. Feb 15 14:08:50 iraycd, it's closed source and encrypted. Feb 15 14:08:56 what are you trying to solve? Feb 15 14:09:54 I want to build a rest api. Same as Google is doing. Feb 15 14:10:42 So developers who are using my application. I can get the request and validate their application. Feb 15 14:12:06 Mavrik: I am only interested in validation, that the call are only happening through a valid application. Feb 15 14:13:43 Mavrik: Facebook is also doing the same thing. They are validating my application through SHA-1 Key. How are they doing that? Feb 15 14:15:01 iraycd, what exactly is unclear Feb 15 14:15:39 iraycd, they compare apps apikey and signature hash against the data on server Feb 15 14:15:40 on request. Feb 15 14:16:01 or at login, or whatever Feb 15 14:16:28 You didn't exactly get me. Feb 15 14:17:01 I am using "Google Maps Android API v2" Feb 15 14:18:35 Mavrik: For which I need to create "Public API access" which asks me for my "SHA1 certificate fingerprint and package name" Feb 15 14:19:27 Mavrik: After I create I will get an "API KEY". Feb 15 14:20:18 Mavrik: This API key can't be used anywhere except the app which is based on that "SHA1 certificate fingerprint" Feb 15 14:21:23 If someone else try to do a API Request with that key, the access will be denied. Feb 15 14:22:17 q: what correct path i need to set in javac -classpath -Xlint ? Feb 15 14:22:24 I just want to check syntax from command line Feb 15 14:22:25 Mavrik: How do they able to know that is' my application? Feb 15 14:22:32 I suppose it must be android-sdk somewhere Feb 15 14:23:14 Mavrik: How do they know that it's my application? Feb 15 14:24:45 Cursor and CursorLoader,... ist that something you use when accessing a local database? Feb 15 14:26:47 http://stackoverflow.com/questions/24837983/how-google-use-sha-1-fingerprint-to-check-valid-android-apps Feb 15 14:27:24 Mavrik: This is the question. Which was unanswered. Feb 15 14:29:43 Hi guys, is the fragment created by xml will not destroy after call fragmentTransaction.replace() to replace it ? Feb 15 14:36:34 I create a fragmentA in xml file, and replace it by fragmentB in java code by fragmentTransaction.replace(). I notice that fragmentB is added, but the fragmentA still there. Feb 15 14:37:34 fragments in xml cannot be replaced Feb 15 14:39:26 So the right way is create fragment in java code, and insert it to my view ? Feb 15 14:40:28 eeyup Feb 15 14:41:26 ohch.., OK, thanks :P Feb 15 14:42:00 i mean if you want them dynamically Feb 15 14:58:36 Should I use a SimpleCursorAdapter for my ListView to populate the view with the results from an AsyncTaskLoader(which performs a HTTP query,.. does that make sense)? Feb 15 14:59:14 no Feb 15 15:01:14 Hey guys do you know how to make a DialogFragment wrap content, instead of manually setting the dimensiosn Feb 15 15:17:27 I was wondering if I can get some ideas on how to do something. I have an app that exists both for English and Chinese for iOS and Android. I'm wondering what the are some approaches to handle the following scenario: We have a part of the app that is a series of Q/A which can change from time to time. Without having to ship a new version of the app to handle question changes, I want to the apps to update the localization for each o Feb 15 15:17:27 f the Q/A by downloading data from a server. I can do this on iOS pretty easily. However, I have found on SO that this may not be doable on Android without losing some performance. Thoughts? Feb 15 15:18:37 Hello, how can I get notified when a view is done loading? Feb 15 15:18:47 Log.d Feb 15 15:18:53 or using Toast Feb 15 15:19:29 but it's not optimal way through Feb 15 15:19:29 I want some listener, tjhat will be calledback when layouting is done Feb 15 15:19:46 I have weird behavior with ViewPager. First opened - all are OK, second opened - some fields are blank - I have Fragment fragment = new PlanFragment(pagercontext, i+1); in getItem() and this.day = day; in constructor (day is second parameter); What I'm doing wrong? Feb 15 15:20:25 you need a different Id for each pager Feb 15 15:22:13 Ok, found it, viewTreeObserver Feb 15 15:22:50 I am considering storing the strings in a db table for android that gets refreshed on app startup. Feb 15 15:23:11 but I think the performance of doing lookups that way will slow the app down enormously Feb 15 15:24:26 Hi Feb 15 15:24:38 Does anybody know a good tutorial on reading xml files? Feb 15 15:25:43 nice, I crashed AS with ̶ Feb 15 15:26:01 (dont copy it into a text view or bad things happen) Feb 15 15:27:19 Also, do you guys prefer Android Studio or Eclipse Feb 15 15:27:35 I'm currently using studio but compared to VS and Netbeans it feels kinda off Feb 15 15:27:39 haven't used eclipse but AS seems nice as a newb Feb 15 15:27:50 (and I'm a newb) Feb 15 15:28:39 Yeah it's not bad or anything, I've already built a simple morsecode app with it, it just doesn't really work that well Feb 15 15:28:51 Also for some reason it doesn't run at all on my ubuntu laptop Feb 15 15:29:15 startup takes a good 5 mins and then it runs so slow it might as well be considered frozen Feb 15 15:42:35 Hey, is there any way to pass arguments to a PreferenceFragment created through Preference.setFragment? I cant use setArguments because the Fragment is already initialized, and I can't use getters and setters, because Casting to my custom PreferenceFragment class fails in the callback of OnPreferenceStartFragment. Feb 15 15:44:08 Quatroking, your laptop sucks Feb 15 15:44:25 it has an i5 cpu tho Feb 15 15:44:30 2.4ghz IIRC Feb 15 15:44:38 4 gb ram Feb 15 15:44:57 but yeah the gpu is burnt so it runs off the cpu, that probably has something to do with it Feb 15 15:45:24 yeah, developing on 4GB of RAM sucks Feb 15 15:45:38 netbeans works fine tho Feb 15 15:45:40 monodevelop too Feb 15 15:46:20 sounds more like your linux install is busted if it takes 5 min to stay Feb 15 15:46:23 start Feb 15 15:46:45 but it's only AS that does this Feb 15 15:46:53 everything else works just fine Feb 15 15:51:44 doesn't make it any less broken Feb 15 15:52:10 plenty of people are running it on Ubuntu laptops without a problem Feb 15 15:52:55 so because one program runs like crap on my laptop Feb 15 15:53:01 my entire OS is to blame Feb 15 15:53:03 :I Feb 15 15:53:34 I've got a listview with two types of items; one is normal, and one should appear inset. how do I add an inset shadow? I've tried setting the elevation of the other (normal) items, but that doesn't appear to do anything. I'm using the support library. Feb 15 15:54:56 actually hold on, it might be because the inset item has a background Feb 15 15:58:50 nope, no dice Feb 15 16:00:30 i thought support libs dont support elevation... Feb 15 16:02:00 elevation isn't supported pre lollipop Feb 15 16:02:58 is there a way of testing my GSON Versioning, I don't want my users to lose their data Feb 15 16:03:46 tuesday: Write tests of a new client getting the old payload? Feb 15 16:16:51 sabton, pfn: it doesn't have to work pre-lollipop Feb 15 16:16:56 I have a view pager that's releasing views too much Feb 15 16:17:28 I know that this requires memory, but I would prefer to manage this manually and do cleanup whenever the app is paused Feb 15 16:17:31 or low memory Feb 15 16:18:14 found it =) Feb 15 16:22:24 does anyone know any good resources with free or paid android tutorial videos? Feb 15 16:23:02 on the intermediate-expert level. so learning good practices Feb 15 16:23:34 tutorials for experts... Feb 15 16:23:39 dont see much of those Feb 15 16:24:28 sabton, we're talking about programming. no one's really an expert Feb 15 16:26:21 I'm looking for something like Laracasts for PHP, but something for Android https://laracasts.com/ Feb 15 16:27:29 so something that teaches SOLID principles and such Feb 15 16:40:14 cmd Feb 15 16:40:17 Oops. Feb 15 16:40:35 Start+R fail. Feb 15 16:40:43 rm -rf Feb 15 16:40:49 :D Feb 15 16:40:57 thisismypassword Feb 15 16:40:59 oops wrong window Feb 15 16:41:04 This is totally not my password Feb 15 16:41:09 lies Feb 15 16:41:28 I still think my pornhub link yesterday was funny :P Feb 15 16:47:15 how can i programmatically find out if the user has just updated to the new version of an application Feb 15 16:47:28 Does anyone have a few minutes to give some feedback on my app? I'll try and rate yours too. :) Feb 15 16:48:41 MikeWallaceDev, smooth move Feb 15 16:49:05 I thought it was :D Feb 15 16:49:06 tuesday, save your current version number somewhere Feb 15 16:49:34 And if you use AS+Gradle to build your app, you'll find this number in BuildConfig (automatically generated) Feb 15 16:49:54 andy98: You might as well just post the link. If people care to install it and give feedback, they will. Feb 15 16:50:02 tuesday, generic code : http://pastebin.com/DHWCU2ni Feb 15 16:50:12 tacticaljoke: I was going to do that. but advertising supposedly isn't permitted in here. :p Feb 15 16:50:24 pfn: good call, i can make it a shared preference Feb 15 16:50:26 this is the first time I've been in this channel, by the way Feb 15 16:50:44 that was the right way to do andy98 Feb 15 16:50:48 thanks :) Feb 15 16:51:04 but now that TacticalJoke asked, it's fine Feb 15 16:51:08 okay. :D Feb 15 16:51:10 very well Feb 15 16:51:48 here's a link to my app. please try it if you have a few minutes to spare. it's safe, free, and ad-free. I'm a new developer just trying to build up my skillset. :) Feb 15 16:51:50 link: https://play.google.com/store/apps/details?id=com.terminalentertainment.tiltnmeasure Feb 15 16:54:11 looks nice andy98 , I'll install it Feb 15 16:54:40 thanks, mike. :D Feb 15 16:55:19 first comment, it's flat on the table.. he doesn't like it :D You could maybe check for that case Feb 15 16:56:23 oops (maybe?) legacy menu Feb 15 16:56:32 but maybe that's by design? Feb 15 16:57:02 Does it make any sense to use AsyncTaskLoader and CursorAdapter when the data source is a JSON API endpoint? I can't wrap my head around it Feb 15 16:57:07 the flipping numbers == niiiiice Feb 15 16:57:15 platzhirsch, no Feb 15 16:57:23 it never makes sense to use loaders Feb 15 16:57:34 Yeah, it seems fiddly when it comes to laying the phone flat. Feb 15 16:57:34 pfn: so I better keep to AsyncTask and ArrayAdapter? Feb 15 16:57:46 2, it never makes sense to use a cursor adapter on non cursor data Feb 15 16:57:50 I would get rid of the legacy-menu-button thing. An on-screen button would look way nicer. Feb 15 16:57:55 tacticaljoke: referring to my app? I'm aware that's a proble, :p Feb 15 16:58:00 Yeah. Feb 15 16:58:05 pfn: yeah, that's what I was thinking.. Feb 15 16:58:09 good, that reassures me Feb 15 16:58:29 there are onscreen buttons, once you press the menu button Feb 15 16:58:34 andy98, what's the point of the "screen location" button? Feb 15 16:59:03 ooops /location/rotation/ Feb 15 16:59:05 screen rotation, mike? that enables the rotating interface Feb 15 16:59:32 well, I see what it does, but.. why? Feb 15 16:59:45 why have that as a button, you mean? Feb 15 16:59:54 or does the feature seem pointless? Feb 15 17:00:45 I dont' understand the feature (but also, maybe it's a bug because I locked the angle, then unlocked it) Feb 15 17:01:15 well, press the screen rotation button and you'll see what it does. it SHOULD show a guideline parrelel to the ground if it's enabled Feb 15 17:01:21 does that work on your device, Mike? Feb 15 17:01:43 ok, no, it's not working correctly then. Feb 15 17:01:55 you hold your phone on its side and tilt it. the screen rotation keeps that black guideline parrelel to the ground Feb 15 17:01:56 hm Feb 15 17:01:59 what's your device? Feb 15 17:02:27 that was the default mode, that works. (really nice) Feb 15 17:02:40 ah, good. :) Feb 15 17:02:48 pfn: but it might make sense to use AsyncTaskLoader in favor of AsyncTask? Seems a more mature interface with respect to configuration change, cancelation, etc. pp Feb 15 17:02:58 clicking on the screen rotation button .. then it doesn't work correctly Feb 15 17:03:09 loaders generally always suck to use Feb 15 17:03:14 your choice Feb 15 17:03:48 mikewallacedev: yeah, the button enables/disables the rotation feature. I can probably remove the button, since there's no real reason to disable it. :p Feb 15 17:04:05 by the way, does that blue background look too dark? Feb 15 17:05:14 the color is not an issue Feb 15 17:05:18 just the design basically Feb 15 17:05:23 background is fine for me. Feb 15 17:05:41 if you made the buttons "normal" and not a gradient in here: https://lh5.ggpht.com/mlXUmvqmHmpT2K6BQRabKv6bLYsvr5VgfaLbNoa2YwQkAM_Q1jRgaLhzUS6KyewpSy3C=h900-rw Feb 15 17:05:47 I would download the app Feb 15 17:05:50 but now? nope Feb 15 17:06:24 Personally, I don't mind the buttons. Not "material", but not ugly to my eye. Feb 15 17:06:28 I really don't see the need for that other mode andy98 Feb 15 17:06:28 also, 6,9MB for just that? Feb 15 17:06:47 moter8: just curious. what do you mean by 'normal' buttons? Feb 15 17:06:52 Also the text font. Feb 15 17:07:01 andy98, those that AS gives you by default Feb 15 17:07:16 6.9mb for a level app? Feb 15 17:07:18 yeah, 6.9 seems big, are you using 9patch? and repeating the background? Feb 15 17:07:23 too big Feb 15 17:07:47 right, the file size is a little inconvenient Feb 15 17:07:54 don't even need 9 patch, all those gfx can be done in xml Feb 15 17:07:55 that's the common complaint, heh. Feb 15 17:08:34 Moter8, not "AS" gives you by default, android Feb 15 17:08:38 pfn, yeah, but his buttons won't look exactly the same... I use XML for my 3D Feb 15 17:08:59 pfn, what gives ;D Feb 15 17:09:27 android provides onscreen buttons for your apps? every app I've used had a totally separate window for setting options Feb 15 17:09:56 MikeWallaceDev, that's not a bad thing Feb 15 17:10:33 well, I appreciate the feedback guys. thanks for trying it. this is certainly a starting point for future improvements. Feb 15 17:10:33 "onscreen buttons for your apps"? Feb 15 17:10:47 andy98, easy, add another view group in z order Feb 15 17:11:01 andy98, https://play.google.com/store/apps/details?id=pw.moter8.interactivestory Feb 15 17:11:13 hide and show as necessary Feb 15 17:11:18 a button like you see there; disclaimer it's my app Feb 15 17:12:26 andy98, do you keep the screen on without asking the user? That could be a battery killer. Feb 15 17:12:28 andy98: I'm seeing a problem on my Sony Xperia M (running 4.1.2). If I open the app and click the back button, the next time I open the app, I just see a black screen and then it closes. Feb 15 17:12:39 If I then swipe it out of Recent Tasks, I can open it the next time. Feb 15 17:12:48 If I then press Home instead of Back, I can go back to the app. Feb 15 17:12:49 moter8: yes, I see what you're referring to now. you don't like the non-standard buttons I'm using. Feb 15 17:13:00 oh, yeah, I saw that too. I thought I just did something wrong Feb 15 17:13:05 exactly :D Feb 15 17:13:24 I think the buttons are fine, it gives your app character Feb 15 17:13:43 I think they just look like android 2.3 Feb 15 17:13:48 (point being, you can't please everyone) Feb 15 17:17:43 don't like the buttons if it makes your app 7mb Feb 15 17:18:09 hehe, agreed, you have to shrink things Feb 15 17:18:58 what does 'android.permission.WAKE_LOCK' do, exactly? Feb 15 17:19:03 does that keep the screen on? Feb 15 17:19:14 but also, supplying l,m,h,x,xxxdpi en every device is just dumb. Android should fix that Feb 15 17:19:19 andy98, yes Feb 15 17:19:20 andy98: Did you see what I said about the app not opening? Feb 15 17:19:41 tacticaljoke: I'm trying to reproduce that bug on my galaxy note 8 Feb 15 17:19:52 Okay, wasn't sure whether you saw. :) Feb 15 17:19:52 it did it to me too Feb 15 17:20:25 MikeWallaceDev, not dumb, use xml graphics, or only supply a single version and let os scale Feb 15 17:20:55 andy98, no, it allows you to request a wake lock Feb 15 17:21:30 it is dumb, I should be able to give specialized versions for each device. Why do you think the buckets exist? Feb 15 17:21:57 MikeWallaceDev, you want to target specific devices? yuck Feb 15 17:21:59 what's dumb is that they put every bucket on your device, even if it will never be used Feb 15 17:22:15 not devices, densities. Feb 15 17:22:26 MikeWallaceDev, oh, for scaling reasons Feb 15 17:22:40 MikeWallaceDev, there's nothing stopping you from doing split releases. Feb 15 17:22:50 yaaah (<- Swedish accent. I don't know why) Feb 15 17:22:50 I can provide only an ldpi image and install it on my xxhdpi device Feb 15 17:23:03 won't work if the ldpi image isn't there Feb 15 17:23:08 and vice versa Feb 15 17:23:36 and yeah, you can do split apk stuff Feb 15 17:23:40 Mavrik, right. But I shouldn't have to. Feb 15 17:23:53 Uhuh. Feb 15 17:24:04 Well, I shouldn't have to write all this programming shit either Feb 15 17:24:14 Wow, nice retort. Feb 15 17:24:19 And just do "computerz, plz software for marz, kk thx!" Feb 15 17:24:45 well, lots of things can change, language is one Feb 15 17:25:02 you mean not use Java? Feb 15 17:25:38 no, localization Feb 15 17:25:54 also devices that can emulate different densities and sizes Feb 15 17:26:01 eg Nexus 9 and 10 Feb 15 17:26:06 not sure how that applies to densities Feb 15 17:26:12 oh, right, that's true Feb 15 17:26:36 but then the system could scale Feb 15 17:26:36 Or if you hook up an external display Feb 15 17:26:50 Lots of things to consider Feb 15 17:27:10 Agreed Feb 15 17:27:46 I still think those are edge cases which would be better candidates for scaling. Feb 15 17:28:00 Most people won't be changing their densities Feb 15 17:28:39 ship individual resource apk. Feb 15 17:28:45 so, most of the time, most of the people have an apk that's 4(?) times the size need Feb 15 17:29:14 ship only highest density images then Feb 15 17:29:17 it's more like 125% size they need. Feb 15 17:29:36 Mavrik, including all density Feb 15 17:29:54 Yes, lower density images drop off in size considerably. Feb 15 17:30:16 Mavrik, well no, if I have an hdpi, and yet have all the x, xx, xxxdpi, that's much more than 4 times what I need Feb 15 17:30:18 Also, DEX code is rather large... vast majority of devices nowdays are xhdpi or hdpi Feb 15 17:30:50 MikeWallaceDev, since those resources aren't the same KB size and are compressed Feb 15 17:30:56 it's not really 4x, nowhere near Feb 15 17:31:13 Png don't compress that much. Feb 15 17:33:11 Ahhhhhh, I see the problem. The market can't remove the unneeded graphics and then resign the app Feb 15 17:33:22 so mute point Feb 15 17:34:02 It's not that much work to configure build flavors with density split with Gradle Feb 15 17:34:06 If your app is so large. Feb 15 17:34:17 debatable = moot (sorry, pet peeve :D) Feb 15 17:34:32 I'm not talking about my app. Feb 15 17:34:39 I'm talking about every app Feb 15 17:35:05 and thanks TacticalJoke , but I just meant that I should shut up about my point (mute!) Feb 15 17:35:08 :D Feb 15 17:37:16 devices can simply filter resources per install if it were an issue Feb 15 17:37:49 that's true Feb 15 17:37:50 does anyone know any good resources with free or paid android tutorial videos on the intermediate-advanced levels? Feb 15 17:38:12 tutorials are only for beginners Feb 15 17:38:42 Are banner ads even worth implementing anymore, alongside interstitials? Feb 15 17:40:31 did anyone know the gradle build too has a gui? Feb 15 17:41:19 Which GUI? Feb 15 17:41:33 gradle --gui Feb 15 17:42:15 Interesting. Didn't notice that in the manual before. Feb 15 17:42:55 gradle 2.2.1 Feb 15 17:44:04 pfn, it's ot just learning how to program for Android that you can learn. You can also learn better practices so you wouldn't write shitty code that your colleagues wouldn't be happy to work with Feb 15 17:44:21 ot=not Feb 15 17:44:46 and you could learn how to apply SOLID principles to Android development in a practical way Feb 15 17:45:11 tutorials. don't teach that Feb 15 17:46:07 pfn, why couldn't they teach that. They do in PHP's Laracasts tutorials. https://laracasts.com/ Feb 15 17:46:21 and php sucks, what else is nee Feb 15 17:46:23 new Feb 15 17:47:23 hey guys :DD Feb 15 17:47:51 what do you guys do when you need a logo for your app? Feb 15 17:48:05 amcsi: When it comes to Android programming, as far as I can see, the only (or the best) advanced tutorial involves just doing stuff. Feb 15 17:48:05 and if you like my suck at drawing yourself Feb 15 17:48:07 pfn, I just brought up something good about PHP. Why would you "counter" by saying PHP sucks? Feb 15 17:48:18 because it's not good? Feb 15 17:48:42 Siamaster: Inkscape looks good. I'm in the process of designing my app's icon right now. Feb 15 17:49:41 how is the learning curve? Feb 15 17:50:18 TacticalJoke, I have a friend who wants to learn better practices since his applications to job roles get rejected for them not liking his test application code, but they never state why Feb 15 17:50:22 It seems easy to me, but I'm kinda used to Photoshop. Feb 15 17:50:48 hmm oki :) I've never done this before tho Feb 15 17:51:11 TacticalJoke, so it would be great to find comprehensive resources to learn things like writing easily testable code Feb 15 17:51:25 Writing easy-to-test code? Feb 15 17:51:53 Siamaster: The official guide is good, and there are good YouTube videos. Feb 15 17:51:56 TacticalJoke, yes. Applying separation of concerns, dependency injection, mocking and so on Feb 15 17:52:00 I've been hearing a lot about code that is heard to test in the last few days Feb 15 17:52:03 I was comfortable almost instantly in Inkscape. Feb 15 17:52:07 it really depends on the application aswell imo amcsi Feb 15 17:53:03 amcsi: Ask him to come in here and post code. He could get feedback from people in here. Feb 15 17:53:30 amcsi: As far as I know, there aren't really any tutorials on the Android-specific parts of those topics. There are books on the general parts, though. Feb 15 17:54:14 amcsi: If your friend is actually you, just post the code. :D Feb 15 17:54:27 hahaha Feb 15 17:55:54 TacticalJoke, I'm a PHP and JS guy, I bug people about those languages all the time in those channels. My Android friend is too lazy to ask on chat usually :/ so you say people here are helpful and like to review peoples' code? Feb 15 17:56:27 you can give it a shot :) Feb 15 17:56:33 Yeah, there are people who do that. Feb 15 17:56:38 We eat people usually. Feb 15 17:56:47 Nom nom nom Feb 15 17:57:58 amcsi: FWIW, this channel is the best general Android-help resource I've found. StackOverflow isn't bad either (though it gives very mixed results). /r/androiddev isn't great. Feb 15 17:59:02 Question here: i'm using the navigation up button as described here http://developer.android.com/training/implementing-navigation/ancestral.html#NavigateUp, but the problem is that the Activity which is called on this code have to recover some objects from the extras. I'm getting a null pointer exception when "navigating up" on the line to recover the objects from the bundle. Feb 15 17:59:02 So the question is. Is there any difference between using the "default" code over link or just call the "up" activity with "startActivity"? Because that way i can simple pass the object to the bundle again. Feb 15 17:59:07 The number of people who are both Android beginners and programming beginners in /r/androiddev is too (damn) high (!). Feb 15 17:59:41 (In terms of upvoters.) Feb 15 18:00:42 TacticalJoke, thanks Feb 15 18:00:52 abara, if you call startActivity, you're not going back, you're adding another activity (FLAGS not counting) Feb 15 18:01:01 Hey Dudettes, Dudes and Others, Feb 15 18:01:10 yo Feb 15 18:01:46 MikeWallaceDev: ! Feb 15 18:01:49 speaking of good code.. Feb 15 18:01:55 Anyone know an app in the default software set for the 4.0 AVD that sends share text intents? Feb 15 18:01:59 have you guys tried Google app engines endpoint? Feb 15 18:02:01 MikeWallaceDev: ok, but how can i make the Intent of the "up" Activity not get lost i change from activity Feb 15 18:02:04 thepoosh : ? Feb 15 18:02:09 HAI Feb 15 18:02:29 I'm using it right now , I start to find it really flawed from a architectural perspective Feb 15 18:02:30 abara, look at startActivityForResult Feb 15 18:02:39 HAI! Feb 15 18:02:43 :D Feb 15 18:03:16 Siamaster, tried it, said "WTF", deleted the project. Feb 15 18:03:37 how much did you do with it? Feb 15 18:03:52 just a tutorial or were you actually trying to develop something on it? Feb 15 18:04:08 * pfn always writes appengine stuff separately Feb 15 18:04:09 I'm trying see if I can add support for some older android versions to Shark Share without too much work - https://play.google.com/store/apps/details?id=ie.appz.sharkshare Feb 15 18:04:10 1wpm (1 WTF/minute) Feb 15 18:04:24 it's always too much work Feb 15 18:04:25 I was trying to develop, but it was my first GAE app, I gave up :( I couldn't get a handle on it Feb 15 18:04:33 MikeWallaceDev: you're saying to me that "NavUtils.navigateUpFromSameTask(this);" is the same to start activity for result and then finnish? Feb 15 18:04:42 what threw you off, may I ask? Feb 15 18:04:55 TacticalJoke, :D Feb 15 18:06:17 Siamaster, there was too much info, and too conflicting. The platform was in transition and I was getting conflicting information from the tutorials. It was too big of a chunk to learn in one shot Feb 15 18:07:12 abara, no, I said that you should look into startActivityForResult. If you need a result (bundle) from the activity that you are calling, that's how you do it Feb 15 18:07:23 I agree, google is not very good at making easy and comprehensive tutorials. Feb 15 18:07:23 appengine hasn't been I'm any sort of transition in years... Feb 15 18:07:39 in Feb 15 18:07:55 MikeWallaceDev: No. It's not it. Feb 15 18:07:59 even android tutorials are sometimes incomplete Feb 15 18:08:19 pfn, the libraries, IDE support, Endpoints and all were changing Feb 15 18:08:31 I remember years ago learning GWT.. I'm hoping GAE won't be as disappointing Feb 15 18:08:43 Siamaster: sometimes? i think it's always incomplete Feb 15 18:09:03 Hey! Can anyone suggest an easy way to have a img_button on a fragment open a navigation drawer on a specific menu item at all ? Feb 15 18:09:29 abara, ok. Feb 15 18:10:23 Im fairly new to android dev ! Feb 15 18:13:55 Anyone ??? Feb 15 18:15:31 What have you tried Rubuntu Feb 15 18:15:32 ? Feb 15 18:16:01 I normally code in C# so Ive only tried online Guides Feb 15 18:16:16 android:id="@+id/content_frame" Feb 15 18:16:17 android:layout_width="match_parent" Feb 15 18:16:17 android:layout_height="match_parent" > Feb 15 18:16:17 Feb 15 18:16:17 From the Fragment's onCreateView() you can include a button somewhere that has OnClickListener where in you put this code, Feb 15 18:16:18 final DrawerLayout drawer = (DrawerLayout) getActivity().findViewById(R.id.drawer_layout); Feb 15 18:16:18 btn.setOnClickListener(new View.OnClickListener() { Feb 15 18:16:19 @Override Feb 15 18:16:19 public void onClick(View v) { Feb 15 18:16:20 drawer.openDrawer(Your View, Usually a ListView); Feb 15 18:16:21 } Feb 15 18:16:21 return false; Feb 15 18:16:22 }); Feb 15 18:16:37 so try, then comeback with a specific question. And don't paste code, pastebin Feb 15 18:16:58 Ive tried and cant get it to work Feb 15 18:17:30 what was Gina Trapani's note taking app called? I bet it has the right kind of share intents Feb 15 18:17:48 Todo.txt Feb 15 18:17:50 found it Feb 15 18:19:06 I'm not sure how to promt the navigation bar to open from a button in the fragment, im a bit confused ! Feb 15 18:19:33 Rubuntu: you mean accessing an actionview? Feb 15 18:19:43 i.e. opening up a search box? Feb 15 18:20:07 no a navigation bar that pops open from the side Feb 15 18:20:07 MikeWallaceDev, maybe the integration crap itself, appengine has been quite stable for the last 4 years I've used it Feb 15 18:20:18 in terms of api Feb 15 18:20:40 right right. Exactly Feb 15 18:20:55 Rubuntu: oh you mean like a menu drawer? Feb 15 18:21:41 Google App Engine has been very stable for us last few years Feb 15 18:21:50 I was reading a book on GAE (which didn't have endpoints, pure GAE), tutorials on Endpoints (regardless of IDE), Eclipse integration Feb 15 18:21:56 we used it for 1mil+ reqs/minute service Feb 15 18:22:04 and while it did have it's quirks Feb 15 18:22:12 it was significantly cheaper than alternatives at that scale Feb 15 18:22:24 It's still something that I want to learn. Feb 15 18:24:21 Ankhwatcher Yea a menu drawer. I downloaded some code samples i tried and it works but now i want open it from a onclick from a button Feb 15 18:25:49 Rubuntu: so "android programatically open menu drawer" Feb 15 18:27:38 basically, but button "a" open menu drawer on menu_item "a" Feb 15 18:30:44 I used this guide http://pastebin.com/GtVXfsaL# Feb 15 18:33:31 You don't have to pastebin URLs. Feb 15 18:33:33 Single URLs. Feb 15 18:33:44 haha ok Feb 15 18:34:16 im new to this IRC, MikeWallaceDec seemed Cheesed for not using pastebin ! Feb 15 18:34:34 y Feb 15 18:34:56 Is there a "lifecycle" call after onResume? I'm trying to move a View, relative to its position, but View::onLayout is only called after onResume is finished. Feb 15 18:35:01 Only because of the number of lines. Feb 15 18:35:08 Rubuntu, because you posted a file :P Feb 15 18:35:39 Ok cool, i understand now Feb 15 18:35:45 sorry Feb 15 18:35:56 no worries Feb 15 18:36:01 MikeWallaceDev, there's viewtreeobserver with onGlobalLayout listener. Feb 15 18:36:09 which gets triggered after layout is done. Feb 15 18:37:34 You know what, forget that question, it's no good. I'm trying to make my library simple, and if the user has to use a special function just to hid a window, I've failed. Thanks anyway Mavrik Feb 15 18:37:54 well, for next time when you'll need calculated view sizes ;) Feb 15 18:37:59 :D Feb 15 18:44:04 if (m_doDelayedHide) {hide();} :( blech. Feb 15 18:45:02 Dat naming convention. Feb 15 18:45:22 hell yes. Feb 15 18:46:30 It's the Windows convention, not far from Android's (mDoDelayedHide) Feb 15 18:46:58 >be snapchat >get purchased for 1bil. $ >people cant watch videos on every 2nd phone Feb 15 18:47:05 Win32 would be something like m_bDoDelayedHide, wouldn't it? Feb 15 18:47:24 that's hungarian Feb 15 18:47:26 TacticalJoke: Probably yes Feb 15 18:47:50 I used to have m_pszName. Ugh. Feb 15 18:47:52 hate* Feb 15 18:48:15 why? Feb 15 18:48:17 HN is not too bad when used correctly Feb 15 18:48:27 It just adds clutter, MikeWallaceDev. Feb 15 18:48:39 It adds clarity imo Feb 15 18:49:22 I don't even have to see your declaration but know that it's a pointer to a null terminated string, and know how to work with it... Feb 15 18:49:33 and it's a class member Feb 15 18:49:34 For people interested in learning about the correct way to do Hungarian Notation: http://www.joelonsoftware.com/articles/Wrong.html Feb 15 18:50:05 As for "clutter", it's a matter of habit, really. Spend a few months reading and writing code like this and it will look like the most natural thing in the world Feb 15 18:51:14 Even if you're used to it, "name" is easier to read than "m_pszName". Feb 15 18:51:21 well, I find the whole "m" thing redundand Feb 15 18:51:33 harder to read, and field members are differend color anyway Feb 15 18:51:41 Yeah, IDEs can highlight that stuff -- and methods should be short enough that it's obvious anyway. Feb 15 18:51:55 (Outside of super-high-performance situations.) Feb 15 18:51:56 Mavrik: It's not redundant, it avoids accidentally shadowing local variables and it makes it clear that your method is doing side effects Feb 15 18:52:13 exactly. Feb 15 18:52:18 huh Feb 15 18:52:19 m_ is safer. Feb 15 18:52:27 and I like safer :) Feb 15 18:52:53 nah, the m notation is stupid Feb 15 18:52:55 *shrug* I prefer my code readable. Feb 15 18:53:05 m_someVariableDoNotTouchThisUnlessYourInTheRightMethodIReallyMeanIt Feb 15 18:53:13 I can read m_ fine Feb 15 18:53:22 I’m mostly the reason why Android uses the mFoo notation, it’s an interesting story I should tell one day Feb 15 18:53:28 it's funny how people make the case for using ide, and then make arguments counter to them Feb 15 18:53:41 cbeust, tell now, and how have you been Feb 15 18:54:05 cbeust, would love to hear/read that story or reasoning :) Feb 15 18:54:11 Alright Feb 15 18:54:22 m_thisVariableIsAStringCalledNameCreatedByTacticalJoke Feb 15 18:54:24 It was a dark and stormy night Feb 15 18:54:24 * JesusFreke gathers around the campfire Feb 15 18:54:27 cbeust, you've been mia so long Feb 15 18:54:39 I and another engineer were in charge of writing the style guide for Android, initially we mostly copied the Java one (no special syntax for fields) Feb 15 18:54:53 Standard this.foo = foo stuff Feb 15 18:55:02 We have a huge pushback from the team, they wanted a syntactic convention Feb 15 18:55:26 (personally, I wanted one too) Feb 15 18:55:43 I liked the Windows convention but _ is not very standard in Java so I came up with mFoo Feb 15 18:55:59 Hmm, should strings in the strings.xml be surrounded by "" 's? Feb 15 18:56:10 no Feb 15 18:56:10 The team was okay with that, and so it went Feb 15 18:56:18 Moter8, nope Feb 15 18:56:19 I don’t feel as strongly about this today as I used to Feb 15 18:56:35 hmm, AS seems to include them everytime I extract the string Feb 15 18:56:36 cbeust, you felt strongly about wanting the m? Feb 15 18:56:49 cbeust, I imagine ide use was less common at the time Feb 15 18:56:54 pfn: I felt strongly that fields should have a convention that differentiates them from locals and method parameters, yes Feb 15 18:57:04 _ feels so meh Feb 15 18:57:07 considering how unfriendly aosp is to being imported by eclipse Feb 15 18:57:11 more like actionscript Feb 15 18:57:16 pfn: Yes, that was partially the reason but IDE’s are not the only one: I read code in a lot of tools other than IDE's Feb 15 18:57:21 I hate pretty much all underscores. Feb 15 18:57:47 I read code in emacs, sometimes vi, browser a lot (code reviews, etc…), git diff tools, git UI’s Feb 15 18:57:47 TacticalJoke: I like them in my resource_names Feb 15 18:57:53 sure, diff, browsers, etc Feb 15 18:58:02 and emacs has analysis for locals... Feb 15 18:58:04 These tools don’t show you clearly where the fields are and where the locals/parameters are Feb 15 18:58:45 pfn: To quote James Bond, “I never left” :) I’ve been around, just very busy Feb 15 18:58:52 I'd rather know that m_ means a field, than try to remember what color THIS IDE uses for fields. Feb 15 18:59:49 It makes for safer code. Feb 15 19:01:14 I was using the mNotation until switching to Android Studio which didn't suggest it, so I just used the suggested names. Feb 15 19:01:44 I'm a terrible programmer who assumes that the IDE knows more about Android than he does. Feb 15 19:03:40 actually, using doublequotes is more safe than without Feb 15 19:03:45 (in strings.xml) Feb 15 19:04:09 if there is a trailing whitepspace Feb 15 19:04:14 yeah I think you might need the doubleQuotes to preserve trailing spaces in some cases Feb 15 19:07:29 AS is dumb. http://i.imgur.com/f4gYrt5.png Feb 15 19:08:07 Hit the little refresh icon? Feb 15 19:08:09 also: http://i.imgur.com/Rg8Eyc9.png Feb 15 19:08:24 huh that fixed it Feb 15 19:08:32 * Moter8 facepalms Feb 15 19:13:55 hi there Feb 15 19:14:05 carlus: hey Feb 15 19:14:58 I’ve found Android’s layout editor pretty much unusable even for very basic layouts Feb 15 19:15:04 I mean AS’ Feb 15 19:15:33 cbeust: you mean the drag and drop one or the actual layout editor? Feb 15 19:16:29 i have a weird problem. i have a aar lib which contains some gzips inside asset directory. when i link the library to my application and i export the apk, the gz files are no more gz Feb 15 19:16:47 how is that possible? Feb 15 19:16:49 carlus: thats probably done on purpose Feb 15 19:16:59 aw Feb 15 19:17:02 carlus: remember your end apk is zip'd Feb 15 19:17:23 carlus: this means you get better entropy in your apk because they are ungzipped Feb 15 19:17:27 yep, but if i could keep the gz files i would reduce the apk final size Feb 15 19:17:43 carlus: doubtful Feb 15 19:17:48 that's.. strange Feb 15 19:17:59 i'm using an ffmpeg library Feb 15 19:18:15 which contains 3 different ffmpeg binaries, one for armv7a, armv7a-neon and x86 Feb 15 19:18:41 i thought that gzipping them would be a good idea Feb 15 19:19:37 as soon as main method of the library is called, the right ffmpeg binary for the current architecture is copied inside /data/data/domain/files/ffmpeg Feb 15 19:20:05 i'm trying to have a 'grid' of views that the user can interact with by dragging around the view, using onTouchEvent listeners right now for each element of the grid. However, the view that was touched first will grab the rest of the motionEvents. I've overrode the dispatchTouchEvent (here: http://pastebin.com/nz1zhWt4) but I must be misunderstanding this function and there's not much documentation on it... any advice? Feb 15 19:20:13 carlus: im not sure how to respond to that. including ffmpeg itself is probably not a great idea. and then including all 3 abi's in the one apk.. Feb 15 19:20:27 http://computer.howstuffworks.com/file-compression.htm Feb 15 19:21:15 i know it's not a great idea, but given that i have to use that huge library i tried to compress something Feb 15 19:21:16 Napalm: that's the normal way of doing it Feb 15 19:21:16 knobber: explain what your trying to do? have a grid of views that can be rearranged by dragging? Feb 15 19:21:45 JesusFreke: not when you have a large library like ffmpeg Feb 15 19:21:53 how big is it? Feb 15 19:22:03 23 mb lol Feb 15 19:22:06 JesusFreke: you should be using http://tools.android.com/tech-docs/new-build-system/user-guide/apk-splits Feb 15 19:22:34 interesting Feb 15 19:22:37 carlus: ^ link for you too Feb 15 19:23:09 Right, that's the "new" way of doing it Feb 15 19:23:21 JesusFreke: no not really. Feb 15 19:23:39 but yeah, if each is 23.. probably not feasible to include them all Feb 15 19:23:39 and what about the library? Feb 15 19:23:44 JesusFreke: for many years people have been using ant to make seperate apk's for different ABIs Feb 15 19:24:14 carlus: what about what library? Feb 15 19:24:22 Napalm, it's just a grid of buttons (stay in the same position) that you can drag around and 'touch' each button with one drag Feb 15 19:24:27 at least, that's my intention for it Feb 15 19:24:54 I heard that people can quite easily decompile apps; how do/should devs use API keys then? Feb 15 19:24:57 knobber: was that a reply to me? Feb 15 19:25:16 a reply to this: knobber: explain what your trying to do? have a grid of views that can be rearranged by dragging? Feb 15 19:25:42 knobber: and whats the problem? Feb 15 19:25:50 the ABIs are not in my application project Feb 15 19:26:00 they're included in a library i'm using Feb 15 19:26:14 Moter8: normally you use the app's signing key to verify the source along with the api key Feb 15 19:26:45 Moter8: obviously you can obfuscate your API key's with simple XOR or some other encyption Feb 15 19:27:04 Napalm, the first button that i press will recieve all motion events, even if i tell the dispatcher to stop dispatching events to that event (based on this impl. http://pastebin.com/nz1zhWt4) Feb 15 19:27:20 carlus: shouldnt make a difference if your library is included is using gradle or is an AAR Feb 15 19:27:45 Napalm, but even with wireshark one could intercept the api key Feb 15 19:27:57 will it automagically split the apk/abis? Feb 15 19:28:09 hmm, I have to research this stuff Feb 15 19:28:36 Moter8: thats why you use SSL and again use the app's signing key Feb 15 19:28:54 ssl can be intercepted by MITM Feb 15 19:29:01 carlus: yes, thats the point Feb 15 19:29:08 awesome Feb 15 19:29:15 Moter8, if you want to protect your communication, you of course use certificate pinning. Feb 15 19:29:16 Moter8: there's not really anything you can do Feb 15 19:29:18 App's signing key? How would I use that with a 3rd party API? Feb 15 19:29:23 http://www.androidpolice.com/2015/02/15/googles-device-art-generator-adds-android-wear-lineup/ Feb 15 19:29:29 Moter8, and obviously, you prepare for the fact that people can get everything from your app. Feb 15 19:29:44 Moter8: not if your using certificate pinning and even better issuing client certificates or use your apps' signing key as the client certificate Feb 15 19:30:11 Napalm: except you can still instrument the app, or the ssl framework, etc. Feb 15 19:30:18 Moter8: your not going to use your app's signing key with 3rd part API's unless they support it. Feb 15 19:30:37 Moter8: its how GCM and other google API's protect themselves Feb 15 19:31:24 JesusFreke Moter8: at the end of the day, you are giving the client access to the API.. therefore there is no protection. thats why you still have user authentication. Feb 15 19:31:46 example: weather app that uses forecast.io Feb 15 19:31:59 you don't have any user auth on that, there is only 1 api key you can use Feb 15 19:32:04 knobber: you probably want to watch this https://www.youtube.com/watch?v=EZAoJU-nUyI Feb 15 19:32:27 people could just maliciously intercept the key, make X thousand calls and generate you a loss? Feb 15 19:32:27 Moter8: there's nothing you can do, other than try to obfuscate it in the apk, if you want. Feb 15 19:32:31 i was hoping there was answer a bit more succint than 1h20m heh Feb 15 19:32:33 but thanks Feb 15 19:32:36 knobber: also, I hope your A) Creating a custom ViewGroup for this or B) using RecyclerView with a custom LayoutManager Feb 15 19:32:39 Napalm: i have now 3 apks and all of them contains all the abis Feb 15 19:32:50 nope but i'll look into that Feb 15 19:33:03 JesusFreke, well damn. Feb 15 19:33:20 knobber: since your creating something quite challenging you'll need to know how the Android touch system works. Feb 15 19:33:34 carlus: then you did it wrong Feb 15 19:33:35 lol Feb 15 19:33:39 lol Feb 15 19:33:44 that's for sure Feb 15 19:33:51 Napalm, i guess so, it just didn't seem like it would be a big deal when i set out to do it Feb 15 19:34:50 carlus: https://android.googlesource.com/platform/tools/build/+/master/tests/ndkSanAngeles/build.gradle Feb 15 19:34:57 see how the product flavors are done Feb 15 19:35:39 Hi guys , I have an android device wich the adb drivers don't works with windows 8.1 64 bit , is there any solution to make it work , or is there a way to change it's embedded adb ? Feb 15 19:36:22 hey Napalm Feb 15 19:37:07 p0wonTnx: Have you googled? There are lots of potential solutions. Feb 15 19:37:08 p0wonTnx: you can use the standard adb drivers that come with the SDK Feb 15 19:37:15 g00s: hey Feb 15 19:38:03 still nothing, i believe it's not able to split the abis inside an aar library Feb 15 19:38:08 anyone tried using rust for ndk stuff? Feb 15 19:38:26 TacticalJoke: of course I google for a while before asking here !! Feb 15 19:38:47 Napalm : You mean the Google USB drivers ? It doesn't work with it Feb 15 19:39:25 p0wonTnx: doesnt work how? did you do "update driver" and force choose the correct driver. Feb 15 19:41:25 Napalm : I did "update driver" from the Device Manager but it tells me that the driver is not found , I installed AdbInstaller , it founds the driver but it tell me that it doeasn't work on wondows 8.1 64 Feb 15 19:42:18 p0wonTnx: i have no idea what AdbInstaller is, but you probably want to remove it Feb 15 19:42:59 p0wonTnx: it didnt work because you tried to "auto search" you need to manually choose the usb_driver folder from your extras/google folder in your sdk folder Feb 15 19:47:22 Napalm : how to manually choose please can you more explain ? Feb 15 19:48:55 p0wonTnx: I already told you.. choose "update driver" > select disk > all type > choose /exters/google/usb_driver folder Feb 15 19:49:04 p0wonTnx: follow your nose Feb 15 19:51:00 Hey, I just opened Android Studio today, and I think something happened to aapt, it's segfaulting or something on a build, even when creating a default project... Feb 15 19:51:08 Here's the log before aapt crashes -- http://paste.ubuntu.com/10243685/ Feb 15 19:51:10 in ndkSanAngeles example, there aren't directly the abis but the native source code (c) compiled through ndk Feb 15 19:54:39 Running a debugger and searching the address of the crashing function I've come across this... https://code.google.com/p/android/issues/detail?id=77629 Feb 15 19:54:46 This is really strange though... Feb 15 19:56:17 can anyone point me to a good source of kml records I can play to my avd? Feb 15 19:59:30 Wait, it seems I'm using 21.0.0 -- Strange, I could've sworn I was using 21.1 Feb 15 20:02:55 If I create a new project it uses 21.1.2 automatically. Wonder why that wasn't the case for you. Feb 15 20:07:09 hello, could any1 help me with my semmingly simple listview problem Feb 15 20:07:27 here is code http://pastebin.com/vCRzHyZt Feb 15 20:10:50 Rudziutki: Could you post /res/layous/item.xml? Feb 15 20:10:53 layout* Feb 15 20:10:54 hmm I wonder why AS combines these with a | catch (IOException | JSONException e)? Feb 15 20:11:03 `catch (IOException | JSONException e)` Feb 15 20:11:09 and not ||? Feb 15 20:11:11 It's shorthand, Moter8. Feb 15 20:11:13 Multi-catch. Feb 15 20:11:38 http://docs.oracle.com/javase/7/docs/technotes/guides/language/catch-multiple.html Feb 15 20:11:40 but what does | even do? Is that a valid OR too? Feb 15 20:11:51 multi catch Feb 15 20:12:02 java 7 feature Feb 15 20:12:12 oh, cool Feb 15 20:12:37 I just want to respond to touches from a gesture that hit a view on Action.MOTION_DOWN Feb 15 20:12:39 i've never seen a single pipe used anywhere yet Feb 15 20:12:41 :D Feb 15 20:12:46 only the latest one Feb 15 20:13:30 | is also used for bitwise OR operations. Feb 15 20:13:35 Inclusive ORing. Feb 15 20:13:43 Do listeners get MotionEvents from the entire gesture? Feb 15 20:14:30 knapper_tech, "depends" Feb 15 20:14:31 :) Feb 15 20:14:47 knapper_tech, if you return false on ACTION_DOWN you won't get the rest of the gesture Feb 15 20:14:55 in onTouchEvent of course. Feb 15 20:15:32 Mavrik, trying to return false there. I save an id..hmmm Feb 15 20:15:40 I think I know what's going on Feb 15 20:17:40 if I wanted to have a text file somewhere in my application that I only read from (never write to, sort of like a configuration file of my own format), what's the best place to store this? I was thinking the res folder but I'm not sure Feb 15 20:18:59 knobber, res/raw or assets Feb 15 20:19:04 depends on how you want to read it Feb 15 20:19:06 Mavrik, what if I want to always respond to just the latest touch that hits the view, but not touches that didn't hit the view Feb 15 20:19:13 knobber, also res/xml will let you access it easier Feb 15 20:19:28 knobber, you're not going to get touches that didn't hit the view in a view. Feb 15 20:19:33 er Feb 15 20:19:35 knapper_tech. Feb 15 20:20:09 a bufferedreader or scanner... it's simple csvs pretty much Feb 15 20:20:28 i was wondering more the proper place for things that aren't xml or anything that defines layouts Feb 15 20:20:33 so i guess that'd be assets? Feb 15 20:20:37 What is the purpose of including this text file, knobber? Just curious. Feb 15 20:20:53 knobber: you can use a res/xml file and use the built in parser for it Feb 15 20:21:19 it'll hold a list of values that I read from and create a radiogroup around Feb 15 20:21:33 that i don't want to hardcode Feb 15 20:21:37 Is it basically an array of strings? Feb 15 20:21:57 each element that i'm grouping by would have a string for a title and 10 ints Feb 15 20:22:03 knobber, assets would probably be the best :) Feb 15 20:22:10 just use an xml file Feb 15 20:22:27 simple enough to parse in a loop and get a series of pojo's from Feb 15 20:22:38 alright Feb 15 20:22:41 Is Android Studio reputable for being slow? Not simply just gradle (and not including the emulator), but the base idea - things such as "typing lag" ? Feb 15 20:23:18 ForestBits: Several months before 1.0, it was extremely slow here. Typing lag and everything. Now, it's about the same general speed as Eclipse for me (which is "not too bad"). Feb 15 20:23:26 forest, i run a pretty old laptop (~2.5 or 3yr) and i've never had stutters like that in android studio Feb 15 20:23:50 TacticalJoke, at this moment its practicly empty file Feb 15 20:23:52 I get some typing lag, especially at startup, but not too much. Feb 15 20:23:54 ForestBits how much ram do you have ? Feb 15 20:24:12 Nop, runs well on my laptop. Feb 15 20:24:17 g00s: i see typing lag in AS with 16gb ram on a i7 3740QM. Feb 15 20:24:24 so i doubt ram alone solves it. Feb 15 20:24:30 oh, then i dont feel bad i only have 4G Feb 15 20:24:44 nor does cpu, apparently. :/ Feb 15 20:24:45 Rudziutki: Try replacing "new ArrayAdapter(this, R.layout.item, myRadio)" with "new ArrayAdapter(this, android.R.layout.simple_list_item_1, myRadio)". And also remove that onClick thing. If that works, the problem is your layout file. Feb 15 20:24:57 but my problem is that after several builds, the gradle daemon leaks more and more memory. then i run out of memeory and everything goes to a crawl Feb 15 20:25:05 In fact, I think you can replace "" with "<>" there. Feb 15 20:25:25 g00s, why on earth Feb 15 20:25:32 g00s, would you as developer have only 4G of RAM Feb 15 20:25:36 i still have little good to say about AS. :P Feb 15 20:25:36 Mavrik, getting an index error on MotionEvent.getX(). Feb 15 20:25:42 get yourself proper tools! Feb 15 20:25:47 yeah, someday Feb 15 20:26:06 I need to upgrade from 4GB RAM. Feb 15 20:26:07 by there u mean public void OnItemClick(AdapterView parent, View viewClicked, int pos, long id) Feb 15 20:26:16 Rudziutki: Yes. Feb 15 20:26:19 g00s, like, tomorrow Feb 15 20:26:20 GO! Feb 15 20:26:21 DAMN YOU! Feb 15 20:26:29 g00s: 4GB. Feb 15 20:26:32 Actually, "onItemClick". Feb 15 20:26:33 For your health :) Feb 15 20:26:40 onItemClick(AdapterView parent, View view, int position, long id) Feb 15 20:26:43 the motionevent in onTouchDown returns an pointer with a bad index from getPointerId? Feb 15 20:26:52 Which comes close to entirely used when gradle is building, at least on default VM settings. Feb 15 20:26:56 ForestBits with $G you'll be able to run AS, gradle, and a few browser tabs thats about it Feb 15 20:27:00 *4G Feb 15 20:27:13 and there will be blood Feb 15 20:27:48 That seems to be the case. I just noticed the base IDE can be slow without an active gradle build, so I was wondering. Though it could be doing other background tasks it does not display. Feb 15 20:28:17 I wonder whether turning inspections down or off (via the little guy at the bottom right) helps. Feb 15 20:28:26 ForestBits, make sure you use Oracle JDK if on Linux, make sure you have enough heap size, do check if you installed some strange extensions Feb 15 20:28:35 ForestBits, do invalidate cache and restart :) Feb 15 20:28:36 Another tip is to disable unused plugins (such as Commander). Feb 15 20:28:59 i do that but dont see a difference, i think they are lazy loaded like eclipse Feb 15 20:29:06 TacticalJoke, android studio has no clue what parent and view is Feb 15 20:29:07 althoug they may clutter the UI Feb 15 20:29:13 I disabled Subversion integration, CVS integration (lolwut), and so on. Feb 15 20:29:36 Rudziutki: If it doesn't know what AdapterView and View are, Alt+Enter. Feb 15 20:29:58 no that part he understands Feb 15 20:30:40 public void onItemClick(AdapterView parent, View view, int position, long id) parent and view are unresloved symbols Feb 15 20:30:57 and alt+enter cant help me with that Feb 15 20:31:01 Rudziutki: Can you paste exactly what you're trying? Feb 15 20:31:05 (On pastebin.) Feb 15 20:31:58 https://www.youtube.com/watch?v=eAPFgC9URqc&feature=player_detailpage#t=569 Feb 15 20:32:02 i was trying this code Feb 15 20:32:09 Though I guess it is still better than the emulator. Feb 15 20:32:26 I'm asking what *you're* trying. Feb 15 20:33:04 Which is probably at most 98% similar to what's on that screen. Feb 15 20:33:24 Actually, I bet it'd be way lower than that. Feb 15 20:33:42 http://pastebin.com/vCRzHyZt http://pastebin.com/tDxb32r4 Feb 15 20:33:45 this is all i have Feb 15 20:34:07 "onClick" is wrong, as mentioned. Feb 15 20:34:29 The commented code looks right apart from 'OnItemClick', which should be 'onItemClick'. Feb 15 20:34:45 already corrected that Feb 15 20:37:15 the only real difference between my code an dhis are variable names Feb 15 20:38:31 Hi! Feb 15 20:38:46 I can't help you unless you paste the exact code you're working with and a problem description that's more than "it doesn't work". Feb 15 20:39:03 TacticalJoke: but that doesn't work! ;) Feb 15 20:39:10 Do you think it is possible to write an app to enable auto-mount the SD card to cmoputer when plugging the USB cable ? Feb 15 20:39:12 gimme sec Feb 15 20:39:16 (Here is more info : http://android.stackexchange.com/q/98891/58896) Feb 15 20:39:34 It seems impossible (why??) on Android 2.3.6 Feb 15 20:39:41 ahop: erm. my devices kinda all do that out of the box. Feb 15 20:39:45 Does it seem possible to write an app that would do that Feb 15 20:39:58 lewellyn: I have Andr 2.3.6 Feb 15 20:40:07 not my fault! ;) Feb 15 20:40:16 ;) Feb 15 20:40:25 (i haven't touched a real gingerbread device in so long, i don't know what they can and cannot do) Feb 15 20:40:25 Where should it be in Settings menu? Feb 15 20:42:38 TacticalJoke, https://www.dropbox.com/sh/auel1cgbnl0q5ib/AABfZVs08kDSMj58yDg1Pesia?dl=0 Feb 15 20:43:26 is there any way to force viewpager to instantiating all the fragments without have to switch tab? Feb 15 20:43:29 Just pastebin. Feb 15 20:44:58 Not sure what the studio process does in the background. Leaving it doing nothing (visually), it still has activity spikes from time to time. Feb 15 20:46:48 http://pastebin.com/ffRHMdAt Feb 15 20:47:16 lista.setOnItemClickListener(new AdapterView.OnItemClickListener()){ Feb 15 20:47:18 Syntax error. Feb 15 20:50:17 seems better now Feb 15 20:50:25 What are you guys using for material design buttons/checkboxes etc for pre-21? Feb 15 20:50:42 eg lib Feb 15 20:51:06 It's like only one layout within my layout can get all the touch events at a time... Feb 15 20:51:12 cool, this weeks androidweekly #140 has lots of nice things :) Feb 15 20:51:32 Moter8, there is a lib out there but I'm just using appcompat and to hell with it Feb 15 20:51:47 renderthread is needed not to make it suck up the UI thread Feb 15 20:52:35 lasserix_ there ? Feb 15 20:53:40 knapper_tech, remember the name? Feb 15 20:55:10 Hi all. I have a Nexus 5 device and I would like to know how it would be possible to re-enable MediaRecorder.AudioSource.VOICE_CALL Feb 15 20:55:14 I have set up admob with the new sdk, but any suggestions on how I can make it only take space when ads are shown? This is my code atm: http://pastebin.com/CSG3krVe Feb 15 20:56:13 I can root the phone, or install any other app. This is for demo purposes, I need to hold this in a security course Feb 15 20:56:26 TacticalJoke, thank you Feb 15 20:56:54 Hi guys. In my app I want to save an image (Bitmap data) for the future use. I think to do it in onStop() method and write byte array data to the DB and later re-read it from there in onStart(). Is this solution ok or I should learn android lifecycle better to understand where and when to perform such operations? Feb 15 20:58:43 AlexBerdnikov, 1. onStop is not guaranteed to be called 2.) Storing an image at this part of cycle is TOO SLOW 3.) Storing an image to DB is a terrible idea Feb 15 21:00:00 Mavrik, OK thank you for the answer. So where should I store Bitmap data? And what Activity method fits better for it? Feb 15 21:00:47 Mavrik, my touch handler is definitely getting touches from other views Feb 15 21:01:02 The layout has a specific height and is in a list view. Feb 15 21:01:24 Can frame layouts get touches outside their area? Feb 15 21:01:52 it's as if my touchhandler class is static... Feb 15 21:02:26 AlexBerdnikov, 1.) Store it on the filesystem, preferrably in cache Feb 15 21:03:01 AlexBerdnikov, 2.) Do not rely on UI lifecycle to store your data. Store your bitmap when it stops changing and make sure you're not losing data when your process gets killed or you're not hanging users device by blocking in UI lifecycle. Feb 15 21:03:34 hello. I'm developing on Eclipse with ADT and while profiling, I find that the only type of profiling I get on DDMS is full method tracing and no sample based profiliing. Feb 15 21:03:39 Any idea why? Feb 15 21:03:56 Old Android? Feb 15 21:04:16 On other people's videos, when they click on "start method profiling" they get 2 options where as I don't. Feb 15 21:04:26 Mavrik: You mean SDK? Feb 15 21:04:41 I updated my ADT. Feb 15 21:04:52 Mavrik, so I should you async task for that probably? Feb 15 21:04:52 No, old Android which runs the profiled code. Feb 15 21:05:02 I'm developing on SDK 18. Feb 15 21:05:11 I mean to start saving process Feb 15 21:05:22 AlexBerdnikov, you certanly shouldn't run a process that stores several MB of data on a UI threda Feb 15 21:05:29 Oh you mean the phone I'm using to test? Feb 15 21:05:32 AlexBerdnikov, but I'm not talking about your threading model\ Feb 15 21:05:52 AlexBerdnikov, I am talking about the fact that there's no reason to expect that your code will run at all when your activity goes out Feb 15 21:05:57 http://i.imgur.com/QsNVmMb.png :( Feb 15 21:06:01 since OS will kill it with higher likelyhood. Feb 15 21:06:03 my button looks like banana on <21 Feb 15 21:10:41 Mavrik: from which version of Android is that type of profiling supported? Feb 15 21:18:40 CalendarContract.Instances <-- What do I have to do if I only want instances from a certain calendar id. That is, I've already queried CalendarContract.Calendars and found the _ID of the calendar I want, now I want to query for instances in that specific calendar for the next 2 weeks. Feb 15 21:21:39 I think it's Kitkat and up. Thanks Mavrik ! Feb 15 21:26:24 does handling one touch prevent subsequently touched widgets from seeing touch events until all touches in the gesture are over? Feb 15 21:33:02 i'm trying to read/write a file using internal storage similar to what is in the developers.android.com training page. Feb 15 21:33:09 Any idea why this does not work? Feb 15 21:33:11 http://pastebin.com/pqy141qH Feb 15 21:40:04 do you have a blank file with no content? Feb 15 21:43:36 davis: "this does not work" is not the best description of the problem ;) Feb 15 21:44:10 also: use something else than pastebin Feb 15 21:44:18 ^maybetheincludedgithubgist Feb 15 21:44:18 pastebin is fine Feb 15 21:44:40 JesusFreke, true. I believe it is writing, but it most definitely does not read whati thought I wrote. Feb 15 21:44:58 btw, in android studio, is there a file browser like what was in eclipse? Feb 15 21:45:02 Then what does it read? It's hard to help people who give basically zero info. Feb 15 21:45:32 it reads nothing. Feb 15 21:45:36 JesusFreke, we already talked about this... Feb 15 21:45:43 (maybe not we but in here) Feb 15 21:45:57 Line 40 doesn't make sense. Feb 15 21:46:20 You're reading the bytes and then ignoring them. Feb 15 21:46:30 davis: your buffer has a length of 0 Feb 15 21:46:46 JesusFreke: He sets it to 1024 later. Feb 15 21:47:01 TacticalJoke: oh, missed that :) Feb 15 21:47:17 I think what's happening is that the code at line 44 is returning -1, because we've already read the (small) data. Feb 15 21:47:23 And the string is never updated. Feb 15 21:47:25 TacticalJoke, Yes, that looks like a mistake. Let me remove that. It was a previous try. Feb 15 21:47:29 ah, yeah Feb 15 21:47:59 davis: If you're just reading lines, it'd be easier to use BufferedReader. Feb 15 21:48:49 ok let me try BufferedReader. FWIW, when i removed line 40 it now reads a bunch of content. Feb 15 21:49:04 Then you can do something like this: for (String line = reader.readLine(); line != null; line = reader.readLine()) { doStuff(line); } Feb 15 21:49:42 Odd, i tried some different code before with that line 40 and it was giving me something like Java@85308 instead of the path to the file I was writing. Feb 15 21:50:52 davis: On a side note, stuff like this is bad: Integer iLen = 0; [...] iLen = 1024; Feb 15 21:51:25 It should be 'int', and it harms readability to do two assignments when one is called for. Feb 15 21:51:52 In fact, the variable isn't even needed: "byte[] bufferIn = new byte[1024];" is clearer. Feb 15 21:51:59 TacticalJoke, true. i was ging to calculate the buffer on what I wrote, but I wasn't sure it was working so just maxed the size. Feb 15 21:52:12 i'll make that change, that sounds better. Feb 15 22:03:47 Before I start on a second approach, here is the working code http://pastebin.com/QBsyy1HR Feb 15 22:09:11 I have question regarding ndk Feb 15 22:09:22 I was trying to compile tesseract Feb 15 22:09:35 but Im getting error undefined reference to '__sfp' Feb 15 22:15:40 so checking out any gapps flashable zip, you see a script that yanks libs out of the apks and puts them in the right place. does this process normally happen when you install an app properly? Feb 15 22:31:39 hello Feb 15 22:32:08 is it possible to change the default call app? Feb 15 22:32:37 i want to edit the displaying of call entries Feb 15 22:36:30 probwith custom launcher Feb 15 22:36:39 or with root Feb 15 22:37:53 lasserix_: i mean to write an app on myself in android studio Feb 15 22:38:05 or some plugin Feb 15 22:38:45 lasserix_ :D Feb 15 22:39:48 i want to be able to modify the appearance of the lost calls, like in red or something Feb 15 22:40:02 but in the main/default call app Feb 15 22:40:49 mihai_c_: oh i guess userscan change the intent for it now Feb 15 22:41:12 you can make a call app and the uer can set it to be the primary target for call intents Feb 15 22:42:25 i don't want to go on the second sugestion Feb 15 22:42:42 i don't understand the first sugestion Feb 15 22:42:57 lasserix_: what is userscan? Feb 15 22:43:42 users can Feb 15 22:44:15 so basically there is no way to change the main app Feb 15 22:44:38 Hi, need some advice - have a rooted android set-top box that I'm trying to connect to an ELO touchscreen. I can see events coming through from the rouchscreen but Android doesn't interpret them correctly (ignores them). So I'm thinking of adding functionality to an app to inject the touch events into the app. Can an android app accept the output from "getevent", then push it to "sendevent"? Feb 15 22:45:28 mihai_c_: i just said it can be changed if the user changes it Feb 15 22:45:31 so just ask the user to change it Feb 15 22:45:41 and make your activity listen for the proper intent filters Feb 15 22:45:57 *listen for the proper intents by setting the proper intent filters Feb 15 22:46:56 i don't know the intimate parts of android Feb 15 22:47:41 well you should probably buy some red wine, some chocolate... Feb 15 22:47:41 i dp an app in android studio and install it? Or i have to program some other kind like a dll in windows? Feb 15 22:47:49 :) Feb 15 22:47:56 dp=do Feb 15 22:48:14 i have done several apps so i know the basics Feb 15 22:48:20 you can use android studio to develop and compile an apk Feb 15 22:48:32 i know that Feb 15 22:49:35 but how do i change how the default call app get the data from my activity? Feb 15 22:50:09 or i missunderstood again? Feb 15 22:50:21 as i said i don't want to do another call app Feb 15 22:50:46 only some part of it responsible for log calls displaying Feb 15 22:52:23 no you cannot moiify the main call app Feb 15 22:52:36 unless you make your own rom or launcher Feb 15 22:52:46 otherwise you can make your own, and the user can set it to be their main call app Feb 15 22:54:15 If DiffMerge could stop begging me to register almost every time I open it, that'd be cool. It ain't gonna happen. Feb 15 22:55:27 same for me and Sublime... Feb 15 22:55:45 $70 is just a little too much for me for a text editor :( Feb 15 22:56:16 The thing is that DiffMerge is free of charge. New versions have started asking for registration. (Why would I want to?) Feb 15 22:57:01 oh Feb 15 22:57:31 to support a great product!?! Feb 15 22:57:50 I don't see how registering supports them. I guess they'd start spamming me or something. Feb 15 22:58:48 MikeWallaceDev: Can you use Sublime indefinitely without paying? Feb 15 22:59:00 yeah Feb 15 22:59:04 Kinda like mIRC. :D Feb 15 22:59:13 but the popup came up every time I saved... Feb 15 22:59:19 Though mIRC runs out at some point (whereupon you have to open regedit.exe and do stuff). Feb 15 22:59:21 A little too often Feb 15 23:01:11 TacticalJoke: https://github.com/android10/Android-CleanArchitecture/blob/master/presentation/src/main/java/com/fernandocejas/android10/sample/presentation/UIThread.java Feb 15 23:01:11 Anyone used this library before? I'm thinking it'd be nice so that I can use Material Design widgets in lower API levels: https://github.com/navasmdc/MaterialDesignLibrary Feb 15 23:01:27 I tried Atom, that was really nice, just took too long to load Feb 15 23:03:34 lasserix_: What about it? Feb 15 23:03:39 Seems like a nice-looking pattern. Feb 15 23:05:22 just remember you had some handler singleton Feb 15 23:05:25 I kinda hate how AppCompat stuff comes directly into my project. Annoying for searching and stuff. Feb 15 23:05:28 this does similar but is pretty clean Feb 15 23:05:38 Yeah, I have this Global class with a public static Handler. Feb 15 23:05:41 Globals* Feb 15 23:06:10 I would like to inject the Handler more, though, to keep classes testable. Feb 15 23:06:29 But the question becomes "Who should be the injector and who should be the injectee?". Feb 15 23:07:01 dependency always goes away from total abstract Feb 15 23:08:44 or inject towards the abstract Feb 15 23:10:03 or am i thinking of dependency inversion? Feb 15 23:18:45 hey guys Feb 15 23:19:32 TacticalJoke seriously? A Globals class? -10 points :) Feb 15 23:19:47 of all people, you are the last one i expected with a globals class XD Feb 15 23:20:01 *expected least Feb 15 23:20:21 i forgot someone told me recently about the status bar the upper one where the wifi, bluetooth and the notifications are. What was the name of the animation used while dragging it from top to bottom. Feb 15 23:20:37 How i can do also something like that? Feb 15 23:38:07 Hi, have anyone some time to help me with valid ViewPager configuration? I have configured it, but it works.. weird (works OK at first screen, works bad on others) Feb 15 23:57:59 is there a simple way to resume to the last active Activitivy after pressing home-button and restarting app from home-screen? Feb 16 00:02:32 adkins: probably not because you have to know what state is necessary to get to that activity. You can implement it yourself pretty easily though Feb 16 00:03:14 Just make sure whenever you enter an activity to log it somewhere, and then upon application create, make sure to pick up from there Feb 16 00:03:37 why would you not want to just rely on the default lifecycle of an app? Feb 16 00:03:54 hi, I would like to download a file for json parsing. Can I use the standard Java URL / URI classes or should I be using an Android specific class or helper class? Feb 16 00:04:11 phix, retrofit Feb 16 00:04:38 ah, it is a RESTful API?? Feb 16 00:04:56 It's a RESTful client Feb 16 00:05:03 yiati: i dont know.....i just look at other apps and after leaving them throught pressing home button and restarting, i come back to where i was, so i assume i should do that too ;) Feb 16 00:05:14 nie Feb 16 00:05:16 nice* Feb 16 00:05:41 adkins, that will happen by default as long as there is enough memory, and you make sure to save you data in a bundle Feb 16 00:06:12 yiati: I am using ADT (Eclipse) as my IDE. Does that have support for Android projects using maven or gradle? or am I stuck with ant? Feb 16 00:06:41 phix: yes you will be stuck with ant + the eclipse build system Feb 16 00:06:56 phix: Android Studio has all of the nice support + features Feb 16 00:06:58 yiati: hmmmm, any other IDEs that support maven or gradle?? Feb 16 00:07:04 (with Android) Feb 16 00:07:17 phix: http://developer.android.com/sdk/index.html Feb 16 00:07:25 Cheers Feb 16 00:07:27 ^ That's their new official IDE Feb 16 00:07:47 You like it? Feb 16 00:07:52 yiati: should i save in onSaveInstanceState of Activity A (MainActivity) that Activity B was started and in onRestoreInstanceState start Activity B again if it was started before? Feb 16 00:08:01 Or are you an IDEAs man?? Feb 16 00:08:24 phix: it's great. Obviously takes a bit of time to get used to like any IDE but it's far better than Eclipse in my opinion Feb 16 00:08:37 I started with Eclipse and it was a pain Feb 16 00:08:46 ok nice, I will give it a shot, hmmm they don't seem to have a Ubuntu package for it, oh well Feb 16 00:08:51 phix: Plus the gradle support for Android Studio is awesome Feb 16 00:09:14 Hmmmm I haven't actually used graven before, do I need to learn Groovy? Feb 16 00:09:20 I mostly use maven Feb 16 00:09:32 (or in some projects, sbt :S) Feb 16 00:09:50 adkins: If you leave the app in Activity X and come back, it will already be there by default Feb 16 00:10:11 phix: You can do Maven in Android Studio as well Feb 16 00:10:19 yiati: what could i have done wrong if it doesnt happen? Feb 16 00:10:37 yiati: Can I also convert an Eclipse project to Android Studio? Feb 16 00:11:01 phix: You don't need to learn groovy too much to use the gradle plugin. This http://tools.android.com/tech-docs/new-build-system/user-guide is the only reference you should need for the most part Feb 16 00:11:16 phix: Yep Feb 16 00:11:43 adkins: What are you doing, and what do you expect it to do? Feb 16 00:11:50 yiati: Is gradle worth it? Or would I be better off with Maven Feb 16 00:12:53 phix: IMHO it's worth it and Google is supporting it very nicely. Maven can work though Feb 16 00:13:04 yiati: lets simplify it to that: Activity A(MainActivity) starts Activity B, Pressing Home, Launching App again => Activity A is visible and not B. What could i have done wrong? Feb 16 00:13:14 yiati: and Gradle uses Maven central? Feb 16 00:13:28 phix: Yep Feb 16 00:14:03 yiati: I appreciate your assistance, I think I have used my quota for the hour :P Feb 16 00:15:35 adkins: Do you have "Don't keep activities" toggled on in the developer options, and/or do you have enough memory on the device for the app to stay in the background? Feb 16 00:15:36 I'm writing a Model class that uses a Date variable and I need the class to be parcelable... how can I read in a Date? Feb 16 00:16:32 nvm, I think I found an answer... not sure if it's efficient though. Feb 16 00:18:18 yiati: that developer option is unchecked and my app is definetly resuming, so i guess i got enough space. Maybe something in the manifest prevents it? Feb 16 00:19:45 This is what I'm doing: this.start = new Date(in.readLong()); Feb 16 00:20:57 yiati: does android:launchMode="singleTask" prevent it? Feb 16 00:22:50 adkins: yes Feb 16 00:25:39 g00s: Haha. Feb 16 00:25:58 Yeah, a Globals class for a small number of items that need to avoid the Activity madness. Feb 16 00:26:40 I just prefer it to the typical singleton pattern. Feb 16 00:27:21 yiati: thx Feb 16 00:27:35 http://pastebin.com/E7BZxARm Feb 16 00:27:55 i got a c++ version to work as a console app. Feb 16 00:34:16 hey guys, why does Preferences need a key? Feb 16 00:35:05 It contains a bunch of key-value entries. Feb 16 00:35:10 leopard, hashing Feb 16 00:35:43 but yeah key-value Feb 16 00:35:50 yiati: why does it need to hash? Is it every going to save the preference locally> Feb 16 00:35:54 You can ask for something if you don't assign a name to it Feb 16 00:36:00 the name is the key Feb 16 00:36:04 It saves them in an XML file. Feb 16 00:36:29 TacticalJoke: so is using a SharedPreference redundant? Feb 16 00:36:33 leopard: sorry I was joking about hashing I don't know what it does with the key Feb 16 00:36:56 What do you mean by 'redundant'? Feb 16 00:36:59 leopard: How would you do it? Feb 16 00:37:21 if you architected Preferences? Feb 16 00:37:26 yiati: oh i see it's the preferences equivalent of layout's @id Feb 16 00:37:30 yep Feb 16 00:37:47 yiati: & TacticalJoke thanks :) Feb 16 00:38:21 You could create your own preferences-file thing, but it'd take a little time and effort. Feb 16 00:39:55 Especially because (I think) SharedPreferences goes to the trouble of ensuring that stuff really is written if your app is in the background and Android is looking to kill the process. Feb 16 00:41:30 Does look like it's hashed, private final Map mModified = Maps.newHashMap(); Feb 16 01:08:31 Hello! Feb 16 01:11:21 Can someone explain to me why this http://pastebin.com/uFTvpejS is giving me the following error "replace (int, android.support.v4.Fragment) in FragmentTransaction cannot be applied to com....SettingsFragment" Feb 16 01:19:18 leopard: because the SettingsFragment extends the platform Fragment not the support Fragment class Feb 16 01:19:55 Napalm: yeah i just found that out. Trying to integrate this into my gradle now https://github.com/kolavar/android-support-v4-preferencefragment Feb 16 01:57:30 phix, ahem, if you like sbt, using it for android is pleasant Feb 16 01:57:51 I don't like sbt Feb 16 01:57:56 lol Feb 16 01:58:11 I have to for work Feb 16 02:00:53 phix, that's too bad Feb 16 02:04:07 Tell me about it Feb 16 02:05:09 about not liking it Feb 16 02:05:18 because it's awesome Feb 16 02:05:29 oh Feb 16 02:11:22 If someone side-loads an app and then the app gets updated, if they side-load the app again will it update the app without issue? Feb 16 02:11:26 I'm guessing so; just checking. Feb 16 02:11:48 you mean if google play updates it? Feb 16 02:11:59 Nah, without Google Play being involved at all. Feb 16 02:13:17 should work if it's all sideloaded Feb 16 02:13:38 I've only had issues when the app store updates it then you try to downgrade Feb 16 02:14:26 does anyone know how to get a reference to the ImageButton navigation icon in Toolbar? Feb 16 02:16:23 Okay. Just planning contingencies in case Google does something crazy such as requiring all developers to give physical addresses someday. Feb 16 02:16:45 (Though I already think it's crazy that paid developers have to publish this info.) Feb 16 02:16:58 Levite: Isn't it just the icon you tell it to display> Feb 16 02:16:59 ?* Feb 16 02:17:14 Yeah but I want to always have the icon displayed but change it's alpha depending on state Feb 16 02:17:22 and disable clicks as well Feb 16 02:18:03 I'll probably just use my own image button Feb 16 02:59:19 Hi Guys, how can i get an Picture at the top that hides when i scroll down, like Google Now **** ENDING LOGGING AT Mon Feb 16 02:59:58 2015