**** BEGIN LOGGING AT Sat May 04 02:59:58 2013 May 04 03:03:50 so how, generally, do you make your application adjust to the various screen sizes? Do you include seperate layouts like the articles say, using different folders in the /res folder "res/layout-large"? Or just use relative layouts for all your layouts? another method? May 04 03:07:14 well, my use case isn't typical, but I have an app with layout, layout-land and layout-port, and use relative layouts. May 04 03:07:21 that's probably fine for something simple May 04 03:07:55 but once you start getting more complicated, it makes sense to split them out when you need to further tweak them May 04 03:09:01 thanks JesusFreke May 04 03:15:02 burritoHeaven, typically, you'd include something in layout-sw600dp or layout-sw720dp May 04 03:15:13 (roughly 7 inch and 10 inch) May 04 03:15:25 and those layouts could specify two fragments, rather than the one you might have on a phone May 04 03:17:48 Is it common now to have a small application built completely out of fragments? They seem so beautiful for multiple layouts. May 04 03:18:10 canadiancow thank you. Would you create those folders instead of layout-large? May 04 03:18:12 Like 1 fragment activity and everything else is a fragment. May 04 03:18:26 burritoHeaven, what's your minSdkVersion May 04 03:18:35 and what do you expect the minimum version is going to be for your tablet users May 04 03:18:46 canadiancow 2.2 May 04 03:19:13 most tablets are honycomb right? May 04 03:19:19 no May 04 03:19:24 ICS+ May 04 03:19:41 ahh i missspoke May 04 03:19:43 layout-large is "roughly" -sw600dp, but some OEMs have tweaked that May 04 03:19:53 same with xlagre/sw720dp May 04 03:19:59 what i meant to say is that the lowest SDK on a tablet is honycomb right? May 04 03:20:04 buit the -sw qualifiers are only available on android 3.2+ May 04 03:20:10 there are some gingerbread tablets May 04 03:20:14 but they mostly suck May 04 03:20:22 ya i could see that. May 04 03:20:30 an acer tab prolly May 04 03:20:47 as for your "one activity", you definitely won't have one activity per fragment, but you can have more than one May 04 03:21:04 no not one activity per fragment. May 04 03:21:27 im talking like one fragmentactivity and everything being displayed is a fragment hosted by that activity May 04 03:21:43 yeah, and im saying somehwere in between that :P May 04 03:21:52 take a look at gmail, and see where it uses new activities May 04 03:22:04 kk good idea thankyou. May 04 03:22:59 one of the articles I had read was stating to use the older "layout-large" method of naming the directories that would contain these alternative layouts when older devices were to be supported. Does this seem like a reasonable approach? Would that work out okay on newer devices, too? May 04 03:24:11 newer devices will be looking for the new files but i believe that they will still default to the old files if the new ones are not there. May 04 03:24:22 layout-large is not worth using May 04 03:24:38 galaxy note phones will pick it up, but they probably look much better with the standard phone layout May 04 03:24:56 a gingerbread tablet probably doesn't have the play store and probably looks bad no matter what layout it uses May 04 03:25:11 and a 3.2 or higher tablet can use sw600dp or sw720dp without impacting any "large" phones May 04 03:25:49 if you really want to support crappy tablets then layout-xlarge might work, and use sw600dp for modern 7" tablets May 04 03:28:51 I only own crappy tablets and an old 2.2 phone. Obviously, the application is going to be used on newer stuff, too. But, being that I'm one of these crusty people with old stuff, I should probably make my app support them. lol. May 04 04:27:22 boo May 04 04:39:51 layout-large-and-in-charge/ May 04 04:46:19 Does anyone know of size limitations on ndk built libraries? I'm getting a crash on install with my full application (libraries are only support) but can not-crash by commenting out a portion of code. May 04 04:46:48 And the portion of code doesn't really matter, I've tried commenting out two different halves of the same code while trying to isolate it. May 04 05:07:14 greymalkin, probably something like 2GB. May 04 05:08:03 Huh... not even close. Although if my APK is greater than 7MB, it crashes a RAZR and S3 on install like clockwork. If it's less than 7MB, then it gets installed and works. May 04 05:35:35 JakeWharton++ May 04 06:17:08 Hello...Anyone familiar with OnFocusChangeListener() ? May 04 06:20:21 the "hasChanged" parameter is always giving me true value...even when the view is not focused... May 04 09:33:16 Huh, must have missed this channel May 04 09:33:52 Anyone want to hear something cool? I can crash a Samsung Galaxy S4 in seconds :P May 04 09:36:18 <[deXter]> Sonicadvance1, How? May 04 09:37:03 [deXter], Something with the Qualcomm video driver when I upload data to the GPU May 04 09:37:23 <[deXter]> Ah, you're talking about the US/UK version then May 04 09:37:36 Yea, S600 model May 04 09:37:52 Because screw PVR544 May 04 09:42:03 Hey anybody here? May 04 09:42:16 393 people, nah, no one is here May 04 09:42:20 http://pastebin.com/pUkR1FYA May 04 09:42:24 I get this error May 04 09:42:39 can someone explain what it means? May 04 09:43:21 hmm, i haven't seen that in a while. used to happen in ADT when you added an ID "+@id" and numbers got shuffled around, but incorrectly. May 04 09:43:32 try to clean your project May 04 09:51:15 ok May 04 09:52:35 Android logcat is really horrible May 04 09:54:09 I still get the error goos May 04 09:55:10 timroes May 04 09:55:27 Ilhami: yeah that's my name :) May 04 09:55:32 LOL May 04 09:55:36 http://pastebin.com/pUkR1FYA do you know what this error mean? May 04 09:56:46 Ilhami: why "LOL" ? May 04 09:57:14 I just wanted help and he said that's my name hehe May 04 09:57:16 thats why May 04 09:57:22 Ilhami: guessing: some resource is missing. since its while parsing some layout file, i guess you are using some view or layout, thta isn't available on this platform May 04 09:57:45 SeparatedList May 04 09:57:53 Adapter May 04 09:57:55 I am using this May 04 09:58:10 http://w2davids.wordpress.com/android-sectioned-headers-in-listviews/ followed this tutorial... May 04 09:59:47 Ilhami: show me the code where it occurs please May 04 10:00:04 I will show you some code wait. May 04 10:00:48 http://pastebin.com/3JUA9JC0 here... May 04 10:02:08 line 50/51 is your error May 04 10:02:22 the second parameter is expected to be an ID referencing a layout file May 04 10:02:28 so something with R.layout. May 04 10:02:37 not R.id. May 04 10:03:36 Fixed... I think.. Let me try it again May 04 10:03:44 and you try to get your listview from R.id.add__journalentry_menuitem May 04 10:03:52 somehow i assume, that is not the id of your listview May 04 10:04:28 e.g. look at L66, in that line you pass in a layout file, like expected May 04 10:04:40 you are such a noob man :D May 04 10:04:41 thanks May 04 10:04:44 it works May 04 10:04:46 also line 72 seems more reasonable May 04 10:04:57 good :) May 04 10:05:33 Something very weird tho.. I set some of the textapperance to be large May 04 10:05:34 Ilhami: i am a noob? just got out of bed and already insulted.. May 04 10:05:47 all text is small.. May 04 10:06:09 android:textAppearance="?android:attr/textAppearanceLarge" why does this not work? May 04 10:09:21 Ilhami: try replacing the / with a : May 04 10:12:09 that didnt work.. I can maybe try to set the textSize intead of doing this? May 04 10:12:36 that try using @android:style/TextAppearance.Large instead May 04 10:12:51 i am always confused by this :) May 04 10:13:17 Will try May 04 10:15:38 still doesnt work... May 04 10:18:05 but I wonder where these are even used... the list_item May 04 10:18:07 e.g. May 04 10:18:07 sooooo... May 04 10:18:17 i stayed up half the night hacking on a project you guys might be interested in May 04 10:18:21 not _quite_ ready to release it though May 04 10:18:56 basically, it's an Android IPC friendly SQLite server. It is almost exactly what you get with using ContentProvider's today, except that it's a drop-in API replacement for SQLiteDatabase May 04 10:19:21 Ilhami: okay checked it android:textAppearance="?android:attr/textAppearanceLarge" does work for me May 04 10:19:27 so instead of using SQLiteDatabase.openBlaBla() you can use SQLiteConnectionManager.openContentProvider(context, authority); May 04 10:19:35 or SQLiteConnectionManager.openService(context, intent); May 04 10:19:42 I am doing something wrong I think timroes.. let me check my code May 04 10:30:33 jasta: cool, what problem does it solve? May 04 10:30:48 blog / github entry? May 04 10:31:49 i'm still confused why one would use that, instead of a content provider :) May 04 10:31:57 but i'm sure i am missing the point May 04 10:32:56 is there a difference between fill_parent and match_parent? May 04 10:33:31 The first word is different May 04 10:33:44 Funny May 04 10:34:21 I mean layout difference? May 04 10:34:27 no May 04 10:34:34 but fill_parent is dep. May 04 10:34:48 dep? did you mean derp ? May 04 10:34:53 ya May 04 10:34:56 early May 04 10:34:58 no coffee May 04 10:35:01 derpricated ;) May 04 10:35:59 my wife is depricated too May 04 10:36:13 so is my willingness to work today May 04 10:36:29 i think i slayed jasta with my daftness May 04 10:38:04 hi May 04 10:41:44 g00s get a s2 May 04 10:41:57 StingRay_: what is an s2 ? May 04 10:42:00 I hear they are amazing for landscapes May 04 10:42:04 http://www.digitalrev.com/product/leica-s2/NzU5Mw_A_A?googlebase=1&country=GB May 04 10:42:09 medium format dslr May 04 10:42:10 :) May 04 10:42:51 the best android phone right now? May 04 10:42:57 GS4 May 04 10:43:07 well not quite, but sh*t load bigger than full 35mm May 04 10:43:10 StingRay_: ya sure. May 04 10:44:13 Samsung makes the best phones? I thought about buying the new LG May 04 10:44:16 i actually dont like 3:2 much, prefer 4:3 May 04 10:44:20 or 1:1 May 04 10:44:31 Ilhami, Galaxy S4 is the "best", got some Snapdragon 800 devices around the corner, like the LG Optimus G Pro or w/e it is going to be May 04 10:44:58 er, LG Optimus G2 May 04 10:45:29 Think Im gonna buy that one May 04 10:45:49 Yea, that should be out within four months May 04 10:46:38 hah who says Im gonna live 4 more months? May 04 10:46:41 Also a new Exynos Octa with a better GPU should be coming out within a couple months May 04 10:48:31 I'm thinking that a Mali-T628 should be more powerful than an Adreno 330 May 04 10:50:49 An Adreno 330 will be as powerful as a lower clocked Intel HD 4000, which I may have to make love with May 04 10:51:40 Hehe you know a lot about phones I see.. May 04 10:52:10 I know a lot about the high end SoCs I should be expecting for Gamecube emulation May 04 10:55:13 screw that stuff - i just want my phone to last longer. thats the best i could hope for May 04 10:55:25 i want 3-4 days on one charge May 04 10:55:37 Get a MediaTek device with their Cortex-A7s then May 04 10:56:40 Yes... May 04 10:56:46 battery time is important May 04 10:56:54 I hate charging it every day May 04 10:57:02 Galaxy S4 battery life is pretty beast May 04 10:57:32 what about that intel moto phone May 04 10:57:38 still best for bat life May 04 10:57:48 blaa blaa razr hd or something May 04 10:57:50 StingRay_, haha, hah May 04 10:57:56 Funny man May 04 10:58:08 Nokia 3310 :D May 04 10:58:13 best phone May 04 10:58:16 Might as well as get a Motorola Droid Maxx May 04 10:59:21 If you want a phone with stupid amounts of battery life like that. Let's get a GS4, then strap a third party 7000mAh battery and enable power saver mode May 04 10:59:44 or a GS3 even since they already have 7000mAh batteries available for that May 04 11:00:00 nice... this is what we need. May 04 11:00:05 or have it tethered to a car battery, then fit a holder to the battery for it…. oooo add an extended aerial too May 04 11:00:11 and a caryy handle May 04 11:01:01 the more lithium you have, the bigger the flash/bang when it explodes ! May 04 11:01:23 g00s, Makes it funner when it does May 04 11:02:11 as long as you dont inhale the fumes May 04 11:04:57 Let's see the battery drop when unplugged and emulating a gamecube on the Galaxy S4 shall we? May 04 11:06:08 oh woop, nevermind. I crashed it again May 04 11:23:16 Oh interesting May 04 11:23:41 ten minutes of run time only at 4% of battery life May 04 11:23:57 I think the throttling is doing a bit of overkill May 04 11:25:32 * Ge0rG really needs to get that runbo x5 phone... May 04 11:31:07 "Acer's 8-inch Windows 8 tablet shows up on Amazon with a $379.99 price tag" … huh May 04 11:31:36 i hope MS pulls out of their funk, i think they have the right idea in general May 04 11:43:00 can Ingress be played on a Non-Camrea Android? May 04 11:43:41 What should it do with the camera? May 04 11:45:13 hi, i am looking for a spanish :) May 04 11:50:07 raz86: there are only androids May 04 11:55:11 i would like to translate "are you sure you want to quit?" lol May 04 11:57:56 guys, how to get the current layout showing? I want to use it like this: if(currentLayout == R.layout.main_activity) do this; May 04 11:58:19 raz86: "¿estás seguro de que desea salir ?" ? May 04 11:58:51 elkng s/estás/está/ May 04 12:27:00 ok thx elkng and Phr33d0m May 04 12:27:24 do the lithium batteries really explode ? May 04 12:29:50 schmooz look at youtube.. there is many persons who tried it, lol May 04 12:33:00 Oh hey, there is already a 3500mAh extended battery for the Samsung Galaxy S4 May 04 13:31:27 I have a LinearLayout and I'm adding child views to it in code, however the child views seem to not obey the width and height params that are set in the XML. The child view is also a LinearLayout. Child LinearLayout has match_parent as it's width, but when added to the parent LinearLayout, it becomes wrap_content... May 04 13:38:49 alexfu did you figure it out yet? May 04 13:38:57 Sirolf: nope May 04 13:40:41 Sirolf: you got any ideas? May 04 13:45:18 alexfu: set layout params in code May 04 13:45:48 or maybe the 3 param constructor will take layout params, but not sure they are passed/parsed from xml May 04 13:47:44 any reason why the child view doesn't use the the params specified in the xml code? May 04 13:47:50 Hi! How I can open activity from another package in my Activity? May 04 13:48:13 alexfu: I take it your inflating it ? May 04 13:48:27 StingRay_: yes. May 04 13:48:37 do you pass the parent in the inflate to be considered ? May 04 13:48:58 StingRay_: oh damn. nope. just used null. May 04 13:49:04 try it May 04 13:51:29 StingRay_: aha, that worked May 04 13:51:52 cool May 04 14:07:52 hey StingRay_ May 04 14:25:44 I try read http://stackoverflow.com/questions/2741857/launch-activities-from-different-package and other. But it not work... May 04 14:34:02 I have a listView but everytime I scroll it up/down the whole listview background turns white May 04 14:35:36 android:cacheColorHint May 04 14:35:37 Doh! May 04 14:49:07 Jov: use the setComponent feature http://developer.android.com/reference/android/content/Intent.html#setComponent%28android.content.ComponentName%29 May 04 14:49:21 new ComponentName(String pkg, String cls); May 04 14:51:22 Hiho :) May 04 14:58:40 Napalm: Tanks, but I already use i.setClassName(). It works May 04 14:59:22 But I have new problem. How get all elements from other Activity? May 04 15:09:04 In simply I need programmatic "click" in view in another Activity May 04 15:35:19 ! May 04 15:36:07 ] May 04 15:36:24 [ May 04 15:41:29 Jov: is this other activity in your package? May 04 15:41:46 Napalm: Yes May 04 15:42:01 then theres nothing you can do May 04 15:42:01 lol May 04 15:42:16 what is the other activity May 04 15:42:25 it might support startActivityForResult May 04 15:44:04 It not my application and I dont have source. In simply I need start Activity and click to button May 04 15:44:53 It impossible? May 04 15:46:25 yes May 04 15:46:29 you no longer have control May 04 15:46:38 what is the intent class and action May 04 15:46:42 type it here May 04 15:46:56 whose application is it? May 04 15:47:16 speedtest.net application May 04 15:47:39 Need to click "Start test" button May 04 15:47:49 why are you trying to remotely start a speed test? May 04 15:48:53 It need for help test 3G in my provider. May 04 16:01:42 May be I can emulate touch by coordinates? :) May 04 16:11:27 hi. How can i make the title of an activity wrap? May 04 16:23:29 hi. How can i make the title of an activity wrap? May 04 16:31:47 you cant May 04 16:31:49 perioid May 04 16:32:02 Y use a multi-line title to begin with May 04 16:32:18 Its suppose to be short May 04 16:54:33 <_ohm> Is there a way I can view individual variable values in my app after it has crashed via adb? I have a nullpointerexception and I cannot for the life of me find it May 04 16:58:29 That's why we have stack traces May 04 17:05:41 <_ohm> SimonVT, you recommend putting try/catches everywhere I possibly can? May 04 17:05:58 No, I recommend reading your stacktrace in logcat May 04 17:08:28 _ohm: I dunno about eclipse (or which you're using), but in intellij it's a simple matter to debug the app and set a breakpoint on the occurrence of a specific exception type May 04 17:09:16 That being said, you can usually figure it out just from the stack trace and line information May 04 17:09:37 although in some cases, there may be multiple things on a single line that may be causing an NPE May 04 17:10:12 that have the possibility to cause an NPE* May 04 17:11:40 <_ohm> I'm looking at adb logcat output once it crashes, guess I'll look harder if that's what you recommend May 04 17:18:12 when I need to access a database from a service and an activity, what is best practice for this task? the activity will perform read-only querries on the db, the service will only insert new data. I don't want to run in concurrency issues or locking problems May 04 17:19:44 I read about the content provider that could be useful in this case. another possibility I was thinking of was to use a separate service that handles all the access to the db. all other accessors would have to bind to the service May 04 17:20:45 when all accessors unbind I close the DB and the service quits. May 04 17:20:54 but this is more a selfmade solution May 04 17:21:29 haven't worked with content providers so far and the examples I found so far where not so easy :) May 04 17:40:55 <_ohm> just so I'm sure, when you say stacktrace you're talking about the raw logcat output correct? Sorry this bug is really hurting my head May 04 17:45:39 _ohm: http://stackoverflow.com/a/3988794 May 04 18:31:09 <_ohm> The stack trace has 2 line numbers that are in my code, however when I try and either add comments or whitespace to move the lines in question in my code, the stacktrace lines do not change. What does this mean? May 04 18:33:41 <_ohm> it says error at line 92, I move my line down to line 94 on eclipse. stacktrace still says error at line 92 May 04 18:34:58 whats the exception ? May 04 18:39:01 <_ohm> StingRay_, it's null pointer. I'm connecting multiple bluetooth devices to a single tablet. Sometimes everything works sometimes it doesn't. when it crashes I can't find anything in stacktrace May 04 18:39:13 <_ohm> starting to think it's hardware May 04 18:40:02 well does that not just mean, something is null and your either attempting to use it ? May 04 18:40:11 on that line ? May 04 18:40:19 maybe you should find out whats null ? May 04 18:40:21 :) May 04 18:40:58 <_ohm> StingRay_, Yeah but I can't find it, stacktrace says like 92 and 137. I go to those lines and either comment them out or move them, run, stacktrace still says 92 and 137 May 04 18:41:16 Clean project, run again May 04 18:41:20 <|0xD34D|> ^^ May 04 18:41:26 erm, it's giving you the line, why try and change lines ? May 04 18:41:40 just look at whats null or debug it May 04 18:41:59 or rather debug it and look at whats null :) May 04 18:42:19 <|0xD34D|> perhaps set a breakpoint on that line and examine the values of everything on that line May 04 18:43:24 <_ohm> how do I set a breakpoint and examine the values on that line? May 04 18:43:46 <_ohm> I'm in eclipse May 04 18:43:59 http://www.vogella.com/articles/EclipseDebugging/article.html May 04 18:44:12 2nd google search "debug, eclipse, breakpoint" May 04 18:45:25 <_ohm> reading this now, thanks May 04 19:01:23 yawn May 04 19:01:30 stayed up until 4am hacking last night :) May 04 19:03:15 I fell asleep on the couch and woke up at 6am May 04 19:05:02 gonna release it soon :) May 04 19:07:08 The kraken? May 04 19:07:48 <_ohm> StingRay_, wow this thing is amazing thank you so much May 04 19:07:58 <_ohm> I had no idea this existed May 04 19:25:39 If I have a thread in my android project that reads from an audioRecord and writes to a file-stream do I have to worry about multiple threads writing the file stream? There are only two threads in the program and the UI thread does not touch the file stream right? May 04 19:30:18 After filling out a form, I want to upload that data to Google calendar. So, in the onClick for the save button, I presume I need to start a background task to do authorization and communication with Google's APIs, and report back when done May 04 19:30:51 but also there may be user intervention required during the auth/auth process May 04 19:31:38 so... do I start another activity to submit the data to Google calendar? how is control returned back to the first activity? May 04 19:32:56 from my understanding, startActivity ends the current activity and starts another one? this wouldn't be what I wanted I don't think May 04 19:33:28 erisco: no May 04 19:33:38 erisco: it might end other activites May 04 19:33:44 it might start a child for result May 04 19:33:59 it might spawn just a new one May 04 19:34:17 this all depends on flags and on startActivity/startActivityForResult May 04 19:34:20 startActivityForResult ? May 04 19:34:30 I was making a suggestion, not asking what it is. May 04 19:34:30 the first activity will want to do something after the data has been uploaded successfully May 04 19:35:37 erisco: yes? May 04 19:35:46 how could it do this? May 04 19:36:22 startActivityForResult May 04 19:36:28 I'm not understanding the design of the platform yet. I can't piece together how this flow is should be done May 04 19:37:03 https://developer.android.com/reference/android/app/Activity.html#StartingActivities May 04 19:37:14 think of activities as mini programs that run in one adressspace May 04 19:37:37 monsti: that _might_ run in one address space. May 04 19:37:40 SimonVT, and as I understand this causes onActivityResult to be called when done? but then how are you intended to disambiguate between different second activities? May 04 19:38:07 erisco: you sent a token with the startActivityForResult method that gets sent back to you. That's how you differentiate. May 04 19:38:32 the intent or the request code? May 04 19:38:54 the request code is that token. May 04 19:39:09 requestCode The integer request code originally supplied to startActivityForResult(), allowing you to identify who this result came from May 04 19:39:38 and what use is the Intent? May 04 19:40:05 erisco: the Intent describes what activity to start, and with what arguments. May 04 19:40:18 in onActivityResult that is May 04 19:40:32 erisco: That intent encodes the result data. May 04 19:40:41 For example, if you picked a contact, or a photo, that information is encoded into the result intent. May 04 19:41:06 Hey there, someone able to help me with a few questions on Services and services being restarted after being killed? I'm pretty familiar with the documentation now, but I feel some best practice advice might actually be helpful. May 04 19:41:10 according to the contract between you and the activity you invoked. this is why monsti said you should consider activities as mini programs. They themselves have API contracts. May 04 19:41:26 jashsu, encoded how? are you just supposed to call intent.getExtras() for a Bundle? May 04 19:41:43 The reason for this is composition. Android apps are built by composing many components together. May 04 19:41:51 erisco: yes, or getStringExtra, getFooExtra, etc. May 04 19:42:04 I am positive there are examples of this in samples/ May 04 19:42:43 o19: the documentation, imo, spells it out pretty clearly these days. do you have a specific question or specific scenario you would like explained? May 04 19:43:30 sure... there just seems to be a conflation between backend and frontend stuff May 04 19:43:57 in what way? May 04 19:44:08 so when I click the "save" button, a typical way to indicate a background task that you have to wait for might be darkening the screen and showing a loading animation May 04 19:44:25 but on android, the notion of switching activities also seems to mean switching guis May 04 19:44:29 typical if you are a boneheaded UI doofus :) May 04 19:44:51 take a survey of the real trend in mobile. Look at your favorite apps. Do they behave this way? May 04 19:45:05 I'm stuck with a specific scenario :) I have a service that eventually gets killed after a while and does not come up as expected after consulting the documentation. Instead it shows as "0 processes, 1 service, restarting" in a task manager... May 04 19:45:12 jasta, yes May 04 19:45:28 erisco: Well then by all means replicate their UI if you like apps that do this :) May 04 19:45:35 Dialogs are supported on Android, and they do exactly as you suggest. May 04 19:45:58 what is the connection between an activity and the gui? May 04 19:46:09 I'm not trying to hide my frustration with this type of UI though. Well designed apps are much, much more clever than using "Please wait..." dialogs. That is so Windows cerca last decade. May 04 19:46:26 erisco: an Activity is the housing functional component of the GUI. May 04 19:47:10 can an activity just carry out a job and not necessarily have a GUI? May 04 19:47:43 No. It necessarily presents a window to the user. May 04 19:47:54 Service's are Android components for headless operations. May 04 19:48:30 But Service carries a very specific semantic definition. You should read the documentation. I will guarantee that if you assume you understand it, you'll be wrong :) May 04 19:50:35 I think it has something to do with the division of tasks between onCreate and onStartCommand as well as with the return value for onStartCommand... And I can't find any proper information on what will be preserved when the process of a running service is killed and what I might need to re-initialize... May 04 19:50:41 jasta, okay, so what I might do then is, when the "save" button is clicked, start work on a service? May 04 19:50:55 o19: Are you familiar in general with how processes work? May 04 19:51:13 erisco: You might, but most folks prefer to use AsyncTask and either present a dialog or some other type of UI indicating an action is happening. May 04 19:51:43 Most really slick apps, though, will do optimistic network transactions so that let's say you were "saving" something to an online database, it would first write to a local cache of the database, then use a service to "sync" with the service. May 04 19:51:59 So that if the user doesn't have a network connection, or a really slow one, the UI will still seem responsive and not get in their way. May 04 19:52:19 that's fine, but we need something a bit simpler right now May 04 19:52:21 This is what I meant about "Please wait..." dialog boxes being out of fashion on mobile. Apps that do this where optimistic writes are possible are maddening. May 04 19:52:40 Then a ProgressDialog and AsyncTask is what you want if you want simple. See the samples directory. May 04 19:52:58 Don't know how to answer that question properly :) May 04 19:53:49 o19: Well, for example, given: class MyService { int foo = 0; onSomeEvent() { foo = 10; } } May 04 19:53:56 jasta, thank-you. this helps May 04 19:54:03 ugh May 04 19:54:03 are you aware of the fact that if MyService is restarted, foo will be reset to 0 until onSomeEvent occurs once again? May 04 19:54:04 "THIS DOESN'T DO SOMETHING YOU NEVER SAID IT DID. 1 STAR. UNINSTALLING" May 04 19:54:32 fml May 04 19:54:47 erisco: You should also look at the Loader API. This is a newer API that offers I think a bit less error prone means of starting and managing AsyncTask's. See AsyncTaskLoader as well. May 04 19:54:59 Both will work, but again, the Loader API is a newer superset and is less error prone. May 04 19:55:01 jasta, under normal operation, the asynctask will not require user intervention, but on an auth failure it will. will I have a way to, say, return an Intent and have the current Activity deal show the needed auth screen? May 04 19:55:37 Yes. May 04 19:55:40 erisco: Yes, but depending on what computing models you're familiar with it may not be obvious to you right away. May 04 19:56:18 well, I wouldn't be expecting anything obvious, but don't want to start down a dead end May 04 19:56:24 o19: Ok, then essentially what you must be prepared to do is save out any state that your service would need to recover like that and then apply the state when you receive your onStartCommand. You must also then use a sticky mode that will guarantee that you receive onStartCommand when your service is restarted. May 04 19:56:34 I prefer in general using the null intent style and just restoring my state in that case May 04 19:57:05 For example, a music player might record first that it is playing a song, and second which song is playing. If somehow the process died and restarted (let's say you crashed for simplicity sake), then you would recover this state immediately and begin playing. May 04 19:57:10 But _you_ would write that code. May 04 19:58:42 o19: Concretely, the null intent sticky style is START_STICKY. May 04 19:59:14 jasta, is Loader a misnomer for what is meant for? May 04 19:59:16 you can test this in the emulator by going to the home screen while your service is running, then running adb shell ps | grep com.my.app, then adb shell kill pid May 04 19:59:24 watch logcat, and you'll see android quickly try to recover your process. May 04 19:59:27 and your service. May 04 19:59:47 Ha, that helps :) May 04 20:00:22 erisco: It's a bit of a logical stretch, I admit. It makes more sense semantically when you think about the CursorLoader which does database queries using this API. But if you stretch your mind a little bit you can see that an AsyncTask which submits information to a service and then returns the server's result is a manner of "Loading" the server's result :) May 04 20:00:57 o19: To test it on a device that you have not rooted (the emulator is by default rooted), you can just throw new RuntimeException("yikes!"). Android will still restart your service in this case. May 04 20:01:17 I suppose START_REDELIVER_INTENT will be fine as well? May 04 20:01:18 but I prefer using kill to test. This is precisely how the low memory killer will nuke your process. May 04 20:01:50 That's even better advice... Don't have root since it's not my device and there are sensors involved. May 04 20:01:53 redeliver intent is a strange style for most purposes, I find. May 04 20:02:02 It depends on how you've designed your API, though. May 04 20:02:25 o19: Actually, if you have debuggable on, you can use run-as com.my.app kill pid May 04 20:02:31 that is, adb shell run-as ... May 04 20:02:51 I always forget about run-as because I root all of my developer phones May 04 20:03:06 jasta, well, I'll take a look at the newer API then. thanks May 04 20:03:10 Note: I _root_ them, but I typically run the stock firmware. There's a difference. May 04 20:03:13 cool. May 04 20:03:47 And this is why, boys and girls, everyone should buy Nexus phones :) May 04 20:03:56 It's my first Android project, but I'm pretty familiar with java, so that kind of practical advice is really helpful. May 04 20:04:28 I desperately want to. Just don't have the money and got a phone to work on from university. May 04 20:04:38 o19: adb shell offers a LOT more functionality than most people would guess, btw. May 04 20:04:47 run adb shell dumpsys meminfo com.my.app for example May 04 20:04:52 or dumpsys activity May 04 20:05:04 adb shell am start May 04 20:05:18 adb backup, too, to extract your app data for debug purposes. May 04 20:06:16 Don't have Eclipse running right now. can I issue commands from inside the IDE as well? May 04 20:06:33 my 24 hours in review of my experience with android so far: http://i.imgur.com/lAStOHW.jpg May 04 20:08:35 daspork: check linus torwals comments on java May 04 20:08:59 "java + linux + gay" should point to the entry of the mailing list ;) May 04 20:09:01 And since we're talking adb now jasta, do you have a similar command to issue stop command to a service instead of killing it? May 04 20:10:39 am start can, in fact, stop too. May 04 20:10:40 reply.writeString(DESCRIPTOR); May 04 20:10:40 return true; May 04 20:10:41 err May 04 20:10:44 http://developer.android.com/tools/help/adb.html May 04 20:10:56 read it. it's all amazing stuff. May 04 20:11:13 just landed there a sec ago :) May 04 20:11:22 sorry, I meant am can, not am start :) May 04 20:11:43 Ohh, they added kill-all. Well then, isn't that handy :) May 04 20:12:48 :) May 04 20:14:18 Eh 5 years ago I would really bash on java, but at this point syntax doesnt matter all that much. and I was pretty impressed with the build system. May 04 20:18:23 Okay, last one for today: What happens, when the device goes to sleep (aka CPU powered down)? Service destroyed and recreated or service process killed and restarted? May 04 20:18:57 daspork: and you can just make all the things static singletons, and then java doesn't matter all that much either! May 04 20:22:07 o19: CPU and radio sleep state does not have any bearing on service state. May 04 20:22:32 It will remain in the "running" state, despite that code can no longer be executing (the CPU is asleep, after all). May 04 20:23:06 jasta: how paranoid are you when mutating files - do this in a service's bg thread, or activity's bg thread and hope for the best ? May 04 20:23:19 (flat files, db, etc) May 04 20:23:24 Most of the services running on your phone are in this unspecified dormant state the vast majority of the time. If that weren't true, your battery wouldn't last an hour :) May 04 20:24:04 g00s: I generally prefer to build up an infrastructure that abstracts this away, typically into an IPC friendly set of components (contnet provider or service) May 04 20:24:11 IntentService is something i use a lot for little projects. May 04 20:24:55 I had an intent service before and just switched to a "regular" one to do it once :) May 04 20:25:15 for example, the preferences framework persists stuff on a separate bg thread; and most people will probably .commit() somewhere in their activities - so they are (unwittingly)?) doing threaded i/o outside the lifecycle of the activity May 04 20:25:42 in the old days, i was really paranoid, not so sure if its a common corner case any more May 04 20:26:05 (to worry about your process being killed when that thread is writing a few bytes - not 10k record commit) May 04 20:27:02 i remember old tricks like Contacts had an empty service, which it started - and then stopped when the write was done May 04 20:27:27 but those jobs were not done in the service :D it was just for marking the process at a higher piority May 04 20:28:29 this is all the use case, of course, the user navs away from the UI and for that split second a small I/O is happening to a file but android kills the process May 04 20:28:44 Is there any way to notice that the framework is coming back from sleep? If it's just freezing my service then I might need to resynch sensor time (seems to be nanos since boot while not sleeping) with user time... May 04 20:29:43 romainguy: there by any chance? know of any controlled vocabularies for Lr for landscape photographers ? May 04 20:30:58 Otherwise the best thing I can imagine is that I might need to use a WakeLock per transaction to DB and snych for each transaction. May 04 20:31:07 g00s: so, answering your question from last night May 04 20:31:27 the purpose of the AndroidSQLiteServer thing is to let you use SQLiteDatabase APIs instead of ContentProvider APIs for doing complex database operations May 04 20:31:43 so you don't have to try to express everything as a simple URI and crap for "non-public" parts of your content API. May 04 20:32:01 Most of the time ContentProvider just makes sense for design reasons, but the API is pretty rigid and requires a lot of fuss. May 04 20:32:08 so this is a way to get the best of both worlds. May 04 20:32:19 And, most importantly, to convert old code using SQLiteDatabase directly to soemthing that can be made multiprocess safe easily May 04 20:32:23 without refactoring or a lot of extra testing May 04 20:32:43 interesting May 04 20:32:58 also, and this is very cool, it lets you host your database in a service instead of a content provider May 04 20:33:20 http://www.zdnet.com/acer-shows-off-aspire-p3-ultrabook-aspire-r7-laptop-with-innovative-designs-7000014900/ + if it had a touchpad slide out from the right side, would be the most awesome future of all computers May 04 20:33:40 so that you can have multiple instances of the same database schema. For example, lets say you wanted to have a shadow version of the database that you update after sync operations or whatever May 04 20:33:55 you could have two instances of the same service, one which houses the shadow database instance, one which houses the main one May 04 20:33:58 we need some android tablets like that shit May 04 20:33:59 then you could have sync mechanics between them May 04 20:34:13 aha May 04 20:34:26 with contentprovider, that's not at all straight forward because you only get one authority May 04 20:34:46 so you have to then implement all this voodoo internal to the contentprovider like the old AbstractSyncProvider stuff back in the day. May 04 20:35:51 are you going to update your devtcg blog when its ready? May 04 20:36:04 yeah, im prepping it for a github release this weekend May 04 20:36:09 ill probably be ready to share it mid week next week May 04 20:36:13 cool May 04 20:36:20 looking forward to checking it out May 04 20:36:21 i wrote it to address a specific problem within Facebook, but im sure others will find it useful May 04 20:36:46 is that where you are working nowadays? May 04 20:36:54 yeah May 04 20:37:24 what is rojo up to ? May 04 20:37:42 just being a dog ;) May 04 20:43:24 any one have an any experience setting up a gae project in intellij? I can't figure out how to set it up to save my life May 04 20:46:17 install the ide's api for your pc's cpu abi and turbocharge your ide channel to ensure the raid is operating at the oem's flux capacity May 04 20:46:55 it's quite simple, really. May 04 21:06:03 Can I issue ADB commands from inside the ADT for Eclipse? Would be handy, but I just can't find it. May 04 21:09:07 blah May 04 21:09:19 * jug6ernaut_ should have bought intellij idea ultimate when it was $50 May 04 21:16:42 why May 04 21:16:45 what does ultimate do? May 04 21:17:37 web May 04 21:17:56 needing to do a GAE project, forced to go back to eclipse :S May 04 21:26:44 I am having hell of a time finding the needed documentation.... given one already has an oauth token, how do you start interacting with Google calendar APIs? May 04 21:27:22 I would have figured this https://developers.google.com/google-apps/tasks/oauth-and-tasks-on-android#apikey would be the answer but half the classes are not provided in the libraries May 04 21:27:49 AccessProtectedResrouce, GoogleAccessProtectedResource, and Tasks (though I would be using Calendar) are undefined May 04 21:28:26 all the documentation I find seems to be talking about different APIs, versions, platforms, and methods, and I just can't find anything consistent. frustrating. May 04 21:41:32 ok. word of advice -- never build your own image cache May 04 21:41:41 especially when you're downloading from the internet May 04 21:50:48 that shit's hard May 04 21:53:16 lol? May 04 21:53:20 md5sum May 04 21:53:37 + length if you have paranoia May 04 22:17:10 hrm. Is there any way to remove focus from my edittext? May 04 22:19:21 nvm, my problem is more complicated than I thought May 04 23:37:16 Hello everyone! I have to implement some form of horizontal finger swiping in a fragment in order to let the user cycle between a variable number of images (one image at time, displayed in full-screen). Would using FragmentStatePagerAdapter for that be reasonable? May 04 23:40:16 sounds like a feasible option to me May 04 23:43:52 How can I update UI from AsyncTask? May 04 23:44:29 do it in the onPostExecute method May 04 23:45:28 f2prateek: I can't use findViewById method there May 04 23:45:48 To access textview May 04 23:46:05 or you can do it onProgressUpdate* May 04 23:46:23 use the findViewbyId in your activity, make the textview variable final May 04 23:46:40 or pass it in the constructor to the async task, or pass the viewgroup in the constructor May 04 23:46:50 not sure which one is the best way but all three will work May 04 23:48:51 f2prateek: An example for final variable please ? May 04 23:49:22 final View omgYouSHouldLearnJava ; May 04 23:49:36 StingRay_: mOmgYouShouldLearnJava May 04 23:49:54 :) May 04 23:49:59 final ImageButton btn; May 04 23:50:09 btn = (ImageButton) findViewById(R.id.imageButton1); May 04 23:50:23 The final field MainActivity.btn cannot be assigned May 04 23:53:57 because it's final May 04 23:55:49 funkbox: I did, final ImageButton btn = (ImageButton) findViewById(R.id.imageButton1); May 04 23:56:14 again can't access from onPostExecute to btn May 04 23:56:20 I have to update it. May 04 23:56:54 pastebin your code May 04 23:58:23 funkbox: http://pastebin.ca/2373723 May 05 00:02:02 so you're saying "find this view!" before you're saying "hey this is the view!" May 05 00:02:40 also btn doesn't exist on post execute May 05 00:04:04 How can I say "hey this is the view!" ? May 05 00:05:10 that's what setContentView does May 05 00:07:03 I will try to do. Thanks funkbox . May 05 00:30:58 how do you get the resource corresponding to the id? May 05 00:31:40 R.string.app_name is supposed to be our application name, but it is actually an int, so I am presuming this is an identifier May 05 00:31:44 how do I get the string? May 05 00:33:32 http://developer.android.com/guide/topics/resources/accessing-resources.html May 05 00:33:53 http://developer.android.com/reference/android/content/Context.html#getString(int) May 05 00:33:55 erek: context.getString(R.string.app_name) May 05 00:34:00 erisco May 05 01:04:42 how can i make a parallelagram shape drawable? May 05 01:05:37 (in xml) May 05 01:08:24 brx_: yes, if you first make a parallelagram shape drawable class May 05 01:09:29 ahh i see May 05 01:10:05 infact May 05 01:10:12 you might be able to make a custom Shape May 05 01:11:52 Napalm|afk, thanks. im against the clock here though really might just have to settle for bakground res image May 05 01:12:54 one moment May 05 01:13:29 k May 05 01:14:39 do you want it with configurable angles? May 05 01:15:42 Napalm, no not neccesarily May 05 01:15:56 not too sloped over, just a nice slight parralellagram May 05 01:16:08 about 20 degrees sloped to the right May 05 01:29:24 brx_: want to do the trig? mine sucks ass May 05 01:29:56 lol, mine will deffo be worse May 05 01:30:05 me and maths dont get along to well May 05 01:30:15 one sec then May 05 01:47:34 anyone good at trig May 05 01:47:35 http://i.imgur.com/Vsiwgwe.png May 05 01:47:52 given the blue angle and the lengths of the red lines i want the length of the purple line May 05 01:49:28 Napalm: if you know D-A you're in good shape May 05 01:49:31 Napalm: or can derive D-A May 05 01:49:43 i dont know A May 05 01:49:50 thats what im saying May 05 01:50:00 i have the lengths of the red lines May 05 01:50:11 and the the blue angle May 05 01:50:13 but the line D-A May 05 01:50:21 can you derive that from any other info you have? May 05 01:50:35 thats what im trying to do May 05 01:50:54 I thought you were asking for the length of... since it's unlabeled, X-A May 05 01:51:10 yes May 05 01:51:22 but i dont have A May 05 01:51:28 i only have the blue andle May 05 01:51:30 angle May 05 01:51:34 I get this. I'm asking if there's any way for you to get DA May 05 01:51:45 point D to point A, not the length of the purple line May 05 01:52:23 well its a standard right angle May 05 01:52:37 which is why I'm asking if you can get that line. May 05 01:53:01 sine I have no clue what other data you might have access to, if you can get DA and say you know DX you can solve XA easily May 05 01:53:06 the height minus the hypotenuse should leave me with the length of the purple line May 05 01:53:33 dragorn: i said what other data i have May 05 01:53:46 the width and height and the blue angle May 05 02:15:03 can someone link me to a good tutorial on properly writing callbacks? i'm having trouble wrapping my head around passing data from asynchronous tasks between objects May 05 02:15:43 Napalm did you succeed? May 05 02:16:19 (its cool btw the resource image looks fine) May 05 02:21:09 chowes: Callbacks? Just have the caller implement a callback interface May 05 02:21:24 chowes: Think View.OnClickListener May 05 02:25:32 my issue might be in the architecture.. right now i have a connection object that manages talking to my server May 05 02:25:42 brx_: just sorting out my trig.. think i have it.. (sin(angle) * height / sin(90 - angle)) May 05 02:26:15 so i'm looking to do something like data = connection.getData(), but the getData method relies on an async call May 05 02:31:54 but does it blend ? May 05 02:32:24 Does anyone know if ViewPropertyAnimator uses a default interpolator? Trying to make a fade in animation using ViewPropertyAnimator but I can't find any code on the subject May 05 02:42:27 man, intellij is so great May 05 02:42:31 what a fool i've been :) **** ENDING LOGGING AT Sun May 05 02:59:58 2013