**** BEGIN LOGGING AT Sat Nov 15 03:00:01 2014 Nov 15 03:00:44 Hey folks. In order to change the color of a selected item in expandable list view, do I need a selected ? Nov 15 03:00:55 The color that shows up when I hold my finger onto some item Nov 15 03:00:59 (currently orange) Nov 15 03:03:55 yeh, there's a setSelector() Nov 15 03:04:16 create a on selector drawable and set what you want Nov 15 03:04:37 do you people prefer specifying stuff in xml files or doing so programmatically ? Nov 15 03:05:18 It's better to keep presentation data separate from code. Eases maintenance. Nov 15 03:05:32 cool, thanks Nov 15 03:05:33 you people? if you have a view that needs states, create a selector list Nov 15 03:14:56 JakeWharton: I can't download Okio. Getting "authentication required" on the link given: https://repository.sonatype.org/service/local/artifact/maven/redirect?r=central-proxy&g=com.squareup.okio&a=okio&v=LATEST Nov 15 03:15:20 I'm guessing I can use this for now: http://mvnrepository.com/artifact/com.squareup.okio/okio/1.0.0 Nov 15 03:18:07 what is the idea behind android going to android studio for app devel rather than using the sdk toolkit as the frontend? streamlining things, making things simpler in terms of coding? Nov 15 03:18:58 IDEs are more productive than command-line tools. Nov 15 03:20:08 *nod* and you can see code structure better in IDEs? Nov 15 03:23:25 Better than what? Nov 15 03:24:02 I guess it's easy for an IDE to present code better, because it (generally) has more information than a text editor. Nov 15 03:24:53 yes Nov 15 03:25:05 and i see the differences now between eclipse and android studio Nov 15 03:25:15 more features using gradle/android studio than ant/eclipse Nov 15 03:26:47 Android Studio still misses some features though, such as JVM unit testing and (from what I heard) some stuff related to NDK. Nov 15 03:26:50 the NDK* Nov 15 03:27:44 *nod* NDK stuff is coming soon though Nov 15 03:28:08 didnt realize it didnt have JVM unit testing but i guess thats okay for now, im just getting started here :) Nov 15 03:28:19 I think they're gonna implement JVM unit testing at some point. Nov 15 03:29:29 right after java 8, right ? Nov 15 03:30:03 i dont yet see any "getting started" tuts made for android studio... thought i did see it at one point but i am still trying to config it to go to a specific dir on another hard drive, not the c:\ drive Nov 15 03:30:58 Android Studio isn't really "released" yet. There's not a huge amount of documentation. Nov 15 03:31:11 right, released as beta for 0.8.14 Nov 15 03:31:12 Then again, I don't expect a huge amount after release, I guess. Maybe a little.# Nov 15 03:33:09 hmm Nov 15 03:34:52 Can't you specify the installation directory? Nov 15 03:35:39 I am little bit confused with the states of a listview item. When the user touches and item and holds his/er finger down to the screen, it's state_pressed, right? Whwat about when s/he releases it ? Nov 15 03:36:11 tacticaljoke: i did... but im talking more about the project directory Nov 15 03:36:52 Oh. Not sure. (I've not used it much.) Nov 15 03:38:24 good thing is that barely anyone does jvm unit testing Nov 15 03:39:15 pfn: Even all those Robolectric users? Nov 15 03:40:13 Need some advice. I have 3 tabs on my app. I want one of the tabs the main tab to change. At first it will be a button to connect to a device. Once connected I want the tab to add all the needed controls and gizmos. I have been looking into changing the fragment for this tab. That works ok although I am concerned it may leak as I call "new SomeFragement()" and never destroy the old one. I was thinking about using FrameLayout this way I have multiple Nov 15 03:40:54 crap. Nov 15 03:41:07 no builtin tutorial on studio at the startup screen... Nov 15 03:42:09 TacticalJoke, all? Nov 15 03:42:46 who needs a start up tutorial, I never use those on any app waste of space Nov 15 03:43:04 pfn: someone who is new to android app development. Nov 15 03:43:28 JakeWharton: OkHttp is so nice. :) Nov 15 03:44:01 JakeWharton: I'm making a Reddit client and considering using OkHttp. Would I ever need to close OkHttpClient? Or can I just hold onto it as a static somewhere? Nov 15 03:44:35 AC-130U, read d.android.com Nov 15 03:44:37 I also like the fact that it's "OkHttpClient" and not "OKHTTPClient". Satisfies the OCD in me. Nov 15 03:44:52 (Or Ocd. :D) Nov 15 03:45:41 AHAH. New Project | project dir settings Nov 15 03:45:43 there we go. Nov 15 03:49:57 or oCD Nov 15 03:51:06 * cliffreich giggles Nov 15 04:00:52 mm, why even though I have a minsdk version of 15, my list selectors are the ones from gingerbread and below? (orange on click) Nov 15 04:01:51 and list_selector_holo_dark doesn't show up at all as an option in my IDE Nov 15 04:01:52 hm Nov 15 04:05:57 tch Nov 15 04:06:09 this tutorial video shows this guy using an old version of android studio Nov 15 04:06:19 0.2.0 or someshit Nov 15 04:06:29 Beket, target sdk version? Nov 15 04:07:54 pfn, mm, It seems that I forgot to specify it Nov 15 04:13:33 Hey guys quick question, I was reading up on asynctask on android's developer doc, when they say "asynctask must be subclassed to use" is that the same as innerclass? I think it is but just making sure. Nov 15 04:14:36 Demon_Jester: No, it's inheritance. Nov 15 04:15:20 It's an abstract class. You can't instantiate it. It's designed to be subclasses (where the subclass can be instantiated). Nov 15 04:15:48 subclassed* Nov 15 04:16:29 Ok, I am googling to see the different between subclass and inner class, but I am not finding anything. just static vs non static is what is coming up Nov 15 04:17:56 Just google "java subclass" and then "java nested class". They're completely different. Nov 15 04:19:01 <_flip> Hey. I need to download X number of files asynchronously. What's the best way to make sure I only have N number of async downloads going at once? Any WorkerPool or something that does this already or do I have to implement it myself? Nov 15 04:19:18 TacticalJoke the reason why I asked, cause I would use asynctask in the same class file, and I thought that was bad performance, so I attempted to use separate class file but now I am reading and people keep saying "more benefits for inner/sub class" Nov 15 04:21:24 _flip maybe a for loop like for loop to 3 and it will do three downloads, then once download is down it takes int down by a number then it will find another download? like for(int i = 0; i < whatever; i++){ // downloading goes here once download is done use i-- each time download is done } Nov 15 04:21:31 I am not sure thay is just pseudo code. Nov 15 04:22:03 _flip: I think ExecutorService (e.g., Executors.newFixedThreadPool). Nov 15 04:22:56 _flip try to use downloadmanager if you can Nov 15 04:23:01 nice, first app running on phone Nov 15 04:25:22 tacticaljoke I want you to tell me if I understand this now, nested class another class in same class file, sub class extends the main class Nov 15 04:26:24 Yeah, basically. Though I'd say that a nested class is a class defined within another class. Nov 15 04:26:42 Demon_Jester: I'm not too sure about AsyncTask, but I think you have to be careful with non-static nested classes here. Nov 15 04:26:54 Because they hold references to the outer class. Nov 15 04:27:03 And holding references to an Activity can create a memory leak. Nov 15 04:27:13 TacticalJoke I am just gonna use asynctask as a subclass like android devs recommend. Nov 15 04:27:13 e.g., on screen rotation. Nov 15 04:27:25 TacticalJoke I will keep that in mind. Nov 15 04:27:32 I'd try to make the AsyncTask subclass a top-level (AKA non-nested) class. Nov 15 04:28:30 (Or a *static* nested class, which is similar.) Nov 15 04:28:37 RxJava! Nov 15 04:28:50 Demon_Jester: inner and sub are not the same thing Nov 15 04:29:28 you mean public class mainactivity extends Activity { public class mainacitivity extends AsyncTask{ } }? Nov 15 04:29:40 shmooz little late I read up on both of them :) Nov 15 04:30:23 shmooz I mean I have better understanding. Nov 15 04:30:37 public class MainActivity extends Activity { private ***static*** class MyAsyncTask extends AsyncTask { } } Nov 15 04:30:45 That'd be a static nested class. Nov 15 04:30:59 But I dunno what you're doing here. It might (or might not) be awkward to avoid a non-static nested class. Nov 15 04:31:46 A good general pattern is to have the "task" class call back to the activity via some interface. And the activity can unregister itself in onDestroy, to avoid leaking memory. Nov 15 04:31:46 Demon_Jester: you can put the Asynctask in its own file and use the constructor to pass stuff you need to pass Nov 15 04:32:18 shmooz I am trying but its being a little bitch, I have been googling the problem and made progress but never solved it. Nov 15 04:32:25 Demon_Jester: Maybe write some code and then show the channel? I'll tell you whether it leaks. :) Nov 15 04:33:36 capella http://www.securityweek.com/mobile-pwn2own-2014-iphone-5s-galaxy-s5-nexus-5-fire-phone-hacked Nov 15 04:34:41 lol, Nexus 5 "force BlueTooth pairing between phones" Nov 15 04:34:43 * capella-s32 reads Nov 15 04:35:24 g00s really? that seems like security risk Nov 15 04:35:45 Demon_Jester thats why its called mobile pwn2own Nov 15 04:35:51 :D Nov 15 04:36:02 oh I thought that was default in nexus 5 Nov 15 04:37:50 is there a special trick to link .so to your native .so application? Nov 15 04:38:11 just trying to integrate openal soft and it's building as a .so. as soon as i add the dependency, the application fails loading Nov 15 04:40:39 Ok I am back my friend is new to linux and said it wont let me type in the password, and I told him in linux asterisks don't show up just type it in and hit enter. Nov 15 04:41:55 TacticalJoke may I talk to you in a pm so I don't fill up the channel? Nov 15 04:44:03 It's hard for me to take PMs right now. Nov 15 04:44:09 If it's about Android programming, you might as well just post here. Nov 15 04:45:35 TacticalJoke when my app launches and I have settings for my UI to be created in the onCreate method, I feel that is just wrong to do, so, what is more elegant way to create the ui on start of the app? I was thinking of using asynctask. Nov 15 04:47:26 What do you mean by "I have settings for my UI to be created [in onCreate]"? Nov 15 04:49:09 <_flip> g00s, is downloadmanager recommended for stuff like thumbnails? even if it's something that you need ASAP? I thought it was more meant for bigger/slower files that will download in the background Nov 15 04:49:20 I have Textview, listview to load into my app and I have them all in oncreate method. Nov 15 04:49:30 To load what? Nov 15 04:50:04 the textviews and listviews Nov 15 04:50:49 I'm not sure what you're asking. If you're loading a huge file then, yeah, you should probably use a background thread. If you're simply initializing views (e.g., setting positions) then you should not. Nov 15 04:50:56 Demon_Jester: you declare them in XML initialize them in onCreate so you can do dynamic stuff with them Nov 15 04:51:02 * AC-130U sighs Nov 15 04:51:30 AC-130U congrats, you are now an android dev Nov 15 04:51:47 i am? Nov 15 04:51:51 how would you know this? Nov 15 04:52:06 shmooz nevermind I just didn't want it on the main thread. Nov 15 04:52:32 I don't understand what you don't want on the main thread. :) Nov 15 04:52:36 your sigh betrays your inevitable frustrations, and is one in a long number of sighs to come Nov 15 04:53:40 Demon_Jester: I would use the UI thread first and then you can see what is slowing down what and what needs to be moved to background Nov 15 04:53:48 TacticalJoke if loading my presettings through xml that is fine for me. Nov 15 04:54:30 shmooz I just wanted least amount of tasks on the ui thread, but if loading my stuff through xml is recommended, I will do that. Nov 15 04:54:53 Demon_Jester: Note that using an XML layout file is not so much about performance; it's more about keeping code easy to read and maintain. Nov 15 04:55:24 In any case, you *have* to use the UI thread for this stuff. You can't touch Views from another thread. Nov 15 04:56:38 TacticalJoke I know the ui thread has to be used, but I mainly didn't want to touch the UI thread unless it was to update it. Thats it really. Nov 15 04:56:47 g00s: its a lot to take in at first Nov 15 04:56:56 this is basically my first night EVER i developed an app Nov 15 04:57:06 real simple "hello world" and then add a button Nov 15 04:57:09 and going from there Nov 15 04:57:10 AC-130U what are you developing? Nov 15 04:57:55 Demon_Jester: Background threads don't make sense unless you're using databases, files, networking, really complex algorithms, or something like this. Nov 15 04:58:04 demon: just training myself in app devel right now Nov 15 04:58:10 AC-130U: that's what google did, and to this day it's a textbox and a button ;) Nov 15 04:58:26 shmooz: slightly glorified but yes :) Nov 15 04:59:13 TacticalJoke I will be doing that, but I always wrote code "sloppy" and wanted to get in the habit of writing code "correctly" Nov 15 04:59:55 TacticalJoke: looks like you found your twin Nov 15 05:00:16 erm Nov 15 05:00:20 ahahahaha Nov 15 05:00:30 I'm actually checking in slightly messy code right now. :[ Because I'm starting a new project. Nov 15 05:00:37 Can't wait to get this stuff stable so that I can neatify it all. Nov 15 05:01:30 TacticalJoke what are you working on anyways? Nov 15 05:01:37 A Reddit client. Nov 15 05:01:57 Intent intent = new Intent(this, DisplayMessageActivity.class); okay.... why do they include the word twice before the = sign? Nov 15 05:02:00 Wait, really? I swear I thought one was already made.... Nov 15 05:02:24 There are many Android Reddit clients. Nov 15 05:02:27 AC-130U because one is not capitalize and easier to read. Nov 15 05:02:29 I haven't found a single good one, though. ;| Nov 15 05:02:31 AC-130U: the first one is a declaration of a type, the second is the name of the variable Nov 15 05:02:47 AC-130U: In C#, you can say "var intent = new Intent(...);". Nov 15 05:02:53 AC-130U: you can have the second be any name you want Nov 15 05:02:56 And other languages, now that I think of it. Nov 15 05:03:24 ah, gotcha. they just used intent for simplicity's sake for tutorial purposes Nov 15 05:03:36 ac-130u yep. Nov 15 05:03:47 it could be Intent view or Intent blow_world_up or whatever i want to name it Nov 15 05:03:51 that makes sense now Nov 15 05:03:55 Sometimes, a repetition of the class name is the best variable name. Nov 15 05:04:14 self descriptive Nov 15 05:04:28 yes Nov 15 05:04:52 ac-130u I really don't want black helicopters over my house tonight pls don't say blow_world_up ;) Nov 15 05:05:10 eh, dont worry, it was just a name used in jest Nov 15 05:05:31 ok im gonna go take a shower before fbi shows up Nov 15 05:05:33 now beginning to understand things a bit better, reading and rereading things Nov 15 05:06:49 now all you need is a few months at a boot camp Nov 15 05:07:07 looks like you build a little here, build a little there, build a little in another module, and repeat ad infinitum Nov 15 05:07:16 Hmm, I have a weird question about garbage collection and memory consistency. Nov 15 05:07:19 Let's say that an app has two threads running (A and B). In A, a reference is set to null. B cannot yet see that this reference has been set to null (because there is no happens-before relation). The garbage collector comes along and frees the memory this null reference used to point to. What happens if B now deferences that variable? Nov 15 05:07:46 I'm assuming that the garbage collector never has to worry about the whole happens-before thing. Nov 15 05:08:17 (In other words, I'm assuming that the garbage collector can see the world as it really is.) Nov 15 05:09:03 Or will the garbage collector refuse to free the memory because B believes it has a reference? Nov 15 05:10:19 that makes more sense Nov 15 05:10:38 Hmm, the second one is annoying for my app... Nov 15 05:10:45 Then I have to use WeakReference to avoid a potential memory leak. Nov 15 05:12:23 Then again, maybe the GC freeing memory causes a happens-before thingy? Nov 15 05:14:30 yeah like you said, if it has references pointing to it it won't collect Nov 15 05:14:52 True. I guess it technically does have a reference at that point. Nov 15 05:16:46 if garbage collector comes and frees memory that the null reference used to point to, maybe do a happens_after that lets B know that the reference has changed? Nov 15 05:26:10 ah yes.... this is nice... even though the tuts on d.android.com was made with eclipse, im still making shit work in android studio Nov 15 05:27:29 I asked in ##java. Someone who seems knowledgeable said that if B still sees a non-null reference then this will stop the garbage collector from freeing the memory. Nov 15 05:28:01 Which makes sense. Though it's a shame the garbage collector can't prod B. :) Nov 15 05:29:05 AC-130U: The issue is that B can block (maybe for a long time). Nov 15 05:29:10 Thereby holding onto the memory for a long time. Nov 15 05:29:24 This could entail a memory leak. Nov 15 05:29:50 s/entail/be/ Nov 15 05:38:50 ohhh that makes sense Nov 15 05:39:59 would B be able to lock and thus somehow alert garbage collector to leave the memory alone for the null reference? Nov 15 05:41:30 Well, ideally, B would realise that the reference is null. Nov 15 05:41:47 B hasn't received the null write yet. Nov 15 05:43:51 Hello. Nov 15 05:43:52 I implemented REST API on app engine. I use spring framework for controllers. For authentication google accounts is needed. For android app I were implement google+ sign in. What is the best way to accessing REST API and use google+ credentials. Nov 15 06:06:59 hmmmm... Nov 15 06:10:51 AC-130U: You'd be no good at poker. Nov 15 06:11:07 youre right, to some degree Nov 15 06:11:22 im good with poker with deaf people because they have a LOT more tells than hearing people Nov 15 06:11:26 they just do not realize it. Nov 15 06:11:46 :D Nov 15 06:11:47 i ALMOST got this app to work right Nov 15 06:11:58 You've done programming before, right? Nov 15 06:12:04 Just checking, because I wasn't sure what you said before. Nov 15 06:12:05 i was supposed to be able to enter some text, click a button, and it would show it Nov 15 06:12:12 a little bit, yes Nov 15 06:12:27 povray, a bit of c Nov 15 06:12:54 nothing really serious Nov 15 06:18:08 How many spaces of indent do you guys use for the "builder" pattern? Nov 15 06:18:21 A lot of people use two standard intents. I use one. Hmm. Nov 15 06:18:25 indents* Nov 15 06:19:44 AKA "fluent interfaces". Nov 15 06:20:25 Actually, it's just one example of fluent interfaces, I guess.) Nov 15 06:20:27 ( Nov 15 06:20:37 TacticalJoke, garbage collection is roots based Nov 15 06:21:02 Okay. Nov 15 06:21:10 this is interesting... when i enter text and click the 'send' button it only shows "Hello World" Nov 15 06:21:13 TacticalJoke, nulling a variable does not mean it is free for collection Nov 15 06:21:20 * AC-130U goes back and rechecks code Nov 15 06:22:07 AC-130U: If you're sending a string to another activity, you'll have to use Intents. Nov 15 06:22:15 which i am Nov 15 06:22:40 but im not sure where yet that i am supposed to send a string to another activity but its not doing it Nov 15 06:23:32 pfn: So, in this case, the fact that B doesn't see null prevents the object from being collected, right? Nov 15 06:23:55 Ok I am back, and hopefully make sense, in Java I am able to do this text.Append(Color.Green, "text log goes here"); but when my app starts I have two different lines of text and it will only use the last color I add, here is what I mean. http://pastie.org/9720507 it keeps loading the red text for both lines. Nov 15 06:24:00 any way around it? Nov 15 06:24:38 Yes, it means anything strongly reachable from a gc root is not eligible for collection Nov 15 06:24:41 K. Nov 15 06:25:17 gc roots are class loaders and threads Nov 15 06:25:31 Demon_Jester: TextView.setTextColor sets the color of the whole thing. Nov 15 06:25:38 pfn: I see. Thanks. Nov 15 06:26:03 TacticalJoke anyway to make specific lines specific text colors or will I need to do something else? Nov 15 06:26:37 Demon_Jester, use spannable strings Nov 15 06:26:39 I've never tried it, but I think you can specify substring colours with spans (or something). Nov 15 06:26:55 pfn tacticaljoke ok I wil lsee what I can find. Nov 15 06:27:50 Spannable is a quirky api Nov 15 06:29:44 AC-130U: You can add "parameters" to the Intent you pass to Activity.startActivity. Nov 15 06:30:19 quirky how Nov 15 06:30:44 rich text is a quirky thing Nov 15 06:40:51 looks like people are using the MS hyper-v emu http://www.reddit.com/r/androiddev/comments/2mb7yv/you_dont_actually_have_to_launch_the_new_visual/ Nov 15 06:41:07 but is this only for xamarin? can "we" use it also :) Nov 15 06:47:07 * AC-130U headdesks Nov 15 06:47:23 ok I got spannables to work as I want, thing is tricky though. Nov 15 06:48:59 Yeah, there doesn't seem to be a "set new input color" thing. Nov 15 06:49:12 I think it might be easier to use ListView for this kinda thing, you know. Nov 15 06:49:14 Not sure, though. Nov 15 06:50:04 ow Nov 15 06:50:08 my brain hurts, heh Nov 15 06:50:09 Naa also brb my laptop keeps buffering this twitch stream on wireless, need to find ethernet port. Nov 15 06:54:30 AC-130u your brain hurts? Nov 15 06:54:34 mine does too :( Nov 15 06:55:39 yes... from android app devel tutorial overload LOL Nov 15 06:55:46 i ALMOST got the app to work as it should Nov 15 06:56:25 I wonder whether Android-development pain eases over time. Nov 15 06:56:29 I guess it correlates with what we're doing. Nov 15 06:57:13 maybe, it eases to some degree, like when you know more how to structure your apps and what steps to take etc Nov 15 06:57:19 and get better at reading code Nov 15 06:57:36 I've been doing it for a few months now. I'm starting to feel 'steady', I guess. Nov 15 06:57:44 Stuff that used to leave me scratching my head is so obvious now. Nov 15 07:00:18 yeah. i hear that Nov 15 07:01:22 One issue is that documentation isn't always great. Sometimes, stuff isn't documented. Sometimes, it *is*, but the documentation is either tiny or unnecessarily complicated. Nov 15 07:01:36 After a while, it almost feels like an "inside knowledge" thing. Nov 15 07:02:48 An example is something like how Fragments interact with the whole save-instance-state framework. I don't think that's clearly documented anywhere. I learned about it by reading the Android code. Nov 15 07:05:18 hmm... yeah, making mistakes within android studio is the best teacher i guess Nov 15 07:14:36 TacticalJoke: sshhhht! don't tell everyone about our secrets Nov 15 07:15:46 :D Nov 15 07:16:58 it's like freemasonry, only the initiated can know Nov 15 07:19:12 shit. i copied code from a fragment, using getActivity() context into a custom view and now it crashes. specifically, MenuItemCompat.getActionView(my menuItem) doesn't work when the menuinflater is created using the view's context Nov 15 07:31:20 if (item instanceof SupportMenuItem) {return ((SupportMenuItem) item).getActionView(); Nov 15 07:31:31 wtf SupportMenuItem Nov 15 07:36:35 for doing openGL app with ndk, is there a good library that makes the development easier? Nov 15 07:46:23 Web browsers should change their behaviour regarding "mailto" links. What they (tend to) do now is so old-fashioned. Nov 15 08:07:11 blargh .... 8+ on interview coding exercises make hulk mad Nov 15 08:11:09 8+ ? Nov 15 08:13:47 er, s//hrs/ Nov 15 08:14:13 (working too hard, can't even type now) Nov 15 08:15:59 (type error) Nov 15 08:16:28 * capella hates those things ! Nov 15 08:17:39 what I really hate is when I try to cast java code into a javascript context and wonder why the method call fails for longer than I'd like to admit Nov 15 08:18:05 cmon! Integer.toString() is real ! Nov 15 08:23:59 I had a tragic thought. Nov 15 08:24:07 Imagine if Microsoft comes along and makes an awesome IDE for Android development. Nov 15 08:24:17 And people just abandon Eclipse and Android Studio (and IntelliJ). Nov 15 08:24:25 And all that effort they put into Android Studio and IntelliJ was wasted. Nov 15 08:24:29 And the project just kinda closes down. Nov 15 08:24:56 * capella must control ... fist of death ... Nov 15 08:28:12 shit, MenuItemCompat.getActionView(item); doesn't like to be called until onActivityCreated ... Nov 15 08:28:19 It'd be sad Nov 15 08:28:19 . Nov 15 08:28:28 but these are in ListView items Nov 15 08:28:57 neverending bullshit Nov 15 08:29:39 what does that ui look like?? Nov 15 08:29:59 capella-s32 what ui ? Nov 15 08:30:32 the one you're designing : Nov 15 08:30:40 ) Nov 15 08:32:19 oh each listview item has an overflow menu as a secondary action Nov 15 08:33:56 * g00s has plan Nov 15 08:35:36 do you guys see this in your gradle console Nov 15 08:35:40 Configuration on demand is an incubating feature. Nov 15 08:35:40 [] Nov 15 08:35:40 [] Nov 15 08:35:40 [] Nov 15 08:35:40 [] Nov 15 08:35:41 [] Nov 15 08:35:42 [] Nov 15 08:35:42 [] Nov 15 08:35:42 [] Nov 15 08:35:43 [] Nov 15 08:35:43 [] Nov 15 08:35:44 [] Nov 15 08:35:44 [] Nov 15 08:35:52 :D Nov 15 08:36:04 whats with all the []s Nov 15 08:38:08 yeah, using a view's contect for a menuinflater fucking breaks all the appcompat shit Nov 15 08:38:13 * capella-s32 didn't do it Nov 15 08:39:06 app level vs view Nov 15 08:39:35 the view would have gotten its context from the activity Nov 15 08:39:43 this makes no sense Nov 15 08:39:55 thats the problem, very little in android makes sense Nov 15 08:40:18 it devolves into superstition, mysticism and witchcraft to get stuff working Nov 15 08:42:05 maybe there is timing problem using context in onFinishInflate Nov 15 08:42:13 and that's why we make the big bucks Nov 15 08:42:22 yeah right capella-s32 Nov 15 08:42:24 heh Nov 15 08:43:04 can i be excused? my brain is full? Nov 15 08:43:12 he Nov 15 08:43:20 hey g00s a while ago you mentioned using a singelton in a service instead of binding. so scenario is a bunch of activities need to be able to register a callback for receiving incoming data from a BT connection. Idea i had was to have first activity start a service, that will have internal looper / handler that will be the original destination of incoming BT data, which each activity can register the callback to get incoming data Nov 15 08:43:20 pushed to it. Nov 15 08:43:45 Instead of binding, I was thinking of just using a singleton to make it easier for the developer I work with (so he doesn't have to add service connections to all his activities) Nov 15 08:43:50 do you see any problems with this? Nov 15 08:44:11 hm, that was probably pfn. he's into singletons in services. i just bind Nov 15 08:44:18 ahh ok Nov 15 08:44:24 see any problems tho? Nov 15 08:47:24 hm, dunno. i let the android framework take care of everything wrt binding. if the service isn't started and the UI goes away it stops, etc Nov 15 08:49:02 right, well this is for a dedicated kiosk app so the service should essentially always be running and accepting incoming data Nov 15 08:50:15 this is the way i do it; i have a service with a list of BT connections. the UI binds, says service.createClient(this bt device) Nov 15 08:50:35 the service sees if that client exists (dont' make another one) Nov 15 08:50:56 if not, it creates it, and hooks its lifecycle listener to the service Nov 15 08:51:20 when the client disconnects, its allowed to keep living. but in onBind, all the disconnected clients are asked to quit Nov 15 08:51:29 ahh Nov 15 08:51:41 once all the disconnected clients quit, by destroying their threads, they ask the service to stop Nov 15 08:51:47 so its a very orderly shutdown Nov 15 08:52:17 right Nov 15 08:52:47 with rxjava sprinkled liberally in the mix ;) Nov 15 08:53:43 thats the easy part Nov 15 08:53:53 the hard part is getting this stupid fucking menuinflater to work Nov 15 08:54:00 heheh Nov 15 08:54:08 on lollipop? Nov 15 08:54:16 support lib Nov 15 08:54:18 appcompat Nov 15 08:54:26 ahh no wonder Nov 15 08:54:41 now that the actionclass as app: prefix, its very fussy Nov 15 08:55:05 for menu items Nov 15 08:55:54 i spend 1% of my time working on interesting parts of my problem domain, and 99% wresting with a shitty platform Nov 15 08:56:27 i bet android has wasted trillions of man lives worth of productivity Nov 15 08:56:42 class action lawsuit? Nov 15 08:57:01 heh Nov 15 08:59:27 these guys just landed a craft on a comet ... and i'm messing with appcompat and menuinflater Nov 15 08:59:39 where the hell did i go wrong Nov 15 09:00:06 hahahaha Nov 15 09:00:11 yep Nov 15 09:02:05 * capella-s32 coincidentally spent many hours over last week hacking moz appcompatview trying to port it to WebApp Nov 15 09:03:21 97% successful ... which basically was fail Nov 15 09:04:21 I'd have to tweak/ change the underlying lib which the author isnt on board with Nov 15 09:06:26 JakeWharton: Is the following okay (in a Globals class)? "public static final OkHttpClient httpClient = new OkHttpClient();" Nov 15 09:06:30 And I'm never closing it or anything. Nov 15 09:19:19 lol g00s poor thing Nov 15 09:22:22 that's fine Nov 15 09:25:39 you play the guitar on the MTV Nov 15 09:25:41 mmmmhmm! Nov 15 09:26:14 Odaym, you're drunk? go home :) Nov 15 09:26:20 haha Nov 15 09:26:25 nah just dire straits in the morning Nov 15 09:26:34 oh it is 130AM here Nov 15 09:26:41 11 AM here Nov 15 09:26:42 Does S-GPS acquire the GPS coords more quickly than traditional GPS? Nov 15 09:28:00 230am Nov 15 09:28:01 workin' Nov 15 09:28:09 *workin' hard for the money Nov 15 09:28:14 is there a guide that presents how to set up eclipse ndk project that contains a native activity? :( I have been searching for 20 minutes and had no luck Nov 15 09:28:28 NDK = SOL Nov 15 09:28:34 SOL? Nov 15 09:28:41 S** out of luck Nov 15 09:29:19 I dont get it Nov 15 09:29:25 Is there a preferred android app ide for linux? Or best? Nov 15 09:29:46 ax562: I use Android Studio and love it Nov 15 09:29:59 is it still in beta? Nov 15 09:30:14 Its improved an incredible amount the last 3-4 months, but yes, technically it is Nov 15 09:30:30 what linux flavor are you running? Nov 15 09:30:45 There's almost nothing inherently wrong with it anymore, if anything. Nov 15 09:30:49 Ubuntu 14.10 Nov 15 09:31:08 Anything non-headless will work great. Nov 15 09:31:31 does it have ndk support? Nov 15 09:31:36 *like debugging Nov 15 09:31:37 It is JAVA based, and can get heavy on RAM usage, but there really is nothing problematic with it anymore. Version 0.9.3 is available. Nov 15 09:32:51 HunterD: I don't know, it is built on IntelliJ's IDEA IDE, which is far more advanced than Eclipse. There would be the option to download plugins for C/C++/whatever development. That and the fact that Android Studio has Android development in mind may put it ahead of Eclipse even further. Nov 15 09:33:15 HOWEVER, I don't think it has specific NDK support. Nov 15 09:34:02 I want to play with some ndk magic but first I want to make my eclipse able to compile simple native activity :| Nov 15 09:34:22 still digging the webz Nov 15 09:35:17 Mind if I ask why you're using NDK? Nov 15 09:37:09 I want to port am openGL app that simulates particles in a gravitational field. I want to make use of multi threading also Nov 15 09:37:26 * AC-130U sighs... i thinki had a good day learning how to code android apps in android studio... Nov 15 09:37:37 ... even if it was my first day ever coding android apps, period Nov 15 09:37:51 AC-130U, show us the result :D Nov 15 09:38:22 just a text entry box and a button and it was supposed to send the typed text to a new window Nov 15 09:38:24 i got close :) Nov 15 09:38:39 it opened the new window but it said "Hello world" and didnt send actual text Nov 15 09:38:43 Put it on the store for .99 i'll buy 5 copies Nov 15 09:38:57 gonna try again tomorrow when my brain aint so mushy and hurting heh Nov 15 09:40:15 HunterD: that a game? Nov 15 09:40:41 not a game, more as a physics demo Nov 15 09:41:22 setting up the development environment should not be so compicated :( Nov 15 09:41:33 complicated* Nov 15 09:41:46 hehehe Nov 15 09:41:55 why? Nov 15 09:42:01 why a physics demo on a phone if not a game? Nov 15 09:44:25 I am more into physics and not gaming. for the fun of making it Nov 15 09:44:32 sometimes fun to play with physics Nov 15 09:45:05 why not just do it on a desktop then? Nov 15 09:45:10 avoid the hastle Nov 15 09:45:18 dont fit in a pocket Nov 15 09:45:19 of IDEs for android ;p Nov 15 09:45:22 yeah yeah Nov 15 09:45:37 I have it on desktop already, from some time ago. and yes, the ide is for android :))) Nov 15 09:45:38 you dont have to explain it, first opengl thing i tackled was supershape formula simulator Nov 15 09:46:10 but you can easy make it into a game and make some cash ;p Nov 15 09:46:56 it;s like an itch in my balls, I must do it now Nov 15 09:48:38 *had ndk 9 downloaded. was downloading ndk 10c for the last 2 hours on bad internet connection. download just failed at the end.... Nov 15 09:49:18 *ill reconnect Nov 15 09:49:35 you dont have to use NDK Nov 15 09:50:30 you can do it in java, just using bytebuffers and such Nov 15 09:50:50 tho ultimatly you wouldw ant to use NDK, depending on what your end goal is, might be better approach to learn how to make android app work Nov 15 09:50:52 then tackle NDK Nov 15 09:58:02 how do I gapps into samsung galaxy 5 4.4.4? Nov 15 10:07:01 javnut is that an app dev question ? Nov 15 10:07:27 StingRay_: it's an app-testing question, so I suppose Nov 15 10:08:04 well, no, no it's not, it's a user question so this is the wrong place Nov 15 10:08:51 oh snap Nov 15 10:10:12 what if I need to download an app Nov 15 10:10:18 to work in conjunction with my app? Nov 15 10:10:50 erm, wtf ? work how so ? Nov 15 10:10:56 what are you wanting to do ? Nov 15 10:15:17 I need to parse through some packet captures Nov 15 10:15:57 in your app ? Nov 15 10:16:43 what is the easiest way to change a value inside a runnable while its running? Nov 15 10:16:52 it's like a package intercepter Nov 15 10:16:56 and I need to try it with kik Nov 15 10:17:03 and other things Nov 15 10:17:36 well if you have a dev quesion here is the correct place, but not how to install things etc Nov 15 10:17:53 Hi. How I can upload text files to myapp ? (before building) ? I have put resources in res/raw but I can't load it within app Nov 15 10:19:17 genymotion is prettty dead though Nov 15 10:21:37 Narzew tip, "can't" is not going to get you far in searching for help or asking in here Nov 15 10:25:59 StingRay_ i searched for that before. It's raw/ folder. But I put the data in the raw/ folder but it wasn't included in build Nov 15 10:28:59 Narzew still, not sure you will get answers without a specific quesiton Nov 15 10:29:20 can't load has no details and is a statement Nov 15 10:32:40 spots that is vague Nov 15 10:32:51 but there are a lot of ways to do it Nov 15 10:33:22 i have an audio thread and i want to be able to change its frequency while its running Nov 15 10:34:00 well if you do like run while (;) { } Nov 15 10:34:07 then you can just implement runnable Nov 15 10:34:12 in some class and add some method Nov 15 10:34:26 void modfreq(float newFreq) Nov 15 10:34:34 and change some class memember Nov 15 10:34:42 that is being read in while (;) { } Nov 15 10:34:42 tried that, but it did not work Nov 15 10:34:55 it only works when i restart the thread Nov 15 10:34:56 well it will work Nov 15 10:35:07 probably cause you were doign something wrong Nov 15 10:35:51 for instance, in the class you can do synchronized setFrequency() and synchornized getFrequency() Nov 15 10:36:02 in your loop use getFrequency Nov 15 10:36:07 http://pastebin.com/BZSBu5J3 Nov 15 10:36:13 that way whenever set is called it's block till get etc etc Nov 15 10:36:37 err Nov 15 10:36:38 samples = genSine(); Nov 15 10:36:38 Nov 15 10:36:38 while (!Thread.interrupted()) { Nov 15 10:36:38 audioTrack.write(samples, 0, samples.length, AudioTrack.WRITE_BLOCKING); Nov 15 10:36:38 } Nov 15 10:36:40 Nov 15 10:36:56 so you get samples once, and wonder why it does not reflect if it changes? Nov 15 10:37:05 you need to move getSine() into the while loop Nov 15 10:37:13 damn Nov 15 10:37:22 hello. I have created a very simple maps activity but maps are not being loaded when I run my app. code: https://gist.github.com/vedant1811/dc8b7793aaa91e4a4162 Nov 15 10:37:37 yeah, you're right there is one missin Nov 15 10:37:38 g Nov 15 10:38:02 or more precise, getSine should be inside the loop Nov 15 10:38:52 works Nov 15 10:39:05 yep Nov 15 10:39:30 thanks for pointing that out, i just haven't seen it, even i spend over an hour looking for the error ;( Nov 15 10:40:15 np Nov 15 10:48:45 Sometimes all you need is a little rubber ducky to talk to and then you find the answer. Nov 15 10:49:10 Also some of these guys can just stare at you silently and the answer pops into your head... Nov 15 10:49:16 they are very good. Nov 15 10:54:09 ahh time to sleeeeep Nov 15 10:57:53 need a nap zzzzz Nov 15 10:57:57 \0 Nov 15 11:03:20 Hello. I am getting the error while trying to create a simple google maps v2 app: Nov 15 11:03:22 11-15 16:01:58.008 30572-30734/com.instano.retailer.instano D/REQUEST﹕ Retrying: com.google.maps.api.android.lib6.b.j@44f07dd8 Nov 15 11:03:23 11-15 16:01:58.008 30572-30734/com.instano.retailer.instano D/REQUEST﹕ Retrying: com.google.maps.api.android.lib6.c.au@45458fd0 Nov 15 11:03:25 11-15 16:02:00.520 30572-30734/com.instano.retailer.instano D/REQUEST﹕ Connection opened to:https://clients4.google.com/glm/mmap/api Nov 15 11:03:26 11-15 16:02:00.520 30572-30734/com.instano.retailer.instano D/REQUEST﹕ Open Connection Nov 15 11:03:28 11-15 16:02:00.841 30572-30734/com.instano.retailer.instano D/REQUEST﹕ DRD(24): 62|15|147 Nov 15 11:03:29 11-15 16:02:00.841 30572-30734/com.instano.retailer.instano D/REQUEST﹕ Close Nov 15 11:03:31 11-15 16:02:00.841 30572-30734/com.instano.retailer.instano D/REQUEST﹕ Error processing: com.google.maps.api.android.lib6.b.d@44de1a70 not retrying Nov 15 11:04:31 vedu: Use pastebin! Nov 15 11:05:58 Sorry. I did https://gist.github.com/vedant1811/dc8b7793aaa91e4a4162 . But then no reply so I pasted it here :( Nov 15 11:06:33 So you spammed the channel to get attention Nov 15 11:10:49 sounds fair Nov 15 11:15:11 why setTaskDescription doesn't work on lollipop? Nov 15 11:15:28 setTaskDescription(new ActivityManager.TaskDescription(getString(R.string.app_name, BitmapFactory.decodeResource(getResources(), R.drawable.ic_launcher), Color.BLUE))); but the app looks normal on recents Nov 15 11:18:18 hey guys? I want to get a reference to a UI element that's loaded inside an adapter Nov 15 11:18:37 like many different cells, each with let's say an icon for the cell and a title under it and an image above the icon Nov 15 11:18:49 I dont want to set the listeners inside the adapter Nov 15 11:19:40 myAdapter.getView maybe? Nov 15 11:21:34 gotta go now, will ask later! Nov 15 11:46:25 Let's talk naming. What is more important, a descriptive name like "Maze Race" or something that is more catchy or "cool" like Voblr ? I mean when you search for a things in google play, do you search in game titles or keywords from description etc? Nov 15 11:46:41 Braze Nov 15 11:47:23 Is Braze a terrible name? For a balls in maze game? Nov 15 11:57:49 catchy and cool is better Nov 15 11:57:57 but it has to actually be catchy and cool Nov 15 12:13:12 * ravilov never searches for apps by name Nov 15 12:13:52 the name only ever comes up when someone wonders what app is it that I'm running, and even then if they want to install it themselves, I might tell them useful keywords instead Nov 15 12:14:06 as in "just search for xxx yyy" Nov 15 12:42:26 anyone successfully linked in openal soft .so from a native activity? Nov 15 12:42:36 or is there a good way to debug why the .so is failing to load? Nov 15 12:49:33 starting to debate re-writing the sound code to just use opensl Nov 15 12:57:08 App name is relevant, works good, it's in tools, don't use lots of space or memory, it's a good utility, description is good to let user understand the usage, screen shorts are well descriptive of features inside. Nov 15 12:57:23 90% uninstall. what could be the causes !!! Nov 15 13:00:19 ads? Nov 15 13:01:20 crashes? Nov 15 13:01:52 better alternatives? Nov 15 13:02:04 description doesnt match quality of app? Nov 15 13:02:59 typos / localizations? Nov 15 13:03:14 if you give us a link, we might could say more Nov 15 13:04:50 does it kill puppies? Nov 15 13:05:12 it might be a very good app for killing puppies, but still ... Nov 15 13:05:48 :D Nov 15 13:06:08 lack of author responsiveness is my guess Nov 15 13:11:00 his fluency in english could provide some clues too ;) Nov 15 13:17:35 Hey guys. Upgrading an app to new AppCompat theme. All my actionbar back buttons have disappeared. Anyone know why that might be? Nov 15 13:26:02 Because the action bar has changed look Nov 15 13:26:54 There's no app icon any more, just a back/drawer icon Nov 15 13:45:14 capella danijoo : no ads, 1 crash in 1000+ installs negligible, can say better then alternatives in store. Nov 15 13:45:32 show us the app then we might can say more Nov 15 13:45:58 danijoo: description is just how to so doesnt matter with quality Nov 15 13:46:28 capella: yes no localisation. its english only. Nov 15 13:46:43 t2mkn: give us a link to the store :pp Nov 15 13:47:13 link in here or in IM :D Nov 15 13:47:20 idc Nov 15 13:50:47 why haven't you posted the link yet? is it such a big secret? Nov 15 13:51:23 ravilov no it's not. just i dont want to market. some may think like that. Nov 15 13:51:34 ... Nov 15 13:51:43 you were *asked* to post the link, how is that marketing? Nov 15 13:52:17 oh well, your own demise then Nov 15 13:52:26 humm... ok here is it my friend: https://play.google.com/store/apps/details?id=com.iglint.android.screenlock Nov 15 13:53:15 well.. look at your reviews :) Nov 15 13:53:26 "Wont let me uninstall" Nov 15 13:53:29 "Not working on s5" Nov 15 13:53:41 "constant annoying notifications" Nov 15 13:54:56 "won't let me uninstall" is admittedly a very dumb one Nov 15 13:55:08 yes Nov 15 13:55:20 the app clearly registers itself as a device admin, you have to unregister in order to uninstall Nov 15 13:55:22 but there are several of it. thats strange Nov 15 13:55:30 but dumb people often forget that Nov 15 13:55:42 what can i do, people dont read instructions for uninstall. Nov 15 13:55:50 nothing you can do Nov 15 13:55:54 problem is the common non-dev-android user just dont know that they have to Nov 15 13:56:12 this is an andorid design problem imho Nov 15 13:56:29 the only thing that comes to mind is including a sort of a "quick help" section and mentioning it there, as a reminder Nov 15 13:56:42 but you should listen to comments like "constant annoying notifications" Nov 15 13:56:56 i mean "impossible to uninstall" isnt a reason why people uninstall :) Nov 15 13:57:04 but notifications are Nov 15 13:57:16 indeed Nov 15 13:57:32 Hi, I was trying to build a simple hello world android project from eclipse and got terrified by the 105 errors that popped up while compiling. Here are the errors:https://dpaste.de/dYMx Nov 15 13:57:43 if it was me though, I'd totally try this app out, seems decent enough and has a decently high score (4.2) Nov 15 13:57:48 notifications are not annoying at all. i have given enough time for that. Nov 15 13:59:12 <_flip> is there anything i can do to increase the performance of a RecyclerView scrolling bitmat heavy CardViews? Nov 15 13:59:18 ravilov: give it a try. u may not be disappointed. Nov 15 13:59:43 but if u: do tell me why. ravilov Nov 15 13:59:56 it is also possible the people that uninstall it are not the kind of people that would leave a review, so in the end you may not be able to figure out the reason by looking at the reviews alone Nov 15 14:00:42 t2mkn, I would if I had a need for a different lock screen, however I'm happy with mine. I'd give it a shot just to see what's it like, but if I do decide to uninstall it would be because I never had a need for such an app to begin with. Nov 15 14:00:47 ya thats happening. not much review Nov 15 14:01:19 I have made a game which is get X balls through a maze into a their respective goals. So it is a bit puzzle, a bit arcade(?), and a bit of a race since it is timed. I first called it Maze Race but find it a bit wrong since it is not really a race, the levels are timed but you are not racing. Suggestion: Mazle (MAZepussLE), Braze, Maze Mania. Nov 15 14:01:57 ravilov: its ok m getting 90%, 1 more may not increase it to 91% :P Nov 15 14:01:59 Mazzletoff Nov 15 14:02:25 t2mkn, lol Nov 15 14:03:34 MazleHoff Nov 15 14:04:31 "work my balls" :p Nov 15 14:06:06 what are your appx uninstall percentage ? Nov 15 14:06:52 0%, which is 100% of them since 0% of them get installed either :p Nov 15 14:07:00 (I don't have my apps on playstore) Nov 15 14:10:30 👍 Nov 15 14:11:59 hah, I only just noticed, you *do* have a reminder to unregister the device admin before uninstall, and in red too Nov 15 14:12:04 people are just too dumb Nov 15 14:13:02 I could never understand this smartphone boom that happened recently, the fact is most people are literally too dumb to use them and don't actually need a smartphone Nov 15 14:13:05 yap, thats what. so what can i reply to them ! Nov 15 14:13:26 tell them they're stupid? :p Nov 15 14:13:32 lol Nov 15 14:13:57 if they don't understand how to do it, you're wrong! Nov 15 14:14:28 Odaym: ya thats right too. i m looking for the right way. Nov 15 14:15:53 are there mirrors for android studio? downloading it from the main site is incredibly slow Nov 15 14:16:00 less than 30 KB/sec Nov 15 14:16:02 that was clearly sarcasm, paraphrasing that infamous saying about the custsomer always being right Nov 15 14:16:27 MacGeek, no official mirrors exist Nov 15 14:16:51 dayum Nov 15 14:16:58 I wanted to set up an android wear emulator to check something Nov 15 14:17:09 it's fast, your internet is slow Nov 15 14:17:23 yeah it's google after all, they have servers literally everywhere Nov 15 14:17:37 my intertube can do a lot more than 30 KB/sec, downloading stuff from elsewhere works just fine Nov 15 14:17:37 if it's slow for you, it's most likely down to your own connection Nov 15 14:17:38 * capella checks under his bed Nov 15 14:17:51 internoob! Nov 15 14:17:59 I have a question man Nov 15 14:18:03 you want to see it? Nov 15 14:18:05 capella, don't bother, it's your bed that's the server Nov 15 14:18:07 * Odaym pulls out his question Nov 15 14:18:15 hehe Nov 15 14:18:45 see I have an adapter that's loading a view, several of them. Inside that view it's loading there's a textview, an imageview and another imageview Nov 15 14:19:00 I populate that adapter from my activity and assign it to my list, great Nov 15 14:19:44 god damn cmd Q Nov 15 14:19:52 on android 5 my issue can be resolved some how. it says device admin enabled. deactivate it brefore. :) but what about older apis Nov 15 14:20:18 now I want a listener to be set on one of those images that the view has for each of the items it has loaded Nov 15 14:20:26 Odaym, God has nothing to do with your crappy client with crappy keyboard shortcuts, or your crappy misbehaving fingers Nov 15 14:20:39 I don't want to see the listeners from the adapter Nov 15 14:20:44 I want to set them from the activity Nov 15 14:20:49 set* Nov 15 14:21:25 ravilol Nov 15 14:21:35 you can answer this one Im sure Nov 15 14:21:38 halp Nov 15 14:22:51 hi there Nov 15 14:23:10 is it possible to use 'Collections.sort' method to sort a CursorLoader? Nov 15 14:23:19 or is there any other way to sort it? Nov 15 14:23:45 Odaym: why not set the listener inside child view. it should be a view class i guess. Nov 15 14:24:00 https://pastebin.com/NP11nKTV Can anyone tell me where I go wrong ? Nov 15 14:24:04 what child, there are no children Nov 15 14:25:07 loading inside adapter, then what u r loading! view is a child object inside right. Nov 15 14:25:27 yea I guess you can call it a child, but it's just a view being loaded by the adapter Nov 15 14:25:58 Odaym, I don't understand your issue Nov 15 14:26:07 I need to open up a file chooser at the press of that view specifically, so I need onActivityResult Nov 15 14:26:19 otherwise I would've just smacked the code in the adapter and whatever Nov 15 14:27:22 so I sort of need "iterate through the adapter and for each view in that adapter, look for the view inside that view with the ID of (the image I want to have a listener) and set a listener on it" Nov 15 14:27:46 this should be done from the activity Nov 15 14:28:57 I dont think I will be able to do that, because if I so manage to get that images inside of those views being loaded by the adapter, my listener on that image will not provide a position Nov 15 14:29:23 create a custom adapter (if you haven't already), inside it create an API to assign the callback, use the API from the activity Nov 15 14:29:51 I dont know how to do that second part Nov 15 14:30:06 ah ok ok Nov 15 14:30:14 guys, can I order a cursoradapter using a column that is present on another table? Nov 15 14:30:38 Im going to create it in a static method callable from the adapter :P Nov 15 14:30:39 How I can read file from asset in Android ? https://pastebin.com/NP11nKTV Where I made mistake ? Nov 15 14:30:46 ravilov perfect custom adapter Nov 15 14:30:53 I do have a custom adapter Nov 15 14:31:17 just need to create the method Nov 15 14:31:44 Odaym: 👍 Nov 15 14:32:02 you really liking that thumbs up icon huh Nov 15 14:32:39 ya my blood group is B+ so m always positive (👍) Nov 15 14:32:41 :D Nov 15 14:32:51 meh Nov 15 14:32:59 real programmer has C blood type Nov 15 14:33:09 h4k1m, sure Nov 15 14:33:35 Ashiren, also known as red bull? Nov 15 14:34:04 ravilov: but how since in my cursorloader I can only sort using columns in concerned column Nov 15 14:34:26 by providing a custom SQL I guess Nov 15 14:34:29 hello, how can I get token to access app engine backend from android app Nov 15 14:34:39 Ashiren: thats right also Nov 15 14:35:19 ravilov: so I need to use a custom sql query instead of a cursorloader coupled with a cursoradapterN Nov 15 14:35:20 ? Nov 15 14:36:24 no idea, I have no insight into your code, but it sounds like you need a multitable join Nov 15 14:37:36 ravilov: I've just a classic: return new CursorLoader(); inside my onCreateLoader (inside my fragment) Nov 15 14:37:58 that's where I order by columns present in current table Nov 15 14:40:20 I've been drinking a lot of red bull lately Nov 15 14:40:32 red boob Nov 15 14:40:52 alright well, that worked Nov 15 14:41:07 it feels like a hack because I've set it up as a static method and I call it from the adapter though Nov 15 14:41:22 and it probably is Nov 15 14:42:07 yeah, not quite what I meant Nov 15 14:42:08 but oh well Nov 15 14:42:32 well what do you mean by API? Nov 15 14:43:22 public CustomAdapter { public static interface OnWhateverListener { public void onWhatever(); } } } Nov 15 14:43:51 also inside CustomAdapter: public void setOnWhateverListener(OnWhateverListener listener) { } Nov 15 14:44:11 pff Nov 15 14:44:15 game is hard Nov 15 14:44:38 um ok Nov 15 14:46:40 oh god there's all sorts of trouble with the one I did Nov 15 14:56:07 Hello Nov 15 14:56:16 I downloaded android studio Nov 15 14:56:27 when I try to create an app, it says it can't find android SDK Nov 15 14:56:46 but the android studio download page states that the SDK is bundeled with the IDE Nov 15 14:56:58 can anyone point me in the right direction ? Nov 15 14:57:13 I'm totally new to android developement and java Nov 15 14:57:32 (used to develop in html, javascript, python) Nov 15 15:01:09 the page is incorrect, download the SDK Nov 15 15:01:45 ok thanks ravilov Nov 15 15:01:50 Hi there, Why does eclipse ide adds appcompat as a new project dependency and forcing it to be compiled from sources? why not use prebuilt appcompat binaries? Nov 15 15:03:21 hello Nov 15 15:03:38 Gsolinas: hi Nov 15 15:04:05 I'm running a virtual android device for the first time , I'm using android sdk Nov 15 15:04:51 I've noticed that it takes a while to boot up, then I'm getting the impression that I'm not able to controll it Nov 15 15:04:58 control Nov 15 15:05:24 Gsolinas: in my experience, the android emulator in the SDK is quite slow, I've had much better results with genymotion Nov 15 15:06:09 MacGeek, that's great news, I've just spent quite some time to configure sdk! Nov 15 15:06:42 Gsolinas: iirc there's a x86 accelerator library you can enable to make the sdk emulator faster Nov 15 15:06:42 my main purpose is to test websites, so the main requirement is a reliable browser emulation Nov 15 15:06:51 but I've just briefly tinkered with it Nov 15 15:07:25 genymotion works fine for that (although it comes without google play services, which you have to manually install separately) Nov 15 15:07:43 MacGeek, I've already installed the accellerator Nov 15 15:09:53 Why does eclipse ide adds appcompat as a new project dependency and forcing it to be compiled from sources? why not use prebuilt appcompat binaries? Nov 15 15:10:39 MacGeek, can I run genymotion without android sdk installed? Nov 15 15:10:44 yep Nov 15 15:11:00 https://www.dropbox.com/s/17fhss8g20l6sel/Screenshot%202014-11-15%2016.10.37.png?dl=0 Nov 15 15:12:08 example genymotion window running chrome Nov 15 15:13:37 MacGeek, jeez, are all devices so heavy in terms of disk space? Nov 15 15:13:59 I'm downloading a google nexus, it's 137 mb Nov 15 15:14:20 yes, they're a bit heavy Nov 15 15:14:37 if you want to use the play store, you'll have to install google play services separately Nov 15 15:15:03 MacGeek, I only need a browser and my host's connection Nov 15 15:15:13 if you google genymotion play store you'll find links that tell you how and provide the necessary zip files to install onto the virtual device Nov 15 15:15:22 well out of the box you'll just have the stock android browser Nov 15 15:15:29 if that's enough for you, then you're set Nov 15 15:15:46 MacGeek, is the default browser chrome? Nov 15 15:15:49 if you need chrome, or other android browsers, you'll need to find the apks for those browsers, or install the google play store Nov 15 15:15:52 no Nov 15 15:16:03 I get it Nov 15 15:16:31 I don't own any android device so I don't know a lot Nov 15 15:18:48 I'm not an android expert either, although I do own two android devices Nov 15 15:19:05 I just adopted genymotion for my virtual machine tinkering since I found the sdk emulator too slow Nov 15 15:19:40 MacGeek, how do I open up the main menu? Nov 15 15:19:50 can I control the machine qith my mouse? Nov 15 15:20:02 doesn't look like it's respondig too well Nov 15 15:20:13 yes you can control it with your mouse - not sure if you can do pinch to zoom, though, I don't think I've ever tried that Nov 15 15:20:23 the virtual machine will probably boot to the lock screen Nov 15 15:20:33 drag your mouse as if you were swiping your finger and it will unlock it Nov 15 15:21:14 then you'll be on your home screen, and you can invoke the application list screen by clicking the button at the center of the dock, the one with 6 white squares inscribed in a circle Nov 15 15:22:36 MacGeek, I see two different docks in the virtualbox preview and the main emulation window Nov 15 15:23:25 after a while I see "unable to connect device" and it shuts down Nov 15 15:23:31 it'll boot into something like this: https://www.dropbox.com/s/xlax35csbnapqw5/Screenshot%202014-11-15%2016.23.04.png?dl=0 Nov 15 15:24:04 MacGeek, I only see he menu on the left Nov 15 15:24:31 tells me to check virtualbox for network conf Nov 15 15:24:50 do you have virtualbox installed and updated? Nov 15 15:26:42 anyone here doing vr stuff? Nov 15 15:26:52 MacGeek, yes... I had it installed Nov 15 15:27:21 it worked without any problems for me, perhaps try quitting and reopening genymotion? Nov 15 15:27:45 MacGeek, trying to update VB first... Nov 15 15:32:18 hey guys Nov 15 15:32:32 is this the right channel to ask for help on app development? Nov 15 15:36:01 d3xter yes, what would you like to know? Nov 15 15:38:13 After importing a project from Github in Android Studio it asks me for this information but I never installed Gradle or whatever: https://www.dropbox.com/s/q1dhkyjabw93qrd/Schermafdruk%202014-11-15%2016.37.45.png?dl=0 Nov 15 15:38:37 i've got an IntentService, which is responsible for doing some network stuff. i was wondering if android provides a way to queue up the intents until the network is back, or should i override onStartCommand() of the IntentService and queue the elements until the networking is back? Nov 15 15:39:58 Because when I point to the gradle version in the .app package this is what I get: https://www.dropbox.com/s/k8hsn2fvdg1x5pg/Schermafdruk%202014-11-15%2016.39.46.png?dl=0 Nov 15 15:40:40 Muchoz: what version of android studio are you using? and which github project? Nov 15 15:40:54 d3xter, 0.9.3, private repo Nov 15 15:41:11 I tried out IntellIJ 14 and only got problems from there on Nov 15 15:41:14 Said fuck it Nov 15 15:43:07 Muchoz: current development version of Android Studio requires a newer gradle version Nov 15 15:43:23 d3xter, yes. But that's in that folder isn't it? Nov 15 15:43:58 d3xter, https://www.dropbox.com/s/n06pqvvbx5zmrrv/Schermafdruk%202014-11-15%2016.43.55.png?dl=0 Nov 15 15:44:21 Muchoz: the gradle delivered with the app is too old Nov 15 15:44:28 Muchoz: one way to solve it, is download gradle on your own and use it as "Local Gradle distribution" when importing the project Nov 15 15:44:49 d3xter, it worked just fine in 0.9.3 yesterday Nov 15 15:45:22 Muchoz: hmm Nov 15 15:46:04 setTaskDescription(new ActivityManager.TaskDescription(getString(R.string.app_name, BitmapFactory.decodeResource(getResources(), R.drawable.ic_launcher), getThemeColor()))); doesn't tint the recents on lollipop, why? Nov 15 15:46:33 Muchoz: then i'm clueless, someone else needs to help Nov 15 15:46:53 d3xter, I fucking hate this gradle shit so much right now. Never does it do its job. Nov 15 15:47:46 Muchoz: this is not gradle's fault? Nov 15 15:48:05 Muchoz: has the gradle files changed since yesterday? are they all present? Nov 15 15:48:14 d3xter, no, yes. Nov 15 15:52:00 Muchoz: tried reinstalling Android Studio? Nov 15 15:52:27 Muchoz: oh, and are the gradle files are up to date, so "git status" doesnt show them as changed? Nov 15 15:53:24 d3xter, no. Nov 15 15:53:37 And no, I'm not gonna reinstall AS once more. Nov 15 15:54:06 in my src folder Nov 15 15:54:12 it fucking imports the repo Nov 15 15:54:17 Is this shit retarded? Nov 15 15:54:19 God Nov 15 15:54:22 Muchoz: alright buddy, calm down first Nov 15 15:54:30 I'm going fucking nuts Nov 15 15:54:45 anyone here has any experience with custom android wear watchfaces? Nov 15 15:54:56 there's something weird I'd like to make and I don't know if it's even possible Nov 15 15:55:16 Muchoz: why do you even include the gradle version inside the project? thats what the gradle wrapper is there for Nov 15 15:55:37 We need help auto-resizing text to fit a rect w/o chopping up words. Any one have experience with this? Tried several libraries online but none worked Nov 15 15:55:44 I downloaded some "watch face makers" from the play store but it doesn't look like it can be done using those Nov 15 15:55:48 Muchoz: oh wait, is this a local gradle installation? Nov 15 15:55:53 d3xter, no Nov 15 15:56:02 d3xter, I'm not including the gradle version Nov 15 15:56:24 Muchoz: what gradle version is this? Nov 15 15:56:27 d3xter, https://www.dropbox.com/s/7b0j3s6kgqsrb45/Schermafdruk%202014-11-15%2016.56.24.png?dl=0 Nov 15 15:57:08 d3xter, no idea Nov 15 15:57:17 The log isn't even telling me the version Nov 15 15:57:37 org.gradle.tooling.UnsupportedVersionException: The specified Gradle installation '/Applications/Android Studio.app/Contents/plugins/gradle' does not implement the tooling API. Support for the tooling API was added in Gradle 1.0-milestone-3 and is available in all later versions. Nov 15 15:59:10 d3xter, how do I set the default wrapper up then? https://www.dropbox.com/s/hsczsz787mjt6gw/Schermafdruk%202014-11-15%2016.59.01.png?dl=0 Nov 15 15:59:11 Muchoz: you just installed the gradle plugin? Nov 15 15:59:17 d3xter, no. Nov 15 15:59:54 I'm just gonna user homebrew and install gradle Nov 15 16:04:31 Muchoz: you downloaded gradle and extracted into .../plugins/gradle? Nov 15 16:04:38 how do I turn on led flash light like in the native camera app? if I use FlashMode.AUTO or FlashMode.ON the picture is dark Nov 15 16:04:40 d3xter, no. That's default Nov 15 16:04:44 Now I'm getting this shit error: https://www.dropbox.com/s/tm71gci573zs25l/Schermafdruk%202014-11-15%2017.04.31.png?dl=0 Nov 15 16:05:24 Muchoz: with the homebrew version? Nov 15 16:05:30 Yes Nov 15 16:08:32 anyone tried to use vorbisfile.c? Nov 15 16:08:40 did you just port the file to use android's file system? Nov 15 16:08:44 or is there a known good port? Nov 15 16:09:19 Muchoz: strange. well to get gradle wrapper you'd need a working gradle installation ^^ download http://www.gradle.org/downloads and extract it somewhere and use it as your local gradle distribution. if its not working, then something is wrong with AS Nov 15 16:09:27 Alright Nov 15 16:09:29 Fuck this Nov 15 16:09:31 reinstall AS Nov 15 16:09:48 I should've never tried IntelliJ 14 Nov 15 16:09:51 piece of shit Nov 15 16:11:05 14? My 13.1 says it's up to date :/ Nov 15 16:12:24 hello, how can I get token to access app engine backend from android app. user must sing in with google plus Nov 15 16:13:30 d3xter, same problem Nov 15 16:14:24 Muchoz: try the version from gradle.org Nov 15 16:16:57 d3xter, same error Nov 15 16:17:31 d3xter, Caused by: org.gradle.api.internal.plugins.PluginApplicationException: Failed to apply plugin [id 'com.android.application'] Nov 15 16:18:48 Caused by: org.gradle.api.plugins.UnknownPluginException: Plugin with id 'com.android.application' not found. Nov 15 16:20:16 FFFFFFFUUUUUUUUUUUU- Nov 15 16:20:30 So glad my client has /ffuu command now Nov 15 16:25:31 Muchoz: http://stackoverflow.com/questions/24795079/error1-0-plugin-with-id-com-android-application-not-found Nov 15 16:31:00 d3xter, once I close that window for importing the gradle project I cannot open it again!n https://www.dropbox.com/s/rfhsum3gkdbnqw1/Schermafdruk%202014-11-15%2017.30.43.png?dl=0 Nov 15 16:32:27 2 days have I wasted so far Nov 15 16:32:29 2 fucking days Nov 15 16:34:26 hello Nov 15 16:34:41 how do I use chrome devtools with genymotion? Nov 15 16:38:06 Muchoz: what happens if you press "here"? Nov 15 16:48:40 d3xter, it's all deactivated because I already pressed on it. Nov 15 16:48:49 I'm gonna take a break Nov 15 16:48:51 fuck that shit Nov 15 16:51:43 I'm trying to do this from a ListFragment: ArrayAdapter adapter2 = new InteractiveArrayAdapter(this, Nov 15 16:51:52 getModel()); Nov 15 16:52:02 But it fails on getModel(). Any ideas of what to do? Nov 15 16:52:46 how does it fail? Nov 15 16:53:39 It says that the method getModel() is indefined for my class ListFragment Nov 15 16:54:43 It's probably because my class is a listfragment instead of an activity which should extend a listactivity Nov 15 16:57:02 It's probably because you don't have a method called getModel in your ListFragment Nov 15 16:57:43 yes Nov 15 17:02:12 I think i've found a new approach to the problem. I'll ask here later if something screws up Nov 15 17:09:17 Muchoz: btw, gradle and android plugins are enabled inside Android Studio, right? ^^ Nov 15 17:13:15 has anyone tried android dev with Visual Studio, I watched a video earlier this week and it looks damn good. Nov 15 17:32:15 hmmhmm Nov 15 17:32:21 Nexus 9 ignores immersive mode? Nov 15 18:06:43 MenuInflaterCompat has setShowAsAction but now getShowAsAction O.o Nov 15 18:07:19 whoever wrote this should undergo forced career re-assignment Nov 15 18:35:13 can somebody tell me why my service is not getting started on boot? i've been in this for around an hour :/ manifest: http://p.samuraimanpurse.com/SG0r2KbL.txt and the receiver: http://p.samuraimanpurse.com/rqAS364j.txt Nov 15 18:35:40 * this is a piece of the manifest Nov 15 18:39:34 hey JesusFreke are you around ? Nov 15 18:41:44 anyone, is it incorrect to have an ActionView in a Toolbar that is not set as an ActionBar via setSupportActionbar() ? it seems to work in some cases, and not others Nov 15 18:41:56 this is dricing me nuts Nov 15 18:44:03 g00s: can BlueTooth do this? ;-) http://arstechnica.com/business/2014/11/man-has-nfc-chips-injected-into-his-hands-to-store-cold-bitcoin-wallet/ Nov 15 18:44:41 oh my Nov 15 18:44:48 heh - indeed Nov 15 18:45:17 * capella waves hands ... these are not the droids you're looking for Nov 15 18:46:15 okay... guess imma break my brains trying to learn android app devel again... Nov 15 18:46:36 AC-130U thats great, just don't tweet about it Nov 15 18:46:53 ill just ask questions if i need to Nov 15 18:46:58 ;) Nov 15 18:47:05 only my 2nd day :) Nov 15 18:56:31 hello. I used template to sign in with google+. Everything wokrs fine. But here is written that PlusClient class is deprecated http://developer.android.com/reference/com/google/android/gms/plus/PlusClient.html Nov 15 18:57:26 guys, the listener's onReceive() gets executed, but the service isn't started Nov 15 18:57:28 any ideas? Nov 15 18:57:38 i do something like Nov 15 18:57:38 Intent myIntent = new Intent(context, ListenerService.class); Nov 15 18:57:38 context.startService(myIntent); Nov 15 19:00:31 Maybe it's already started Nov 15 19:07:31 SimonVT would anticipate any problems inflating a menu inside a custom view's onFinishInflate? there seems to be something weird with the context I get there using getContext(). The app: prefixed things on menu items aren't working right, even with MenuItemCompat. the code worked fine in a plain fragment Nov 15 19:15:03 I don't see any problem with doing it from onFinishInflate Nov 15 19:17:08 i think i see where i fucked up yesterday Nov 15 19:17:48 i was using simple blank template with no fragment and the tutorial seems to call for making a blank activity with fragment Nov 15 19:22:14 SimonVT the menu item's app:showAsAction="always" is also failing, so these app: attributes seem to be invisible here Nov 15 19:24:36 I'm sure you're just doing something wrong Nov 15 19:26:00 i dunno. like i said the code worked in a plain fragment onCreateView. Now I moved that into a a class that extends CardView, in onFinishInflate. The ToolBarView shows, the menu shows, just the app: prefixed things are 'gone' Nov 15 19:26:04 i have the right theme, of course Nov 15 19:35:20 g00s, not using the right inflater Nov 15 19:36:15 I'm using ExecutorService to maintain a thread pool. The documentation says that an ExecutorService should be shut down when no longer needed, to reclaim unused resources. The problem is that I don't know when I could do that in an Android application. Nov 15 19:36:27 My ExecutorService is basically a global variable. At which point can I determine that my app no longer needs it? Nov 15 19:37:48 pfn i only know of one MenuInflater :D Nov 15 19:37:49 that's for you to decide Nov 15 19:38:05 g00s, instance, not class Nov 15 19:38:31 TacticalJoke, that's for you to decide, when you no longer need background jobs, you shut it down Nov 15 19:38:31 I'm thinking that my only option is to allow Android to kill those threads. Nov 15 19:38:55 if you always need background jobs, then you never shut it down Nov 15 19:38:58 Okay. This is a Reddit client. As far as I can tell, my app is never in the position to say "Okay, the user is done now". Nov 15 19:39:02 All right. Nov 15 19:39:20 eg async tasks executor never shuts down Nov 15 19:39:26 Ah, interesting. Nov 15 19:39:32 Hadn't thought of that. Nov 15 19:39:45 pfn oh so maybe ActionBarActivity getInflater() returns a special one? i'll check Nov 15 19:39:50 Thanks, pfn. :) Nov 15 19:39:58 g00s, getMenuInflater Nov 15 19:40:16 i was just saying MenuInflater inflater = new MenuInflater(context) Nov 15 19:40:24 g00s, I ran into the same thing the other day Nov 15 19:40:26 g00s, yes, that's wrong Nov 15 19:40:27 wrong Nov 15 19:40:37 JakeWharton: Is it okay to hold onto an OkHttpClient globally and never close it? Nov 15 19:40:44 interesting let me investigate Nov 15 19:41:21 JakeWharton: My app would prefer that the OkHttpClient stay alive for as long as possible, I guess. Nov 15 19:41:39 There's no point where I can say "Enough with this HTTP business now". Nov 15 19:42:36 g00s, use getMenuInflater Nov 15 19:42:46 hi !!! I have a question, I have a "NavigationDrawerFragment" (auto generated with eclipse), and it work fine. But when closed, I don't want it to be hidden, but just a smaller width, is it possible ? Nov 15 19:42:48 which processes the attrs correctly Nov 15 19:44:19 BTW, if I don't ever shut down the ExecutorService, I take it that the OS will kill it all when it takes down my process (when, for example, my app is running in the background and the memory needs to be reclaimed)? Nov 15 19:44:34 g00s, new inflater doesn't know how to apply the attrs to menu item, of course Nov 15 19:48:31 I'm also curious about whether an ExecutorService, if it doesn't *kill* threads, could prevent an object from being garbage-collected. It may be that the thread never sees that the reference is set to null. Hmm. Nov 15 19:48:56 Makes me wanna use WeakReference for my Activity listeners. But I'm not sure that's needed. Nov 15 19:49:40 pfn you were right, thanks. i was banging my head :| Nov 15 19:50:11 note to self: if there is a getX on ActionBarActivity, better use it Nov 15 19:51:15 Hey can someone help me connect gain access to my remote database? Nov 15 19:58:40 I try to conect googleApli client and get SIGN_IN_REQUIRED error. Why I get this error befor I start main activity I login via google+ Nov 15 20:04:47 ??? Nov 15 20:04:48 ??? Nov 15 20:10:55 hy all Nov 15 20:14:14 can I set the volumes of the speakers separately with the tonegenerator of android api? Nov 15 20:14:36 http://developer.android.com/reference/android/media/ToneGenerator.html Nov 15 20:15:21 Anyone have idea how to encrypt API keys in android source code so that anyone do later reverse engineering can't find it. ? Nov 15 20:19:47 TGMCians, try using "api keys android best practices" as a search term. in a technical sense, you're not going to find a solution that makes it impossible to reverse engineer. at best you could put the api key on a server you control and then have your app hit that server. that is, the api key never makes it to the device itself. Nov 15 20:21:54 timemage : But anyone can have that URL then hacker can hit to my server to get the API key then he can do all other stuff... Nov 15 20:22:36 Which order do you folks use for imports? I tend to do Java, Android, libraries I'm using, and then my own project. Nov 15 20:22:48 TGMCians, the idea is your securing your own server. because the server is yours. whereas if they key is part of the app, it's now out of your hands altogether. Nov 15 20:22:52 Basically general to specific. Nov 15 20:24:33 timemage : I don't think this solution would wurk because anyone can get that URL from app and have API key. Nov 15 20:25:55 TGMCians, i'm not suggesting putting the key in the url. Nov 15 20:26:28 Oh then How ? Nov 15 20:26:31 TGMCians, i'm saying you put your own authorization system between the device and the api the form of your own server. Nov 15 20:26:43 TGMCians, provide your own form of key that you control. Nov 15 20:27:09 TGMCians, if they above it, revoke it. basically you'd be doing exactly what the end api would do to you. Nov 15 20:27:47 TGMCians, s/above/abuse/ Nov 15 20:33:43 g00s, indeed, like I said, I encountered the same a couple days Nov 15 20:46:22 Ok thanks timemage Nov 15 20:49:09 hahah nice, doing the tutorial, i got to a point where i actually have 2 'send' buttons, ahahaha wtf Nov 15 20:49:50 such fun. Nov 15 20:50:56 yes yes Nov 15 20:51:18 also, what i dont quite understand is why when i create an activity i get extends Activity and not ActionBarActivity as the tutorial shows Nov 15 20:51:52 you can change it if you needactionBarActivity Nov 15 20:51:55 things Nov 15 20:51:57 or fragments Nov 15 20:52:43 throws up errors when i do that though Nov 15 20:53:27 are you targeting lower apis as well? Nov 15 20:53:33 then you shall import support Nov 15 20:53:56 already imported but not used Nov 15 20:54:19 then dunno, to little information Nov 15 20:54:37 ActionBarActivity is part of support-v7. If you're not using support-v7, you just use Activity. Nov 15 20:56:08 ABA is a subclass of Activity that has backward-compatible stuff. Nov 15 20:56:12 backwards* Nov 15 20:58:05 ahah, that would make sense... would Activity then supercede ABA but still support ABA for compatibility reasons? Nov 15 21:00:16 Basically, ActionBarActivity lets you have an ActionBar on Android 2.1 (even though the ActionBar wasn't invented until Android 3.0). I think ActionBarActivity is also used to get Material Design on Android versions below 5.0. Nov 15 21:00:58 If you're neither supporting 2.1 nor wanting Material Design, you should simply use Activity. Nov 15 21:01:15 s/2.1/<3/ Nov 15 21:01:20 (Not a love heart.) Nov 15 21:01:29 that makes sense, since i am coding for JB and newer Nov 15 21:01:31 question - can a ctor somehow tell if it's been invoked from another ctor of the same class (this(...)) or externally (via new class())? Nov 15 21:02:15 AC-130U: Note that the tutorials go between support stuff and non-support stuff almost at random. Nov 15 21:02:30 Some tutorials arbitrarily assume you're using backwards-compatible stuff; others arbitrarily don't. Nov 15 21:02:38 yah beginning to, thats why i ask questions, and i hope im not askign stupid ones heh Nov 15 21:02:53 No, not stupid at all. Nov 15 21:03:37 ravilov not that i know of. so if it matters, make it private and have a factory method Nov 15 21:03:45 "The only stupid question is the one not asked" applies to Android programming more than anything. :) Nov 15 21:04:23 im trying to learn how to create a tcp server on an android device so i can connect to it and send commands through that connection but im majorly confused about something i see in every example and tutorial ive read Nov 15 21:04:44 they create the connection on the server, read ONE line of text, usually echo it and then CLOSE the connection Nov 15 21:04:46 I440r you mean all of the 786765378456784356 titorials ? Nov 15 21:04:47 that cant be right Nov 15 21:04:58 every single one of them ive seen yes... Nov 15 21:05:03 huh? Nov 15 21:05:09 can you link example Nov 15 21:05:18 http://lakjeewa.blogspot.com/2012/03/simple-client-server-application-for.html Nov 15 21:05:40 Blog tutorials tend to be awful, FWIW. Nov 15 21:05:55 i know Nov 15 21:06:08 well you dont need to close after reading Nov 15 21:06:11 g00s, not that simple - I have a class with multiple constructors, all of which can be accessed via "new", however some of the constructors call some of the other constructors, so in some circumstances some things will get initialized twice Nov 15 21:06:15 this is just example Nov 15 21:06:15 thats the biggest problem with android development for the nub thers almsot no decent example code out there Nov 15 21:06:27 its BAD example Nov 15 21:06:37 then use better tutorials :o Nov 15 21:06:42 if it is doing something that stupid there how the freek can i even trust it at all? Nov 15 21:06:53 I440r: What kind of server are you creating? Nov 15 21:06:54 im reading the tuts on d.android.com Nov 15 21:07:00 ravilov yeah, thats why i'm saying, make the ctor private , use telescoping factory methods Nov 15 21:07:00 its probably got a totally fucked up and utterly useless design from the beginning Nov 15 21:07:03 g00s, and yeah from what I can tell the best I can do is get Thread.currentThread().getStackTrace() and then examine the trace, looking for "myself" and then going one level up Nov 15 21:07:13 which is good... but what im doing creates interesting results, heh Nov 15 21:07:24 2 buttons when there is supposed to be only one. Nov 15 21:07:25 ravioli, if i had to maintain that code, i'd find the owner and kill them Nov 15 21:07:25 hmm Nov 15 21:07:35 TacticalJoke, i have a native Forth library. i can have my java code send forth code to that compiler and it will compile them and execute them Nov 15 21:07:43 g00s, I'm not going to do that of course Nov 15 21:07:49 i want to be able to interactivly debug that code. to do this i need a shell Nov 15 21:08:42 so i want a tcp server running on the device i can connect to from my terminal, i can then send forth commands or code or whatever and interactvily debug the forth code Nov 15 21:09:24 all the tcp server will do is read input from the connection, send that input to the forth library to interpret and then echo what ever the results of the operation were Nov 15 21:09:44 but it has to be an asynchornous server Nov 15 21:10:45 I440r chek out https://github.com/romainguy/ViewServer/blob/master/viewserver/src/main/java/com/android/debug/hv/ViewServer.java Nov 15 21:11:01 It sounds like the server should allow clients to stay connected for some time, in your case. Nov 15 21:11:15 if romain guy posted that its not bad example code :) Nov 15 21:11:25 TacticalJoke, exactly Nov 15 21:11:36 until it gets a "bye" command Nov 15 21:11:38 basically Nov 15 21:11:42 see line 390, etc Nov 15 21:12:46 ok except theres alot of overhead in that example thats a) irrelevant to my purpose and b) i dont understand Nov 15 21:12:52 i.e. some of it might be important Nov 15 21:13:06 its the classic google example code Nov 15 21:13:16 ++ Nov 15 21:13:27 The good thing about your case is that it's such a platform-agnostic domain that so much of it is googlable. :) Nov 15 21:13:31 coder goes to manager at google and says "we need an example of how to draw sprites on the display" Nov 15 21:14:02 manager says... ok write a complete multi threaded, multi player space invaders game with sprites sound, sockets, ... ... .. Nov 15 21:14:17 i.e. buyrng the important stuff inside gigabytes of other stuff Nov 15 21:14:52 im sure i could put that snippet in my code if i knew where Nov 15 21:15:05 or how to make it fit the picture i have in my head Nov 15 21:15:36 well, that ViewServer isn't actually meant to be example code. It's a debug server that was written for a specific debugging need Nov 15 21:15:39 i cant just BLOB that snippet inside my existing code, the entire server application actually has to be a separate project that i can incude in any other project Nov 15 21:16:24 it's like it's it's a generic "here's how you do interactive sockets" example or anything Nov 15 21:16:43 what i need is a simple example that shows ONLY how to create an asynchronous server. not a complete multi threaded multi player space invader with music, sound effects and everything else all blobbed together lol Nov 15 21:17:04 well you don't have it Nov 15 21:17:07 figure it out Nov 15 21:17:42 well a lot of people TRY to give those examples but they are bad examples for being one shot Nov 15 21:17:57 you get to send ONE message and it displays it in a text view and dies Nov 15 21:18:01 awesome examples :/ Nov 15 21:18:50 i certainly do not want to support multiple connections Nov 15 21:19:05 why don't you try to get the example and understand Nov 15 21:19:28 what's going on inside it, and from that deduce how you would need to start removing things to end up with what you want since what you want is much simpler (as you say) from what's in the example Nov 15 21:19:39 im looking at the posted code. the actual server part is quite small yes not complicated at all Nov 15 21:19:41 Can anyone recommend a detailed tutorial on the Android motion sensors? I want to create an app that counts reps while exercising, but the info I've found so far is somewhat vague. Nov 15 21:19:48 it's not like it's going to go a completely different way when its an example of what you want, it's going to go the way its going now, but with less things Nov 15 21:20:08 just start stripping it Nov 15 21:20:11 see what happens, lol Nov 15 21:20:17 literally play with it Nov 15 21:20:33 not infront of us though Nov 15 21:21:00 I ordered Reto Meier's Professional Android 4 book Nov 15 21:21:09 1 month from now, I will schoolin yo asses OK Nov 15 21:21:50 what license is on that romain guy code? Nov 15 21:21:52 Hrm...I have that book. Is it good? LOL. Nov 15 21:21:54 * I440r looks Nov 15 21:21:56 haha! Nov 15 21:21:59 you gotta read it bro! Nov 15 21:22:15 aosp Nov 15 21:22:17 I do. Wife got it for me to help me get off my ass and code. Nov 15 21:22:25 Guess she chose wisely. Nov 15 21:22:33 is it good? I really like Reto from videos I've seen Nov 15 21:22:42 thats a problem too Nov 15 21:22:59 I didnt even see the TOC the time I bought it, I had seen it and wanted it way before Nov 15 21:23:02 :/ Nov 15 21:23:25 get it working first, then worry about license! Nov 15 21:25:26 never work with name.com Nov 15 21:25:27 ok? Nov 15 21:25:47 How can I get token that android client can access RESTful API on app engine Nov 15 21:26:22 I440r: why is that a problem? Nov 15 21:26:31 apache is a pretty relaxed license Nov 15 21:26:46 JesusFreke, because THIS part of the code is closed source Nov 15 21:27:02 I440r: right, apache doesn't require you to release the source Nov 15 21:27:04 my forth will, when finished be a commercial product, closed source Nov 15 21:27:21 is that what an AOSP licence is? an apache license? Nov 15 21:27:37 I440r: did you even look at the header on that file? :) Nov 15 21:27:38 careful with the GPLs, anything you put out as opens source will have to stay open source for at least 3 years on all versions of the software Nov 15 21:27:43 yes Nov 15 21:27:43 "Licensed under the Apache License, Version 2.0 (the "License");" Nov 15 21:27:44 v3 at least Nov 15 21:27:54 Odaym: 3 years? Nov 15 21:27:56 oooh ! Nov 15 21:27:57 yes Nov 15 21:28:03 i did however miss that part of it Nov 15 21:28:06 Odaym: [citation required] Nov 15 21:28:27 guy from Oracle contacted me on this after he asked for a source for a software I had open sourced and then took off Nov 15 21:28:32 hell! Nov 15 21:28:32 @oracle.com said the email Nov 15 21:28:35 *hello Nov 15 21:28:36 so.. :) Nov 15 21:28:53 Can someone help me with 'adb devices'? Nov 15 21:28:54 Odaym: I'm not an expert on gpl or license or anything, but afaik, there's no time limit mentioned in the license :) Nov 15 21:29:13 It does not detect connected device (Sony Xperia android 4.3). Nov 15 21:29:50 it just shows an empty list Nov 15 21:30:15 I have change usb connection mode to mass storage but it didnt help Nov 15 21:31:33 Odaym: actually, nevermind Nov 15 21:31:37 it's true? Nov 15 21:31:42 there is a 3 year time period mentioned in the license Nov 15 21:31:59 yea but it's in the "Non Source forms" Nov 15 21:32:00 "accompanied by a written offer, valid for at least three years and valid for as long as you offer spare parts or customer support for that product model" Nov 15 21:34:52 Google has released a second Android advert on UK TV. Nov 15 21:35:47 hi guys, i'm trying to build a webview for an already existing native app, and I need to load a json file (via javascript) that will be located somewhere in the app. what would be the best strategy to go about it? Nov 15 21:36:57 be together, not the same Nov 15 21:37:03 that's really very clever Nov 15 21:37:23 appeals to individuality Nov 15 21:39:30 is there a more proper channel to ask a question like this perhaps? Nov 15 21:40:15 what's the technology you're using to do this? Nov 15 21:40:20 #technologyname Nov 15 21:40:42 Odaym: It also seems to mock Apple a little. Nov 15 21:40:48 it is for Apple Nov 15 21:40:49 It does seem clever, yeah. Nov 15 21:40:54 directly Nov 15 21:41:08 they didnt toot how they were better, they hint at how others are wrong Nov 15 21:42:49 Odaym: if you were asking me, the webview is HTML/JS. and I need to read a json file with JS and create stuff with its data Nov 15 21:43:12 no but you must be using something with a name to be able to get all this to run on a phone Nov 15 21:43:18 phonegap, ionic, etc..? Nov 15 21:43:23 titanium? Nov 15 21:43:37 hmm, it's going to be embedded in a native app Nov 15 21:43:49 not today Nov 15 21:43:51 lol Nov 15 21:43:52 i'm not sure if they're using something like phonegam or titanium? Nov 15 21:44:00 gap* Nov 15 21:44:14 i have absolutely no idea about android dev Nov 15 21:44:23 (obviously) Nov 15 21:44:26 you want to write HTML/js and have that thing you wrote be running alongside native code? Nov 15 21:44:37 yes pretty much Nov 15 21:44:41 impossible Nov 15 21:44:55 impossibrrruuuu Nov 15 21:44:56 so it's a native app, 1 single aspect of it will be an html/js webview Nov 15 21:45:07 you can't Nov 15 21:45:11 ;o Nov 15 21:45:34 a native android app accepts only C code from the NDK or Java code from the JDK Nov 15 21:45:55 there is no JavaClass.evalThisJSforMe("JS code") Nov 15 21:46:03 it just has to communicate with the native app and get a single file Nov 15 21:46:21 can't you just load a webview within a native android app? Nov 15 21:46:39 http://developer.android.com/reference/android/webkit/WebView.html Nov 15 21:46:39 ? Nov 15 21:46:45 yea, what about that? Nov 15 21:46:49 that's not what you're asking.. Nov 15 21:46:56 you're saying you want to write JS inside the native code Nov 15 21:47:11 no i'm sorry if I sounded confusing Nov 15 21:47:27 there's this native app, 1 aspect of it will be a webview, which I'm writing with HTML/JS Nov 15 21:47:54 what's an aspect man Nov 15 21:48:06 part of its code? what? Nov 15 21:48:18 say you open the app, visually you see 3 tabs Nov 15 21:48:27 great Nov 15 21:48:31 Let's say, "Get started", "Buy Stuff", "Get Help" Nov 15 21:48:35 amazing Nov 15 21:48:38 the Buy Stuff part will load a webview Nov 15 21:48:43 ok Nov 15 21:49:20 so when a user taps the "Buy Stuff" tab, it loads the webview I'm writing Nov 15 21:49:26 ohhh I see Nov 15 21:49:33 the webpage is hosted somewhere and written in whatever Nov 15 21:49:34 ok Nov 15 21:49:37 yeah Nov 15 21:49:48 you want from that page to get something from the app Nov 15 21:49:59 ideally the webpage will be static html/js and live in the app filesystem somewhere Nov 15 21:50:01 or rather, from the phone's storage? Nov 15 21:50:23 yes, the app itself Nov 15 21:50:42 has a json file, and I'm wondering what would be the best strategy to get that file within the webview and read it with js Nov 15 21:50:54 yea, if that page wants to gain access to the device's storage or whatever, it needs to be written in a technology that exposes the storage to the app (you call it webpage) you're writing Nov 15 21:51:07 so your page needs to be an app written in Phonegap or Titanium or Ionic or or or Nov 15 21:51:29 aha Nov 15 21:51:36 but still Nov 15 21:51:37 no Nov 15 21:51:41 no you can't Nov 15 21:51:56 cause that app you're going to write is going to be "opened" when the user clicks Buy Stuff Nov 15 21:52:12 yep Nov 15 21:52:13 so it will overtake the native app and open instead of it Nov 15 21:52:32 and show the splashscreen that is typical of all cross platform..platforms Nov 15 21:52:36 and immediately that webpage needs to communicate with the app, get a json, and build stuff with its data Nov 15 21:52:43 it can't be done Nov 15 21:52:49 100% Nov 15 21:53:05 let me talk to your manager Nov 15 21:53:06 if you cansel a doInBackground does it run its "finally" part? Nov 15 21:53:22 onPostExecute? Nov 15 21:53:28 why do you want to execute js? Nov 15 21:53:36 cause he doesn't know native Nov 15 21:53:44 so much easier to learn this little part of native, vm2004 Nov 15 21:53:49 really Nov 15 21:54:03 :( Nov 15 21:54:07 no, this code has a doInBackground and another method to kill the background task Nov 15 21:54:19 but if it KILLS the background task it never closes the port Nov 15 21:54:21 find out where the tab is opening, inside its content place the snippet that opens a file from the storage, sends it to a server, and on the server continue your stuff from elsewhere Nov 15 21:54:55 vm2004: do it in java Nov 15 21:55:01 http://stackoverflow.com/questions/2735102/ideal-way-to-cancel-an-executing-asynctask I440r Nov 15 21:55:24 it has an onPostExecute but that does not close the port either Nov 15 21:55:30 spots: the idea would be to do it via webview so that it can be later used in iOS as well Nov 15 21:55:31 onCancelled Nov 15 21:55:50 nah man you can't talk (with usual JS) to an app like that Nov 15 21:55:54 I440r: To cancel the download, you probably have to close the Socket. Nov 15 21:55:54 that's why there's phonegap and all of those Nov 15 21:55:57 bad idea Nov 15 21:56:10 then use ndk and write it in c++ Nov 15 21:56:14 oh my god, vm2004 Nov 15 21:56:20 Cancelling an AsyncTask probably just interrupts a Thread, which probably won't stop a download/upload. Nov 15 21:56:25 you can open phonegap apps in the browser Nov 15 21:56:28 it can be done! Nov 15 21:56:36 phonegap sucks Nov 15 21:56:51 do the world a favor and use the right language for the right task Nov 15 21:56:57 TacticalJoke, its not a download. this example code looks good but i asked a specific question. if i do "networktask.cancel(true) does that just KLILL the task or does that task get to run its "finally" part Nov 15 21:56:59 You might have to make the socket reference volatile. Nov 15 21:57:03 this is a specific task that he needs to do, and it can be done, why not Nov 15 21:57:09 if not then this code has a bug Nov 15 21:57:27 obviously I agree with you, it's not my call though Nov 15 21:57:32 What do you mean by "finally part"? Nov 15 21:57:41 http://stackoverflow.com/questions/5135438/example-android-bi-directional-network-socket-using-asynctask Nov 15 21:57:43 thats the code Nov 15 21:57:54 I take it back vm2004 because I remembered that definitely you can open a phonegap app in a browser and it behaves just fine Nov 15 21:57:58 i know companies that used phonegap Nov 15 21:58:04 src\com.exampleasynctask\MainActivity.java: Nov 15 21:58:09 beyond that I dont know how you would get it up on the internet Nov 15 21:58:11 which led for them to spending more money and make it native Nov 15 21:58:28 thanks guys Nov 15 21:58:45 I440r: My guess would be that AsyncTask.cancel won't actually achieve anything. Nov 15 21:58:50 I worked with a company that used phonegap and I worked with a company that used Titanium Nov 15 21:58:54 both are respectable platforms Nov 15 21:58:59 TacticalJoke, ? Nov 15 21:59:02 just need a master with the language that they use Nov 15 21:59:08 it wont cancel the task at all? Nov 15 21:59:11 you need a proficient web developer to work with them and they are very good Nov 15 21:59:13 Unless you're using isCancelled or something. Nov 15 21:59:14 so the code has another bug too then lol Nov 15 21:59:28 oooh? Nov 15 21:59:43 I linked you to the part where it says use isCancelled.. Nov 15 21:59:47 so blahtask.cancel() is basiclaly a signal to the task that it should check for and handle? Nov 15 21:59:56 I don't know enough about AsyncTask to say for sure (looking at the code right now). Nov 15 22:00:00 I440r: I think so. Nov 15 22:00:12 that makes the code more understandable :) Nov 15 22:00:34 I440r: Generally, with socket stuff, I think you have to call Socket.close to stop stuff from happening. Nov 15 22:01:14 TacticalJoke, this code does not have an isCancelled() check Nov 15 22:01:24 it's a callback man Nov 15 22:01:26 it has an onCancelled() tho Nov 15 22:01:43 but that does not close the sockets Nov 15 22:02:01 magically it wont Nov 15 22:02:08 you'd have to mention it explicitly Nov 15 22:02:09 it has a networktask.cancel() in its onDestroy Nov 15 22:02:12 Maybe AsyncTask checks isCancelled at some time. Nov 15 22:02:15 but that does not seem to close the socket Nov 15 22:02:21 Though probably not before a socket has finished reading/writing. Nov 15 22:02:23 Or timing out. Nov 15 22:03:01 and the only timeout specified in the posted code is the 10 second limit you have to connect to the server which is another thing that HAS to go Nov 15 22:03:31 You'll probably want some timeout value, though. Nov 15 22:03:35 nope Nov 15 22:03:37 Not sure whether there are defaults if you don't specify anything. Nov 15 22:03:43 not for the innitial connection Nov 15 22:04:21 if there is an implied timout on all connections to my server then that has to be inside a while(1) Nov 15 22:04:37 i want the user to be able to connect or NOT to the debug server Nov 15 22:05:01 and be allowed to connect at any time he choses Nov 15 22:05:14 i can probably achieve that Nov 15 22:05:16 Sorry, I was thinking of the client. Nov 15 22:05:22 I guess the server can just listen and listen. Nov 15 22:05:27 ya client has a connection time out Nov 15 22:05:48 except this is a server example where you get 10 seconds to connect to it and then it dies Nov 15 22:05:57 which is utterly stupid Nov 15 22:06:15 hey workd. you have 10 seconds to connect to my web browser after i launch it. if you dont connect it goes away Nov 15 22:06:18 /facepalm Nov 15 22:07:19 i think i can mangle this code to fit my use case and then tweak these stupidnesses out of it over time Nov 15 22:07:29 *over time* Nov 15 22:07:37 probably months Nov 15 22:07:44 probably never Nov 15 22:07:53 ty Nov 15 22:07:56 "later is never" --Dijikstra Nov 15 22:07:59 :D Nov 15 22:08:29 Isn't this a client, not a server? Nov 15 22:08:32 This SO post. Nov 15 22:08:38 no its a server Nov 15 22:08:50 "ill tweak this code RSN..." Nov 15 22:08:54 *never gets around to it* Nov 15 22:09:01 isnt it? Nov 15 22:09:35 the network task loop reads the input, does something and then loops Nov 15 22:09:44 This is terrible code. Putting networking code in MainActivity.java? Rly? Nov 15 22:09:51 actually it reads the input then starts a loop which reads it again and again. Nov 15 22:10:24 .... NOOOOO... make MainActivity.java call an Intent or something similar to Networking.java or someshit Nov 15 22:10:27 TacticalJoke, the code i posted has a NetworkTask Nov 15 22:10:28 thats what makes most sense to me Nov 15 22:10:42 I'm not seeing where it creates a server. Nov 15 22:10:48 I see that it connects to 192.168.1.1:80. Nov 15 22:11:07 erm Nov 15 22:11:18 crap i think your right :/ Nov 15 22:11:20 fud Nov 15 22:11:40 search on android async tcp server. get client code :/ Nov 15 22:12:19 I haven't written a server in about 10 years. Otherwise I'd give you a TL;DR right now. Nov 15 22:12:56 I wonder whether you could just keep it simple and close the client every time, though. Nov 15 22:12:58 tldr code is never good example code for learning specific things from Nov 15 22:13:04 Not as "light", but it'd be so easy to write. Nov 15 22:13:08 thats the problem with android. thers no fucking example code thats worth a damn Nov 15 22:13:26 I440r: Are you seriously complaining about my offer to help were I more knowledgeable?! Nov 15 22:13:35 TacticalJoke, hell no! Nov 15 22:13:36 lol Nov 15 22:13:53 thats not what i meant. i was talking about the crud out there right now. Nov 15 22:14:07 there may well be some very good examples out there. buried in a sea of slime Nov 15 22:14:08 * g00s regrets posting viewserver now Nov 15 22:14:10 Oh, okay. Nov 15 22:14:26 How can I get token that android client can access RESTful API on app engine Nov 15 22:14:26 g00s that code has A LOT i do not understand Nov 15 22:14:36 That ViewServer code does look like the exact kinda code I440r needs to write. Nov 15 22:14:37 it also does a lot i dont need Nov 15 22:14:41 Despite there being more code than he needs. Nov 15 22:14:50 I440r me too :D Nov 15 22:14:52 TacticalJoke, it does Nov 15 22:14:53 I440r: You can just Ctrl+F through it. Nov 15 22:14:56 extract the pattern and run Nov 15 22:15:00 Ctrl+F for ".close", for example. Nov 15 22:15:04 For "accept". Nov 15 22:15:12 You get like seven results for those two queries. Nov 15 22:15:16 It's basically a text-parsing exercise. Nov 15 22:16:19 I440r: Are you writing the client? Or does it already exist? Nov 15 22:16:27 there will be no java client Nov 15 22:16:30 only the server Nov 15 22:16:36 What is the client? Nov 15 22:16:45 the client will be a telnet connection to the server Nov 15 22:16:49 or something similar Nov 15 22:17:03 Okay. It might be easiest to begin with a server that closes the client connection after every request. Nov 15 22:17:10 nope Nov 15 22:17:12 Then worry about keeping connections open. Nov 15 22:17:26 later Nov 15 22:17:45 that is stupid. i get to send ONE debug command to the server for processing by the forth library and then the connection closes? Nov 15 22:18:00 thats the problem with all the examples ive seen out there. ONE SHOT Nov 15 22:18:10 The point is that it's very easy to write the one-shot code. Nov 15 22:18:17 That's why I'd advise writing that *first* Nov 15 22:18:18 . Nov 15 22:18:22 Then worry about keeping connections going! Nov 15 22:18:27 That's the hard part (if I recall correctly). Nov 15 22:18:35 The tutorials do it because it's easy. Nov 15 22:20:30 If you're keeping a connection alive, things get more complex. What if the client gets disconnected but the server doesn't get notified? How many threads are you gonna keep around to account for that possibility? Nov 15 22:21:27 You can't just have one worker thread in that case, I think, because the worker thread will be tied up when the server thinks the client is connected and the client is now trying to reconnect. Nov 15 22:21:50 Though I have no idea. It's been about 10 years since I've thought about all this stuff. Nov 15 22:21:57 The last server I wrote was an HTTP server using winsock. :) Nov 15 22:22:55 TacticalJoke, im sure android has some high level thingies that take care of all those low level thingies for you Nov 15 22:23:18 if i had control over the lowest levels of this i would probably have a much easier time Nov 15 22:24:12 I think the lowest level is gonna be java.net.Socket. Nov 15 22:24:25 i dont THINK high level. it takes me a long time to figure out how all the high level pieces interact Nov 15 22:38:44 I have a question about something I read in the documentation. When using the TaskStackBuilder to create a pending intent, what is meant by starting a new task. Nov 15 22:39:22 If I click on a notification that does not have a stack of previous activities, it still goes back when I press back. Nov 15 22:39:49 What is meant by a new task? Nov 15 22:40:03 hello. I need help- Nov 15 22:40:05 How can I get token that android client can access RESTful API on app engine Nov 15 22:41:41 Does do new stack replace the old stack, or does it make two seperate concurrent stacks? Nov 15 22:44:59 anyone? Nov 15 22:52:36 hello. I need help Nov 15 22:52:37 How can I get token that android client can access RESTful API on app engine Nov 15 23:23:33 hai Nov 15 23:23:41 i have a native library that only supports ARM Nov 15 23:23:57 how do i set this up w/ gradle so i can disable that library on non-arm devices Nov 15 23:24:43 what does gradle have to do with it Nov 15 23:25:27 try to load your library, if it fails, disable the native features Nov 15 23:25:38 Failure [INSTALL_FAILED_CPU_ABI_INCOMPATIBLE] Nov 15 23:25:47 when i include the lib Nov 15 23:26:14 that's a manifest setting Nov 15 23:26:25 i didn't change my manifest Nov 15 23:26:55 it works when i comment out this line : // compile files('libs/armeabi.jar') Nov 15 23:27:15 I am having a problem with the TaskStackBuilder. I think I have jelly bean, but back navigation is not working. Nov 15 23:27:45 I added the parent stack, and before that I added individual intents, but when I press back, it takes me back to the home screen; Nov 15 23:28:03 But when I do it without the task stack builder, it goes to the previous activity. Nov 15 23:28:45 I am not building an application yet I am just trying to get familiar with the SDK. Nov 15 23:28:53 Can someone help me please? Nov 15 23:29:53 JacobTabak, dunno then Nov 15 23:29:57 think i found it Nov 15 23:30:23 JacobTabak, check the generated manifest and find the feature that sets the tag Nov 15 23:30:38 or just do it with gradle :) Nov 15 23:31:14 well, that's what I mean Nov 15 23:31:51 hello? Nov 15 23:34:18 read the docs Nov 15 23:34:32 your question isn't anything interesting for someone to answer Nov 15 23:34:37 or detailed enough Nov 15 23:35:02 pfn http://pastebin.com/J2SvTsG1 Nov 15 23:35:04 fyi Nov 15 23:35:07 works Nov 15 23:35:17 I read the docs but I did not find the information I was looking for. Nov 15 23:35:27 JacobTabak, indeed Nov 15 23:40:29 I am trying to make my test app have a previous activity stack when you navigate to an activity via a notification, so that when you press back it navigates to them. Nov 15 23:40:59 But even though I am following the docs on notifications, when I press back it goes to the home screen. Nov 16 00:08:32 then you did it wrong Nov 16 00:08:42 again, not enough detail Nov 16 00:22:10 The JSON Reddit gives is way more complex than I'd thought it'd be. Nov 16 00:22:16 God damn, that's long. Nov 16 00:39:54 Hi, I'm trying to get a camera image via an intent. The resultCode in the onActivityResult(...) however is always RESULT_CANCELLED even though I successfully took an image Nov 16 00:40:29 Does anyone know what could have gone wrong? Nov 16 00:53:32 anyone know of any links that explains drawables and how to animate them? Nov 16 00:53:40 animate via code Nov 16 01:14:26 Anyone know when overriding listview drawChild(Canvas c, View child, long drawingTime) is the canvas object that of the listview or that of the child? Nov 16 01:14:54 Hi people Nov 16 01:15:26 I need help with something. Im trying to make a online TV app. What do I need to know about this? im a newbie but i know android a little and had a course about it Nov 16 01:17:59 is there a way to see any network requests that an app makes? Nov 16 01:18:12 add logging Nov 16 01:18:15 or use a proxy Nov 16 01:18:19 @RustyShackleford Nov 16 01:20:34 JacobTabak, what does the function called in android when you slide over the screen and something happens? Nov 16 01:20:41 like opens a new activity Nov 16 01:22:02 JacobTabak: well not my app. Someone elses app Nov 16 01:22:12 proxy Nov 16 01:22:17 charles works Nov 16 01:22:32 IDOT has an app that shows travel times on Illinois highways. Their app sucks though Nov 16 01:22:43 i'd like to see where they are getting their data Nov 16 01:23:00 Or just let the phone share your wifi and sniff it with wireshark, unless it is https. Nov 16 01:25:54 peyam: What you need to know is how to set up a streaming server, which has little to do with android. And then you'll need to make a client for it on android. Also I think the term you were looking for was "swipe" Nov 16 01:26:20 ThreeFive, thanks you very much Nov 16 01:27:09 Poor guy just got notified for no reason :( Nov 16 01:29:37 are there any ultra-cheap android devices that don't have radios in them? Nov 16 01:29:55 heh Nov 16 01:30:01 why don't you want the radio? Nov 16 01:30:07 eh its for a client Nov 16 01:30:25 I don't know if they are keeping the radio in the motog 2 or not Nov 16 01:30:37 Hey! Nov 16 01:30:38 is that upcoming? Nov 16 01:30:43 I never use it in my motog Nov 16 01:30:52 should i just tell him to get a moto g? Nov 16 01:30:58 Anybody that can help me with how to get my listview from a ListFragment? Nov 16 01:30:58 they should be close to shipping Nov 16 01:31:17 aceus findViewById(android.R.id.list) Nov 16 01:31:19 I love the motog, price not with-standing only real issue is no sd card Nov 16 01:31:28 eh i don't think thats an issue? Nov 16 01:31:31 yep, i've tried that but it does not work Nov 16 01:31:37 but the cloud has been fine for me Nov 16 01:31:50 it comes with 65gig google drive storage Nov 16 01:31:51 so moto g 2 is not moto g (2nd generation) right? Nov 16 01:32:01 i've also tried the getListView() but it gives me an nullpointerexcp. Nov 16 01:32:01 it is Nov 16 01:32:11 oh is this it? http://www.motorola.com/us/moto-g-2nd-gen-pdp-2/Moto-G-2nd-Gen./moto-g-second-gen-buy.html Nov 16 01:32:48 aceus: then your fragment doesn't have a list yet. Nov 16 01:32:50 yup Nov 16 01:32:59 hmm Nov 16 01:33:15 It do displays my listview with data in it... Nov 16 01:33:18 does* Nov 16 01:33:22 I think its the best phone for the price personally, clearly opinions can differ of course ;) Nov 16 01:33:37 I like the size of it Nov 16 01:33:50 can you take a look at my code? Nov 16 01:34:13 pastebin works, as long as it is not too big Nov 16 01:34:13 is this first gen or 2nd gen Carbonflux ? https://play.google.com/store/devices/details?id=moto_g_8gb&hl=en Nov 16 01:35:27 that looks like first gen to me but I can't be sure Nov 16 01:35:51 either way really Nov 16 01:36:09 I guess one issue is 5.0 vs 4.4.4 Nov 16 01:36:27 I don't know if the first gen motog's will run 5.0 at some point or not Nov 16 01:36:38 i think its 2nd gn because of price Nov 16 01:36:45 not sure though Nov 16 01:36:50 but i'm sure 2nd gen will be lollipoppified Nov 16 01:37:19 lv.setEnabled(false); should disable the listview, right? Nov 16 01:37:26 normally the second gen's state that in the ad, because its a "feature." Nov 16 01:37:28 and make it unable to click on? Nov 16 01:37:36 my guess is that is a 1st gen Nov 16 01:37:37 isn't moto g 2nd gen already sporting lollipop? Nov 16 01:38:00 ^ good point, I am not sure Nov 16 01:40:42 ListFragment: http://pastebin.com/ds2FTbxn , xml: http://pastebin.com/cEUWxMCc Nov 16 01:43:24 any ideas? Nov 16 01:49:05 call getListView in onViewCreated? Nov 16 01:50:09 hm Nov 16 01:50:20 gives nullpointerexcp Nov 16 01:50:40 i think you have to use Nov 16 01:52:37 use what? :) Nov 16 01:54:36 you already are Nov 16 01:54:40 try onActivityCreated? Nov 16 01:55:02 tried that... it do not give me nullpointerexcp now Nov 16 01:55:11 but lv.setEnabled(false) do not work Nov 16 01:55:14 getListView returns null untl after onCreateView returns Nov 16 01:55:25 and lv.setVisibility(0); do not work either Nov 16 01:55:39 even in onActivityCreated? Nov 16 01:55:49 hold on Nov 16 01:56:04 obv if you are doing that in onCreateView it doesn't exist yet so it won't work Nov 16 01:56:20 move it into onActivityCreated, it should work since the listview reference will exist and be accessable Nov 16 01:56:59 but i do it in a onClickListener and it wont work there either Nov 16 01:57:01 hm' Nov 16 01:57:24 ? Nov 16 01:57:35 that's because you are referencing something you previousily did as nul Nov 16 01:57:41 just do you wiring in onActivityCreated Nov 16 01:59:04 im having this in the onActivityCreated: lv = getListView(); Nov 16 01:59:20 and this in onClick(); lv.setEnabled(false); Nov 16 01:59:23 wont work :S Nov 16 01:59:53 it dont give me any exception though Nov 16 01:59:58 nothing just happens... Nov 16 02:00:14 lv.setVisibility(0); do not work either Nov 16 02:01:59 aceus what were you trying to do ? Nov 16 02:03:55 im trying to hide my listview when pushing a button Nov 16 02:04:34 or just disable the listview (or the checkboxes within it) would be even better Nov 16 02:05:36 have you tried having your adapter return false for isEnabled(position) ? Nov 16 02:07:05 no, my adapter has not implemented that method? Nov 16 02:07:25 try it :) Nov 16 02:08:42 but is lv.isEnabled() calling the method isEnabled() that's in my customadapter? Nov 16 02:08:55 no Nov 16 02:09:40 then why should i try it? :) Nov 16 02:10:08 meh, carry on :) Nov 16 02:10:18 okey Nov 16 02:10:24 but Nov 16 02:10:39 should it even be possible to enable and disable a listview inside a listfragment? Nov 16 02:11:36 i dunno. you should be able to determine that pretty quickly. if it doesn't work, try something else Nov 16 02:12:44 fells like i've been trying everything Nov 16 02:12:46 :) Nov 16 02:12:47 feels* Nov 16 02:17:31 lv.getCheckedItemCount() returns 0 no matter how many boxes has been checked Nov 16 02:25:54 The Reddit JSON is way more complex than I'd expected. ;o Nov 16 02:26:09 Srs parsing bsns. Nov 16 02:29:40 Urgh, comments are in HTML. Nov 16 02:29:46 That's convenient (not). Nov 16 02:30:00 setText(Html.fromHtml(htmlCommentString)) Nov 16 02:30:23 This is stuff such as "
blah
". Nov 16 02:30:33 Why would the Reddit API give that? Weird. Nov 16 02:30:58 "body_html":"<div class=\"md\"><p>aww, she had to slide into that hug. : (</p>\n</div>" Nov 16 02:31:17 That's one JSON key-value example. Nov 16 02:31:34 how can i assign an onclick listener inside a custom viewgroup class? Nov 16 02:31:52 same way you do it any other way Nov 16 02:32:13 should i do it in onFinishInflate? Nov 16 02:32:28 or in constructor Nov 16 02:32:39 you can probably do it in the constructor Nov 16 02:32:44 thanks btw....that makes total sense... I was thinking I had to override or something Nov 16 02:32:51 cool Nov 16 02:33:03 you can Nov 16 02:33:14 but you can also just implement onClick in the custom view class Nov 16 02:33:19 then set setOnClickListener(this) Nov 16 02:33:34 if you override onTouchEvent or whatever you have to handle something extra, i forget what Nov 16 02:33:46 I'm using android studio...I don't see the option to override onClick Nov 16 02:33:51 Thats what confused me Nov 16 02:34:02 yeah its not onClick its onTouch which is different Nov 16 02:34:10 Same idea though? Nov 16 02:34:23 umm Nov 16 02:34:31 a click is a specific kind of touch sequence Nov 16 02:34:38 down + up within some dt Nov 16 02:34:53 Just checked, I don't see onTouch as an available override Nov 16 02:34:56 a touch can be all kinds down up move cancel hover etc etc Nov 16 02:35:17 Just to be clear my viewgroup extends a LinearLayout Nov 16 02:35:30 I'm gonna go ahead and just do it in the constructor, thank you Nov 16 02:36:37 Omg. Nov 16 02:36:45 It was the lame JSON-viewer site I was using that was doing that HTML stuff. Nov 16 02:36:50 I think. Nov 16 02:37:06 Ooh. It has "body" *and* "body_html". Never mind. Nov 16 02:37:11 Awesome. :D Nov 16 02:37:41 I'm curious about your opinions here. Making a Reddit client, and I'm writing the parsing code right now. Nov 16 02:37:47 Is it best to manually create a parse tree? Nov 16 02:37:56 Like, picking up stuff I want and ignoring the rest. Nov 16 02:38:06 I was hoping to kinda fly in and do it really, really efficiently, but it seems that I must create a tree. Nov 16 02:38:12 (I'm using Jackson.) Nov 16 02:39:10 I don't want "object mapping", because that only has the potential to be slower. Nov 16 02:39:36 The data is just too complex to fly in and take what I want without creating a tree. Hmm. Nov 16 02:39:51 I think, anyway. Nov 16 02:39:59 Or it's possible but the code would be horrendous. Nov 16 02:41:39 BTW, is there a really awesome JSON-viewer site out there? All the ones I'm finding are only semi-okay Nov 16 02:41:40 . Nov 16 02:43:06 I use a chrome plugin Nov 16 02:43:23 Well....its only for if you just called the webservice... Nov 16 02:43:27 You can't just paste in json Nov 16 02:46:34 Okay, this is quite good: http://www.jsoneditoronline.org/ Nov 16 02:55:10 where's the api they added to auto hide the actionbar when scrolling in api21? Nov 16 02:56:08 JacobTabak going for all the bling eh ? Nov 16 02:56:18 lol i need it for this landscape activity Nov 16 02:56:35 too lazy to do something more involved Nov 16 02:56:36 i kinda hate that behavior Nov 16 02:56:38 kinda Nov 16 02:57:23 sooo whats the api ! Nov 16 02:57:32 found it Nov 16 02:57:33 http://developer.android.com/reference/android/app/ActionBar.html#isHideOnContentScrollEnabled() Nov 16 02:58:33 thats answes an important question for me. i was wondering if the AB was deplicated for toolbar, but the existance of that new method would indicate "no" Nov 16 02:58:40 *answers **** ENDING LOGGING AT Sun Nov 16 02:59:59 2014