**** BEGIN LOGGING AT Sat Mar 22 02:59:59 2014 Mar 22 03:00:16 santosh: what you wrote is also just 9... Mar 22 03:01:19 also, all your colors will be shades of gray from white to black Mar 22 03:01:49 santosh: are you familiar with ascii or unicode? Mar 22 03:02:33 Nashenas: yeah Mar 22 03:03:09 what do you think 'f' - '0' will give you? Mar 22 03:03:48 ascii value of f - 0 :P Mar 22 03:14:07 omg guys this is so good Mar 22 03:14:08 https://github.com/JakeWharton/pidcat Mar 22 03:14:20 piiiidddcccaaattttttt Mar 22 03:14:27 :o Mar 22 03:15:16 catting your pids, like a boss Mar 22 03:16:32 now that is beautiful. You get a Star. Mar 22 03:18:10 It does basically the same thing as Android Studio does, right? By just filtering by package name? Mar 22 03:21:46 my n7 disconnects from my MBP like every 15 minutes, its exasperating Mar 22 03:22:16 adb kill-server && adb start-server fixes it Mar 22 03:22:44 i wonder if its the device, or the laptop, that is dropping the ball Mar 22 03:33:33 g00s: adb over tcp ftw Mar 22 03:34:51 JesusFreke i'll try that again … Mar 22 03:34:54 thx Mar 22 04:09:01 JesusFreke any way to tell the device, if you have a adb connection, don't go to sleep? since its unplugged it keeps going to sleep :) Mar 22 04:09:40 g00s: good question! You could turn the screen timeout itself either off or to a high value. other than that, you can still keep it plugged in, even when using adb over tcp Mar 22 04:10:17 ah, ok - thanks! Mar 22 04:11:10 developer options -> stay awake should have "screen will never sleep when connected to adb" Mar 22 04:11:17 Why is bluestacks faster than the android emulator? Mar 22 04:12:25 g00s: sounds like a great way to accidentally drain your battery overnight :) Mar 22 04:12:42 my laptop would go to sleep :) Mar 22 04:12:51 then the device should too :D Mar 22 06:22:12 Under what circumstances would a fragment be required to include an implementation of onCreate( )? Mar 22 06:33:41 anything that you might need to initialize on a fragment level. Mar 22 06:49:34 I thought fragments used onCreateView()... Mar 22 06:51:20 For creating views Mar 22 07:07:22 http://developer.android.com/reference/android/app/Fragment.html explains the lifecycle Mar 22 07:19:16 bankai_ i still dont understand the difference between isHidden() and isVisible() as described there Mar 22 07:19:34 i've read it over and over Mar 22 07:21:21 maybe my dog can explain it to me someday Mar 22 07:21:49 is visible retains the space taken up Mar 22 07:22:05 an image that's not visible still changes layout Mar 22 07:22:22 a hidden image doesn't even have space in the layout Mar 22 07:22:41 so is hidden like View.GONE ? Mar 22 07:24:54 actually that ma not be right Mar 22 07:25:02 That a fragment isn't visible doesn't mean it has been hidden Mar 22 07:25:08 That is is hidden means it isn't visible Mar 22 07:27:52 A fragment without a view wouldn't be visible, but it wouldn't be hidden either Mar 22 07:30:57 so would !isVisible() be synonymous with getRootView() == null Mar 22 07:31:37 err, getView() Mar 22 07:32:04 Nope Mar 22 07:32:17 If you hide a fragment, it just sets view visibility Mar 22 07:35:39 maybe with some mind enhancers i'll get it Mar 22 07:36:21 Just read the source Mar 22 07:38:09 getView is evil Mar 22 07:38:09 getView() has to be the most misleading piece of code in AOSP Mar 22 07:52:03 SimonVT i'm DrawerLayout, and sometimes finding it hard to get it to start pulling out. anything i can do ? Mar 22 07:52:08 *using Mar 22 07:52:29 some reason, i have to keep trying by swiping from the edge Mar 22 07:52:38 no ViewPager, or anything else that intercepts that gesture Mar 22 07:57:16 I don't use DrawerLayout Mar 22 07:57:28 ok Mar 22 08:00:27 I'd like to add a custom attribute to contacts which shows up in the contacts app. and when the attribute is clicked, I'd like for it to open up my app. does anybody have any pointers or a link to a tutorial? Mar 22 08:00:58 it sounds like a simple requirement to me, but googling leads to sync providers and sqlite and I'm not sure if I'm missing the obvious solution here Mar 22 08:02:55 last time i looked at the Contacts content provider, i almost had a near death experience Mar 22 08:10:58 capella so FF 29 is the big one with UI changes! Mar 22 08:11:21 mmm ... australis stuff? Mar 22 08:11:37 yeah! i may notice something different for the first time since navigator 4 Mar 22 08:12:08 :) FF30 brings nice changes to Synch mechanism Mar 22 08:14:39 Good morning folks. I wonder if anyone could help with a loadDataWithBaseUrl problem I have. I want to show a html formatted text from the db and apply a stylesheet from assets, but the stylesheet isn't loaded as far as I can tell. Source here : http://pastebin.com/CcZz2yvD Mar 22 08:17:07 I have tried to dump the stylesheet first to see if android can find it and this works fine : http://pastebin.com/LY8Qf3h1 Mar 22 08:19:43 codetroll, I'm not sure if webview is capable of loading data directly from apk assets Mar 22 08:19:48 It is. Mar 22 08:19:56 ah Mar 22 08:20:14 As far as I can tell from the web it should be able to.. Mar 22 08:20:35 the file:///android_asset should point to the assets folder.. Mar 22 08:20:55 Both file:///android_asset and file:///android_res/raw are valid, though as of 4.4 you can't load from one if the base URL specifies another (it will crash - hard). Mar 22 08:21:58 so I could try using android_res/raw instead.. Mar 22 08:22:02 codetroll, is there any chance the css is loading correctly but that the css isn't valid? Mar 22 08:22:30 hmmm well - perhaps - I nicked it from our website where it works just fine.. Mar 22 08:23:35 like this : http://pastebin.com/9PeXbftc Mar 22 08:24:10 I'm not a css validator. Mar 22 08:24:13 it validates fine on w3,rg Mar 22 08:24:17 w3.org ;) Mar 22 08:24:38 Also, have you tried removing the trailing slash from your base URL? Mar 22 08:24:39 Nilium.cssValidator(); Mar 22 08:24:51 hmm I can't remember.. let me try Mar 22 08:25:11 If you're implying I'm a singleton, I will find a way to kick you in the nuts through the internet. Mar 22 08:25:40 LOL.. Mar 22 08:25:43 ;) Mar 22 08:26:06 so there can be more of you at the same time then? Mar 22 08:26:51 I'm a long-lived instance. Mar 22 08:27:06 Unlike a singleton, I will eventually stop existing. Mar 22 08:27:24 Not counting process lifetime. Mar 22 08:27:26 my wife asked why I laughed... told her it was very geekish humor.. Mar 22 08:30:13 Mavrik you did help me out fine with the ListView with both text and ID to use for further DB lookup on thursday - so thank you for that. Not sure yet how it works.. but that will be for a future time :) Mar 22 08:31:11 damn - the emulator takes forever to start up Mar 22 08:34:25 Can anyone help with this when compiling? http://pastebin.com/3ML644M6 Mar 22 08:41:40 codetroll: use a real device or try genymotion Mar 22 08:52:26 autrilla: You have an error somewhere in your resources/manifest that they haven't yet added an error message for Mar 22 08:55:16 shmooz I will take a look at genymotion - thank you.. Mar 22 09:10:27 SimonVT, that was it :) Mar 22 09:15:14 shmooz I am so sending virtual cases of whatever beverage you like through the internet just now... Mar 22 09:16:01 codetroll: 99 cases of virtual beer on the wall, 99 cases of virtual beer Mar 22 09:16:10 lol Mar 22 09:16:12 codetroll: is it smooth ? Mar 22 09:16:46 yeah - I downloaded, installed and had the emulator up and running faster than it would take to start the normal emulator Mar 22 09:16:55 genymotion ftw Mar 22 09:17:00 indeed Mar 22 09:17:09 i wonder if they will have images for wearable things Mar 22 09:17:38 this is what the emu was supposed to be like to begin with :| Mar 22 09:17:45 hehe Mar 22 09:19:21 There are some chicks in the other room going peep-peep. It's 2am. It's a good substitute for music. Mar 22 09:21:02 There is a slight difference though it doesn't seem to respect the UTF8 setting in the webview - all my danish characters are now goofed.. again.. sigh.. I so wish all written language could be in english only.. no matter what country Mar 22 09:22:15 Nilium what is peep-peep ? Mar 22 09:22:36 chicks, like chickens? Mar 22 09:22:39 The sound chicks make. Mar 22 09:22:39 i.e., cheep, peep, etc. Mar 22 09:22:42 Yes. Mar 22 09:22:47 aw, awesome Mar 22 09:22:52 There are about 6 of them in the other room. Mar 22 09:23:03 that sounds horrible Mar 22 09:23:13 Only temporarily since we're taking care of them for a friend. Mar 22 09:23:33 Nilium the chick magnet Mar 22 09:23:45 i went to a hatchery or something and they had like 40 bins of different kinds of chickens Mar 22 09:23:47 I have 8 parrots and enjoy the noise they make. Horrible varies. Mar 22 09:23:56 omg, fucking parrots Mar 22 09:24:11 yeah screw that Mar 22 09:24:27 -.- Mar 22 09:24:49 8 fucking parrots? Nilium you ok? Mar 22 09:25:21 I only bought one and adopted two, the remainder are my family's lack of willpower. Mar 22 09:25:32 I just happen to have zero complaints about having 8 parrots 'cause I like birds. Mar 22 09:25:41 apparently Mar 22 09:25:43 :) Mar 22 09:26:00 How would you specify what item goes with which nav drawer item? Mar 22 09:26:05 what icon* Mar 22 09:26:41 autrilla just put a listview in there ? Mar 22 09:27:21 g00s, I already have a ListView there, and I surely will need an adapter for it. However, if feels dumb to create an object for each nav drawer item Mar 22 09:27:53 Just swap out fragments Mar 22 09:28:37 Nilium i'm guessing you are a fan of ParrotVM Mar 22 09:28:40 XD Mar 22 09:28:54 It is actually an interesting VM but I wrote my own so nope. Mar 22 09:29:14 I currently consider Lua the baseline for good VMs. Mar 22 09:30:08 i need to learn a little lua Mar 22 09:30:18 i hear good things about LuaJIT Mar 22 09:30:49 Nilium have you tried embedding lua into any android apps ? Mar 22 09:30:55 LuaJIT's interesting, though by now it should be treated as its own thing. Mar 22 09:30:56 What works in Lua will not always work in LuaJIT. Mar 22 09:30:57 there is lua4j or something, sounded slow Mar 22 09:31:02 Not on Android, no. Mar 22 09:31:24 Embedding a VM in something running in a VM just seems like a lot of pain to me. Mar 22 09:32:30 Especially since I can't think of a good way to reconcile the Lua and DVM GCs nor how to effectively wrap Java API functions for Lua. That said, I also haven't looked at anything that tries to solve those problems, so I'm sure someone's figured something out. Mar 22 09:32:30 Hell, someone's probably ported Lua to Java. Mar 22 09:32:30 Which I'd guess would be really damn slow. Mar 22 09:32:35 SimonVT, what do you mean? Mar 22 09:32:42 You could probably compile Lua directly to JVM bytecode though. Mar 22 09:33:22 Oh, icon Mar 22 09:33:37 Yeah, just a listview Mar 22 09:34:07 SimonVT, I already have that. Would you create a class like NavDrawerItem, with a drawable and a string just for that? Mar 22 09:34:22 yes Mar 22 09:34:52 I would totally do that. Mar 22 09:35:03 That's what I do already Mar 22 09:35:48 It's basically what I do in Scala, albeit with case classes. Mar 22 09:36:11 intellij takes an inordinate amount of time "re checking/building" when I redebug an app with no code changes from the last run. Mar 22 09:36:40 rgr yeah :( Mar 22 09:36:50 they have some big things to work out still Mar 22 09:37:54 thats when it doesnt sit in an infinite loop in "make". And stupidly I tried renaming a package last night. result? Still broken. Been using grep to isolate where the issues are. hell on earth. Mar 22 09:38:14 great IDE. just sometimes frustrating like they all can be. Mar 22 09:39:42 I just use it for code editing, but never had any issues renaming packages Mar 22 09:39:44 i thought one of the strengths of AS was supposed to be its tight integration with gradle; it does seem to have a bit of that because it takes forever :) Mar 22 09:39:46 Hi, I am trying to use alarmmanager's set repeating alarm function to repeat tasks at fixed intervals, but I find that the alarm doesn't signal at the correct time always. Is this a known limitation? Mar 22 09:40:00 but the IDE and gradle don't seem to be on the same page with errors Mar 22 09:40:12 I _have_ had issues where it puts a file in the generated-files directory (e.g., R.java) when moving a class from one package to another Mar 22 09:40:35 lgp171188 make sure its EXACT or whatever the flag is Mar 22 09:40:46 Aside from that, all build-related stuff goes through a terminal window, so I don't have to screw with IntelliJ's build system Mar 22 09:40:56 g00s, let me take the code and check it Mar 22 09:41:18 yup. and damn this wrapper thing too. after days with 1.11 installed its suddenly decided it doesnt like it and wont use 1.10 via the wrapper. Mar 22 09:41:35 Do we still get the inflater on adapters with inflater = (LayoutInflater) context.getSystemService(Context.LAYOUT_INFLATER_SERVICE); Mar 22 09:43:34 lgp171188: Since kitkat, repeating alarms aren't exact Mar 22 09:43:53 yeah they changed something about that :| Mar 22 09:44:11 SimonVT, ah my Galaxy Nexus is running kitkat via cyanogenmod. That is why I am facing this problem. Mar 22 09:44:22 how can I go about working around this? Mar 22 09:44:40 Use setExact Mar 22 09:46:12 SimonVT, is setExact available on older versions of API? If not, I will have to set the alarm by checking the version and using the appropriate function. Mar 22 09:46:18 is that right? Mar 22 09:46:19 Nilium: with my set up my understanding is that it doesnt ise the intellij build sequence -rather it spawns gradle. Unfortunately it shares very little with you about what it's doing when in the ide. better from command line. Mar 22 09:46:50 * Nilium shrugs Mar 22 09:46:55 I just have hotkeys to write lines to my terminal window, like 'compile' and whatnot Mar 22 09:47:23 Only useful if the process is sbt, though Mar 22 09:49:27 I dont mean the stop and start. I mean the output of the compile process as it runs. Unless of course I have muted it somehow. which is entirely possible ;) Mar 22 09:50:29 if you do in-process, you should see everything in the gradle console Mar 22 09:56:21 g00s: you're using gradle, right? Mar 22 09:56:33 yeah. it works, i mostly forget about it Mar 22 09:56:43 "forget abbarrd it"... Mar 22 09:58:34 have you done anything to break down your build.gradle for Android so that you have a "base" one included in on a per project basis? e.g Mine current one is : https://gist.github.com/anonymous/9704009 ie a lot different from the "default" android build.gradle. Mar 22 10:00:09 no, not per project Mar 22 10:00:23 i only have a few projects using it, 2 apps and a few libraries Mar 22 10:00:31 each is different enough Mar 22 10:01:01 i don't have a defaultConfig{} block like that, so far just leaving stuff in their manifests Mar 22 10:02:38 what the hell are the rules for using width/height="0dp" in relativeLayout Mar 22 10:02:48 for the children. i can never seem to get it to work Mar 22 10:04:09 how do i layout_weight Mar 22 10:04:22 no, RelativeLayout, not LL Mar 22 10:04:35 how do i read Mar 22 10:04:42 yo udont have a default config block did you say? Mar 22 10:05:23 rgr no, not atm Mar 22 10:05:36 minSdk , targetSdk, etc … i put that in the manifest Mar 22 10:09:35 mmm I have been struggling making a time lapse video recording. mRecorder.setCaptureRate(double) seems to do nothing... Mar 22 10:18:46 ah ok Mar 22 10:19:34 Im being blind but where is this gradle console? view/tool windows/gradle is the gradle tasks list. Mar 22 10:20:27 (btw intellij is also adding an extra hierarchical level to new projects by default it seems - its confusing me a little but I suspect its down to me being a noob to java and packaging etc in general) Mar 22 10:20:45 if you click the little square all the way at the bottom left, it toggles the tool windows Mar 22 10:21:01 then you will see all of them Mar 22 10:23:18 sure but thats just same as views/tool windows isnt it? Clicking gradle just shows the gradle task tree again. Mar 22 10:25:32 I was referring to seeing the build progress sub tasks and subsequent output Mar 22 10:25:36 ah got that sorted, thanks for helping by reading. ( and even ignoring ) Mar 22 10:25:39 :D Mar 22 10:29:37 rgr its 'Gradle Console' Mar 22 10:34:24 If the documentation would just be in phase with whats actually going on... Mar 22 10:36:17 It states that the audiosource of a mediarecorder will be ignored when in time lapse mode. Yet, it crashes when an audio source is set. Mar 22 10:36:24 not setting any does the trick. Mar 22 10:37:54 So the programmer has this dilemma, debug debug debug. Did I say debug ? Mar 22 10:37:54 yet ? Mar 22 10:38:03 and take all documentation with a pinch of salt. Mar 22 10:41:41 lunch time. Mar 22 10:55:53 Is it possible to launch a fragment activity as a popup in an existing activity? Mar 22 10:56:30 I wanted to have the user press a button which launches the pop up saying it's ready to scan an NFC tag with a cancel button Mar 22 10:56:47 then when they scan the tag it closes the pop up and returns to the original activity Mar 22 10:56:59 Is 30sp for text size of nav drawer items too big? Mar 22 10:57:04 Hi guys, is there any serious way to develop to android these days with python? or is it still all those crappy alternatives?, does the SDK support python in any way?. Mar 22 11:02:32 Is the best way to go about this today is Kivy?. Mar 22 11:26:45 How can I do something like this, in terms of sub-items? http://developer.android.com/design/media/navigation_drawer_holo_dark_light.png Mar 22 11:27:30 Howdy. Mar 22 11:27:44 I'm getting this: "Unsupported type 'add-resource' in file 'attrs.xml'", build tools 19.0.3, target sdk version 19. The file contains lines like this: '' and it's from the Google Email app, which I'm trying to compile on its own. Can anyone help me figure out what went wrong? Mar 22 11:27:58 I'm using gradle (plugin version 0.9.0). When I use ant it doesn't seem to throw that error (but other errors, so not sure whether it simply hasn't reached that point yet). Mar 22 11:58:44 how do I pass information from a DialogFragment back to it's activity? Mar 22 12:00:08 I've now tried a bunch of things and found a solution to my problem. The solution sort of confirms what I had thought. But I still don't want to believe it. I think (I hope) I'm doing something else wrong Mar 22 12:00:20 SyntheCypher, there's an article on that in d.android.com Mar 22 12:00:20 I'm calling setFitsSystemWindows(true); and also (false); Mar 22 12:00:31 but once setting it to true, I cannot seem to set it back to false Mar 22 12:00:41 there is a gap above my element the exact height of the system bar Mar 22 12:00:59 I was able to get the padding top of this element before and after each of the calls with true and false Mar 22 12:01:03 before it was 0 padding Mar 22 12:01:14 once set to true, it was 50 padding Mar 22 12:01:20 once set back to false, it was still 50 padding Mar 22 12:01:48 SyntheCypher, http://developer.android.com/guide/components/fragments.html#CommunicatingWithActivity Mar 22 12:01:50 and moreover, if I manually set it back to 0 instead of calling setFitsSystemWindows(false); then my gap-above-my-element problem is solved Mar 22 12:04:05 cheers Mar 22 12:04:27 Having radio buttons on the navdrawer is going to be a hassle Mar 22 12:11:24 is there anyway to ensure that a DialogFragment's parent Activity implements a particular Interface? Mar 22 12:14:53 Oh, maybe I can decompile GMail and see how they do it Mar 22 12:15:03 SyntheCypher, the page says that too Mar 22 12:56:15 Is there any way to programatically open the "Shutdown / Reboot" menu? Mar 22 13:08:11 g00s: Im not seeing any gradle console. I think I'm IDE blind... Mar 22 13:13:07 grex25, http://stackoverflow.com/questions/19930790/sdk-android-how-to-open-shutdown-reboot-dialog-for-the-device Mar 22 13:13:30 autrilla: thank you! :) Mar 22 13:16:21 I have this scenario: The user clicks a button, waits 500 ms and his/her answer is shown if it was the correct choice via a background color on the button. Wait another 500 ms then proceed. How should I do it? Mar 22 13:17:16 I have radio buttons on the nav drawer, how can I make them behave like a radio group? Mar 22 13:17:54 compac, a Handler maybe? Mar 22 13:19:14 autrilla, Yes. I have tried using a handler and it works for the first delay but how do I start the second delay? Is starting it from inside the handler the way to do it or maybe have the second handler start after 1000 ms? Mar 22 13:19:38 compac, yeah, set one to 500ms and the other one to 1000ms Mar 22 13:33:48 Just post another runnable in the first one **** BEGIN LOGGING AT Sat Mar 22 14:02:39 2014 Mar 22 14:02:47 I have radio buttons on the nav drawer, how can I make them behave like a radio group? More or less like GMail does when you have multiple accounts Mar 22 14:05:16 anyone knows an good article on android application architecture? I have more or less let's say a form and I wonder whether the new and edit functionality should be on the same activity or in 2 separate ones Mar 22 14:06:22 vmusr: IMO on the same, look at how some of the existing apps do it Mar 22 14:08:47 p_l, i browsed around but could't find source ... seems like it's going to be fun, since the form is one activity and the pages are 3 fragments, with lot's of dynamically added components... Mar 22 14:22:36 there is lots of conflicting opinion. Ive been looking too. Mar 22 14:22:49 What's the latest android support lib version? Mar 22 14:25:28 autrilla, they behave normally... Mar 22 14:26:02 pfn, yes, but if have multiple raido buttons, I only want one of them to be selected Mar 22 14:26:06 radio* Mar 22 14:26:24 so? Mar 22 14:26:44 it still behaves normally Mar 22 14:26:46 pfn, I want them to behave as a group Mar 22 14:27:00 then put them in a group Mar 22 14:27:21 pfn, from the listview? Mar 22 14:27:27 listview adapter* Mar 22 14:28:06 hi all, I'm not using any bitmap resources or any resources in general (yet), however 82% of my heap is being used by android.content.res.Resources, any idea why that would happen? I've not seen this behavior on my s3/s4, on the galaxy note 3 I am seeing it. Mar 22 14:29:55 autrilla, that's irrelevant to being in a nav drawer Mar 22 14:30:04 it retains about 11mb of data, which is causing tons of gc's Mar 22 14:30:24 pfn, I should have said that Mar 22 14:30:57 autrilla, list views have selection modes, use them Mar 22 14:32:38 pfn, it's expandable, does it matter? Mar 22 14:34:37 So FragmentStatePagerAdapter is only in the support library? Mar 22 14:40:36 view pager is only in the support library... Mar 22 14:42:19 pfn, I don't know what you mean by selection modes, do you mean CHOICE_MODE_MULTIPLE etc? Because iirc that's for selecting ListView items, not radio buttons Mar 22 14:43:33 nvm I figured it out Mar 22 15:09:25 I have the problem that SurfaceTexture.getBitmap() from a CameraPreview takes 200ms to load. I found several people on Stackoverflow with the same issue but no solutions. I need to get the pixels of my Surfacetexture in a fraction of that time Mar 22 15:09:35 would really appreciate help Mar 22 15:10:12 I mean TextureView.getBitmap(), sorry Mar 22 15:15:31 I never understood why the android development channel is so increddible dead. Most devel chans on freenode are such a great help, but whenever I came here I only found silence and rarely a bit offtopic Mar 22 15:18:05 Lirezh, it's not really. i'm loading my camera project. i don't remember the api well enough to help. Mar 22 15:18:41 Sorry for my frustration ;) it's 7 hours trial and error already Mar 22 15:19:19 Lirezh, in my case i didn't have to worry so much about the time to take the picture. Mar 22 15:19:21 I need to get the pixels of the camera preview in a fast manner in onSurfaceTextureUpdated(). something without getbitmap() involved Mar 22 15:19:27 gah. big mistake putting my java projects in a directory below a symlink. IntelliJ is going haywire - it seems sometools auto unwrap the symlink leading to duplicate file name errors despite them being the same physical file. Mar 22 15:19:29 Lirezh, I guess it's mostly because most of are here to be helped, and not to help. I've only seen a couple of people constantly helping here, SimonVT and pfn Mar 22 15:19:56 I help when I know the answer, but I usually don't know it Mar 22 15:20:14 at least responses ;) that's better than usual Mar 22 15:20:25 Lirezh, what i'm doing in my app is responding to onPictureTaken, not pulling data out of a surface view. Mar 22 15:21:09 hmm I need to wrok with the preview of the camera (all pictures) Mar 22 15:21:21 I fear onPictureTaken woudl only react on a real capture, not on the preview Mar 22 15:21:35 I need a live stream of images Mar 22 15:22:34 Lirezh, you may need to do something on the order of putting it into a video mode. for my program, i'm overlaying stuff on the image. not processing it though. Mar 22 15:23:04 I read that drawing is fast, just getBitmap() is very slow Mar 22 15:23:25 I think I need to somehow get the pixel data directly out of the texture instead of getBitmap() on the View Mar 22 15:24:09 What's the difference between onFling and onScroll? Mar 22 15:24:15 (android events) Mar 22 15:24:40 Tobbi, Google.. http://stackoverflow.com/questions/3081711/android-view-gesturedetector-ongesturelistener-onfling-vs-onscroll Mar 22 15:25:02 autrilla: Just been there, so that first answer is definitely the right one? Mar 22 15:25:58 Tobbi, sure, onFling is faster Mar 22 15:26:12 Okay, thank you. :) Mar 22 15:27:37 hi Mar 22 15:27:53 how can i disable "activity idle timeout"? Mar 22 15:27:55 Which method/function is making my app crash? https://gist.github.com/santosh/1a1e9c33460a243163d3 Mar 22 15:28:17 it makes me so hard to debug my application Mar 22 15:28:34 santosh, check the stacktrace Mar 22 15:28:38 i want to disable these feature,,,, is there anyone know about it? Mar 22 15:28:52 autrilla: means? Mar 22 15:29:17 santosh, http://lmgtfy.com/?q=stacktrace Mar 22 15:30:06 achieva, what's that? Mar 22 15:30:16 santosh, you have 16 elemets in the array Mar 22 15:31:03 nextInt() will return 17 possible indexes, so you could be getting indexourofbounds exception for that Mar 22 15:31:16 brx_, and the odds are he will Mar 22 15:31:17 does it crash everytime or just sometimes? Mar 22 15:31:51 autrilla: when i try to run my application, (crawling user's heap memory data by native code at the UI thread) Mar 22 15:32:15 achieva, is that all the logs say? Mar 22 15:32:24 brx_: everytime Mar 22 15:32:36 try nextInt(15) Mar 22 15:32:41 autrilla: ah~! okay, wait a minute Mar 22 15:32:43 brx_: after the onTouch event ofcourse Mar 22 15:32:57 brx_, think about it... He does it 16 times, it will fail once every 16 times. The odds are it WILL happen every time. Mar 22 15:33:17 autrilla, why? Mar 22 15:33:36 brx_, you do it one time, 1/16 chances of it happening Mar 22 15:33:40 Do it 16 times, 16/16 Mar 22 15:33:54 It doesn't mean it WILL happen Mar 22 15:33:54 autrilla: http://pastebin.com/WkMmtKw3 Mar 22 15:33:57 But it is very likely Mar 22 15:34:24 achieva, that's Angry Birds, not your app (unless you work for rovio) Mar 22 15:34:58 autrilla: ah, my typo, (i try to modify angry birds) Mar 22 15:35:18 Shady stuff Mar 22 15:35:51 santosh, use logcat Mar 22 15:36:22 santosh, use logcat after changing it to 15 instead of 16 Mar 22 15:36:23 autrilla: i don't try to bad things, just related to my work Mar 22 15:36:43 achieva, apparently that's an error difficult to track Mar 22 15:36:52 When does it happen? Mar 22 15:36:54 autrilla: Would you know if there's a way to simulate onFling events with the emulator? Mar 22 15:37:31 Tobbi, hmmm... You couls use the TouchUtil API Mar 22 15:37:34 could* Mar 22 15:37:43 TouchUtils* Mar 22 15:37:58 Ah, okay. Mar 22 15:38:18 autrilla: hmm.... in my guess, the problem is ui thread is blocked a long time Mar 22 15:38:33 achieva, yeah, it's that Mar 22 15:38:41 You have to figure out what's blocking it though Mar 22 15:38:54 Check for infinite loops etc Mar 22 15:41:58 Alright, this is the navdrawer I want to make: http://i.gyazo.com/830946fdde2029c662e36cade5a0241c.png Best approach? Mar 22 15:44:33 Okay so I want to pass around a host address and port name between activities Mar 22 15:44:40 Right now I'm doing it using putExtra Mar 22 15:44:43 KaylieG, bundle it Mar 22 15:44:46 Correct! Mar 22 15:44:48 should i be using sharedprefs instead Mar 22 15:44:49 ? Mar 22 15:45:52 Also, I'm doing it like this right now because my server application is very primitive and right now creates a new socket connection for each action. Mar 22 15:46:06 Is there any way to conveniently pass an entire socket object between activities? Mar 22 15:46:24 so that i can just create it in the first activity, and then just use that one throughout the application? Mar 22 15:49:20 KaylieG, intents are fine Mar 22 15:50:11 But they don't allow me to bundle in an already created socket object Mar 22 15:50:27 Which is why I'm just passing in the address and port for now Mar 22 15:51:19 KaylieG, you could host the connection inside a Service, maybe Mar 22 15:51:41 Then you can access the connection from wherever you want Mar 22 15:52:07 I'll look into that, thanks Mar 22 15:52:23 also is better to bundle in primitives or use sharedpreferences? Mar 22 15:52:46 KaylieG, I don't really know, but I usually bundle the primitives Mar 22 15:53:21 okay, thanks Mar 22 15:54:43 anyone aware how efficient the ternary operator is android? Mar 22 15:55:07 since I'll have to write a ton of these Mar 22 15:55:33 from the PoV of android, it doesn't exist (Just like JVM doesn't give a damn about it) Mar 22 15:57:33 vmusr: Java's ternary operator is just a more cryptic form of the if-else statements Mar 22 15:57:54 vmusr: why a lot ? Mar 22 16:01:05 I think the only reason I haven't used ternary operators is because I've just gotten used to writing stuff in long form while developing for android. Mar 22 16:03:11 I need a pointer. I'm new to android animation and need a pointer. If I were to randomly move a view around, as in a screensaver, how would I ensure that the view stays completely visible within all device viewing areas? Mar 22 16:05:38 i suppose you could check if the view's left edge > 0 ..etc? Mar 22 16:05:53 qkzoo1978: Math. Mar 22 16:07:25 I guess I should have thought about my choice of words better. Is there a method to get the size of the viewport so you know what dimensions you're working with? Mar 22 16:09:00 funkbox, since I've got a big form with 30+ options, and will be using the same activity to hold both the creation of new data and editing of existing Mar 22 16:10:44 sounds like you're doing something wrong Mar 22 16:11:15 and in terms of data structures, that is Mar 22 16:12:21 vmusr: you're doing something wrong i think Mar 22 16:13:27 vmusr: why you'd need lots of ternary operators for the form? Mar 22 16:13:45 funkbox, well (i won't use pastebin for single line) the question is because there would be several statements in each fragment and the holding activity Mar 22 16:13:47 dateView.setText(editing ? dateFormat.format(editProtocol.getDate()) : dateFormat.format(date)); Mar 22 16:13:58 like this one Mar 22 16:15:05 ... you're doing this wrong Mar 22 16:15:32 boy Mar 22 16:15:50 highly likely Mar 22 16:16:01 vmusr: create a form that takes the data from a class, then make it so that the class is either loaded from existing data (i.e. editing an existing record), or created "empty" with defaults Mar 22 16:16:22 if (editing) { setText()s here} Mar 22 16:17:21 I'm struggling with adding a library to my project. Following the tictactoemain/lib sample Android provides, I'm still getting a "unable to find explicit activity class" error. The library package I included showing up under Android Dependencies is com.example.surveymetest. I suspect the issue is how I'm calling/defining the activity in the manifest but I can't seem to get it right. Any... Mar 22 16:17:22 ...ideas? https://gist.github.com/guitarlover52/7094609c417c2ff1a020 Mar 22 16:21:48 p_l, wound't this mean that my data object (if new) would have to be fully populated with values, to avoid null pointer exceptions ? Mar 22 16:23:03 vmusr: you can take care of that in constructor Mar 22 16:25:38 Alright, this is the navdrawer I want to make: http://i.gyazo.com/830946fdde2029c662e36cade5a0241c.png Best approach? Mar 22 16:25:56 p_l, that's easy - true, however since the "form" is broken into 3 Fragments, each fragment holds a separate instance of the data class (and writes only to specific parts of it), which are merged (the merge depends on replacing the nulls) into a single object. Mar 22 16:26:09 when the save method is called Mar 22 16:26:34 vmusr: instead of using separate instances, use one instance to which all fragments have a reference? Mar 22 16:27:35 I don't know from performance view, however wouldn't it be more complex to have reference to the same object Mar 22 16:28:28 no. All you need is to make sure a) you have a way to get the correct reference b) you don't leave dangling references Mar 22 16:29:35 Lirezh, what are you doing with each picture? Mar 22 16:30:58 I am reading a barcode Mar 22 16:31:04 I solved it in another way Mar 22 16:31:14 I registered a callback for the onFrame of the preview Mar 22 16:31:39 it contains a byte array which means i do not neet getbitmap() anymore Mar 22 16:32:07 Lirezh, right. that's sort of what i was trying to point you at above. Mar 22 16:33:11 yea, so the same approach actually just instead of onPictureTaken it's onPreviewFrame() Mar 22 16:33:28 it gets triggered 30 times a second (optimal case) Mar 22 16:34:13 Lirezh, i'm assuming you don't mind quite so much if the image quality goes down. Mar 22 16:34:29 Lirezh, rather, i'm getting that out of what you're saying now. Mar 22 16:35:09 ah yea, I am sure the quality of the preview sucks. But I am scanning for barcodes, so getting a fast picture of medium quality is what I need so it can find the barcode as fast as possible Mar 22 16:35:59 Lirezh, you could probably take a hybrid approach. Mar 22 16:36:15 p_l, i had something similar, using the setOnPageChangeListener from the PageAdapter and shuffling the object between fragments and activity via interface, but was not very effective, since it depended on specific behaviour Mar 22 16:36:36 using pictures and the preview at the same time ? Mar 22 16:37:02 vmusr: you know you could use a static method that would return currently edited form, right? Mar 22 16:37:57 yea but don't remember where I read that it was bad idea Mar 22 16:38:02 Lirezh, nah, just using the stream of previews to recognise the gross features and then switch to actually taking a picture when you could benefit from the clarity. Mar 22 16:39:19 hello, i see people compiling python (to libpython.so ??), and *.py transform then into apk. i would like to know the procedure and how does thing work. working example/ example code are appreciated. Mar 22 16:39:42 p_l, since it's for а thesis, no harm in experimating Mar 22 16:39:51 Yea maybe gonna do that, depends on how well it works with the current code Mar 22 16:39:52 experimenting * Mar 22 16:40:09 I am scanning only QR codes, they are very error tolerant Mar 22 16:40:19 vmusr: well, there's the part where you need to consider strict following of dogma vs. actual practicality :) Mar 22 16:53:11 :) Mar 22 16:53:28 I can't use getActivity() with FragmentActivity ? Mar 22 16:53:51 Alright, this is the navdrawer I want to make: http://i.gyazo.com/830946fdde2029c662e36cade5a0241c.png Best approach? Maybe just do it all in the layout instead of using listviews? Mar 22 17:03:02 does anyone know how to setup an avd to be able to communicate with a webserver on my lan? Mar 22 17:28:07 if I use an inflater to inflate a layout merge element then the onCreate for the controls in that merged element is called when? Mar 22 17:39:31 any better method than looping through radiogroup to set selection by index, not by id? Mar 22 17:54:26 can anybody suggest a nice 2-D game dev framework..? Mar 22 17:54:40 I just need some simple jumping physics, and a couple of rectangles.. Mar 22 17:54:53 libgdx and box2d Mar 22 17:55:16 Mentos: I hope they're not too difficult to use? :) Mar 22 17:55:43 give them a search and see Mar 22 17:55:59 Mentos: Sure! Sorry. Thanks a ton! :) Mar 22 18:02:28 can anyone explain just when onCreate is called and for what views? I would have thought inflating a merge layout would cause oncreate to be called but no. Mar 22 18:03:00 Views don't have an onCreate method Mar 22 18:05:52 rgr: http://developer.android.com/reference/android/app/Activity.html Mar 22 18:06:04 In particular, http://developer.android.com/reference/android/app/Activity.html#ActivityLifecycle Mar 22 18:06:38 rgr: and http://developer.android.com/training/d/activity-lifecycle/index.html Mar 22 18:06:44 of course they dont, whoops, ... I'm getting myself mixed up - sorry. . I'm just unplumbing androidannotations from my first prog to better understand the creation process. Maybe a better way of asking is : when is it legal to set listeners on a custom class derived from View? In the constructor? Mar 22 18:07:18 And, my experiment just compiled and ran .. and yes.. it is legal. Ok. Works. Mar 22 18:07:45 codeguru: yes thanks. I need to sit down and re-devour all that. Mar 22 18:08:13 it's definitely a lot of information and takes several reads to really understand Mar 22 18:09:34 rgr: I have never created a custom view, but it seems to me that you would set the listeners from outside the custom view class, for example in an Activity's onCreate() method. Mar 22 18:09:44 (I'm mixing up a hotchpotch of xml layouts and merged xml element/layouts which in turn contain custom controls (implemented in Java) to really get a feel for how it all hangs together - all working atm. I hope to post the full code later to get some criticism on the flow & view/model delineation). Mar 22 18:11:02 codeguru: eg here in constructor : https://gist.github.com/anonymous/9711712 Mar 22 18:11:55 corresponding with this custom button in the merged layout https://gist.github.com/anonymous/9711726 Mar 22 18:12:02 Mentos: Your nick reminds me of the candy! And you're suggestion - box2d is exactly what I was looking for, has everything I need. I owe you! <3 Mar 22 18:12:23 rgr setting listeners like that reduces the reusability, imo Mar 22 18:12:48 ughlol: glad to hear it good luck Mar 22 18:12:48 how? They are very specific to that button class. Mar 22 18:12:56 thanks! ^_^ Mar 22 18:13:06 (so to speak .. its only a test framework as I learn obviously) Mar 22 18:19:48 codeguru: the main thing I need to do though is take a step back and re-read the life cycle. I need to know how the internals tick. I can worry about data/interface modelling/segregation later. The main thing is my toys are working and I'm egtting some great intellij experience going too. Love it. Mar 22 18:21:08 juts for completeness, theres the code/listener for the click to add a new custom row. https://gist.github.com/anonymous/9711841 Mar 22 18:21:25 rgr: A button can only have one OnClickListener(). By setting it in your custom class, you don't allow users to set their own. Mar 22 18:22:19 sure. I understand what you're saying and agree. Mar 22 18:22:56 in fact I'll change that now (todays exercises was stripping out androidannotations and I was humming and harring about where the listeners should be added) Mar 22 18:23:04 tvm Mar 22 18:25:20 Custom view com/sj/mazerace/game/LevelView is missing constructor used by tools: (Context) or (Context,AttributeSet) or (Context,AttributeSet,int) // is that something to care about? Mar 22 18:25:20 only my own class should ever call this constructor. Mar 22 18:29:10 hi Mar 22 18:29:36 rento: No, that is not an issue Mar 22 18:29:47 Context, AttribtueSet is used when inflating form xml Mar 22 18:30:04 i'm trying to build android from src for arm emulator Mar 22 18:30:18 it's failing with this err... Mar 22 18:30:23 make: *** No rule to make target `out/host/linux-x86/bin/validatekeymaps', needed by `out/target/common/obj/ETC/validate_framework_keymaps_intermediates/stamp'. Stop. Mar 22 18:30:41 any clues what might be wrong? Mar 22 18:33:14 Try one of the mailing lists, this channel is for app dev Mar 22 18:33:25 There's a list somewhere on s.android.com Mar 22 18:34:27 SimonVT: okay. will try that Mar 22 18:44:12 Under what circumstances would fragments be required to implement onCreate()? Mar 22 18:45:53 None Mar 22 18:52:48 possibly you mean "will be handling fragments" in onCreate? (possibly..) Mar 22 19:08:33 Is there a way to allow configuration changes only for layout without calling onDestroy? Mar 22 19:09:17 as in, i'll allow the layout to reset, but I don't want ondestroy to be called Mar 22 19:09:39 or alternatively, a way to detect configuration change in the onDestroy method itself Mar 22 19:18:28 hey, are you allowed to set setOnTouchListener on a edittext, for some reason when I do, i am unable to focus it after Mar 22 19:20:15 Guys is there any way to change from portrait to landscape without calling onDestroy? Mar 22 19:21:04 Or is there a way to detect if onDestroy was called because of a change in orientation rather than closing the activity? Mar 22 19:21:25 you can manage orientation yourself Mar 22 19:21:30 that's about it Mar 22 19:24:58 oh no problem I found the isFinishing() method Mar 22 19:25:26 when used in onDestroy it can distinguish between onDestroy calls due to orientation change vs actual finishing of activity Mar 22 19:34:39 Anyone here who uses Moto G ? Mar 22 19:35:31 Is there a alyout that lets so set X buttons on the same distance from each other and to end of screens? Mar 22 19:51:01 did TWC just decide to start scrambling local channels ? Mar 22 19:56:47 How do you guys handle IntentServices that handle multiple actions? Just a large if/else block? I was thinking Strategy pattern, but I still need to dispatch the strategies somewhere... Mar 22 20:00:22 hello, i'm back! Mar 22 20:12:49 hi Mar 22 20:13:55 I don't understand why my setPixel doesn't work after a while... (I setPixel(massive) on a bitmap, and after a while, it can't write on it) Mar 22 20:14:17 I draw it on a canvas at the same time Mar 22 21:00:24 I'm working on creating on creating an sdk, but as part of that I need to use a content provider. The problem I'm running into is that you can't install more than one app with the same content provider in it Mar 22 21:00:47 is it possible to have a content provider as part of a sdk? Mar 22 21:03:20 not that I have an answer, but curious - what would be the desired behaviour if there were two apps that happened to link to your sdk? Mar 22 21:03:45 [meaning, there would be two content providers presumably doing the same thing, and thereby becoming ambiguous] Mar 22 21:03:46 basically all that the content provider stores is a sharedprefs Mar 22 21:03:52 which stores a user string Mar 22 21:04:02 so my server knows it's the same user accessing different apps Mar 22 21:04:45 I guess the goal would be to only have one content provider installed to give access to the sharedprefs user string Mar 22 21:05:45 but it's not possible to do any sort of conditional definition in the manifest is there? Mar 22 21:07:28 not to my knowledge - but I have a feeling you'd still run into the same issues even if this were present Mar 22 21:07:55 yea Mar 22 21:08:07 I might have to just do a sharedprefs thing Mar 22 21:08:19 it sounds like you have some data that's common across all apps that use your sdk; but you're also able to deduce this common data during login time Mar 22 21:08:20 and maybe try to identify the user on the server with the ip Mar 22 21:08:26 hm Mar 22 21:09:10 fwiw - I happened to poke a little bit into how google itself handles this situation [eg: they have multiple apps play/calendar/mail etc] that all refer to the 'same' user Mar 22 21:09:35 their model is a hub-and-spoke sort of thing. Their 'sdk' is a thin layer that talks to one specific app (the goolge play app) which contains the service Mar 22 21:10:00 hmm Mar 22 21:10:17 so the auth logic is [essentially] controlled by one hub app; and the other apps all delegate their auth calls into a service exposed by the hub app Mar 22 21:10:35 yea, that makes sense Mar 22 21:10:50 I'm not sure you could really effectively do that if you're not facebook or google though Mar 22 21:11:01 without having some app you can deem as your hub Mar 22 21:11:14 *nod* if you anticipate that each app that uses your sdk independently does user-login, it might just be simplest to expose the user-id directly in your sdk rather than trying to use the service framework. Mar 22 21:12:15 So if I'm gathering everything you're saying, I need to create the next google/facebook Mar 22 21:12:23 and then my sdk will work well Mar 22 21:12:29 my wallet agrees ;) Mar 22 21:12:38 not really, though that sounds like a good goal too :-) Mar 22 21:12:55 [I've suggested an alternative above...] Mar 22 21:13:43 I think facebook [if I recall] does a funky combo the last I looked at it Mar 22 21:14:33 the sdk has two code paths in it - if the facebook app is installed, it talks to some component in facebook [don't recall if it's actually a service]. Otherwise, it opens a webview (to do the authorization path at least.) Mar 22 21:15:03 that's an interesting thought Mar 22 21:15:18 It's actually an in-app survey sdk Mar 22 21:15:33 mainly for a few of my apps but I'll probably open source it Mar 22 21:15:44 so developers can survey their users Mar 22 21:16:06 gotcha. So the goal really is to perhaps to find something that's the equivalent of a deviceid? Mar 22 21:16:20 yea, that might actually be valuable Mar 22 21:18:02 *thinking* well, if you're willing to grab the get_accounts permission - you'll be able to list all the registered accounst on the device, which might be sufficient for your purposes Mar 22 21:18:16 [it'll typically have one - the google account - for most google-registered android devices] Mar 22 21:18:57 (and it'd be one more permission of course; which is the downside of that trick.) Mar 22 21:19:14 that's a good thought Mar 22 21:19:29 another one was to put a "sign-in with facebook" on the first page of every survey Mar 22 21:19:41 if they don't use a facebook sign-in for their app Mar 22 21:19:57 but that could also keep users from taking the surveys Mar 22 21:20:20 *nod* yea. The accountmanager approach might be slightly less intrusive - they've already registered the account, so it should be 'reliable' without needing a further signin Mar 22 21:20:52 ie - you can just use the first account [or list them and have them select one if you feel that's necessary] - the signin has already occured, so no more actions are needed Mar 22 21:21:43 yea, I'll give that a shot Mar 22 21:21:54 actually seems smoother than the contentprovider anyway Mar 22 21:27:53 is anyone here familiar with the google maps API? I would like to ask some questions regarding it Mar 22 21:29:32 just ask Mar 22 21:31:27 Ok, is it possible to search locations just via text in the google maps API and not latitude etc? Mar 22 21:35:59 jutsi: http://maps.googleapis.com/maps/api/geocode/json?latlng=44.4647452,7.3553838&sensor=true Mar 22 21:37:06 gdrc isn't that JS code? Mar 22 21:37:18 that's json Mar 22 21:37:59 ah right Mar 22 21:39:28 is it possible to implement a swipe listener on a edittext Mar 22 21:40:23 gwz: edittext is a view? Mar 22 21:40:54 oh it is Mar 22 21:41:18 https://developer.android.com/reference/android/view/GestureDetector.html Mar 22 21:43:01 gdrc: when I do set a setOnTouchListener on the edittext, I am unable to focus on it Mar 22 21:43:52 what do you mean? Mar 22 21:45:08 the edittext field is unselectable Mar 22 21:45:29 I know the listener is working though when I swipe on it but I am unable to enter any input into it Mar 22 21:46:04 I wonder if you'll run into difficulties working with the the edittext's built-in gestures [select/copy/paste, basically] Mar 22 21:48:52 have a feeling you might have the least trouble having the use do the gesture on a surrounding layout element rather than directly within the edittext itself Mar 22 21:49:00 s/use/user Mar 22 21:49:53 hmm okay so perhaps put a layout around and then put a gesture on that Mar 22 21:50:32 yes; and keep in mind the user will need to initiate the gesture on that layout rather than within the edittext... Mar 22 21:51:04 its still kind of weird though that the gesture is workiing within the edittext but I cant input anything into it Mar 22 21:51:45 I'm not 100% sure, but looking at the code it's probably interfering with the other gestures implemented on the edittext Mar 22 21:53:45 you might have slightly better luck turning off the textIsSelectable attribute, but my feeling is that it's a bit hit and miss Mar 22 21:54:56 [anyway - visually at least, my personal 0.02 is that it's better to swipe away an enclosing container rather than have a swipe _within_ the edittext do something] Mar 22 21:55:20 er, always assuming that the goal is to "swipe away" the editbox :-) Mar 22 21:55:28 yuh that is the goal Mar 22 22:04:49 My app will allow users to save lists of strings (of arbitrary lengths). Each list will have a name. What's the best way to do this? Would a database be overkill? Mar 22 22:04:52 Should I create my own format? Mar 22 22:07:12 In the long term, I've usually found using a db tends to accumulate fewer hacks Mar 22 22:07:32 I noticed a little glitch in my program. There is no way to do it so a method has to be finished and cannot be interrupted? The thing is, say you get a phonecall at the exact wrong time, myprogram could crash. Mar 22 22:07:50 TacticalJoke: but then again, for quick little things I've just saved them into a preferences; especially if I don't need to 'process' the data [eg: search for a specific name, in your case.] Mar 22 22:09:22 rento: not in any canonical sense [as in theory, your app can simply be killed] but usually, stuff running in a service tends to be left alone Mar 22 22:10:02 theTimeHandler.removeCallbacks( theTimeRunnable ); <- can that be called twice safely? Mar 22 22:10:03 Okay. I see that SharedPreferences.Editor has a getStringSet method. Though it uses the Set class, which doesn't allow duplicates. Mar 22 22:10:08 My users might have duplicate data. Mar 22 22:11:26 TacticalJoke: using json to wrap the data is usually the hack that most people end up with I guess Mar 22 22:11:31 Wait, SharedPreferences has getStringSet. Mar 22 22:11:33 Okay. Mar 22 22:11:45 Is that better than XML for this? Mar 22 22:12:27 I'll just have "list one --> x, y, z", "list two --> a, b, c", etc. Mar 22 22:12:50 dunno. as I said above, there are broadly two approches. use sqlite, or create your own textual schema [xml/json - probably json is slightly less worse] Mar 22 22:13:11 the former tends to be more elaborate, but collect fewer hacks over time Mar 22 22:13:31 the latter tends to be simpler, but tends to accumulate hacks multiplying as the complexity of the schema/future 'enhancements' Mar 22 22:13:47 Maybe I could create a format like "+Title\n*Item one\n*Item two\n*Item three". Mar 22 22:14:01 Then everything is either a + (a title) or a * (an item). Mar 22 22:14:08 an* Mar 22 22:14:43 well, yes - there's a third approach, which is hack your own textual format, which usually ends up collecting even more hacks once the user adds an item like 'I love this ****ing app' and so forth :-) Mar 22 22:15:27 Not sure I understand -- does that string break the format somehow? Mar 22 22:15:48 My idea is that every item has a prefix (so there can be no ambiguity). :) Mar 22 22:16:38 ah, no - not quite - but you'll need to escape the prefix (eg: items with a newline, etc. dunno) Mar 22 22:16:54 Oh, that's true. Mar 22 22:17:04 Actually, now that I think of it, I could just have multiple files. Mar 22 22:17:11 The list title is the file name. Mar 22 22:17:22 Though obviously I'll have to limit list-title characters. Mar 22 22:17:28 and then you'll need to worry about titles with a '/' in them and so on Mar 22 22:17:30 * kbs shrughs Mar 22 22:17:30 Ya. Mar 22 22:17:33 That does get complex. lol Mar 22 22:17:51 see above for multiplying complexities - still think that's the best way to think about it Mar 22 22:19:32 if this is something like a 'notes' app, I'd personally just use a db - it's more tedious but tends to avoid subtleties like utf-8 and so on whic usually shows up much later Mar 22 22:19:41 when building your apps what, if anything, do you tend to utilise the YourActivity class constructor for? Mar 22 22:32:45 hy all Mar 22 22:33:34 i'm running into some trouble on a lower-end device (512MB RAM) with an opengl game of mine...crashes without any errors when i try to load in too many textures, reducing # of textures loaded eliminates it but i need all the textures obviously :) Mar 22 22:33:45 any suggestions on how to reduce my footprint? Mar 22 22:34:03 I tried to develop with android studio, but it's totally chinese for me...I always get weird error messages, such as Gradle can't sync my project after I tried to import an existing one...can't start a new project, because it says PicoPluginExtensionInitializationException O.o Mar 22 22:34:18 where can I get help for all of this? Mar 22 22:35:35 So basically if you have a variable that needs to be locked, in a sense if you get a phonecall you cant guarantee 100% that it can be handled correctly if that vairable needs to be read in the onPause...? Mar 22 22:35:54 i mean you cant block on a semaphore in onPause Mar 22 22:38:12 you generally can't [or should not anyway] block on the ui thread - which is where onPause() runs Mar 22 22:38:27 are you running your 'must-not-interrupt' method on the ui thread? Mar 22 22:50:47 well there is a gamestate and depending on the gamestate i want to do different things onPause. The gamestate is changed in another thread but read from the UI thread. Mar 22 22:57:20 jabba123: yes... reduce the texture quality... clearly its a resource issue. adn saving a few K on code aint gonna offset the overhead of massive textures on a low end phone. Mar 22 23:05:20 it would be cool if Moto 360 had a 3D screen like on that gameboy with 3D, you could totally disguise it like a real watch Mar 22 23:12:28 Do you neeed to quit threads in lifecycle methods? I do when i switch fragment but if Android kills my app, whats the point of stopping a threa,d everything is killed anyway right? Mar 22 23:19:03 why would an app go from onCreate->onStart->onResume->onPause->onResume on a clean start where there was no interruption? No other activity was interrupted and only this one is on the screen so the onPause seems redundant. Mar 22 23:19:36 (according to the official life cycle doc here : https://developer.android.com/reference/android/app/Activity.html#ActivityLifecycle Mar 22 23:21:20 hi guys, i followed this guide: http://www.androidaz.com/development/zxing-qr-reader-direct-integration... @layout/capture is included in the activity_main.xml of my application, and the text in @layout/capture shows (please place qr code in the viewfinder), but the camera does not start Mar 22 23:25:31 if i disable the library-ness and run it as an app, it says unfortunately barcode scanner stopped Mar 22 23:25:32 hmph Mar 22 23:30:33 backbutton causes a stop and ondestroy by default? or is it something settable in my manifest? Mar 22 23:33:40 rgr: you'd call finish() in onBackPressed() Mar 22 23:39:11 rgr: I suppose, to allow resuming of apps on a clean start is the reason for onResume->onPause->onResume Mar 22 23:41:10 ? Mar 22 23:41:26 My Q is why its being destroyed. Mar 22 23:41:44 hmm, been a while since ive built a project with gradle and im getting this funky error on the :lint target saying that there's no such method, com.android.tools.lint.client.api.LintDriver.isSuppressed(Lcom/android/tools/lint/detector/api/Issue;Llombok/ast/Node;)Z Mar 22 23:42:10 i confirmed that indeed the lint-api-22.7.0.jar which is being referenced does not have this method. however, android-sdk/tools/lib/lint-api.jar _does_ have this method Mar 22 23:42:47 the lint-api-22.7.0.jar being used (according to gradle build --debug) is being served from the maven repo here: http://mvnrepository.com/artifact/com.android.tools/sdklib/22.7.0 Mar 22 23:43:27 has anyone else seen this? google is not showing anything which tells me this could be very recent Mar 22 23:43:58 your comment re onResume->onPause->onResume makes sense Mar 22 23:44:59 rgr: to have it destroyed you need to call finish in onBackPressed() after exhausting your backstack when exiting Mar 22 23:45:40 I just published an app: https://play.google.com/store/apps/details?id=ie.appz.tonedeff.app Mar 22 23:45:41 I dont want it destroyed. Im only asking why its being called. Mar 22 23:46:42 jasta there was a problem with lombok (see your error) but that was a while ago Mar 22 23:47:15 Ankhwatcher: why if you dont mind me asking? It does nothing worth sharing without making too fine a point of it. Mar 22 23:47:42 theres nothing there about matching tones, identifying chords/notes or following sequences. Mar 22 23:47:49 g00s: its been a while since ive updated, perhaps there's been some issue through the upgrade path Mar 22 23:47:56 rgr: because I can :p Mar 22 23:48:08 i'm confused which library is referencing this method... Mar 22 23:48:09 fair enough. Mar 22 23:48:11 hang on, let me pull the stack trace Mar 22 23:48:14 yeah, there was an immediate update because of lombok specifically Mar 22 23:48:35 oh son of a bitch are you kidding me Mar 22 23:48:58 i have some fucking custom lint rules in ~/.android/lint that are old Mar 22 23:49:03 *grumble* Mar 22 23:49:28 hi g00s, I still havent located this gradle console you mentioned. you use AS? It shows you the compilation and gradle phases as it builds you say? Mar 22 23:49:42 rgr yes Mar 22 23:50:09 sorry but can you tell me again how you bring it up. I'm totally snowblind at this stage. Mar 22 23:50:55 with my AS, the thing at the leftmost / bottom corner either prings up a list of tool windows, or - if you click it directly, puts buttons for those tool windows around the work space Mar 22 23:51:12 rgr: if you override onBackPressed and not call finish() then onStop() and onDestroy() should not get called Mar 22 23:51:15 basically, when you fresh install AS, there is a little hover over it says "this is where all this shit is" Mar 22 23:51:23 its in there :) Mar 22 23:51:29 shmooz: thanks Mar 22 23:51:58 I use intellij but shouldnt be any different afaik. I use full gradlew build too. bah. Mar 22 23:52:18 shmooz: I'll try that to see. Mar 22 23:53:54 g00s: can you bring it up from teh normal menu? Mar 22 23:54:54 rgr View -> Tool Windows :) Mar 22 23:55:46 shmooz: oh you mean nothign gets called if O override onBackButton. Is there a way to override it so that the app minimises but only in onStop and onPause cycle? Mar 22 23:56:48 g00s there's only a "gradle" window there. no gradle console. for me. Mar 22 23:57:00 thats messed up. i dunno then Mar 22 23:57:10 intellij 13.1 Mar 22 23:57:17 oh, well Mar 22 23:57:22 duh Mar 22 23:57:34 does it have a title other than gradle console? Somethign I can google? Mar 22 23:57:37 i'm using android studio Mar 22 23:57:43 i dunno, bankai_ might know Mar 22 23:58:09 it probably isn't there Mar 22 23:58:18 run gradle from command line instead? Mar 22 23:58:23 what? Mar 22 23:58:26 hy all Mar 22 23:58:36 how can I use android studio? I always get errors Mar 22 23:58:52 I have reinstalled, but still get errors from gradle Mar 22 23:58:58 gregtom6: well that question is a bit wide Mar 22 23:59:05 what error messages are you getting? Mar 22 23:59:18 put them in pastebin if there are a lot Mar 22 23:59:27 Ankhwatcher: because I have never know what is the certain error Mar 22 23:59:38 it says: gradle project sync failed Mar 23 00:00:08 rgr: http://www.gradle.org/docs/current/userguide/tutorial_gradle_command_line.html Mar 23 00:00:22 yeah I could alt-f12 and run "./gradlew build" but thats kind of shit. Mar 23 00:00:39 Ankhwatcher: its not a gradle Q. Its a console Q. ie where is it ;) Mar 23 00:01:11 rgr: the princess is in another IDE Mar 23 00:01:21 hehe Mar 23 00:01:39 rgr: people would normally use the home button for that Mar 23 00:01:55 they would expect their last back press to exit Mar 23 00:02:14 gregtom6: it should show some more detailed error messages also Mar 23 00:02:22 where? Mar 23 00:02:43 so if I'm watching a video I want to get back to instead of pressing back, I hit home Mar 23 00:03:10 if the message is scrolling across the bottom of the screen you can click on it for more details Mar 23 00:03:28 gregtom6: hit the magic gradle button http://www.sep.com/sep-blog/files/2013/10/Capture.jpg and see what messages it gives you Mar 23 00:04:05 Ankhwatcher: it's very magical: Gradle 'MyApplication' project refresh failed: A fatal exception has occurred. Program will exit. Gradle settings Mar 23 00:04:13 There's no more details Mar 23 00:04:20 there were never was any Mar 23 00:05:36 rgr: but you can break convention and do what you want I guess Mar 23 00:05:48 no no. Mar 23 00:06:28 heh. The amount of times I either move my finger from ny nexus 7 to the monitor and swipe it or try moving he mouse from the monitor to the nexus is quite scary... need to give the monitor a good clean now! Mar 23 00:07:28 okay, I give up Mar 23 00:07:37 this Android Studio is an unusable shit Mar 23 00:07:42 gregtom6: wow you give up easily Mar 23 00:07:53 what does it say in the gradle console: http://tools.android.com/_/rsrc/1383953354693/recent/androidstudio034released/gradle-console.png Mar 23 00:08:14 easily??? I tried to solve this a few months ago Mar 23 00:08:55 gregtom6: and you gave up after 5 minutes then too? Mar 23 00:09:42 gregtom6 you could just shut the IDE down, and run gradle from the command line … to distill things to the essentials Mar 23 00:10:13 type ./gradle - and it will tell you whats messed up Mar 23 00:10:33 rgr: http://stackoverflow.com/questions/3141996/android-how-to-override-the-back-button-so-it-doesnt-finish-my-activity Mar 23 00:11:34 g00s: where? Mar 23 00:11:35 Im happy that it does if thats the convention. Mar 23 00:12:13 gregtom6: are you using Windows or OSX/Linux? Mar 23 00:12:39 Ankhwatcher: I'm just not happy to spend hours with making and be able to running an empty project...that's all Mar 23 00:12:48 Ankhwatcher: Windows Mar 23 00:13:41 g00s: in which folder should I enter ./gradle? Mar 23 00:13:56 gregtom6 if its in your path, the folder with the root build.gradle Mar 23 00:14:17 also doesn't hurt to read the gradle instructions :) Mar 23 00:14:33 g00s: and where are the instructions? Mar 23 00:14:41 g00s: will that work under Windows? Mar 23 00:14:52 gregtom6: that's the fun part ;) Mar 23 00:15:03 not the ./ bit, so just 'gradle' Mar 23 00:15:32 g00s: I don't have that PATH variable Mar 23 00:15:36 so where can I find that? Mar 23 00:15:43 ugh Mar 23 00:16:00 gregtom6: are you still trying to compile an empty project from months ago or is this a new one? Mar 23 00:16:23 g00s: isn't that what gradlew.bat is for? Mar 23 00:16:37 oh i thought that was gradle wrapper Mar 23 00:16:43 Ankhwatcher: I start a new one now, but I tried to import an existing project a few months ago with no success Mar 23 00:16:51 but now I can't create a new one Mar 23 00:17:02 even no with reinstalled Android Studio Mar 23 00:17:13 and that's very bad compaired to Visual Studio ide Mar 23 00:17:13 g00s: well maybe it is but shouldn't it achieve the same thing? Mar 23 00:17:28 i dont use the wrapper, dunno Mar 23 00:17:50 okay with this in mind Mar 23 00:18:04 gregtom6: navigate to the root of your project folder in the console Mar 23 00:18:10 gradlew is the wrapper Mar 23 00:18:27 the root is the folder with "settings.gradle" in it Mar 23 00:18:52 you "use the wrapper" if you want to build with a different gradle version e.g "./gradlew build" Mar 23 00:19:40 Ankhwatcher: and what now? Mar 23 00:20:07 try running "gradlew build" Mar 23 00:20:30 if that doesn't do anything "gradlew.bat build" Mar 23 00:21:27 ERROR: JAVA_HOME is set to an invalid directory: D:\Progik\Java Please set the JAVA_HOME variable in your environment to match the location of your Java installation. Mar 23 00:21:30 I see now Mar 23 00:21:42 why this message is not appear on Android Studio? Mar 23 00:21:49 why should I navigate in cmd? Mar 23 00:21:56 gregtom6: who knows Mar 23 00:22:09 at least Android Studio really should told me this earlier Mar 23 00:22:25 I dunno I've seen errors for this sort of stuff out of it Mar 23 00:22:47 but I switched to android studio about the same time I left windows so I don't really know what it's like on there Mar 23 00:23:32 does it work with Linux? Mar 23 00:23:37 of course Mar 23 00:23:42 I mean it works better on Linux? Mar 23 00:23:49 how would I know Mar 23 00:23:50 I'd guess hell on earth. Mar 23 00:24:38 Ankhwatcher: and why is that an invalid directory? Mar 23 00:24:47 jdk and jre is still in there Mar 23 00:24:51 *are Mar 23 00:24:56 wtf? Mar 23 00:24:59 gregtom6: did you set your environment variables like PATH ? Mar 23 00:25:01 on linux you need to switch from the OpenJDK to the Oracle JDK for it to work right, which is a bit of a pain Mar 23 00:25:22 gregtom6: isn't path supposed to point to the bin folder Mar 23 00:25:32 I just wanted to write a f*ing android application... Mar 23 00:25:47 gregtom6 you have to know how to computer first though :) Mar 23 00:25:57 gregtom6: well maybe if you set up your computer right Mar 23 00:26:01 PATH doesn't necessarily need to point to bin, just anything you want in the path. Mar 23 00:26:05 *a bin Mar 23 00:26:27 I have already set them a few months ago Mar 23 00:26:31 Well, a bin directory. Mar 23 00:26:31 Maximum specificity. Mar 23 00:26:55 I don't know why can't I use adb command everywhere in cmd, because it worked well previously Mar 23 00:27:13 i think its better when google doesn't bundle all these things, and you have to set stuff up yourself and actually think about the parts Mar 23 00:27:14 Checked your PATH recently? Mar 23 00:27:21 I just don't understand this illogical Android studio Mar 23 00:27:28 gregtom6: didn't your mother teach you how to set up your Environment Mar 23 00:28:19 My mom actually did back when we had computers running DOS Mar 23 00:28:30 gregtom6: http://stackoverflow.com/questions/2619584/how-to-set-java-home-on-windows-7 Mar 23 00:28:54 Nilium holy shit your mom used dos ? Mar 23 00:29:21 looks like you point JAVA_HOME at the specific JDK you want to use and optionally add the bin folder to PATH Mar 23 00:29:30 My mom used emacs and/or vim. I don't think she knew what either was, she just had to use them for her job. She wasn't a programmer. Mar 23 00:29:40 (that just lets you run java/javac/javadoc from the command line) Mar 23 00:29:41 :O Mar 23 00:30:09 Nilium was she a sysadmin ? who uses emacs and is not a programmer :| Mar 23 00:30:13 why cant you cast from int to an enum? I have to write my own convertingfunction? Mar 23 00:30:22 I don't know what they did on DOS 'cause I only used it for games and Win3.1 came soon after Mar 23 00:30:22 Then came Win95 and DOS was mostly gone except to play older games Mar 23 00:30:33 People who need to edit text. Mar 23 00:31:09 Important to keep in mind that text editing options were kind of limited and emacs was free. Mar 23 00:31:34 yeah; i dont recall if emacs worked in dos. i bet vim did though Mar 23 00:31:45 probably STILL does, part of the problem :) Mar 23 00:32:06 Well, she didn't use emacs when we had DOS. She'd ended up being a stay-at-home mom by then. Mar 23 00:32:11 Ankhwatcher: I did the same Mar 23 00:32:15 and nothing solved for me Mar 23 00:32:35 My dad also used Emacs, but he was actually a programmer. Mar 23 00:32:54 why would vim work on dos? Mar 23 00:32:56 edlin Mar 23 00:32:59 gregtom6: what does JAVA_HOME show as when you evaluate it from the console Mar 23 00:33:08 Only coded in assembly, though, at least according to him. Mar 23 00:33:11 His words: "I never used high-level languages" Mar 23 00:33:18 gregtom6: keeping in mind that you have to close and re-open the console for your changes to take affect Mar 23 00:33:46 Ankhwatcher: but Android Studio says the same Mar 23 00:33:48 not console Mar 23 00:33:48 Wonder what I should do for dinner.. Mar 23 00:34:20 gregtom6: set you bloody system up right and then worry about AS Mar 23 00:35:14 bloody my whole PC, since I need to do tons of different things in this Mar 23 00:36:30 * Nilium is pretty sure the problem is something obvious and it shouldn't be this hard to set up. Mar 23 00:37:09 Nilium: it's a java ide that can't find java, of course it doesn't work Mar 23 00:37:10 Ankhwatcher: now gradlew build starts to build something... Mar 23 00:37:11 wow Mar 23 00:37:32 I am surprised by how slow Gradle is. Mar 23 00:37:43 I don't use Gradle. Fun stuff. Mar 23 00:38:10 Confession: I don't use a build system. Mar 23 00:38:18 At least for this current project. Mar 23 00:38:30 Classpaths FTW. :D Mar 23 00:38:32 Butterflies? Mar 23 00:38:44 I don't really write code, I just argue with people about their ide Mar 23 00:38:45 Or "the classpath", I guess. Mar 23 00:41:38 Ankhwatcher: I tried to do this gradlew build again, since Android Studio still doesn't work Mar 23 00:41:56 why cant you cast from int to an enum? I have to write my own convertingfunction? Mar 23 00:43:08 f*ck you, gradle Mar 23 00:43:31 Because an enum isn't an int. Mar 23 00:43:31 rento: http://stackoverflow.com/questions/5878952/cast-int-to-enum-in-java Mar 23 00:44:04 You could use the ordinal method, or you could just give it an integer value. Mar 23 00:44:34 rento: I had never heard of an enum until you started spamming this channel and I now know that a) you can't and b) you need to google shit before you ask Mar 23 00:44:39 Or, optionally, use constants instead of enums. Mar 23 00:44:39 I think constants will get inlined more easily than enums in that case. Mar 23 00:45:03 Ankhwatcher: what should I do now? Mar 23 00:45:14 Actually not sure if enums even get inlined. Mar 23 00:45:14 I just don't use them. Mar 23 00:45:52 gregtom6: are you happ that you have set JAVA_HOME to point to a jdk install like C:\Program Files\Java\jdk1.6.0_10? Mar 23 00:45:59 *happy Mar 23 00:46:13 Ankhwatcher: I have already did that Mar 23 00:46:32 I have already was able to do gradlew build Mar 23 00:46:40 it built something Mar 23 00:46:43 okay Mar 23 00:46:46 gregtom6: you may need to reboot after doing that Mar 23 00:46:47 restart Mar 23 00:46:57 I have restarted android studio Mar 23 00:47:09 still nothing Mar 23 00:47:42 shmooz, Ankhwatcher Mar 23 00:47:42 we mean the whole system Mar 23 00:47:47 oh Mar 23 00:47:50 okay Mar 23 00:48:03 when you get back look for a JDK location setting in AS as well Mar 23 00:48:06 reboot after setting PATH Mar 23 00:48:06 is there something what contains these steps? Mar 23 00:48:30 gregtom6: the wealth of human experience shared by shmooz and myself Mar 23 00:48:40 okay, I restart now Mar 23 00:48:44 bye until then Mar 23 00:48:49 cya Mar 23 00:49:41 hope he set the PATH right ;) Mar 23 00:50:00 shmooz: from my research into his problem path shouldn't matter Mar 23 00:50:05 just JAVA_HOME Mar 23 00:50:17 its easy to delete all the other paths in windows while adding, because they are all highlighted Mar 23 00:50:37 and if you type while highlighted it erases all the PATH's lol Mar 23 00:50:39 shmooz: oh yeah he might have entirely screwed his system Mar 23 00:51:44 AS has the JDK location set on a project level Mar 23 00:51:59 it's in the F4 dialog Mar 23 00:53:35 man this laptop sure acts screwy Mar 23 00:53:58 Ankhwatcher: are you running ubuntu on it ? Mar 23 00:54:15 Linux Mint Mar 23 00:54:25 I use Linux Mint on an iMac in work Mar 23 00:54:27 cool Mar 23 00:54:43 so AS works on that no problem Mar 23 00:54:45 and it works fine there, but it's a bit squirrely on htis laptop Mar 23 00:55:03 shmooz: once you have the oracle jdk it's smooth sailing Mar 23 00:55:12 well and your udev rules Mar 23 00:55:37 how can I emulate a click on an object in my gridview? Mar 23 00:57:30 Ankhwatcher: performItemClick(obj.getAdapter()... Mar 23 00:57:52 for listview Mar 23 00:58:24 probably gridview has it too Mar 23 01:00:11 or just performClick() Mar 23 01:00:15 yeah I think that will work Mar 23 01:00:35 I'm trying setSelection, then performClick() Mar 23 01:03:32 I just can't believe it works now Mar 23 01:03:33 thanks Mar 23 01:03:41 yay!!! Mar 23 01:03:48 gregtom6: you're welcome, happy coding Mar 23 01:08:56 Is there a way to be notified when the SearchView is closed (when it's in the ActionBar). SearchView.OnCloseListener (https://developer.android.com/reference/android/widget/SearchView.OnCloseListener.html) doesn't seem to be getting called Mar 23 01:12:56 Well this seems to work Mar 23 01:12:58 https://developer.android.com/reference/android/view/MenuItem.OnActionExpandListener.html Mar 23 01:19:32 haha! it worked Mar 23 01:19:44 thanks for the tip shmooz Mar 23 01:19:57 congrats! Mar 23 01:20:55 yeah I use that to emulate a click on my listview for when the user chooses an item from a context menu as shortcut to play the video in my app Mar 23 01:21:26 for the 'Play' option when they long press a video in the list Mar 23 01:21:41 shmooz: what I'm trying to do is have this https://play.google.com/store/apps/details?id=ie.appz.tonedeff.app play all of the colours in order Mar 23 01:21:49 it actually sounds pretty cool Mar 23 01:22:00 now I want to make it show which one is being played Mar 23 01:26:50 If you get a phonecall in the middle of onBackPressed, what would happen? Mar 23 01:27:05 would onBackPressed finish before onPause is called? Mar 23 01:27:48 Has anyone had any luck with the Android Wear libraries? I followed the documentation but I can't seem to get it. (Using Android Studio, BTW) Mar 23 01:32:20 woohoo Mar 23 01:33:44 rento: both those are called on the same thread - so, if the process itself hasn't been killed, then they will run sequentially (well, on the same thread naturally) Mar 23 01:34:31 rento: I have a strange feeling that the system you're desiging is doing all its work on the ui thread, and is likely the source of issues :-) but maybe I'm wrong Mar 23 01:49:34 okay my code is up on github and my new apk is on it's way to the store Mar 23 01:49:40 time to go to bed Mar 23 01:49:49 goodnight all Mar 23 01:50:24 congratulations :-) Mar 23 02:01:49 I'm trying to create a survey sdk to plug into some of my apps. Basically the premise is onResume it will start the async task in my library that will check for/retrieve the survey from the server. If it returns a survey then the "Take Survey" button should have its visibility set to visible Mar 23 02:02:25 the problem I'm having though is how to get a boolean returned from the asynctask in the library code which I can then check against to make the button visible Mar 23 02:02:36 any idea how I should go about doing that? Mar 23 02:03:27 the pattern I've generally found useful, is to use pub-sub for the return value; and use threads in a service (rather than an async task) to do the background work Mar 23 02:04:16 ah, I could give that a try Mar 23 02:04:35 there isn't any direct pub-sub framework in the native android system, but it's fairly easy to splice one together from LocalBroadcastManager, or just straight up Handlers Mar 23 02:05:11 I personally find services easier to work with than an asyncthread - but if you are gonna use an asyncthread, you can directly reference the activity from the thread on its completion Mar 23 02:05:47 As soon as my app launches I get unfortnately has stopped working... how do I debug this? I see no errors... Mar 23 02:06:20 also check loadermanager for less worse ways to interact with the enclosing activity [if you use asynctask, that is] Mar 23 02:07:33 thammond: ie - if you use asynctask, you can probably directly enable the button in its onpostexecute Mar 23 02:07:51 I've tried that Mar 23 02:08:07 thammond: but - mostly be aware of the activity lifecycle, which is sometimes different from your thread's lifecycle - loadermanager can lessen some of the gotchas here Mar 23 02:08:10 the problem is that the button's in the client app's activity Mar 23 02:08:39 yep :) Mar 23 02:09:09 hm. Do you not have a way to get a reference to that button? Mar 23 02:10:45 ie - your api to "initsurvey" called from your client app's onCreate() say, might pass in the activity (and that button if necessary) -> you launch your asynctask, etc. [I'm not a big fan of this approach because of the activity lifecycle gotchas, but that's another story] Mar 23 02:11:29 I could potentially Mar 23 02:11:50 but I was trying to design it so I could toss it into any app I create/eventually open source it Mar 23 02:12:29 passing the button might work though Mar 23 02:14:03 another alternative I've seen is to not do any ui specific stuff - instead, have [an async] method that checks whether the user has taken the survey Mar 23 02:14:16 and, another method that returns an intent that the caller can call to start your survey activity Mar 23 02:14:40 this lets the client create the ui that makes sense for them [rather than a button, etc] Mar 23 02:15:30 now you push the dirty work over to the client :-) let them handle any leaks from the async method ,tc Mar 23 02:15:38 haha yea :) Mar 23 02:16:06 that is a pretty good idea Mar 23 02:16:31 I was thinking about trying to return an intent actually Mar 23 02:17:01 Can anyone help me out with debugging? I have a simple app what do I do if it crashes on run in the emulator? Mar 23 02:17:08 I see no errors Mar 23 02:17:22 thammond: *nod* returning an intent seems to be a pretty common trick within sdks - many of the apis do just that. Mar 23 02:18:23 thammond: it's pretty convenient - can stick it anywhere [including widgets as a pending intent] so it's a handy-dandy pattern for embedding 'an action' Mar 23 02:18:48 Do you know if there are any examples of that out there? Mar 23 02:19:02 I haven't looked, but if you know offhand ;) Mar 23 02:19:48 thammond: yes, most of the google apis do that - you can poke around there and you'll hit on some api that returns an intent Mar 23 02:20:09 er, google api == "google play services" -based apis Mar 23 02:20:11 sweet! thanks kbs! Mar 23 02:22:53 eg: https://developer.android.com/google/auth/api-client.html -- when the authorization fails, the return result contains an intent. You launch this intent, which starts a login activity from within the sdk and so on. Mar 23 02:23:14 nebby what's your logcat say? empty? Mar 23 02:23:29 yeah Mar 23 02:23:40 empty Mar 23 02:23:41 are you getting any logcat output at all? Mar 23 02:23:44 no Mar 23 02:23:58 sometimes the emulator disconnects from the logcat - try restarting eclipse/the emulator Mar 23 02:24:15 okay Mar 23 02:24:37 I think sometimes you can get it jump started from the DDMS perspective, but I favor just a restart of eclipse. Seems to work more for me Mar 23 02:24:52 kbs: that looks good Mar 23 02:33:07 nebby: did that work? I can help you de-bug the error once you start getting something logged :) Mar 23 02:39:50 thammond: yeah it worked. I'm following a tutorial from a book, but the code seems to be crashing it. I've found that it's myInstance.getDate().toString() that crashes it - the toString() specifically, I think the Date has not been set, so NULL to string may be causing the crash? Mar 23 02:43:55 thammond: that was it, thanks Mar 23 02:48:17 yep thatll do it. to be safe you can check to see if it's null before doing that **** ENDING LOGGING AT Sun Mar 23 02:59:58 2014