**** BEGIN LOGGING AT Sun Jun 09 02:59:59 2013 Jun 09 03:00:57 read that and then rethink why you think you need this, and if you still think you do, talk to someone about what you're actually trying to achieve so you can be led down the correct path (which often involves using scheduled timers instead) Jun 09 03:03:05 i liked this part of that article: "Think of your Android service as a cron job or Windows scheduled task, not as a persistent daemon or Windows service." Jun 09 04:13:56 is there a good nosql for android? i don't want to go through the pains of using sqlite Jun 09 04:14:11 something like sharedpreferences but for larger sets of data Jun 09 04:19:16 Jc_Dev: Jc very correct again. but I and the user of the phone, both are/will be aware of it. The service is most of importance. even at sleep. Now lets ignore 4. momentarily and talk about the strategy? Jun 09 04:26:47 jmgrosen: files and shared preferences Jun 09 04:26:55 jmgrosen: write files. Jun 09 04:27:58 jmgrosen: you may want to save those files in internal memory and also encrypt them if they have curcial data Jun 09 04:28:57 so files with serialized objects? or json? Jun 09 04:29:06 is speed comparable to a db? Jun 09 04:29:16 well, my application isn't too performance-crucial Jun 09 04:30:17 jmgrosen: http://developer.android.com/guide/topics/data/data-storage.html#filesInternal Jun 09 04:31:01 would you recommend normal java serialization or json? Jun 09 04:31:26 #java would be a better place to ask in my recommendation Jun 09 04:31:31 okay, thanks Jun 09 04:31:45 jmgrosen: you may wait for an android dev perspective here too Jun 09 04:31:53 alright Jun 09 04:32:08 its just I never got into that detail Jun 09 04:43:15 Hello Jun 09 04:43:41 Is it possible to recompile app with obusfucation decompile with apktool? Jun 09 04:44:44 jmgrosen: sqlite isn't that bad and once you have the boiler done it's very convient Jun 09 04:45:45 plus you can roll in it a content provider have convient access Jun 09 04:46:10 biggenius: i recomend http://developer.android.com/tools/help/proguard.html Jun 09 04:46:55 back Jun 09 04:47:26 Sircle: Yes i am familiar with Proguard. But i am asking if app decompile with Apktool can be obfuscated during recompile process Jun 09 04:49:00 lasserix: the worst part is migrations, though Jun 09 04:50:35 Sircle: for strategy, i would recommend using BOOT_COMPLETED to reschedule your service executions on startup, and to design your service to run for a limited about of time (say, 10 minutes) and use AlarmManager to start it back up afterwards, this way it won't appear to be a long-running service and will be less likely to be terminated. In addition, you can make it foreground, but that may not be entirely necessary. Jun 09 04:51:59 biggenius: hm.. sory , no experience with apktool. wish you luck Jun 09 04:52:48 Jc_Dev: actually, internally the app sleeps for the provided time by user. mostly 15 minuts. operates somthing and sleeps again. Jun 09 04:53:11 jcase: in an infinite while loop Jun 09 04:53:22 Sircle, wat Jun 09 04:53:48 sory. my bad Jun 09 04:53:54 biggenius, i answered you in smali Jun 09 04:53:59 then tried to give your MORE help Jun 09 04:54:01 but you left Jun 09 04:54:05 Sircle: oh also, for your service to do work while the screen is off, you will need to obtain a wake lock Jun 09 04:54:24 Jc_Dev: : in an infinite while loop Jun 09 04:54:39 jcase: I was disconnected i guess. iam here now Jun 09 04:54:52 jcase: yes thanks Jun 09 04:55:01 biggenius, what are you trying to obfuscate? Jun 09 04:55:04 Sircle: i wouldn't recommand an infinite while loop Jun 09 04:55:05 and how do you want it done Jun 09 04:55:06 Jc_Dev: wake lock? what would that do? Jun 09 04:55:26 Sircle: a wake lock prevents the CPU from going to sleep when the screen is off Jun 09 04:55:59 Sircle: so you have to force the phone to be partially awake even when the screen is off if you intend to do work while the screen is off, this is done by requesting a PARTIAL_WAKE_LOCK Jun 09 04:56:09 Jc_Dev: when the screen is off, the CPU gets to sleep, and the applications stop them selfes? everything is stopped? Jun 09 04:56:16 yes Jun 09 04:56:21 Jc_Dev: the services too? Jun 09 04:56:24 yes Jun 09 04:56:33 this is why your phone battery can last all day Jun 09 04:56:43 it sleeps when you aren't using it Jun 09 04:57:01 Jc_Dev: No I dont want to consume battery for doing nothing for 15 minuts Jun 09 04:57:04 you can request to be woken up though, using AlarmManager Jun 09 04:57:36 Sircle: exactly - so what you do is you "check" to see if there's anything to be done, then let the phone go back to sleep for a while Jun 09 04:57:53 Jc_Dev: . point. what about the services that receive calls and sms when screen is off. they must be running? Jun 09 04:58:45 Jc_Dev: if i make it to wake up by alarm manager. the screen will turn ON again? or just my app be able to perform? Jun 09 04:58:53 Jc_Dev: this is getting complex :) Jun 09 04:59:14 Sircle: are you talking about the actual OS services? those are different Jun 09 04:59:17 Jc_Dev: What about those services which are using in Push email applications? Jun 09 04:59:45 Jc_Dev: they notify user even if screen is off. Jun 09 05:00:12 Sircle: no it won't turn the screen on, just your app, then for the duration you want to do work, you obtain a wake_lock and then release it when you are done checking to see if there is work/performing work Jun 09 05:00:34 biggenius: yes, they are most likely being woken up intermittently by the AlarmManager to check for work Jun 09 05:00:54 Jc_Dev: ok thanks. Jun 09 05:01:29 if all services were running all the time the phone would be unusable, they are really more like "scheduled tasks" Jun 09 05:01:43 at least, that's how you should think of them Jun 09 05:02:14 Jc_Dev: hm Jun 09 05:02:25 Jc_Dev: only Alarm Manager is solution? Jun 09 05:02:37 Jc_Dev: Or there is something more out there. Jun 09 05:02:38 you can interrupt the user and turn on the screen and show a message from the service, but that's discouraged unless the user really really expects this to happen (e.g. incoming call, or alarm clock going off) Jun 09 05:03:03 Jc_Dev: if a service is listening to calls and sms all the time. then its a service running all the time or a cron task that starts every nano second and stops after the second nano second? Jun 09 05:03:11 biggenius: AlarmManager is usually the solution, because you cannot guarantee a service to be long running, and you really don't want it to be long running anyways due to impact on phone Jun 09 05:03:25 Jc_Dev: the user dont expects the UI Jun 09 05:04:01 Sircle: Same here, i have app with no ui listening to server and sending info on specfic actions by user. Jun 09 05:04:29 Sircle: you can usually get a service to run for minutes no problem, but the longer it runs the higher chance android will intervene and stop it, so re-scheduling executions increases the "up time" Jun 09 05:04:35 Sircle: Thinking about some way to do it, without draining users battery. Jun 09 05:05:04 biggenius: listening to server? you mean maintaining an active data connection over wi-fi or cellular? Jun 09 05:05:27 biggenius: intermittent wake-ups that check with the server quickly and then disconnect would help save battery Jun 09 05:05:30 Jc_Dev: Yes, active data connection on Wifi. Jun 09 05:05:49 Jc_Dev: alright, good info. Jun 09 05:06:05 biggenius: might want to see http://stackoverflow.com/questions/17005837/persistent-foreground-android-service-that-starts-by-ui-and-also-starts-at-boot then Jun 09 05:06:25 Sircle: ok. Jun 09 05:06:48 biggenius: you'll also need to acquire a wifi lock too, to prevent that radio from going to sleep Jun 09 05:06:58 (while your service is awake to perform the server check) Jun 09 05:07:09 hm Jun 09 05:08:13 hmm ok Jun 09 05:09:38 i'm actually doing something along these lines too, i want a service to run a p2p client, but i need to let it shutdown gracefully after a period of inactivity (even if the screen is off) Jun 09 05:10:09 :) Jun 09 05:10:16 i'm using a combination of all these techniques :) Jun 09 05:10:23 hm Jun 09 05:10:46 Jc_Dev: then I made valid question Jun 09 05:10:57 I've actually made my own service derivation called AutoStopService which shuts itself off after a period of inactivity, and starts itself back up when the activity needs to know something Jun 09 05:11:33 what if i have app that requests Permissions from users. And i don't write all these permission in AndroidManifest Jun 09 05:11:42 yep it's a valid question, it's just that the answer may lead to some different design then you originally were anticipating Jun 09 05:11:57 Will my app crash or what? Jun 09 05:12:21 on not getting appropriate permissions from user? Jun 09 05:12:21 biggenius: yeah you'll get a runtime exception that tells you to put it in the manifest :) Jun 09 05:12:23 ya..... thats the problem. design problem Jc_Dev Jun 09 05:12:32 biggenius: or the behavior just won't occur Jun 09 05:12:36 Jc_Dev: cool Jun 09 05:12:51 Jc_Dev: do vote my question up or down if you think any thing about it Jun 09 05:13:10 biggenius: ^ Jun 09 05:13:19 and I might set a bounty Jun 09 05:14:15 Sircle: What? you want me to upvote some question? Jun 09 05:14:32 Sircle: Where is question? Jun 09 05:16:13 http://stackoverflow.com/questions/17005837/persistent-foreground-android-service-that-starts-by-ui-and-also-starts-at-boot Jun 09 05:16:43 biggenius: just a sentance. you may downvote too :) if you dont like it Jun 09 05:18:00 Sircle: I already implement this intent based service in my app. Jun 09 05:18:19 Sircle: Upvoted your question, looks good to me. Jun 09 05:21:24 this looks interesting for my problem: https://github.com/jankotek/mapdb Jun 09 05:21:42 anyone have any experience with it? Jun 09 05:22:27 not I, i see they have maven integration though :) Jun 09 05:22:48 yes, and a very nice api it seems Jun 09 05:24:16 and under active development too Jun 09 05:25:49 "janotek authored 8 hours ago" -- eeyup Jun 09 05:36:18 biggenius: thanks Jun 09 05:36:32 biggenius: you might want to show up you code if its opensourced Jun 09 05:36:50 Jc_Dev: ^ Jun 09 05:37:13 Sircle: Sure, but i am just using Boot completed intent , nothing so special about the code Jun 09 05:41:27 biggenius: ok. np then Jun 09 05:41:36 hi all...need some help populating fragments in a widget's configure activity Jun 09 05:42:15 the activity will have 3 tabs and i'm trying to build a fragment class such that it can load all 3 tabs dynamically Jun 09 05:42:46 somehow I'm missing the gap between the activity and the fragment classes Jun 09 05:43:17 your activity will have a pager, your pager will implement getItem, which will return an instance of a fragment Jun 09 05:44:08 can that fragment be the same type every time? Jun 09 05:44:24 Jc_Dev: biggenius pleasure talking Jun 09 05:44:28 * Sircle goes to bed Jun 09 05:44:30 you can switch on the index to determine which of the 3 fragments you create Jun 09 05:44:32 Sircle: cya Jun 09 05:44:52 and how do I pass the index to the fragment from the activity? Jun 09 05:45:17 the index is part of the pager callback which is already in the activity Jun 09 05:45:34 each tab is represented by a fragment Jun 09 05:45:44 rather, each tab contents i should say Jun 09 05:46:23 ok... Jun 09 05:46:50 I guess where I may be getting caught up is that depending on the tab, the adapter for the fragment may be different Jun 09 05:47:02 so same fragment, different adapter Jun 09 05:47:08 the adapter should be within the fragment - fragments are intended to be self-contained Jun 09 05:47:39 can I dynamically choose which adapter to use for an instance of a fragment? Jun 09 05:47:52 based on data in the activity? Jun 09 05:48:15 yes, you can pass arguments to the fragment as part of creating it Jun 09 05:49:25 I created the fragment by calling getFragmentManager().findFragmentById(id)... is that right? Jun 09 05:49:50 or should I build the fragment with a constructor and call that? Jun 09 05:51:04 your activity will have an instance of FragmentPagerAdapter, which you use as the adapter for your ViewPager Jun 09 05:51:38 this causes the viewpager to call getItem(int position) when the user selects a tab Jun 09 05:51:58 you return a fragment by using the constructor: e.g. return new MyFragment(); Jun 09 05:52:25 job done! Jun 09 05:53:25 to be honest, i'd just make a new project with min api 11 or higher, and pick a default activity that uses the viewpager, it generates you a nice example of how to do it Jun 09 05:54:14 ok I'll look into that...I haven't been able to find any simple examples of what I'm trying to do Jun 09 05:54:30 basically I have a layout with a TabHost and 3 fragments Jun 09 05:55:23 on creation of the activity I add the tabs, but I'm stuck trying to build the code that populates/updates the tabs Jun 09 05:55:25 ah ok, yeah you're basically doing it all manually - ViewPager with a FragmentPagerAdater makes it a lot easier to work with Jun 09 05:55:49 hmm...ok Jun 09 05:56:22 check out the generated example, it might look goofy at first but it should "click" after you play with it Jun 09 05:56:54 alright...I'll give it a try...many thanks! Jun 09 05:57:03 only gotcha is i think you need min api of 11 to leverage those new classes, i'm not entirely sure if they were backported via the support mechanisms Jun 09 05:57:08 you're welcome, good luck :) Jun 09 05:57:24 I'm building on api 17 so that shouldn't be a problem Jun 09 05:57:46 yeah, but min api is a separate concern than target api Jun 09 05:58:21 oh right Jun 09 05:58:22 currently close to 40% of android users are on api 10 still (shakes fist) Jun 09 05:59:01 http://developer.android.com/about/dashboards/index.html Jun 09 05:59:49 hmm...the project I'm using has min api of 8 :( Jun 09 06:00:04 Mine works for API 7 Jun 09 06:00:24 7 is not worth supporting Jun 09 06:00:27 8 is not worth supporting Jun 09 06:00:31 the difference between 7 and 19 is under 5% Jun 09 06:00:40 *9 Jun 09 06:01:06 sorry not the difference, the total users using those 3 versions Jun 09 06:01:28 9 is also not worth supporting, but generally, if you can support 10, you can support 9 Jun 09 06:01:35 the api differences between 9 and 10 are tiny Jun 09 06:02:11 there were some nice changes between 10 and 11, i decided to use 11 in my app, but i'm also hoping everyone upgrades to the nice new phones coming out this year Jun 09 06:02:20 or even to last year's phones lol Jun 09 06:02:22 11 is also not worth it Jun 09 06:02:27 11, 12, 13 are not worth it Jun 09 06:02:30 really, your choices are 10 or 14 Jun 09 06:02:36 15 even Jun 09 06:02:38 yeah Jun 09 06:02:47 8, 10, 15, 16, 17 Jun 09 06:02:57 if you need 10, and it works on 8 iwthout much trouble, i'll accept 8 Jun 09 06:03:02 but otherwise, pick one of those four Jun 09 06:03:22 yeah i should probably change my min from 11 to 15, i'm not actually sure what i'm missing out on now that i think about it Jun 09 06:03:49 i just picked 11 so i could use the new holo stuff Jun 09 06:03:54 13 is if you are doing gtv Jun 09 06:03:58 should I use ADT or Android Studio, I like the AS IDE, but it seems very buggy and there is not much support for it yet. Jun 09 06:04:12 use intellij idea Jun 09 06:04:14 ;) Jun 09 06:04:31 Snicers-Home: i'm using AS myself, it's the way to go gonig forward so might as well take the plunge Jun 09 06:04:58 Jc_Dev, I agree, but I am having a huge issue pulling down source from VCS. Jun 09 06:05:34 Snicers-Home: you mean using the integrated VCS options in the IDE? Jun 09 06:05:43 yeah Jun 09 06:05:48 i use them all the time (i'm on bitbucket at the moment) Jun 09 06:05:53 The source pulled down, but now I am getting all sorts of errors. Jun 09 06:06:27 Jc_Dev: from what I'm seeing ViewPager and FragmentPagerAdapter are in the Support Library...isn't that more for compatibility? Jun 09 06:07:00 Jc_Dev, I am using bitbucket as well, but files on my laptop (mainly in the build folder) do not push to bitbucket for some reason. Jun 09 06:07:09 thebean: it's the mechanism for letting you use new features but still target older api's, i'm not sure why google decided to put those in the support library only though, shrug Jun 09 06:07:33 oh ok thanks for clarifying...it is very weird Jun 09 06:07:34 Snicers-Home: you shouldn't be putting files under your build folder under source control in the first place Jun 09 06:07:48 Snicers-Home: check out the standard .git-ignore templates, there's one for android Jun 09 06:08:10 Jc_Dev, correct, but when I pull it tells me "ERROR: APK path is not specified for module 'AppNameHere'" Jun 09 06:08:42 Jc_Dev, .gitignore Jun 09 06:09:01 Zharf: ah ok Jun 09 06:09:33 Snicers-Home: do you have a git root setup in your project? it's one of those little messages at the top right if you open a project that appears to be under source control Jun 09 06:09:45 yes Jun 09 06:09:47 Snicers-Home: i actually used the command line to clone the repo first, then opened it Jun 09 06:09:56 Jc_Dev, I did it both wasy Jun 09 06:10:45 Snicers-Home: make sure you're launching Android Studio with Administrator privelege, if this applies to you Jun 09 06:11:03 there's a few ppl complaining about this here: http://stackoverflow.com/questions/16722651/apk-path-is-not-specified-for-module-example-example Jun 09 06:11:10 not sure it's related to source control though Jun 09 06:11:22 I am. Jun 09 06:12:19 hmmm not sure then - i haven't run into anything like that myself Jun 09 06:13:06 ok so here might be an issue,. Jun 09 06:13:29 I have to redefine the SDK when I import from VSC since the names are slightly different, this causes the Gradle: : java.lang.NullPointerException Jun 09 06:14:19 redefine the apk? Jun 09 06:14:28 or you talking java sdk? Jun 09 06:14:41 android sdk Jun 09 06:14:46 oh Jun 09 06:15:01 why do you need to do that? Jun 09 06:15:20 IDK Jun 09 06:15:33 do you have the sdk under source control? Jun 09 06:15:35 My guess is they are in different locations on my two computers Jun 09 06:15:40 no I don't. Jun 09 06:15:57 then to fix the null point I do this: Project structure -> modules -> remove Android -Gradle Jun 09 06:16:26 it's not a location thing, I haven't used AS but in intellij IDEA you have SDKs with names, and the proejct files match the sdk with the name Jun 09 06:16:59 you can add multiple SDKs Jun 09 06:17:43 after I remove Android-Gradle I can then build with no errors, when I then go to run the app I get the APK path is not specified for module Jun 09 06:18:23 it would make sense to get that when you run... but you said you get that when you pull from source control, i'm confused Jun 09 06:18:44 * Zharf zzz Jun 09 06:19:10 here's how to fix it maybe though: http://stackoverflow.com/questions/6079004/upgrade-intellij-to-10-5-and-android-build-fails-android-sdk-not-specified Jun 09 06:19:15 Jc_Dev, I get that when I pull from sourcecode and run Jun 09 06:19:27 when I run from the computer I dev'd on originally it runs fine. Jun 09 06:19:44 oh ok, sounds like it's unrelated to source conrol, it's just a misconfiguration on the one computer Jun 09 06:19:56 hey guys... this is more of a java question but anyway to handle webscraping task I almost always use HTMLUnit... now I am tryig to login to a forum or flickr, etc. and the grab what I need. The URL of the login form is on a page with .php extension and I don't think HTMLUnit will work because of that. Can anyone please help? Jun 09 06:20:48 Jc_Dev, I have tried that, no luck. Jun 09 06:20:50 if you haven't tried it, is there really any help needed? Jun 09 06:21:03 (directed at killmesoftly ) Jun 09 06:21:35 i use a mac and win 7 with AS and bitbucket, haven't seen that myself yet Jun 09 06:21:57 sounds annoying though Jun 09 06:23:20 Jc_Dev: quick follow-up question...will using viewpager/fragmentpageadapter work for a widget configuration activity? Jun 09 06:23:25 can you use a webview to display html contents even without loading a url? Jun 09 06:23:49 looks like it, forget i asked Jun 09 06:24:59 thebean: i haven't played with widget's yet, but my understanding is they launch an activity just the same as usual, so my understanding is that there's nothing special about the fact it's a widget configuration screen vs a typical activity Jun 09 06:25:11 Bear10: asked what? Jun 09 06:25:17 exactly Jun 09 06:25:18 ok cool Jun 09 06:25:20 :P Jun 09 06:25:24 ;) Jun 09 06:29:40 I also get this: "Gradle project refresh failed: Can't resolve Gradle project. Reason: given path doesn't point to a file". It is pointing to a location on my original computer that I started coding on... Jun 09 06:31:51 So I guess I just copy the code and start a new project... Jun 09 07:03:29 you guys aware of any android security research irc channel? Jun 09 07:13:57 biggenuis prob android-root or here depending on context Jun 09 07:17:30 Snicers-Home: oh it almost sounds like you have some of the project files under source control - what does your .gitignore look like? Jun 09 07:18:16 the big one is the .idea folder, but there's a few more Jun 09 07:35:10 I would pay money to be able to sleep =( Jun 09 07:36:03 ron_frown: hey do i have the app for you... Jun 09 07:36:28 ? Jun 09 07:36:54 oh just implying i have some snake oil for sale :) Jun 09 07:37:21 I've slept like maybe a grand total of 4 hours the last week Jun 09 07:37:31 I've just decided not to bother TRYING for sleep Jun 09 07:37:51 actually you know there's this 15-20 minute yoga track i listen to sometimes, it pretty awesome for falling asleep, it gets you all relaxed and you just pass out, but it's funny cause the track isn't actually intended for making you sleep, just rest Jun 09 07:39:24 Jc_Dev theres an interesting shoutcast radio stream called ambient sleep Jun 09 07:39:35 it helps, but I dont know what it i Jun 09 07:40:10 I'll finally fall asleep after a couple hours, then sleep for like an hour then be attempting sleep the rest of hte night Jun 09 07:47:14 Mavrik: hey dude, u there? Jun 09 08:10:24 anyone can answer this please? http://stackoverflow.com/questions/17007474/how-to-view-an-image-uri-fetched-from-sqlite-table-inside-an-imageview Jun 09 08:14:22 hey omid8bimo are you basically asking how to retrieve the column value as a string from the cursor? Jun 09 08:15:11 Jc_Dev: well, i think so. the problem is i dont know how to get that single column (which is image uri) and show is in my imageview in my custom adapter method? Jun 09 08:16:58 oh ic, one sec i did that before Jun 09 08:23:10 omid8bimo: let me clarify - you have the uri as a string, and you have the reference to the imageview, and you want to set it? if that's the case, I believe it is like this: iv.setImageURI(Uri.parse(fileString)); Jun 09 08:24:00 btw i see you're using a listview and sqllite, have you considered using SimpleCursorAdapter instead of ArrayAdapter? Jun 09 08:26:32 Jc_Dev: well, yeah. but the uri is a column in the db. how can i map that to a String first my in custom adapter method? Jun 09 08:27:13 Jc_Dev: yeah i read about SimpleCursorAdapter but i dont know how to use it in my case? like how it will simplify my code? Jun 09 08:27:39 it simplifies it a lot because you specify which columns to populate which controls in your row Jun 09 08:27:58 and you can override the assignment yourself if needed by overriding setViewBinder Jun 09 08:28:33 in fact, i would say just switch over to that, i'm not really sure how to do it properly otherwise Jun 09 08:28:44 i'll be back in a few min Jun 09 08:31:24 Is there anybody out there ? Jun 09 08:34:05 hi Jun 09 08:34:20 Jc_Dev: so with SimpleCursorAdapter, i dont need to define a my custom adapter method? Jun 09 08:40:17 Hello guys :) https://gist.github.com/tagrudev/5742841 any ideas on that ? Jun 09 08:40:28 The new android studio is giving me so much head ache Jun 09 08:55:18 hi Jun 09 08:57:41 omid8bimo: hey sorry about that, i'm back - one sec let me give you an example Jun 09 08:58:05 I'm new to Android dev ( but an experienced programmer ), i'm using an "selector" to change button text when pressed etc. but when I try use it to change the background color the program is not working. Jun 09 08:58:26 I see on the net ways the change the button color with an image, but is that necesarry ? Jun 09 08:58:46 necessary* Jun 09 08:59:11 i think you can use a color, too Jun 09 08:59:34 Jc_Dev: ok thanks dude Jun 09 08:59:37 the "images" you use are drawables Jun 09 08:59:44 Unknown0BC: only if you want say some sort of custom background, like funky rounded corners for example. you use a 9patch file which is a mechanism for letting the button scale properly on various screen sizes Jun 09 08:59:52 and a drawable can be a "shape" (type square) with a color Jun 09 09:00:51 a drawable can be a fill description too Jun 09 09:01:03 like a gradient + stroke Jun 09 09:01:15 * Unknown0BC reads Jun 09 09:01:16 oh hey StingRay_ Jun 09 09:01:18 gradientDrawable Jun 09 09:01:19 :) Jun 09 09:01:26 Jc_Dev: no Jun 09 09:01:27 no Jun 09 09:01:32 you did not get it workin Jun 09 09:01:40 oh but i did Jun 09 09:01:45 cuase thats what "oh hi stringray" means Jun 09 09:01:53 it worked so well rainbows appeared Jun 09 09:02:02 lol yeah Jun 09 09:02:06 i send you a memo on irc Jun 09 09:02:24 did you get the notification when you logged on? Jun 09 09:02:26 I found it rather strange that the method worked fine on android:textcolor then I just wanted to use the same method on android:background ( in the button section ), and it kinda crashes. Jun 09 09:02:28 but did you hear baby unicorns laughing ? cause thats when you know you get something right ! Jun 09 09:02:35 Jc_Dev: no Jun 09 09:02:39 So must I use drawable for the background of the button ? Jun 09 09:02:41 ok one sec lemme find the link Jun 09 09:02:41 no notifications Jun 09 09:02:47 MUST* Jun 09 09:02:55 Unknown0BC: your missing the point Jun 09 09:03:02 the same method for the text just does not work for the background ? Jun 09 09:03:05 a drawable is something that can be drawn Jun 09 09:03:50 text would use a colorStateList Jun 09 09:04:01 ah Jun 09 09:04:01 a button/view would use a drawableStates Jun 09 09:04:15 ah Jun 09 09:04:21 StingRay_: http://pastebin.com/YDBAcBNz Jun 09 09:04:26 gotcha thanks man :) Jun 09 09:04:40 Any idea on this I tried to insert a external lib in my libs directory in Android Studio and now I get this https://gist.github.com/tagrudev/5742841 Jun 09 09:05:32 I tried manually defining a packageName (although there is one in Manifest file) in the gradle.build Jun 09 09:05:38 still the same output Jun 09 09:05:56 Jc_Dev: you know how many SO points you will get for this lol Jun 09 09:06:10 cause I would think 100's of questions active at the moment Jun 09 09:06:24 with various lib projects needs Jun 09 09:08:49 StingRay_: yeah i saw a lot, i answered one of them here http://stackoverflow.com/questions/9744721/relative-project-dependencies-in-gradle/16999835#16999835 Jun 09 09:09:17 omid8bimo: hey i'm working on sanitizing an example, and i just realized one thing - i think you need to make a content provider to use SimpleCursorAdapter Jun 09 09:10:32 omid8bimo: is that something you'd be ok doing? i find it makes a great abstraction for the db layer anyways Jun 09 09:10:43 i'll keep working on the example regardless, but just realized that Jun 09 09:11:46 Jc_Dev: thank you so much :) Jun 09 09:15:29 omid8bimo: ok sorry i had to hack it together from a few classes because i had some in an abstract base class, but here's the idea: http://pastebin.com/D15MzRdG Jun 09 09:16:08 those constants are coming from my "interface" class that goes with the provider i made to represent my db table Jun 09 09:17:01 the magic is in createAdapter, in the setViewBinder you can take over how the data gets set into the row's view, in my case i'm translating a stored date into a textual representation Jun 09 09:20:24 * StingRay_ loves it when there is magic Jun 09 09:20:26 :) Jun 09 09:20:32 migrating back to eclipse must be the answer Jun 09 09:20:53 tagrudev: android studio troubles? Jun 09 09:21:32 It can not include a simple external lib Jun 09 09:22:09 and I can't even start to explain my disappointment from this gradle (sh.t) Jun 09 09:22:11 really Jun 09 09:22:48 Jc_Dev: all right, let me see that and get back to you if i had a question. thanks for your time Jun 09 09:22:58 omid8bimo: alrighty Jun 09 09:23:04 and who the funk does this for an IDE Jun 09 09:23:04 http://screencloud.net/v/dwu4 Jun 09 09:23:12 tagrudev: oh yeah it's tricky the first time, is it a jar you're including? Jun 09 09:23:40 yeah keep in mind it's at like version 0.1 Jun 09 09:23:43 yes I found out how to include it in the gradle Jun 09 09:23:51 but now Jun 09 09:23:58 there is a problem with the build it cannot locate Jun 09 09:24:08 oh you have to do a clean Jun 09 09:24:14 how can I do that ? Jun 09 09:24:22 what OS are you Jun 09 09:24:57 ubuntu 13.04 Jun 09 09:25:07 Terminal/command prompt/console to your project root and run equivalent of: ./gradlew clean Jun 09 09:25:16 ./gradlew clean build will do a clean and a build Jun 09 09:26:41 also, here's a shortcut to auto-include any jars you add to your project: compile fileTree(dir: 'libs', include: '*.jar') Jun 09 09:27:14 I did that Jun 09 09:27:19 still fails Jun 09 09:27:34 https://gist.github.com/tagrudev/9923d2ba63abd3a47b2e Jun 09 09:28:13 apparantly now It cannot find my R. file Jun 09 09:28:15 ;( Jun 09 09:28:26 also Jun 09 09:30:00 ah ok yeah that failure is something else, are you ok posting your build.gradle? Jun 09 09:31:59 Jc_Dev: yes I am trying to rebuild the project from scratch let me try that and if it fails again I will paste it Jun 09 09:32:04 ok Jun 09 09:41:40 Jc_Dev: will AS ever include a auto gradle config sync magicy thingy ? Cause for me to switch to gradle and maintain configs ( sometimes when just testing a library) is for a non-coder, a pain!! Jun 09 09:41:58 and do you think they will call it what i just did ? lol Jun 09 09:42:19 StingRay_: they included a sync button in the last patch, it syncs the IDE with gradle, which is a start Jun 09 09:42:36 a visual gradle editor Jun 09 09:42:40 now thats an idea Jun 09 09:43:05 StingRay_: I'm not sure if it does more, i haven't played with it yet, but yeah, i have no idea if you'll ever move away from manually editing gradle files Jun 09 09:49:23 StingRay_, dude, AS is version 0.1.3 Jun 09 09:49:30 Jc_Dev: im a little confused. first of all, if i have 5 columns in the db, should i have one item in "from" and "to" arrays fro SimpleCursorAdapter? Jun 09 09:49:31 it's in a pre-alpha state :) Jun 09 09:50:04 Didnt ask what version it was in ;) I knew that Jun 09 09:50:16 omid8bimo: you can grab out as many columns as you want, so if you wanted all 5, you would specify the 5 column names in "from" and the destination textview id's in "to" (for example) Jun 09 09:51:10 StingRay_, well, isn't it obvious then that it's not finished product yet? And that Gradle integration into IntelliJ suite has just started? Jun 09 09:51:27 it is obvious, and yes Jun 09 09:51:34 again that wasnt my question Jun 09 09:54:13 Jc_Dev: ohom. in the "from" array, should i use the tableName.columnName or can i just juse the column names? Jun 09 09:54:19 omid8bimo: the thing is, the SimpleCursorAdapter wants to be powered by a content provider, which is another layer you probably don't have yet - there's a good example in the sdx examples though, that's what i used Jun 09 09:55:05 omid8bimo: from is just the strings of the actual column names, which should be defined as constants somewhere in your project in theory :) Jun 09 09:56:43 What is the purpose of "hint" in TextView ? Jun 09 09:56:49 Jc_Dev: ok i have created a dbhelper class. i just use the DbhelperClassName.columnNameField. correct? Jun 09 09:57:40 bluesm: It's for when Facebook encourages you to type "What's on your mind?" in a text field. Jun 09 09:58:00 ... if I remember correctly. Jun 09 09:58:23 Zta: It is probably "EditText" Not TextView. Jun 09 09:58:49 Oh, right. Jun 09 09:58:57 Good question then =) Jun 09 09:59:03 omid8bimo: if that's the name of your actual database column, then yes Jun 09 09:59:13 Jc_Dev: all right. doing it now Jun 09 09:59:41 omid8bimo: the sample for a content provider that i used: /Applications/Android Studio.app/sdk/samples/android-17/NotePad/src/com/example/android/notepad/NotePadProvider.java Jun 09 10:02:58 heads up to anyone who suddenly gets problems with their R identifiers not compiling - run lint, you may have a typo somewhere in an xml document Jun 09 10:03:30 hi all, anyone is familiar with Volley, the new library from google for building rest app? Jun 09 10:03:58 I have a problem that it seems to have somethings contradicted to the presentation in Google I/O 2010 Jun 09 10:05:03 i imagine hint is more for accessibility features, like screen readers Jun 09 10:05:28 in 2010, the presenter said we should use service to prevent the system killing the app, but in volley, I can't find that service. I can find two threads only, one for cache and one for network. did i misunderstand somethings? Jun 09 10:07:40 edwinkcw, I think you misunderstood context Jun 09 10:07:49 edwinkcw, what are you trying to do with Volley? Jun 09 10:08:14 Mavrik, just build an restful client Jun 09 10:09:05 Mavrik: which part did I misunderstand? Jun 09 10:09:34 edwinkcw, why exactly do you want to prevent OS from killing your requests for a simple RESTful client? Jun 09 10:09:45 omid8bimo: well good luck with the refactor, i'm calling it a night. i think you'll like the content provider, one of the things you get for free is notifications of when the data changes and it auto-updates the view. Jun 09 10:10:06 edwinkcw, the only usecase why would you ever wanna stop OS from killing your request is long-running downloads in background Jun 09 10:10:21 Jc_Dev: ok. thanks for your help. im still working on it to see how can i make it work. Jun 09 10:10:21 for which the Volley devs explicitly say that lib wasn't meant to do that Jun 09 10:10:33 Mavrik: it should be a waste if I send the request, but response is back while the app is killed Jun 09 10:10:42 edwinkcw, and? Jun 09 10:10:57 Mavrik: if I run a service, I can store the response into database. Jun 09 10:10:59 user closed your app, stop running ;) Jun 09 10:11:52 edwinkcw, if you followed the talk you would see that Volley devs explicitly tell you to cancel requests when UI is closed Jun 09 10:11:59 and that's the usecase Volley is built for Jun 09 10:12:09 Mavrik: ok Jun 09 10:12:27 Mavrik: so I feel confused by those two presentations Jun 09 10:13:21 Mavrik: one says we should run a service to prevent the response is not handled. Volley says just kill the request if the user exits Jun 09 10:13:37 yeah? Jun 09 10:13:47 again, think of the context Jun 09 10:14:03 and stop holding presenter usecases as holy and thinking situation can't change over time Jun 09 10:14:16 Volley is built ease things like loading thumbnails and data in UIs Jun 09 10:14:28 for which there's no reason to burn user data connection and CPU after the app is closed Jun 09 10:14:37 if you need to store the data in background, store it in background Jun 09 10:14:45 but Volley probably isn't build for that, use another lib or roll your own Jun 09 10:14:53 Mavrik: ok, so when should I use service approach? Jun 09 10:15:25 Mavrik: ok, I got your point Jun 09 10:18:29 edwinkcw, you should use a service approach when you don't want to lose the response Jun 09 10:18:35 edwinkcw, for most UI-oriented stuff that makes no sense Jun 09 10:18:46 e.g. retrieving app data, retrieving inbox in background makes little sense Jun 09 10:19:05 since that data will probably be obsolete by the time user opens the UI again and you'll have to fetch it again anyway Jun 09 10:19:22 use background service when doing something more important - sending new posts, sending GCM tokens, etc. Jun 09 10:19:26 things that MUST NOT be lost Jun 09 10:36:05 Why is my ActionBar in my app dark? My AndroidManifest defines . My styles include