**** BEGIN LOGGING AT Sat Oct 04 03:00:01 2014 Oct 04 03:00:36 i'm not sure if it's not working or if GA just waits forever to show data Oct 04 03:00:45 i think it defaults to only show up to yesterday Oct 04 03:00:50 make sure you include today Oct 04 03:01:02 you should see it in live view Oct 04 03:01:37 damn Oct 04 03:02:06 sarbs: still same problem. Oct 04 03:05:41 Well Oct 04 03:06:05 I have successfully installed spyware on the new version of my game. Oct 04 03:09:27 ET phones home every time my game opens Oct 04 03:09:45 and I can check for build version, phone type, uuid, etcetc, and send a custom message Oct 04 03:29:27 anyone in here happen to know if I can make a location object from something coming back in retrofit? Oct 04 03:29:34 i do Oct 04 03:29:35 and yes Oct 04 03:29:47 I get a location object, but the lat/long are both 0.000000 Oct 04 03:29:58 the coordinates don't actually seem to get set Oct 04 03:33:29 "location_1" : { "needs_recoding" : false, "longitude" : "-88.50035182000002", "latitude" : "46.76081586" } Oct 04 03:33:35 you'll want to register a type adapter with Gson Oct 04 03:33:42 and in my model: @SerializedName("location_1") @Getter Location location; Oct 04 03:33:56 but location always comes back as location=Location[null 0.000000,0.000000 acc=??? t=?!? et=?!?]) Oct 04 03:34:32 you'll want to register a type adapter with Gson and create the instance yourself by pulling out the appropriate data Oct 04 03:34:55 ok Oct 04 03:48:05 In animations is it possible to animate 3 different activities which are on backside of the new comming activity? Oct 04 03:49:57 My app starts with 1st activity. Then user starts the other activity by taping on a button. 1st and 2nd comming activity animates properly. When user taps on for 3rd activity, the 1st activity dont gets animated. Oct 04 03:52:45 in.nextName() => needs_recoding Oct 04 03:53:45 expected a name but was BOOLEAN... Oct 04 04:05:42 IT WORKS!!!! Oct 04 04:05:46 Thanks, JakeWharton Oct 04 04:46:05 I still have no damn idea why this app won't launch and why it's not logging anything as to what's got it all pissed off. Oct 04 04:48:52 im trying to understand the FragmentPagerAdapter before using any library and im having some issues. help pls, my content is never displayed Oct 04 04:49:45 I have an api I'm trying to interact with that has a really strange query string syntax, and I'm trying to use retrofit to interact with it Oct 04 04:49:53 it works fine if I hard code the paths Oct 04 04:50:10 cliffreich i am an expert Oct 04 04:50:11 but I'm not sure the best way to allow myself options... Oct 04 04:50:15 "/resource/w9tw-628x?$where=unitdescription%20=%20'{attractionType}'" Oct 04 04:50:27 shekibobo don't url encode the path Oct 04 04:50:29 that's what I'm trying, with @Path Oct 04 04:50:30 ok Oct 04 04:50:33 retrofit takes care of that for you Oct 04 04:50:44 there are literally spaces? Oct 04 04:50:47 in the url? Oct 04 04:50:52 in the query, yeah Oct 04 04:51:02 it's pretty dumb Oct 04 04:51:04 single quotes? Oct 04 04:51:09 yup Oct 04 04:51:13 can u paste a working url? Oct 04 04:51:16 or is it private Oct 04 04:51:17 I was going to use the SDK for that API type Oct 04 04:51:34 but gradle can't find it Oct 04 04:51:51 its not gradles job to find anything Oct 04 04:51:54 its your job to tell gradle where it is Oct 04 04:52:19 http://data.michigan.gov/resource/w9tw-628x.json?$where=unitdescription%20=%20%27State%20Park%27 Oct 04 04:52:28 ok jacob im making a pastebin so it will have sense Oct 04 04:52:29 yeah, I tried to tell it where it was Oct 04 04:52:34 shekibobo you ahve single quotes in your URL Oct 04 04:52:38 but they don't tell you where it is Oct 04 04:52:39 oh %27 is a single quote? Oct 04 04:52:56 looks that way... Oct 04 04:53:19 the space before 'state park' is optional, it works without it Oct 04 04:53:36 same with the one after unit description Oct 04 04:55:11 good catch, thanks Oct 04 04:55:20 this is not a good use case for retrofit Oct 04 04:55:33 you can't use path parameters in teh query string Oct 04 04:55:49 ok, that's what I was wondering Oct 04 04:55:50 it will work fine Oct 04 04:55:55 sorry i lied Oct 04 04:55:55 just use an object to abstract all that awfulness Oct 04 04:56:05 whose toString() renders it in that format Oct 04 04:56:14 JakeWharton you can use PATH params in a query string? Oct 04 04:56:19 i thought that didn't work Oct 04 04:56:21 no Oct 04 04:56:25 I tried it and it didn't Oct 04 04:56:27 ok, yea, it will work, just not pretty Oct 04 04:56:47 "/resource/w9tw-628x" with (@Query('where') String stupidQuery) // String stupidQuery = "unitDescription='State Park'" Oct 04 04:56:51 no Oct 04 04:56:53 use an object Oct 04 04:57:17 Where.of("unitdescription", "State Park"); Oct 04 04:57:23 ohh learning new things Oct 04 04:57:38 what is Where? Oct 04 04:57:42 whatever you want Oct 04 04:57:48 oh k Oct 04 04:58:06 yeah i suppose that's a nicer thing Oct 04 04:58:16 do you get what hes saying shekibobo Oct 04 04:58:42 and use @EncodedQuery so it doesn't mangle single quotes Oct 04 04:59:05 I think you're saying to make my own POJO that I can use to generate my stupid query strings, and pass those objects to the request Oct 04 04:59:12 as query params Oct 04 04:59:23 precisely Oct 04 04:59:30 i like how this .govs error response has the actual sql error in the response Oct 04 04:59:33 sweet Oct 04 04:59:36 http://data.michigan.gov/resource/w9tw-628x.json?$where=unitdescription=%27State%20Park Oct 04 04:59:38 hides all the ugly in the toString() of that object and keeps your API nice and clean Oct 04 04:59:39 yeah, this API is pretty terible Oct 04 04:59:42 message: "Error, could not parse SoQL query "select * from #w9tw-628x where unitdescription='State Park"", Oct 04 05:00:29 JacobTabak here is the pastebin http://pastebin.com/K6P7WN1B Oct 04 05:00:37 k reading Oct 04 05:00:42 ty Oct 04 05:00:57 yo cliffreich your naming convention... class named fragment_tabs Oct 04 05:00:59 c'mon my eyes Oct 04 05:01:19 im learning :( will fix it Oct 04 05:02:14 cliff were we talking about getChildFragmentManager yesterday? Oct 04 05:02:30 i wasnt here then Oct 04 05:02:32 ok good Oct 04 05:02:50 when you're creating your fragment adapter, use getChildFragmentManager() rather than getSupportFragmentManager() Oct 04 05:05:03 oh Oct 04 05:05:08 thats probably not your issue Oct 04 05:06:06 probably need the code for fragment_data Oct 04 05:06:25 ok sec Oct 04 05:06:36 also you really shouldn't call your layout file fragment_adapter Oct 04 05:06:40 adapters don't have layouts Oct 04 05:07:05 layout file should be fragment_tabs, class file should be TabsFragment Oct 04 05:17:03 here is, names are horrible i know :/ http://pastebin.com/ghYSkKVn Oct 04 05:17:37 ill rename everything Oct 04 05:18:07 also dont use fill_parent always use match_parent Oct 04 05:18:16 also, don't do stuff like this Oct 04 05:18:20 android:text="Text with test only purpose" /> Oct 04 05:18:50 i just made that to check if my content was working Oct 04 05:19:22 like an ugly test heh Oct 04 05:19:32 but it won't show Oct 04 05:19:36 use tools:text Oct 04 05:19:45 that way it will *never* show in the real app Oct 04 05:20:53 oh ok Oct 04 05:21:51 so - your content is never displayed? Oct 04 05:22:15 nope, for some reason the last XML never made it Oct 04 05:22:40 it's empty Oct 04 05:23:26 whoah Oct 04 05:23:31 your viewpager height is 0px Oct 04 05:23:58 and you have a framelayout below it with fill_parent (which should be match_parent) Oct 04 05:24:07 i thought about that for 1 hour but the android documentation is like that 0 height Oct 04 05:24:08 thats' definitely not right - Oct 04 05:24:22 if you're using weights, you can't have a 0 and a match_parent Oct 04 05:24:34 also NEVER type px in an android project Oct 04 05:24:38 just don't do it Oct 04 05:24:54 just remove subcontent and see what happens Oct 04 05:25:41 (use 0dp instead) Oct 04 05:26:27 @EncodedQuery doesn't seem to convert spaces and quotes Oct 04 05:26:41 ya i think you just want @Query Oct 04 05:26:46 @Encoded means you've pre-encoded it Oct 04 05:26:57 but i get the two confused Oct 04 05:27:24 nailed it Oct 04 05:27:26 thansk Oct 04 05:30:38 sorry my internet disconnected Oct 04 05:30:51 yes now i can see the text with testing purpose! Oct 04 05:31:12 thanks, i think i can continue with the tests adding something to the list Oct 04 05:33:59 ping Oct 04 05:34:05 pong Oct 04 05:34:58 heh it said ping timeout so tried /ping. pong reminds me of the old irc answers for /ping Oct 04 05:36:10 when it could die from ping of death Oct 04 05:54:07 Ok Oct 04 05:54:15 So expansion files go in Android/obb/ Oct 04 05:54:37 but that's hidden (Android/) in genymotion Oct 04 05:55:08 so i am a bit stuck.... Oct 04 05:55:20 have you tried w/ android device monitor? Oct 04 05:55:34 wait i see it somehow again Oct 04 05:55:39 maybe i am just tired Oct 04 05:56:16 ok now i need to add a directory Oct 04 05:56:48 don't see any way to add a directory.... Oct 04 05:57:01 i don't know what android device monitor is Oct 04 05:57:06 theres your first probelm Oct 04 05:57:21 its part of the tools in teh sdk Oct 04 05:57:31 u can send files to and fro with a gui Oct 04 05:58:29 i just want to know how to use the file manager Oct 04 05:58:34 :( lol Oct 04 05:58:39 on the device? Oct 04 05:58:43 i think its cyanogenmod Oct 04 05:59:08 yes Oct 04 05:59:18 simple things Oct 04 05:59:23 create a directory Oct 04 05:59:25 move a file Oct 04 05:59:28 seems impossible Oct 04 05:59:42 with an app? Oct 04 05:59:52 there are a million tools to manage files on android Oct 04 05:59:53 with the default file manager Oct 04 06:00:17 new folder is on the bottom left Oct 04 06:00:33 http://cl.ly/image/3i2A1n2V3f1s Oct 04 06:00:35 nothing, it is white Oct 04 06:00:43 i don't see this Oct 04 06:00:47 i am on tablet format Oct 04 06:00:59 oh i see new Oct 04 06:01:05 what about moving files? Oct 04 06:01:08 are you bad at computer Oct 04 06:01:39 lol Oct 04 06:01:52 help Oct 04 06:02:20 oh Oct 04 06:02:31 ok i got it Oct 04 06:02:36 had to click the checkbox Oct 04 06:02:43 instead of the whole file (that opened it....) Oct 04 06:03:28 ok it seems to work Oct 04 06:03:36 if really badly Oct 04 06:04:30 and crashes.. Oct 04 06:05:43 where do i select if it emulates arm or x86? Oct 04 06:05:48 or is x86 always the case? Oct 04 06:05:57 its x86 unless you mod it Oct 04 06:06:16 ah Oct 04 06:06:18 ok so great Oct 04 06:06:21 it works in x86 Oct 04 06:06:23 at 5fps Oct 04 06:06:29 that is trange though Oct 04 06:06:31 strange Oct 04 06:06:36 since my laptop is x86 Oct 04 06:06:45 probably more like 1fps Oct 04 06:06:53 emulator is slow Oct 04 06:10:26 i forgot to ask Oct 04 06:10:33 doing an informal poll Oct 04 06:10:38 $2.99 too much for premium? Oct 04 06:11:27 i will piracy it anyway Oct 04 06:12:03 lol Oct 04 06:12:18 android users dont spend money on apps Oct 04 06:12:25 hmm, i do Oct 04 06:12:50 you think ios users spend a lot more? Oct 04 06:13:02 oh and speaking of ios Oct 04 06:13:13 its not a theory Oct 04 06:13:23 do you know if i can just use an ios emulator to build a... build? Oct 04 06:13:29 or do I need an actual device Oct 04 06:15:26 I don't know what "build a build" means, but all you need is a Mac, Xcode, and the SDK Oct 04 06:15:56 so i can't just use an emulator? Oct 04 06:16:13 like Oct 04 06:16:20 does the mac have anything special? Oct 04 06:16:23 like maybe a unique id Oct 04 06:16:41 use an emulator for what? Oct 04 06:18:01 making the build Oct 04 06:18:17 emulators run builds Oct 04 06:18:26 i listed the three things you need to make a build Oct 04 06:19:20 what if i don't have a mac. Oct 04 06:19:24 emulate.. a.. mac Oct 04 06:19:26 no? Oct 04 06:19:50 that will work fine Oct 04 06:20:07 hmm, ok. Oct 04 06:23:09 hey jacob wheres your fragment switcher library ? Oct 04 06:27:39 to me that switcher looked weird in landscape because if the contents of a cell are long then it takes up too much space to scroll through items Oct 04 06:28:39 to me rotating to landscape and keeping the list ordered from top to bottom makes more sense, like most listviews do Oct 04 06:29:17 ahh Oct 04 06:29:17 thanks Oct 04 06:29:42 i had reason to use fragments so i was going to play with it but if there's problems ill just stick to my old code for handling fragments Oct 04 06:30:04 or not switcher what is it, list with headers per sort Oct 04 06:34:10 lasserix: I guess we are talking about different things Oct 04 06:34:50 JacobTabak had posted some neat looking list with header titles per category that you could expand Oct 04 06:35:02 hi Oct 04 06:35:08 yea i have done 2 things recently Oct 04 06:35:27 https://github.com/jacobtabak/Fragment-Switcher Oct 04 06:36:06 lasserix^ Oct 04 06:36:24 and here's the recyclerview thing in case anyones interested https://github.com/timehop/sticky-headers-recyclerview Oct 04 06:37:49 shmooz the thing i built doesn't rotate when the device rotates, i just did that to show that it was capable of doing that Oct 04 06:37:49 hi, where can i get documentation for android recovery structure? Oct 04 06:38:46 JacobTabak: yeah that can still be useful especially for square images with some info on top and bottom style per cell Oct 04 06:39:45 that fill more vertical real estate so it doesn't look so empty Oct 04 06:43:19 what's the best way of managing a google maps api keystore? Oct 04 06:45:33 damn now a little issue... when I'm loading okay the fragments with the FragmentStatePagerAdapter, but as each fragment load it's own data to display the ListView and uses Otto it loads both content and display the same in each tab/current view Oct 04 06:46:44 as there is only 1 fragment seems like otto notifies both instances with the same Oct 04 06:46:55 each time, pero each request Oct 04 06:46:58 per* Oct 04 06:49:40 so no otto Oct 04 06:50:15 what is the min version to support xxdpi. I thought it was 16 but it seems to be working fine on devices that are 14 Oct 04 06:51:08 it's 16 Oct 04 06:51:19 eeyup Oct 04 07:08:45 very interesting Oct 04 07:08:58 So Oct 04 07:09:06 In case anyone is interested Oct 04 07:09:22 android idiot users are afraid of the "this download is big" box Oct 04 07:09:30 and 2/3rds of them will abandon the download Oct 04 07:10:39 does greenrobot EventBus has a way to use identifiers? Seems like Otto can't Oct 04 07:11:24 Agamemnus: Is there a source for that information? Oct 04 07:12:02 yeah Oct 04 07:12:07 my appbrain interface Oct 04 07:12:12 for the last 5 hours Oct 04 07:12:28 I'm working on a team of devs, and we're using the gmaps api. Is there a way for each of us to load our own API_KEY in the manifest, without clobbering each other? Oct 04 07:12:53 it could be a huge coincidence Oct 04 07:13:17 but my install per impression ratio has remaine a consistent .27% for 3 days Oct 04 07:13:24 but now it is is .09% Oct 04 07:13:35 remained Oct 04 07:13:48 patience grasshopper Oct 04 07:14:14 those are short times to come to conclusions Oct 04 07:14:27 no Oct 04 07:14:31 it is consistent Oct 04 07:14:44 and it dropped off the face of the planet for 5 hours Oct 04 07:14:51 consistently Oct 04 07:15:43 how big is the download ? Oct 04 07:16:02 it's 35MB bigger now Oct 04 07:16:09 since I added x86 Oct 04 07:16:20 so it's.... about let's see Oct 04 07:16:42 well ok not 35mb bigger Oct 04 07:16:45 strange Oct 04 07:16:50 oh right Oct 04 07:16:55 well it's 57mb plus 25mb Oct 04 07:17:12 so pretty much 80mb Oct 04 07:17:27 most of that is just chromium and crosswalk Oct 04 07:18:11 shekibobo i have an answer for you Oct 04 07:18:16 let me know if you want it Oct 04 07:18:23 I got it! make the app download those after they install it Oct 04 07:18:32 I do, but I get the feeling I know what it is already Oct 04 07:18:37 that's not possible really Oct 04 07:19:04 or are u talking to shekibob Oct 04 07:19:05 o Oct 04 07:19:06 shekibobo you only need 1 (or 2) api key Oct 04 07:19:19 you need 1 api key per application identifier Oct 04 07:19:36 so we all just need to share the api key? Oct 04 07:19:41 not *just* Oct 04 07:19:50 you also need to share a debug signing key for the project Oct 04 07:20:06 ok, yeah, tha'ts what I'm wondering Oct 04 07:20:06 which i can give you more information on if your'e using AS/gradle... if not there are ways but you're on your own Oct 04 07:20:15 I'm using gradle with AS Oct 04 07:20:25 ok, so create a new debug keystore Oct 04 07:20:39 are you on a mac? Oct 04 07:20:48 2 of us are Oct 04 07:20:51 I am Oct 04 07:20:54 ok Oct 04 07:21:13 so go to your ~/.android dir Oct 04 07:21:21 done Oct 04 07:21:21 and rename your debug.keystore debug.keystore.bak Oct 04 07:21:27 relaunch android studio Oct 04 07:21:34 it should automatically make a new debug.keystore with a unique signing key Oct 04 07:21:49 copy that into your revision control Oct 04 07:22:05 in the same directory as your project-level build file Oct 04 07:22:23 once you've copied it, you should restore your backup Oct 04 07:23:44 ok, so /project/debug.keystore Oct 04 07:23:52 commit that to source control Oct 04 07:24:00 for me it would be like /project/app/debug.keystore Oct 04 07:24:09 ok Oct 04 07:24:19 ie, you have settings.gradle in your top lvl dir Oct 04 07:24:23 you need to be in your 2nd lvl Oct 04 07:24:28 ok Oct 04 07:24:44 do you have signingConfigs in your project-level build.gradle Oct 04 07:25:09 yeah Oct 04 07:25:15 do you have one for debug Oct 04 07:25:20 if not, create one just like release Oct 04 07:25:33 debug { storeFile file("debug.keystore") } Oct 04 07:25:47 I have android/signingConfigs/config { ... } Oct 04 07:25:57 ok thats fine Oct 04 07:26:11 in buildTypes, you'll see one of your buildtypes reference that Oct 04 07:26:13 the name is arbitrary Oct 04 07:26:20 what buildtypes do you have? Oct 04 07:26:31 release Oct 04 07:26:42 and it must say signingConfig signingConfigs.config ? Oct 04 07:27:17 just has proguard config stuff Oct 04 07:27:24 oh ok Oct 04 07:27:28 sec ill just send you a pastebin Oct 04 07:27:30 k Oct 04 07:29:14 http://pastebin.com/UGXVWGYC Oct 04 07:30:37 so then you just get the hash of that keystore and put it in the google api console Oct 04 07:38:49 that works. awesome, thanks! Oct 04 08:17:06 in retrofit, can query params be optional, or do I have to write a separate method for that? Oct 04 08:17:13 yes, pass null Oct 04 08:17:27 k, thx Oct 04 08:17:35 "null values are ignored." http://square.github.io/retrofit/javadoc/retrofit/http/Query.html Oct 04 08:38:53 Morning! Oct 04 08:39:03 (UTC + 5:30) ;-) Oct 04 09:12:09 <_CalLightman_> Hi, I need help in implementing custom view. The view will contain multiple EditText and will be ised as a row in expandable list. Oct 04 09:18:34 Aaaand, I figured out why my app never launched. Some fucknut developer put a timebomb in it. Oct 04 09:20:43 got to make sure you get paid Oct 04 09:47:15 that's a nice app you got there... would be a shame if anything happened to it :p Oct 04 10:43:16 Hi. Oct 04 10:43:36 Can anyone tell if I should sign different flavors of my app with different certificates or can I use a single one? Oct 04 10:44:00 you can use one for everything Oct 04 10:52:27 Not sure if this question is appropriate, but: How much money per hour could I request as a freelancer doing android programming (I am in my final year in college)? Oct 04 10:57:31 Depends on how good you are. Oct 04 10:58:19 jpsharp: Hmm...hard to know that without external evaluation... Oct 04 10:58:20 If you suspect monkey business from a client, put some time bombs in. Oct 04 10:58:23 JakeWharton: This line isn't necessary, is it? https://github.com/JakeWharton/u2020/blob/master/src/main/java/com/jakewharton/u2020/data/GalleryDatabase.java#L77 Oct 04 10:58:29 :-P Oct 04 10:58:35 From what I've gathered, Retrofit does that for you. Oct 04 10:59:31 https://github.com/square/retrofit/issues/430#issuecomment-37068797 "Don't call subscribeOn. We do that for you using the internal HTTP Executor of the RestAdpater.", your own comment even :D Oct 04 11:00:20 Tobbi: Well, to be honest, until you get several projects under your belt and a name for yourself, you're going to be lowballed and undercut by overseas developers. Oct 04 11:01:07 what they want is 20years old, M.Sc or better, and at least 5 years experience ^^' Oct 04 11:01:59 jpsharp: Last time we worked for around 3600 and that was around 3 months of work, and we were two people. We underestimated the amount of work...by far. Oct 04 11:02:08 3600 EUR, jsyk Oct 04 11:02:41 ouch Oct 04 11:02:59 yup...So, this time we wanna do it proper. Oct 04 11:03:32 *properly Oct 04 11:09:59 hi Oct 04 11:10:13 i want to display some news articles. To go to the next, just swipe left. Oct 04 11:10:17 is there some view i should use for that ? Oct 04 11:10:24 the article is full screen :) Oct 04 11:11:15 does this sound like viewpager? Oct 04 11:14:52 viewpager yes Oct 04 11:15:34 maybe there's something better Oct 04 11:15:40 worth investigating Oct 04 11:17:25 viewpager is exactly that usecase Oct 04 11:27:05 hi, trying to execute an asyncTask after another, wonder if my thinking is wrong here: http://pastebin.com/bm7s7ed4 Oct 04 11:27:40 I get an exception that I'm in an illegal state when I try to execute the second async task Oct 04 11:27:40 it says it's already started Oct 04 11:32:17 DarsVaeda : Are you sure you're calling execute on one object of async task only once? Oct 04 11:33:30 not entirely both requests extend AsyncTask Oct 04 11:33:53 but I was under the impression that if executeOnFinish is called the first tasked is as said, finished Oct 04 11:34:15 but then both request reside in two objects Oct 04 11:34:48 I'm using startActivityForResult, but how do I return the result in the other activity/ Oct 04 11:34:49 > Oct 04 11:34:50 ? Oct 04 11:36:11 The developer page explains how to start the activity and how to process the result, but not how to actually return the result from in the other activity Oct 04 11:36:11 ? Oct 04 11:37:33 I geniunely can't find this in the documentation Oct 04 11:37:34 :( Oct 04 11:42:49 AKK9 : intent.setResult(Bundle) ; finishActivity(intent) [or something of this sort] Oct 04 11:43:20 in the activity that is supposed to receive the data, override onActivityResult() Oct 04 11:43:58 DarsVaeda : I am sorry, not sure if I understand your code :-/ Oct 04 11:45:27 sheikhaman, thanks Oct 04 11:46:14 no prob :) Oct 04 12:50:53 sheikhaman, guess what...a typo was the problem -.- Oct 04 12:51:46 aahahahah.. great! :D Oct 04 12:51:53 maybe you should sleep a little? ;-) Oct 04 12:52:31 probably I should rethink my naming :/ Oct 04 12:55:10 :D Oct 04 13:13:04 Hi Oct 04 13:13:09 public void setHomeActionContentDescription (CharSequence description) Oct 04 13:13:10 Set an alternate description for the Home/Up action, when enabled. Oct 04 13:13:11 This description is commonly used for accessibility/screen readers when the Home action is enabled. (See setDisplayHomeAsUpEnabled(boolean).) Examples of this are, "Navigate Home" or "Navigate Up" depending on the DISPLAY_HOME_AS_UP display option. If you have changed the home-as-up indicator using setHomeAsUpIndicator(int) to indicate more specific functionality such as a sliding drawer, you should also set this to Oct 04 13:13:16 accurately describe the action. Oct 04 13:13:38 I can't understand that clear x| Oct 04 13:14:09 and what is Home/Up button? Oct 04 13:29:09 MalekAlrwily: the button in the top left of the action bar looks like < Oct 04 13:30:11 And you have run into the issue that many have with it. Here is the design guides http://developer.android.com/design/patterns/actionbar.html Oct 04 13:59:58 OMG RETROLAMBDA ACTUALLY WORKS!!!! Oct 04 14:06:30 i Oct 04 14:06:32 hi* Oct 04 14:18:29 hi Oct 04 14:30:57 I have a service which handles events: when the app is in foreground, the activity receives these events, too. When the app in background, the activity can't receive events and here is the question: is there any technique to queue things to do, or any other approach, in general, to this problem? Oct 04 14:48:54 I'm so god damn frustrated with Amazon! Oct 04 14:49:35 they give you samples that are broken when you import, the documentation is so fragmented and overly verbose for nothing Oct 04 14:50:30 10,000 pages that speak about the same god damn topic Oct 04 15:05:05 MyWay: Do you want to show some results on that event or just do stuff in the background? Oct 04 15:11:47 is it possible for ANDROID_ID to have less than 16 hex characters ? Oct 04 15:13:11 the_cyber_guy: i think its always 64bit Oct 04 15:13:25 unless you have a totally weird custom rom.. Oct 04 15:14:27 can't it have something like 10 or 14 hex characters as it will still be under 64 bit length ? Oct 04 15:14:49 docs say its always 64bit Oct 04 15:15:31 as i am getting some installs from such devices having less than 16 hex characters in their android_id. Oct 04 15:15:40 stock rom? Oct 04 15:15:44 custom rom probably Oct 04 15:15:50 64bits is to avoid collision Oct 04 15:16:02 don't know. those are remote installs. Oct 04 15:16:12 (to mitigate, not to avoid) Oct 04 15:16:22 so should i block those devices ? Oct 04 15:16:29 why? Oct 04 15:16:44 yeah as I said. AOSP roms should be 64 bit and not less unless somebody did stupid thing with the source.. Oct 04 15:16:48 this is not a way to detect if the user app is legit or not Oct 04 15:16:55 i don't want fake installs. like multiple installs on same device. Oct 04 15:16:56 you could use LVL, but it's not very efficient Oct 04 15:17:04 to be sure it has been downloaded from playstore per example. Oct 04 15:17:15 security is a mess Oct 04 15:17:20 when it comes to that on android ;( Oct 04 15:17:27 the only way is to have a third party server you control Oct 04 15:17:33 hmm :( Oct 04 15:17:36 yeah ;( Oct 04 15:17:41 i've very disappointed Oct 04 15:17:45 i'm* Oct 04 15:17:57 ok thanks all Oct 04 15:18:47 adq what apps do you have on the store ? Oct 04 15:19:17 StingRay_, a few why? :) Oct 04 15:19:26 links ? just wanted a look Oct 04 15:19:31 yes but in private Oct 04 15:20:41 cause I think security/purchasing etc for android is not really a concern for 95% of devs Oct 04 15:21:44 it is a concern when you sell app Oct 04 15:21:46 StingRay_: because 95% of apps are free^^ Oct 04 15:21:50 and you don't want to have your apk in the nature Oct 04 15:21:54 which happens very fast Oct 04 15:21:59 danijoo no not at all Oct 04 15:22:07 also even free application are diverted Oct 04 15:22:08 sure Oct 04 15:22:10 ok 95% of inap or premium apps Oct 04 15:22:11 to embed horrible malware Oct 04 15:22:18 put their ads and other evil stuff Oct 04 15:22:30 whats evil on ads?^^ Oct 04 15:22:36 i use ads too Oct 04 15:22:44 but sometimes you will see that it is easy to replace the id Oct 04 15:22:48 so some ppl repackage your app Oct 04 15:22:55 with their own id, or even worst, sell them Oct 04 15:23:45 yeah. but i think the best way to handle those is being better ;) Oct 04 15:23:53 if they sell and you dont, nobody will buy Oct 04 15:24:15 if you have 1mio installs and they 1:1 copy it. nobody will see the copy in the store Oct 04 15:25:05 also you can obfuscate every key to make it harder to replace it Oct 04 15:25:14 unfortunately these are the only methods we have :( Oct 04 15:27:05 well I think unless you have less than 500 installs, or over 1 million, there is no real concern …and the < 500 concern is questionable (time Vs effort) Oct 04 15:27:49 noobody copies apps with 500 installs Oct 04 15:28:32 but people pirate apps with 10 installs Oct 04 15:28:41 yeah…I think it would be a good state to be in to start to worry about piracy and cp Oct 04 15:29:27 EPG: pics or it didnt happen :P Oct 04 15:29:41 search for quicker camera launcher pro Oct 04 15:29:57 it's not a legend that for little developers, it's very annoying to see their apk in the wild Oct 04 15:30:00 :) Oct 04 15:30:12 noobody copies apps with 500 installs <- wrong Oct 04 15:30:15 it's automated now Oct 04 15:30:19 just bots Oct 04 15:30:24 you can make a test easily Oct 04 15:30:31 yep Oct 04 15:30:32 publish a free apk Oct 04 15:30:37 monitor the web in a week Oct 04 15:30:42 and use punctuation, not Return Oct 04 15:31:03 right. Oct 04 15:31:45 mh Oct 04 15:31:56 havent seen any copies yet and im over 400k Oct 04 15:32:03 maybe luck then :) Oct 04 15:32:18 unbelievable :) Oct 04 15:32:18 nothing wrong really with return, unless there are many discussions going on, not like each line costs :) Oct 04 15:32:35 but the sentences Oct 04 15:32:39 will be very fragmented Oct 04 15:32:42 and you'll like... Oct 04 15:32:45 be waiting for the next one Oct 04 15:32:47 to appear Oct 04 15:32:49 to get the full Oct 04 15:32:50 meaning Oct 04 15:32:53 actually depends on flow Oct 04 15:32:59 maybe I just had this though now Oct 04 15:33:05 hi Oct 04 15:33:07 h Oct 04 15:33:08 i Oct 04 15:33:09 not when I was on the other sentence :) Oct 04 15:33:10 Sicp, you're totally right, I'm trying to fix that but it's not always easy, all my fault there. And indeed, I realized I tend to often use return instead of punctuation Oct 04 15:33:15 i want use this https://github.com/johnkil/Steganography Oct 04 15:33:17 so thank you. Oct 04 15:33:34 but seems that need gif image selected by user in gallery Oct 04 15:33:35 not so frustrated with Amazon anymore, things are beginning to work Oct 04 15:33:47 any idea how can i use above Oct 04 15:34:27 molavy: you can use it by downloading it from google play store :) Oct 04 15:34:30 theres a link on github Oct 04 15:34:50 danijoo: i want use it in my ap Oct 04 15:34:51 app Oct 04 15:34:53 molavy not been updated in a while though Oct 04 15:35:00 as part of project Oct 04 15:35:13 its a full app, not something to be used in a project molavy Oct 04 15:35:42 but since its under apache, you are free to use parts of it in your app Oct 04 15:36:14 StingRay_: danijoo: seems that work just on gif image, so i have two way, 1: converted user selected image from png,jpg to gif, 2: change it to work with jpg ,png images Oct 04 15:37:01 molavy not sure either of us want to hear what you may or may not do :) Though I only speak for myself here :) Oct 04 15:37:54 StingRay_: :) Oct 04 15:38:14 ok, never mind Oct 04 15:38:20 molavy: You cant just include it in your app. All you can do is take the source and make the best of it. I think this answers your question Oct 04 15:38:58 did someone know how can i convert jpg to gif in android Oct 04 15:39:00 ? Oct 04 15:39:11 more fitting of Google, that question Oct 04 15:39:26 also kind of irrelevant if you read and understand that app Oct 04 15:39:28 too niche Oct 04 15:40:15 molavy: read the image into memory, save it in new format Oct 04 15:40:16 i found this : http://jiggawatt.org/badc0de/android/index.html#gifflen Oct 04 15:40:40 that'll do it Oct 04 15:41:02 but it is native library, do you know better library just in jar file Oct 04 15:41:18 no :) Oct 04 15:41:19 can't get everything in one go Oct 04 15:41:26 google might ;) Oct 04 15:42:47 thanks anyway Oct 04 15:44:31 molavy also take not of the format of gif Oct 04 15:44:42 there is not such a thing as…a giff Oct 04 15:55:33 Anyone know of a library for implementing a music player inside of an application? Oct 04 15:59:14 pieces029: you dont need a library for that. its build in Oct 04 15:59:21 MediaPlayer and AudioManager class Oct 04 16:00:50 danijoo: I know. I'm looking more for a library that would have the main ui parts and threading built. Oct 04 16:01:22 Seems like work that would be repetitive for any application that wants a media player to create the menu drawer, activity and intent service. Oct 04 16:02:07 then all apps would look the same.. Oct 04 16:02:47 I mean it could be built in such a way that lets you style it... Oct 04 16:03:31 i dont think there is a library like that.. Oct 04 16:03:34 Welp, sounds like another thing I need to add to my list of things to do. Oct 04 16:18:39 Android development apply to app development as well? Oct 04 16:21:28 Spynxic what ? Oct 04 16:23:38 <_abc_> Hello. Is the new (to me) ARChos hack to run apps in Chrome browser faster than the development sim? I mean, is the app faster under Chrome? Also I assume certain apis will be somewhat lacking or weird acting? No accelerometer etc on desktop? Oct 04 16:25:42 * StingRay_ fears his brain is not working as intended… everyone seems to be speaking in jumbled sentences Oct 04 16:25:59 * StingRay_ goes for coffee Oct 04 16:26:03 Sorry Oct 04 16:26:24 _abc_: it's unlikely to be faster than an intel VM with accelerated video (haxm or whatever your platform uses) Oct 04 16:26:29 Just beating around the bush Oct 04 16:26:52 Know where I could find the source of a camera stripped of all features (preview only) Oct 04 16:27:26 Want to build something on top of it but I'd rather not re-implement the wheel Oct 04 16:27:49 Spynxic typing less than 20 lines of code is not really re-inventing Oct 04 16:28:00 would call that implementing, and very small too :) Oct 04 16:28:15 So you do know of a source then? Oct 04 16:28:24 well no, cause it's just 20 lines Oct 04 16:28:38 Camera + Surface Oct 04 16:28:48 then you have a camera view on a surface :) Oct 04 16:29:09 where did you learn the 20 lines..? Oct 04 16:29:15 d.android.com Oct 04 16:37:06 What if my application needs to load data asynchronously before functioning properly? Is there a general pattern to approach this? Sometimes I need to access this data in onCreate() or onResume(), etc. Oct 04 16:38:02 Tell the user you're loading data Oct 04 16:38:16 Then load it async Oct 04 16:38:25 platzhirsch: you can set up the rest of the functionality in onPostExecute() of asynctask Oct 04 16:38:59 I found onPostExecute() really dangerous, sometimes it's not executed on the UI/Main thread, but well okay :) that's what EventBus is for Oct 04 16:39:47 and what runOnUiThread is for Oct 04 16:40:05 And onPostExecute is always executed on the main thread Oct 04 16:40:06 but onPost is always on main UI thread ? Oct 04 16:40:09 yeah that Oct 04 16:40:37 * platzhirsch nods :) Oct 04 16:41:51 Do I need to clear a SurfaceView? every position my ball has is still on the View Oct 04 16:44:43 is it ok to draw to a SrufaceView from a background thread? Oct 04 16:50:39 troned: you shouldnt clear the entire view, when you invaldate the view you specify the "dirty" or "invalid" area of te view. This rect should be a union of your old ball position and size and the new ball position and size. Oct 04 16:51:33 troned: when it comes to the draw method. You can call canvas.drawColor(0, PorterDuff.Mode.CLEAR); to wipe that section. Since the canvas is clipped to the dirty area Oct 04 16:52:05 troned: this will clear the old ball off the screen as its part of the "dirty" area of the view. The new ball is then drawn as usual." Oct 04 16:53:20 I see, ty. Oct 04 16:53:47 troned: and yes, you can access write to the Surface from a background thread Oct 04 16:53:51 troned: you should use http://developer.android.com/reference/android/view/SurfaceHolder.html#lockCanvas%28android.graphics.Rect%29 Oct 04 16:53:57 to get the Canvas for the view Oct 04 16:53:58 And it is not possible to set a background. Do I have to redraw the background every time then somehow? Seems expensive? Oct 04 16:54:08 do use lockCanvas Oct 04 16:54:11 and then http://developer.android.com/reference/android/view/SurfaceHolder.html#unlockCanvasAndPost%28android.graphics.Canvas%29 Oct 04 16:54:31 Napalm: ok i do that so that posts a draw on the main thread then? Oct 04 16:54:43 not on the calling thread Oct 04 16:54:48 troned: did you not follow what i said? Oct 04 16:54:59 troned: you are not drawing the entire background Oct 04 16:55:10 troned: only the dirty area. Oct 04 16:55:24 troned: this way its not so expensive. Oct 04 16:56:16 yes I got that. but i dont see how to set the background, there is no setBackgroundResource Oct 04 16:56:32 lol Oct 04 16:56:35 i just said Oct 04 16:56:49 ... You can call canvas.drawColor(0, PorterDuff.Mode.CLEAR); Oct 04 16:57:00 as in to make it transparent Oct 04 16:57:03 if you want a background Oct 04 16:57:04 draw iot Oct 04 16:57:05 it Oct 04 16:59:57 I'm pretty new. I wrote a small piece of code to understand the UI stuff better but it's not working as I expected. Anyone able to help with http://pastebin.com/fpma9rVD ? 29-34 detail my confusion Oct 04 16:59:58 if I have an android:onClick method pointing to a function in my mainActivity, do I put this function inside of onCreate? or just inside of the main activity class? Oct 04 17:02:31 Can i save references to some subviews (TextView, buttons etc) in onCreate method for later use in same activity (For example in listener code)? Is it possible that this references can be broken in some conditions? Oct 04 17:03:01 by reference i mean result of findViewById Oct 04 17:09:49 when the context that the view is bound to goes Oct 04 17:19:03 hi, im trying to do a simple camera tutorial, as explained in http://developer.android.com/guide/topics/media/camera.html. however, whenever I try using startPreview() after having previously called stopPreview(), an exception is thrown by startPreview(). eg startPreview(); stopPreview(); startPreview(); doesn't work, but just startPreview(); does. does anyone have any idea what could be going on? thanks! Oct 04 17:23:44 dyo Oct 04 17:23:49 *yo! Oct 04 17:28:38 Napalm, but if you use a dirty rectangle you to know exactly what is on it. Since oldball+new ball means a bigger rectangle than just the balls, i need to know what else is in that rectangle, obstacles etc Oct 04 17:28:41 seems complicated. Oct 04 17:28:54 what? Oct 04 17:28:57 no you dont Oct 04 17:28:59 its clipped Oct 04 17:29:50 danijoo: show results Oct 04 17:29:51 can you clarify to me how I differ moveable objetcs from clipped ones? where do I make them clipped? Oct 04 17:30:10 when the app come back in foreground, I want to read these events and show results Oct 04 17:33:37 hi Oct 04 17:33:43 hi Oct 04 17:36:40 I'm using menu items in the action bar, I make them showAsAction so they are in the Action bar. But when I press them there is no effect. Oct 04 17:36:42 hi guys. how to find what is my device screen resolution . for eg. hdpi or mdpi or xhdpi and so on. Oct 04 17:36:57 is there any way to update notification created by startForegroud() without recreating it? Recreating it causes blikning Oct 04 17:37:16 How do I make feedback on theese buttons? Oct 04 17:37:43 Do I need to make a second 'pressed' png for each of my icon images and then make selectors? Oct 04 17:38:26 AKK9 thats a design question Oct 04 17:38:38 but that would give you 2 states if that what you want Oct 04 17:38:38 troned: one moment Oct 04 17:39:12 StingRay_, well I think im really asking if there is an easier way instead of duplicating my icons? Oct 04 17:39:25 murlidhar DisplayMetrics gives you what you want Oct 04 17:39:27 There is no option to set alpha Oct 04 17:39:31 In the drawable Oct 04 17:39:43 StingRay_: ah thank u :) Oct 04 17:39:54 So if I want my icons to look greyed out, is creating two icons the best option? Oct 04 17:40:27 well I wouldn't, but if using xml probably Oct 04 17:40:51 its possible to use an identifier with Otto? I have 2 View instances with the same subscriber and they are supposed to display different content but otto same the same twice, so they always have the same content Oct 04 17:41:18 the android wear emulator (watch) has no internet connection Oct 04 17:41:21 StingRay_, how woudl you approach it? Oct 04 17:41:22 is there any way to get one there? Oct 04 17:41:32 Change the alpha int he code using a onPress listener? Oct 04 17:41:35 If that exists? Oct 04 17:42:03 AKK9 code, I would personally mutate() the same drawable and filter it, putting it back to a stateListDrawable Oct 04 17:42:12 would…well… I do :) Oct 04 17:42:36 i think i can use an internal identifier but still... Otto would start unnecessary events before you can tell the data is for there Oct 04 17:44:23 If anyone was curious, the answer to my UI positioning question @ http://pastebin.com/fpma9rVD is that I needed to set parent view's padding to 0. Not sure why it has an effect, but it fixes it. Oct 04 17:45:34 StingRay_, can't you use setAlpha on a drawable? What does mutate do? Oct 04 17:45:58 AKK9 google search + docs Oct 04 17:47:48 StingRay_, I get it now !thanks. Oct 04 17:51:51 StingRay_, you are doing this for buttons in the actionbar? Oct 04 17:52:00 I dont use actionbar Oct 04 17:52:06 but for a menu bar view yes Oct 04 17:52:15 Napalm, so i should override onDraw and there I draw all the permanent stuff? and then when I do canvas.draw I just use a dirty rectangle? Oct 04 17:52:17 but for you maybe just have alternate state png's Oct 04 17:53:03 StingRay_, yeah I think I will definitely use it for other views, but for the actionbar i think it might be easier with seelctors states. Oct 04 17:53:08 Thanks Oct 04 17:58:14 with a mapFragment, is there a way to provide a list of points, similar to an adapter? Oct 04 18:00:49 can my app ask different permissions based on device's android version? Oct 04 18:01:38 MyWay: as far as I know, no. Oct 04 18:01:43 i would like to use https://developer.android.com/preview/material/ui-widgets.html#cardview "android.support.v7.widget.CardView" but i cant see any mention on http://developer.android.com/tools/support-library/features.html Oct 04 18:04:12 kuldeepdhaka it's in the v21 preview Oct 04 18:04:30 you can develop with it but you shouldn't release any apps to the public before the v21 support library is made publicly available Oct 04 18:04:51 i will be only using the card ui only Oct 04 18:04:59 ctrl+F for 'compatibility' here: https://github.com/timehop/sticky-headers-recyclerview Oct 04 18:05:02 and it support start from v7 ?? Oct 04 18:05:07 correct Oct 04 18:06:22 JacobTabak, sheh !?* Oct 04 18:06:26 troned: hey Oct 04 18:06:28 ? Oct 04 18:06:30 It's available as a preview in the support library repo Oct 04 18:06:35 Just depend on com.android.support:cardview-v7:21.0.0-rc1 Oct 04 18:06:46 Napalm, hey Oct 04 18:07:07 troned: i'll do you a quick example ok? Oct 04 18:07:20 I have a service which handles events: when the app is in foreground, the activity receives these events, too. When the app in background, the activity can't receive events and here is the question: is there any technique to queue things to do, or any other approach, in general, to this problem? Oct 04 18:07:26 it is like i said right, onDraw will be called first time, then I just draw with a dirty rect? Oct 04 18:07:30 JacobTabak, that was for google. theirs no public release for developers :) Oct 04 18:07:32 ok thanks, napalm, i appreciate it Oct 04 18:07:43 kuldeepdhaka there is, what are you talking about? Oct 04 18:07:50 MyWay use ordered broadcast receivers Oct 04 18:08:14 will read about it, thank you Oct 04 18:08:16 kuldeepdhaka i'm using cardview in an app im developing, its trivial, just add the dep like SimonVT said Oct 04 18:09:45 JacobTabak, oh. ok Oct 04 18:10:00 and look at my note regarding compatibility if your min api is < L preview Oct 04 18:12:09 JacobTabak, yea that note made me frown on google. (they should have release it in another package without any such tricks) Oct 04 18:14:15 Thank you JacobTabak and SimonVT let me try it! Oct 04 18:14:51 kuldeepdhaka the point is it's not finished - they did this to prevent developers from releasing it in apps before the lib is finalized Oct 04 18:15:27 Before L is finalized Oct 04 18:15:59 You should be glad they're finally releasing previews of future platforms Oct 04 18:16:12 also because they reserve the right to change the APIs for cardview, recyclerview, palette Oct 04 18:16:20 and don't want developers btching about them breaking their apps Oct 04 18:16:23 hum, that a valid reason. Oct 04 18:16:44 Besides, CardView has issues Oct 04 18:17:03 On L at least Oct 04 18:17:38 when can we expect the CardUI release (any wild guess) Oct 04 18:17:45 nov 1 Oct 04 18:18:36 not too long, we will release after that (possibility) we can wait. Oct 04 18:18:58 The new support libraries will likely be released along with L Oct 04 18:19:14 oh, thats why not in support library as i asked Oct 04 18:19:52 i should be sorry for the "!*?" :| Oct 04 18:22:13 Napalm, hmm now I question what I said. Im testing it now though Oct 04 18:22:30 troned: onDraw doesn't work on SurfaceView Oct 04 18:22:49 doesnt it get called in the beginning? Oct 04 18:22:53 no Oct 04 18:23:08 hey SimonVT what's your story Oct 04 18:23:35 Napalm, OK. I just don't get how the difference is made between what is clipped and what is not. Oct 04 18:23:47 will your example show that? Oct 04 18:23:55 My.. story? Oct 04 18:23:58 yea Oct 04 18:25:00 troned: when you draw to your canvas. Anything outside the clip area is not drawn. Oct 04 18:25:41 Napalm, yes I get that. But in the clip area there is a background, maybe obstacles etc. so then i need to know what those are Oct 04 18:26:12 troned: yea, get the clip area canvas.getClipBounds(rect); Oct 04 18:26:31 Isee Oct 04 18:26:33 however Oct 04 18:26:40 I have many balls so I have many dirty rects... Oct 04 18:26:44 yes Oct 04 18:26:46 on different places on the screen. Oct 04 18:26:58 so I clip the whole screen or I clip multiple times Oct 04 18:27:12 so you clip the max area or clip multiple times Oct 04 18:27:24 the union area is the norm Oct 04 18:27:37 which can end up being the entire screen Oct 04 18:27:49 but it will always be the most optimal size Oct 04 18:27:59 locking the canvas for each one you draw is probably not effective. Oct 04 18:29:18 but I cannot give multiple dirty rects as input? so I need to figure out the minimum clip area...(which itslef takes time)) Oct 04 18:29:35 troned: you can always do canvas.quickReject() Oct 04 18:30:07 troned: you simply union all your dirty rects Oct 04 18:30:12 which takes no time at all Oct 04 18:30:45 oh well my app is working, with that horrible made identifier thou Oct 04 18:30:48 rip clean code Oct 04 18:31:19 Napalm, is there a simple way? Oct 04 18:31:24 omg Oct 04 18:31:28 rect.union(rect); Oct 04 18:31:37 simple enough :) Oct 04 18:38:19 how can i check the text entered in password field is alphanumeric or how can i put constraint for alphanumeric password? Oct 04 18:39:20 troned: SurfaceHolder.lockCanvas(Rect); first time its called will ignore the Rect and lock the entire view. just as an added bonus Oct 04 18:39:30 troned: it also updates the rect Oct 04 18:39:37 You shouldn't care what the password is.. Oct 04 18:43:56 what so you mean?? Oct 04 18:49:41 Napalm, sorry if you hink I am stupid. But let's say inside the Rect I of course have the 2 balls. I also have the background and the obstacles. So if I get the with canvas.getClipBounds(rect); I also get the old ball positions. I want to get the rect without the balls, then draw the new balls (positions) Oct 04 18:54:07 http://lpaste.net/112083 <- my render method. so if canvas is the dirty rect it waont draw if that stuff is outside? Oct 04 18:56:05 SimonVT, "Could not find com.android.support:cardview-v7:21.0.0-rc1." Oct 04 19:00:20 how to update Notification so it updates without blinking? Oct 04 19:00:37 it was started with startForeground() Oct 04 19:03:35 why might mapFragent.getMap() always be null? Oct 04 19:03:55 and is there a way to listen for the map to become available? Oct 04 19:05:51 it's a method of a class Oct 04 19:05:55 it will not be null Oct 04 19:07:57 it's null, and I've actually seen recommendations to just call getMap() multiple times... Oct 04 19:08:05 there's got to be a better way Oct 04 19:08:10 you mean it returns null Oct 04 19:08:19 or the instance with that method is null Oct 04 19:11:00 JacobTabak: maybe I don't understand, but even if I use ordered broadcast receiver, if my activity is in background, I will not receive it, right? Oct 04 19:11:22 you can use a broadcast receiver to start your activity Oct 04 19:12:08 WHen publishing an app in Google app store should I upload a screenshot to 7/10inch categories if it looks the same as the phone screenshot? Oct 04 19:12:22 what is the minimum value of proximity sensor in your device? my device gives me 3cm. Oct 04 19:12:29 skulltower it should not look the same :) Oct 04 19:12:54 but this is not what I want; my problem is that my service is already doing anything I need in background, but when the user choose to view the activity and this come in foreground, I'd need to update it with old events Oct 04 19:13:28 I don't know if there is something like queue events waiting the activity come back in foreground, or some other approach to this Oct 04 19:14:23 MyWay sounds like you just need to update your UI onresume? Oct 04 19:14:32 if there is new data? Oct 04 19:14:39 MyWay do you not bind to the service ? to then get whatever you want from it ? Oct 04 19:15:06 StingRay_, urgh. Okay what about 7 and 10 inch screenshots, those can look different can't they? Oct 04 19:15:17 can look the same* Oct 04 19:15:24 MyWay: keep a notification. when user taps on it. the activity should come. startForeground(SERVICE_NOTIFICATION_ID, notification); Oct 04 19:15:27 yes JacobTabak, but I don't know which is a good approach to store/"queue" events happened when the activity was in background, I mean, how the activity knows which are old events happened? Oct 04 19:15:30 skulltower erm, mine would look diff, cause you have more/less space Oct 04 19:15:39 MyWay just always update your UI onresume Oct 04 19:15:43 depends … use your own judgement :) Oct 04 19:15:50 skulltower, if it looks the same there's no reason to, you're not tablet optimized Oct 04 19:16:21 or have your service store a timestamp in your shared preferences of the last data update Oct 04 19:16:24 and check that onResume Oct 04 19:16:56 getMap() returns null Oct 04 19:17:00 pfn, thanks that's what I needed Oct 04 19:17:48 uhm, keep a timestamp of the last update and then everytime it gets resumed, update it, this works, but I thought there is a "cleaner" approach to these things Oct 04 19:18:09 its pretty clean... just requery for updated data on resume Oct 04 19:18:10 can't I collect things happened, in some way, and then pass these to the activity, when the activity come in foreground? Oct 04 19:18:21 you'd have to check it onResume Oct 04 19:19:42 MyWay: keep a service running. when your activity starts. from activity query the service. or alternatively your service can store data somewhere from where the activity can read in. Oct 04 19:20:03 ... in onResume Oct 04 19:20:11 yes Oct 04 19:22:25 guys; minimum value of your proximity sensor please. i have MotoG which gives 3cm. want to know what yours give. Oct 04 19:22:49 give me an easy way to test and i will tell you Oct 04 19:23:07 if no one tells me, then i have to make an activity which will ask user for a test. it will increase the size of apk. Oct 04 19:23:35 any app like "Sensor Box" Oct 04 19:23:35 t2mkn, 0.0 cm Oct 04 19:23:50 SimonVT, ? Oct 04 19:24:07 EPG: thanks. Oct 04 19:24:13 any one else Oct 04 19:25:32 t2mkn i hold my hand 3 cm away and proximity sensor says 0cm Oct 04 19:25:32 t2mkn, thanks :) Oct 04 19:25:43 nexus 5 Oct 04 19:26:22 JacobTabak: got it. thq. Oct 04 19:27:20 JacobTabak: nexus 5 gives variable difference or just 2 values. like 0cm and 100cm as max? Oct 04 19:27:50 it always says 0 or 5.000305 Oct 04 19:28:00 not a scientific test Oct 04 19:28:01 is there any way for my service to know if the activity is in background, or foreground? Oct 04 19:28:04 but from my 3 seconds messing with it Oct 04 19:28:10 myway- ordered broadcast receiver Oct 04 19:28:30 oh, so I send a broadcast message and check it's boolean result Oct 04 19:28:36 not really Oct 04 19:28:39 its* Oct 04 19:28:42 "Could not find com.android.support:cardview-v7:21.0.0-rc1." unable to get card ui library. whats wrong in it? Oct 04 19:28:43 you send out the ordered broadcast, if the activity receives it and interecepts it, then activity is in foreground Oct 04 19:28:49 if activity doesn't receive it, then it's not in the foreground Oct 04 19:29:00 kuldeepdhaka are you using gradle? Oct 04 19:29:23 JacobTabak, Gradle 2.1 Oct 04 19:29:45 (only gradle) Oct 04 19:29:54 i'm sure you're not using 2.1 Oct 04 19:30:19 ok maybe not sure Oct 04 19:30:41 JacobTabak, i download it from gradle.org its v2.1 Oct 04 19:30:51 ok Oct 04 19:30:54 so not using android studio Oct 04 19:30:55 just gradle Oct 04 19:31:40 this is my dep Oct 04 19:31:41 compile 'com.android.support:cardview-v7:+' Oct 04 19:32:02 do you have everything updated in the SDK manager? Oct 04 19:32:16 specifically the google repository Oct 04 19:33:20 JacobTabak, installing L preview. will it use the library from the sdk manager? Oct 04 19:33:34 this is not part of the L preview Oct 04 19:34:06 http://cl.ly/image/2G3p3Z1E1L0W Oct 04 19:34:20 (i dont have much ram to feed as well as i like to know whats going on.) Oct 04 19:34:22 make sure ou have support repo and google repo installed Oct 04 19:38:52 JacobTabak, support repo not installed. (only support library) Oct 04 19:39:01 ok there's your issue Oct 04 19:39:56 JacobTabak, Android support repo OR Google repo Oct 04 19:40:30 probably support repo Oct 04 19:40:34 JacobTabak, i have neither installed Oct 04 19:40:34 i have both installed Oct 04 19:40:38 i don't see why you wouldn't install both Oct 04 19:41:19 troned: hey.. check this out https://gist.github.com/slightfoot/a519bc3627f49c44a226 Oct 04 19:41:27 and if you really do care, these are not really questions you need to ask, you can just install one, and see if it works, if not delete it Oct 04 19:41:42 JacobTabak, i never required them Oct 04 19:41:46 Napalm, ty for your effort, i will look at it Oct 04 19:41:48 i don't care Oct 04 19:41:49 kuldeepdhaka Oct 04 19:42:43 JacobTabak, on a 30KB/S line thing doing get that way Oct 04 19:43:09 i can download and *just* delete. :p Oct 04 19:43:18 troned: you'll see the green area is the area thats only being clipped and updated Oct 04 19:43:42 it takes hours of effort and patience Oct 04 19:44:38 troned: if your game objects area in a virtual playfield larger than the view then you can test to see if its in the screen and only render the items in the screen. Oct 04 19:44:41 *i cannot download Oct 04 19:45:29 troned: flip the mDebugEnable to actually do the clipping. without it we just draw the clip rect in green. Oct 04 19:47:30 kuldeepdhaka you have my sympathy, but you can just google this stuff to find out which repo its in Oct 04 19:47:39 i'm pretty sure its in the support repo... because they're support libraries Oct 04 19:52:10 JacobTabak, i thought that the library will be downloaded from some server for me by gradle Oct 04 19:52:21 Napalm, thanks a lot Oct 04 19:52:25 that's not how it works with google play services or the support libraries Oct 04 19:52:34 did you actually do that for me? then you are to nice lol :) Oct 04 19:54:13 I need Google Analytics help Oct 04 19:54:30 I am seeing that it is tracking real time screen views Oct 04 19:54:40 but it doesn't track screen views after they're done Oct 04 19:54:41 WHY? Oct 04 19:54:50 thank you, JacobTabak, it is working :) Oct 04 19:54:57 np MyWay Oct 04 20:14:10 troned: did you try it.. is that helpful? Oct 04 20:15:10 Napalm, was away, trying it right now Oct 04 20:30:24 Napalm, ty Oct 04 20:31:01 It was already a lot smoother using SurrfaceView properly than as i was before (and definetaely compared tu using a normal View) Oct 04 20:31:13 and with the clipping it seems even slightly smoother Oct 04 20:31:21 now i just have some GC to track down Oct 04 20:55:18 I have a nexus 7 with a cracked screen, so the touch screen doesn't work. I'm trying to open it via adb shell so I can recover the data. However, adb shell says: error: device unauthorized. Please check the confirmation dialog on your device. However, I can't check the confirmation dialog because the touch screen doesn't work... I have a USB adaptor that should, I think, allow me to use a USB mouse with the screen, but then Oct 04 20:55:18 obviously it won't be plugged into the USB cable to my laptop. Is there a way to authorize the device permanently, so I can then unplug the mouse and plug in the USB cable? Oct 04 20:58:04 puff: Adb via network? Oct 04 21:03:56 flan3002_: Good point. Oct 04 21:07:39 I don't know if that dialog goes away when you unplug usb Oct 04 21:07:52 you could also try plugging in adb, getting the auth dialog, unplugging usb, plug in OTG mouse Oct 04 21:08:01 check auth Oct 04 21:08:06 no clue if it'll stick or not Oct 04 21:08:08 but i'd try it Oct 04 21:08:38 dragorn: Worth a shot. Oct 04 21:11:13 i’m testing in app purchasing, using android.test.purchased as the SKU… after the first time i did it, it always comes back saying i own the IAP… how can i reset that? Oct 04 21:12:04 ttps://github.com/twotoasters/RecyclerViewLib looks like some relief. (curiosity) will it cause licensing problem (in any form) with google by releasing an app on google play based on this library? Oct 04 21:13:16 kuldeepdhaka what do you need RecyclerView ? Oct 04 21:13:35 is there a way to scrub earlier APKs or expansion files from Google's systems? Oct 04 21:13:40 StingRay_, because the lib include CardView Oct 04 21:14:00 ok, why do you need CardView view class ? Oct 04 21:14:00 kuldeepdhaka: looks like stock APL, so as long as you obey those terms, you're fine. Most android things are APL at this point. Oct 04 21:15:04 dragorn, APL Android Public licence ? Oct 04 21:15:28 kuldeepdhaka btw just interested why you need CardView …as in technically Oct 04 21:17:02 kuldeepdhaka: apache. read the license file in the link you provided. Oct 04 21:17:02 StingRay_, i need to build an ui with card like view (though subset subset) Oct 04 21:17:31 card like view is kinda easy though right / Oct 04 21:17:51 StingRay_, i can do with GridView but i have code alot everything myself. Oct 04 21:18:39 CardView is not a grid or list type view thought ? Oct 04 21:19:08 it's just a view with a handy corner radius ? that can really be done with any drawable Oct 04 21:19:17 or thats what I assumed not having looked into it Oct 04 21:19:20 dragorn, they are using google code, and mean to say directly or indirectly? Oct 04 21:20:41 StingRay_, the dotted top part (click to open a menu), look and its the future are some reason not to code it myself Oct 04 21:21:11 StingRay_, using others code is easier (as long as it work as intended :p) Oct 04 21:23:37 kuldeepdhaka yeah…suppose I dont really get the hoops to get to something that I just cant see the benefit … but maybe cause I have that stuff already Oct 04 21:25:49 is there a way to use maxWidth and match_parent at the same time? or to get a similar effect? I want the element to match the width of the parent unless the parent width is over X dp Oct 04 21:26:20 d0de conditions you kinda have to code Oct 04 21:26:34 oh bother Oct 04 21:26:46 sometimes you maybe be able to fudge things with lots of views and relations Oct 04 21:26:49 but not worth it Oct 04 21:29:47 thank you for the advice :) Oct 04 21:52:13 I didn't realize I would have to convert pixels to dp myself when setting with width programmatically, it's kind of a pain :( Oct 04 21:57:50 Hi, I'm currently thinking about creating a simple app. I'm relativly new to android/java development and I'm currently wondering if I should first start with the visual layout of the app or programming the backend logic. Where do you guys start first? Oct 04 21:58:22 Klausmeier1: How simple? Oct 04 21:58:36 Klausmeier1: If you got to ask this, it's probably not simple enough. :P Oct 04 21:58:38 Klausmeier1: It's probably better to draw the UI out first, and knowing what you want it to do generally Oct 04 21:58:55 Although, I like to make the app functional first, then make it pretty :] Oct 04 21:59:37 flan3002_: The user should be able to define questions, answer them and those anwsers should be stored in am small sqlite db Oct 04 22:00:30 Klausmeier1: Get an ugly UI working and tune it after the basic logic works. Oct 04 22:02:56 flan3002_ that sounds happy hazzard and odd :) Oct 04 22:03:10 i usually develop in c# where i'm relativly confident what i'm doin' but like i said i am relativly new to java and android. my main problem atm is the whole activity thing :D Oct 04 22:03:12 that how most indie devs work ? Oct 04 22:03:29 Hello Oct 04 22:03:31 Klausmeier1, instead of wandering everywhere, i suggest you to learn how android manages its ui, how things are loaded, (android is a GNU/Linux flavor), looks for basic ui api (ex: TextView, Button EditText), inflation of layouts, states of Activity (later for Fragment also). and teach yourself that java is the central programming langauge for Android. thought highend stuffs are their like opengl Oct 04 22:03:47 Does anyone know how to diagnose a boot loop before adb starts? Oct 04 22:04:01 michael__ wrong place to ask Oct 04 22:04:36 *though high-end stuffs are also their Oct 04 22:05:01 where do i ask? #android-root ... but everyone there is idle! (hehe) Oct 04 22:05:07 StingRay_: I asked on #android-root and waited about an hour. Not one person replied, or even logged in/out Oct 04 22:05:28 michael__ well, silence or not… does not alter the fact this is the wrong place :) Oct 04 22:05:29 i think i wont need opengl :D i am a programmer, if i erver touch a graphics libary everyone is going blind:D Oct 04 22:05:49 after understanding this, you can easily punch anything Oct 04 22:06:36 StingRay_: Then what place, other than #android-root would you suggest? Oct 04 22:07:02 michael__ dunno, this is not really the place to ask for directions either… but if you ever start app development ;) Oct 04 22:08:34 Klausmeier1, go for native android app as much as possible. (not because its easier or more documented but on platform likes these *UI* (ie nui) matters alot) Oct 04 22:09:03 *native android != JNI Oct 04 22:09:15 kuldeepdhaka: nativ in the sense like NDK? Oct 04 22:09:47 *native android != NDK Oct 04 22:09:57 No. Just not PhoneGap and stuff. Oct 04 22:10:06 *i mean to say native looking android app Oct 04 22:11:14 A ok. Last week my boss told me to have a look at PhoneGap :D He want to bring our point of sales System to mobile devices :D Oct 04 22:11:39 oh gawd :/ Oct 04 22:12:19 Klausmeier1, i never used phone gap (so im not the right guy to comment on it). all i can say is native look and feel of app is important Oct 04 22:14:18 learned the hard way: i could have ported my Qt app to android (no pun intended) with less effort but i took the hard way and it payed off Oct 04 22:14:48 (actually tried for a while) Oct 04 22:16:49 So i think starting to outline my app. in the way that i know where i need to start reading Oct 04 22:18:30 can anyone suggest a way to get maxWidth to work for an element set to match_parent? I don't care if it's a horrible hack, I just really need to get this flipping view to have a max width and doing it cleanly with code is becoming a massive headache Oct 04 22:20:29 anyone ever tried installing Amazon's AWS toolkit into Eclipse? Oct 04 22:20:56 I'm working with a fresh installation of Eclipse now, as the first time around adding one of the Toolkit's modules fucked Eclipse up Oct 04 22:21:49 I first added the URL to their repo as "Amazon's AWS ToolKit - Fuck Amazon" Oct 04 22:21:52 I think they sensed it Oct 04 22:23:39 d0de: subclass the layout, override onMeasure, call super, check measured width, if it's too wide call setMeasuredDimension with the max width Oct 04 22:23:55 Napalm: I have followed your example and my dirty rectangle is correct but still the Canvas is to big after I do canvas = gameView.getHolder().lockCanvas( gameView.getDirtyRect() );. I know it is somewhat impossible without the code but is there some obvious error I could be making? Oct 04 22:24:22 BAM! Oct 04 22:24:26 The dirty rect covers the whole screen even inside the render method even though the dirty rect i pass in does not Oct 04 22:24:28 you just got answered, d0de Oct 04 22:24:31 lol Oct 04 22:26:13 JakeWharton, thank you, sincerely Oct 04 22:26:22 but I think my head might be about to explode :\ Oct 04 22:26:46 seriously man, if the main reason behind Google preventing us from deleting a previously-published app was to avoid this happening with paid apps, why can't they just figure out what is actually a paid app and only prevent it on those only? Oct 04 22:26:54 since you also cannot go from Free app to Paid app on the Market? Oct 04 22:27:01 there is bullshit afoot Oct 04 22:29:04 I think his answer was too complicated d0de Oct 04 22:29:24 to him it might seem clear; but I have no fucking idea what subclassing a layout would possibly mean Oct 04 22:29:40 public class MaxWidthLinearLayout extends LinearLayout Oct 04 22:29:42 try to put what you need in 1 sentence and go to Google with it Oct 04 22:29:44 you just subclasses Oct 04 22:29:50 subclassed Oct 04 22:30:03 can someone please look at this class? it’s for in app purchasing. i successfully made the test purchase, but the app bombed (NPE) when calling consumeAsync… now when i run it again, it says the purchase has already been made and i don’t know how to consume it properly to reset on their test server Oct 04 22:30:07 http://pastebin.com/PBae4UFc Oct 04 22:30:11 I don't think the answer was too complicated, I think the technique to accomplish this in Android is too complicated and any competent answer will reflect that Oct 04 22:30:24 but then again I'm a horrible programmer so what do I know Oct 04 22:30:29 + Oct 04 22:30:38 d0de: well get this working and you'll be a tiny bit better Oct 04 22:30:40 that's what we always say; I suck, Google must know what they're doing Oct 04 22:30:43 then do that over and over Oct 04 22:31:02 and you'll be knocking this crap out before you know it Oct 04 22:31:21 until you grow the programming balls to badmouth the framework, and truly become a horrible programmer Oct 04 22:31:24 haha Oct 04 22:31:39 My app will need to make HTTP requests now and then. Should I use a Loader or an AsyncTask? (It'll actually be a Reddit cilent, in case that helps.) Oct 04 22:31:49 Thank you. You're almost certainly right. I just get demoralized when I face the prospect of adding what seems to me to be non-trivial code to accomplish a task I can't help but feel is fairly trivial Oct 04 22:32:00 I never thought anything could make me miss CSS Oct 04 22:32:00 identifying and accurately criticizing the bad parts of the framework is the sign of a good programmer Oct 04 22:32:04 same feelings with everybody d0de Oct 04 22:32:15 rarely is anyone correct in doing so, Jake Oct 04 22:32:37 i disagree, and am happy to complain about most of Android Oct 04 22:32:40 Sicp: The Android API has plenty of horrible stuff going on. Oct 04 22:32:40 most do it to seem like they know what they're talking about by bringing out the bad side of it instead of jumping the bandwagon of praising it Oct 04 22:32:55 Many do it to create positive change. Oct 04 22:33:10 Bad design decisions need to be criticised. Oct 04 22:33:20 I haven't tried anything else as deeply as Android Oct 04 22:33:23 so I wouldn't know Oct 04 22:33:31 still noob Oct 04 22:34:12 there’s always more to learn Oct 04 22:34:18 like f’n in app purchases Oct 04 22:34:53 and Amazon AWS Oct 04 22:35:50 * StingRay_ thinks iap are a little flawed Oct 04 22:35:56 you guys ever tried Director? for Eclipse? Oct 04 22:36:20 IAP is fine so far, haven't gotten to dealing with it directly yet. it's their plugins and sample code that come broken straight from repo! Oct 04 22:36:31 do you know much? i got a NPE trying to consume the purchase for the test environment… now i just keep getting an error saying it’s already purchased and i can’t do anything Oct 04 22:36:42 http://pastebin.com/PBae4UFc Oct 04 22:37:13 i want to know how to consume it now, even though it’s already purchased Oct 04 22:38:11 ultra- i ditched all the pre-defined test crap and tested it live with purchases Oct 04 22:38:46 wouldn’t you run into the same problem? always already purchased? i want to be able to test repeatedly Oct 04 22:39:26 ultra, I ran into the same problem, couldn't find a way around it Oct 04 22:39:26 well I tested it live…as in another account with credit card Oct 04 22:39:39 then refunded? Oct 04 22:39:44 but I did notice that even with refund, the purchase state on live iap does nothing Oct 04 22:39:52 well, cept give the money back :) Oct 04 22:40:11 state still stays as purchased for managed things :( Oct 04 22:40:26 wtf Oct 04 22:40:29 had hoped it updated, but checked over the span of 4 months and still the same lol Oct 04 22:40:41 though wallet and destination show it as refunded Oct 04 22:40:49 yeah, the iap stays active for a really long time Oct 04 22:41:14 d0de na, something is wrong cause the 1st test I ever did and refunded is still purchased Oct 04 22:41:20 and thats 7-8 months Oct 04 22:41:26 so the app itself can’t remove what they purchased? Oct 04 22:42:33 oh, mine stayed active for about a month IIRC Oct 04 22:42:44 when the auto cancel thing kicks in, even though I had cancelled it manually Oct 04 22:43:16 basically i have to throw this out there and hope it works Oct 04 22:43:51 d0de how do you check the state ? purchaseState ? Oct 04 22:44:09 cause mine is still state 0, purchased on all the test ones I refunded Oct 04 22:44:15 it’s all here: http://pastebin.com/PBae4UFc Oct 04 22:44:16 let me check Oct 04 22:44:30 oh, nm Oct 04 22:46:39 I don't understand how I can't update ADT, I get the error that I still don't have "the update that I'm trying to install" Oct 04 22:46:48 23.0.4 Oct 04 22:48:13 anyone noticed "http://developer.android.com/assets/js/android_3p-bundle.js:2477" or something like this scripts cause firefox to show not responding problem? Oct 04 22:49:47 this is common ^^ on firefox for me (causing a lag) but it works fine on chrome Oct 04 23:04:28 oh my god, seriously this is what is happening? you download ADT and try to update it and it fails? Oct 04 23:04:39 it's not like some practical joke or anything? Oct 04 23:05:24 I challenge you, open Eclipse now and update ADT Oct 04 23:05:47 whats eclipse ? oh dont matter…too busy neways Oct 04 23:08:46 this is a mockery! Oct 04 23:09:04 may the developers of this bundle suffer health issues Oct 04 23:09:18 help me Joe Peschi! Oct 04 23:16:04 Sicp: It's better to download Eclipse and then install ADT. Oct 04 23:16:12 The version of Eclipse that comes with the bundle is terrible. Oct 04 23:16:22 (Another problem with Android development, BTW.) Oct 04 23:17:05 I wish Apple handled Android Oct 04 23:17:11 mind == blown Oct 04 23:17:17 you heard it here first Oct 04 23:17:53 That would be the worst Oct 04 23:18:07 look at how much frustration there is in this thread, http://stackoverflow.com/questions/12634568/how-can-i-update-my-adt-in-eclipse Oct 04 23:18:46 i mean eclipse is crap.. I stopped using it about 3 years ago. Oct 04 23:18:55 you use the other crap now? Oct 04 23:19:18 tell me, how do you import a project to AS? Oct 04 23:19:19 lol Oct 04 23:19:20 I use AS now. I was using intellij before that. Oct 04 23:19:38 You go to the file menu and then click import... Oct 04 23:19:48 I can't use AS until it supports JVM unit testing on Gradle. Oct 04 23:20:06 that's how you access the import functionality, that doesn't import your project Oct 04 23:20:07 Sicp: What's wrong with installing the latest Eclipse and then ADT? Oct 04 23:20:10 It's the best solution, IMO. Oct 04 23:20:27 you browse to the project, and then you press OK, and then it fails because of Oct 04 23:20:42 I know there are solutions to it, but what is this shit man Oct 04 23:20:58 I'm pretty sure the Android bundle is simply broken right now. Oct 04 23:21:06 Well, it was completely broken. Then it was "fixed". Oct 04 23:21:10 you cannot update it Oct 04 23:21:14 out of the box, you can't Oct 04 23:21:17 imagine Oct 04 23:21:28 You should be able to update the current one. Oct 04 23:21:34 Did you install the Android bundle again? Oct 04 23:21:45 how to get Activity (e.g. MyActivity) class name without package name (com.example.MyActivity)? Oct 04 23:21:51 I think it's updateable, but it uses a horrible old version of Eclipse that doesn't let you move toolbars. Oct 04 23:21:55 yea I gave them the benefit of the doubt, got a fresh ADT and didn't touch anything, just Install New Software > Update Oct 04 23:21:57 And that has a bug that entails a huge gap in the toolbar. Oct 04 23:22:23 Just install Eclipse and then ADT, d00d. It's without doubt your best option. Oct 04 23:22:29 You get an updateable Eclipse. Oct 04 23:22:32 I used to do that Oct 04 23:22:37 I will again I guess Oct 04 23:22:56 cause Eclipse is a powerful IDE man Oct 04 23:23:05 It's powerful but I hate it. Oct 04 23:23:37 I wouldn't stop it unless AS became as seamless as it, Im not willing to compromise for some hackers that think people will settle for something less than perfect; fuck them Oct 04 23:23:47 not that they care what I think\ Oct 04 23:24:17 I want to code, not fucking fix paths! Oct 04 23:24:26 Sicp no need to swear so much Oct 04 23:25:02 how else are you going to understand the magnitude of the frustration Oct 04 23:25:13 lol Oct 04 23:25:14 fine Oct 04 23:25:18 Sicp the amount of lines you are spamming Oct 04 23:25:21 thats Oct 04 23:25:23 indication Oct 04 23:25:24 enough Oct 04 23:25:44 I wasn't doing that thing I mentioned earlier, my lines are long Oct 04 23:32:07 If you're a new Android developer, you should consider starting with Android Studio, because the ADT plugin for Eclipse is no longer in active development. Oct 04 23:32:14 from https://developer.android.com/sdk/index.html Oct 04 23:32:30 yet the links are all still there, everything is as it was when it was still in development Oct 04 23:32:32 wankers Oct 04 23:33:37 AS: "It's currently in beta but will be the official Android IDE once it's ready." Oct 04 23:33:47 so basically, you have something that is deprecated and something that is not ready Oct 04 23:33:55 go nuts! Oct 04 23:37:43 it seems that ADT is being sabotaged Oct 04 23:38:53 constant errors on updates Oct 04 23:41:46 Sicp just install AS or IJ and be done with it Oct 04 23:41:57 you have something against moving on ? Oct 04 23:42:51 adb, ant and ndk for me... Oct 04 23:45:53 Why do people define AsyncTasks as inner classes of Activitys/whatevers? That doesn't seem like a good idea at all. Oct 04 23:46:03 (Since the inner class will hold a reference to the Activity/whatever.) Oct 04 23:50:55 Transfusion Oct 04 23:50:59 oopsy Oct 04 23:51:02 i mean TacticalJoke Oct 04 23:51:10 yea, i see it way too often Oct 04 23:51:36 I guess people just dont relise Oct 04 23:51:38 realise Oct 04 23:52:14 Even one of the Android developers did it in a tutorial: http://www.androiddesignpatterns.com/2013/04/retaining-objects-across-config-changes.html Oct 04 23:52:19 Weird. Oct 04 23:53:10 I hate how almost anything in Android can be unnecessarily complicated and hard to understand. And documentation is often awful, leading us to depend on StackOverflow questions or blog posts to figure out how to do stuff. Oct 04 23:53:27 Considering it's an async task, the goal is typically to couple it to the activity Oct 04 23:53:58 pfn: it should be loosly coupled Oct 04 23:54:16 depends on what you're doing Oct 04 23:54:33 Won't there be a memory leak if the AsyncTask is an inner class of the Activity? Oct 04 23:54:34 agreed Oct 04 23:54:45 for loading data from the network, it shouldn't be coupled at all Oct 04 23:54:52 TacticalJoke: only whilst the AsyncTask is running Oct 04 23:55:33 your data should probably exist independently of your activity, and as such, your task shouldn't be coupled to the activity Oct 04 23:56:31 TacticalJoke: he's not leaking the activity in that example Oct 04 23:56:42 Napalm: How comes? Oct 04 23:56:51 the parent object is a fragment Oct 04 23:57:06 but if the async task is calculating some data on performing heavy math for rendering, there's really no reason to be afraid of coupling Oct 04 23:57:07 fragments are not tightly coupled to the activities Oct 04 23:57:36 Is he leaking the Fragment, though? Oct 04 23:57:42 no Oct 04 23:57:47 the fragment is retained Oct 04 23:58:29 Hmm. What if the OS wants to kill the fragment? Oct 04 23:58:39 it can Oct 04 23:58:42 If, for example, the user closes the app. Oct 04 23:58:51 the fragment state can change, just the object cannot be collected by the GC Oct 04 23:58:55 and once the AsyncTask is finished the GC will pick up the Fragmeent Oct 04 23:59:11 Okay. Oct 04 23:59:48 pfn: What do you think about using a Loader for making an HTTP request (in a Reddit app)? I know, the other day, you suggested a Service (I think) for anything like this. Oct 04 23:59:52 agreed he might want to implement onDestroy in the Fragment and kill the task.. but that really depends on the task Oct 05 00:00:13 I really like Loader's Oct 05 00:00:16 loaders are the shittiest api ever Oct 05 00:00:19 lol Oct 05 00:00:26 pfn: just because you had a bad experience once Oct 05 00:00:27 :D Oct 05 00:00:34 like, God, what were they thinking bad Oct 05 00:00:35 Napalm: Ah. I see that he does that in the full code: https://github.com/alexjlockwood/worker-fragments/blob/master/src/com/adp/retaintask/TaskFragment.java Oct 05 00:00:53 Could I use one Service for both downloading Reddit stuff and posting Reddit stuff? Oct 05 00:00:57 I'm clueless about Services. Oct 05 00:00:59 Once you wrap Loaders with a bit of boiler plate they are fine Oct 05 00:01:01 Anyone know the correct way to save a listviews sate, such as where the user is and all that good stuff? Oct 05 00:01:07 TacticalJoke, the os. never kills individual objects, just the process as a whole Oct 05 00:01:08 state* Oct 05 00:01:24 Napalm, what we wrote was all boiler plate Oct 05 00:01:48 it's a shitty api no matter which way you look at it Oct 05 00:01:54 So, if you guys were writing something like a Reddit client (which does HTTP requests, basically), would you use a Service for both downloading content and uploading posts? Oct 05 00:02:00 the goal is admirable, but the api sucks Oct 05 00:02:11 And would it be a single Service for all? Oct 05 00:02:28 service is for life cycle management, that's all Oct 05 00:02:36 When you say service you mean like an actual background service? Oct 05 00:02:38 pieces029: it should already be done by the framework.. are you using a ViewPager? Oct 05 00:02:46 pieces029: Yeah. Oct 05 00:02:50 Napalm: no just a list view Oct 05 00:02:53 I wouldn't place network IO in a service at all Oct 05 00:03:01 pfn: Oh. Where would you put it? Oct 05 00:03:13 TacticalJoke, any sort of singleton object Oct 05 00:03:18 I thought you suggested an IntentService for this (the other day)? Or maybe I'm misremembering. Oct 05 00:03:20 TacticalJoke: I would just use Retrofit to get the content needed. It's funny I'm actually working on something like that right now. Oct 05 00:03:21 pieces029: you are going to have to elaborate on how you use the ListView Oct 05 00:03:40 TacticalJoke, the lazy way to do it would be an. intent service Oct 05 00:03:42 pieces029: is it in a fragment? do you swap that fragment out at runtime outside the normal activity lifecycle? Oct 05 00:03:44 pfn: But where do I do the blocking IO stuff? Oct 05 00:04:16 TacticalJoke, any arbitrary object with it's own thread management, how you want to do that is up to you Oct 05 00:04:35 runnable and executors, rxjava etc Oct 05 00:04:40 Napalm: alright, I'm actually using flow and mortar, so it might be an issue in there. So I have a custom view that has a listview in it, when I navigate away and come back, the users position is loast, and all content needs to be re-downlaoded and added back in. Oct 05 00:04:54 Hmm. Some people suggested IntentService in here the other day. Oct 05 00:04:59 TacticalJoke, services are only life cycle management containers Oct 05 00:05:01 TacticalJoke: IntentService runs its message handler off the main thread.. your suppose to block as much as you need Oct 05 00:05:12 I would advise against intentservice, they get really messy really fast. Oct 05 00:05:18 Okay. lol Oct 05 00:05:24 an intent service has some life cycle management in conjunction with a job executor. Oct 05 00:05:35 it's just a convenience Oct 05 00:05:43 pieces029: sounds like you were misusing it Oct 05 00:06:14 intent service is a convenience in the same way as array adapter, imo Oct 05 00:06:31 Is it better to use Executor than Thread? Oct 05 00:06:40 a little more powerful, but still limited just the same Oct 05 00:06:45 Possibly. I am following the way that the Mortar example does it. But it's basically the same as if you had a custom view with the listview in it. Oct 05 00:06:53 executors typically manage thread pooling for you Oct 05 00:07:00 I see. Oct 05 00:07:16 normally you don't want to be. managing threads yourself Oct 05 00:07:27 pieces029: Link me to the Mortar example and perhaps I can comment Oct 05 00:07:27 What's the difference between an Executor and a FutureTask? Oct 05 00:07:35 Yeah. Oct 05 00:07:42 Napalm: I can send you my code. It's open source. Oct 05 00:07:48 a future task is a result of calling an executor... Oct 05 00:07:51 Oh. Oct 05 00:08:20 So, if I'm writing a Reddit client, creating a Singleton that internally uses Executors is a good solution for both downloading content and posting content, right? Oct 05 00:08:21 you throw a task at an executor, it's now a future task Oct 05 00:08:28 I see. Oct 05 00:08:53 Napalm: Here is the mortar example, https://github.com/square/mortar/blob/master/mortar-sample/src/main/java/com/example/mortar/view/ChatListView.java and here is my code, https://github.com/pieces029/on-this-day/blob/master/src/main/java/com/andrewreitz/onthisday/ui/show/ShowListView.java Oct 05 00:09:33 pieces029: Did you say you're creating a Reddit client? Oct 05 00:09:42 Yeah was just going to link you some code Oct 05 00:09:47 Okay. lol Oct 05 00:09:53 https://github.com/pieces029/on-this-day/blob/master/src/main/java/com/andrewreitz/onthisday/data/api/reddit/OnThisDayRedditService.java That's my code using Retrofit. Oct 05 00:09:58 make sure it doesn't suck. they all suck. Oct 05 00:10:02 Wait -- would an IntentService have a higher priority than a Singleton that uses Executors? Oct 05 00:10:12 pretty sure it's impossible to make a good reddit client Oct 05 00:10:14 JakeWharton: Make sure my sample doesn't suck? Oct 05 00:10:15 haha Oct 05 00:10:23 JakeWharton: Why impossible? Oct 05 00:10:43 The code on Retofit's website is gong to be much more helpful. Oct 05 00:10:49 Every Android Reddit client I've used so far sucks. Oct 05 00:10:53 Hence my desire to make one. lol Oct 05 00:10:55 i’m pretty happy with Alien Blue, but I’m not sure if it’s available for android Oct 05 00:10:59 TacticalJoke, they have no priorities, you set whatever pri you want Oct 05 00:11:01 It's not, unfortunately. Oct 05 00:11:26 pfn: I mean... would the Executors be more likely to be process-killed than IntentServices would? Oct 05 00:11:28 I'm really happy with Reddit Sync. The one I'm making is specificically for getting on this day posts on the grateful dead subreddit. Oct 05 00:11:31 i just wish alien blue showed flair (like in /r/nfl), but otherwise it’s great Oct 05 00:11:45 TacticalJoke, services are a life cycle container Oct 05 00:11:50 hippie reader! Oct 05 00:11:54 executors are not Oct 05 00:11:58 I use RedReader on Android. Oct 05 00:12:10 It's the best I've tried, but it doesn't even support linking to specific comments. Oct 05 00:12:17 Or loading all comments. Shows only around 200 comments. Oct 05 00:12:17 if your app does not have any active life cycle object, it is eligible to be killed Oct 05 00:12:50 Is there any case where an IntentService wouldn't be killed but an Executor inside a singleton would? Oct 05 00:13:09 With regard to what I'm doing. Oct 05 00:14:05 I'm asking because I wouldn't want the "post to Reddit" task being easily killed if the system gets low on memory. Oct 05 00:14:28 "Download thread" tasks can be, of course. Oct 05 00:14:38 ("thread" = "Reddit thread") Oct 05 00:15:20 TacticalJoke: if you have a task that MUST happen, check out tape. Oct 05 00:16:36 Hmm. I'm hoping to do this without creating too many dependencies on third parties. Oct 05 00:16:53 I don't get something. Why can't I just use an AsyncTask? Is it because it's too dependent on the UI? Oct 05 00:17:23 You can. Oct 05 00:19:20 What if I have a singleton that uses AsyncTasks under the hood? Oct 05 00:20:00 RedditConnection.downloadThread(Url url) --> does stuff with AsyncTask --> fires callback. Oct 05 00:20:09 Is there any problem with that? Oct 05 00:20:23 So an async task that has a queue to scheudle what it runs? Oct 05 00:20:34 Or you just fire and forget? Oct 05 00:20:43 Fire and forget.. Oct 05 00:20:45 .* Oct 05 00:21:00 Any ideas on why this crashes on line 62? All other out.println("some text here") work. As soon as I type text and hit enter I get "Rando has stopped working" Oct 05 00:21:53 http://pastebin.com/MD4GFWQQ Oct 05 00:22:27 TacticalJoke: The issue with that, is that the AsyncTask only has 10 threads, I believe, what if you have an error? How will you handle that, or ensure that it retries? Oct 05 00:22:34 Might only have 5 Oct 05 00:22:53 I think it varies depending on the version, but pretty sure it's 10, can't remember. Oct 05 00:23:13 So I can't use more than 10 in one go? Oct 05 00:23:52 Correct, wich should be fine, as long as they keep going through. Oct 05 00:24:46 You're going to want to make sure you have good error handling. Oct 05 00:25:20 pieces029: Is this documented anywhere? Oct 05 00:25:22 I'm trying to find it. Oct 05 00:27:31 https://android.googlesource.com/platform/frameworks/base/+/refs/heads/master/core/java/android/os/AsyncTask.java Oct 05 00:27:45 Looks like it's double the cpu core size plus 1 Oct 05 00:28:33 That's not really the issue with using it, it's just easy to get it wrong, where it borks up the whole queue. Oct 05 00:29:00 My tasks will just be "download this Reddit thread" and "upload this post to Reddit". Oct 05 00:29:15 And stuff like that. Oct 05 00:31:13 So I guess it doesn't matter too much. Oct 05 00:31:21 I dunno; I'm just looking for simplicity to start with. Oct 05 00:31:32 I can become an Android multi-threading wizard later, I guess. Oct 05 00:31:45 Assuming that there is sufficient documentation. Oct 05 00:32:56 JakeWharton: Were you joking about it being impossible to make a good Android Reddit client? I'm now wondering whether there's some Android limitation I'm unaware of. Oct 05 00:33:09 no i'm not joking Oct 05 00:33:16 it's not impossible, it's just improbably Oct 05 00:33:19 improbable Oct 05 00:33:34 The reddit api sucks... Oct 05 00:33:41 Why, JakeWharton? Oct 05 00:34:49 Is there something about Android that makes it hard to make a good Reddit client? Oct 05 00:34:53 no Oct 05 00:36:21 I guess you mean "All the existing ones suck", or something. Oct 05 00:36:35 With which I agree. Oct 05 00:37:22 it's a medium that's is hard to translate to a small screen appropriately Oct 05 00:37:50 the content is wildly heterogenous, the comment system is crazy, etc. Oct 05 00:39:01 Yeah. Mine will be very minimalistic in its UI for this reason. Oct 05 00:41:39 when I create an activity manually with android studio - new class instead of new activity, then I make the associated xml file, It doesn't recognize it with R.layout. What else do I need to do to turn a class into an activity Oct 05 00:42:43 doesn't recognize R.layout should have nothing to do with if it's an activity… more to do with the import of R Oct 05 00:43:50 TacticalJoke, you must always have a live managed object in order to keep your app from being killed Oct 05 00:43:59 either a service or activity Oct 05 00:45:01 but you only really need. the service for life cycle management, you don't necessarily need to put jobs in it Oct 05 00:45:06 StingRay_, so I should be able to manually create an activity then? by creating the java class which extends Activity and the associated xml file? Oct 05 00:45:16 If a user uploads a Reddit post and then presses the Home button, I'd want the upload to run in the background. Would it be best to go for a Service, then? Oct 05 00:45:24 just create a DontKillMeService Oct 05 00:45:35 bilb_ono yeah, and the two have nothing to do with each other Oct 05 00:45:45 and start / stop it whenever you have jobs in the background Oct 05 00:45:55 I see. Oct 05 00:45:56 you're basically done Oct 05 00:46:05 And I can use AsyncTasks on top of that? Oct 05 00:46:12 intent service does the same thing automatically Oct 05 00:46:26 that's why it's a frequent suggestion for trivial cases Oct 05 00:47:01 my app sometimes makes the phone reboot. Is there anywhere I can find logs of system failure like that? Oct 05 00:47:04 :( Oct 05 00:47:11 I am finding this issue quite serious Oct 05 00:47:31 StingRay_, and if I am getting a "cannot resolve symbol activity_camera" (the name of the xml file), where can I look to see what could be going wrong. Which error log - android studio Oct 05 00:48:16 pfn: The same thing as an AsyncTask? Or the same thing as a "Don't kill me" service? Oct 05 00:48:18 Just checking I understand. Oct 05 00:48:24 bilb_ono you import the proper project/app specific R, or reference it by full path Oct 05 00:48:39 bilb_ono but these questions are all answered quite quick with google searches :) Oct 05 00:48:40 TacticalJoke, it does the start/stop as I described Oct 05 00:49:15 the latter Oct 05 00:50:11 StingRay_, I tried googling "cannot resolve symbol activity" but all of the cases were not generalizable. It seems that cannot resolve symbol is a common error message Oct 05 00:51:55 bilb_ono, learn to build your app from the command line Oct 05 00:52:03 best way to isolate errors Oct 05 00:52:13 ide hide too much Oct 05 00:52:22 StingRay_, so something like this: import com.example.app.R.layout.activity_camera; Oct 05 00:52:48 well yeah but you should probably deal with your imports rather than that Oct 05 00:53:05 so not import that but just R Oct 05 00:53:16 so you can ref R.layout.activity_camera Oct 05 00:53:31 hey! Is there a way to get a service to run periodically at startup without having the app open? Oct 05 00:53:37 Say once every 30 seconds Oct 05 00:55:14 pieces029: you are binding your data-set for your adapter too late. The data has to be restored before the first layout call. Oct 05 00:55:22 Good evening. Oct 05 00:55:29 Okay. Oct 05 00:56:39 Is there a way to get at string resources inside a pojo without having to have access to a context? Oct 05 00:57:21 shekibobo: save the int resource value in the pojo? Oct 05 00:58:15 hmm Oct 05 00:59:55 Is it okay to write to and read from a tiny database on the UI thread? Oct 05 01:02:53 * Napalm watches the room go silent Oct 05 01:04:42 Napalm, thanks a lot again! Oct 05 01:04:50 I have it working perfectly now. Oct 05 01:05:02 good to hear.. what was the problem in the end? Oct 05 01:05:18 well i dont remember what i said last Oct 05 01:05:34 your clip rect was covering the entire view Oct 05 01:05:39 I had some trouble with the debug-rectangle ( to tired) Oct 05 01:05:44 TacticalJoke I woudn't Oct 05 01:05:52 wouldn't* Oct 05 01:05:58 oh yes, it wasn't, i was just drawing the wrong thing *smacks head* Oct 05 01:06:08 ;) Oct 05 01:06:09 it so much smoother using SurfaceView Oct 05 01:06:15 than View Oct 05 01:06:26 now i just need to track down some GC and the game is finished Oct 05 01:07:50 I found out the issue. it was a merge conflict in the manifest Oct 05 01:08:32 troned a game should never be finished Oct 05 01:08:59 troned should get to the point you are willing to realise it :) … or thats what it is with console games :) Oct 05 01:10:02 StingRay_, yes that is kind of what i meant. i have a bunch of stuff that i can add to it but i said to myself that "now i have to relase it and then i cn add the rest to a later release" Oct 05 01:10:31 How do you guys spread your games? Facebook+other social media and hold your thumbs that it will just take off? Oct 05 01:10:36 want a tester ? games is something I know about :) Oct 05 01:10:49 StingRay_, sure Oct 05 01:11:11 I use the accelerometer, I noticed the noise wwas quite different on different phones Oct 05 01:12:52 it is a pretty decent game, not angry brids or anything but kind of fun Oct 05 01:16:29 I have an idea for the Reddit client. Oct 05 01:16:40 What about some kind of task manager that keeps a database of "unclaimed tasks". Oct 05 01:16:57 Like "We've downloaded the http://reddit.com/r/foo/sdfsdffsd thread". Oct 05 01:17:21 And then an Activity can ask for that task to be performed. If it's already been performed, the result is just given to that activity (rather than the download happening again). Oct 05 01:17:26 Is that easy to implement? Oct 05 01:17:37 (I ask because I don't know much about threading in Android.) Oct 05 01:20:47 TacticalJoke: I don't see why they wouldn't work. I mean that could easily get huge and get out of date. Oct 05 01:21:13 Yeah, it'd have to prune old tasks. Oct 05 01:21:35 The idea is that, even if an Activity has been killed, the downloads happen and can be retrieved. Oct 05 01:22:04 If this happens, there are no problems: User clicks button --> Thread download starts --> User gets a phone call --> Activity is killed. Oct 05 01:22:31 At that point, the Activity can ask the TaskManager (or whatever) to download the thread again. If the task is in process or finished, it can use that task; else, it can create a new task. Oct 05 01:22:32 paused Oct 05 01:22:58 shmooz: But it could also be killed, right? Oct 05 01:23:01 If memory is low. Oct 05 01:23:22 yeah, so you continue doing stuff in a service then Oct 05 01:23:56 Hmm, would it have to be a service? Oct 05 01:24:05 probably Oct 05 01:24:31 Wouldn't that eat up battery? Oct 05 01:24:41 Always downloading stuff in the background Oct 05 01:24:55 pieces029: It'd only download what the user has requested. Oct 05 01:25:05 Though, true, I might want it to stop if the Activity has been killed. Oct 05 01:25:11 I guess the only thing I'd want to keep is uploading. Oct 05 01:25:33 I mean "if the process has been killed" (not "Activity"). Oct 05 01:27:48 Does simultaneous Wifi and Wifi direct require two radios or is it time multiplexed? Oct 05 01:30:24 anyone getting the nexus 6? Oct 05 01:30:37 I plan on it. Oct 05 01:30:55 Although 5.9 inches sounds possibly to big Oct 05 01:30:56 what about the 9? Oct 05 01:31:20 Nah, tablets are only for keeping kids entertaned Oct 05 01:31:27 What is the reason for Tablets having worse specs than phones? Oct 05 01:31:31 entertained Oct 05 01:31:41 no clue Oct 05 01:31:49 i wanted to spoil myself and get both Oct 05 01:32:10 why not? Oct 05 01:32:11 i haven't had a tablet since the original 7 and it's been broken a while Oct 05 01:32:40 That's what I currently have, works pretty well for keeping my kid enterained and throwing stuff up on the chromcast. Oct 05 01:33:02 Well I might, it's just that I have a mental block against two cores when there's four on my phone Oct 05 01:33:30 Kids are why mine is broke :) Oct 05 01:33:34 I'm so confused. Oct 05 01:33:41 Let's say that I'm making an app that reads from, and writes to, a database. Oct 05 01:33:49 And I'm gonna be "good" and not read/write in the UI thread. Oct 05 01:33:51 Haha, mine tried very hard to break it. I'm amazed he hasn't Oct 05 01:34:13 TacticalJoke: ok following you. Oct 05 01:34:13 I can't use just an AsyncTask for writing, because it's tied to the activity. Oct 05 01:34:18 why is good in quotes Oct 05 01:34:24 So I need a service for writing, it seems. Oct 05 01:34:32 wrong tacticaljoke Oct 05 01:34:33 Look into Loaders Oct 05 01:34:33 In that case, should I use the service for everything? Oct 05 01:34:36 Why is your async task tied to an activity? Oct 05 01:34:36 dont look int loaders Oct 05 01:34:44 okay dont Oct 05 01:34:52 loaders are satan Oct 05 01:34:53 apparently I've missed something? Oct 05 01:34:58 pieces029: What I mean is that Android could kill my process if the Activity dies. Oct 05 01:35:01 tell me one thing a loader does that makes your life easier Oct 05 01:35:02 They worked well for me Oct 05 01:35:12 JacobTabak: Am I wrong in saying I need a service for the writing? Oct 05 01:35:17 you don't need a service Oct 05 01:35:21 Android could kill your service if it wants Oct 05 01:35:44 JacobTabak: What if the user clicks "Save to database" and then exits my app? Android might kill the entire process. Oct 05 01:35:44 the only time you need a service is if you're doing stuff w/o user interaction Oct 05 01:35:51 TacticalJoke that won't happen Oct 05 01:36:47 Hmm. Oct 05 01:37:04 writing to the db doesnt take more than 50-100 ms Oct 05 01:37:06 The documentation seems to say that we need to use services. From : Oct 05 01:37:07 "For example, an activity that's uploading a picture to a web site should start a service to perform the upload so that the upload can continue in the background even if the user leaves the activity. Using a service guarantees that the operation will have at least "service process" priority, regardless of what happens to the activity." Oct 05 01:37:27 uploading an image takes much longer than writing to a DB Oct 05 01:37:34 Okay. Oct 05 01:37:39 and Oct 05 01:37:46 you have to ask yourself how much is that "guarantee" worth Oct 05 01:37:55 True. Oct 05 01:38:08 I'm gonna be using a tiny DB. I'm tempted to do it all on the UI thread, to be honest. Oct 05 01:38:13 that's retarded Oct 05 01:38:14 excuse my french Oct 05 01:38:23 you act like it's hard to do something on a background thread? Oct 05 01:38:38 Well, things get very complex. Oct 05 01:38:41 This is bringing up a good question about architecture. If I am using several similar services at once, would it be better to shorten the code into something that could be handled using an Application singleton? Then a service just to keep the app instance alive? Sounds hackish but I'm getting a lot of overhead code on the services Oct 05 01:38:41 no they don't Oct 05 01:38:41 I dont think it;s retarded, I just think it's not right or it's a bad choice :) Oct 05 01:38:43 Because of Activity restarts and such. Oct 05 01:38:58 no rdnt don't do that Oct 05 01:39:07 JacobTabak: Multithreading is so freaking hard. Oct 05 01:39:14 you're not multithreading Oct 05 01:39:18 JacobTabak, okay but why? Oct 05 01:39:19 you're doing a fire and forget operation in another thread Oct 05 01:39:27 JacobTabak: The read isn't a fire-and-forget. Oct 05 01:39:32 It's fire-and-update-the-UI. Oct 05 01:39:48 this is so commonplace Oct 05 01:39:55 every app you ever write will do this Oct 05 01:40:02 it's only intimidating because you're not used to it Oct 05 01:40:39 your app doesnt' get killed right and left Oct 05 01:40:56 rdnt in practice, your activities stay alive for a good amount of time in the background Oct 05 01:41:38 JacobTabak, yes but I actually want a persistent service Oct 05 01:41:53 ok, so why are you talking about doing something in an application singleton? Oct 05 01:42:20 I'm guessing that using a Service is way more complex (code-wise) than using an AsyncTask, right? Oct 05 01:42:28 correct Oct 05 01:42:36 even if your activity is destroyed, your async tasks won't be killed Oct 05 01:42:44 its not like your activities are garbage collected when tehyr'e destroyed Oct 05 01:43:15 Hmm. That page says "Caution: Another problem you might encounter when using a worker thread is unexpected restarts in your activity due to a runtime configuration change (such as when the user changes the screen orientation), which may destroy your worker thread". Oct 05 01:43:21 if you start an async task, call finish resulting in your activity being destroyed, the async task will still finish even if it takes 20 seconds Oct 05 01:43:26 When talking about AsyncTask. Oct 05 01:43:47 That page does sound kinda wrong. Oct 05 01:43:49 TacticalJoke thats' why you put asynctasks in fragments with setRetainInstance = true if it's a critical operation Oct 05 01:43:59 but yes, it's wrong Oct 05 01:44:06 Just don't update the ui if your activity isn't around Oct 05 01:44:18 yea, its not like rotating will cancel async tasks Oct 05 01:44:20 TacticalJoke wow… I just read back, for the past 2 or so hours you have taken about 80% of this channel Oct 05 01:44:22 it will just wreck your reference to the context Oct 05 01:44:35 For a not-so-important database, I guess I could just assume that the Activity dying won't entail the AsyncTask dying. Oct 05 01:44:37 well actually i won't speak about async tasks because i don't use them (ever) Oct 05 01:44:43 StingRay_: Sorry. lol Oct 05 01:45:10 well seems a bit like you have managed to get tutorials and examples from nearly everyone who is normally active…so congrats Oct 05 01:45:22 not an easy task Oct 05 01:45:49 he's asking good questions tbh Oct 05 01:45:57 but he'd learn better by just assuming the simplest case Oct 05 01:46:06 and if something breaks, google it or ask Oct 05 01:47:06 Honestly, I might just try using the UI thread for DB access. Oct 05 01:47:11 And seeing how slow (fast) it is. Oct 05 01:47:12 you try that bud Oct 05 01:47:17 (don't try that) Oct 05 01:47:20 lol Oct 05 01:47:22 i'm the one telliong you to experiment Oct 05 01:47:27 and im telling you not to experiment with that Oct 05 01:47:38 you're setting yourself back 5 years Oct 05 01:47:44 DONT DO ANY IO ON MAIN THREAD EVER Oct 05 01:47:54 Even simple file reads/writes? Oct 05 01:47:57 NEVER!!! Oct 05 01:48:16 dont even write to shared prefs Oct 05 01:48:22 use apply() Oct 05 01:48:26 rather than commit() Oct 05 01:48:32 How about reading from shared prefs? Oct 05 01:48:41 you can read from shared prefs Oct 05 01:48:45 because they're cached Oct 05 01:48:50 it will be slow the first time Oct 05 01:48:56 but that's an exception Oct 05 01:49:01 Hmm. Oct 05 01:49:04 because there are no complex objects in shared prefs Oct 05 01:49:05 only primitives Oct 05 01:49:09 If my app reads a DB on load only, can that be an exception? Oct 05 01:49:14 no? Oct 05 01:49:40 that will just take a really long time opening your app., Oct 05 01:49:49 Plus if you take to long you will cause an anr Oct 05 01:49:50 God, you know what would be cool? CPUs that can do this stuff automatically. You just write a single-threaded app and the CPU worries about multithreading in real time. Oct 05 01:49:51 good luck having activity transitions if you load on the main thread Oct 05 01:50:00 TacticalJoke or you could learn how to thread without any effort Oct 05 01:50:12 like rxjava Oct 05 01:50:18 JacobTabak: So reading from shared prefs is an exception because it's such simple data? Oct 05 01:50:18 Just about to say that., Oct 05 01:50:34 TacticalJoke its an exception because its primitives only AND its cached after the first read Oct 05 01:51:07 ie, no parcelables or complex objects Oct 05 01:51:14 only strings, ints, longs, floats etc Oct 05 01:52:37 What if I had a DB with one tiny row. And it's cached. Still can't read it on the UI thread? Oct 05 01:52:46 you're a troll Oct 05 01:52:49 By "it's cached", I mean that my app saves the data after a single read. Oct 05 01:52:50 For making a view that can scroll both ways, should I Embed a ScrollView inside a HorizontalScrollView, or is there a better way? Oct 05 01:53:02 I'm not trolling. I'm trying to find where the line is drawn. Oct 05 01:53:30 don't do SQLite on the main thread Oct 05 01:53:32 TacticalJoke no part of reading or writing on UI thread …thats kinda the line Oct 05 01:53:35 It's drawn along the Rio Grande underneath a giant fence. Oct 05 01:53:55 StingRay_: But everyone seems to say that reading shared prefs is okay, so it's clearly not the line. Oct 05 01:54:06 The first read *isn't* cached, of course. Oct 05 01:54:10 thats not a transaction database Oct 05 01:54:28 it's a pissy xml file where like JacobTabak said, the values are cached Oct 05 01:54:39 and they're primitives Oct 05 01:54:50 TacticalJoke wants us to admit we should do it on another thread Oct 05 01:54:54 which we should Oct 05 01:55:00 but we're lazy Oct 05 01:55:02 so we don't Oct 05 01:55:10 I'm of the same mindset, really. I hate multithreading. Oct 05 01:55:10 but that doesn't give him an excuse to be lazy Oct 05 01:55:11 so many up Oct 05 01:55:14 man* Oct 05 01:55:17 TacticalJoke rxjavaaaa Oct 05 01:55:25 I also hate third-party libraries. ;| Oct 05 01:55:32 Isn't AsyncTask good enough, though? Oct 05 01:55:33 then you're going to have a bad time Oct 05 01:55:34 rxjava is the shit Oct 05 01:55:36 asynctask is shit Oct 05 01:55:42 i haven't used an asynctask in over a year Oct 05 01:55:44 and i never will again Oct 05 01:55:58 if u don't like third-party libraries ur cutting out probably the best part of being a java dev Oct 05 01:56:13 if i couldnt use third party libraries i'd probably change careers Oct 05 01:56:19 My attitude towards third-party libraries is like that of a cat towards a human. Oct 05 01:56:31 feed me? Oct 05 01:56:39 man why does development attract all these weird, go against the grain people Oct 05 01:56:42 I depend on them to some degree, but I'm out hunting all day. Oct 05 01:56:43 michael__ sorry, no you should not really do that Oct 05 01:56:55 JacobTabak: I hate dependencies! That's not weird. Oct 05 01:56:57 whats the usage case ? like a map ? Oct 05 01:57:02 Especially when Android has AsyncTask already. Oct 05 01:57:03 TacticalJoke i think it means you don't understand them Oct 05 01:57:06 if you hate them Oct 05 01:57:15 Dependencies often mean subtle bugs that we can't fix. Oct 05 01:57:20 no? Oct 05 01:57:21 Because we didn't write the code and we have no idea of how it works. Oct 05 01:57:24 wrong? Oct 05 01:57:28 every dep i use is open source Oct 05 01:57:34 and many of them i've recompiled into my own customized jars Oct 05 01:57:45 github forking is nice Oct 05 01:58:06 i dont use libraries i dont understand (with the exception of rxjava because its new) Oct 05 01:58:13 but i'm learning :P Oct 05 01:58:42 Would RxJava have the same problem regarding Activitys being killed and background threads potentially being stopped? Oct 05 01:58:57 has anyone here implied that's actually a problem? Oct 05 01:59:04 The Android documentation. lol Oct 05 01:59:09 Though I know it sucks. Oct 05 01:59:32 you're barking up the wrong tree Oct 05 02:00:16 200+ apps in the store with millions of users Oct 05 02:00:18 and its never been a problem Oct 05 02:00:54 Those are your apps? Oct 05 02:01:13 i've never *not* been the lead dev on any app i've worked on Oct 05 02:01:23 Okay. Cool. Oct 05 02:02:23 also the most popular app that I work on has a lot of image uploading Oct 05 02:02:24 I'm guessing the AsyncTask is killed only if RAM is really low, or something. Exceptional conditions. Oct 05 02:02:33 and i still don't use a service Oct 05 02:02:36 Interesting. Oct 05 02:03:18 and it actually intentionally finishes() the activity that does the image uploading as soon as the background thread starts Oct 05 02:03:49 JacobTabak what phone network you on? Oct 05 02:03:54 StingRay_: Sorry for the delay, how should it be done? Oct 05 02:04:03 michael__ whats the use case ? Oct 05 02:04:17 StingRay_ at&t, but i'm sure that's not relevant at all unless you're asking for personal reasons Oct 05 02:04:18 michael__ not really sure never done it, but I think it would depend on use Oct 05 02:04:30 Well, I feel more confident about using AsyncTask now. Thanks. :) Oct 05 02:04:34 JacobTabak asking for professional ones Oct 05 02:04:42 Or RxJava. lol Oct 05 02:04:53 asynctask sucks Oct 05 02:04:55 I really need a dev on T-Mob US :) to ask a favour of Oct 05 02:05:04 g00s: Is that another vote for RxJava? Oct 05 02:05:10 StingRay_: A sandbox-style game, where I want the user to be able to move around on the map. Oct 05 02:05:20 TacticalJoke anything except asyntask :) Oct 05 02:05:24 TacticalJoke before I used rxjava i used androidannotations @Background and @UiThread annotations Oct 05 02:05:27 g00s: What's bad about it? Oct 05 02:05:35 Hmm, interesting. Oct 05 02:05:39 makes code hard to read Oct 05 02:05:43 boilerplate etc Oct 05 02:05:47 also Oct 05 02:05:50 AsyncTask does? Or the annotations? Oct 05 02:05:52 michael__ oh then is there a reason you want to use Complex Views rather than just a Surface and do it yourself ? Oct 05 02:05:54 asynctask Oct 05 02:05:56 Oh. Oct 05 02:05:56 What's RxJava? Oct 05 02:06:00 asynctask also doesn't support parallelism by default Oct 05 02:06:05 ie, asynctasks are run serially Oct 05 02:06:11 hello Oct 05 02:06:13 so if you want to fire off 2 network requests, they'll be run one after another Oct 05 02:06:18 (by default) Oct 05 02:06:24 can't reuse, can't cancel, default executor changed, misused to retain references, stupid generics Oct 05 02:06:32 any of you know how to build an apk from a source code? https://code.google.com/p/ics-openvpn/ Oct 05 02:06:48 JakeWharton: I'm guessing you're into RxJava too? Oct 05 02:06:50 Hi Oct 05 02:06:58 felirami: ./gradlew assemble Oct 05 02:07:09 excuse me jakewharton? Oct 05 02:07:23 StingRay_: I figure it'll be easier to embed a surfaceview in a scrollview and let the system take care of it than try to implement it myself Oct 05 02:07:27 That's the command to run. Oct 05 02:07:31 didnt understood what you meant Oct 05 02:07:39 felirami: clone the repo, run ./gradlew assemble Oct 05 02:07:49 michael__ I think you maybe wrong on that one…specially for a game Oct 05 02:07:51 and how do i run that Oct 05 02:07:53 on windows? Oct 05 02:07:58 ./gradlew.bat Oct 05 02:08:00 er Oct 05 02:08:01 gradlew.bat Oct 05 02:08:04 Does simultaneous Wifi and Wifi direct require two radios or is it time multiplexed? Oct 05 02:08:11 how do i make a gradlew.bat Oct 05 02:08:13 I figure I'll ask again :D Oct 05 02:08:19 TacticalJoke: I have used it Oct 05 02:08:23 ... felirami https://code.google.com/p/ics-openvpn/source/browse/ Oct 05 02:08:26 its right in there Oct 05 02:08:36 gradlew.bat Oct 05 02:08:37 true haha Oct 05 02:08:37 StingRay_: Ok then Oct 05 02:09:10 uhmm, is it possible then to actually modify it to add my own ovpn files and build an apk on that right? Oct 05 02:09:28 felirami you can do whatever the f you want, its open source Oct 05 02:09:45 can anyone teach me how? or atleast guide my journey Oct 05 02:09:58 ask specific questions Oct 05 02:10:01 ok Oct 05 02:10:04 take some initivative Oct 05 02:10:08 look at the code Oct 05 02:10:11 build it, run it Oct 05 02:10:11 so you know openvpn right? Oct 05 02:10:18 felirami: the first quetion answre is yes. Oct 05 02:10:23 ive used it, i'm 95% sure none of us have evern compiled it in here Oct 05 02:10:39 so you need to generalize your questions Oct 05 02:10:57 is it possible to add certain ovpn files to openvpnforandroid and limit the connections on them? Oct 05 02:11:15 Oct 05 02:11:15 limit i mean, not have the feature of import an external ovpn file into the program Oct 05 02:11:18 I have a question about content restrictions on google play. Specifically towards pornographic content. Is the outline of a penis considered pornographic? Oct 05 02:11:31 Syzygy__ yes but you'll have ot be reported becasue there's no moderation Oct 05 02:11:42 and then it's totally up to whoever reviews the case whether or not your app will be removed Oct 05 02:11:47 Syzygy__: I have to ask why. lol Oct 05 02:11:57 A medical app? Oct 05 02:12:15 obviously a wankoff simulation app using the accelerometer Oct 05 02:12:17 TacticalJoke, not really, but I guess it could be kinda used for research purposes Oct 05 02:12:18 bbl Oct 05 02:12:30 anyone understood my question? Oct 05 02:12:38 someone can flag the app is inappropriate Oct 05 02:13:03 TacticalJoke, basically a dicksize comparator Oct 05 02:13:05 just a drunk idea Oct 05 02:13:30 I'm trying to imagine how such an app would work. Oct 05 02:13:33 It uses the camera? Oct 05 02:13:40 of course. Oct 05 02:14:19 I'm still trying to think of a way to get accurate size measurements (without the ability to cheat) using a phone camera Oct 05 02:14:32 Lol. I can't help but laugh at the juxtaposition of Africans starving and Americans using their modern, Internet-connected smartphones to compare penis size. Oct 05 02:14:58 it's a stupid drunk idea, as I said Oct 05 02:15:08 I know. I just find it funny. :D Oct 05 02:15:30 I too find starving africans hilarious (jk) Oct 05 02:16:35 Syzygy__ my wife says you should sell tape measurers instead Oct 05 02:16:50 How do you determine the size from a camera photo? Oct 05 02:17:00 Wait, that sounds like an easier to make app. Just a ruler on a phone to measure it. Oct 05 02:17:03 I'm trying to google some ways Oct 05 02:17:44 Wouldn't they all need to be the same distance away from the same kind of lens? Oct 05 02:17:51 Syzygy__ if your app gets populare it will be removed Oct 05 02:17:54 * StingRay_ doest like the idea at all, I hate phablets let alone having to use a few tablets Oct 05 02:17:55 http://stackoverflow.com/questions/26182290/keeping-one-fragment-with-multiple-views-using-viewpager Oct 05 02:17:56 possibly Oct 05 02:17:57 that was your question and thats the answer Oct 05 02:18:02 lol StingRay_ Oct 05 02:18:08 Syzygy__: That app already exists Oct 05 02:18:12 JacobTabak, I can think of legitimate reasons to have this actually Oct 05 02:18:24 the moderators will not give a hsit Oct 05 02:18:25 shit* Oct 05 02:18:33 What's a legitimate reason? Oct 05 02:18:36 michael__, can you tell me the name? I'm curious Oct 05 02:18:45 TacticalJoke, medical, research Oct 05 02:18:53 Syzygy__: https://play.google.com/store/apps/details?id=kr.sira.measure&hl=en Oct 05 02:18:58 Syzygy__ i remember reading that in studies involving this, someone is actually trained to take the measurement correctly - because self reporting is biased :D Oct 05 02:19:00 Like, if your dick is *this* big, you may have cancer Oct 05 02:19:12 Though it's just regular measurement, not perverted Oct 05 02:19:23 Not specific enough Oct 05 02:19:24 michael__, even better Oct 05 02:19:42 g00s, that's why I'm looking for ways to get accurate size measurements with a camera Oct 05 02:19:47 At the end of the day, it's just a physical object. I think generic measuring is a great idea. Oct 05 02:19:48 * StingRay_ needs a time ignore IRC/textual plugin Oct 05 02:20:00 StingRay_ whats up buddy talk to me Oct 05 02:20:00 But we already have an app that measures penis sizes Oct 05 02:20:03 And it's cross-platform! Oct 05 02:20:05 Syzygy__ lol, good luck :) Oct 05 02:20:54 Darklust, can you tell me the name? for market research :> Oct 05 02:21:16 Syzygy__: Snapchat. The logic comes from the females we send the pics to :] Oct 05 02:21:28 ah Oct 05 02:21:53 Terrible joke, I realize Oct 05 02:21:53 is that actually what snapchat is intended to do? or just what people do? Oct 05 02:22:14 i cannot think of anything Snapchat does more efficiently than sexting Oct 05 02:22:24 So that's what I'd attribute it towards Oct 05 02:23:25 Syzygy__: That's actually what Snapchat is intended for unfortunately Oct 05 02:23:36 ok Oct 05 02:23:39 snapchat is for people who married people who want to chat with other people with fake pictures Oct 05 02:23:47 oh wait Oct 05 02:23:48 thats tinder Oct 05 02:23:49 sorry Oct 05 02:24:07 I worry about some of these phone apps. They make cheating all too easy, IMO. Oct 05 02:24:12 Though I am a worrier. Oct 05 02:25:00 TacticalJoke mine is even worse Oct 05 02:25:01 * JacobTabak awkward Oct 05 02:25:10 StingRay_: How so? Oct 05 02:25:18 can hide and control conv. per person Oct 05 02:25:25 and blind hide something/things Oct 05 02:25:38 so it's not shown as secured or hidden, as in no trace Oct 05 02:25:39 :) Oct 05 02:25:43 Damn. lol Oct 05 02:29:17 Some people say "Use Fragments instead of Activitys". Is that really a good idea? Oct 05 02:29:26 I thought Fragments were just for tablet UIs. Oct 05 02:29:30 No Oct 05 02:29:31 TacticalJoke oh please stop now Oct 05 02:29:36 lol StingRay_ Oct 05 02:29:39 StingRay_: What? lol Oct 05 02:29:40 I think he is trolling? Oct 05 02:29:49 I don't get why you would think that. Oct 05 02:29:53 i don't think it Oct 05 02:29:54 TacticalJoke you really should just go off and learn Oct 05 02:30:05 StingRay_: You assume I haven't spent hours googling these topics. Oct 05 02:30:08 (That assumption is false.) Oct 05 02:30:11 no Oct 05 02:30:17 Every single topic I've brought up, I think, I've googled for hours. Oct 05 02:30:17 you are assuming I'm assuming Oct 05 02:30:20 TacticalJoke use fragments when necessary. Oct 05 02:30:33 TacticalJoke tabs, nav drawer Oct 05 02:30:39 Yeah. Oct 05 02:30:43 TacticalJoke but stop asking a room of opinionated people for pure speculation and opinions Oct 05 02:30:46 not a good idea Oct 05 02:30:49 (Or setRetainInstance(true), I guess.) Oct 05 02:30:49 maybe he wants the opinions? Oct 05 02:30:58 Yeah, I'm asking for opinions. Oct 05 02:31:18 TacticalJoke i don't really ever use setRetainInstance either Oct 05 02:31:19 JacobTabak if you have no opinion, does that mean you are looking for one ? Oct 05 02:31:23 I would say almost always use fragments, it always for reuse. Think of activities as controllers that contain the fragments. Oct 05 02:31:44 pieces029 and i would argue that that leads to unnecessary boilerplate Oct 05 02:31:44 JacobTabak: Hmm. What about background threads? Oct 05 02:32:00 TacticalJoke if you have a long running, high priority backgroudn thread, then sure Oct 05 02:32:05 99% of data requests can just be restarted Oct 05 02:32:29 it's not worth overengineering for the edge cases Oct 05 02:32:31 But that seems complex... Oct 05 02:32:41 TacticalJoke setRetainInstance is *NOT* for ui fragments Oct 05 02:32:44 Let's say that I'm writing to a database in a background thread, and I update the UI after. Oct 05 02:32:52 they are 2 unrelated questions Oct 05 02:32:54 If I don't retain the thread, I have to store the operation, right? Oct 05 02:33:00 And redo the operation on rotation. Oct 05 02:33:11 no. if you're writing you only need to do it once Oct 05 02:33:15 the operation will complete even if it's rotated Oct 05 02:33:23 Yeah, but in this case I need a UI update after. Oct 05 02:33:33 ("Operation succeeded" or some such.) Oct 05 02:33:34 you always load your data oncreate or onresume Oct 05 02:33:34 this is just repeating now :( Oct 05 02:33:50 TacticalJoke show a toast? Oct 05 02:33:55 idgaf Oct 05 02:34:18 just write your activities to be stateless Oct 05 02:34:54 * StingRay_ feels young cause he figured out what idgaf is :) Oct 05 02:35:05 you could have googled it before typing that Oct 05 02:35:08 hello all Oct 05 02:35:31 JacobTabak could have, but would not have felt young cause of it Oct 05 02:35:33 :) Oct 05 02:35:48 you could either say you feel young or feel old Oct 05 02:35:56 either your'e not hip enough or not old school enough Oct 05 02:36:06 if you don't know what it means you can't know if it's before or after your time Oct 05 02:38:40 oh StingRay_ lol Oct 05 02:38:43 i misread your thingy Oct 05 02:38:57 thought you said 'feels young cause he doesnt know what idgaf is' Oct 05 02:38:58 lol Oct 05 02:41:35 JacobTabak: I'm trying to imagine how I'd show a Toast here. I'd need a Context, of course, and it seems that the show-a-Toast code should go in one of the Activity classes. But it'd be a whole new Activity that can't be reached by the background thread. Kinda complex. :/ Oct 05 02:41:44 u can toast with app context Oct 05 02:41:45 I hate that we have to worry about rotations at all. Oct 05 02:41:54 ... you can just prevent rotation Oct 05 02:41:56 So I guess I would have to use accelerometer and video data to try and measure the size via trigonometry. Oct 05 02:41:57 if you hate it so much Oct 05 02:42:37 TacticalJoke do you know what i mean by app context vs activity context Oct 05 02:42:40 Yeah. Oct 05 02:43:05 I don't like the idea of the worker thread showing a Toast, though. Seems like UI code. Oct 05 02:43:16 the worker thread would not show the toast Oct 05 02:43:16 It's not Oct 05 02:43:19 you'd have to pass it back to a ui thread Oct 05 02:43:33 Services show toasts all the time Oct 05 02:43:52 services run on the main thread Oct 05 02:43:56 by default Oct 05 02:44:13 But toasts can be shown without an Activity being visible Oct 05 02:44:38 but he was talking about threading Oct 05 02:44:40 Sorry, I meant "I dislike the idea of the AsyncTask class showing a Toast". In a perfect world, it'd be MainActivity or whatever. Oct 05 02:44:52 I know that some of the AsyncTask methods run on the UI thread. Oct 05 02:45:03 TacticalJoke get real please Oct 05 02:45:17 what is the use case where someone rotates the device whiel waiting for a db write and needs to be notified when the write finsihes? Oct 05 02:45:24 considering writes take 50-100ms? Oct 05 02:45:56 Hmm, true. Oct 05 02:46:16 you're wasting so much time talking in IRC Oct 05 02:46:18 alright, finally moved my last project over to Android Studio -- Goodbye Eclipse. Oct 05 02:46:21 trying to solve problems you don't even have Oct 05 02:46:29 I guess I over-analyse. lol Oct 05 02:46:47 just log stuff like this in crashlytics or some other reporting solution Oct 05 02:46:48 QubeZ grats Oct 05 02:46:53 and if it's actually an issue, address it then Oct 05 02:46:55 Yeah, if the rotation happens in the meantime, they can just forget about the Toast. :) Oct 05 02:47:11 Just "if (fooActivity != null) { notifyFooActivity(); }". Oct 05 02:47:18 your activity won't be null Oct 05 02:47:21 if you have a referenc to it Oct 05 02:47:25 do u need a lesson on GC Oct 05 02:47:49 Wait, I guess I meant something like "if (!isCancelled()) {}". Oct 05 02:47:58 Where the Activity calls AsyncTask.cancel at some point. Oct 05 02:48:11 No, that doesn't work. Never mind. Oct 05 02:48:12 ugh i need to leave this irc Oct 05 02:48:14 you provoke me Oct 05 02:49:12 I'm not sure why. Just trying to figure out multithreading in Android. Oct 05 02:49:22 It's not exactly a simple topic. Oct 05 02:49:29 I appreciate your help. Oct 05 02:50:10 https://gettingreal.37signals.com/ch04_Its_a_Problem_When_Its_a_Problem.php Oct 05 02:56:06 JacobTabak that link would have just destroyed 16 years of my life Oct 05 02:56:20 isn't it true though? Oct 05 02:56:21 cause for 16 years thats kinda what I did :) so have to disagree Oct 05 02:56:28 I've bookmarked it Oct 05 02:56:34 in a small context I agree Oct 05 02:56:48 hwat problems are you guys talking about? Oct 05 02:56:49 but not as an average or majority Oct 05 02:57:02 if you're in a position where you have to ask these questions - you aren't being paid enough to think about them ahead of time Oct 05 02:57:42 I appreciate the advice. I do plan way too much. I think it's good advice in general, but there are times when planning is valuable. Oct 05 02:59:07 StingRay_ and 16 years ago, i'm sure it was the best choice Oct 05 02:59:19 StingRay_ you're in a different situation now than you were then Oct 05 02:59:35 well yes but my industries are the same Oct 05 02:59:37 I'd guess that most planning is wasted time and energy. Oct 05 02:59:45 But the problem is that it's hard to tell in advance what's needed and what's useless. Oct 05 02:59:48 I get paid to look ahead and find the problems Oct 05 02:59:53 man builds in Android Studio are fast **** ENDING LOGGING AT Sun Oct 05 03:00:01 2014