**** BEGIN LOGGING AT Tue Jul 29 03:00:00 2014 Jul 29 03:07:25 Whats the name of the view that slides in from the left on apps Jul 29 03:08:44 Navigation Drawer Jul 29 03:08:52 Cheers Jul 29 03:08:55 can someone please point me to some tutorial or literature how to make frame layout and on top of it relative layout (transparent) with couple of buttons and some edittext? Jul 29 03:21:37 would it be bad to give each tab on my mainactivity its own backstack? Jul 29 03:37:33 theblang probably Jul 29 03:38:28 g00s what about having different branches of navigation that let's you navigate back with the home button arrow? Jul 29 03:38:57 i dont follow Jul 29 03:39:28 yeah, ok - thats basic. sure Jul 29 03:39:53 i have three action bar tabs, each with their own fragments. those fragments can load in more fragments, for example one of them is a list that can load in a detail. i would like the user to be able to navigate back after delving into a particular tab. does that make sense Jul 29 03:42:44 any good apps that use tabs that you can think of? Jul 29 03:43:03 theblang there is a devbytes on navgiation patterns; you may like it Jul 29 03:43:14 *navigation patterns Jul 29 03:45:30 g00s im having trouble thinking of an app that uses tabs, lol Jul 29 03:45:48 alarm clock :) Jul 29 03:46:07 g00s lol. touche Jul 29 04:02:01 Leeds around? have any opinion on light weight *buntu for my mom :) Jul 29 04:02:15 typically i'd use xubuntu - not sure whats the greatest these days Jul 29 04:02:39 g00s: I've used xubuntu on my 7 year-old dell laptop, I can easily recommend it Jul 29 04:02:58 barbs cool, thanks :) Jul 29 04:02:59 not sure how old your computer is. if it's a bit older, you might want to look at lubuntu Jul 29 04:03:49 its 2009 timeframe, 2G memory. Windows 7 isn't running well Jul 29 04:04:00 some dell with a bunch of crapware installed Jul 29 04:04:08 can't find Win 7 disk Jul 29 04:04:27 yeah, with 2G ram I'd definitely suggest Xubuntu Jul 29 04:05:03 you can easily make it look more like windows if that's what your mum's uesd to. I'd suggest the Albatross window theme :) Jul 29 04:07:04 i think she just surfs and plays Spider (card game) Jul 29 04:08:33 awesome :). xubuntu doesn't try to be fancy, it just does its thing and gets out of your way Jul 29 04:09:00 she could probably just get a chrome book or iPad but ... gotta recycle :) Jul 29 04:09:13 I don't use *buntu :) Jul 29 04:09:15 by "gets out of your way" it means "do everything the way it wants you to and you won't have a problem" Jul 29 04:09:28 bankai_au: nope. Jul 29 04:09:35 barbs is xubuntu an official *buntu distro ? Jul 29 04:09:39 but if I did, xubuntuntnuuntntu would probably be my choice Jul 29 04:10:17 g00s: I think it was at some stage, but not anymore? Not really sure. It's updated just as often as ubuntu though Jul 29 04:10:41 i wonder whats the difference between xubuntu, and just getting a ubuntu cli and saying apt-get xfce or something Jul 29 04:11:11 g00s: not a whole lot. I think some of the default applications are different as well Jul 29 04:11:23 I'm not totally sure you can get an ubuntu cli? Jul 29 04:11:28 g00s: Ubuntu, Kubuntu, Xubuntu and Lubuntu are the offial derivatives Jul 29 04:11:32 been a while since I've looked at it Jul 29 04:11:57 barbs i wonder if ubuntu server :) = cli XD Jul 29 04:12:06 genii thanks Jul 29 04:12:07 yeah, might be :) Jul 29 04:12:14 of course not Jul 29 04:12:16 g00s: Thay all use the same backend repositories with different desktops Jul 29 04:12:40 servers have to have GUIs nowadays - or what would the poor "read a book, now I'm a pro" admins use? Jul 29 04:12:59 Leeds: SSH Jul 29 04:13:05 so yeah, install ubuntu server, get to command line and the apt-get xfce :) Jul 29 04:13:08 no, I will not be quiet Jul 29 04:13:22 :P Jul 29 04:13:27 lol Jul 29 04:13:30 Leeds: Heh Jul 29 04:13:44 seriously though, a lot of 'admins' nowadays would be lost without their cpanel, or similar Jul 29 04:14:10 g00s: The usual is ubuntu-desktop kubuntu-desktop xubuntu desktop lubuntu-desktop etc Jul 29 04:14:32 genii ah, its tsrating to come back . i used ubuntu last maybe 2009 Jul 29 04:15:47 Leeds: You have no idea how often there are questions in #ubuntu-server relating to whatever desktop they installed Jul 29 04:15:51 I like my slackware Jul 29 04:16:01 Slack ain't bad Jul 29 04:16:16 I haven't installed any *buntus that way, but I'd recommend just installing Xubuntu the normal way. the defaults apps are pretty lightweight, and very easy to uninstall if you don't want them there Jul 29 04:17:15 in my app, I use a single activity/webview to handle a few different bits of content. Each different site the wv loads will have an icon in the top left corner (overlaying the webview). I need this icon to change depending on what site was clicked. I'm sending an intent with a char to the wv activity and using that char in a switch statement to setImageDrawable(). Then, for good measure, I... Jul 29 04:17:17 ...even tried adding the view to the layout but im not having any luck. Jul 29 04:17:27 genii of course, once yo uinstall chrome everything goes to shit Jul 29 04:17:38 trying to save all that memory .. . and then *poof* gone Jul 29 04:18:37 g00s: Why would you install a graphical browser on Ubuntu Server instead of something like links3 ? Jul 29 04:18:45 links2 rather Jul 29 04:19:01 what's the difference between links2 and elinks? which is newer? Jul 29 04:19:26 I upgraded chrome on my desktop yesterday... I'm not saying I typically have a lot of tabs open, but I had to increase the maximum number of open files on the system or it would crash while launching :) Jul 29 04:19:29 genii oh, i was just pondering alternative routes to get to xfce desktop from plain ubuntu Jul 29 04:19:39 also, I still use lynx Jul 29 04:19:55 genii i'll just use xubuntu Jul 29 04:20:13 how is the linux wifi story these days :| Jul 29 04:20:44 there was a thing on HN the other day saying it was kinda crappy Jul 29 04:20:56 g00s: Basically, avoid Broadcom Jul 29 04:20:57 I personally haven't had many issues with it... Jul 29 04:21:18 hm, its an old dell. i guess i should try a live desktop Jul 29 04:21:25 see if it even starts up Jul 29 04:43:47 say i stop a translation animation partway through it, is there any way to get the last alpha animation value in the animation? Jul 29 04:44:19 i want to fade out a view, but be able to seamlessly fade it back in partway through the animation without any jumpiness in the alpha Jul 29 05:02:33 What is a reason AS wouldn't pickup the butterknife annotation processor? I have annotation processing enabled and the dependency is in the build.gradle.. Jul 29 05:02:43 pick up how? Jul 29 05:02:51 AS doesn't have a build system Jul 29 05:03:02 javac would see the annotation processor so long as you have the compile dependency Jul 29 05:03:10 thats what i meant Jul 29 05:03:27 I have "compile 'com.jakewharton:butterknife:5.1.1'" in my build.gradle Jul 29 05:03:39 AP enabled in as. However, butterknife isn't injecting Jul 29 05:04:09 turn on logging Jul 29 05:04:19 ok Jul 29 05:04:24 i forget how Jul 29 05:04:29 for butterknife? Jul 29 05:04:30 ButterKnife.setDebugging(true);, maybe Jul 29 05:04:33 yeah Jul 29 05:04:33 oh Jul 29 05:04:48 if im starting a new activity with >1 extra, do i need to bundle? Jul 29 05:05:03 (in the intent) Jul 29 05:05:06 Intent will bundle for you Jul 29 05:05:18 curious... doesnt seem to be passing properly Jul 29 05:05:33 always received as 0 (int) Jul 29 05:06:24 Ok, JakeWharton, here is what I get: "MISS: Reached framework class. Abandoning search." after looking up the viewinjector Jul 29 05:06:40 look in build/ Jul 29 05:06:51 there should be Foo$$ViewInjector.java classes Jul 29 05:06:54 where Foo is your class Jul 29 05:07:02 ok Jul 29 05:07:19 it'll be under generated-sources/ somewhere Jul 29 05:09:08 oh god not this Jul 29 05:09:20 I dont even have generated sources Jul 29 05:12:09 welp./ Jul 29 05:14:30 Do I have to register a content provider to use within my app? Jul 29 05:14:36 Or do I register for other apps to have access to it? Jul 29 05:29:43 hmm Jul 29 05:30:20 i wonder if the crashlytics plugin is messing things up Jul 29 05:30:28 i had to downgrade to java 7 for the as plugin to work Jul 29 05:40:49 o shipit, where art thou Jul 29 05:41:14 he's shipping Jul 29 05:43:41 at least you're here Jul 29 05:43:47 not sure if you're the original g00s Jul 29 05:44:45 bankai_au http://www.marco.org/2014/07/28/app-rot Jul 29 05:45:00 i doubt its different for android Jul 29 05:52:13 "The amount of effort you put into an app has very little to do with how much of the market will buy it." Jul 29 05:52:16 this Jul 29 05:53:08 that is true Jul 29 05:53:12 i mean, instagram Jul 29 05:54:16 interesting advice, to avoid custom widgets, use stock stuff, essentially - leverage the platform Jul 29 05:55:33 so the other day, we saw that article where more android devs were below the app poverty line than ios devs - i still think its (1) demographics (2) the platform is more PITA. kinda double whammy Jul 29 05:55:45 I've said for a long time that the way to make money from app development is to get someone to pay you to do it Jul 29 05:56:28 Leeds yeah - but even there, as the article mentions, lots of those mobile dev shops are fading away. i read this a few weeks ago - maybe its only in the US Jul 29 05:56:40 the race to the bottom on pricing hurts a lot... Jul 29 05:57:49 but the biggest thing is probably homogeneity - everyone has Facebook, Whatsapp, instagram, Candy Crush, etc. almost as part of their base install - and the difficulty for everyone else to market, be discovered Jul 29 06:00:36 my mum, my dad, both my sisters - all have iphones, all have ipads (I think - one sister might not have one)... they hear about new apps in, I suspect, exactly two places: direct word of mouth, and when something actually gets big enough to hit the news or other mainstream media Jul 29 06:02:13 i hardly use any apps. thats why i've been happy with my lumia 521; the app selection for WP is terrible - but the MS stuff works great, and thats it. i probably won't install anything ever again on it Jul 29 06:02:39 there's a comment in one of the linked articles: "If you use RSS or Twitter to read about what’s new in the iOS world, chances are good that you saw it mentioned once or twice." Jul 29 06:02:42 i treat it as a dumb phone with a decent browser, and great offline mapping Jul 29 06:03:26 if your ambition is only ever to reach people who read RSS or get app recommendations on twitter, that's fine - but you'll never reach any of my family that way, or the other hundreds of millions of people who don't read RSS feeds or use twitter that way... Jul 29 06:03:56 yeah, i never cracked that one (marketing) Jul 29 06:04:11 I think very few of us have Jul 29 06:05:00 i hate it when pundits say to use social media for marketing; fuck that i hate social media Jul 29 06:05:23 i'm not going to create a FB profile for that Jul 29 06:05:37 very rare to find marketing and tech skills in the same person, or even in a small team - techies tend to find marketing a bit dirty, some of it *is* *very* dirty, and there's the simple fact that you probably have to pay someone to do decent marketing for you Jul 29 06:09:00 in this particular article, the guy is talking about spending 8-9 months of 60-80 hours a week on an app, which he released about 6 months ago and has made about US$33k on so far - presumably after the 30% is taken, but before taxes and so on Jul 29 06:09:54 ah, he reckons US$21k after tax and healthcare... Jul 29 06:10:54 thats about poverty in the US Jul 29 06:11:01 right Jul 29 06:12:29 got to say, given how easy it is to throw together an app in 10, 20, 50 hours - and we *know* that - if he put something like 1500 hours of work into it, it's got to be way overengineered Jul 29 06:13:05 i am an engineer in a marketing team, so far I agree with what I read Jul 29 06:13:54 the app he's writing about is an RSS reader... it's not exactly world-beating cutting-edge computer science... Jul 29 06:14:16 a lot of startups/apps fail because they are over-engineered and never make it because devs spend to much time perfecting it Jul 29 06:15:32 it's the job of a project manager to deal with that - which you don't have with a solo engineer or a small tech team Jul 29 06:16:00 true Jul 29 06:18:45 I would imagine there aren't many 'solo engineer' startups that made it Jul 29 06:18:54 almost always, you have to start with a well structured team Jul 29 06:19:33 that was the context of g00s_'s original link - indie devs, which sort of implies solo or small-team, who are making a living purely from (in that case) their own iOS apps Jul 29 06:21:09 with the conclusion that there are very few, and that the numbers are *shrinking*... Jul 29 06:21:37 that is a hard way of making money.. there are many companies out there that will hire good/semi-good ios/android devs Jul 29 06:22:01 yes, that's exactly the point being made :) Jul 29 06:22:54 but then again Jul 29 06:23:03 these people *hope* they will make it big one day Jul 29 06:23:45 you should read his link and the articles it links to... http://www.marco.org/2014/07/28/app-rot Jul 29 06:24:03 i read the first paragraph Jul 29 06:24:04 :) Jul 29 06:25:43 What does '@Entity' mean ? Jul 29 06:31:20 What makes me mad, is that there are so many *not so good* app developers, that the overall quality of development for platform goes down. Especially when those *not so good* devs give *equally bad* advices from their experience. Jul 29 06:43:35 I/art﹕ Heap transition to ProcessStateJankPerceptible took 17.730712ms saved at least -31KB Jul 29 06:43:39 Thanks ART. Jul 29 06:46:31 Hi, Im trying to figure how to send license URL to chromecast receiver with CastCompanionLibrary. How would I go forward with this, should it be sent through mediachannel or customchannel? Jul 29 07:04:50 have a blank imageView in my main activity. have a function that gets called in onCreate() called "loadImageFromStorage" that checks for an imagefile in int Storage and inflates the ImageView with the bitmap Jul 29 07:05:32 The imageview doesnt seem to be inflating, any ideas why? in oncreate not the place for that? Jul 29 07:05:41 is* Jul 29 07:11:01 Jesperhead: there's no error, it just doesn't display? Jul 29 07:13:39 correct :( Jul 29 07:13:47 about to litter the function with Log.vs Jul 29 07:21:38 Hello. How to get the apk from android studio? I am using 8.2 on linux Jul 29 07:22:02 When I have TableA which holds some items, and TableB which holds 1 or more sub-items for TableA, referenced by TableA._ID, do I select TableB contents with custom content provider, or do I do that later in LoaderCallback? Jul 29 07:24:19 vedu, it should be in bin folder. Jul 29 07:24:47 detachYo: It is not Jul 29 07:25:17 vedu: check in 'app/build/outputs/' Jul 29 07:25:31 (where app is the name of your module) Jul 29 07:41:44 I have an app/build and a build/ Jul 29 07:53:29 vedu: F4 on your module ~> Modules ~> Select Module ~> Paths Jul 29 07:55:04 CodePulsar: What do you mean by F4 on your module Jul 29 07:55:42 jesperj: did you put anything in your imgview? you say you "inflate" an image you loaded into the imgview? I dint know about that - I only know about setting an img resource in code : not inflating an image into the view. see setImageResource. Jul 29 07:56:20 Only layouts are "inflated" Jul 29 07:58:13 vedu: ok, you have two, is the apk in any of those? Jul 29 07:58:28 no. none Jul 29 07:58:51 jush: I imported this source to android studio Jul 29 07:59:17 vedu: have you actually built it yet? Jul 29 07:59:30 build -> make project? Jul 29 07:59:32 yes Jul 29 07:59:55 then cd [project_dir] && find -name "*.apk" Jul 29 07:59:57 the plug in a device and run it : thatll prove there is an apk. Jul 29 08:00:14 find . -name "*.apk" Jul 29 08:00:46 the . isn't required :) Jul 29 08:01:34 it should be in build/outputs/apk btw assuming standard gradle intellij/AS project structure. A 2 second google would have helped out. Jul 29 08:01:44 rgr: thanks. I get ./app/build/outputs/apk/app-debug-unaligned.apk Jul 29 08:02:23 Is that the only one? there should be one with the "-unaligned" Jul 29 08:02:38 ? Jul 29 08:02:45 err, without the* Jul 29 08:02:48 ;) Jul 29 08:02:52 yes. 2 are there. Jul 29 08:03:08 so.... you didnt say what was really there. Not good... anyway. You have apk. Jul 29 08:03:10 ./app/build/outputs/apk/app-debug.apk is the correct one? Jul 29 08:03:15 yeah Jul 29 08:03:24 I think I got this just after building Jul 29 08:03:30 yes, you would... Jul 29 08:03:31 thanks guys Jul 29 08:03:35 yes.. Jul 29 08:03:38 I had built earlier Jul 29 08:03:49 then it was there. but you didnt look or use find. Jul 29 08:03:53 Is there difference between the format of Uri I should build when i have tables hat have 0 or more rows and 1 or more rows? Jul 29 08:03:55 and ran it on my device. but thanks anyway. seems trivial now Jul 29 08:07:10 my god. so many pitfalls with multithreading android. headache. Jul 29 08:09:49 s/android/ Jul 29 08:09:56 multithreading is never easy Jul 29 08:10:25 and in case of android, it is extra hard because all the instances your threads might rely on can be swapped out from under you Jul 29 08:10:39 or the listeners you think you are sending messages to might momentarily not be there Jul 29 08:11:25 To some degree sure, but you can kindda guard yourself from that with services and broadcastreceivers (or hell even just make it a bound service i guess) Jul 29 08:11:54 bound services present a very difficult problem as well. Suppose you have a message you need to handle right now, but the serivce is not bound yet. Jul 29 08:12:20 since there is no way to bind to a service synchronously, you can't do it. That message goes into some ad-hoc queue while you fire up the bind and once the bind succeeds you can then send the message Jul 29 08:12:50 Needless to say, I don't recommend even trying to use android's normal mechanisms for communication between components because I can't figure out how to make it reliable Jul 29 08:13:24 probably static lists and flags and so on... that sort of thing at least can be arranged into a known state at start of program and relied on until the app exits Jul 29 08:13:33 :-/ Jul 29 08:14:40 Cant you solve that by just starting the service before binding? Then in the service do an oberserver-like pattern where you keep track of all bindees (is that a word? things that bind to the service) Jul 29 08:14:47 then you'd have no ambiguity or undefined behavior Jul 29 08:19:28 vedu: Press F4 key on your keyboard Jul 29 08:24:38 I just think that setting listeners on ApplicationContext, and starting your processing threads in some Application subclass at least gives something approaching reasonable app-wide state. Jul 29 08:26:05 I know that the android way is to just sort of respond to events and construct the state in the event handlers and then pass them on as arguments in Bundles or Intents or what-have-you, but this model never works for me because all apps I've ever done always have something that doesn't fit the pattern Jul 29 08:29:31 Those are good points, i agree Jul 29 08:32:31 ugh Jul 29 08:32:32 ew. Jul 29 08:32:40 Don't create global app state and global threads O.o Jul 29 08:32:40 wth Jul 29 08:33:05 If you are a music player, say, then you need a global thread that plays music. Especially if it isn't just some mp3 file but some synth. Jul 29 08:33:06 That's going to be total maintenance nightmare, not to mention debugging issues and threading / cpu / memory leakage. Jul 29 08:33:22 Yes but you don't throw that into your application class Jul 29 08:33:32 If you have a bluetooth serial connection to a device, you need a global thread that chats with that device and responds to things it says. Jul 29 08:33:38 Also, no, Android will not randomly kill your threads. Jul 29 08:33:55 Java threads and executors are alive as long as the process containing your application is alive (even when the app is in background). Jul 29 08:34:20 Which is why you have to be careful with raw threads or you'll get lots of funky errors (not to mention battery drain and race conditions) if you don't properly stop them. Jul 29 08:34:33 If you have a long-running computation that can take minutes to do, you need a thread to do it, and have to take all the interesting precautions to prevent android from mucking it up: take cpu wakelock, set a notification that says "please don't kill me until I'm done", etc. Jul 29 08:35:23 yes Jul 29 08:35:35 that's why you have the concept of Services that help you contain those things Jul 29 08:35:39 these are all just about examples of the sort of "global state" I'm dealing with. It's usually a background computation that UI needs to work with. Jul 29 08:35:43 also, Executors help alot instead of raw thread. Jul 29 08:37:02 well, android executors are clearly meant for medium-term tasks. The default pool is serially executing and the other pool has some number of workers. I doubt either is very good fit for long-term tasks. Jul 29 08:37:14 Mavrik: I dont see how having a started service in your app is a threading/cpu/memory nightmare. Jul 29 08:37:24 for instance, when you are cpu bound, you will want to create as many threads as you have cpu cores and divide the work between them. Jul 29 08:37:42 liefer, that's because I haven't said that. Jul 29 08:38:09 "Don't create global app state and global threads" Jul 29 08:38:23 liefer, yes. Jul 29 08:38:35 liefer, contained service object isn't global state. Jul 29 08:38:44 Its pretty close. Jul 29 08:38:50 alankila, ThreadPoolExecutors set with threads to number of cores do that rather well Jul 29 08:38:57 liefer, don't put words in my mouth. Jul 29 08:39:13 alankila, they're just a manager for threads anyway making API a little bit cleaner Jul 29 08:39:14 Alright, my bad Jul 29 08:39:17 maybe, but if you make a pool for just that purpose you probably could have just fired up N threads instead Jul 29 08:39:39 Well, Executors are there to make management of N threads easier. Jul 29 08:39:44 That's pretty much all they do. Jul 29 08:40:19 I don't really oppose the pools anyway either Jul 29 08:40:38 I guess managing them is more fun than raw threads, you can e.g. kill a pool easily without having to go into that interrupt() dance with a thread until it bothers to join Jul 29 08:40:39 anyway, I feel we're talking about the same things :) Jul 29 08:41:12 I speak of the particula while (thread.isAlive()) { thread.join(100); } thing which itself must try-catch InterruptedException Jul 29 08:41:15 so much fun Jul 29 08:41:17 Just that I've seen people actually fire up threads in Application object and forget about them Jul 29 08:41:26 there should be just a "thread.dieNowIDontCareWhatYouDo()" Jul 29 08:41:28 and then store global state in there which always turns into a total muck :) Jul 29 08:42:01 oh yeah... Interrupted checked exceptions, I wish I could meet the guy who defined that in Java spec and beat him with a stick Jul 29 08:42:33 it is not unreasonable I guess Jul 29 08:42:45 but they could have made that subclass of runtimeexception for sure Jul 29 08:43:32 in fact I honestly think they should have made everything a runtimeexception. *sigh* but that ship sailed so long time ago Jul 29 08:43:41 hehe :) Jul 29 08:43:59 still, I can't help thinking that you could actually introduce runtime that treated all exceptions as runtimeexceptions Jul 29 08:44:01 I like SOME checked exceptions - the thing that pisses me off for example in Python is that I never know what kind of exceptions some external library will throw Jul 29 08:44:10 just ignore the 'throws' statements and if someone is catching then great, if not, who cares Jul 29 08:44:14 So IOExceptions being checked is just fine with me Jul 29 08:44:26 but some of those are just plain retarded - checked exception for UTF-8 on Android Jul 29 08:44:33 or InterruptedExceptions on Threading Jul 29 08:44:43 or checked exceptions inside finally blocks on streams Jul 29 08:45:12 the worst part of this is that it's an api change if you try to fix this Jul 29 08:45:59 though, maybe they could change a couple of things into subclasses of RuntimeException... Maybe things wouldn't break all too horribly Jul 29 08:46:28 all the old code that catches and flags the exception as thrown still work, and all the new code can ignore it. So it could be a backwards compatible change. Jul 29 08:47:03 and I'm not too pleased that it took forever to have StandardCharsets.UTF8 Jul 29 08:47:19 nor do I quite understand why that class and why not Charset.UTF8 Jul 29 08:47:42 assuming you mean "checked exception for UTF-8 on android" to be something about finding the UTF8 encoder for these things Jul 29 08:49:31 alankila, indeed Jul 29 08:49:39 there's bunch of classes that need UTF-8 charset Jul 29 08:49:53 which is required by spec... but you still have to check for UnsupportedCharsetException or whatsit Jul 29 08:49:53 passing the charset as String was a very poor decision originally. Jul 29 08:50:05 also, Dalvik 65k method limit Jul 29 08:50:08 what were they thinking. Jul 29 08:50:15 as is not providing statics that contain the charsets every JVM is mandated to support Jul 29 08:50:15 sorry, DEX 65k method limit -_- Jul 29 08:50:24 there are 3: ISO-8859-1, UTF-8 and UTF-16 Jul 29 08:50:45 well, they learnt that mistake but somehow it took 10 years Jul 29 08:51:10 I do wonder if the java language committee members are entirely sane. Can't they fix obvious shit a bit faster? Jul 29 08:51:41 They're not, have you seen the commitee? Jul 29 08:51:46 I have not Jul 29 08:51:53 You have companies which hate each others guts trying to make a spec :D Jul 29 08:52:20 64k limit. Jul 29 08:52:24 not 65k :p Jul 29 08:52:31 it's a power of 2 :p Jul 29 08:52:31 I'm feeling like I need to pick another JVM language and start writing code on it and never look back Jul 29 08:52:34 65535. Jul 29 08:52:56 64 ki - 1 limit! Jul 29 08:53:09 64 kibi-methods ;) Jul 29 08:53:12 sorry, 65536, because it's a 16-bit field from 1-16 :) Jul 29 08:53:14 should be enough methods for anyone Jul 29 08:53:29 for everyone except that huge shitty behemoth of Play Service Jul 29 08:53:44 who the flying fuck taught Google to put ALL their functionality in a single library Jul 29 08:54:02 forcing us to drag Chromecast, Maps, Analytics and Ad APIs with the app just to get Push functionaliry Jul 29 08:54:32 maybe dex is obsolete soon anyway Jul 29 08:54:46 It's still used as an intermediate format, but I can't help but wonder how long Jul 29 08:54:47 Unlikely. Jul 29 08:55:01 Considering the fact that even Android L won't be able to load any other class format :/ Jul 29 08:55:28 Hopefully they'll make a pretty gradle plugin like JakeWharton suggested Jul 29 08:55:36 Are OAT files device-specific Jul 29 08:55:45 yes afaik Jul 29 08:55:47 yes Jul 29 08:55:49 same as ODEX Jul 29 08:55:51 hmh. Ok, then. Jul 29 08:55:53 similar to.. yeah. Jul 29 08:55:56 since they're statically linked and compiled for local arch Jul 29 08:57:00 at least the oat files contain the original dex file Jul 29 08:57:08 no more de-odexing shenanigans :) Jul 29 08:59:36 Is dynamic class loading possible on android? Suppose you download code from the internet in dex format and run it. Can you run it without writing a dex interpreter? Jul 29 08:59:47 yes Jul 29 08:59:51 yes it's possible Jul 29 09:00:02 but it's a significantly more painful experience than when working with plain java Jul 29 09:00:03 you can use normal class loading, afaik, there's a Dex ClassLoader Jul 29 09:00:36 that is interesting. But can it compile it to OAT and load it? Jul 29 09:01:11 alankila: probably it would go into JIT fallback Jul 29 09:01:41 hmm, that's a good question really Jul 29 09:02:17 some info here from I/O: http://stackoverflow.com/a/24652129/169115 Jul 29 09:03:15 alankila: ART is technically supposed to fulfill the same "contract" as DVM in official API Jul 29 09:03:31 and runtime loading of classes from DEX files is part of said contract Jul 29 09:04:16 I see. So it will do the translation and ART doesn't end up with a fallback JIT, it sounds like Jul 29 09:04:35 yup, but you still can't live-patch code, you need a backing dex file on storage Jul 29 09:05:47 well, technically you can't live patch it with DEX either - you need to do it at load time, so if you hijack that, making it rerun the code generation would not be that much of a problem... probably Jul 29 09:07:06 mhm, but you can do it with desktop JVMs Jul 29 09:07:09 with as, can I run release apk on device? Jul 29 09:07:22 no reason you couldn't. Jul 29 09:07:23 Mavrik: with desktop JVM you do it at load time as well Jul 29 09:07:54 Mavrik: how? Jul 29 09:08:12 *shrug* Don't use gradle, ask someone who does :) Jul 29 09:08:12 technically, if ART will consume standard classloader interface, just with DVM bytecodes instead of JVM, you can do JVM-style livepatching Jul 29 09:08:21 but there's no difference between "debug" and "release" apks Jul 29 09:08:29 (technically that is) Jul 29 09:10:05 is there any way to detect whether the app is running on Bluestacks or any such android emulator? Jul 29 09:10:38 I think is not possibile because the window for edit configuration is called Run/DEBUG configurations Jul 29 09:12:01 Does anyone know of any planned updates to the L preview? Jul 29 09:12:37 heinrisch, I think Google said there will be no updates until final release Jul 29 09:13:39 thats a little strange, the current release is really unstable.. Jul 29 09:14:36 Well previously there's been no preview at all ^^ Jul 29 09:15:25 that is true, but when skip on the extra testing if you can get it relatively cheap? Jul 29 09:15:36 please, could anyone give me good tutorial, example, literature, about overlaying custom view, i have framelayout with custom view, and i want to overlay on top of it relativelayout with couple of buttons and edittext, i need that relative layout to be transparent Jul 29 09:16:07 heinrisch: I don't think they're looking for release testing as much as SDK feedback? Jul 29 09:17:35 well they could get both :) I only have one phone and I had to uninstall the preview because of frequent reboots and most of the time I could not unlock the screen Jul 29 09:23:01 It definitely seems that the fewer preview releases, the bigger the possible gulf between the preview SDK and final SDK Jul 29 09:23:17 So everyone will scramble in a mad week to fix their app for the release sdk Jul 29 09:27:42 I've compiled a test program with android ndk in ubuntu, and tried to run it with qemu-arm, but it says "/system/bin/linker: No such file or directory". what's wrong? Jul 29 09:29:48 you probably need more of android userland to execute it Jul 29 09:30:34 I think the linker path is embedded in the binary Jul 29 09:31:24 I don't know if you can change it, or invoke the linker as the program giving the executable as argument Jul 29 09:31:39 and if android supports anything like LD_LIBRARY_PATH to determine where to resolve the libraries Jul 29 09:37:12 thank u, I'll try compile it with static link Jul 29 09:37:57 that could work better Jul 29 09:38:21 Hello Jul 29 09:38:25 Anybody help me? Jul 29 09:39:36 yes, that works now, thank u alankila Jul 29 09:41:01 ;( Jul 29 09:44:13 I need other method different to settext Jul 29 09:47:03 Hello, i've been using this for my admob ads: GoogleAdMobAdsSdk-6.4.1.jar Jul 29 09:47:05 Now it looks like I should upgrade ? Jul 29 09:47:15 Messiiii: getText() ? Jul 29 09:47:27 But seriously, what do you want the other method to do? Jul 29 09:47:53 but where is the latest ?: GoogleAdMobAdsSdk-x.x.x.jar ? My google is confusing me. Jul 29 09:48:31 Unknown0BC: it's been migrated to the Google Play SDK Jul 29 09:48:36 Estel::: When i setText on my editText, the String setText replace and delete al text in my EdiText Jul 29 09:48:51 I wish add text Jul 29 09:49:27 Unknown0BC: https://developer.android.com/google/play-services/ads.html Jul 29 09:49:58 Messiiii: do it manually. As in, field.setText(field.getText() + newText); Jul 29 09:50:18 Estel: ty, Short question, will I just be able to replace: GoogleAdMobAdsSdk-6.4.1.jar ? or am I going to have to do a lot more ? Jul 29 09:50:33 On the development side. Jul 29 09:50:56 Unknown0BC: It requires some adjustments, but not mush Jul 29 09:50:58 much Jul 29 09:50:59 I've not done it, but I suspect it's not completely trivial Jul 29 09:51:22 No Jul 29 09:51:29 Its a emoticon button Jul 29 09:51:46 Button -> send string(emoticon)-->edittext Jul 29 09:52:14 Unknown0BC: see https://developers.google.com/mobile-ads-sdk/docs/admob/play-migration Jul 29 09:52:48 It so sucks when you think you are just going to download a new lib.jar. Jul 29 09:53:06 and then you are going to sit around for some time more than that, just to adjust. Jul 29 09:53:12 anyway ty guys and gals. Jul 29 09:53:15 hehe yeah. Jul 29 09:53:17 I better get to reading. Jul 29 09:54:30 morning people Jul 29 09:54:35 or evening Jul 29 09:54:45 morning iffa Jul 29 09:55:02 .c Jul 29 09:58:02 How can you set up different search icons for different themes? Jul 29 09:58:49 :((( Jul 29 09:58:53 Helppp Jul 29 09:59:00 Messiiii: what's up Jul 29 10:00:42 fuck search icons Jul 29 10:00:44 imo Jul 29 10:01:56 I have never tried doing that with search icons. Jul 29 10:02:07 you can't change the search icons in the search widget as far as i know? Jul 29 10:02:51 iffa: yes you can Jul 29 10:03:01 how? Jul 29 10:03:13 iffa: in the menu xml you use android:icon in Jul 29 10:03:25 didn't work without adding 'collapseActionView' to android:showAsAction Jul 29 10:03:25 ive tried that but the icon doesnt change? Jul 29 10:04:05 mhm.. Jul 29 10:04:19 not sure, clean project, rebuild maybe Jul 29 10:04:28 what SDK are you targeting? Jul 29 10:05:10 I need add text to edittext Jul 29 10:06:04 ill have to test this out Jul 29 10:06:18 ive always hated the fact that the android search icon is not as light as other icons Jul 29 10:06:32 Then maybe you should append to it Messiiii Jul 29 10:07:08 No, when i put the text, the string delete all text on my edittext Jul 29 10:07:26 Final String emo1 = data.getExtras().getString(Extra.EMOTICON); Jul 29 10:07:26 EditText input = (EditText) findViewById(R.id.input); Jul 29 10:07:31 Input.append(emo1); Jul 29 10:07:49 All text replace by the emot1 Jul 29 10:08:07 Messiiii, then it does not work ? Jul 29 10:08:13 I need add the emoticon to the text, no replace the text to emoticon Jul 29 10:08:50 Messiiii, have you tried appending any string, other than emot1 ? Jul 29 10:08:50 Does append work for other strings ? Jul 29 10:09:08 No, no work, the code work, the string send perfect to edittext, but the string replace and delete all text in my edittext Jul 29 10:09:34 I have 60 emoticons Jul 29 10:10:03 I mean? Jul 29 10:10:21 So if you do Input.append("just a test"); it would work ? Jul 29 10:10:31 But if you do Input.append(emo1); it does not work ? It replaces all text ? Jul 29 10:11:30 Yes Jul 29 10:12:05 Input.append(emo1) replace all text, i need ADD the string Jul 29 10:13:19 If the append works correct for other strings, but it does not for emo1 then there may be a character or character sequence in emo1 causing the append to replace everything instead of appending. Jul 29 10:14:23 just noticed “short description” on the dev console… where exactly is this scene? Jul 29 10:15:02 um, *seen Jul 29 10:15:08 too early Jul 29 10:15:16 Ok Jul 29 10:23:22 I have a method that returns a Bitmap. Does the bitmap in the method recycle/gets freed from memory automatically when the method ends/returns, or do I somehow have to recycle it? If I have to recycle it, I wonder how it could be done because I can't do it before "return b" (b==Bitmap) and not after since it wont get executed after return... Jul 29 10:32:37 http://imgur.com/a/awXzN hows my app looking (other than the "ITS ILLEGAL, STOP", no it is not) guys Jul 29 10:32:47 anything odd? Jul 29 10:34:18 I don't like how 'Music controls' is drawn over the EditText. Just nitpicky though. Jul 29 10:34:44 flan3002: I don't like it either! the library doesn't have a method to change its position ._. Jul 29 10:35:26 iffa: I'd prefer it to dim everything else than the highlighted thing. Then the help text could be brigther and more readable. Jul 29 10:36:08 i'll try that out, thanks Jul 29 10:49:41 what do i need to do/know when making my app open source nad putting it on github or something? Jul 29 10:51:22 pick the right license to release it under i guess Jul 29 10:52:13 iffa: http://choosealicense.com/ Jul 29 11:09:18 i need an infinite vertical scroll view exactly like facebook or instagram or google plus app to load user posts in activity when he scroll down , give me some keywords for search Jul 29 11:09:26 what do you store in your .gitignore for AS/Intellij projects? I want to keep window layouts unique across machines but I do want to retain changelist names. Jul 29 11:10:10 "infinite vertical scroll list android" - that wasnt so hard. Jul 29 11:10:33 https://www.google.com/search?ie=utf-8&oe=utf-8&q=infinite%20vertical%20scroll%20list%20android&gws_rd=ssl Jul 29 11:13:23 good to hear Jul 29 11:13:39 Is it possible to display logo AND icon in the action bar? Defining a logo hides the icon Jul 29 11:15:06 platzhirsch, what phone/version and are you rooted? Jul 29 11:15:09 hi himcesjf- Jul 29 11:19:43 ri0tdorque: API 9 Jul 29 11:24:49 is there a difference between up navigation and back pressed? Jul 29 11:24:54 semantically by default I mean Jul 29 11:25:58 Do yo keep iml, iws, ipr files in your AS project in git? Or some subset of them? Jul 29 11:26:52 rgr: Don't add them to your git repo. Jul 29 11:28:50 why not? Jul 29 11:29:35 Because a git repo should be as configuration-free as possible. Ie., other collaborator should not be bound to IntelliJ/AS. Jul 29 11:29:40 Every single resource I have just googled says exactly the opposite. Jul 29 11:30:09 Using gradle should ensure that the project can be built without an IDE. Jul 29 11:30:10 And that is nonsense. git is also used to hold configuration data. Ive used git for years. But Im not sure exactly whats in the intellij files. Jul 29 11:30:57 flan3002: which has nothing whatsoever to do with the intelij config files and is totally transparent anyway : I can rebuild using gradle. I am not asking about gradle files. Im asking specifically about intellij files. http://cschablin.blogspot.ca/2011/06/sharing-intellij-idea-project-files.html Jul 29 11:31:32 building !== developing and maintaining a vcs trail. Jul 29 11:32:06 It can be used, but it shouldn't, if you can avoid it. Someone else might come along with Eclipse or vim and not need the .iml files at all. Worse, if these configuration files require external dependencies or are not platform-agnostic. Jul 29 11:33:40 that is not the use case. the use case is me moving between laptop and desktop. I would have said if this was a multiplatform, multi user issue. And since AS/Ij use different structures and layout for their builds and sources etc that would be a pretty horrific and edge case. Jul 29 11:34:01 dint worry. That link above explains what should be in vcs. Jul 29 11:35:01 rgr: Well, then, it will be more convenient for you. Go for it! Just don't include everything still... Jul 29 11:35:12 Like the .idea directory... Jul 29 11:36:46 Just saying, but gitignore.io seems to agree with me... http://www.gitignore.io/api/intellij Jul 29 11:37:24 why would I include everything?!? Thats the whole point of me double checking here. Jul 29 11:37:59 that gitignore is an anonymous post with no explanation. I prefer the link above where the guy knows what hes talking about and explains it. Jul 29 11:38:29 yay… first android app just hit the store :D Jul 29 11:38:43 w00t cool for you Jul 29 11:39:55 rgr: Your choice. It's just that I've run into problems with people using different OS, IDEs and setups. I therefore prefer to seperate the configuration per platform from the actual content. :) Jul 29 11:41:11 rgr: This seems to be the best answer though: https://intellij-support.jetbrains.com/entries/23393067 Jul 29 11:41:35 I already said its not for different OSen usign different IDEs. Also jetrains head dev says "defo put them in" : http://devnet.jetbrains.com/message/5245422 Jul 29 11:42:10 and yes your link also says to put them in. Jul 29 11:43:32 I'm using the aviary sdk and it has shot up the number of methods taking it past the 65k method limit. I'd like to use proguard to exclude unused methods, but don't know if I should update build.gradle of the included aviary sdk or should update my own project's build.gradle Jul 29 11:47:16 gavri: I'd say your own. Otherwise proguard might exclude methods that are used later on in your project. Jul 29 11:47:57 jush: that means I can include in my own project file the names of aviary classes that need to be excluded? Jul 29 11:48:33 also, this is probably a dumb question. if I'm not using any kind of reflection, is there a way to tell gradle to automatically drop all unused methods from the output build? Jul 29 11:51:16 gavri: yes, you can add the names in your own proguard rules file. Proguard should remove all unused methods from the output build (http://www.crashlytics.com/blog/mastering-proguard-for-building-lightweight-android-code/) Jul 29 11:52:44 jush: thanks for the link Jul 29 11:53:04 but I'm still wondering why proguard lists down the unused classes which it then lets me explicitly exclude Jul 29 11:53:13 instead of just dropping those classes from the final jar Jul 29 11:53:26 is it because reflection might be in use? Jul 29 11:53:34 so if you open the jar they're still there? Jul 29 11:54:05 keep in mind that proguard will print unused methods if you have the printusage flag (see the link) Jul 29 12:15:48 i have a webview in my application and I see onPageStarted being called twice for each site I try to load... The function that calls mWebView.loadURL is only called once... Jul 29 12:16:05 any ideas why? Jul 29 12:16:13 jush: I'm confused. does it both print unused methods and also eliminate them from the final jar? Jul 29 12:16:35 then there is no work for me to do besides just using the default proguard-android.txt file, right? Jul 29 12:17:39 hi i got asus zenphone 5.it worked fine for 3 days..then it suddenly turned into white screen.nothing seems to work..but i feel the touch is working..the screen is white and i m nt able to see anything in the display Jul 29 12:20:27 gavri: yes, that's my understanding. It prints the unused methods that actually will be removed. I think the purpose is to let you know so you can decide to really remove them from your source code Jul 29 12:24:30 Do you see anything in the Admob AdView when you use ads:adUnitId="DEVICE_ID_EMULATOR"? Or is it just blank? Jul 29 12:30:14 how do i add listeners to my custom notification buttons Jul 29 12:36:31 jush: thanks Jul 29 12:40:42 hi all Jul 29 12:40:50 i want to cache http responses - so i'm using OkHTTP Jul 29 12:41:11 however, i want to cache all responses with a client-side policy. all responses should be cached for 1 hour regardless of the server policy Jul 29 12:41:38 from OkHTTP docs - it's impossible and people are instructed to use DiskLRUCache and manually build the logic Jul 29 12:41:46 anyone bumped into this scenario? Jul 29 12:54:23 What's the R.id name for the home up button? Jul 29 13:05:43 platzhirsch, home Jul 29 13:07:33 Hi, how to get if service is active or not? Jul 29 13:07:54 iffa: depends what you mean by "custom". You addlisteners to views so the same as you add any listeners to non custom views I would assume if I understand the Q. Jul 29 13:09:43 right, so the lunar lander example code is fatally flawed. it doesnt recreate the rendering thread in the surfaceCreated method : the run() may have previously exited in lifeCycle change. Only recreating the thread in the containing view oncreate isnt valid since your're not guarenteed onCreate will be called for a temporary focus switch. Jul 29 13:10:53 (sorry, in the custom view constructor, not the oncreate I meant) Jul 29 13:11:19 anybody used SlidingMenu? Jul 29 13:20:34 i'm confused at this... i do not understand a single example. i have a button in my custom notification view, so how do i add a listener to it so i knwo when it is clicked? i know it has somethng to do with pendingintents and such Jul 29 13:28:35 Is there a non support library version of FragmentPagerAdapter? Jul 29 13:29:39 You dont like supporting older version of android? Jul 29 13:30:57 Syzygy: there might be some port in a github repository somewhere, but ViewPager is one of the main reasons everyone uses support fragments for everything Jul 29 13:31:25 liefer, not past 4.0.0, no. Jul 29 13:31:36 can i set a click listener on the facebook login button without overriding the underlying listener? Jul 29 13:31:54 Syzygy: im curious, do you lose anything from using the support lib version? Jul 29 13:32:17 liefer, he probably just has to change a lot of code Jul 29 13:32:33 the app is getting close the the DEX limit, so I would like to try to avoid libraries as much as possible. Jul 29 13:32:34 happened to me once, needed to change dozens of classes to support library Jul 29 13:33:09 If you dont care about supporting older devices, you dont really have to consistently use the support lib version of things Jul 29 13:33:20 hi all, Jul 29 13:33:23 Syzygy: maybe use the v13 support library? Jul 29 13:33:36 Hey Alfreda Jul 29 13:33:51 liefer, there does not seem to be a non-support FragmentPagerAdapter Jul 29 13:34:02 lol.... someone was talking about the dex limit earlier today. 64k should indeed be enough for everybody :P Jul 29 13:34:09 Syzygy: :( Jul 29 13:34:14 liefer, not if you use some libraries Jul 29 13:34:20 i was being sarcastic Jul 29 13:34:52 Syzygy, can't you integrate some of the libraries into your code? Jul 29 13:35:07 to be fair we basically rewrote the app from scratch and split functionality off into different apps by now, so it might not be an issue anymore Jul 29 13:35:19 it's a douchy thing to do, but if it works Jul 29 13:35:45 yeah, probably but it's still not a good solution imho Jul 29 13:35:55 Why not? Jul 29 13:36:05 if i have an activity A that call another activy B when i click on a button with startActivityForResult(myIntent, 0); After i want with another button on B return to A with intent values Jul 29 13:36:07 things like lack of dependency management come to mind Jul 29 13:36:19 Syzygy: what about using proguard? Jul 29 13:36:21 which is the event onReturn? Jul 29 13:36:52 Alfreda: onActivityResult() ? Jul 29 13:36:54 you have to override the onActivityResult on activity A Jul 29 13:37:04 and the id should be 0 Jul 29 13:37:07 doesn't android studio use that by default? it generates a proguard-rules files at least Jul 29 13:37:20 no, check build.gradle runProguard is false by default Jul 29 13:37:43 Syzygy, dependency management is for little girls. =P Jul 29 13:38:00 why should the id be 0? Jul 29 13:38:15 because the set the id to 0 in the startActivityForResult Jul 29 13:38:17 jvrodrigues: in public final class Add extends Activity { @override onActivityResult? Jul 29 13:38:25 oh Jul 29 13:38:29 jvrodrigues, unfortunately we're working on a medical app and need to document stuff like that. Jul 29 13:38:55 Syzygy, medicine also feels like things for little girls, so i guess it fits =P Jul 29 13:39:13 jvrodrigues: i dont unstand well Jul 29 13:39:25 A--->B after B--->A Jul 29 13:39:31 where i must override function? Jul 29 13:39:51 jvrodrigues: I'm not even sure what you mean by that statement Jul 29 13:40:55 i want in A write a function that is runned only when i return from B Jul 29 13:41:04 is possible? Jul 29 13:41:37 Alfreda: yes, in A, add a function onActivityResult() Jul 29 13:42:47 public final class Add extends Activity{ protected void onActivityResult (int requestCode, int resultCode, Intent data){ ...} } ? Jul 29 13:43:23 @override? Jul 29 13:43:39 Alfreda, i think i see your problem Jul 29 13:44:01 what? Jul 29 13:44:07 in activity b you have to call getParent().setResult(Activity.RESULT_OK, data) Jul 29 13:44:09 then call finish Jul 29 13:44:15 whenever you're done with whatever you're doign Jul 29 13:44:26 data is obviously the object you want to pass Jul 29 13:44:34 if i'm not mistaken Jul 29 13:44:41 i rarely work with activities these days Jul 29 13:45:37 actually no Jul 29 13:45:48 data is an intent Jul 29 13:46:46 anywas Jul 29 13:46:56 can i set a click listener on facebook login button without ruining everything it does? Jul 29 13:46:58 in B i call A in this mode: http://pastebin.com/C3zQ5NMG Jul 29 13:47:18 where i add getParent().setResult(Activity.RESULT_OK, data) Jul 29 13:47:32 before you finish that activity Jul 29 13:47:41 Alfreda: you shouldn't call startActivity() in B Jul 29 13:47:47 you should just finish, which goes back to A Jul 29 13:47:59 (And call setResult() before finish()) Jul 29 13:48:09 Estel: and how i can edit my code? Jul 29 13:48:47 but i want use intent on A Jul 29 13:49:06 Because A opened B, it already exists behind B. Jul 29 13:49:10 how can I stop the logcat scrolling in intellij? im being blind : there has to be a pause button there or something. Jul 29 13:49:34 rgr, edit filters. Jul 29 13:50:00 i dint want to remove the filter. I want to stop the scrolling Jul 29 13:50:33 rgr, i don't know a way, sorry Jul 29 13:50:48 Estel: ah Jul 29 13:50:59 Estel: i remove startActivity(i) Jul 29 13:51:03 and before of finish() Jul 29 13:51:12 (also, please for the love of god stop using the return key for punctuation. three words per line plays havoc with comprehension) Jul 29 13:51:19 i insert getParent().setResult(Activity.RESULT_OK, i) ? Jul 29 13:51:20 rgr: it doesn't autoscroll for me in intellij if I'm not on the bottom line? Jul 29 13:51:31 Alfreda: yes Jul 29 13:51:34 Estel: yeah, its playing up on me. dunno why, Jul 29 13:51:38 Alfreda, that's basicaly what i told you Jul 29 13:51:49 yes yes Jul 29 13:51:50 sorry Jul 29 13:51:59 in setResult() Jul 29 13:52:07 Aha solve. It was loading a cache and then couldnt stop by moving off last line. When cache caught up I can stop by moving away from the end. Jul 29 13:52:11 Activity.RESULT_OK Acitivity is A or B? Jul 29 13:52:14 i think B Jul 29 13:52:28 It's neither, it's just a static variable that means Jul 29 13:52:43 ah ok Jul 29 13:52:46 static! Jul 29 13:52:52 "Activity B is saying 'I did what you asked okay'" Jul 29 13:53:16 ok Jul 29 13:53:25 so getParent().setResult(Activity.RESULT_OK, i); Jul 29 13:53:28 Yes Jul 29 13:53:34 and in A? Jul 29 13:53:48 @Override protected void onActivityResult (int requestCode, int resultCode, Intent data) Jul 29 13:53:54 Yes Jul 29 13:54:00 how edit this? Jul 29 13:54:24 if (resultCode == RESULT_OK) { ..... ? Jul 29 13:54:29 sure Jul 29 13:54:53 Intent Data is myIntent in B? Jul 29 13:55:04 that i pass at this function automatically? Jul 29 13:55:22 so data.getString(.... <- i have my data? Jul 29 13:55:29 I believe so. Jul 29 13:55:33 Just try it! ^^ Jul 29 13:56:29 thanks Jul 29 13:57:36 Estel: i must write Intent i = getIntent(); before? Jul 29 13:58:11 data=getIntent()? Jul 29 13:58:39 No, you don't need to getIntent Jul 29 13:58:45 just use the data object Jul 29 14:14:43 hy all Jul 29 14:15:02 what kind of proximity sensors do the android phones have? Jul 29 14:15:11 I mean what kind of values does it measure? Jul 29 14:15:33 and why is it the most energy harvester sensor in the phone? Jul 29 14:18:00 how do i make multiline cursor using keyboard? Jul 29 14:19:18 Anyone can help me here please ? http://stackoverflow.com/q/25017456/1708105 Jul 29 14:21:48 gregtom6: it varies from device to device. According to the documentation, the actual Proximity sensor measures the user's proximity in centimeters (or a binary near/far state) Jul 29 14:22:14 gregtom6: and I would guess that GPS uses the most battery? Jul 29 14:27:03 AhmadElMelegy: post your Q and a link to the code. Not just a link to what could be anything. Dint just say "can someone help me". *Ask the Question*. Jul 29 14:27:52 Estel: but the near/far state is a centimeter value too? I mean it seems to be a boolean, but that's the software only Jul 29 14:27:54 or not? Jul 29 14:27:58 GPS uses very little if you only turn it on for specific periods for specific apps. Which is generally the way now. Jul 29 14:28:15 but if on for tracking etc then yes, it burns fuel. Jul 29 14:28:17 gregtom6: it depends on the per-device implementation. Jul 29 14:29:08 Estel: can I get centimeter values from a Sony Xperia L's proximity sensor? Jul 29 14:29:19 You'll have to try it. Jul 29 14:29:22 because the built-in mime code application measures only on and off values Jul 29 14:29:37 I remember that my first android phone didn't have a proximity sensor Jul 29 14:29:54 I suspect so, the documentation says it's only very few devices that are boolean Jul 29 14:29:56 it took forever for me to realize that the reason I sometimes didn't hear anybody was because my ear had touched the mute control on screen Jul 29 14:30:36 if I'm going to tint icons, is it better for the originals to be white or black? Jul 29 14:30:36 alankila: didn't early Android devices disable the screen altogether in call? Jul 29 14:30:43 Because they had sexy hardware end call buttons.\ Jul 29 14:31:16 with 4.3 my phone turned the screen off when it came close to the ear and sometimes it wouldnt turn it back on. nightmare. Jul 29 14:31:28 maybe but I was updating to custom ROMs on the device. It shipped with android 1.5 IIRC Jul 29 14:31:47 Which phone? Jul 29 14:31:49 shekibob_: what do you mean by "tint" in this instance. Example images? Jul 29 14:31:50 HTC Hero Jul 29 14:31:55 nexus 4. Jul 29 14:32:29 The proximity sensor is probably the most annoying sensor to break. Jul 29 14:32:47 it is when you're on a foreign answering machine and cant end the *ing call... Jul 29 14:33:56 Hold the power button, kill EVERYTHING Jul 29 14:34:02 OWZAT Jul 29 14:34:38 anyone know what this could possibly mean? sigsegv in jdwp GetSourceFile http://pastie.org/pastes/9429469/text Jul 29 14:46:16 ok, I cant provide detailed detailed information. But maybe the context will jog someones memory and enable them suggest an approach. I have an AnimationDrawable to which I setCallBack with a new Drawable.Callback(). When I run the program the callback, according to my logging, is called once and once only - so it animate once and once only. However if I set a breakpoint in the callback and then hit continue the callback IS called time Jul 29 14:46:16 and time again. It suggests some sort of timing issue. any high level ideas? Jul 29 14:53:39 how can I get which phones has a proximity sensor with distance measurement in centimeter? Jul 29 14:53:53 so the output is no boolean? Jul 29 14:54:54 you google Jul 29 14:57:10 gregtom6: I'd be surprised if you'll find an authoritative list, far easier to test Jul 29 14:57:42 thats a lot of phones to test.... maybe better to find a list that dint... Jul 29 14:58:03 I mean, you test in code to handle the circumstance. Jul 29 14:58:48 Estel: well, the built-in application measures a boolean value. But I don't know if it's provide that's a far/near sensor or just the application creates a boolean Jul 29 14:59:22 gregtom6: yeah, so write a small applicatoin to try and extract the value yourself? Jul 29 15:08:37 My N5 seems to be boolean Jul 29 15:09:17 returns either 0 or 5.000305cm Jul 29 15:17:34 in my code http://pastebin.com/QXT5ctK2 i want that when i click on iten on grid i dont view FullScreen.xml why? Jul 29 15:18:52 i view correclty the grid with item Jul 29 15:18:58 but when i click i dont view nothing! Jul 29 15:19:07 Fulllscreen.xml dont start Jul 29 15:19:10 pls help me Jul 29 15:19:24 Do you mean FullImageActivity.class ? Jul 29 15:20:33 yes Jul 29 15:20:58 Don't compare strings with ==, use .equals Jul 29 15:23:37 SimonVT: thanks Jul 29 15:25:42 while if bundle.getString("Provenienza","Insert") i have this error onRuntime: http://pastebin.com/CE5zqXrf Jul 29 15:26:05 what error is? Jul 29 15:26:18 is there anyone familiar with the overlaying layouts? Jul 29 15:27:00 Alfreda: pretty explicit, line 2. Index out of bounds. Your for loop is done incorrectly, you're off by one. Jul 29 15:28:21 but i dont undstand where is error in my code :( Jul 29 15:28:42 i dont view grid Jul 29 15:28:47 before onclick event Jul 29 15:30:28 I don't know where the error is in your code, either, since I haven't read your code (and honestly don't have the time), but the failure is quite clear. Index out of bounds, you're walking past the end of an array. Don't do that. Jul 29 15:30:53 Hi. I have troubles figuring out how to import via url json array and add it's data to spinner. Would be apreciated if anyone will give a hint. Thanks Jul 29 15:34:17 my app works! yeay Jul 29 15:35:28 iflista: I'd probably use okhttp, gson or retrofit (okhttp and retrofit from square, gson from google), that gets you an array, then it's just an arrayadapter to plug it into your spinner Jul 29 15:36:28 dragorn, so there is no way to use json using only android libraries? Jul 29 15:37:15 iflista: you could use apache http client and gson, but okhttp is much more robust and I beleive gson is an external regardless Jul 29 15:37:31 dragorn, thanks Jul 29 15:37:39 okhttp and gson are just jar drop-ins anyhow Jul 29 15:37:42 they're pretty trivial to use Jul 29 15:38:12 dragorn: ok i've resolved Jul 29 15:39:09 What Jul 29 15:39:19 What's a good way to make the screen flash? Jul 29 15:39:42 but after i click on item i have this error: http://pastebin.com/DPP9s0zE Jul 29 15:39:53 Yasser83, have you even tried google? Jul 29 15:40:04 yep Jul 29 15:40:13 Not very thoroughly http://stackoverflow.com/questions/14436103/how-to-make-screen-flashing-blinking-from-background-service-on-android-device Jul 29 15:41:01 * autrilla feeds Yasser83 with a spoon. Jul 29 15:41:22 C'mon, you're old enough to do that youself, you're already 31 Jul 29 15:42:01 dragorn: ? Jul 29 15:46:20 is there any software to test whether my device bootloader is locked or unlocked? Jul 29 15:47:09 cancer, try #android-root Jul 29 15:47:58 autrilla | tnx for the info. but sometime i have to stay there for hour and not a single reply. only once i got reply. Jul 29 15:48:16 Feel free to wait for an hour here too Jul 29 15:48:41 : D. Jul 29 15:48:52 i'm already there : ). Jul 29 15:57:08 hey all. any freelancers here? Jul 29 15:57:28 I'm about to post a project up on elance and thought I might try here first. Jul 29 15:58:32 I believe that's against the channel rules. Jul 29 15:59:13 It is Jul 29 15:59:50 Hi Could anybody help me with this unit conversion stuff? Jul 29 16:00:02 Im having some problems with the boardconfig.mk Jul 29 16:00:12 According to combined info given by df and cat /proc/partition, my #blocks is 7760896 and blksize is 4096 Jul 29 16:00:21 Of my SD-CARD which is 4 GBs* Jul 29 16:00:31 But 7760896*4096 gives 31788630016 bytes which is about 29.60546875 GBs :P Jul 29 16:00:40 Szygy: you are right. Just read the channel banner. Jul 29 16:00:48 Sorry about that. Jul 29 16:02:22 * autrilla First of all, I'd need to know your budget, I wouldn't want to lose your time and my time Jul 29 16:02:41 hi Jul 29 16:02:52 does mtpd support samsung galaxy s duos model? Jul 29 16:07:05 learning android dev and trying to wrap my head around fragments/activities. if i have a simple app that just has two activities ('main' Jul 29 16:07:43 ' and settings) should each fragment have its own activity or should i try to use one activity for both fragments ('main' fragment and settings fragment) Jul 29 16:10:15 is anyone using the sliding menu library and can tell me if there's a way to close the menu? Jul 29 16:11:51 Syzygy: Which one? there is no "the library" Jul 29 16:12:58 Oh, did I just /me that? Jul 29 16:13:02 Duh Jul 29 16:14:36 danijoo, https://github.com/jfeinstein10/SlidingMenu this one. I believe it's somewhat widely used Jul 29 16:15:36 oh well. I used it once but dropped it when googles released the drawerlayout in their support package Jul 29 16:15:47 Why dont you use the official one? Jul 29 16:16:46 I feel like I had that discussion last week, but don't recall the actual arguments I had. Let's stick with "I have my reasons". Jul 29 16:17:04 anyways, to answer your question there is SlidingMenu.toggle() Jul 29 16:17:13 that closes and opens it Jul 29 16:17:19 doesn't seem to work. Jul 29 16:17:33 oh uhm. it worked when I used it. mh Jul 29 16:18:29 then I dont know. But i remember that I used toggle for that (i overwrote onBackPressed to close the menu when its open) Jul 29 16:18:33 It didn't when I used it like 10 minutes ago. I can try again. Jul 29 16:19:28 (back button closes it without me having to code that) Jul 29 16:21:16 aaearon: no answer. I would have two acitivities since from your use case it sounds like they will also use different fragments. settings is a lot different to "main". Jul 29 16:21:22 toggle might not have worked earlier because isMenuShowing() didn't, so my if might never have worked in the first place... Jul 29 16:21:39 its not like reusing a "info pane" fragment on multiple activities. Jul 29 16:22:17 nope, still not working. Jul 29 16:24:42 ugh. two days trying to get animationdrawable working with a surfaceview painful. I know its going to be something so bloody simply. If I set one breakpoint in the Drawable.Callback and hit continue reoving the breakpoint it works fine. without the breakpoint it doesnt. aargh. Jul 29 16:25:49 hello, i am using this code in NotificationCompat.Builder.setSound( Jul 29 16:25:53 android.resource://uk.co.digigalaxy.helper/notification_sound Jul 29 16:26:05 This works fine with mediaplayer.setDataSource. but not with the notification, does anyone know what's wrong? nothing plays Jul 29 16:28:03 don't worry I found it Jul 29 16:28:09 does anyone know why Math.floor() and Math.ceil() return a float/double? I mean the whole purposr of those methods is to round up/down to the nearest INTEGER... Jul 29 16:28:25 purpose* Jul 29 16:28:40 I don't think that's the whole purpose. Jul 29 16:28:52 ^ Jul 29 16:29:02 you probably want to use these functions to continue calculations, for instance to isolate the decimal part of the number could be x - Math.floor(x) if x > 0 Jul 29 16:29:12 Also, google http://stackoverflow.com/questions/511921/why-does-math-floor-return-a-double Jul 29 16:29:20 Im having some problems with the boardconfig.mk .According to combined info given by df and cat /proc/partition, my #blocks is 7760896 and blksize is 4096 Of my SD-CARD which is 4 GBs* .But 7760896*4096 gives 31788630016 bytes which is about 29.60546875 GBs :P Jul 29 16:29:21 conversion to int and back to float would be inefficient Jul 29 16:29:22 ravilov: thats ja java convention Jul 29 16:29:39 hm, okay Jul 29 16:29:45 Also, double can be larger than int Jul 29 16:29:59 java NEVER does any type conversation in in-built methods that results in loss of accuracy Jul 29 16:30:05 danijoo, yeah I know, I was just wondering about the origins of that Jul 29 16:30:05 ravilov: Conversions between datatypes are not free. Jul 29 16:30:19 I guess I see the point now Jul 29 16:30:22 * autrilla wonders when we'll have an AndroidBot Jul 29 16:30:31 never Jul 29 16:31:20 g00s, but.. but.. Jul 29 16:31:22 * danijoo already waits for someone finding an exception to that rule. Jul 29 16:31:29 I keep having to tell people to google Jul 29 16:31:45 I just thought perhaps not the ONLY but surely the MAIN purpose would be to round to int, so logically speaking it didn't make sense Jul 29 16:32:02 thats not logically speaking. Jul 29 16:32:05 might as well define Math.round() to return a double too then Jul 29 16:32:20 yeah, that Math.round returning long is pretty odd in truth Jul 29 16:33:06 alankila: the most odd thing about Math.round is that it only returns a long if you give it a double Jul 29 16:33:09 there'd Math.rint() and Math.scalb() though Jul 29 16:33:15 if you give it a float, it will return an int Jul 29 16:33:16 alankila, to me it makes perfect sense, seeing that's how it workd in a lot of other popuuar languages out there Jul 29 16:33:23 well that is probably because of the 2^53 mantissa of doubles Jul 29 16:33:29 it needs more than 32 bits to return the result Jul 29 16:33:47 " java NEVER does any type conversation in in-built methods that results in loss of accuracy" - that's a fun statement considering that's exactly what a floor/ceiling operation does Jul 29 16:33:53 works* Jul 29 16:34:20 Syzygy: no. floor/ceil rounds. You shouldnt expect it to do conservations Jul 29 16:34:46 a decimal number is still a decimal number. If it has a zero after digit or not Jul 29 16:34:50 not saying that, I'm just saying that rounding is a loss of accuracy Jul 29 16:34:53 anyway you can calculate with doubles as if they were integers if you just take care to round after certain operations and keep the result smaller than abs(x) < 2^53 Jul 29 16:35:53 what's all this conservation conversation? Jul 29 16:36:05 you mean conversion conversation Jul 29 16:36:42 no conversions that use conservation... Jul 29 16:50:24 What's the R.id of the logo which is displayed in the action bar? Jul 29 16:51:25 waaaahhh Jul 29 16:52:10 wuuuuuuhh Jul 29 16:52:32 bdumdumdum Jul 29 16:52:36 asdfsadas Jul 29 16:52:39 :) Jul 29 16:52:56 You can change the icon ActionBar Jul 29 16:53:04 but you need the edit androidmanifest Jul 29 16:53:22 no, I mean the logo Jul 29 16:53:26 android:logo != android:icon Jul 29 16:53:33 I need to fetch the logo and remove the padding Jul 29 16:53:49 what logo? Jul 29 16:53:54 app icon ? Jul 29 16:54:12 getActionbar().setIcon(drawable) Jul 29 16:54:13 Jul 29 16:54:21 noo, not the Icon : ) Jul 29 16:54:34 what type of logo ? Jul 29 16:54:36 :) Jul 29 16:54:50 please share small code Jul 29 16:55:24 getActionBar().setLogo(drawable) Jul 29 16:55:29 there is no other logo in an activity.. Jul 29 16:56:05 http://stackoverflow.com/questions/6735649/android-icon-vs-logo Jul 29 16:56:41 platzhirsch: I think that has no ID Jul 29 16:56:46 Nooooo Jul 29 16:56:48 you can use a method to set it Jul 29 16:56:50 and thats all Jul 29 16:57:05 it's just a static asset and I don't need to set it, I need to get rid of this additional padding Jul 29 16:57:18 the action bar customizeability is a nightmare Jul 29 16:57:24 but thanks anyway Jul 29 16:57:41 write your own then :> Jul 29 16:57:48 its not that hard Jul 29 16:57:52 People went this road already Jul 29 16:58:00 yeah.. Jul 29 16:58:00 after all we had ABS Jul 29 16:58:15 R.I.P. Jul 29 17:01:05 Is it possible to insert something in AndroidManifest.xml using gradle? Jul 29 17:01:15 or generate a separate xml file Jul 29 17:01:40 JakeWharton: Skoal! Jul 29 17:16:16 Hi all! I am having a problem linking the NDK with Eclipse Juno. I try to follow the instructions but there is no place to set NDK's SDK. I downloaded a new ADT and NDK, it is a clean installation Jul 29 17:16:23 in a custom view, is there a easy way other than overriding onLayout to know if a layout as happend? Jul 29 17:19:21 :%s/NDK\'s SDK/NDK\'s path/g Jul 29 17:25:47 There's only one match in there, the g is unneeded. ^^ Jul 29 17:26:11 flan3002: you are right Jul 29 17:26:30 I don't use Eclipse though, so can't help... Jul 29 17:26:41 no prob Jul 29 17:27:35 funktronic, as with any other view, there's ViewTreeObserver Jul 29 17:27:48 Mavrik: yeah, i think that's what i gotta do Jul 29 17:29:46 Is there any great tool/lib you'd use for an Android project? Like Otto/Dagger/that kind of stuff, for example Jul 29 17:31:18 ahaha text to speech is so good :D Jul 29 17:31:37 especially if you change the pitch mid sentence Jul 29 17:32:08 If you want to confuse it, you can. Obvious thing is obvious... Jul 29 17:32:25 it's not getting confused, it just sounds hilarious Jul 29 17:33:06 Hi all! I am having a problem linking the NDK with Eclipse Juno. I try to follow the instructions but there is no place to set NDK's path. I downloaded a new ADT and NDK, it is a clean installation Jul 29 17:34:39 autrilla: Butter Knife Jul 29 17:35:20 JakeWharton, yep, great tool too. Any other suggestion? Jul 29 17:35:32 i'm far too biased for this question Jul 29 17:35:49 OkHttp+Retrofit+Picasso, of course! Jul 29 17:35:57 say("hello, I'm a fairy - you might ask") tts.setPitch(0.8); say("are you my fairy"); tts.setPitch(1.0); say("the answer to that is - yes"); Jul 29 17:36:00 I could ask this all day Jul 29 17:36:08 Every squareup lib! Jul 29 17:36:52 acuarium: http://tools.android.com/recent/usingthendkplugin ? Jul 29 17:37:17 Damn... 26 seconds of lag... :/ Jul 29 17:40:24 flan3002: all the tutorials I read have the same mistake Jul 29 17:40:46 It might be a mistake on your side... Jul 29 17:44:23 JakeWharton, have you ever done listview drag reordering? Jul 29 17:44:30 no Jul 29 17:44:48 :/ Jul 29 17:44:57 Sad Jul 29 17:45:05 not for me it isn't Jul 29 17:45:19 It is for me! Jul 29 17:45:21 listview drag reordering --> https://www.youtube.com/watch?v=_BZIvjMgH-Q Jul 29 17:45:48 lasserix, that code just allows for long-pressing on the cells Jul 29 17:45:58 No drag handler, worst design ever Jul 29 17:45:58 ah reordering Jul 29 17:46:01 Handle* Jul 29 17:46:09 it also reorders Jul 29 17:46:16 I know Jul 29 17:46:23 But it is not intuituve Jul 29 17:47:02 I think we've done it at some point Jul 29 17:48:00 I tried using the DevBytes code and use Otto instead of the OnItemLongPressListener, didn't work Jul 29 17:48:27 autrilla: "didn't work" is so broad Jul 29 17:48:27 Can't you build a drag handler around the code? Jul 29 17:48:44 it was fairly easily to implement for a gridview Jul 29 17:48:47 autrilla: the quality of answers to your questions is directly proportional to the quality of your questions Jul 29 17:49:40 lasserix: listview drag and drop is difficult Jul 29 17:54:15 when i press back in my app or remove it from recently used apps list, my app is destroyed without saving its state Jul 29 17:54:33 is there a way to prevent that? Jul 29 17:55:28 no. Jul 29 17:55:34 that's the default behaviour Jul 29 17:55:58 onDestroy(){ save your stuff here } Jul 29 17:56:15 there's also onBackPressed Jul 29 17:56:40 funktronic, didn't work means I didn't reorder or did anything Jul 29 17:56:41 or just save your stuff as you go Jul 29 17:56:47 so you don't randomly lose users data Jul 29 17:57:12 uhm. bu-u-u-ut.. my app survives practically everything, including being killed by the system if there's no more memory Jul 29 17:57:42 lasserix, that's exactly what I tried... Jul 29 17:57:46 it's connected to the service so it makes sense to save its state on back press and such Jul 29 17:57:52 http://stackoverflow.com/questions/23710029/reorderable-listview-via-drag-and-drop Jul 29 17:58:53 wait what Jul 29 17:59:02 "survives being killed if there's no memory?" O.o Jul 29 18:00:24 nothing survives being killed Jul 29 18:00:29 if device runs out of memory it will silently kill your application Jul 29 18:01:33 save your stuff in onpause Jul 29 18:01:36 not ondestroy Jul 29 18:01:45 use a boolean to know if anything changed Jul 29 18:02:03 or, again, save your state as it changes. Jul 29 18:02:06 i save my stuff in PagerAdapter Jul 29 18:02:29 mavrik: if you do that, depending on how long it takes make sure to offload it Jul 29 18:02:44 lasserix, do what? Jul 29 18:02:52 save your stuff per change Jul 29 18:02:58 Mavrik, you would also save the current "page" the use is at? Jul 29 18:03:06 autrilla, yes. Jul 29 18:03:16 user* Jul 29 18:03:17 but the system doesn't adapter's call restoreState() when app is relaunched Jul 29 18:03:24 also, that is not an information that has to survive OOM case is it? Jul 29 18:03:28 Hm, fair enough. Where exactly? Sharedprefs? Jul 29 18:03:42 autrilla, wherever the data requires Jul 29 18:03:51 autrilla, we are talking about data that MUST survive OOM condition right? Jul 29 18:03:55 not random UI crap that can be lost? Jul 29 18:04:07 Mavrik, the "page" the user is at is random UI crap Jul 29 18:04:17 Like if he's in a certain menu of the app Jul 29 18:04:21 then there's no point in trying to save it in those conditions? Jul 29 18:04:43 Mavrik, my question probably has nothing to do with squirrel's Jul 29 18:05:11 anyways, the system DOES save the state Jul 29 18:05:15 Probably not. Because for most UX cases persisting UX stuff doesn't make sense. Jul 29 18:05:17 the problem is with restoring Jul 29 18:05:38 Especially since Android manages tasks pretty well and users are rather confused when apps "stick" to wrong states. Jul 29 18:06:07 E.g. if you restart app after a long time you expect it to be in "vanilla" state not like you left it three days ago - that's why you have the task-based API Jul 29 18:06:31 Mavrik, what if you change app? Jul 29 18:06:44 And it doesn't get killed, but destroyed or whatever it was called Jul 29 18:07:10 ? Jul 29 18:07:14 state is retained. Jul 29 18:07:17 It is? Jul 29 18:07:40 autrilla, are you trolling me? Jul 29 18:08:00 Nope Jul 29 18:08:03 autrilia, are you actually resolving a problem you've faced or your trying to solve a hypothetical problem? Jul 29 18:08:12 A problem I've faced Jul 29 18:08:18 I know you can persist fragment content Jul 29 18:08:23 What is this problem? Jul 29 18:08:33 setRetainInstanceState or something similar to that Jul 29 18:08:46 lasserix, retaining application state Jul 29 18:08:57 onSaveInstanceState for most items, including custom vies Jul 29 18:08:59 if a user clicks the back button, it means they quit from the app, which means the next time the app starts it should start fresh Jul 29 18:08:59 *views Jul 29 18:09:24 lasserix, in my case I used ActionBar dropdown navigation Jul 29 18:09:43 when you click home and come back did it reset your ui? Jul 29 18:10:03 then you need to figure out what you're not doing: adding fragments to backstack or whatever Jul 29 18:10:05 lasserix: if user presses home button, he also leaves the app, but it doesn't start fresh Jul 29 18:10:12 it shouldn't Jul 29 18:10:16 home = minimize Jul 29 18:10:21 back = quit Jul 29 18:10:38 home + swipe off recents = quit Jul 29 18:11:11 there is a specific call back you are looking for in the case of OOM kill Jul 29 18:11:36 when your app is using background processes, back and swipe off recent != quit Jul 29 18:12:06 it doesn't try to kill it? Jul 29 18:12:28 I'm not entirely sure if dropdown navigation is a good design pattern Jul 29 18:12:33 it's weird. setPitch doesn't seem to have much effect on googles default TTS engine. can't you adjust the pitch dynamically or are there only 3 pitch options? Jul 29 18:12:37 ie if you have a thread going, and check isInterrupted, its supposed to be interrupted at that point? Jul 29 18:12:44 anything from 1-1.9 sounds the same Jul 29 18:13:03 eh Jul 29 18:13:29 autrilla: the case of the OS killing your activity and you want it to go back to the UI it was at when it was killed --> onRestoreInstanceState Jul 29 18:13:36 I'm trying to parse xml with XmlPullParser and I have a tag why is it that after calling parser.require(...) the method parser.getEventType() is TEXT ? Jul 29 18:13:40 Hi, I'm working on an native Android application in which I render a 3D scene using EGL/GLESv2. The rendering setup works, except that I don't see anything on screen. When I grab a GLTrace, I can see that the graphics are properly rendered into the frame. The screen on the tablet (Samsung Galaxy Note 10.1 2014) is black. If I have an error window on the top, before I launch the application from the Eclipse, it starts to render corre Jul 29 18:14:33 I wonder what the best way it with L Jul 29 18:14:33 I suppose there's a problem in how the SurfaceFlinger composites different layers or how the swapBuffers behaves Jul 29 18:16:29 why is it setPitch(float) when there are only 3 pitch options anyway... <1 , 1-2, 2< Jul 29 18:21:05 Syzygy: without knowing anything at all what youre talking to 1-2 sounds like it leaves room for 1.5 etc Jul 29 18:21:30 Anyone know if using top from adb shell canbe filtered byprocess name? Jul 29 18:21:58 jesperj, technically it does. but anything between 1.0 and 1.9 results in the same pitch (for androids default TTS engine) Jul 29 18:22:03 lasserix: using grep ? Jul 29 18:22:42 Syzygy: sounds strange indeed Jul 29 18:22:49 mkdk: heh i tried it yesterday did not work, tried it again and it did work ;p Jul 29 18:23:09 lasserix: Great ! :) Jul 29 18:26:24 I had a strange thing happening with a avd that it couldnt save to sdcard even though i had it setup. ever happened to you guys? Jul 29 18:26:39 jesperj: sometimes you have to mount it before you can use it Jul 29 18:26:40 deleting it and recreating a similar one and it worked fine Jul 29 18:27:03 mkdk: oh... hmm Jul 29 18:27:33 jesperj: my other guess is that if you have killed AVD without shutting it down properly, it could have corrupted the sdcard image (?) Jul 29 18:27:44 apart from pressing back and removing the application from recent list, are there any other ways to “quit” the application? Jul 29 18:28:03 squirrel: yes, you can kill it through DDMS Jul 29 18:28:12 mkdk: well maybe. all i know is that it didnt show as needing repairing and stopping it and starting it again didnt solve the problem Jul 29 18:28:16 squirrel: or you can go to the application manager, click on the app and then quit the process Jul 29 18:28:17 mkdk: i mean, properly quit Jul 29 18:28:38 squirrel: Ah, sorry, then I don't know Jul 29 18:30:11 jesperj: Perhaps next time it happens, you can try to mount it manually using mount command; as explained here : http://stackoverflow.com/a/10681133 Jul 29 18:30:43 jesperj: if it doesn't work, mount can give you some kind of information what it is, or you can keep the image, create a new one and compare the two to see what is the difference Jul 29 18:34:00 mkdk: thank you :) Jul 29 18:34:22 jesperj: No problem; I hope it helps :) Jul 29 18:35:58 capella manning has 'FireFoxOS in Action" :O Jul 29 18:36:29 ? Jul 29 18:37:17 of whom is this manning which you speak? Jul 29 18:39:00 capella http://www.manning.com/jongboom/ Jul 29 18:40:06 ah :) Jul 29 18:43:03 mkdk you making a game? Jul 29 18:43:53 lasserix: no, it's an application for rendering specific 3D geometry Jul 29 18:44:07 lasserix: Not for playing, but for playful-working :) Jul 29 18:45:04 eucleadian or non-eucleadian? ;p Jul 29 18:47:34 lasserix: euclidean ;) The geometry is an actual real-world object Jul 29 18:47:50 hmm, is CheckboxPreference deprecated or something? Jul 29 18:48:52 oh cool Jul 29 18:49:04 getting ready for tango Jul 29 18:50:17 what's that ? Jul 29 18:50:31 https://www.google.com/atap/projecttango/#project Jul 29 18:51:27 lasserix: you might also like : http://www.youtube.com/watch?v=6br7NreTwD4 Jul 29 18:52:51 so I've got a -sw320dp folder and a -sw320dp-xhdpi folder. im creating a nexus one emulator, which is hdpi. it still uses the -sw320dp-xhdpi folder though. any ideas why? Jul 29 18:55:06 Ahh yeah Jul 29 18:55:21 just cant wait till can stick it into contact lenses Jul 29 18:56:11 mattblang: Drawables can be scaled from other densities at runtime if none is provided for the devices density Jul 29 18:56:56 SimonVT well, for drawables it should go down a folder not up right? actually its not a drawable, its a values folder. Jul 29 18:57:36 SimonVT im specifying a width and height of something in dimens.xml. but this emulator, which says hdpi, is definitely pulling the value from the -sw320dp-xhdpi values folder Jul 29 18:58:17 lasserix: You might be actually already wearing something like that without knowing about it :) http://www.youtube.com/watch?v=5ZsDDseI5QI Jul 29 18:59:29 Seems strange to have different widths and height based on density Jul 29 19:01:20 SimonVT yeah, I would like to do it differently but am not sure how. the problem is that a lot of the ICS era phones, like the Nexus One, show a cut off screen because I was considering stuff like the Nexus 4 when I designed for -sw320dp. so I thought maybe qualifying by density might be a way to solve the problem Jul 29 19:01:57 SimonVT so then all the ICS era phones could pull from sw320dp, while the Nexus 4 and more modern ones would pull from sw320dp-xhdpi. Jul 29 19:02:47 Sounds like you're just doing layouts wrong Jul 29 19:03:36 SimonVT my current method is to create one layout for portrait, but abstract some things like text size and heights to dimens.xml, which I use values-qualifier folders Jul 29 19:04:25 SimonVT I thought I was on the right track there, but would definitely love any suggestions if I am not doing it correctly Jul 29 19:07:24 Depends what you're trying to achieve Jul 29 19:08:14 I'm using proguard but getting more than a 1000 warnings, which then leads to an IOException error Jul 29 19:08:25 so I tried fixing all the warnings with -dontwarn Jul 29 19:08:30 but they don't go away Jul 29 19:08:37 I've added: Jul 29 19:09:02 -dontwarn javax.annotation.** to my proguard-android.txt file Jul 29 19:09:09 with no impact at all Jul 29 19:09:15 any idea what I might be doing wrong? Jul 29 19:11:28 SimonVT here is what I am trying to do. this is the only page where it really matters, because I have lots of labels, and the buttons themselves are Linear Layouts Jul 29 19:11:30 SimonVT http://i.imgur.com/E4rLlpZ.png Jul 29 19:13:06 Put it in a scrollview, problem solved Jul 29 19:13:42 SimonVT yeah, I'm probably going to do that. it is still weird that this emulator is pulling from XHDPI though. Jul 29 19:14:02 SimonVT regardless of my problem. though im reading some other people who have seen the same behavior Jul 29 19:14:37 Your -sw320dp-xhdpi thing wouldn't fix it anyway.. You'd just get a user with a nexus one sized device with an xhdpi device Jul 29 19:14:42 display Jul 29 19:14:52 adb shell getprop qemu.sf.lcd_density ? Jul 29 19:14:59 what's that say? Jul 29 19:16:24 SimonVT let's say I wanted to fix this without going the ScrollView route. what do you think would be the best way Jul 29 19:16:39 Guess the note in the documentation applies everywhere: Note: Using a density qualifier does not imply that the resources are only for screens of that density Jul 29 19:17:13 how I can find my device id? Jul 29 19:17:27 You'd either provide different layouts for different screen sizes, or make a viewgroup that layouts the views the way you want Jul 29 19:17:42 or to be precise print it on Windows when my phone is plugged... Jul 29 19:18:14 SimonVT but with the layouts for different screen sizes, am I not in the same boat I am currently in? Jul 29 19:19:15 No? Nexus one doesn't have the same screen size as nexus 4 Jul 29 19:19:22 You're trying to do it based on density Jul 29 19:19:29 Do it based on screen size Jul 29 19:20:30 SimonVT so maybe have a sw-320 and a sw-360 folder possibly? Jul 29 19:21:12 You could probably do that Jul 29 19:21:19 You just have to make sure it actually fits on a 320dp device Jul 29 19:21:32 mrpyo, adb devices maybe? Jul 29 19:21:36 And use gravity or something to make it pretty on 359dp devices Jul 29 19:21:47 SimonVT got ya. thanks man Jul 29 19:22:13 Everyone else just uses scrollview :) Jul 29 19:22:37 SimonVT honestly, ill probably just do that haha. I was mainly just curious Jul 29 19:23:00 http://stackoverflow.com/questions/25006099/issue-with-going-to-app-when-browsing-to-a-url can aony help me? Jul 29 19:26:06 iffa: the browser doesn't send out intents about every web address you open in it (not that I have checked, but if it does, I'm never browsing anything on my phone ever again) Jul 29 19:26:30 I'm pretty sure it does? Jul 29 19:26:34 at least almost Jul 29 19:27:41 I'm pretty sure it doesn't, because that would openly broadcast your entire browsing history to every app on your phone. What makes you think it does? Jul 29 19:31:26 Currently working on properly parsing the responses from my server's REST api into POJOs. Some objects however are being sideloaded while being referenced by ids, like so: http://paste.kde.org/pcjkujzgz Jul 29 19:31:26 Do you guys know how to tell Jackson/GSON to follow the id in the JSON's "chartItems" array and properly construct and fill my "Chart"-Object? Jul 29 19:31:47 do I have to manually implement this with a custom deserializer? Jul 29 19:32:09 or is there already some library or jackson/GSON plugin out there which does the work for me? Jul 29 19:34:17 JakeWharton, I never remember this: on what build.gradle should Otto, ButterKnife etc be placed for gradle, and where in it exactly? There's usually more that one dependencies {} Jul 29 19:34:37 the one for the app Jul 29 19:34:44 or whatever module you are using it in Jul 29 19:36:36 JakeWharton, you missed Timber btw! Jul 29 19:36:46 And/or hugo Jul 29 19:36:52 there's many more than that Jul 29 19:37:24 JakeWharton, such as? Jul 29 19:37:30 Those libs are always useful Jul 29 19:38:34 Dagger, RxJava, @AutoValue, @AutoParcel, Gson, Wire, a slew of testing-related libraries Jul 29 19:43:39 JakeWharton was looking at bread crumb libs the other day. HanselAndGretal, clever clever Jul 29 19:43:58 fragment bread crumbs are thankfully deprecated Jul 29 19:44:16 pretty sure no one ever used them except the settings app (briefly) Jul 29 19:44:42 JakeWharton yeah I decided against using them. I did love the name of that lib though, haha Jul 29 19:48:21 How can I make a test using android test framework wait (like Thread.sleep()) Jul 29 19:49:23 whats the approach you favour for doing something every X seconds on the current thread (just store some transient variable values) Jul 29 19:50:37 rgr handler, sendMessageAtTime with some correction (subtraction of previous work time) Jul 29 19:50:50 or just sendMessageDelayed :) Jul 29 19:51:08 don't forget to remove all pending messages in onStop() or whatever Jul 29 19:52:26 thanks Jul 29 19:53:45 gah. I'm all ocver the place with my runnables, threads, handlers.... fucking hell it can get messy. excuse my french. Jul 29 19:54:30 I have a fragment being used in two activities, the fragment attaches a subview whenever it is instantiated, and I get a small flicker of this view expanding .. can anybody point me at some techniques to make the transition a little more smooth? Jul 29 19:55:39 All of my data comes from a rest API. I'd like to preload some data so that the app is usable without networking. How should I store the preloaded data? Jul 29 19:56:59 tubaman i have seen 2 ways; ship preloaded data in sqlite in assets; and (2) include the textual json in assets, and just parse / read that instead of from http Jul 29 19:57:21 so the parser for json reads from http or file Jul 29 19:57:46 g00s: thx Jul 29 19:59:46 Why does the android test frame work cause my activity to go through multiple life cycles if i only have one test? Jul 29 20:00:22 i am using singlelaunchtestcase, oncreate is called only once, but onResume/Start and onPause/Stop is called twice even though I only have one test Jul 29 20:02:04 g00s: without a lot of work I dont see I can use your idea since the thread I wish to "do something" every X seconds is a rendering thread run() loop which just repeats drawing frames and doesnt feature a message queue or looper. Or? Jul 29 20:03:06 rgr: you making a live wall paper? Jul 29 20:03:23 no. Jul 29 20:03:47 game? Jul 29 20:04:57 a common technique is to measure the time it took to render, sleep in the while for the difference between you're target frame rate and the actual render time Jul 29 20:05:46 if you have physics or some other stuff that is also computationally intensive, you can incorporate this in various ways, depending on what you need out of your update/rendering Jul 29 20:06:27 http://gafferongames.com/game-physics/fix-your-timestep/ http://www.koonsolo.com/news/dewitters-gameloop/ --> they also apply to non-games, if you have simulation to base your rendering off Jul 29 20:06:45 please. Jul 29 20:06:58 ? Jul 29 20:14:30 anyways if you want you can associate a looper with a thread and enable message passing by handlers Jul 29 20:14:41 yes.. Jul 29 20:15:04 How I get data outsite a runnable thread? Jul 29 20:15:06 I'm just reading the meterial design spec... seems like half the components described do not readily exist in Android ? Jul 29 20:15:10 what am I missing? Jul 29 20:15:54 TylerDurden36: one way is to make a class implementing runnable then you pass a ref to whatever data you need in the constructor, just don't leak context Jul 29 20:23:25 Does anyone have knowledge using openfire and (a)smack for android? Jul 29 20:28:12 can i get some UI feedback from you guys? :) http://i.imgur.com/3tI6Fsc.png & http://i.imgur.com/UQbdhK0.png Jul 29 20:34:20 Make each list element somewhat taller, a little spacing isn't dangerous Jul 29 20:35:03 How can I stop the socket checking for loop from quitting prematurely? http://pastie.org/private/qsb6wsgucaa40ysmyjda Jul 29 20:35:28 Thorbear: any other suggestions on what to do with the list? It doesn't fit the rest of the app IMO :/ and thanks for the suggestion! Jul 29 20:35:50 Trying to get PNG icons for KitKat apps. Need them for a project. Anyone have a link to where I could find a collection of them? (I haven't had much luck) Jul 29 20:40:06 iffa: you could have the titles and subtitles in different colors/intensities, and anything you could do to reduce the amount of useless text would probably look better (do you need the whole urls? Could you use metadata instead of filenames?) Jul 29 20:40:07 My flipping god, the ammount of needless complexity to do even the most basic stuff in java is ridiculous Jul 29 20:40:26 Programming in java should be a crime against humanity Jul 29 20:40:58 As opposed to what? Attempting to write anything crossplatform and multithreaded in C ? Jul 29 20:41:16 Thorbear: I would love to include information like file size in there, but I don't know how to parse that from the HTML :/ Jul 29 20:41:29 and doing that for each search result would make it so slow Jul 29 20:42:46 iffa: I'm just saying, anything that reduces the amount of text on each item would be good, especially while you still have several items that end with "..." Jul 29 20:42:49 iffa if you can set up a server, parse it there Jul 29 20:43:54 yeah.. I don't have the resources to set up a complicated system that will do all this parsing and stuff, I'll get that URl out of there though, the user probably wont care about it Jul 29 20:46:55 iffa, you need to add more spacing to your elements Jul 29 20:47:13 it'll instantly look way better Jul 29 20:47:28 thanks Mavrik Jul 29 20:47:36 iffa, see this: https://developer.android.com/design/style/metrics-grids.html Jul 29 20:48:48 ill get to work on that :) Jul 29 20:59:03 Chainfire yeah i was confused about that too ... i was planning to wait until good docs & stuff was out of preview ;) Jul 29 20:59:33 i'm glad they previewed it, that way the experts can figure it out and explain it when its available for real :D Jul 29 20:59:47 meanwhile i can do other stuff ;) Jul 29 21:03:38 which spec? Jul 29 21:04:16 Mavrik Chainfire was looking at the Material spec / design guidelines Jul 29 21:04:40 yeah which ones? the Android ones or the web ones? Jul 29 21:07:10 here they say the reddit app is getting Material makeover http://www.androidpolice.com/page/3/ Jul 29 21:07:25 when i watch the video, it looks like the same old stuff tho maybe i'm missing something Jul 29 21:07:32 except for the FAB Jul 29 21:07:41 and dissapearing AB Jul 29 21:09:05 interesting rumor "For those wondering what the hell happened to Android Silver, well, it appears that the recent departure of Google’s Chief Business Officer Nikesh Arora — the man spearheading the project — may have caused the Android Silver initiative to be scrapped altogether" Jul 29 21:09:52 https://twitter.com/RyanWhitwam/statuses/482694983804153856 <--- ahahahahaha Jul 29 21:13:11 next nexus sounds big (phablet) Jul 29 21:13:43 i'll grab a lumia 530 no thanks :) Jul 29 21:14:36 Hello! Iam trying to lern how to make an app. But I have a problem :/ When I test run the app one of the layouts seems be bigger then the screen. When the keybord appers it covers the buttons and Edit Text. :( Jul 29 21:15:19 that are in bottom of the layout Jul 29 21:15:49 that's normal :) Jul 29 21:18:32 Yeah. But when i want to write something in that "Edit Text Field" i cant see what im writning xD Jul 29 21:19:59 trying to get proguard working, but since my project uses dagger and this issue https://github.com/square/dagger/issues/202 remains open, does that mean that I'll either have to give up dagger or proguard? Jul 29 21:22:12 i vote proguard Jul 29 21:22:16 (to give up) Jul 29 21:26:04 JakeWharton: I need to get around the 65k method limit Jul 29 21:26:16 since I've added a library that is huge Jul 29 21:26:35 Can someone take a look at http://paste.ubuntu.com/7898422/ I have the question also in there because it was a little big. I'm having trouble working with the viewpager fragments Jul 29 21:26:37 then just don't obfuscate Jul 29 21:26:59 what library? scala ? :D Jul 29 21:27:30 gavri: Dynamic dex loading. Have fun. :) Jul 29 21:28:04 JakeWharton: but wouldn't just dropping methods be a problem too? Jul 29 21:28:09 flan3002: what do you mean? Jul 29 21:28:31 well, remember, obfuscation doesn't do that much ;) Jul 29 21:29:23 You want more methods? Have more dex files! :) Jul 29 21:31:05 feels like a waste to have to distribute the code of all those methods that never get called. isn't using proguard a good idea? Jul 29 21:31:44 If you can use it, sure, but it can't strip away infinitely much. Well, it can, but then your app will crash. ^^ Jul 29 21:52:13 need a helpful push. blind to the woods and the trees at the moment. I have in various places in some runnables a reference to the handler for the mainthread. erm, how do I plumb into that back in the mainactivity to process messages my runnables/threads post back to the main handler? Jul 29 21:54:37 Hi fellows, What might be the best api displaying and annotating pdf on android? Jul 29 21:55:13 I would like to load a pdf in a view, apply a signiture and the save the pdf to disk Jul 29 21:55:42 Any straight foward way of acheiving this functionality Jul 29 21:57:22 Out of 416 people no one has a though? Jul 29 21:57:27 lol Jul 29 21:57:32 :) Jul 29 21:58:41 rgr: rxjava Jul 29 22:01:55 is there a good place to find javadocs (gradledocs?) for the android gradle plugin? Jul 29 22:11:26 the issue where Im getting confused is how to pass the mainqueue handler or whatever I need to do so that I can handle the receipt of messages in the mainactivity class java and not in an anonymous Handler constructed in the constructor of a customer view. I want that handling code back in the mainactivity. If that makes any sense.... probably not, as I'm in non compile hell at the moment after a few too many liberal restructurings... Jul 29 22:11:54 rgr I still don't understand the question Jul 29 22:12:29 an anonymous handler constructed in a view's constructor runs on the main thread Jul 29 22:12:42 so any runnable you apss that will run on the main thread ... Jul 29 22:13:07 usually creating the handler on the ui thread will associate its looper to the main looper Jul 29 22:13:18 or you can do Handler h = new Handler(Looper.getMainLooper()) Jul 29 22:13:18 if you have a reference to an Activity, you can use "runOnUiThread()" call instead Jul 29 22:13:54 he's trying to set up a render loop Jul 29 22:14:10 lasserix: no Im not. please please stop second guessing. it doesnt help. thats all done. Jul 29 22:14:29 sorry you were earlier Jul 29 22:14:31 Chainfire: I need to better formulate my problem. Jul 29 22:14:49 no I wasnt. The Q was linked to it being used from a render loop. Jul 29 22:14:49 anyways like i said you can do Handler h = new Handler(Looper.getMainLooper()) to make that handler callback on the main/ui thread Jul 29 22:15:22 Ill look at that. thanks. It may be linked. Jul 29 22:15:27 rgr, runInUiThread(Runnable run) Jul 29 22:15:45 its nothing to do with runnables. Jul 29 22:16:03 Hi, i am using the Input.gyro. What i see is that there is an obvious lag/"lock" on one device (note 3) but not on the other (nexus 7). What can this be? Jul 29 22:16:23 rgr, try explaining the situation, then :) Jul 29 22:16:46 yes. I need to take a break. I'm mutlithreading in my brain and cant think straight.... Jul 29 22:16:51 ;) Jul 29 22:17:50 Thread.wait() :p Jul 29 22:17:58 er, Object.wait() Jul 29 22:18:02 or something Jul 29 22:18:13 anyone played with ConfirmationActivity in the wearable support lib? Jul 29 22:18:18 but still, I bet your answer is a Runnable to throw to runOnUiThread() which receives some 'final' variables it then passes to a method of MainActivity you write :P Jul 29 22:18:25 I like the success animation but failure animation sucks :/ Jul 29 22:19:57 Chainfire: yeah, it all comes down to design patterns. Jul 29 22:21:41 I don't think that's actually a design pattern. Then again, most design patterns seem to be no more than formal write ups about how most people with some sense would solve problem X Jul 29 22:22:05 ok. right. in my runnable I maintain a handler which points to the mainUIthread handler. It really is as simple as this : how do I receive and process the messages I send on that handler using handler.sendMessage *back in the main activity class*. Is all I need to do create a new handler in the main thread? Jul 29 22:22:35 I wouldnt say "some sense" look how OO has gone from isA to containsA for example. Things change over time and the APIs dominate the design principles. Jul 29 22:23:03 s/main thread/main acitivity Jul 29 22:26:03 those discussions are beyond my intelligence, let us focus on the matter at hand Jul 29 22:26:21 why are you maintaining a handler inside your runnable? Jul 29 22:26:31 is there some code you can paste? is the runnable run by a thread, or by the main thread? Jul 29 22:27:12 is MediaPlayer async? Jul 29 22:27:46 Hey, I need some iOS advice actually, does anyone have a minute for a private msg? Jul 29 22:28:58 because an android channel is clearly the best place to ask for ios advice :) Jul 29 22:29:04 I maintain a handler in my runnable so that I can handler.sendMessage(msg) back from the work loop. I want to handle that message back in the mainactivity class. Does that in itself sound wrong? Because if so I've seriously misunderstood something. e.g I want to send back a message containing the current framerate and have the mainactivity decide where to display that on standard textviews. Jul 29 22:29:41 (this is going to be something so trivial I'm going to cry I know it....) Jul 29 22:30:10 rgr the runnable doesn't need a handler for that Jul 29 22:30:18 rgr: you declare the handler in mainactivity, you pass a ref to your runnable if thats how you want to do it Jul 29 22:30:55 you can optionally make the handler static and use a weak reference (in your main) then you can send messages from your runnable without a field reference to the handler Jul 29 22:31:38 *use a weak reference from to your mainactivity inside your handler (if you define the handler in the mainactivity as a static nested, if it's top level no worries) Jul 29 22:32:05 you (a) create a handler in MainActivity and reference that from your (threaded?) runnable to postMessage, and override the handleMessage method, or (b) use runOnUiThread (from Activity), which posts a Runnable on the main thread's looper, which in turn calls your MainActivity method Jul 29 22:32:09 Chainfire: the runnable and the handler in the worker thread isnt the issue. The Q is how I plug in in MainActivity to monitor the messages sent back. Jul 29 22:32:23 I personally always use method (b), let me just pastebin you an example Jul 29 22:32:39 right. let me double check. Im not that far from that. It might be some silly typo. Jul 29 22:33:10 Thanks google, for not obfuscating the wearable support library! Jul 29 22:33:17 Finally, a failure animation that makes sense Jul 29 22:35:56 but remember I'm constructing the runnable in a custom view constructor. and runonuithread is exactly what I dont want since it *has the processing code in the function in the runnable its called with*.. I want that code back in the mainactivity - not in the runnable which should only be sending a message back to "do X please". Jul 29 22:36:31 ack. I'll wear your patience. I'll take a break and revisit it. Jul 29 22:37:03 rgr android spices up any concurrency situation ;) Jul 29 22:37:05 rgr I don't understand why you don't want that Jul 29 22:37:31 because you depend on runOnUiThread() and rather depend on a passed Handler ? Jul 29 22:37:37 or...? Jul 29 22:38:17 Chainfire, does runOnUiThread work with a handler behind the scenes? Jul 29 22:38:40 Afzal I'm pretty sure it just uses a private Handler somewhere, yes Jul 29 22:38:47 lol cool Jul 29 22:38:49 you could loook it up in the source if curious Jul 29 22:38:54 yeah googling Jul 29 22:39:26 Chainfire, yup, private handler indeed. http://grepcode.com/file/repository.grepcode.com/java/ext/com.google.android/android/2.1_r2/android/app/Activity.java#Activity.runOnUiThread%28java.lang.Runnable%29 Jul 29 22:40:01 rgr - why is this not good for you? http://pastebin.com/nQh7fEkC Jul 29 22:40:25 because once again : runonuithread requires I put the *processing* into the constructed object I pass to it. ALL I want to do is pass a MESSAGE back : and the mainactivity code then processes that message and uses code in that class. I dont want to be accessign mainactivity views etc from my workter thread. That makes sense to me. Jul 29 22:40:57 I don't understand what processing is done in the constructed object... Jul 29 22:41:04 see the pastebin, it only calls one method Jul 29 22:41:07 and, its in a custom view.... Jul 29 22:41:08 storing references to activities is not a good idea anyway :) Jul 29 22:41:39 ? Im not. Jul 29 22:41:54 see ya. lots to think about. Jul 29 22:42:11 I guess I really don't understand the problem Jul 29 22:42:25 Afzal true that, though Jul 29 22:42:50 should probably be a weakreference Jul 29 22:42:54 or something like that Jul 29 22:45:34 rgr, you using a service or something? Jul 29 22:46:33 Now I think about it, I think he doesn't get that a Runnable's onRun isn't called in the thread context of the caller Jul 29 22:47:09 he left, btw Jul 29 22:53:16 oh lol Jul 29 23:02:40 Hi all, how to know if service started on startup through startService is still running? Jul 29 23:22:33 scra Jul 29 23:25:42 Chainfire: still there? I go it working the way "I wanted". I would appreciate you looking and then saying why this is wrong or right. The first gist shows the methods on the mainactivity in the main "HoneyBeez" class. A function to process incoming messages and one to do something with one specific message. https://gist.github.com/anonymous/321ebb7379a2729a4c86 Jul 29 23:26:29 The second shows the creation of a handler in my runnable which is accessible form my work thread : https://gist.github.com/anonymous/af1c4dcfc5b7bddb82bb Jul 29 23:27:12 and the final one shows me sending a msg back to the main activity function shown in the first gist. https://gist.github.com/anonymous/5a406e3145874061a335 Jul 29 23:31:16 aye Jul 29 23:31:43 random question, did anyone else think at Google I/O that they were talking about a screen that could change shape? Jul 29 23:31:49 (for a brief while) Jul 29 23:33:17 rgr> (2) is meant: in the constructor of your view? Jul 29 23:33:29 the structure of that "makes sense" to me but Im new to handlers. Only just really getting it. But that works and allows me to keep my message handling code back in the class it belongs and not in the custom view class code which, for me, is clean. Jul 29 23:33:35 hang on Jul 29 23:34:41 no. in the runnable constructor which contains the run method which does the "work". Jul 29 23:34:52 where is the runnable constructed? Jul 29 23:35:08 to be more clear, the Handler needs to be constructed on the main thread for this to work Jul 29 23:35:14 the view's constructor runs on the main thread Jul 29 23:35:22 in the constructor of the view : thus still on the main thread. Jul 29 23:35:25 alternatively, you need to pass the Handler the main looper Jul 29 23:35:28 ah ok Jul 29 23:35:28 (it does work) Jul 29 23:35:34 well then I certainly see this doing what you want, yes Jul 29 23:35:38 a few comments: Jul 29 23:35:52 I do appreciate your help. I might have sounded ungrateful - I wasnt. I was just panicking and not seeing things. Jul 29 23:36:15 - I guess the activity should implement a callback interface that you pass to the custom view, instead of casting to (HoneyBeez) and calling a pre-set method Jul 29 23:36:20 and am super super tired. Jul 29 23:36:48 - in displayFrameRate, cache both findViewById and getString calls, both are considered slow Jul 29 23:37:05 Chainfire: how do I pass that to the customview? Jul 29 23:37:32 (re cache : sure, I always do - but am at "test" zone re:handlers) Jul 29 23:37:56 oh no worries about that, there was just a slight misunderstanding in how it works. Handlers and Runnables can be a bit confusing first you use them, but once you grasp the concept ... :) Jul 29 23:38:22 so can you elaborate on your comment about a callback interface please? Im not sure I get it. Jul 29 23:38:36 are you declaring the custom view in XML or in code? in XML is more difficult Jul 29 23:38:47 code. Jul 29 23:39:02 obviously the code class is referenced in the layout xml. Jul 29 23:39:22 well then your custom view can implement a setOnFrameRateListner(CustomView.OnFrameRateListener onFrameRateListener) call Jul 29 23:39:41 OR, you can check first if context instanceof CustomView.OnFrameRateListener Jul 29 23:39:43 or whatever Jul 29 23:40:00 forget about frame rate : that is only "one function". Or did I misunderstand : wwere you just making up a name to match my sample? Jul 29 23:40:05 its not strictly necessary if you don't want to re-use that view Jul 29 23:40:15 yes Jul 29 23:40:50 I would move the processIncomingMessages call's contents to your custom view Jul 29 23:41:07 and have them call methods of an interface Jul 29 23:41:38 no. that would be dumb i think. because the custom view isnt the main acitivity which has a better idea what views to display status data on. Jul 29 23:42:06 those messages are telling the mainactivity "do something with this date". The custom view doesnt need to know what. Jul 29 23:42:10 data Jul 29 23:42:36 the customview already knows about the data, its sending it Jul 29 23:42:42 it would make your activity class cleaner Jul 29 23:42:50 but I'm not sure you actually understand what I'm saying Jul 29 23:42:53 it knows about the *data*. it doesnt know or need to know how its display. Jul 29 23:43:00 and it still doesn't Jul 29 23:43:04 the main activity decides that. Jul 29 23:43:24 that's why I want the process code in the main class. Jul 29 23:43:41 displayFrameRate would still be in your main class Jul 29 23:43:57 I'd type you up the example of what I mean but tbh I'm too tired myself and heading off Jul 29 23:44:15 its a standard-ish pattern Jul 29 23:44:44 but called from the runnable which doesnt and shouldnt care about what the function is called or what it does. Unless these custom callback interfaces you mentioned come into play here. Im not sure. Jul 29 23:44:54 thansk anyway. much appreciated. Jul 29 23:44:55 night. Jul 29 23:45:15 yes, they would Jul 29 23:45:20 ask me tomorrow if still interested then :P Jul 29 23:45:34 I will do and I am. Ive crossed a river today. Jul 29 23:49:16 If the MainActivity implements FrameRateListener and you are inflating customview from xml, you can cast the context passed as your FrameRateListener and since it'll be the mainactivity, you can hook the callback this way. Jul 29 23:53:42 working on writing my own custom deserializer in jackson. I am using this deserializer for specific properties. the problem is, that I need the complete tree in my "deserialize"-method rathern than just the sub-tree for the annotated property. any idea how to achieve this? Jul 29 23:54:44 or do I really have to manually parse the complete json in order to achieve this? Jul 29 23:55:03 I just want to insert my own parsing logic for certain properties :S Jul 29 23:57:18 Anyone work with a library project that needed access to the non-library database? Jul 30 00:06:03 I had forgotten how much boilerplate code ContentProviders had :/ Jul 30 00:07:26 Afzal truth Jul 30 00:08:11 shipit, almost used SimonVT's library last night but now that it's written, it'll remain there for eternity (or until I add another table) Jul 30 00:08:27 hm, don't know this library Jul 30 00:08:36 https://github.com/SimonVT/schematic Jul 30 00:09:12 not sure what that apt stuff is about in a gradle file though Jul 30 00:10:18 interesting! Jul 30 00:10:26 does it generate tables as well? Jul 30 00:11:06 time for All About Android on twit.tv ;) Jul 30 00:14:19 shipit, this class says it does write the database https://github.com/SimonVT/schematic/blob/8f50f700f10438859da180eaf450d9599ca000f1/schematic-compiler/src/main/java/net/simonvt/schematic/compiler/DatabaseWriter.java Jul 30 00:15:01 Afzal: very interesting! thanks!! Jul 30 00:15:17 yeah np, lemme know if it works nicely so I can also switch :p Jul 30 00:15:19 I'm generating the schema at compile time Jul 30 00:15:32 using a gradle/java plugin Jul 30 00:15:54 but this content provider generation looks very interesting Jul 30 00:15:59 ofcourse, I will :) Jul 30 00:22:14 SimonVT: Love Schematic. Is it possible/sane to include it as a library project (Aching for that interface inheritance support) Jul 30 00:51:57 Chainfire: think I sussed what you meant about interfaces. heres a small snippet of it in use. https://gist.github.com/anonymous/55941eefde2533dd40a0 Jul 30 00:57:15 hey guys, how do I set the highlight color of action bar tabs? I'm looking at styles.xml, it's not making any sense. Jul 30 00:58:05 Helloooo Jul 30 00:58:09 Anybody help me? Jul 30 00:58:10 =) Jul 30 00:59:00 EditText input = (EditText) findViewById(R.id.input); Jul 30 00:59:00 String texts = input.getText().toString(); Jul 30 00:59:00 Jul 30 00:59:00 Jul 30 00:59:00 Jul 30 00:59:00 Input.append(texts + emo1); Jul 30 00:59:08 No work Jul 30 00:59:14 how many more times do you have to be told to *just post the code in a pastebin and ASK THE Q. Jul 30 01:00:08 Input.append(texts + emo1); -> Input -> input -> input.setText(texts + emo1) Jul 30 01:01:14 Whattttt Jul 30 01:01:18 lasserix::: Jul 30 01:01:19 the guy is a troll. same crap every night. Zero attempt to debug or provide context. you're wasting your time. Jul 30 01:01:29 he's been doing it, more or less, since March Jul 30 01:01:45 Im not a troll mean Jul 30 01:01:48 Im newbie Jul 30 01:01:53 when he was trying to modify an open source IRC client by editing the smali code Jul 30 01:01:54 Respect me Jul 30 01:01:58 I hate banning but if ever someone deserved it ... ban by IP or whatever. Jul 30 01:02:09 He was what?!? Jul 30 01:02:32 Sounds delusional OR very bored. Jul 30 01:02:44 Smali? Jul 30 01:02:48 Leeds::: Shut up Jul 30 01:03:07 Its the master code Jul 30 01:03:09 personally, I blame JesusFreke Jul 30 01:03:18 It's all my fault Jul 30 01:03:26 see! Jul 30 01:03:36 No, yaaic Jul 30 01:03:42 No smali Jul 30 01:03:48 rgr: scarily, I'm not joking Jul 30 01:04:08 well, I'm joking about it being JesusFreke's fault... partly :) Jul 30 01:04:48 yesterday broke me. three attempts to get him to post layout and code. no chance. and then not understanding the difference betwee actual text and a textview. I say troll. No one can sign into irc being that stupid. Jul 30 01:04:59 Input.append(texts + emo1); -> Input -> input -> input.setText(texts + emo1) Jul 30 01:05:20 Ok, anydbody help me?? Jul 30 01:05:22 from the code you posted you fucked up by a) trying to call Input when you meant to call input b) calling the wrong method on the edit text Jul 30 01:05:34 you don't use .append to chagen edit text text Jul 30 01:05:38 you set .settext Jul 30 01:06:07 When i put a string to edittext, the string replace all text in myedittext bot Jul 30 01:06:14 This is my problem lasserix Jul 30 01:06:25 yeah you so use setText(text + emo1) Jul 30 01:06:29 lasserix: you're wasting your time. Jul 30 01:06:41 Ok i try Jul 30 01:06:43 you dont een know what emo1 is. He set it 10 times yesterday. Jul 30 01:06:56 Input.setText(texts + emo1); Jul 30 01:07:00 This is correct? Jul 30 01:07:02 but if you have the patience you can be the new jesusfreke... Jul 30 01:07:03 no Jul 30 01:07:06 input not Input Jul 30 01:07:14 your code had Edittext input not EditText Input Jul 30 01:07:19 rgr: I think you lasted longer than me. I only tried to help twice :) Jul 30 01:07:25 so whichever one it is, pick the right case Jul 30 01:07:28 lol Jul 30 01:07:30 java is case senstive Jul 30 01:07:39 he is probably making an IRC - emoji client Jul 30 01:07:57 Messiiii, apply ducttape to any texx you don't want removed Jul 30 01:08:04 heh Jul 30 01:08:17 then apply sand at high velocity Jul 30 01:08:29 if its an underwater app on a new Sony Z2 it needs to be ducktape. Jul 30 01:08:37 android integration tests suck particularly when you are testing with a deamon level process thread started by an executable from java runtime Jul 30 01:08:58 yes... I'm sure they do... ;) Jul 30 01:09:01 lasserix::: Http://pastebin.com/rafEZcbn Jul 30 01:09:41 looks like it should work Jul 30 01:09:48 a good day. handlers back working. now potentially replaced with callback interfaces. momentum. but defo bed time. Jul 30 01:09:51 but you probably want to check if texts is null if say, the user hasn't entered any text Jul 30 01:10:02 rgr: you should probably use a singelton Jul 30 01:10:09 I just wish the emoticon does not replace the text inside my EditText I want the emoticon SE ADD TO EDITTEXT Jul 30 01:10:19 rgr ;p Jul 30 01:10:37 rgr: also make sure you a) use Messages.obtain() to recycle messages Jul 30 01:10:53 b) if you pass A LOT OF messages make sure you are not creating new strings/etc each time Jul 30 01:10:56 Read my Jul 30 01:11:04 I just wish the emoticon does not replace the text inside my EditText I want the emoticon SE ADD TO EDITTEXT Jul 30 01:11:28 i was passing framerate data to logcat / from my openglsurfaceview back when i was niave and just pushing the framerate as a string was causing all sorts of lag/gitter Jul 30 01:11:59 rgr: good day here too just finally finished this, and it finally passed testing right as it is time to go hom e:) Jul 30 01:12:23 messii yeah that should work if emo1 is a string Jul 30 01:12:39 lasserix: yes, yes, yes. pleae dont feel the need to constantly explain the obvious... it takes the polish off your good help! Jul 30 01:13:33 Ok but not work Jul 30 01:13:42 Can you see all code? Jul 30 01:13:49 not right now Jul 30 01:13:51 i am going home Jul 30 01:14:13 rgr: just trying to save you some trouble since you seem to have had enough with this ;p Jul 30 01:14:43 Ok I get no solution, I've only read nonsense Jul 30 01:15:13 perhaps you should look elsewhere then Jul 30 02:06:06 anyone have problems linking to other apps in play store description? Jul 30 02:42:51 i wonder how seriously my fellow devs are taking the wearable stuff **** ENDING LOGGING AT Wed Jul 30 03:00:01 2014