**** BEGIN LOGGING AT Sat Nov 29 02:59:59 2014 Nov 29 03:02:52 hey, it is possible to run API21 on a device running 4.4.2? How do you handle multiple versions? New to Android development Nov 29 03:49:00 WHAT THE HELL IS GOING ON WITH GOOGLE PLAY? Nov 29 03:49:03 OR IS IT MY CONNECTION Nov 29 03:56:15 Haven't you seen the matrix?! Its not the phone that's bending, it's you. Nov 29 04:08:12 Napalm: I think I'll go with that adapter-wrapper pattern. Thanks for the info. Nov 29 04:09:22 It's the kind of esoteric knowledge that's hard to come by. Nov 29 04:12:53 yeah, definitely something wrong with memory management in lillipop Nov 29 04:13:00 O.o Nov 29 04:13:03 stuff is getting evicted too easily Nov 29 04:13:13 oh that, yeah known bug Nov 29 04:13:33 even with 500+ mb free Nov 29 04:19:45 ActivityManagerService is so complicated Nov 29 04:55:45 i wonder if this is any good http://www.informit.com/store/bulletproof-android-practical-advice-for-building-secure-9780133995114 Nov 29 04:55:54 just out Nov 29 05:03:15 hi Nov 29 05:03:49 what are good practice when it comes to sqlite management, should I use a thread for each request/insert (as it may be time consuming task) ? Nov 29 05:05:44 Marlinski if you can do all writes (update, delete, insert) serialized on one thread (non-ui) and reads can happen on any non-ui thread Nov 29 05:07:37 g00s: I see, so I should dedicate a thread for database operation then Nov 29 05:08:59 Marlinski even though technically, the sqlite android api bindings are thread safe, sqlite itself, even compiled in multi-threaded mode ... seems more stable when all operations are on the same thread Nov 29 05:09:12 especially all mutating ones Nov 29 05:09:34 ok Nov 29 05:10:26 so should I use a BlockingQueue or something to wait for operation command on this thread ? Nov 29 05:10:44 and then request an update/insert/create by pushing a command to this queue ? Nov 29 05:11:12 it really depends on the nature of your operations Nov 29 05:11:59 pfn: can you elaborate ? Nov 29 05:12:39 concurrent insertion and deletion is never a problem Nov 29 05:12:53 it's when you update the same resources Nov 29 05:13:50 as for "seems more stable" I'd like to hear what was empirically found to be unstable Nov 29 05:17:29 pfn thats just advice from sqlite devs themselves Nov 29 05:18:13 its also why they recommend not compiling sqlite in multi-threaded mode :) Nov 29 05:18:24 it certainly wasn't designed with high concurrency in mind Nov 29 05:19:02 Marlinski also, use the same SQLiteDatabase instance throughout the application Nov 29 05:19:17 g00s: yes, this I done already Nov 29 05:19:27 g00s: using factory pattern Nov 29 05:19:35 you'll get weird errors around locking using multiple connections Nov 29 05:19:36 yeah Nov 29 05:20:33 I will receive message from the network that I want to store in the database, and then be able to render it on the UI (based on filter and such) Nov 29 05:20:46 you can very much like see it as a twitter app (except it is not) Nov 29 05:21:16 I am more struggling as to have a nice design of the way those component interact together gracefully Nov 29 05:21:44 Nov 29 05:59:41 alright so I understabnd that good practice for database is using a CursorAdapter with a LoaderManager and a CursorLoader to query the ContentResolver for getting and rendering data from a database Nov 29 05:59:56 but what about the part that put the data into the database ? Nov 29 06:03:44 thats often done by an IntentService doing network i/o Nov 29 06:04:27 g00s: I mean when I alreayd have the data Nov 29 06:05:28 oh Nov 29 06:05:41 well, you could do it a few ways Nov 29 06:05:56 I am all ear :) Nov 29 06:06:13 I also doesn't want to "block" the network thread Nov 29 06:06:20 but I am afraid of overengineering this ^^ Nov 29 06:06:25 one way, is to copy AsyncQueryService* from aosp and re-use that as-is. It will serialize all the operations onto a queue and do those in a service Nov 29 06:07:08 another way, is just to have an Executor dedicated to your db operations, and put the operaration on the executor Nov 29 06:07:24 and in onPause, block until those operations are completed Nov 29 06:07:33 thats what sharedPreferencesImpl does Nov 29 06:07:59 BTW - you don't have to use a contentprovider, but it does provide lots of 'pre-built- machinery Nov 29 06:08:11 http://www.doepiccoding.com/blog/?p=102 Nov 29 06:08:52 g00s: thank you, I was looking for an article like this one Nov 29 06:08:59 if onPause sees no operations are pending, it just falls through. you can get away with this often because a few writes won't hold up all the works. Nov 29 06:09:13 but you /can't/ get away with that doing networking Nov 29 06:09:19 because that could take a really long time Nov 29 06:11:23 Marlinski if you use a Provider, you don't have to use it /all the time/. for example, in some places I insert straight into the db, but then notify the ContentResolver that the Uri changed so it can propegate out ContentObservers Nov 29 06:12:06 basic single-table CRUDs are easy in the provider, but when you start doing things with transactions it getss kinda gross ... Nov 29 06:12:09 like really gross Nov 29 06:12:31 Marlinski if you go Provider way, see the iosched app. it has a throughtfully laid out one Nov 29 06:12:47 pay attention to their conventions, etc - necessary to keep things straight ;) Nov 29 06:14:17 g00s: thank you very much Nov 29 06:15:06 one thing i've considered, is just implementing Provider.Query ... that works then with all the CursorLoader stuff . and just do all the writes (withing appropriate transaction boundaries) on your own executor Nov 29 06:15:10 yw Nov 29 06:15:22 g00s: indeed, each modification to the database may need to be notified to multiple component (not only the UI) so I believe that provider may be the way to go Nov 29 06:17:05 Marlinski you can also use an event bus for that. some choices are otto, greenrobot, tinybus Nov 29 06:21:49 some one tell me why use GCM, where as I can simply pull a message from web server and display to user. ??? Nov 29 06:22:11 any advantage of GCM ? Nov 29 06:23:19 g00s: can't I simply use BroadcastReceiver to manage Event ? Nov 29 06:23:55 g00s: what is the advantage of tinybus (or other) over simply registering for BroadcastIntent ? Nov 29 06:23:55 Marlinski support library has LocalBroadcastManager or something like that ... but stuffing bundles is lame / not type safe etc Nov 29 06:24:19 using a regular BrroadcastRecievcer, i think you used to leak that to the whole system Nov 29 06:24:33 oh Nov 29 06:24:40 you may be able now to just specify a component to scope it, not sure Nov 29 06:24:57 if you use LocalBroadcastManager, it jut stays in your app. Nov 29 06:25:06 ok Nov 29 06:25:29 otto / greenrobot are like LBM except instead of throwing Intents around, they match based on type (of object) Nov 29 06:25:53 much nicer readability Nov 29 06:33:57 4should be one Google Api Client in fragment activity or each fragment can have its own? Nov 29 06:41:56 . Nov 29 06:47:09 How do I handle the case where i have a view, say it's divided into three rects. the width of the view is 800 so each rect is 266.66667 ... I'm left with 2 px of dead space, whats the best way to solve this problem? Nov 29 06:52:33 ah, somebody was asking about this the other day : FloatLabelLayout https://gist.github.com/chrisbanes/11247418 Nov 29 07:12:10 test Nov 29 07:12:40 Hello Nov 29 07:38:11 * matt_j pokes Dr_Coke Nov 29 07:38:17 lol Nov 29 07:38:19 hello Nov 29 07:38:20 :) Nov 29 07:38:21 o/ Nov 29 07:38:21 matt_j, Nov 29 07:38:25 :) Nov 29 07:38:26 there's no reason to use a content provider unless your doing ipc Nov 29 07:39:19 and when using a few components that require it, like search views Nov 29 07:44:15 g00s: if using LoaderManager with cursorLoader then I *must* create a contentprovider ? Nov 29 07:44:47 pfn: k Nov 29 07:45:01 Marlinski CursorLoader requires contentprovider Nov 29 07:47:31 looks like CWAC no longer lists a plain cursor version. maybe he discontinued it Nov 29 07:50:12 and yeah, loader sucks Nov 29 07:50:48 Marlinski: simonvt has a library that will convert your sqlite db to a cp think it is called schema Nov 29 07:50:54 or schematic Nov 29 07:53:01 i remember when tbray wanted to write a ruby based content provider generator Nov 29 08:09:45 what does it matter what language he wanted to write it in? Nov 29 08:13:09 because reto said his attempt was sick and twisted :) Nov 29 08:13:52 http://blog.radioactiveyak.com/2010/04/content-provider-iterator-or-things.html Nov 29 08:14:15 some old fun history Nov 29 08:16:08 seems completely unrelated to your original statement Nov 29 08:19:14 i have an activity with a navdrawer and about 5 fragments which get replace based on what item is selected in the navdrawer, should i hold on to the fragments once the are 'deselected' or reinstate the fragments everytime they are selected? Nov 29 08:25:22 dnl_tp theoretically you could do both, i haven't seen which is more common either way. the tradeoffs would be the same as http://developer.android.com/reference/android/support/v4/app/FragmentStatePagerAdapter.html Nov 29 08:25:51 see first few paragraphs Nov 29 08:26:10 kk Nov 29 08:29:48 Hey, I'm drawing a game board with lots of pieces on a canvas http://i.imgur.com/BAwCIrE.png Nov 29 08:30:16 Performance wasn't bad until I added animated elements like sliding drawers. Nov 29 08:30:20 and it's still not too bad Nov 29 08:30:43 but are there any ways I could speed it up before having to result to manually rendering. Nov 29 08:31:23 I was thinking bitmap buffering but the stones have to change often. Though I could probably do it to the grid to save a little. Nov 29 08:31:26 hmm Nov 29 08:31:30 hybrid apps... Nov 29 08:32:40 resort* Nov 29 08:40:55 g00s: you were the one looking for material resources Nov 29 08:40:56 ? Nov 29 08:40:57 https://www.youtube.com/watch?v=x5-ntYM_2UY Nov 29 08:41:11 gordon_ i was ? Nov 29 08:43:01 someone here was asking Nov 29 08:43:06 dont remember who :) Nov 29 08:44:52 they obviously didn't look very hard Nov 29 08:45:00 where "very hard" is really "at all" Nov 29 08:53:24 they = who ? Nov 29 08:54:01 who = they :) Nov 29 08:55:48 I'm confused Nov 29 08:55:56 but that's normal, I guess, probably Nov 29 09:14:09 therefore they = they and who = who. QED Nov 29 09:50:27 If I create a socket between 2 devices connected to same wifi. the speed of transfering will be affected by their distance, or their distance from the Wi-Fi router? Nov 29 09:52:30 'socket' ? Nov 29 09:52:46 oh Nov 29 09:53:10 they will never be talking together directly Nov 29 09:53:14 only through the routher Nov 29 09:53:16 router Nov 29 09:53:48 distance affects speed - though exact orientation poition how the device is eing held does too Nov 29 09:53:49 so if i want a direct connection I'll have to use Wifi direct, right? Nov 29 09:54:03 because ad hoc isn't possible in android Nov 29 09:54:12 yes Nov 29 09:54:16 well - it's possible Nov 29 09:54:20 just not with stock Nov 29 09:54:31 and it has its own issues Nov 29 10:00:41 I'm currently using Wi-Fi direct Nov 29 10:00:42 dun dun dun Nov 29 10:00:52 but with some device it works, and with some device doesn't Nov 29 10:01:49 aww Nov 29 10:01:50 yeah it is bug-gy Nov 29 10:04:10 Anyone wrote an IME? Nov 29 10:04:32 Trying to figure out how to implement cursor movement arrows (next, previous, down, up) Nov 29 10:16:00 the LoaderCallback onCreateLoader(): Cursor, is called after initLoader(), and returns a Cursor. So how do i access this returned Cursor? I guess it is wrong to create a variable of type Cursor, and then call onCreateLoader from that variable, right? (like so: Cursor variable = onCreateLoader()) Nov 29 10:16:56 I have a doubt, is this possible ? foo(Object obj){ taskToBeExecutedByAnotherThread.add( new Runnable(){run(){ something(obj) }} ); Nov 29 10:18:00 Anybody used any Video Chatting library? Nov 29 10:18:10 lasserix_: have you tried InputConnection.sendKeyEvent, using the DPAD keycodes? Nov 29 10:18:35 e.g. http://developer.android.com/reference/android/view/KeyEvent.html#KEYCODE_DPAD_UP Nov 29 10:18:49 strat: i believe you are not supposed to directly use the cursor, just handle it--if you implement the callbacks and "bind" it to your list, the loader is supposed to handle that which you ask Nov 29 10:19:04 JesusFreke: thanks Nov 29 10:19:55 lasserix_, okay thank you, I had a feeling it was supposed to be 'used' that way, but didnt know for sure. Thnx! (Y) Nov 29 10:20:23 Strat yeah i can't remember been a while sinced i implemented a cl, but there are better options btw if you don't need ipc for cp Nov 29 10:25:12 derp http://xkcd.com/323/ Nov 29 10:25:59 lasserix_, indeed, but for this lab i need icp (it's an exercise) :) Nov 29 10:26:07 ipc* Nov 29 10:26:41 should've started with android much much earlier man....it's so beautiful! Nov 29 10:26:50 ahh sorry i wasn't using git at the time, but i remember there are three loader methods to implement, if you implement those (can't remember the binding) it should handle the rest for you Nov 29 10:27:22 there are general purpose async task loaders that are more favorablebecause they don't force you to use a cp, which is not really useful if you don't need inter-app communication Nov 29 10:27:39 Strat: might be helpful to know that actually a cp is a remote service Nov 29 10:28:12 (using system defined aidl if i am not mistaken, but probably am) Nov 29 10:31:53 JesusFreke: if you've done this, before you have to do new KeyEvent which takes an action (up down cancel etc) and a code... should i use up or down? Nov 29 10:33:09 well, if there an actual human pressing a button somewhere, you do down on the putton press and up on the button release Nov 29 10:33:27 otherwise, just send a down then an up immediately after Nov 29 10:33:53 also, just FYI, the DPAD_UP thing is just a theory :) Nov 29 10:34:00 I'm not positive that will control the cursor Nov 29 10:34:56 I don't think I implemented cursor movement in mine Nov 29 10:35:01 the cursor must obey! Nov 29 10:35:29 lest we all be doomed to arbitrary bitmask overflow Nov 29 10:41:09 lasserix_: according to this: https://source.android.com/devices/tech/input/keyboard-devices.html - if you plugged in a USB keyboard, for example, the arrow keys should be mapped to those DPAD_UP LEFT, etc. keycodes Nov 29 10:41:48 so that's more than likely the correct set of keycodes, at least Nov 29 10:42:36 yeah Nov 29 10:42:51 or else it puts the key in the hashmap or else it gets the destructor again ;p Nov 29 10:43:16 now I just have no idea what you're going on about :) Nov 29 10:43:23 but I'm off to bed anyway :) Nov 29 10:43:34 thanks Nov 29 10:43:49 i think it'll work! Nov 29 10:48:31 Hey, I have a scroll view consuming ontouch events/the fling gesture I'm using, is there an easy way to fix this? Nov 29 11:06:06 hi Nov 29 11:06:26 how ppl catch headphone button? Nov 29 11:09:44 nvm figured it out Nov 29 11:10:44 zbcm ? Nov 29 11:11:07 I asked a question earlier, not talking to you :) Nov 29 11:11:14 and sorry I can't help you. Nov 29 11:11:18 No idea Nov 29 11:11:28 pls help! Nov 29 11:15:06 I have no idea :x Nov 29 11:20:15 monkeyisl: prob input jack methods? Nov 29 11:21:06 lasserix_ : what is that?... i'm newbie. is there any web doc that you're talking about? Nov 29 11:22:29 no idea but i i imagine there is sys broadcast event for plugging i n headphones? Nov 29 11:23:01 is '_' a special character for android sqlite for a column ? Nov 29 11:23:14 I have a column _id and another _sid and it seems to raise an error Nov 29 11:23:22 (for _sid) Nov 29 11:26:19 apparently it is not the problem :) Nov 29 11:27:59 monkeyisl, "headphone button"? as in media buttons as part of headphones like most bluetooth headphones have? Nov 29 11:28:09 Zharf : yes Nov 29 11:29:01 http://www.shopbot.ca/pp-plantronics-backbeat-go-2-plantronics-price-446828.html Nov 29 11:29:03 monkeyisl, Intent.ACTION_MEDIA_BUTTON Nov 29 11:29:06 something like that ..but with buttons. Nov 29 11:29:24 you need a broadcast receiver to listen to that Nov 29 11:30:16 ahh.. thank you! Nov 29 11:33:05 there's actually an article on d.android.com about how to use that if you need more help with it Nov 29 11:33:20 kk Nov 29 12:22:38 Does anybody else's IntelliJ have problems with appcompat themes? Nov 29 12:25:04 works for me Nov 29 12:25:11 hey guys, just wondering if anyone knows a decent framework or way of integrating an irc client into an android app? Nov 29 12:25:25 framework ? Nov 29 12:25:31 short of opening the web client in a browser i can't see an easy way which won't involve lots of work Nov 29 12:25:33 you mean library? Nov 29 12:25:41 sorry yes Nov 29 12:26:10 http://archive.oreilly.com/pub/h/1966 Nov 29 12:26:30 :D Nov 29 12:27:09 maybe this : http://jerklib.sourceforge.net/ Nov 29 12:27:34 first one looks like a bot not a client? Nov 29 12:27:42 what's the difference ? Nov 29 12:28:02 http://jerklib.wikia.com/wiki/JerkLib_Wiki Nov 29 12:28:03 i want a client, so that the user can log into our irc server through the app, and type and join channels and all that jazz Nov 29 12:28:05 this looks nice Nov 29 12:28:17 jimmycarr: bot is the same as client Nov 29 12:28:52 surely not..? a bot doesn't require a ui Nov 29 12:29:26 how do you gonna do it? Nov 29 12:29:36 you need that lib and your own Service class Nov 29 12:29:57 so you need some sort of communication with that Service only Nov 29 12:30:26 EventBus or intents Nov 29 12:30:57 i was hoping there might be something already existing that we could use or modify slightly but i haven't found anything Nov 29 12:31:06 we can implement our own though, and jerklib looks pretty good for that Nov 29 12:31:13 thanks :) Nov 29 12:38:12 np Nov 29 12:49:12 Hi. I have error with building with Gradle (command-line) Nov 29 12:49:14 Could not create plugin of type 'AppPlugin'. Nov 29 12:49:20 Searched StackOverflow, tried 3 solutions Nov 29 12:49:22 But no-one worked. Nov 29 12:54:30 That is unfortunate. Nov 29 12:56:26 i remember note 2 had a feature where if the screen was on lock and the phone was plugged in and you waved your hand across the front face it would give you weather and a clock like a 3 second peek Nov 29 12:56:27 does anyone remember what it was called Nov 29 13:08:12 How do I make a version of my theme that is the same but without an actionbar? Nov 29 14:18:39 Hi. Is the way to make SwipeViews work with Android 2.2 ? (I get call requires API level 11, current min is 4 error) Nov 29 14:19:25 support-lib Nov 29 14:23:36 Ashiren: I should change v4 to v13 for example ? Nov 29 14:31:33 Wow, 2.2 might be difficult Nov 29 14:31:54 I'm wondering how to do tabs "right" with appcompat Nov 29 14:33:12 I need 2.2 support, but I want SwipeViews. Any good alternative, or hack to do this ? Nov 29 14:34:36 hi, has anyone tried to make an android wear action, that starts an IntentService with extra parameters? my service does not receive any parameters if a add them with putExtra to the PendingIntent Nov 29 14:36:39 is it just me, or is this android tutorial completely out of date? https://developer.android.com/training/index.html Nov 29 14:39:09 Sonderblade: Looks like it's from around 3.0 Nov 29 14:39:23 I think it probably still applies Nov 29 14:40:37 how sloppy of google not to keep it up to date Nov 29 15:07:06 I can start a browser instance from my app via Intent browserIntent = new Intent(Intent.ACTION_VIEW, Uri.parse("url"); Nov 29 15:07:20 i than get a prompt, that asks me which browser i would like to use Nov 29 15:07:46 How do i tell android that its a video stream and i would like to use a video player and not a browser to open it? Nov 29 15:10:17 http://developer.android.com/guide/components/intents-common.html#Music Nov 29 15:16:46 jiox: perfect :) Nov 29 15:20:23 How do I put tabs in a "Toolbar"? I'm really struggling. Nov 29 15:35:07 Hello. Nov 29 15:35:52 I am developing a library which is in he build path of an application I am developing. I am developing on both the library and the application. Nov 29 15:37:31 When I run the application, the library is built also, however for some reason the .jar file does not appear in the application libs directory, I have to after each build put the new jar in there else the application will halt with Logcat NoClassDefFoundError Nov 29 15:38:30 Is the the lib not suppose to automatically be part of the application ? Nov 29 15:43:40 hello Nov 29 15:46:23 How do I get the text to be in the middle of a view? Nov 29 15:46:29 Of itself. Nov 29 15:46:31 In a textview Nov 29 15:46:36 how hard can it be? Nov 29 15:47:54 Ok got it. Nov 29 15:47:55 very easy, android:gravity="center" Nov 29 15:47:55 in your xml or programmatically with setGravity Nov 29 16:03:51 I created an action bar refresh item, and in the onOptionsItemSelected, whenever the refresh button is clicked, I make an http call which updates an arraylist, and then uses an arrayadapter to display the updated arraylist in a listview. however, what i have noticed is that, although the refresh button makes the http call, the listview is only updated every other click. Nov 29 16:09:56 in app.gradle, how to get the current flavor being built? Nov 29 16:35:47 I'm trying to start a new project in android studio and gradle keeps getting stuck, forever Nov 29 16:45:02 is there some premade linux image for android development? Nov 29 16:56:23 Hello Nov 29 16:56:30 ohayou Nov 29 16:56:39 i have installed dropbear but cant login :/ Nov 29 16:57:05 is this the right place? Nov 29 17:00:44 killall: try #android or #android-root. This is an application development channel Nov 29 17:00:56 sonOfRa: thanks :) Nov 29 17:18:06 Does android:installLocation="auto" mean that it can ONLY install on an SD card, even if there is no SD card? I'm getting "Failure [INSTALL_FAILED_MEDIA_UNAVAILABLE]" when trying to install after setting it... Nov 29 17:31:21 Cyp___: is the package currently installed? Nov 29 17:33:08 Napalm: Yes. Nov 29 17:34:22 that could by why Nov 29 17:34:29 try a fresh install Nov 29 17:36:20 I have an app with installLocationm="auto" and don't have the problem you describe Nov 29 17:38:10 Ashiren: it's night... Nov 29 17:38:17 not good time for ohayou ;) Nov 29 17:38:42 Napalm: Thanks. After uninstalling it, I could reinstall it, but only once, then it gives the same error again. Would be good if not having to uninstall completely each time... Nov 29 17:40:09 this is driving me insane, now the gradle log has this " Unable to establish loopback connection" Nov 29 17:41:57 DemonOne: its because you are using a global gradle instance rather than the wrapper Nov 29 17:42:22 Napalm: it doesn't work with the deafult wrapper either... let me try again Nov 29 17:44:05 And why does adb uninstall say "Failure" when trying to uninstall? Nov 29 17:44:21 (Even when uninstalling an old version without installLocation="auto"?) Nov 29 17:45:01 Napalm: I get the same error with the default gradle Nov 29 17:45:21 check your running processes Nov 29 17:45:29 make sure you dont have a demonized version of gradle running Nov 29 17:45:35 Napalm: I'm on windows Nov 29 17:45:36 or a "stuck" process Nov 29 17:45:42 DemonOne: and? Nov 29 17:45:58 Napalm: no gradle process or java process running Nov 29 17:46:10 Huh? I tried installing two times in a row, quickly. The first time failed with Failed [INSTALL_FAILED_MEDIA_UNAVAILABLE], the second time said Success? Nov 29 17:46:48 weird Nov 29 17:47:38 hey napalm Nov 29 17:47:47 isn't it Nov 29 17:48:01 hey g00s Nov 29 17:48:34 I Was told I can use --no-daemon for gradle, but putting that in the gradle global VM args didn't work Nov 29 17:51:31 anybody know how to get rxjava .cache() behavior, but only retain the last element ? under the hood, the .cache() Subscription uses a ReplaySubject - this has a # of ctors allowing bounded / unbounded operation. but the .cache() operator doesn't use them Nov 29 17:51:44 even .cache(n) is only a hant to the unbounded mode Nov 29 17:51:50 *hint Nov 29 17:53:25 g00s: why not do a flatMap before? Nov 29 17:54:08 i'm using this as the result of a query operation which only the last item is important . the fragment re-attaches to the cache Nov 29 17:54:35 if the data is updated, a new value is emitted - nobody would be interested in old values Nov 29 17:55:17 pfn: I tried small parser project with scala today Nov 29 17:55:24 I love scala test :) Nov 29 18:00:24 hm, maybe this isn't going to work. i have no way to close the cursor Nov 29 18:01:54 * g00s was tring to get loader behavior w/o using loader :) Nov 29 18:50:19 JacobTabak you around ? Nov 29 18:50:25 yo Nov 29 18:51:14 hey JacobTabak , happy thanksgiving :) quick q - did you ever use the rx .cache() operator on an operation that emitted multiple items? i just wanted to cache the last one, can't figure it out unless i copy/paste the code and make some changes Nov 29 18:51:28 i think you should just use a behavior subject Nov 29 18:51:34 gordon_, it's pretty nice Nov 29 18:52:00 JacobTabak hm. cache() uses replaySubject() Nov 29 18:53:24 JacobTabak trying to reproduce loader behavior with rx Nov 29 18:53:42 i'm doing it with behavior subject Nov 29 18:53:46 i mean Nov 29 18:53:49 using cursors ? Nov 29 18:53:58 problem is lifecycle, closing them, etc. Nov 29 18:54:03 no, not with cursors Nov 29 18:57:26 pfn: robolectric with scala test and sbd ~ test FTW Nov 29 18:57:30 will try later on Nov 29 18:58:38 gordon_, robolectric doesn't work out of the box as I understand it... Nov 29 18:59:46 pfn: can you specify order on classpath with sbt ? Nov 29 19:03:11 * OverCoder is being drove crazy Nov 29 19:04:30 I'm trying to NotificationManager.notify() depending on what user clicks in a a dialog, if i did this in the onClickListener() i get Cannot make a static reference to the non-static bla bla, so what can i do about that? Nov 29 19:04:56 gordon_, dunno, haven't tried it since 1.x, it's changed a lot since then Nov 29 19:05:21 it used to require a custom test runner Nov 29 19:05:27 dunno if that's still true Nov 29 19:05:51 https://www.youtube.com/watch?v=BQJtV_YLuNE Nov 29 19:05:54 :) Nov 29 19:11:06 adb isn't recognising my Nexus 9 :/ can't work out what stupid thing I've missed Nov 29 19:15:29 not installing the drivers on windows Nov 29 19:17:23 OverCoder: Your DialogFragment calls back to the activity (via the listener pattern); the activity calls someNotificationManager.notify(). Nov 29 19:17:44 mhmm Nov 29 19:17:49 Thanks Nov 29 19:19:29 Estel did you turn on developer mode Nov 29 19:19:33 on the tablet Nov 29 19:19:58 Yes. I'm looking into the drivers now, though I've nevver had to do anything nifty with Nexus stuff before Nov 29 19:23:11 Hello! Can I make two fragments, each with a listview, scroll together? I've tried at least two methods but worked out so far. The end goal is to make a layout which show those two listfragments as two columns on a tablet (which works) but make them scroll vertically one over another in portrait mode (which I can't get working) Nov 29 19:24:15 Estel: what OS do you use on your develpoment machine/ Nov 29 19:24:16 ? Nov 29 19:24:41 This is Win 8.1. Fixed now, issue was related to http://stackoverflow.com/questions/25327339/ Nov 29 19:25:08 icedp: https://github.com/slightfoot/android-tandem-scroll Nov 29 19:25:19 that should help, problems with the code.. let me know Nov 29 19:30:38 Napalm: Sorry, maybe I wasn't clear. I want not the behavior you link to (though it's interesting lib). I want the two fragments to scroll together as as in: [a b c] -> [b c 1] -> [c 1 2] -> [1 2 3] (first fragment containing listview with a letters, second - with numbers Nov 29 19:31:27 hi, does someone know how android 5 determines if a notify is a message in priority mode? Nov 29 19:32:11 icedp: i dont understand what your asking for. perhaps draw some pictures Nov 29 19:32:26 appel1: the priority flag Nov 29 19:32:27 icedp, https://github.com/pfn/android-tvm/blob/master/src/main/scala/MainActivity.scala#L822 Nov 29 19:32:30 ah setCategory apparently Nov 29 19:32:35 apollo13: ^ Nov 29 19:33:15 apollo13: http://developer.android.com/reference/android/app/Notification.html#priority Nov 29 19:33:22 Napalm: thanks, according to https://developer.android.com/about/versions/android-5.0.html it is setCategory -- will try setting that to message Nov 29 19:33:28 icedp, port to java as necessary Nov 29 19:33:44 pfn: port what? Nov 29 19:33:47 Napalm: hmm, sure that priority affects the silent mode? Nov 29 19:33:53 oh Nov 29 19:33:56 ignore that Nov 29 19:34:29 I've set interuptions to messages & calls, no I need to figure out how to make my notifies messages, http://developer.android.com/reference/android/app/Notification.html#CATEGORY_MESSAGE seems to be a good first guess Nov 29 19:34:38 Napalm, my link above Nov 29 19:34:55 apollo13: you want this http://developer.android.com/reference/android/app/Notification.html#visibility Nov 29 19:35:24 Napalm: no, I am talking about the new silent mode, where android won't notify you unless you get a call or sms Nov 29 19:35:53 pfn: he's already got my code that does that.. he wants something else apparently Nov 29 19:35:56 Napalm: see the notification metadata section on https://developer.android.com/about/versions/android-5.0.html#Notifications Nov 29 19:36:28 apollo13: thats priority Nov 29 19:37:01 oh wait Nov 29 19:37:02 "setCategory(): Tells the system how to handle your app notifications when the device is in priority mode (for example, if a notification represents an incoming call, instant message, or alarm). " Nov 29 19:37:16 we seem to be talking about different things, or I am stupid :) Nov 29 19:37:31 apollo13: oh wait.. you mean the "pop over" notifications Nov 29 19:37:33 ? Nov 29 19:38:13 Napalm: no, I mean the things you can configure in settings -> sound & notifications -> interruptions -> priority interruptions Nov 29 19:38:32 where you can configure your phone to only alert you for calls&messages from starred contacts Nov 29 19:38:50 apollo13: yes thats, a mixture of the 3 Nov 29 19:38:51 I think setCategory will allow my app to tell android that this is an sms Nov 29 19:39:36 yes, but it wont pop-over in front of the user without it being high-priority Nov 29 19:39:44 that is okay Nov 29 19:41:03 I wonder when the next lollipop update will be, this current memory management kinda sucks Nov 29 19:41:39 pfn: oh? I noticed my music player crashing when firefox has opened a few pages :) Nov 29 19:42:39 yeah, I have 500mb to 1gb free ram and stuff gets evicted out of memory too easily Nov 29 19:42:43 pfn: dont you believe its mainly an app thing.. too many apps not paying attention to the low mem warnings and cleaning up Nov 29 19:42:58 music player, irc, home launcher Nov 29 19:43:03 pfn: ah, perhaps thats a different problem Nov 29 19:44:16 pfn: I've seen this since the preview Nov 29 19:44:39 apollo13, indeed, I never ran preview Nov 29 19:45:03 it's a bit annoying, but I still 😍 🍭 anyway Nov 29 19:45:19 ♥ Nov 29 19:45:33 hmm heart emoji is ugly Nov 29 19:47:05 Napalm would you use that technique SharedPreferencesImpl uses with ActivityThread blocking on QueuedWork in onDestryoy in your own code? Nov 29 19:47:42 I cant remember what I wont about that now Nov 29 19:47:43 lol Nov 29 19:48:09 It was to guarentee something gets executed at a later date right? Nov 29 19:48:13 something along those lines Nov 29 19:48:25 Napalm when you want to make sure an async disk write completes even if activity is destroyed :) Nov 29 19:48:37 well, blocking keep sit from getting destroyed XD Nov 29 19:49:53 sadly, QueuedWork is an internal class :( Nov 29 19:50:03 so you can't add your own goodies to it Nov 29 19:50:16 reflection baby Nov 29 19:50:30 g00s, wrap it in a service, duh Nov 29 19:50:45 start a service on destroy if work is outstanding Nov 29 19:50:51 JacobTabak - JakeWharton had you in mind when making those private ctors throw exceptions :) Nov 29 19:50:53 stop service when work is complete Nov 29 19:51:22 what are you referring to Nov 29 19:51:29 oh Nov 29 19:52:16 i don't remember the commit heh. i was thinking, ok its crazy time when you have to ensure the library works against all abuses of reflection Nov 29 19:54:34 that's pretty lame Nov 29 19:54:46 if a user wants to reflect your api let them Nov 29 19:54:58 if it crashes in the future, fuck them Nov 29 19:56:01 I feel like that about final classes. If someone wants to subclass something that wasn't designed to be subclassed, let them. It's their problem if their code breaks. Nov 29 19:56:12 yeah. in general , make it hard for people to use the api wrong - thats why ctor is private, but once they resort to reflection all bets are off Nov 29 19:58:19 I have a fragmentActivity that is being used to display a list of images (the user presses on an image from the list in the previous Activity and gets to this fragment Activity) Nov 29 19:58:48 I am having trouble passing the position of the item that was pressed because in the fragment activity's adapter, I'm sending the position to the fragment inside the adapter's getItem Nov 29 19:59:03 so it sends 0, 1, 2 etc... because I am using the position from getItem() Nov 29 19:59:41 so basically whichever picture I press on, the activity loads all pictures, beginning with the first Nov 29 19:59:52 I want it to load all pictures, beginning with the one I pressed Nov 29 20:03:03 Odaym: because views are recycling perhaps Nov 29 20:03:30 well getItem() gets called as much as there are pictures, even when you havent scrolled to any others Nov 29 20:04:00 or if I send the position from the activity to the fragment activity to the fragment, I get all the pictures of the same index repeated Nov 29 20:04:08 I do land on the one I want at the beginning, though Nov 29 20:04:14 hello. Is it possible to get area of screen (coordinates) which is covered by button? Nov 29 20:04:40 I guess inside...I can do myPosition - 1 or + 1 somewhere, but I dont want to get into detecting when swipe was done, it needs to handle this Nov 29 20:10:24 slani: try view.getLocationOnScreen() Nov 29 20:10:37 Odaym: maybe show code and someone could help you ) Nov 29 20:10:58 its not like 1 page Nov 29 20:11:37 plus its going to be 10 minutes of talking about things in the code that have nothing to do with the problem before anything is said about the problem Nov 29 20:11:38 :P Nov 29 20:12:58 Odaym: debug then ) determine whether you get the position wrong or it gets passed to the fragment wrong or fragment use it wrongly Nov 29 20:13:10 it's the passing, the passing is done in the wrong method Nov 29 20:13:55 I'm trying to use a listview I put on my activity from the code, how do I get android studio to create the definition for it? Nov 29 20:17:26 androidStudio.writeMyApp(ListView v); Nov 29 20:17:35 or dont pass anything and it will write the whole app Nov 29 20:17:41 see docs Nov 29 20:20:05 yes, because getting a definition of a component without having to write the stub yourself is exactly that Nov 29 20:23:11 I dont even know what you asked, just trolling Nov 29 20:23:16 oh Nov 29 20:23:18 hemad Nov 29 20:23:21 isorry Nov 29 20:23:27 Napalm: That wrapper pattern is so cool. :) I can now have headers/footers without pain. Thanks! Nov 29 20:23:34 I don't think I would've thought of it if you hadn't said. Nov 29 20:23:46 Maybe if I'd spent hours messing around with custom headers/footers. Not sure, though. Nov 29 20:24:18 Napalm: I modified it for simplicity: my wrapper class extends BaseAdapter (but has a constructor that takes a ListAdapter to wrap). Nov 29 20:30:07 TacticalJoke: its not that simple Nov 29 20:30:54 TacticalJoke: if you do it that way you need to have an internal DataSetObserver that monitors the ListAdapter given to it and will notify the BaseAdapter's listeners when the data changes Nov 29 20:31:11 TacticalJoke: at the moment, if your wrapped adapters data changes it will not show on the UI properly Nov 29 20:31:37 TacticalJoke: because the ListView is only subscribed to your Wrapper Adapter and not the Wrapped Adapter Nov 29 20:34:58 Napalm: Hmm. I was planning to get around that by keeping hold of the wrapper adapter and calling notifyDataSetChanged on that. Nov 29 20:35:02 Won't that work? Nov 29 20:35:14 Like, manually change the list and then call wrapperAdapter.notifyDataSetChanged. Nov 29 20:35:22 any way to hide the bottom menu? it becomes redundant when you use an actionbar at the top Nov 29 20:35:41 Sonderblade: The menu button to the right of the three navigation buttons? Nov 29 20:37:58 TacticalJoke: no. it's a bar with an overflow menu on top of it Nov 29 20:38:13 What is your targetSdkVersion? Nov 29 20:38:24 11 Nov 29 20:38:45 hmm Nov 29 20:38:56 Set is >= 14 Nov 29 20:39:00 target should be highest, 21 Nov 29 20:39:07 Sonderblade: It's a compatibility behaviour. Nov 29 20:39:10 and minimum should be 11 or whatever you want Nov 29 20:39:37 The documentation is here: http://developer.android.com/reference/android/os/Build.VERSION_CODES.html#ICE_CREAM_SANDWICH Nov 29 20:39:48 when setting a notification icon with .setSmallIcon(int icon)...where do i put this image file for the notification? Nov 29 20:39:56 https://www.youtube.com/watch?v=Othc45WPBhA WAT :D Nov 29 20:39:58 in which folder in order to access it via R??? Nov 29 20:40:12 WATBAT Nov 29 20:40:24 Hi Nov 29 20:40:26 Napalm: Is it sufficient for me to call wrappedAdapter.notifyDataSetChanged after changing the underlying list myself? Nov 29 20:41:05 If I have a private variable in my activity, when will it be null? Nov 29 20:41:35 TacticalJoke: no, infact thats horrible Nov 29 20:41:47 MalekAlrwily: When the activity is first created (including after a rotation change) or when you set it to null. Nov 29 20:42:41 TacticalJoke: Will not it be null if my activity destroyed?\ Nov 29 20:42:54 Napalm: You keep telling me stuff is bad or doesn't work without telling me why. :p Nov 29 20:43:25 As I said, create a private internal DataSetObserver and subscribe the WrapperAdapter to the WrappedAdapter.. in onChanged call notifyDataSetChanged(); and in onInvalidate call notifyDataSetInvalidated(); Nov 29 20:43:37 TacticalJoke: i was getting there :P Nov 29 20:43:40 Okay. lol Nov 29 20:44:06 TacticalJoke: Thank you :D Nov 29 20:44:20 Napalm: That sounds messy. With *your* code, would I have to do all that? Nov 29 20:44:48 TacticalJoke: its not messy. Nov 29 20:44:51 MalekAlrwily: If it's an instance field, there is no 'it' to speak of after the instance has been collected. Nov 29 20:45:45 TacticalJoke: this way the notification bubbles up, if the Wrapped Adapter calls its own notifyDataSetChanged(); the Wrapper Adapter gets notified and it can notify its listeners Nov 29 20:46:22 Napalm: If I used your code, would I have to do this? Nov 29 20:46:26 ok my problem is that I am expecting an adapter to load items beginning with item number X Nov 29 20:46:27 (Just so I can follow what you're saying.) Nov 29 20:46:29 this cannot be done Nov 29 20:46:30 TacticalJoke: weird, changing targetSdkVersion to 21 fixed it Nov 29 20:46:31 TacticalJoke: and no, the example I showed you was to allow the register and unregister to fall through to the base.. but then you cant notifyDataSetChanged from the WrapperAdapter Nov 29 20:46:37 Sonderblade: Expected. Nov 29 20:46:41 it's always going to load all the items beginning from the very first one Nov 29 20:46:45 Sonderblade: http://developer.android.com/reference/android/os/Build.VERSION_CODES.html#ICE_CREAM_SANDWICH Nov 29 20:46:52 you cannot feed it any specific number else it will always load that one Nov 29 20:47:24 like if you say inside, "for every item (i.e. code in CreateView of a fragment) load this image of index X" you will always get that image Nov 29 20:47:40 Odaym: it sounds to me like you have other issues Nov 29 20:47:47 so how do I start that adapter with the picture I clicked on? how can I say that just once, load the image with the number that I have, then go about your business Nov 29 20:47:50 Napalm: Okay. I don't mind if I can't notifyDataSetChanged from the wrapper. Nov 29 20:48:05 Odaym: its nothing to do with the Adapter.. its the View Nov 29 20:48:15 yea yea, the view Nov 29 20:48:27 but the number is being passed from the adapter that says return new Fragment, in its getItem() Nov 29 20:48:51 otherwise it will crash saying that fragment is already added, so you have to instantiate it anew every time Nov 29 20:48:57 Sonderblade: The TL;DR is that if you target too low then Android assumes that your app relies on a hardware menu key and so presents a menu button in that general area on the screen. Nov 29 20:49:07 Sonderblade: It's a compatibility behaviour. Nov 29 20:49:24 Sonderblade: Target as high as you can. Nov 29 20:49:47 TacticalJoke: does that page say anything about the bottom bar? i dont see it there Nov 29 20:50:01 "For devices without a dedicated menu key, the software compatibility menu key will not be shown even on phones. By targeting Ice Cream Sandwich or later, your UI must always have its own menu UI affordance if needed, on both tablets and phones." Nov 29 20:50:48 ("The ActionBar will take care of this for you.") Nov 29 20:51:44 Anybody know where in which folder I have to store notification icons (for usage in Notification.Builder.setSmallIcon())????? Nov 29 20:52:33 in the usual folders Nov 29 20:52:46 where you store everything else Nov 29 20:53:10 hint: drawable-*dpi Nov 29 20:54:19 sorry I got disconnected Nov 29 20:54:56 it's impossible to do it in this way Im trying Nov 29 20:56:01 AH! Nov 29 20:56:44 Odaym: you really need to explain what your trying to achieve Nov 29 20:56:58 no, that won't work either, if you pass the final path from the adapter's getItem, that method is still going to be called as many times as the number of objects and you end up with the same image repeated Nov 29 20:57:15 I did Napalm Nov 29 20:57:24 somewhere above Nov 29 20:57:38 fragment activity showing many images Nov 29 20:57:47 well I read it and I still dont get what the hell your trying to do Nov 29 20:57:49 beginning with the image I pressed on, back in the listview Nov 29 20:57:50 so explain again Nov 29 21:00:05 http://pastie.org/9751128 Nov 29 21:01:48 Napalm: I'm thinking that your solution is way simpler. I also don't need to notifyDataSetChanged from the wrapper. The wrapper will exist only to allow headers/footers. Nov 29 21:02:02 In fact, most of my code won't even be aware of the wrapper. Nov 29 21:02:19 Kinda like with ListView.addFooterView wrapping the adapter privately. Nov 29 21:03:42 Actually, now that I think of it, I might need to. I need to add/remove headers/footers. Hmm. Nov 29 21:04:44 TacticalJoke: Do you want a solution for this? Nov 29 21:05:12 Is it really complex? :D Nov 29 21:05:18 If it is, don't worry. Nov 29 21:08:36 line 36 of that paste is wrong, sorry, just wrote it again as I was pasting Nov 29 21:08:50 Napalm: To be honest, I can't see what's wrong with something like this: this.wrapperAdapter = new WrapperAdapter(this.actualAdapter); listView.setAdapter(this.wrapperAdapter); Nov 29 21:08:55 should be bookmarks.get(positionFromAdapter).getImagePath() Nov 29 21:08:59 Then, if I wanna do anything with actualAdapter, I go through wrapperAdapter every time. Nov 29 21:08:59 TacticalJoke: no, its not complex Nov 29 21:09:07 Napalm: Okay, sure. If you don't mind. :) Nov 29 21:09:31 I have to sort some other things out, so you'll have to wait Nov 29 21:09:57 Napalm bubble sort ? Nov 29 21:10:07 I like the sleep sort. Nov 29 21:10:09 :D Nov 29 21:10:11 you are sorting bubbles again .... Nov 29 21:10:16 g00s: wat? Nov 29 21:10:28 :D Nov 29 21:10:31 The sleep sort avoids code duplication. Nov 29 21:11:51 ValueAnimator is awesome :) Nov 29 21:21:54 any idea? Nov 29 21:22:01 I am hope.less() Nov 29 21:22:20 it's like Im flipping the numbers around and getting back the same result haha Nov 29 21:22:26 feels stupid Nov 29 21:23:02 If that pastie is supposed to describe your issue, you suck at describing issues Nov 29 21:23:28 no the pastie is just code, I expected Napalm to ask Nov 29 21:23:42 the issue is at the Picasso line in the pastie, where I use the index to get the image I want to load Nov 29 21:23:46 You're expected to properly explain your issue Nov 29 21:23:58 that index needs to start at a number that I get from the listview's onItemClickListener Nov 29 21:24:25 I pass it to the fragmentActivity, then from there to the Fragment itself, and use it in the fragment's getView(), where I cannot because I will always get that number Nov 29 21:24:27 Odaym, nope, adapter views do not load every view starting at the beginning Nov 29 21:24:35 they load whatever is visible Nov 29 21:25:53 TacticalJoke, having your wrapped be aware of your wrapper is smelly Nov 29 21:26:46 pfn: wat? its what the platform does Nov 29 21:26:50 Yeah, I was just gonna have the activity (or whatever) be aware of the wrapper. Nov 29 21:27:00 double wat Nov 29 21:27:02 lol Nov 29 21:27:06 lol Nov 29 21:27:16 the wrapped is not aware of the wrapper in platform Nov 29 21:27:29 And then the List gets updated and the Activity calls wrapper.NotifyDataSetChanged. Nov 29 21:27:36 you can set a dataset observer on it, but the adapter doesn't know about the erappert Nov 29 21:27:39 wrapper Nov 29 21:28:47 you could just set and forget the wrapper altogether and just retain the inner adapter Nov 29 21:29:19 the inner notifies which dispatches to the wrapper, and the wrapper dispatches its own notify Nov 29 21:29:44 based on being an observer of the wrapped Nov 29 21:31:59 So I guess we're talking about this idea: As I said, create a private internal DataSetObserver and subscribe the WrapperAdapter to the WrappedAdapter.. in onChanged call notifyDataSetChanged(); and in onInvalidate call notifyDataSetInvalidated(); Nov 29 21:32:14 I guess I might have to end up doing that. Nov 29 21:32:40 Because I just realised that my app does (of course) need to interact with the inner adapter. Nov 29 21:33:35 this might not be the place to ask, but when using a library that is distributed under the LGPL 2.1+ license, do i have to attach the library as a library or can I compile it myself as a part of my project? Nov 29 21:35:44 viran, you need to be able to provide components to any of your users so he can replace / modify the LGPL stuff and still link with your software into a working product Nov 29 21:35:54 which in practice means - probably not Nov 29 21:36:10 Hmm. HeaderViewListAdapter doesn't do the DataSetObserver thing. Nov 29 21:36:17 thanks Mavrik Nov 29 21:36:18 you can do what you want viran, as long as you provide the license, and the source code Nov 29 21:36:45 adq, uh, no. Not for LGPL. Nov 29 21:37:10 ahh sorry if i'm wrong if so Nov 29 21:37:38 "The main difference between the GPL and the LGPL is that the latter allows the work to be linked with (in the case of a library, 'used by') a non-(L)GPLed program, regardless of whether it is free software or proprietary software.[1] " Nov 29 21:38:07 here's a picture that illustrates what I'm having a problem with https://dl.dropboxusercontent.com/u/19390574/IMG_20141129_233441.png Nov 29 21:38:11 I, you, we should better read http://en.wikipedia.org/wiki/GNU_Lesser_General_Public_License :p Nov 29 21:38:31 (i'm avoiding any gpl as much as I can tbh) Nov 29 21:38:49 if i attach a jar to my project, will proguard optimize it? most of the stuff in the Jar are not being used in my code Nov 29 21:38:49 Odaym: 404. Nov 29 21:38:53 I want to use that position I grabbed from the listActivity to load the image of that index, when the viewpager (using fragments) loads Nov 29 21:38:59 oh, still synching, sorry Nov 29 21:39:03 1 second Nov 29 21:40:42 here's the image http://i.imgur.com/Bxvwrqa.png Nov 29 21:40:43 viran, proguard will not be enabled by default, if enable you can include exclude what you want Nov 29 21:40:59 but it's not as straight-forward as you think maybe (to deal with proguard) Nov 29 21:41:18 Whiteboard. ;o Nov 29 21:41:26 adq, yeah, any GPL is rather problematic in Android world Nov 29 21:41:40 that's why most libs are licensed under MIT Nov 29 21:41:48 yep, or apache Nov 29 21:41:59 i like MIT license, not very restrictive Nov 29 21:42:27 also CC-BY 3, despite it is less used for code than resources per example Nov 29 21:42:41 it's also easy to understand Nov 29 21:43:29 it's undoable man Nov 29 21:43:34 wrong approach I think Nov 29 21:44:21 Seems pretty basic Nov 29 21:44:28 is there a license that would allow me to take a provided code and intergrate it into my own code? not as an external package Nov 29 21:44:44 the requirement is, but the way it's written now there is no way to be able to tell the adapter start here Nov 29 21:44:51 its not how it behaves Nov 29 21:45:04 You don't tell adapters "where to start" Nov 29 21:45:09 the createview or the getItem, theyre both gonna get called as much as their are objects Nov 29 21:45:10 Adapters just provide the data it's asked Nov 29 21:45:20 there are* Nov 29 21:46:19 what can I do then to load the fragmentactivity at a certain image Nov 29 21:46:28 viran, any permissive license Nov 29 21:46:33 viran, Apache 2.0, MIT, BSD, etc. Nov 29 21:46:40 The adapter backed View decides what to show Nov 29 21:46:41 do I have to reorder the objects in the dataset? Nov 29 21:46:45 most of them will require you to add a contribution text tho Nov 29 21:46:46 So tell your ViewPager what position to show Nov 29 21:47:06 the createView in the Fragment's code? Nov 29 21:47:16 omg Nov 29 21:47:26 SimonVT: I told him that earlier.. Nov 29 21:47:32 no need to omg man Nov 29 21:47:39 lol Nov 29 21:47:52 If you want your viewpager to show position 10, tell it to show position 10 Nov 29 21:47:57 There are methods for that Nov 29 21:48:09 SimonVT: isnt he passing the wrong position to him fragments he creates aswell Nov 29 21:48:14 looked like it Nov 29 21:48:22 Napalm: I don't know what to do about this thing. :[ Nov 29 21:48:29 I have no idea, I saw code with no explanation Nov 29 21:48:39 It's like every possible solution has some horrible drawback. Nov 29 21:49:15 TacticalJoke: i just have to reboot.. i got a memory leak.. 25.6GB of RAM used... wtf? Nov 29 21:49:17 The lesser evil seems to be simply using ListView.addFooterView. Nov 29 21:49:20 Okay. lol Nov 29 21:49:29 TacticalJoke: when I come back, i'll take a look Nov 29 21:49:33 Thanks. Nov 29 21:51:22 TacticalJoke: you'll have to wait a moment, i'm just going to dump the indexes for my kernel memory see if I can locate the bad driver Nov 29 21:51:31 I think its Intel HAMX Nov 29 21:51:34 No worries. I'll be here for hours. :D Nov 29 21:51:37 or VirtualBox Nov 29 21:55:54 setCurrentItem did it Nov 29 21:55:58 thanks Simon Nov 29 21:56:26 needed a more explicit explanation of where the problem was Nov 29 21:56:37 "omg" wasnt very clear Nov 29 22:07:12 Anyone know where app compat stuff is done in eclipse? I wanted to try the v21 one Nov 29 22:10:30 Hmm, I'm thinking of just having my adapter implement headers/footers. Nov 29 22:10:36 Doesn't seem ideal, but it kinda makes sense. Nov 29 22:11:02 Feels like it violates the SRP, though. Nov 29 22:25:54 later Nov 29 22:26:49 dear all , i did install an app , now i am in bootloap , how can uninstall the app from bootloader by adb .. gt-i9300 Nov 29 22:30:22 I put a ListView on my activity, I can see it in the layout preview in android-studio, but when I run the app the listview is nowhere to be found Nov 29 22:31:47 hmm Nov 29 22:33:47 auto-layout? Sorry I'm a iOS developer mostly but that could be the answer Nov 29 22:33:57 android studio renders it perfectly well, but neither the emulator non my device show it Nov 29 22:34:41 Mallot1: I don't see anything about that, I've only started android development a few hours ago Nov 29 22:35:08 DemonOne: Welcome to android development then =D Nov 29 22:37:02 demon are you giving the listview data? Nov 29 22:37:04 Mallot1: thanks... ;) java already bit me as it constantly refused to use IPv4 for Gradle and SDK manager Nov 29 22:37:48 DemonOne: I am fairly new myself since I'm trying to port my C++ project to Android. I recommend Eclipse Luna Nov 29 22:38:13 with the Android SDK, NDK, ADT, and Support Library Nov 29 22:38:16 whatitis-: I gave it an array adapter, but shouldn't I atleast see it as it has a blue background and is quite huge? Nov 29 22:38:48 Mallot1: I went straight for android-studio as it's the future... Nov 29 22:39:06 depends if your adapter has data, and if not and you have listview wrap content Nov 29 22:39:38 DemonOne: I did to I switched because of the lack of support online. I still use both now and then, To each his own =) Nov 29 22:39:40 whatitis-: I see, I might've messed up the way I the adapter is created Nov 29 22:43:55 im trying to create an application with api 21, and im trying to change the action bar color, but it is not working Nov 29 22:44:16 im customizing the bae application theme under styles.xml Nov 29 22:44:36 and im adding the colorPrimary attribute, but i see no change in my app Nov 29 22:48:48 whatitis-: my app crashes now, after I thought I fixed it Nov 29 22:50:06 whatitis-: it happened when I actullay gave AdapterArray my List as the 3rd arguemnt, and then fed it to the listview Nov 29 22:50:19 Check out the stack trace in LogCat. Nov 29 22:53:05 hi Nov 29 22:53:23 Hey guys, should I use android studio or eclipse to build the most basic web browser app? Nov 29 22:53:24 when i look at the navigation drawer example in eclipse/adk, i notice it has a TextView in fragment_main.xml. But I launched this example and it does absolutely nothing, it's as if it weren't there. So why have they included it? its id is section_label: android:id="@+id/section_label" Nov 29 22:53:48 I want it to work on all devices obviously Nov 29 22:54:07 It will be an app for a web app I have Nov 29 22:54:21 basically Nov 29 22:54:41 android studio is eclipse Nov 29 22:54:43 so there you go Nov 29 22:54:58 cheater, what do you mean Nov 29 22:55:53 Android Studio and Eclipse are different. Nov 29 22:55:57 Android Studio is basically IntelliJ. Nov 29 22:56:02 But with changes, I guess. Nov 29 22:56:28 TacticalJoke, what do you think I should use Nov 29 22:56:38 CapnKlutch: Both will work. Android Studio is the future. (Though I prefer Eclipse because I'm doing JVM unit testing.) Nov 29 22:56:46 (Also because Eclipse is way faster here.) Nov 29 22:57:14 TacticalJoke, thanks I'll try both I guess in that case Nov 29 22:57:18 Few people seem to agree about Eclipse being faster than Android Studio. Nov 29 22:57:36 its more about gradle on wimpy machines Nov 29 22:57:45 If Android Studio works for you, I would recommend that (because all the development effort is going into Android Studio now). Nov 29 22:58:00 I'm gonna move to AS when I can. Nov 29 22:58:10 Yeah, I suspect it's Gradle. Nov 29 22:58:46 CapnKlutch: A third option is IntelliJ. It supports Android development out of the box. Nov 29 22:59:39 Android Studio is (as far as I can tell) IntelliJ with a purely Android focus. It's very similar, at least in the Android functionality. Nov 29 23:00:16 guys, i want to run my service in a separate thread? Nov 29 23:00:25 CapnKlutch: The TL;DR is probably "use Android Studio if it works for you". Nov 29 23:00:32 i heard that IntentService runs on different thread but i get NetworkonMainThreadException Nov 29 23:03:32 oh, sorry, i thought android studio was the same as android sdk Nov 29 23:03:42 but android sdk uses eclipse... does that mean android sdk is crappy now? Nov 29 23:04:22 Android Studio and Eclipse are IDEs. They both interact with the Android SDK. Nov 29 23:04:36 wait.. Nov 29 23:04:40 what did i download then? Nov 29 23:04:41 has anyone worked with styling the actionbar in api 21? Nov 29 23:04:41 You might be confusing "SDK" and "Android Developer Tools". The latter is an Eclipse plugin. Nov 29 23:04:49 "adt bundle" is what i got. Nov 29 23:05:02 That's Eclipse + Android Developer Tools (+ Android SDK?). Nov 29 23:05:07 ok. Nov 29 23:05:10 and that's crappy now? Nov 29 23:05:17 i should be using intellij? Nov 29 23:05:22 is intellij free? Nov 29 23:05:28 android studio ftw Nov 29 23:05:42 Android Studio (which is basically IntelliJ) is what they're focusing on now. Nov 29 23:05:47 "they"? Nov 29 23:05:56 well <3 Eclipse Nov 29 23:06:05 The people developing Android tools. Nov 29 23:06:05 RIP Eclipse Nov 29 23:06:09 it's one ide for almost everything Nov 29 23:06:10 so guys... Nov 29 23:06:13 OverCoder: I'm sticking with Eclipse for now. :D Nov 29 23:06:16 <3 Eclipse Nov 29 23:06:17 #yolo Nov 29 23:06:25 me too Nov 29 23:06:31 D: Nov 29 23:06:36 I'd jump ship to Visual Studio if I could. Nov 29 23:06:42 Maybe one day we'll be able to. Nov 29 23:06:45 anyone know why there is that text view in the navigation drawer layout? Nov 29 23:06:49 i get some really sweet graphical errors when i leave an immersive activity on lollipop Nov 29 23:06:53 greeeeaaaaat. Nov 29 23:07:15 id is "@+id/section_label" Nov 29 23:07:28 can anyburdy please halp with action bar styling? pls. pls respond. Nov 29 23:08:44 I think the Android team doesn't like our lives to be boring. Various landmines are scattered around Android. Nov 29 23:09:09 TacticalJoke: are you talking about that textview? Nov 29 23:09:12 mantazer: Just ask your question. Nov 29 23:09:30 cheater: No, but I'm open to that qualifying. Nov 29 23:09:41 ok. Nov 29 23:09:51 mantazer: make sure youre using am appcompat base theme and use colorprimary/colorprimarydark Nov 29 23:10:04 * OverCoder slaps himself Nov 29 23:10:07 dbrosyth: the dev tutorial doesnt mention appcompat base theme Nov 29 23:10:07 and then grab your toolbar and set it as the support actionbar Nov 29 23:10:10 i'm off guys Nov 29 23:10:19 cya Nov 29 23:10:21 and thanks Nov 29 23:10:23 kk Nov 29 23:10:27 guuuys i want to run a service on a separate thread Nov 29 23:10:28 Did you get your answer, cheater? Nov 29 23:10:32 .-. Nov 29 23:10:34 I was joking about that qualifying as a landmine. Nov 29 23:10:53 OverCoder: Services always "run" on the main thread. But Services can start their own threads Nov 29 23:11:05 o Nov 29 23:11:10 ListView id... is there an easier way to just display strings in a list view? Nov 29 23:11:12 * OverCoder is happy and codes Nov 29 23:11:43 my adapter was crashing the app since it didn't have a TextView id Nov 29 23:12:17 You could give it android.R.layout.simple_list_item_1, just for testing or whatever. Nov 29 23:13:00 It's nice to define our own layout for the adapter, though. Then we get total control over how stuff looks. Nov 29 23:14:03 TacticalJoke: thanks, trying that now Nov 29 23:14:15 simple_list_item_1 is just a TextView, basically. Nov 29 23:14:26 TacticalJoke: I understand it giving control, but for now it's just holding me back Nov 29 23:14:41 TacticalJoke: cool, it worked Nov 29 23:14:55 DemonOne: Also, it's nice to subclass BaseAdapter rather than use ArrayAdapter. Nov 29 23:14:57 The latter sucks. Nov 29 23:15:01 But you might not be ready for that yet. :) Nov 29 23:15:55 I'm just trying to make this stupid app for a simple demo at work Nov 29 23:16:54 I can't beleive java messed me up with that stupid force ipv4 thing Nov 29 23:17:10 Okay. ArrayAdapter should be fine for that. Nov 29 23:17:17 What IPV4 thing? Nov 29 23:18:32 this: -Djava.net.preferIPv4Stack=true Nov 29 23:18:56 gradle would just silently fail Nov 29 23:19:04 trying to use IPv6 Nov 29 23:20:59 Ooh, Eclipse has a "convert anonymous class to nested class" refactoring. Nice. Nov 29 23:21:22 Refactoring tools must save so much time over the years. Nov 29 23:21:47 it would be preferable if things weren't hard to do to begin with Nov 29 23:23:46 dbrosyth: is appcompat still necessary for api21+? Nov 29 23:25:04 God, this Reddit client I use tries to cache everything. Nov 29 23:25:28 Last saw this listing 23 hours ago? Obvsly you want a cache and not a new download. Nov 29 23:25:33 cached copy* Nov 29 23:25:39 Did you finish yours yet? Nov 29 23:25:49 Nah, but it's pretty functional so far. Nov 29 23:26:23 mantazer: oh i thought you were targetting more stuff. in that case you can just use theme.material afaik and drop the compat lib Nov 29 23:28:43 Darklust: I'm currently implementing "Load More" functionality for listings. I think I prefer that to auto-load-more on scroll. Nov 29 23:28:49 I mean clicky stuff. Nov 29 23:28:58 Though I might end up hating it. Nov 29 23:29:11 In lue of a RecyclerView? Nov 29 23:29:58 dbrosyth: hmmm... this is what im doing, but no luck and im so confused Nov 29 23:29:59 https://developer.android.com/training/material/theme.html#ColorPalette Nov 29 23:30:02 I'd do the same for RecyclerView, I think. Nov 29 23:30:48 did you get the naming bit sorted, TacticalJoke ? Nov 29 23:31:22 Yeah. Reddit game me permission to use the 'X for Reddit' style. Nov 29 23:31:36 Though in the e-mails they kept saying 'reddit' (correct) and I kept saying 'Reddit' (incorrect), and they didn't mind. Nov 29 23:31:58 I just hate the lowercase version, so I kinda subtly got them to okay me on the uppercase version. Nov 29 23:32:10 cool Nov 29 23:32:35 Also, I get to use the Reddit (reddit) alien as long as I don't make it look really weird or something. Nov 29 23:33:09 sounds about right Nov 29 23:33:32 So many clients use 'Reddit X', but I think they're gonna get strict on naming soon. Nov 29 23:33:44 They wouldn't let me use 'Reddit X', and they said they're gonna clamp down (I think). Nov 29 23:34:21 i think that is correct Nov 29 23:34:49 are you going to be open sourcing and components of your app? Nov 29 23:35:05 Maybe. Haven't thought much about it yet. Nov 29 23:35:10 cool Nov 29 23:35:10 I kinda feel like I ought to. Nov 29 23:35:15 let me know how it all goes Nov 29 23:35:17 :) Nov 29 23:35:44 The good thing is that the Reddit API is easy. Just JSON stuff. Nov 29 23:36:14 The only rules seem to be "30 requests per minute" and "use an honest User-Agent". Nov 29 23:36:44 yeah Nov 29 23:36:59 we actually use that same api for the ama apps, you can do some fun stuff with just that Nov 29 23:37:53 dbrosyth: Wait, you're with Reddit? Nov 29 23:38:23 yes Nov 29 23:38:41 Oh, nice. Didn't know. lol Nov 29 23:39:11 haha, yah i could have mentioned that earlier Nov 29 23:39:35 I'm using the package name for the User-Agent (it's unique), and I'll be limiting to one request every 2000 milliseconds, I think. Nov 29 23:40:18 yeah its not too hard to keep under the limits Nov 29 23:40:44 Yeah, it's a pretty gentle one. Makes my life easier. :) Nov 29 23:40:49 as long as youre "responsible" on the client Nov 29 23:41:45 is there anything in Google's Location API that will let me determine the street the user is on? Nov 29 23:41:58 for example, the user is going southbound on Main St Nov 29 23:42:33 RustyShackleford: reverse geocode Nov 29 23:42:39 http://imgur.com/a/i1DVz#0 no palette though Nov 29 23:45:43 is it uh, accurate? My concern is that in a city like chicago, the streets are very close together Nov 29 23:46:05 it might think that the user is on a nearby parallel street Nov 29 23:46:40 a real gps is very accurate without any building (close to 1m/s of precision) Nov 29 23:47:05 i mean, it will be as accurate as your coordinates and googles reverse geocoding technology? Nov 29 23:47:11 so it all depends on the device (and also if the user did not activate multiple sources, sometimes it does the average .... instead of picking the most accurate source) Nov 29 23:56:33 RustyShackleford, no, it's obviously not 100% accurate Nov 29 23:56:38 but it's good enough. Nov 29 23:56:57 Instead of thinking about "I need 100% accuracy" think "What do I do when it's wrong?" ;) Nov 30 00:05:26 hello! Nov 30 00:06:13 has anyone had experience with setting up android studio on ubuntu? Nov 30 00:08:12 Can someone help me understand this stackoverflow answer really quick Nov 30 00:08:21 http://stackoverflow.com/questions/7057845/save-arraylist-to-sharedpreferences In the answer do you know what types myScores and scoreEditor is? Nov 30 00:08:44 It has been bugging me, and I am assuming listOfExistingScores is the arraylist Nov 30 00:09:53 I'd guess myScores is an SharedPreferences instance, and scoreEditor is an Editor instance. Nov 30 00:10:28 That would make sense Nov 30 00:10:35 ty Thorbear Nov 30 00:10:36 can anyone please tell me why my action bar color isnt changing: http://pastebin.com/9QMiP2CZ Nov 30 00:10:50 and listOfExistingScores can be any Collection Nov 30 00:11:32 ah okay that is good Nov 30 00:11:41 tyvm Thorbear i greatly appreciate this Nov 30 00:12:23 That answer sounds odd to me. Nov 30 00:12:27 Sets don't allow duplicates. Nov 30 00:12:44 cbot_: also, you shouldn't use commit() like the SO answer does. Android Studio will helpfully tell you that apply() is much better for most situations. Nov 30 00:13:14 I have not used android studio yet Thorbear Nov 30 00:13:34 Well, then I helpfully told you instead :) Nov 30 00:13:36 TacticalJoke, would it be more practical to use gson? Nov 30 00:13:49 cbot_: Maybe. What exactly are you trying to stroe? Nov 30 00:13:51 store* Nov 30 00:13:59 He just pointed out the difference between sets and lists Nov 30 00:14:00 One option is Parcelable, but I hate that. Nov 30 00:14:08 An arraylist of custom objects that may include things like UUIDs and date objects Nov 30 00:14:17 Hi, I am having some trouble with dagger when using a library I have been working on. I used dagger in the library, and dagger in the project that uses the library. Once I try to execute the app, I get multiple "could not be bound" errors with classes coming from the library. Nov 30 00:14:29 And aparently, the library does not have any problem when building it. Nov 30 00:14:31 Wait, I take that bak. Nov 30 00:14:32 back* Nov 30 00:14:39 I don't think it's the case that Parcelable is an option. Nov 30 00:16:06 I'm almost sure gson is though, but I'd like to avoid the use of outside libraries Nov 30 00:16:35 Yes, Gson should be an option for almost anything text-wise. Nov 30 00:16:57 cbot_: meh. embrace the library and get what you want to get done, done :P Nov 30 00:17:07 Gson is really small, BTW. Nov 30 00:17:14 cbot_: considering it adds basically the size of a medium res image Nov 30 00:17:29 optimize for your dev time and just get it done Nov 30 00:17:32 Yeah that's what I'll likely do Nov 30 00:17:59 also it's really not worth your effort to write your own r-d parser for a complex data format Nov 30 00:18:12 TacticalJoke, why would sets not allowing duplicates be an issue for the answer? Nov 30 00:20:33 Any idea why this is happening ? Nov 30 00:20:36 Ok Nov 30 00:20:40 Is there a channel Nov 30 00:20:50 Where I can just get people to download my game? :D Nov 30 00:21:53 no lol Nov 30 00:22:38 THERE IS Nov 30 00:22:44 Don't hold back on me! Nov 30 00:22:46 cbot_: I was thinking of the case where he has duplicate items in the list. Nov 30 00:23:09 Yeah that shouldn't be an issue for me I don't have any duplicates Nov 30 00:23:14 ty though Nov 30 00:28:17 Okay. Nov 30 00:31:39 Hi Nov 30 00:33:36 linux or windows for android development? Nov 30 00:33:55 i like using linux when it doesn't break on me Nov 30 00:36:22 I have downloaded the material icons pack, and I navigate to hdpi, and I see a good icon, but there are icon_48dp, icon_36dp... what should I use? Nov 30 00:37:46 I have normal, hdpi, ldpi, mdpi, and xhdpi.. 256, 72, 36, 48, and 96 Nov 30 00:38:11 what to use? Nov 30 00:39:08 should I include all these in my app? Nov 30 00:44:26 what are you using it for? different UI elements require different dp sizes Nov 30 00:44:46 for action bar Nov 30 00:45:29 JakeWharton: ^ Nov 30 00:45:31 i think you want the 36dp ones then Nov 30 00:46:01 for all sizes? or only hdpi? Nov 30 00:49:45 Those are for icons Nov 30 00:49:54 No idea if I'm doing it right :P Nov 30 00:54:46 anyway thanks Nov 30 01:02:21 for all sizes Nov 30 01:02:28 oh Nov 30 01:02:45 you want the 36dp version for all densities Nov 30 01:03:05 36dp is the size, hdpi/xhdpi/etc is the density Nov 30 01:05:51 how do i change the font of the title in the actionbar in api21? Nov 30 01:08:05 Use a TypefaceSpan Nov 30 01:09:24 JakeWharton: Thank you Nov 30 01:10:36 thx Nov 30 01:11:33 JakeWharton: But there are 36dp icon for hdpi, 36dp for mdpi, .... Nov 30 01:11:40 what should I copy? Nov 30 01:11:50 you should copy them all Nov 30 01:12:08 oh Nov 30 01:12:15 :) Nov 30 01:38:11 So, I created an adapter that supports settings/removing a footer at any time. Does this look right? Nov 30 01:38:12 http://pastebin.com/DBMCyeRK Nov 30 01:49:52 Napalm: :D Nov 30 01:50:08 Napalm: I created an adapter that supports setting/removing a footer: http://pastebin.com/DBMCyeRK Nov 30 01:50:10 Is that right? Nov 30 01:50:37 TacticalJoke: hey Nov 30 01:50:45 Hai. Nov 30 01:51:18 2 moments Nov 30 01:51:21 No worries. Nov 30 01:54:13 hmm, this dsp book for $120 on sale 55% ... Nov 30 01:54:59 which book? Nov 30 01:55:12 I've got a good DSP book Nov 30 01:56:17 Napalm http://www.informit.com/store/understanding-digital-signal-processing-9780137027415 Nov 30 01:56:46 http://www.amazon.co.uk/Digital-Signal-Processing-Michael-Parker/dp/1856179214 Nov 30 01:58:34 i thought you were going to like to Oppenheim :D Nov 30 01:58:37 *link Nov 30 02:03:08 allright then. I think i'm almost done with my custom rx scheduler which puts work on IntentService kinda-thingy Nov 30 02:06:45 oh look, somebody already made RxGoro Nov 30 02:18:19 ok so i moved my development from my laptop to my desktop and my desktop does not recognize my droid incredible but the laptop does Nov 30 02:18:26 i cannot use the incred to debug Nov 30 02:19:00 make sure you have right usb drivers Nov 30 02:19:12 also looks like it does not recognize my thunderbolt either Nov 30 02:19:20 what drivers do i need under linux? Nov 30 02:19:47 ???????????? no permissions <-- this is what i get from adb devices for both devices Nov 30 02:20:06 neither my laptop nor my desktop have anything at all in /etc/udev/rules.d Nov 30 02:21:17 oh, linux eh Nov 30 02:21:19 i can debug using either device with my laptop but the desktop does not recognize either Nov 30 02:24:22 ? Nov 30 02:25:50 i think ive found it, my user is not in the android group Nov 30 02:25:53 let me fix that Nov 30 02:53:05 Around 0% of my e-mails interest me. **** ENDING LOGGING AT Sun Nov 30 02:59:58 2014