**** BEGIN LOGGING AT Mon Jun 22 02:59:59 2015 Jun 22 03:13:02 hey guys Jun 22 03:13:29 when i change the image of my image button the scaletype reverts to some other one Jun 22 03:13:51 for example firstImageButton.setImageBitmap(bitMap); changes the image, but the scale type gets all messed up Jun 22 03:14:08 before that i was setting the src to be the image tho Jun 22 03:25:32 have you tried just changing the scaletype back Jun 22 03:31:54 Why the activity is not declared in AndroidManifest.xml file? i did Jun 22 03:37:29 anyone tell why AS tells this eror? Jun 22 04:03:53 rrr_: Let me gaze into my crystal ball and find out. Jun 22 04:04:32 worked out Jun 22 05:14:22 What happened to whatitis? Jun 22 05:22:09 hey guys, was wondering how would one go about setting up an internet kill switch on Android. Is it possible? Jun 22 05:22:33 dck28: Can you be more specific? Jun 22 05:22:35 is setting up a proxy server the a good way to do that? or are there better ways to do that? Jun 22 05:23:17 so basically monitoring outgoing internet connections, and if it falls out of a preset range of IP, I disable the internet... Jun 22 05:23:37 out of range of an IP? What does that mean? Jun 22 05:24:07 Hmmm. say i would only want to connect to the internet through specific IP address, like a VPN provider or something. Jun 22 05:24:23 but if I detect that there are any leakage, I want to disallow and disable connection to the internet. Jun 22 05:25:04 dck28: Just curious how proficient you consider yourself in terms of networking? Do you know the difference between TCP and UDP? Heard of BGP, routing tables, that kind of thing? Or you just have a general idea of how networking works? Jun 22 05:27:48 that's a good question... I don't know too much about the details, but I've seen some app claims to have that ability to do such a thing, I was wondering if they can actually prevent all leakage versus false advertisment... haha Jun 22 05:28:26 i know a little about default gateways and TCP/IP vs UDP... that's about it... Jun 22 05:28:35 dck28: I figured, because what you're asking doesn't make a lot of sense (no offense) Jun 22 05:28:44 or maybe I'm just not understanding Jun 22 05:30:21 https://www.youtube.com/watch?v=iDbyYGrswtg Jun 22 05:32:21 that's fair... umm... ideally if I can setup a system wide firewall that prevents all outgoing traffic except for a pre determined IP... does that make sense? Jun 22 05:33:02 libraries to Upload to ftp server .. ? any suggestions ? Jun 22 05:38:19 My leaderboards worked unpublished so I reset my leaderboards and published the game but now in the game it says "No leaderboards for this game" Help Jun 22 06:03:12 Does anyone know how to center the tabs in the new tablayout? Jun 22 06:03:33 nevermind Jun 22 06:40:07 "How We Developed the Guillotine Menu Animation for Android" uh huh Jun 22 06:40:59 its like the skeuomorphism but for animations Jun 22 06:41:53 i'll call it skeuomation :) Jun 22 06:49:19 if I compileSdkVersion 21, minSdkVersion much lower, and I use lambdas without RetroLambda, will the app crash on old Android? Jun 22 06:50:32 jimbo1qaz: yes Jun 22 06:55:24 http://stackoverflow.com/a/22303654 android studio flags "try-with-resources" if minsdk<19. so why didn't android studio similarly flag my lambda, even though minsdkversion < 21? missing inspection? Jun 22 06:56:14 jimbo1qaz: because Lambda's are Java 8 and Android doesnt support it Jun 22 06:57:55 when I inspect->java8, it changes compilesdk to 22. so 22 does not, in reality, support java 8, and android studio's lying? Jun 22 07:00:57 libraries to Upload to ftp server .. ? any suggestions ? Jun 22 07:02:18 volley Jun 22 07:02:57 so I'll just use retrolambda, should I set it to sdk8? Jun 22 07:03:52 nvm can't Jun 22 07:04:46 jimbo1qaz: why cant you? Jun 22 07:05:28 android studio complains that sourceCompatibility() not found if I explicitly set it. Jun 22 07:05:40 if I alt-enter on a rejected lambda, it lets me do so. Jun 22 07:06:01 then the "java version" "compatibility" under "project structure" is blank Jun 22 07:06:10 no, it's 1.8 Jun 22 07:06:16 Drop this under your build.gradle under android {...} http://pastie.org/10252544 Jun 22 07:08:35 why, despite I'm using com.android.support:appcompat-v7:19.1.0 , apptheme preview is still material not holo? Jun 22 07:08:54 why do you want holo Jun 22 07:09:00 thats a really old support lib version Jun 22 07:09:24 I'm not a fan of [s]metro[/s][s]windows3.1[/s]material. Jun 22 07:09:52 is your app just for you? Jun 22 07:10:39 what is the general opinion on holo vs material? Jun 22 07:11:01 material > holo Jun 22 07:11:35 well fuck, looks like I have no choice but to use material design Jun 22 07:11:52 yup Jun 22 07:11:54 it's a very ironic name. material design is flat and unshaded, unlike real materials. Jun 22 07:11:56 my opinion is law Jun 22 07:12:00 metal is shiny, paper is uneven Jun 22 07:12:15 but material is flat, unshiny, and all surfaces have no color variation. Jun 22 07:12:20 material is supposed to have a Z axis thru elevation Jun 22 07:12:20 except for shadows Jun 22 07:12:29 holo wasnt much different Jun 22 07:12:39 the shadows are pseudo-3D, but the actual surfaces are flat and non-material. Jun 22 07:12:43 {white grey / dark grey/ holo blue} Jun 22 07:13:41 welp: Error:(1) Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Inverse'. 102 errors Jun 22 07:13:56 let me fix it myself. Jun 22 07:14:21 Gradle sucks soooo much Jun 22 07:14:31 Ribesg: why Jun 22 07:14:39 Because everything! Jun 22 07:14:47 welp, AppCompatActivity didn't fix anything Jun 22 07:15:07 must compileSdkVersion of 21 Jun 22 07:15:23 well, it would help if they told me the problem, instead of stack-overflow Jun 22 07:15:48 Every time I (have to) use it it feels like I'm using an alpha thing Jun 22 07:15:52 Even pre-alpha Jun 22 07:15:59 specifics Jun 22 07:16:47 now it's complaining about buildTypes incompatible type. Jun 22 07:16:47 It's the slowest thing on earth Jun 22 07:16:55 can't copy the exact error because android studio won't let me. Jun 22 07:17:21 Can't wait for IntelliJ to support Maven Polyglot Jun 22 07:17:36 Maven without XML Jun 22 07:17:41 What else do you need Jun 22 07:18:12 stackoverflow: buildTypes must be last element for whatever reason, wtf why does error suddenly appear? Jun 22 07:18:15 anyway fixed Jun 22 07:19:20 nvm Jun 22 07:19:36 Unexpected random behaviour, random errors, welcome to Gradle Jun 22 07:19:55 besides occassionally poor speed i find it okay Jun 22 07:20:22 I would even prefer Google to enforce Ant Jun 22 07:20:23 http://stackoverflow.com/a/30828772 is correct Jun 22 07:21:13 lol ant Jun 22 07:21:18 ? Jun 22 07:21:29 gtg thanks Jun 22 07:21:32 the reason why google left ant was because it wasnt flexible enough Jun 22 07:21:43 At least it works Jun 22 07:21:55 so does javac *.java Jun 22 07:22:10 I should use Make Jun 22 07:22:15 but i agree, not so impressed with gradle Jun 22 07:22:23 hey thepoosh Jun 22 07:22:25 Gradle isn't shiny Jun 22 07:22:34 hi there Jun 22 07:22:34 It needs a lot of love Jun 22 07:22:41 I'm fine with gradlee Jun 22 07:22:56 Like valid error messages, and stop eating cpu like cookies Jun 22 07:23:18 nomnomnom Jun 22 07:23:30 Best thing with Gradle is the gradle daemon Jun 22 07:23:36 Which prevents you from using the clean task Jun 22 07:23:42 Gotta love Gradle Jun 22 07:24:16 prevents clean task ? Jun 22 07:24:28 Yup Jun 22 07:24:29 Fun isn't it Jun 22 07:24:52 dont follow - use daemon all the time, clean is fine Jun 22 07:25:17 Every time I try to run Gradle "clean build" from IDEA, it tells me some other process has a lock on the files to be removed Jun 22 07:25:21 Which process? Gradle. Jun 22 07:25:27 Wtf Gradle. Jun 22 07:25:46 hm, no idea Jun 22 07:25:58 Also when I exit IDEA Gradle still runs Jun 22 07:26:02 That's fun too Jun 22 07:26:46 I guess those 2 last problems are related to the fact that I use Gradle in an IDE, but still Jun 22 07:26:47 if you start another gradle outside the IDE, it might get messed up - there will be 2 daemons duking it out Jun 22 07:27:04 I'm totally not starting Gradle outside the IDE on Windows Jun 22 07:27:06 :P Jun 22 07:27:18 But yeah a build tool should work with major IDEs Jun 22 07:27:38 g00s, I think those 2 problems are linked Jun 22 07:27:52 Exit IDEA, Gradle doesn't quit, restart IDEA, new Gradle process Jun 22 07:28:06 2 Gradles -> death Jun 22 07:28:10 i have always wanted CLI and IDE to share the same daemon ... but seems at least now they can't Jun 22 07:28:38 AS starts the daemon through another API , so gradle seeing different arguments doesn't reuse the existing one ... or something like that Jun 22 07:29:09 Yeah well Jun 22 07:29:39 That build tool isn't properly supported by IDEs, isn't properly programmed (lol those error messages), feels like an alpha thing Jun 22 07:29:43 Still enforced by Google Jun 22 07:32:10 It could be glitchy because it's young Jun 22 07:32:15 But it's 8 years old >< Jun 22 07:33:37 could be glitchy because its big, complicated, and built using dynamically typed language :) Jun 22 07:33:50 oh, and then there is goofle's stuff sitting in there too Jun 22 07:36:59 why does genymotion randomly decide not to want to rotate the device Jun 22 07:37:43 desmin88: never happened to me Jun 22 07:42:24 hi, is there any benefit to using ObjectAnimator over using interpolation in the onDraw method? Jun 22 07:45:14 hey guys im looking for tutorials Jun 22 07:45:25 on using permissions to mine data Jun 22 07:45:41 permissions to mine data .. ? Jun 22 07:46:28 like for example i have an sms app and i want to be able to collect sms info from my users Jun 22 07:46:43 like collecting all their messages old and new Jun 22 07:47:01 sounds creepy Jun 22 07:47:27 since the app has permission to access their phones all their text messages Jun 22 07:47:35 what would i do? can i upload it to parse? Jun 22 07:48:20 im having trouble finding tutorials Jun 22 07:49:13 liftedbronco: are you serious? Jun 22 07:49:25 yeah Jun 22 07:49:41 why would you want to collect every users sms messages Jun 22 07:49:51 marketing.. Jun 22 07:50:00 you realize thats like Jun 22 07:50:01 wrong Jun 22 07:50:08 idk Jun 22 07:50:10 liftedbronco thats fucked up Jun 22 07:50:12 im looking for tutorials Jun 22 07:50:20 my sms app has some users Jun 22 07:50:25 no one will help you here with that Jun 22 07:50:37 also, with new permissions model, i bet many users will not allow that Jun 22 07:50:48 well, still got some time Jun 22 07:50:57 what the fuck Jun 22 07:50:58 liftedbronco: hint - the kind of collection you described is illegal in at least some countries, no matter what EULA you get people to sign, and it can be iirc a criminal offence :3 Jun 22 07:50:59 most phones are on kitkat Jun 22 07:51:49 you realize how unethical that is also Jun 22 07:52:21 i just wanna get some info on it Jun 22 07:52:21 unethical, probably illegal (and prosecuted by state prosecution!) Jun 22 07:52:33 theres precedent too Jun 22 07:52:33 doesnt mean im gonna do it :P Jun 22 07:52:37 flashlight apps have gotten sued Jun 22 07:52:41 for data collection Jun 22 07:53:02 they must have gotten alot of data or something Jun 22 07:53:15 so you just want to mine a little data Jun 22 07:53:17 nothing too big Jun 22 07:53:25 amount isnt a factor Jun 22 07:53:53 i just want a tutorial to see how it works Jun 22 07:54:01 no Jun 22 07:54:05 i already have a good understanding Jun 22 07:54:13 anyways Jun 22 07:54:24 pmsg me a tutorial if anyone has 1 Jun 22 07:54:26 whats your sms app? jw Jun 22 07:54:34 now i dont wanna post it :P Jun 22 07:54:40 you guys making me nervous Jun 22 07:54:49 i just wanna see it Jun 22 07:55:03 nvm Jun 22 07:55:14 your app will ask for permission to read user SMS when you try to do that Jun 22 07:55:20 no one will agree Jun 22 07:55:42 liftedbronco its shit like that that gives android a bad name. at least soon users will have more control over things somewhat Jun 22 07:55:56 yea I hope you go to prison Jun 22 07:56:18 Apple would simply not allow that in the store; people know that, and they feel safer in their garden Jun 22 07:56:27 no wonder, with dipshits like you Jun 22 07:56:52 whoa whoa im not gonna do it Jun 22 07:56:58 pls dont bash me :P Jun 22 07:57:15 your being bashed and rightfully so Jun 22 07:57:36 good thing that your skill won't allow you to do it :P Jun 22 08:04:38 thepoosh whats your favorite android library used in glide ? Jun 22 08:05:05 hmmmm Jun 22 08:05:08 good question Jun 22 08:05:28 what lib do you think you could not live without Jun 22 08:05:28 i like GreenDao even though I'm kinda sorry we're using it Jun 22 08:05:36 and Volley since I know it inside and out Jun 22 08:05:44 even though I'm kinda sorry we're using it Jun 22 08:05:55 ah, haven't used volley Jun 22 08:06:03 I like the way it's built Jun 22 08:06:12 not always the way it operates Jun 22 08:07:51 can someone please help me understand this function and how to call it? Jun 22 08:07:52 http://pastebin.com/mVY7ddNS Jun 22 08:07:56 thepoosh what technique / practice at glide do you think has had the greatest impact on quality ? Jun 22 08:17:33 can someone please help me understand this function and how to call it? -> http://pastebin.com/mVY7ddNS I dont know which of this runs first and why do this-> new GetCallback() ? Jun 22 08:24:55 Anyone have tips on how to implement a timed (10 minute) cache with Retrofit & RxJava? Jun 22 08:39:39 Hi, I have a problem with Gradle. I added jcenter repository and commons-lang dependency, but it doesn’t even search on jcenter. Why is that? More info: http://pastebin.com/BFKwrikF Jun 22 09:05:55 Ok, I figured it out. It required adding jcenter() to allprojects.repositories in project level gradle file. Was only in buildscript before, and wasn’t seen for some reason. Jun 22 09:07:10 I have an issue where my draw calls in a custom view that's displayed in a recycleview seem to get ignored. The elements that are displayed on screen are drawn correctly, but when scrolling down, the ones that come up aren't being drawn until... I don't know... after that every element that comes onto the screen is drawn, including those that were not drawn previously. Jun 22 09:07:22 On click listeners do work on the not drawn elements Jun 22 09:17:40 can anyone tell me how the Paint.getTextBounds() works? why are the bounds so smaller than the actual text? Jun 22 09:18:58 ashwink005, probably because you don't have all properties set on Paint properly? Jun 22 09:19:11 Might wanna look at StaticLayout though, that one is usually the better API for text rendering Jun 22 09:20:06 Mavrik: I wanted to know the usual behavior.. does it usually give the exact Rect that can completely enclose the said text? Jun 22 09:20:21 or am I doing something wrong? Jun 22 09:23:21 no idea, it calls through to a native call so I can't even tell from the source Jun 22 09:27:37 Mavrik: thanks man I'll look into staticLayout class Jun 22 09:32:59 hey guys i'm trying to edit the Spinner class file but there are massive amounts of errors. i basically need to change just one line but obviously i can't override that method Jun 22 09:33:49 hello, I got problem with retrofit / network when fetching data when got push notification (in separate thread) "Non-fatal Exception: retrofit.RetrofitError Unable to resolve host "my.domain.com": No address associated with hostname" Jun 22 09:34:33 normally it works but got like 173 reports in crashlytics. what can be the cause of it? Jun 22 09:36:28 I use synchronious network call but in async task Jun 22 09:37:00 ashwink005, I think some letters can go below the text bounds. for example "p" "y" "g" Jun 22 09:37:21 but I'm not entirely sure, and I'll leave for a bit now. Jun 22 10:03:01 Hi all. I'm using the Facebook sdk to share a selfie. It works great on my Samsung S3 but when I test it on a Samsung S4, the ShareDialog closes immediately. Any suggestions what the problem can be? Jun 22 10:08:28 'found the anser, for those who are interested: http://stackoverflow.com/a/23934564/1723525 Jun 22 10:44:23 gordon_: looks like the phone maybe losing internet connection, which you are not checking. Retrofit produces the error. I think crashlytics sends the error afterwards, when the internet is back. Jun 22 10:50:33 Anyone help me!! Jun 22 10:51:10 The getTextBounds from Paint is giving a Rect with some space on Top! how do I get the value of the extra space? Jun 22 10:56:15 ashwink005: its the distance between top and ascent Jun 22 10:57:45 Napalm: so how do I get its value if I have the TextBounds Rect? Jun 22 10:57:55 does it depend on the textSize? Jun 22 10:58:52 http://www.catch22.net/img/editor10.gif Jun 22 10:58:56 http://developer.android.com/reference/android/graphics/Paint.html#getFontMetrics(android.graphics.Paint.FontMetrics) Jun 22 10:59:47 maybe it was the leading Jun 22 10:59:55 whatever.. im sure you can work it out Jun 22 11:00:15 Na Jun 22 11:00:26 Napalm: Dude thanks a ton Jun 22 11:04:56 i have a MediaController and a videoplayer that it controls. I can manually .play() and .pause() the videoplayer, but the MediaController does not pick up on this. How do i let it know? Jun 22 11:05:43 xorgate: i assume you've called MediaController#setMediaPlayer? Jun 22 11:06:23 or do you mean te new media one Jun 22 11:09:22 'the new media one' ? Jun 22 11:10:44 the video player (ExoPlayer) is operated by the MediaController, works fine. But I want to also allow for example tapping on the vid to pause/play. Then the mediacontroller does not pick up on the new state Jun 22 11:11:17 meaning it thinks it's playing when it's paused Jun 22 11:11:17 xorgate: there are two MediaController classes in Android.. which one Jun 22 11:14:07 Napalm: aha.. android.widget.MediaController Jun 22 11:14:07 aka the old one Jun 22 11:16:08 xorgate: how are you calling .play()? Jun 22 11:19:16 xorgate: why not call MediaController.show()? when you call .play()? Jun 22 11:19:38 xorgate: looks like you can call MediaController.setMediaPlayer again and it will update the play/pause state Jun 22 11:20:19 Napalm: ok i can try that again.. seems a bit of a hack Jun 22 11:20:53 napalm, exoplayer has: player.getPlayerControl().start() Jun 22 11:41:56 Hi! I'm trying to port an iOS software to android. I know that a label is of font size 16pt but when I put the 16pt on android (or really 16/72in) the size is much larger on the physical screen Jun 22 11:42:06 Shouldn't the size be exactly the same? Jun 22 11:48:43 how does my android app know to look in activity_main.xml? Jun 22 11:48:52 WHere is the 'reference'? Jun 22 11:50:14 is it setContentView(R.layout.activity_main); Jun 22 11:50:29 I've got this vector data "M6 6h2v12H6zm3.5 6l8.5 6V6z". it is shown great on android studio preview but not the same on real device Jun 22 11:50:52 any Idea why? this is skip_prev from google icons. the skip_next works. Jun 22 11:51:30 http://i.imgur.com/SmHLQQd.png Jun 22 11:53:12 Napalm: well crikey, that worked ;) Jun 22 11:56:46 RxJava question: Anyone have an example to tie AsyncSubject to normal Observable API call. What I am trying to do is to use it as a cache. Jun 22 12:16:41 It doesnt seem to work to implement ViewPager.OnPageChangedListener on my FragmentStatePagerAdapter. Any clues? Jun 22 12:24:01 Napalm, Got the rotating caption to work btw :> Jun 22 12:29:27 nice, which method did you use? Jun 22 12:29:37 chrisaardal: ^ Jun 22 12:29:52 GestureDetectors Jun 22 12:30:27 About my last question: turns out it was a typecasting mistake I did, I figured it out. Jun 22 12:30:47 tho google should release a native RotationGestureDetector Jun 22 12:30:57 like iOS Jun 22 12:31:30 google should release a lot of things... Possibly things that work, would be even better. Jun 22 12:35:33 findViewById, how do you search for a View if you have several layers(SlidingPanel->Frame->LineairLayout->TextView Jun 22 12:40:01 gavit: Search by the unique id. Jun 22 12:40:33 gavit: Search by the id of the TextView. Jun 22 12:48:23 claint: this is what I was thinking Jun 22 12:50:39 thank you Jun 22 12:53:58 Hi all. I need some advice about something. When I'm using Fragments (all the time), I set an onClickListener on my rootview of the Fragment to have no click event on the Fragment below (stack). How do you guys do this? Jun 22 12:56:14 Any ideas how I could translate font sizes in iOS to Android? Jun 22 12:59:22 hi everyone, I'm working on an chat based app in which i'm conecting as well as logging to server for chat. Jun 22 12:59:54 How to connect and login to server by using a service Jun 22 12:59:56 Petazz_, I don't see what exactly do you think you'll gain by that O.o Jun 22 13:01:54 i want to handle the delay that is caused due to connecting and logging in from a service Jun 22 13:10:50 so, I have a series of fragments in a ViewPager. these fragments just contain one RecyclerView. I've set up the layout of the Activity to contain a CoordinatorLayout + AppBarLayout + TabLayout, such that the title bar goes away when the onscreen recyclerview scrolls. Jun 22 13:11:27 unfortunately, i'm seeing an issue where if the recyclerview does not have enough data to fill the screen (in other words, it can't be scrolled) but you try to scroll anyway, the toolbar still goes away. it's kind of weird and awkward. Jun 22 13:11:32 anyone know a way around that? Jun 22 13:16:47 Does this channel include web apps? Jun 22 13:17:18 native android Jun 22 13:17:39 KingMe, Ok, so #android for installed to homescreen web apps? Jun 22 13:17:50 Hi there, I've found two new files, a mapping.txt and a seed.txt , should I add it to my gitignore file ? Jun 22 13:17:55 android only, webapps only when they intersect. I guess installing to homescreen and persistent counts Jun 22 13:17:57 sigmabeta: but is your recyclerview inside a scrollview? Jun 22 13:18:14 ventura, no. should it be? Jun 22 13:19:40 jrtappers yea android for android and android-dev for native android development I think Jun 22 13:20:48 Ok, I will go to #android, thanks for the redirect Jun 22 13:27:05 hi everyone, i want to handle delay in service Jun 22 13:27:59 hello, I'm in a quest to find out a gesture that happens when a push notification arrives, well I'm very interested in having a push notification like the one that comes with subway surfers. That is to say, the sound and title that appears when that app receives one. I read about notifications but I only manage to have my icon appear, but no message is displayed. is there any additional... Jun 22 13:28:01 ...property I should turn on or something? please help me find out how this is called. thanks Jun 22 13:36:30 hi everyone, i want to handle delay in service Jun 22 13:41:08 livtyler, display of notifications is dependant on Android version Jun 22 13:41:15 rohit7roy, yay! Jun 22 13:41:21 We're happy for you. Jun 22 13:41:51 But if you want help (both of you), you'll actually going to have to provide more information and be more specific when asking. Jun 22 13:42:00 Mavrik: mmm, as I tell, I have this type of notifications from an app called Subways surfers and I'm using kitkat Jun 22 13:42:57 sigmabeta: have the same problem ( even in demos I've seen the same behaviour Jun 22 13:45:35 icedp, yeah it's not a showstopper, just a bit weird Jun 22 13:49:32 rohit7roy: AFAIK, there was an example of doing that delay there, check https://www.youtube.com/watch?v=bViOO3zPRsU Jun 22 14:05:26 how do I display a message pop up when a push notification arrives? Jun 22 14:08:39 livtyler: http://developer.android.com/guide/topics/ui/notifiers/notifications.html#Heads-up Jun 22 14:12:23 anyone know of a merge adapter for recyclerview.adapters ? Jun 22 14:14:49 is there a way for the view to get data from a model in android? Jun 22 14:15:02 I want to do something like person.name = "test" Jun 22 14:15:20 and the view which displays the person should autoupdate it's textview Jun 22 14:19:23 i am implementing a SearchView with ExpandableListView and the query demand a RESTful access Jun 22 14:19:56 how do i delay the network access until the user has stoped typing or clicked in submit? Jun 22 14:21:35 Mavrik: What do you mean? Jun 22 14:21:41 livtyler: thanks Jun 22 14:21:51 I have an app (designs) that I need to apply to Android Jun 22 14:22:07 It seems that the point size (pt) in iOS and Android is very different Jun 22 14:25:21 hello Jun 22 14:25:26 I have bluetooth questions Jun 22 14:25:59 go ahead, sir. don't ask to ask Jun 22 14:26:14 when receiving a message, is it guaranteed that the message is complete? Jun 22 14:26:29 like, are there cases that it will be trunctated into two messages? Jun 22 14:26:38 Hey guys, could you please take a look at this: http://stackoverflow.com/questions/30982317/parsing-xml-using-simple-xml-framework-in-java Jun 22 14:26:42 I'm having troubles with parsing some XML Jun 22 14:27:12 I'm looking at this: http://developer.android.com/guide/topics/connectivity/bluetooth.html#ManagingAConnection Jun 22 14:27:29 and this is the specific line of concern: bytes = mmInStream.read(buffer); Jun 22 14:27:35 I've got a bit of question for people who do both Android and iOS dev - how do you go about code sharing between platforms - do you write the core of your applications in C or C++ and then just write a platform specific UI on top of it for each platform? Jun 22 14:27:50 i've discovered that it concatenates two messages sent in quick succession Jun 22 14:27:51 or do you just not bother with any code sharing? Jun 22 14:28:27 instead of splitting it. so my question is, is there a possibility that a message is split into two parts? Jun 22 14:28:46 Nizumzen: I use j2objc for the non-ui code Jun 22 14:28:53 then GWT for web Jun 22 14:29:17 paulo_, i'll speak by experience, thus not theoretically. if you're using rfcomm, bluetooth would be like a serial port, thus, it's up to you to break mark start/end of messages Jun 22 14:29:18 if you separate the logic & UI code, those tools work really well Jun 22 14:29:20 paulo_: cool I'll look into that - never heard of that before Jun 22 14:30:55 if you write "foo" then "bar", in the other side you may get the "foobar" at once Jun 22 14:30:56 <_cypha> Does anyone know where I can find a list of mobile devices and the sensors each one has? The largest the list the better. Jun 22 14:31:03 that's my experience Jun 22 14:31:26 bitkiller: hmm. I'm thinking of using start & stop bytes. This will require me reading the port byte by byte. Do you think this will slow down the transmission? Jun 22 14:31:48 It's probably around a hundred bytes per message, it's game state. Jun 22 14:31:54 Nizumzen, we have a C++ core and Djinni bindings Jun 22 14:31:58 you should define a protocol Jun 22 14:32:28 some data structure or header for each message Jun 22 14:32:50 and some byte sequence to mark end/start of message Jun 22 14:32:58 hmm ok. do you know open source implementations for that? Jun 22 14:33:26 nope Jun 22 14:34:17 i did this a lot of times in PIC assembly or C Jun 22 14:35:26 oh, you interfaced it to an android phone with bluetooth? Jun 22 14:35:45 Does anyone have experience with parsing xml? Jun 22 14:36:18 no. it was rs232...old times (10-15 years ago) Jun 22 14:37:09 paulo_: create a simple header, or use something like protocol buffers, ASN.1, etc. Jun 22 14:37:27 TLV structure is your friend Jun 22 14:38:10 do not use start/stop bytes Jun 22 14:38:38 Mavrik: yeah that is what I was thinking of doing Jun 22 14:39:09 paulo_: a sample framing protocol - 1 octet tag T, 2 octets length N, followed by N octets of data Jun 22 14:39:58 p_l: is there a chance of corruption? Jun 22 14:40:28 paulo_: use HMAC scheme over the whole messaage? Jun 22 14:42:26 that feels overkill. Jun 22 14:42:41 whether you can get corruption depends on what you're sending the message over Jun 22 14:43:06 it's bluetooth through android. I'm assuming the android OS does checksumming Jun 22 14:43:41 not sure how good BT checksums are Jun 22 14:44:01 but if you can trust them, then you might not need HMAC other than to protect from spoofing Jun 22 14:45:50 p_l: ok, i'll do framing. thanks :) Jun 22 14:52:54 hi what does it mean when a style attribute in a layout start by ? Jun 22 14:53:24 for instance style="?metaButtonBarStyle" Jun 22 14:57:22 troulouliou_dev, references theme attributes Jun 22 14:57:58 pfn, ok thanks Jun 22 15:05:33 Has anyone tried to use the material design specs for lists? Jun 22 15:07:32 48dp tile height, 16sp font, 16dp top padding, and 20dp bottom padding makes the text get cut off. Jun 22 15:07:53 then make your text marquee, or make it smaller Jun 22 15:08:14 and yes, those numbers don't seemt o add up Jun 22 15:08:27 How do you guys keep track of your notifications? Jun 22 15:08:28 But those are the numbers they give! Jun 22 15:08:49 WriterOfAlicrow, 48dp minimum tile height. Jun 22 15:08:55 48dp is the minimum touch area Jun 22 15:09:05 make it stretchable to account for possible text size changes as well Jun 22 15:09:09 it's GUIDELINE Jun 22 15:09:16 not a religious text. Jun 22 15:13:13 Wait. The design specs say the bottom padding is measured from the baseline. How do I do that? Jun 22 15:13:58 WriterOfAlicrow: http://developer.android.com/reference/android/graphics/Paint.html#getFontMetrics(android.graphics.Paint.FontMetrics) Jun 22 15:15:50 Napalm: That looks like a horrible hack. Can't it be done with xml? Jun 22 15:17:14 do what? Jun 22 15:19:01 Specify padding measuring from the baseline. Jun 22 15:22:12 WriterOfAlicrow: http://developer.android.com/reference/android/widget/TextView.html#attr_android:includeFontPadding Jun 22 15:22:27 That's wrong. Jun 22 15:22:43 That defines if view size will take ascenders/descenders into account Jun 22 15:22:50 If you set that to false, it'll cut of letters like g Jun 22 15:22:57 then you add padding ;) Jun 22 15:23:16 you can also turn clipChildren off in the parent Jun 22 15:23:18 would i use a view flipper if i wanted to swap between two imageviews under the same activity? Jun 22 15:23:32 or would it be easier to use a toggle button and two separate activities Jun 22 15:24:28 bobbiejim1: viewflipper Jun 22 15:24:38 bobbiejim1: do you want it to flip at a time interval? Jun 22 15:25:03 bobbiejim1: or just flip when you set a new image? Jun 22 15:25:26 nah i want the user to basically be able to take photos and view them on one view, then switch to another view and take photos for a different "category" Jun 22 15:25:56 is it generally bad practise to use asynctask if it's never going to touch the UI as a worker thread Jun 22 15:26:17 basically i have a 3d building and the user can view real time images they took of that building, then i want them to be able to seamlessly switch to another view that shows the floorplans and interior images of the building Jun 22 15:26:34 so i have an outside/inside imageview Jun 22 15:26:42 bobbiejim1: then it really depends on how you want the UI to behave.. take a look at http://developer.android.com/reference/android/widget/ViewSwitcher.html and http://developer.android.com/reference/android/widget/ImageSwitcher.html Jun 22 15:27:13 alrighty will do Jun 22 15:28:31 I want to have a share button in my options menu. My code is http://pastie.org/private/m9qjti8xz3g9cecb3xuucw For some reason the share icon is not appearing in my activity, but working with the same code in another. Any ideas how I can fix this? Jun 22 15:28:53 bobbiejim1: remember its based on ViewAnimator so you can use android:inAnimation and android:outAnimation Jun 22 15:29:17 How can I parse XML using simple XML? Jun 22 15:29:26 viewswitcher is? Jun 22 15:29:28 I'm having trouble getting it to parse correctly, anyone have any experience in it? Jun 22 15:29:34 barq: you are not using the app:showAsAction="ifRoom" but only android:showAsAction.. probably Jun 22 15:29:40 hey guys I'm thinking of creating a slide show application and was wondering what type of Activity to use for it Jun 22 15:29:41 oh they both are Jun 22 15:30:54 Napalm: I have android:showAsAction="always" Jun 22 15:32:08 barq: and if your trying to use app-compat so it works on older versions of Android you'll want app:showAsAction Jun 22 15:33:27 Napalm: Hmm, I get Namespace 'app' is not bound if I use it. Jun 22 15:34:02 barq: AndroidStudio? Jun 22 15:34:02 Somebody has some experience with the frameworks code? I need to exclude something from the framework which causes the RIL for a certain device to panic and renders the build rom completely unusable. When I remove the troubled code the RIL functions like it should, but I don't want to remove the code from the framework cause other devices might depend on it. The file in question is SubscriptionController.java Jun 22 15:34:25 Yes, I migrated :) I probably need the correct app name. Jun 22 15:34:46 nope Jun 22 15:35:10 barq: it should show a auto-suggest popup with a hot-key like alt+enter or alt+1 to fix.. and it will add it. Jun 22 15:35:20 Does anyone know how to convert jpgs sequence to MP4. I build an app that takes a sequence of photos bus a need to create a video that plays the sequence. Jun 22 15:35:23 barq: if it doesnt add xmlns:app="http://schemas.android.com/apk/res-auto" Jun 22 15:36:52 ulises_: http://developer.android.com/reference/android/media/MediaCodec.html Jun 22 15:37:44 ulises_: you can also use http://developer.android.com/reference/android/media/MediaRecorder.html with a Surface Jun 22 15:38:17 Napalm: I still get the error No resource identifier found for attribute 'showAsAction' in package if I use the namespace you suggested. Jun 22 15:38:33 Thank you Napalm. I am reading the links! Jun 22 15:39:02 barq: pastebin your gradle script for your app module Jun 22 15:41:27 greetings all. I am trying to get some clarity from the documentation on Services Jun 22 15:41:43 I see that OnStartCommand will be called with each call to StartService Jun 22 15:42:10 barq: it doesn't matter how deeply nested it is? Jun 22 15:42:17 Napalm: http://pastecode.org/index.php/view/bebdd0a0 Jun 22 15:42:21 does that mean OnCreate gets called as well? If it does, is there a way to check if the service is already running? If not, is the usual practice to stop the service and then start it regardless? Jun 22 15:42:33 gavit: No. Jun 22 15:42:39 ulises_, you'll need to use MediaCodec to actually encode H.264 if you want HW acceleration Jun 22 15:42:41 gavit: That's what the id is for. Jun 22 15:42:51 barq: ahhh. your using actionbarsherlock Jun 22 15:42:52 ulises_, but you can code just a viewer if you want to just show the sequence on the screen Jun 22 15:42:56 that takes me back Jun 22 15:43:11 so I answered my own question, OnCreate does get called (as expected) Jun 22 15:43:24 so is there a way to determine whether I should call startService or should I just stop and start? Jun 22 15:43:34 seems like that would be most straightforward Jun 22 15:43:36 xximjasonxx, what are you trying to do? Jun 22 15:43:49 Mavrik: when the user logs in, I want to ensure that my service starts Jun 22 15:44:11 and? Jun 22 15:44:14 what else? :) Jun 22 15:44:24 and i do not want the oncreate command running multiple times :) Jun 22 15:44:30 xximjasonxx, it won't. Jun 22 15:44:36 onStartCommand will be called for each invocation Jun 22 15:44:44 Mavrik: I just ran a test, granted with an emulator, and I saw OnCreate called twice Jun 22 15:44:45 onCreate will be called when service gets created and until it's destroyed. Jun 22 15:44:58 then the service got destroyed in the meantime Jun 22 15:45:02 you'll have to handle that. Jun 22 15:45:06 first when I initially ran the app, second when I restarted the app Jun 22 15:45:20 ok, so probably best to assume the service is running before starting it Jun 22 15:45:21 Android can and WILL kill your background service. Jun 22 15:45:28 I will use mediaCodec. But I do not know how to pass the images to class. I saved those photos inside the memory sdcard. What would be the process to send the pictures? Jun 22 15:46:27 when you pop the back stack, should lifecycle methods run for the fragment that you are going back to? Jun 22 15:46:42 barq: change it back to android:showAsAction and then make sure you have called http://developer.android.com/reference/android/support/v4/app/Fragment.html#setHasOptionsMenu(boolean) in your onCreate Jun 22 15:46:49 ulises_, load bitmap, convert to YUV420p, pass it into the MediaCodec frame callback Jun 22 15:47:05 get encoded H.264 stream, pass it to MP4 muxer to be muxed into MP4 Jun 22 15:47:58 Napalm: I am extending SherlockFragmentActivity, that method is not available. Jun 22 15:48:24 ulises_, might wanna go read up on basics of how digital video works Jun 22 15:50:58 I know Mavrik. I jump in to code a project with very limited time. Jun 22 15:51:17 Do you have a link ? Jun 22 15:51:43 what possible reason for "adb install" just hang there forever? Jun 22 15:52:20 barq: i thought this was in a fragment? Jun 22 15:52:41 Napalm: Nope, SherlockFragmentActivity Jun 22 15:53:11 The odd thing is I am using the exact same onCreateOptionsMenu in another place and it is displaying there. Jun 22 15:53:27 barq: change your last line of onCreateOptionsMenu() to return super.onCreateOptionsMenu(menu) | true; Jun 22 15:53:53 what would i use for the context in ViewSwitcher?> Jun 22 15:54:07 if im switching between 2 imageviews under the same activity Jun 22 15:54:36 Napalm: Nope still not showing. Jun 22 15:57:12 barq: and here I am doing findViewById(R.id.id1).findViewById(R.id.id2) etc Jun 22 15:57:33 Hi i have a question regarding the drawer menue in android 5. The items i select stays highlighted in android 5 but not in the previous versions. How do i mimic the behaviour of the previous versions in android 5? Jun 22 15:57:48 gavit: Just do findViewById(R.id.theidyouwanttofind) Jun 22 15:58:27 I have tried to manualy unselect all items once one is clicked but no luck :/ Jun 22 15:58:47 Does anyone whether it’s possible to stream video from an MP4 file while it’s being written when using Exoplayer? Jun 22 15:59:45 I mean buffering from the file as if one was streaming from HTTP. Jun 22 16:02:37 Has anyone ever had an issue with a Fragment not calling onResume when it is put on the screen with popBackStack? I have two situations where I am doing this, in one onResume runs but in the other it doesn't. At a loss as to why. Jun 22 16:03:20 Or any lifecycle method for that matter. Jun 22 16:04:03 anyone know what i should use for the Context parameter with ViewSwitcher? Jun 22 16:04:11 when i want to swap between two imageviews Jun 22 16:05:41 context is your activity Jun 22 16:06:04 yeah, i tried making my activity the context Jun 22 16:06:47 still gives me an error Jun 22 16:07:16 I've had an error before Jun 22 16:07:17 Then I fixed it Jun 22 16:07:22 You should try doing the same Jun 22 16:07:36 thanks, thats actually why i came here.' Jun 22 16:07:41 hi again, do I need to use ndk for image manipulation? (resize first) like adding frames to picture, background Jun 22 16:07:44 bobbiejim1: What's the error say? Jun 22 16:07:45 or it will be fine Jun 22 16:08:16 I mean memory. Jun 22 16:08:26 if i try to use the activity as context it asks for an identifier (i tried .this, no dice). if i use something like View view that works, but im not sure if thats what i should be doing haha cuz i want to swap between views within the activity Jun 22 16:09:47 Noone knows what your error is Jun 22 16:10:01 Show the error and the chances of getting help increases Jun 22 16:10:20 i just want to implement a viewswitcher, there isnt really a specific error. i want to swap between two imageviews under the same activity Jun 22 16:11:00 if i try using my activity as the context under the viewswitcher it asks for an identifier, of which i tried .this which didnt work Jun 22 16:11:11 are you using 'this' inside an inner class? you should paste some code Jun 22 16:11:18 Napalm: I tried doing http://pastecode.org/index.php/view/f797d3ee from within the Fragment now, but still nothing showing. Jun 22 16:11:28 bobbiejim1: Post us where you initialize the ViewSwitcher Jun 22 16:11:29 I have no idea what "asks for an identifier" means Jun 22 16:11:44 Maybe someone else does, good luck Jun 22 16:11:46 barq: i said. in your onCreate() NOTTT onCraeteOptionsKMenu() Jun 22 16:11:50 identifier, as in myactivity.this or . something eles Jun 22 16:12:16 i dont really have much related to the actual view switcher code wise, its just public void ViewSwitcher(CONTEXT) {} Jun 22 16:12:17 Hello, I am new to android development and wanted to know if I could get an opinion on why something was done in a layout if anyone has any thoughts. Jun 22 16:12:56 SimonVT: is it me, or have we just had a really big in-flux of newbs recently? Jun 22 16:13:03 In the layout within the Sunshine app that you make at udacity: https://github.com/udacity/Sunshine-Version-2/blob/sunshine_master/app/src/main/res/layout/list_item_forecast.xml why is there an ImageView inside a FrameLayout, any thoughts why not to juse use the ImageView without the FrameLayout? Jun 22 16:13:27 Wilkim: android:layout_gravity="center" Jun 22 16:14:00 Napalm, so that's to center the image inside the FrameLayout? Jun 22 16:14:11 Wilkim: although its better to use just an imageView with scaleType="centerInside" probably Jun 22 16:14:18 Probably to give it a max width Jun 22 16:14:21 Napalm: Still no luck. The fragment is a static class, maybe that is causing trouble. Jun 22 16:14:28 WHAT Jun 22 16:14:30 Can't be larger than 60dp Jun 22 16:14:38 barq: you mean a static inner class? Jun 22 16:14:43 Yes. Jun 22 16:14:47 barq: its fine Jun 22 16:15:00 ive been here for a few weeks haha......just figured someone might know how to implement the viewswitcher after some googling didnt help Jun 22 16:15:09 barq: is the fragment in a viewpager? Jun 22 16:15:23 ah SimonVT that's a good point, thank you! Jun 22 16:15:48 Wilkim: my point was you can do the same thing with just a imageView Jun 22 16:16:26 Wilkim: set its layout_width to 60dp and change the scaleType Jun 22 16:16:43 bobbiejim1: everyone knows how to do it apart from you Jun 22 16:16:52 That can behave a bit strange tho, maybe there were some issues Jun 22 16:17:04 Napalm, so technically I can set the width to be 60dp on the ImageView and use that one attribute you mentioned and then there would be no need for the FrameLayout right? Jun 22 16:17:08 gordon_, you have all the image manipulation tools available in Java and none of them in NDK Jun 22 16:17:09 e.g. if it measures the height first, then scales it down Jun 22 16:17:19 gordon_, there's not much reason to use NDK for that. Jun 22 16:17:26 SimonVT: it doesnt Jun 22 16:17:34 It does in some cases Jun 22 16:17:36 you can add android:adjustViewBounds Jun 22 16:17:36 Or did, at least Jun 22 16:17:38 i guess everyone must know it then. Jun 22 16:17:40 that fixes that Jun 22 16:17:42 Mavrik: thank you! I dont want to use ndk if I need to Jun 22 16:17:45 Had lots of issues with imageview scale types Jun 22 16:17:46 bobbiejim1: It's just hard for us to help without any more information, because the ViewSwitcher constructor takes a Context, which is your Activity (so either 'this' if you are doing view stuff in the Activity, or getActivity if you are in a Fragment). Outside of that we need more info on how exactly you are trying to initialize it Jun 22 16:17:50 I just avoid them now and pre-scale Jun 22 16:17:51 *if I dont need to Jun 22 16:18:05 you will have memory issues if your pictures are too big though Jun 22 16:18:13 thanks theblang Jun 22 16:18:32 theblang yeah, and i said i tried using my activity as a context, but it still wasnt accepting that or any variation of that. so now instead of using the constructor im just creating a new ViewSwitcher, seeing if i can do something with that Jun 22 16:18:48 Napalm: Yes, the ViewPager has a Fragment and the Fragment has an Adapter. Jun 22 16:18:55 well thank you guys! Jun 22 16:18:58 Wilkim: correct. but anyway, there are reasons why you want to do it this way.. for instance certain animations might change the behaviour Jun 22 16:19:32 ah gotcha, well I'll try it and see how it behaves on my phone and tablet and some emulators Jun 22 16:19:54 thank you guys! I'm sure ill have a ton of more questions as I develop my first app on my own Jun 22 16:20:08 barq: and your viewpager is in a Fragment aswell? Jun 22 16:20:37 if so, add setHasOptionsMenu(true); in onCreate() on that also Jun 22 16:20:43 Napalm: The ViewPager is in the SherlockFragmentActivity. Jun 22 16:20:53 bobbiejim1: So go to gist.github.com and paste the code you are using to create the ViewSwitcher, that is the only way we can help you Jun 22 16:21:04 barq: how about this.. drop sherlock and just use appcompat Jun 22 16:21:04 :| Jun 22 16:21:19 ^word Jun 22 16:21:24 barq: Oh wow, you are still using Sherlock? Even Jake said to stop using it, haha Jun 22 16:21:31 there isnt much, it was just what i typed in the chat a bit earlier, but its alright i think by just creating a new viewswitcher rather than using the class i can do what i intended Jun 22 16:21:31 * Napalm nods over at SimonVT Jun 22 16:22:01 Yes, I want to get rid of that, but not right now. Jun 22 16:22:12 bobbiejim1: you do know that we all have no idea what you are talking abotu Jun 22 16:23:24 as in, instead of doing "public void ViewSwitcher(some context) {}" im trying "ViewSwitcher someviewswitcher = new ViewSwitcher(this)" Jun 22 16:24:06 omg, this is like pulling teeth Jun 22 16:24:19 theblang: you can take this one Jun 22 16:24:31 In another SherlockFragmentActivity the options menu is created fine. Jun 22 16:24:52 im not asking for help anymore lol...just saying what im attempting Jun 22 16:25:00 There I am using a Fragment without a ViewPager. Jun 22 16:26:40 adding the guava library, version 18 with gradle makes gradle not build the project (fails at :app:dexDebug stage). Anyone would have a clue why? Jun 22 16:28:19 claint: because v18 is massive... wait thats every version of Guava. Jun 22 16:28:28 claint: why not run gradle in debug mode and get the details why Jun 22 16:28:42 Yeah, try building with --info, --debug or --stacktrace, see if you get any hints Jun 22 16:28:48 Hi - could someone please explain the difference to me of map() and zipWith() in RxJava? These make it seem like the same: http://reactivex.io/RxJava/javadoc/rx/Observable.html#zipWith(rx.Observable,%20rx.functions.Func2) http://reactivex.io/documentation/operators/map.html Jun 22 16:30:23 Napalm: command line invocation right? Jun 22 16:30:31 yes Jun 22 16:30:37 or just press Terminal in AS Jun 22 16:34:20 Anyone use the new support snackbar? Jun 22 16:34:28 lasserix: yes Jun 22 16:34:29 Can you position it ONLY at the bottom? Jun 22 16:34:41 yes Jun 22 16:34:44 specifically, i need to be offset it from the top of the layout Jun 22 16:34:50 oh f-k Jun 22 16:34:52 okay Jun 22 16:35:09 well there's one out--even if set the parent view as "container" at the top? Jun 22 16:35:46 tjbiddle: zipWith takes an observable and a function that combines two values from each observable into one; map takes a function that changes a value from one observable Jun 22 16:35:59 I am probably over the 65k Dex limit because of Guava. Probably better not use it, I just wanted to use it for some caching thing, but I can write that myself. Jun 22 16:36:46 lasserix: you can change it Jun 22 16:37:16 lasserix: i know "a way" Jun 22 16:37:34 its nasty but would work Jun 22 16:38:46 how nasty? Jun 22 16:38:57 Just copy the source, change it Jun 22 16:39:00 na Jun 22 16:39:00 and is it dynamic: ie, can i change the background/text color on the fly? Jun 22 16:39:09 SimonVT: ah good idea Jun 22 16:39:11 you could override addView and alter the layoutparam gravity field Jun 22 16:39:20 do you know the source? Jun 22 16:39:22 hey, what intent will bring an app up in it’s current state. i’ve tried `getPackageManager().getLaunchIntentForPackage()` but it’s relaunching the app. Jun 22 16:39:24 if view class is "SnackbarLayout Jun 22 16:39:24 " Jun 22 16:39:25 *err link to the source Jun 22 16:39:40 (updating sdk atm) Jun 22 16:39:41 lasserix: you dont want to edit the source.. its a package Jun 22 16:39:48 The pattern is that the snackbar is at the bottom, trying to force that particular implementation any other way will just lead to pain Jun 22 16:39:51 unless you want to alter it each time they update Jun 22 16:40:12 SimonVT: so it's probably just better to stick to using nispoks for the time being? Jun 22 16:40:21 was trying to remove unnecessary dependencies Jun 22 16:40:29 It's what, 2 textviews, a linearlayout and some view animations? Jun 22 16:40:32 Not much to it Jun 22 16:41:00 SimonVT: you mean re-create it.. true Jun 22 16:41:22 SimonVT yeah I guess, just with dismiss animation and voial Jun 22 16:41:29 I also mean that I doubt they'll change much Jun 22 16:41:33 Maybe some more convenience methods Jun 22 16:44:06 Are there meterial style dialogs in the support library? Jun 22 16:44:57 I want to create a slide show type application that will let users browse full-screen images. What kind of Activity or design pattern would you recommend I use for this kind of application? Jun 22 16:46:21 lasserix: yes Jun 22 16:46:36 lasserix: https://developer.android.com/reference/android/support/v7/app/AlertDialog.html Jun 22 16:46:46 Somebody has some experience with the frameworks code? I need to exclude something from the framework which causes the RIL for a certain device to panic and renders the build rom completely unusable. When I remove the troubled code the RIL functions like it should, but I don't want to remove the code from the framework cause other devices might depend on it. The file in question is SubscriptionController.java Jun 22 16:46:50 Can I implement it something like in the Android.mk files? ifneq ($(filter gee geehrc geefhd,$(TARGET_BOOTLOADER_BOARD_NAME)),) or is this impossible in the java or framework files? Jun 22 16:48:12 PsychoGame: you want #android-root Jun 22 16:48:24 Napalm . He asked in root already Jun 22 16:49:01 Where can I find the source for the support snackbar? Jun 22 16:49:11 Only option is to be patient and see if an answer pops up Jun 22 16:49:55 Is it in my sdk folder? Jun 22 16:50:30 Allright, then I'll wait and experiment some more. Maybe I accidentily find the solution haha. I'm not very good with java unfortunately Jun 22 16:52:16 argh does anyone know a good file browser for mac? the finder blows Jun 22 16:52:50 does java have any package managers like Node.js's npm, PHP's composer, etc. Jun 22 16:53:23 hey Jun 22 16:53:54 is there any way to get around allowing your pc for usb debugging? Jun 22 16:54:39 cannot browse any tablet on this pc or use usb debugging so was hoping i might be able to set it up wirelessly Jun 22 16:54:56 without having to first connect via usb to allow usb debugging Jun 22 16:55:06 hello, any one point me to good resources to learn android studio development Jun 22 16:55:57 Napalm: This is my Activity and what I have tried. I am not sure where exactly to put the setHasOptionsMenu for it to work properly. https://ghostbin.com/paste/8mdxh Jun 22 16:57:42 Hmm so I need to make my own snackbar, what's the easiest way to drop in a view anywhere in layout relative to a parent? just use the parent, add it in as code? Jun 22 16:58:50 Fraz, https://play.google.com/store/apps/details?id=com.ryosoftware.adbw&hl=en Jun 22 17:00:48 fb|, with that though, will i still need to initially connect via usb to allow the pc for usb debugging? Jun 22 17:01:11 have you enabled the developer menu yet? Jun 22 17:01:51 barq: why are you still using fragmentsherlocks? Jun 22 17:02:41 lasserix: app hasn't been developed for a while Jun 22 17:02:54 barq id stop and refactor that out Jun 22 17:03:00 you'll going to save yourself a lot of headache Jun 22 17:03:23 It's on my list of things to do in the near future, but it will take quite a while I think to get rid of ABS in the whole app. Jun 22 17:03:55 fb|, yes. Its just this pc will not show the command promp on the device to allow usb debugging Jun 22 17:04:00 seems to be a problem with the motherboard Jun 22 17:04:14 ive tried with 5 different tablets Jun 22 17:04:14 try the app, but it requires root Jun 22 17:04:32 it should show you the dialog on the tablet after you do adb connect x.x.x.x Jun 22 17:04:39 yeah i know Jun 22 17:04:39 lasserix: How much work is it to get rid of ABS? Jun 22 17:04:41 it doesnt Jun 22 17:04:47 ive been trying to fix this for months Jun 22 17:04:48 you tried the app already Jun 22 17:04:54 which is why you're telling me it doesn't Jun 22 17:04:55 right? Jun 22 17:04:55 gonna go try it now Jun 22 17:04:58 :D Jun 22 17:05:14 remember you need root Jun 22 17:05:27 yeh one of these tabs is rooted Jun 22 17:05:40 you running cyanogenmod by any chance? Jun 22 17:06:04 no, the stock rom Jun 22 17:06:14 alright Jun 22 17:06:50 but i would like to figure out what the hell is going wrong though:S Jun 22 17:07:28 it's probably your windows ADB driver Jun 22 17:07:55 i've had spotty results with it on windows, but the exact same computer on linux connects to ADB just fine :/ Jun 22 17:08:18 yo guys, I have a listview using a BaseAdapter. One row can contain a imagebutton. I want the button's imageresource to update when I press it. Jun 22 17:08:42 Ive tried notifydatasetchanged() aswell as invalidate(). Nothing works... Jun 22 17:09:19 fb|, ive tried accross 5 different tablets and every possible drivers for each Jun 22 17:09:42 chrisaardal, you probably want Button.setOnClickListener() Jun 22 17:09:48 used the same drivers on my other pc and they worked fine Jun 22 17:09:53 adb is buggy as all hell Jun 22 17:09:57 both machines are running the same version of windows Jun 22 17:10:03 fb|, I am using it Jun 22 17:10:21 plus on this machine, i cant even browse any tablets files in windows explorer Jun 22 17:10:36 s73v3r, no. but the drivers of some manufacturers are Jun 22 17:10:51 yes it is. I’m constantly having logcat cut out on me Jun 22 17:10:57 when browsing the tablet, i either get "this folder is empty" or an unnamed folder that when i try to access just loads forever Jun 22 17:11:06 you should download an ubuntu image, burn it to a DVD and boot off that, then install android-tools-adb Jun 22 17:11:08 and this is on a nexus device Jun 22 17:11:08 and test that out Jun 22 17:11:09 s73v3r, logcat in AS or logcat in terminal? Jun 22 17:11:17 logcat in AS Jun 22 17:11:21 there you go. Jun 22 17:11:31 you should do adb lolcat too Jun 22 17:11:51 thats not adb, thats AS's logcat integration that sucks Jun 22 17:11:53 they would be getting the data from the same logcat component Jun 22 17:12:50 fb|, already done that Jun 22 17:12:59 doesnt work on ubuntu either Jun 22 17:13:05 adb logcat works like a charm Jun 22 17:13:10 never had a disconnect ever Jun 22 17:13:12 it has to be something with the motherboard Jun 22 17:13:21 Fraz, sounds like a hardware problem then, software isn't gonna fix it Jun 22 17:13:27 yeah Jun 22 17:13:32 the app I told you to use used ADB over TCP Jun 22 17:13:34 so you can just use wifi Jun 22 17:13:50 just charging the tablet a bit first then ill try Jun 22 17:13:54 not used this tablet in a while Jun 22 17:13:58 my tablet's USB port is kind of messed up after having it for 3 years so I use adb connect on that Jun 22 17:14:06 doesn't give me much issues Jun 22 17:14:24 there's another app that claims it doesn't need root, i've never tested it Jun 22 17:14:33 as long as i dont have to give the pc permisson on the device it should be ok Jun 22 17:14:35 https://play.google.com/store/apps/details?id=com.sherdle.adbwireless&hl=en Jun 22 17:15:00 oh nvm it says cable setup required Jun 22 17:15:03 i think ive tried this one actually Jun 22 17:15:09 yeh Jun 22 17:15:31 well it's time to play the waiting game then Jun 22 17:15:37 also i fucking hate memory leaks Jun 22 17:18:14 fb|, how do i actually go about connecting using this app? Jun 22 17:18:14 barq, just be familiar with what you need to change it to and it shouldn't be too difficult / will really be a reflection of your code's organization Jun 22 17:18:50 Fraz, once you run it on your pc you just do adb connect 1.2.3.4 where 1.2.3.4 is the IP address of the tablet Jun 22 17:19:08 lasserix: I didn't write the code, I just took over the legacy code, so hard to estimate. Haven't migrated from ABS to AppCompat before. Jun 22 17:19:09 then you can adb push/pull/shell as you normally woudl Jun 22 17:19:12 would* Jun 22 17:19:31 barq what is your min sdk you are targetting? Jun 22 17:19:36 10 Jun 22 17:19:40 anythingbelow 15 and you are a fool Jun 22 17:19:41 oh Jun 22 17:19:43 well Jun 22 17:19:45 still Jun 22 17:19:47 oh i need an app that runs on the pc too? Jun 22 17:19:52 dont just use regular adb? Jun 22 17:20:04 Fraz, you use regular adb Jun 22 17:20:18 do adb help so you can read how adb connect works Jun 22 17:20:24 lasserix: 15% of the app's users are still on 2.3.3-2.3.7, so can't increase the minSdkVersion yet Jun 22 17:21:07 how would i get the ip for the tablet? Jun 22 17:21:30 adb wifi will tell you the IP when you run the app Jun 22 17:21:36 barq . Are those 15% part of the targetted group of android users? Jun 22 17:21:39 barq you should ditch those folks Jun 22 17:21:50 they are just holding you down Jun 22 17:22:21 It's like targetting low end pcs for your games... Most low end pc users dont even play games Jun 22 17:22:26 barq, seriously though target API 15+ since that 15% is only gonna dwindle and you're gonna spend time supporting a platform that won't exist in a year Jun 22 17:22:40 If you are trying to fix so that textview should appear with text when you click something and nothing shows up when you run it. What should you check? Feels like I have everything that I need, and I add the text in the onPostExecute method in my class that extends AsyncTask Jun 22 17:22:49 Then next year I can get rid of it. Jun 22 17:22:53 Right now I can't, yet. Jun 22 17:22:58 ok it seems to be connected Jun 22 17:23:04 Fraz, fuck yeah! Jun 22 17:23:40 does it matter what software im wanting to debug with? im actually using unity engine Jun 22 17:23:55 should i just run as usual and it should work? Jun 22 17:23:55 anyone familiar with Otto Bus? Jun 22 17:23:55 as long as it connects through adb you're set Jun 22 17:24:01 i am Jun 22 17:24:02 ok sweet:D Jun 22 17:24:05 fingers crossed Jun 22 17:24:23 JakeWharton, what's your opinion on supporting devices older than ICS? Jun 22 17:24:34 don't do it Jun 22 17:24:56 they're low-value users and the cost of supporting them is higher than their worth Jun 22 17:24:58 So there's no way to get the optionsMenu working in https://ghostbin.com/paste/pn5ox ? Jun 22 17:24:58 ProTip: google "jake wharton" and see how much you should consider his advice Jun 22 17:25:00 barq: unless those 15% are actually addidng more than 15% to your bottom line, don’t do it Jun 22 17:25:06 thanks for all the software man! you're awesome JakeWharton Jun 22 17:25:15 minsdk 16 Jun 22 17:25:24 JakeWharton: where should i declare the event classes to transfer my information? inside the fragments where im going to post or in a separe file? Jun 22 17:25:39 luist: it's up to you. you should put them where they make the most sense. Jun 22 17:25:45 s73v3r: It's not my decision. Right now min is 10. Jun 22 17:25:55 luist: in the past we've put them in or near the source of the event Jun 22 17:26:01 just change that 0 to a 5 barq Jun 22 17:26:04 :D Jun 22 17:26:15 JakeWharton: the source is the receiver? Jun 22 17:26:16 JakeWharton: Any ideas how to get the optionsMenu to work in https://ghostbin.com/paste/pn5ox ? Jun 22 17:26:19 JakeWharton: or the post? Jun 22 17:26:23 bring them the costs of having to support them, and ask them if the revenues brought in are worth it Jun 22 17:26:28 luist: the person posting Jun 22 17:26:34 JakeWharton: okay.. thanks Jun 22 17:27:43 fb|, its not working:( Jun 22 17:27:59 Fraz, what does adb devices say? Jun 22 17:28:01 unity is complaining no android device, check that usb debigging is enabled etc Jun 22 17:28:19 oh Jun 22 17:28:21 Greetings peoples, I am trying to run an app on Android but everytime I start it it opens up the Settings menu and thats it. The device is listed and I'm using Linux. I'm using cordova on a Samsung SII. Anyone have any ideas? Jun 22 17:28:21 it shows no devices Jun 22 17:28:33 I tried putting setHasOptionsMenu in the ScreenSlidePageFragment, but cannot get it to work with ActionBarSherlock. Jun 22 17:28:36 so you did adb connect 1.2.3.4? Jun 22 17:28:40 ah now it does Jun 22 17:28:44 i had to reconnect Jun 22 17:28:47 try adb shell Jun 22 17:28:54 it shows the device, but says unauthorized Jun 22 17:28:59 AHAHAHA Jun 22 17:29:03 did the authorization dialog show up on the tablet? Jun 22 17:29:11 the allow usb debugging prompt popped up on the device Jun 22 17:29:16 man Jun 22 17:29:18 do it do it do it do it do it do it do it do it Jun 22 17:29:25 yo guys, I have a listview using a BaseAdapter. One row can contain a imagebutton. I want the button's imageresource to update when I press it. Jun 22 17:29:28 ive been waiting 6 months to see that Jun 22 17:29:29 Ive tried notifydatasetchanged() aswell as invalidate(). Nothing works... Jun 22 17:29:47 omg its so new and worky! Jun 22 17:29:52 haha Jun 22 17:29:54 awesome man Jun 22 17:30:30 cant beleive this, ive been in and out of this channel for months trying to get help Jun 22 17:30:39 15 ins in here today and i get it working Jun 22 17:30:43 mins* Jun 22 17:30:55 thanks fb|, youre a lifesaver Jun 22 17:31:08 np man Jun 22 17:31:27 you should post this kind of stuff on xda-developers you'll have better luck Jun 22 17:31:32 i did Jun 22 17:31:34 months ago Jun 22 17:31:36 damn :/ Jun 22 17:31:37 never had a single reply Jun 22 17:32:08 but that was about trying to figure out why it wasnt working on this pc, not about finding an alternative method Jun 22 17:32:33 ive been trying to fix the problem rather than finiding an alternative which i decided to try today Jun 22 17:32:54 the only thing i can recommend is what i usually tell people Jun 22 17:33:06 which is to try a different cable or usb port and every combination of both Jun 22 17:33:25 oh cool leakcanary started working all the sudden Jun 22 17:33:27 but it sounds like it's a hardware issue if it won't even work in linux Jun 22 17:33:50 hmm nispok is leaking my activity Jun 22 17:34:41 I have to replace ActionBarSherlock in the whole App, right? I can't start and partially migrate one Activity, can I? Jun 22 17:34:44 Hey folks, thanks for reviewing Velodrome, the blog post is live :-D http://levelmoney.github.io/android/java/onactivityresult/2015/06/22/introducing-velodrome.html Jun 22 17:34:46 Hey so the guys at google kind of did a major fail: the snackbar doesn't work with virtual keyboard! Jun 22 17:35:00 barq -> SherlockActivity goes to AppCompat activity Jun 22 17:35:05 then use toolbar instead of ABS Jun 22 17:35:54 Does anyone have a workaround for the fact the Snackback support widget doesn't play nicely with the virtual keyboard (that is, if the virtual keyboard is up, it'll cover the snackbar) Jun 22 17:36:03 barq, you can also include the support library and edit one activity at a time Jun 22 17:36:27 OK, that sounds like a good compromise. Jun 22 17:36:54 it'll add a lot of bloat but if you're just doing development on it, it won't matter too much Jun 22 17:36:59 fb|, this is the thread i made back in january http://forum.xda-developers.com/android/help/to-access-android-devices-pc-t3000779 Jun 22 17:38:21 fb|: What do you mean by a lot of bloat? I thought AppCompat is better than ActionBarSherlock? Jun 22 17:38:42 barq, you're gonna have both libraries in the same app Jun 22 17:39:21 Fraz it seems to me that there are more questions than answer in that particular board :/ Jun 22 17:39:25 Hmm, I added compile "com.android.support:appcompat-v7:22.1.0" Jun 22 17:39:29 Might as well change them all over to AppCompat in one go. It's pretty easy. Jun 22 17:39:30 22.2 Jun 22 17:39:43 But still not resolving the AppCompatActivity Jun 22 17:39:54 barq, yup until you remove ABS completely your APK size is gonna be bigger than it needs to be Jun 22 17:40:19 barq, http://inthecheesefactory.com/blog/android-design-support-library-codelab/en Jun 22 17:40:24 There's likely conflicts in attribute names if you depend on both ABS and AppCompat Jun 22 17:41:34 fb|, i wasnt really sure where to post it, this board seemed to be the most relative. I actually made another thread before this before i realised it was likely a hardware problem. In there i listed everything i tried Jun 22 17:41:48 i posted that in the board for the particular tablet i was using Jun 22 17:42:10 g00ey: that you g00s? Jun 22 17:42:16 http://forum.xda-developers.com/memo-pad-7/help/usb-debugging-memo-pad-me170c-k017-t2997886 Jun 22 17:42:22 noone ever replied to that one either:( Jun 22 17:43:40 wow leak canary is f-kin awesome Jun 22 17:43:49 is there a place to get free common android image resources? like an image that looks like > on a listview to indicating clicking it will carry onto another activity Jun 22 17:44:04 https://github.com/google/material-design-icons Jun 22 17:44:11 Wilkim: if you are using AS Jun 22 17:44:14 download that icons Jun 22 17:44:20 then install the plugin Android Drawable Importer Jun 22 17:44:38 you have to configure the plugin to point to the downloaded icon directory, but you can with one click install for all resoruce types Jun 22 17:44:43 what is AS? :) sorry n00b android developer here Jun 22 17:44:47 android studio Jun 22 17:44:55 is it a bad practice to run an activity function from a fragment? like ((MainActivity) getActivity()).showDialog(getString(R.string.someString)); Jun 22 17:45:08 Fraz, looks like you lucked out today. I'm only lurking here trying to get an answer too lol Jun 22 17:45:28 ah gotcha, yes that indeed I am using and thank you! Jun 22 17:45:49 well this is awesome all my memory leaks are related to nispok's snackbar Jun 22 17:46:09 luist: better to use a callback Jun 22 17:46:24 lasserix: like an event bus? Jun 22 17:46:25 set it in onAttach of fragment, make activity implement it Jun 22 17:46:27 sure Jun 22 17:46:31 but simpler way is to just Jun 22 17:46:54 yeah lol, i dunno what even provoked me to join irc and ask Jun 22 17:46:55 public interface Foo { doSomething() } then Activity implements Foo, then in fragment's on attach you can do mFooListener = (Foo) activity; Jun 22 17:46:56 cuz im already using an event bus for something else, so i though of changing this too Jun 22 17:47:04 was just out of the blue "ill give it one more go" Jun 22 17:47:08 yeah you can use the event bus too here Jun 22 17:47:13 okay thanks Jun 22 17:47:27 lasserix: you need to update the library. https://github.com/nispok/snackbar/commit/23e27b1c2a96fbe1575c801b312913fef31c67f8 Jun 22 17:47:35 lasserix is it bad to use material design icons for the part of the layouts that may be running on gingerbread and ics? Jun 22 17:47:49 Wilkim: f- those platforms Jun 22 17:47:51 look to the future Jun 22 17:47:55 stop supporting old devices Jun 22 17:48:04 that will cause you headaches and are not worth your development time Jun 22 17:48:14 https://developer.android.com/about/dashboards/index.html?utm_source=suzunone Jun 22 17:48:21 After replacing SherlockFragmentActivity with AppCompatActivity AS cannot resolve R, even after cleaning the project. Jun 22 17:48:27 you are talking about ~6 of all users Jun 22 17:48:37 Nothing wrong with using a material look on older platforms. Jun 22 17:48:42 barq I would start with a completly new project Jun 22 17:48:44 so your saying to start with 4.1? Jun 22 17:48:46 copy in what you need Jun 22 17:48:49 Wilkim: yeah Jun 22 17:48:52 In fact, Google is encouraging this. Jun 22 17:49:11 we want those deprecated os versions to die off, so lets as developers stop suporting them Jun 22 17:49:18 gotcha Jun 22 17:49:39 lasserix: How many hours do you think it will take to migrate this whole thing? Jun 22 17:49:45 I'm still minSdk-ing at 4.0.3. Though I'm thinking of moving up. Jun 22 17:49:48 and that's not a bad idea, my app isn't going to be too popular so i guess im only signing off possibly no more people then i can count on my hand Jun 22 17:50:04 barq i have no idea if you can show me a github link maybe i could give you some idea Jun 22 17:50:32 It's not on github, but it's around 20 activites Jun 22 17:50:55 anyone know off the top of their head how tall (dp) the snackbar is ? Jun 22 17:51:05 barq, just use a base activity Jun 22 17:51:08 well, again, new to all of this, how do I move up my min sdk? and do I need to make any changes to support this? I've only added a single layout file and the realm.io library Jun 22 17:51:13 add a method like setupToolbar Jun 22 17:51:30 Wilkim: edit the build.gradle file in your app module Jun 22 17:52:01 If you app crashes when you press the home button, is it onPause or onStop that is fucked up? Jun 22 17:52:15 that's all there is to it? Jun 22 17:52:21 onPause happens before onStop Jun 22 17:52:48 zajt, you'll have better luck looking at your logcat though Jun 22 17:52:52 to see what method caused the crash Jun 22 17:52:56 alright Jun 22 17:53:13 Does anyone have a work around to the fact the snackbar fails when the softkeyboard is shwoing since it shows up behind the soft keyboard? Jun 22 17:53:22 Wilkim: yeah Jun 22 17:53:35 lasserix, adjust Pan or resize ad necessary Jun 22 17:53:57 lasserix, or don't use translucent status bars Jun 22 17:54:22 pfn why the second one? Jun 22 17:54:51 lasserix, because it interacts strangely with the keyboard Jun 22 17:55:06 ahh weell that's out Jun 22 17:55:18 i am already using adjustresize Jun 22 17:55:46 since we wanted a elevations tyle thing seperating the content view from the soft keyboard Jun 22 17:56:01 huh Jun 22 17:56:49 adjust resize doesn't work with translucent status bars Jun 22 17:56:54 bug 63788 Jun 22 17:56:57 63777 Jun 22 17:57:52 ahh Jun 22 17:57:55 i see that now Jun 22 17:57:59 Guys.. what is the correct term of myWM in this snippet? "WifiManager myWM = (WifiManager) getSystemService(Context.WIFI_SERVICE);" Jun 22 17:58:04 wifimanager object? Jun 22 17:58:07 or? Jun 22 17:59:14 pfn: so doing blank project to see what i can get this snackbar to do, if i do adjustpan/resize and no translucent startbars still doesn't work Jun 22 17:59:17 It's an instance of WifiManager. Jun 22 17:59:35 thx TacticalJoke Jun 22 17:59:47 You could also call it an object. Jun 22 18:00:11 what exactly does doesn't work mean in this case Jun 22 18:00:21 if your view is rendering properly, so should the snackbar Jun 22 18:00:28 An object whose type is WifiManager. Jun 22 18:00:45 "a wifi manager" Jun 22 18:01:02 pfn: the snackbar is still at the bottom of the layout Jun 22 18:01:11 ie, covered up by the softkeyboard Jun 22 18:01:13 lasserix, then sounds like the problem is your layout Jun 22 18:01:20 not the snackbar Jun 22 18:01:38 well i have to use translucent status bar Jun 22 18:01:42 the softkeyboard doesn't cover anything Jun 22 18:01:52 translucent status bar is a different issue, use the workarounds as documented Jun 22 18:02:26 can you point me to url? Jun 22 18:02:51 lasserix, in the bug comments Jun 22 18:04:19 thanks Jun 22 18:04:20 for Integer.getInteger("1"), exception "java.lang.NullPointerException: Attempt to invoke virtual method 'int java.lang.Integer.intValue()' on a null object reference" is being thrown Jun 22 18:04:31 so adjustresize is incompatible with translucent statusbar? Jun 22 18:04:46 pfn: ahh you're right, it did work with adjust resize thanks Jun 22 18:04:54 (but still got to figure out translucent status bar ;p Jun 22 18:04:56 thanks pfn Jun 22 18:07:48 surf2b1 sorry just saw your comment, i ned to update the library--in regards to what? Jun 22 18:10:12 Kuldeep: Google has lots of answers for that. Jun 22 18:10:20 I'm on my phone but just found a load. Jun 22 18:13:13 my problem may be similar to kuldeep's, but ive tried some of the solutions on google. im trying to implement a ViewSwitcher and this http://pastebin.com/dZs5zy5a is what i have, but im getting a nullpointerreference as well, even with initializing the viewswitcher. here is the layout it is based off of http://pastebin.com/aUSy6EGw Jun 22 18:14:09 and the specific error: "Attempt to invoke virtual method 'android.content.res.Resources android.content.Context.getResources()' on a null object reference" Jun 22 18:14:23 at the line where im initializing the viewswitcher Jun 22 18:14:46 TacticalJoke, "1" should return 1. (not null) Jun 22 18:15:00 hi i have in my rom asign a permission in platforms.xml to a new user i have added in system; is there a command line to see if th enew user is indeed getting the permissins Jun 22 18:15:27 id replace Integer.getInteger("1") with int i = 1 :p Jun 22 18:15:57 troulouliou_dev, wrong channel. go to #android-root Jun 22 18:16:05 TacticalJoke, i understand that it is converting to primitive type (via intValue()) but how come Integer.getInteger("1") return null? Jun 22 18:16:31 I don't know: I'd have to google. :D Jun 22 18:16:41 Google would tell me, though. Jun 22 18:16:56 danijoo, my debug log printed has stringified version Jun 22 18:17:40 kuldeepdhaka, the reason for your error is that Integer.getInteger is not for converting strings to integer Jun 22 18:18:14 bobbiejim: What does the stack trace show? Jun 22 18:18:14 try Integer.parseInt() Jun 22 18:18:16 kuldeepdhaka: https://developer.android.com/reference/java/lang/Integer.html#getInteger(java.lang.String) Jun 22 18:18:24 pfn: do you remember which solution actually worked? http://stackoverflow.com/questions/21092888/windowsoftinputmode-adjustresize-not-working-with-translucent-action-navbar/22266717#22266717 Jun 22 18:18:29 There's probably no system properly named "1" Jun 22 18:18:36 I suspect it's related to doing stuff before Activity.onCreate. Jun 22 18:18:49 property Jun 22 18:19:37 Is putting a snackbar at the top of the activity totally material anti-pattern? Jun 22 18:20:01 maybe not totally, but at least a lot :) Jun 22 18:20:14 better fix your layout Jun 22 18:20:25 SimonVT, what is system property? Jun 22 18:20:41 i thing parseInt is what im looking for, lemme try Jun 22 18:20:50 kuldeepdhaka, int i = Integer.parseInt("1") Jun 22 18:20:51 Is it possible to have https://github.com/the4thfloor/volley as a gradle dependency and not import the source into my project? Jun 22 18:20:52 yup Jun 22 18:21:03 danijoo: problem is even if i fix the layout, having the snackbar at the bottom still looks worse Jun 22 18:21:07 it covers up some other stuff Jun 22 18:21:13 at the top, over the action bar makes more sense Jun 22 18:21:21 for this particular layout Jun 22 18:21:22 over? oh.. :/ Jun 22 18:21:27 here ill show Jun 22 18:21:30 Tactical joke let me paste the whole thing one sec Jun 22 18:21:32 i think over would suck Jun 22 18:22:17 kuldeepdhaka: Y'all need to google stuff. Jun 22 18:22:43 TacticalJoke, yes, i should. Jun 22 18:22:48 http://pastebin.com/VmNyWMAA Jun 22 18:23:15 It's just a properly.. Jun 22 18:23:20 Look up System#getProperty Jun 22 18:23:29 TacticalJoke theres the stack trace. its got something to do with the way im initializing the viewswitcher, but ive initialized it the way ive seen others do when solving nullpointerexception problems on SO Jun 22 18:23:30 Yeah, I think you need to create that thing in Activity.onCreate. Jun 22 18:23:45 the viewswitcher? Jun 22 18:23:51 (new version of rtfm => please google it :P) TacticalJoke no offense intended Jun 22 18:23:56 Field initializers run before onCreate. Jun 22 18:24:46 yeah, i have the switcher initialized before the oncreate method Jun 22 18:24:54 danijoo, worked. Jun 22 18:24:56 unless youre talking about something else Jun 22 18:25:02 You can't access resources abs stuff before onCreate. Jun 22 18:25:06 That's the one. Jun 22 18:25:16 thanks TacticalJoke danijoo SimonVT Jun 22 18:25:28 ahhh ok so onCreate should come before anything...lets try that out Jun 22 18:26:37 SimonVT, btw i do not think Integer class is a good place to keep method for reading system properties. Jun 22 18:27:13 That decision is probably a decade old Jun 22 18:27:39 probably two Jun 22 18:28:01 a decade ago was Java 1.5 Jun 22 18:28:18 Yeah Jun 22 18:28:57 There was probably a reason for it back then, bit late to change it Jun 22 18:30:01 TacticalJoke i tried initializing the viewswitcher inside oncreate, i get a different error but its similar to what i was getting before (still nullpointerexception, just having to do with a method called on the viewswitcher and not on grabbing the resources) Jun 22 18:30:49 danijoo: http://postimg.org/image/sztp5jgkj/ Jun 22 18:30:57 could it be possibly because the viewswitcher hasnt loaded entirely? Jun 22 18:30:58 http://hanhuy-acra.appspot.com/public/com.hanhuy.android.keepshare/32492a46acb5562f8bf0bfe6a9fedd6db07b572e Jun 22 18:31:00 ugh, wtf is this crash Jun 22 18:31:28 recursive call on the spannable? Jun 22 18:31:34 It's hard for me to help much as I'm on my phone, but the stack trace should guide you. Jun 22 18:31:40 *recursive out of control in the spannable generation Jun 22 18:32:08 danijoo: http://postimg.org/image/sztp5jgkj/ see. at the top, imho, it looks much better Jun 22 18:32:19 lasserix, obviously not something I call directly Jun 22 18:32:20 The stack trace is the holy word of The Almighty. Jun 22 18:32:25 Anyone good at SQLiteOpenHelper here? Jun 22 18:32:38 pfn: oh i didn't know if you were using a library or something Jun 22 18:32:38 zajt: just ask a question Jun 22 18:32:42 holy shit acra Jun 22 18:32:45 i didn't know people actually used that Jun 22 18:32:49 lasserix: https://www.google.com/design/spec/components/text-fields.html# Jun 22 18:32:54 Don't use a snackbar for that Jun 22 18:32:57 zajt: i've got her number on speed dial Jun 22 18:32:58 it looks slightly less of a joke than before Jun 22 18:33:00 lasserix, what library, it's all android framework Jun 22 18:33:06 JakeWharton, that's my own reporter crap Jun 22 18:33:31 SimonVT: are those supported by the new support design library? Jun 22 18:33:38 I'm writing an method to get the information from the database, but I'm not sure what to write in a while loop. Here is what I have so far: http://pastebin.com/QbsHuQwq Jun 22 18:33:40 *those kind of error-text fields Jun 22 18:34:07 zajt: you have to do if(c.moveToFirst()) because the c might not have returned any rows Jun 22 18:34:10 will be difficult if you havent seen my other classes :P Jun 22 18:34:10 There's something for that somewhere, yes Jun 22 18:34:14 Not sure what it's called Jun 22 18:34:27 iirc Chris Banes has posted a bit about it on g+ Jun 22 18:34:30 zajt: also, you don't know that the cursor returned not null, because your query syntax might have been messed up Jun 22 18:34:37 SimonVT: thanks Jun 22 18:34:44 no problemo. im getting another null pointer exception on the view switcher, so im wondering if maybe i should make a check to be sure the viewswitcher is loaded or something before i run the methods on it Jun 22 18:34:46 I'll run it by the higher ups and see Jun 22 18:34:48 SimonVT: thanks Jun 22 18:34:54 lasserix: yeah true, so it is a mush to check if(c.moveToFirst()) ? Jun 22 18:35:08 no Jun 22 18:35:48 NPEs are fundamentally simple: a reference is null when it's expected not to be. It's just a case of figuring out where and why. Jun 22 18:36:35 lasserix: to fix leaking the activity context Jun 22 18:38:08 NPEs just means the code is trying to access something that isnt actually there right? Jun 22 18:39:17 not sure what I should do in the if(c.moveToFirst()) lasserix Jun 22 18:39:19 It usually means a reference is null and it appears to the left of '.': nullReference.method(); Jun 22 18:40:15 ugh, dunno wtf is triggering this stack overflow Jun 22 18:43:51 zajt: http://pastebin.com/6RNmpsRy Jun 22 18:44:10 zajt: you can do other things like setTransaction succesfull and other nonsense with the try catch Jun 22 18:44:17 I should ditch materialedittext for the design lib layout Jun 22 18:44:18 hmm Jun 22 18:44:21 maybe I'll try that Jun 22 18:44:24 surf2b1: ah thanks Jun 22 18:45:06 lasserix: alright gonna go through that but can't you write if(cursor != null && cursor.moveToFirst()) ? Jun 22 18:45:39 http://pastebin.com/nveNhkEy Jun 22 18:45:43 sire Jun 22 18:45:45 *sure Jun 22 18:45:58 i am just spelling it out for you since you seem to not done it before Jun 22 18:45:59 Just do while (cursor.moveToNext()) Jun 22 18:46:01 optimize it as you like Jun 22 18:46:24 SimonVT: you still might want to look up column indexes Jun 22 18:46:37 which people like to do every loop iteration for some reason Jun 22 18:46:52 You can just do that before the while loop Jun 22 18:47:11 so if I write that if-statement, I first check if it's not null(which is neccessary because otherwise I can't go through any rows and recieve data), and then I check if I can move to the first row with moveToFirst(because it is not sure that even though it's not null, there might be empty rows ? Jun 22 18:47:13 SimonVT: so you are saying ditch moveToFirst? Jun 22 18:47:15 am I correct here? Jun 22 18:47:31 It makes no difference Jun 22 18:47:49 I just prefer while over do-while Jun 22 18:48:59 Also, wtf at the catching everything Jun 22 18:49:01 zajt: http://pastebin.com/aLd373WT Jun 22 18:49:12 SimonVT: just trying to suggest he add more catches Jun 22 18:49:16 that are specific Jun 22 18:49:27 but to show that you should add some catches, that you know how to handle Jun 22 18:49:46 alright there are always many ways to do something, but was I correct about my if-statement above? Jun 22 18:49:47 //various other exceptions you can catch --> catch the specific exceptions Jun 22 18:49:57 when i tried to explain it Jun 22 18:50:09 zajt: if you use try / catch / finally it doesn't matter Jun 22 18:50:13 if it's null it'll throw Jun 22 18:51:17 yeah but I guess I had correct about this I wrote: "so if I write that if-statement, I first check if it's not null(which is neccessary because otherwise I can't go through any rows and recieve data), and then I check if I can move to the first row with moveToFirst(because it is not sure that even though it's not null, there might be empty rows ?" Jun 22 18:51:30 just wanna make sure that I got that right, then I'll go forward :) Jun 22 18:52:53 zajt: s/empty rows/no rows Jun 22 18:53:03 catching NPEs :/ just do if != null Jun 22 18:53:28 whoa, catch (Exception oops) ... no no no Jun 22 18:53:39 As Gordon Ramsay would say: "problem problem problem" Jun 22 18:53:48 icedp: what do you mean there? Jun 22 18:54:33 zajt: if query returned *no rows* moveToFirst will return false. You said "empty rows" Jun 22 18:55:14 oh SimonVT: so using the text validation (under the edit text) for showing error works on text validation, but what about log in failure? Shouldn't that be handled by the snackbar? And in that case, then it still seems better to show it at the top then toggle the soft keyboard to show the snackbar at the bottom (ie, on submit hide keyboard, if fails, show snackbar, once snackbar is dimissed re-request focus on the edi Jun 22 18:55:14 ttext, as opposed to just leaving it open and closing it if success or showing the error from the server at the top and not closing/opening it) Jun 22 18:55:16 oh alright Jun 22 18:55:38 anyone familiar with this textview-font-helper library? any gotchas in using it that aren't documented, think it's awesome/terrible, etc? https://github.com/chrisjenx/Calligraphy Jun 22 18:55:39 SimonVT: basically, I'm asking what's a UI design pattern here for not text validation, but whether the login was successful or not? Jun 22 18:56:03 Is it good to use try-catch when using databases? Jun 22 18:56:10 like you did lasserix Jun 22 18:56:20 I would just display that as text on the screen, not as a snackbar Jun 22 18:56:22 zajt: yea it is good practice to not leave your cursors open Jun 22 18:56:23 Snackbars disappear Jun 22 18:56:31 yeah true Jun 22 18:56:53 SimonVT: currently it'll show like "Login failed" then rerequest focus on the email input Jun 22 18:57:17 Login failed isn't very descriptive Jun 22 18:57:20 by displaying it as text, you mean as part of the view hierarchy there or something superimposed? Jun 22 18:57:20 hello Jun 22 18:57:20 Tell them what failed Jun 22 18:57:25 why did you instansiate(spelling?) the arraylist inside the if-statemenet and not like I did directly in the beginning of the method? Jun 22 18:57:28 I can't its not my call Jun 22 18:57:48 can anyone help me with android API functionality, can I set users network or APN? Jun 22 18:58:11 zajt: because it if fails you allocate it and set capacity to zero, but this really depends on how you want to handle no results Jun 22 18:58:28 alright Jun 22 18:58:35 zajt: Everyone else would just instantiate it at the beginning, no reason to wait Jun 22 18:58:54 yeah so it isn't wrong, just personal preferences and small details Jun 22 18:58:55 :) Jun 22 18:59:08 SimonVT: I originally did that but due to security reasons they didn't want me to do that, by saying "display text" you mean that's already part of that view hiearchy or somethign I add as a kind of "overlay" or like alert dialog? Jun 22 18:59:42 Yes, part of the view hierarchy Jun 22 18:59:46 Yeah, I just display "Invalid password" (or whatever) in a TextView. Works well. Jun 22 19:00:08 "Email or password incorrect" or something Jun 22 19:00:11 "No connection to server" Jun 22 19:00:22 again, the only error message is either No internet or Login failed. Jun 22 19:00:22 yeah, sometimes it's good to not tell if the login was wrong or the password Jun 22 19:00:34 i did that originally but the people who are paying me said no. Jun 22 19:00:37 Having a snackbar for a few seconds isn't very helpful, the user might not even notice it Jun 22 19:00:38 in case someone is under attack ;) Jun 22 19:01:11 otherwise you give the hint that hte login is correct, then only the password to find remains Jun 22 19:01:16 SimonVT: okay ill ask the designer and see if he can come up with something Jun 22 19:01:21 adq again not my call Jun 22 19:01:26 just discussing :) Jun 22 19:01:33 That's true. I think I don't reveal whether it was the actual username or password (in fact, AFAIR, I don't even know which). Jun 22 19:01:35 adq i validate whether it is a valid email, but i can't say wrong password Jun 22 19:01:47 adq: doesn't make sense, if login is registered can be checked on Sign up Jun 22 19:02:02 i did not backlog, sorry Jun 22 19:02:22 icedp: it is a security concern Jun 22 19:03:00 You should never reveal whether it's the email or password that's wrong.. But imo you should let them know that either the email or the password is the issue Jun 22 19:03:04 There could be other issues Jun 22 19:03:26 lasserix: attacker would check if login is register by trying to sign up, then obviously when attacker tries to log in with that login - that is password which is wrong. what security is added by message "login or password is wrong" if it's known login exists? Jun 22 19:03:59 It's a lot more effort to do that, to be fair. Jun 22 19:04:08 lasserix: hmm not sure how I should add them to the list there since my SearchResultItem got no constructor Jun 22 19:04:33 I used to care about not revealing if it's email or password... but nearly every site will tell you if "you already have an account" if you try to sign up with an email that already exists, or tell you if your "forgot password" email is wrong. which makes it pretty easy to tell if the email is right nor not. Jun 22 19:04:42 TacticalJoke: that is no effort for attack, but some effort for users Jun 22 19:05:05 maybe it's my return parameter that is wrong, that it shouldn't be a list with SearchResultItem Jun 22 19:06:25 zajt: add a constructor Jun 22 19:06:26 security has to be set up proportionnally to what you protect Jun 22 19:06:31 it's not a nuclear plant Jun 22 19:06:53 but also, every piece of information disclosed which was unknown originally is still something Jun 22 19:06:59 but agreed, if it was known, no pb Jun 22 19:07:02 how can i identify whether the IOException will catch this specific error: Error:﹕ Unable to resolve host “someserver.com": No address associated with hostname Jun 22 19:07:05 (it == the login) Jun 22 19:07:10 not sure if it's correct in my project to add a constructor which takes two strings there Jun 22 19:07:30 SimonVT: i validate email or passord client side (must contain @ password must be so many characters long since there is no reason to do a wasteful server call), but as far as putting text into the UI layout for showing error from server, where would you dedicate such space? Jun 22 19:07:35 luist: log the type of exception, then look up the inheritance hierarchy Jun 22 19:07:54 like swap out the signin button for the text, then have an okay and re-request focus and show the signin button or something? Jun 22 19:07:56 man i still cant figure this out... getting a null pointer exception on a view switch that i initialize in onCreate, after setting the contentview and everything else that SO suggested (http://pastebin.com/eKpLr18w). still getting the NPE, stack trace here http://pastebin.com/8YNW2i5w Jun 22 19:08:11 anyone know what im doing wrong? its something with the way im initializing the viewswitcher but im not sure what Jun 22 19:08:12 SimonVT: or do you have a good example of that from a screenshot i could see online (ie an app that does it well)? Jun 22 19:08:23 SimonVT: *thanks for all the help btw Jun 22 19:09:03 bobbiejim: Jun 22 19:09:13 you need to prefix findViewById by the view its in Jun 22 19:09:14 bobbiejim: check your layout. apparently that ID doesn't exist in it Jun 22 19:09:34 how can I set network or APN with API? Jun 22 19:09:38 ie, findViewById from the activity is looking in the activity layout, you're probably looking for a view inside the viewswitcher, so you need to do viewSwitcher.findViewById Jun 22 19:09:50 lasserix, https://plus.google.com/+CyrilMottier/posts/j9FKakj2d7s Jun 22 19:09:55 bobbiejim: but you didn't indlude a stack trace so... Jun 22 19:10:02 if it's about UI placement Jun 22 19:10:10 you might find it inspiring Jun 22 19:10:14 groxx: how do i log the type? im simply using catch (IOException e) Jun 22 19:10:17 i did? it was the second pastebin Jun 22 19:10:21 unless i didnt actually link that lol Jun 22 19:10:23 http://pastebin.com/8YNW2i5w Jun 22 19:10:37 You did. :D Jun 22 19:10:46 adq ahh man that is actually fugly in my opinion wayyy too much going on ;p Jun 22 19:10:47 luist: e.printStackTrace() will include it. Jun 22 19:10:59 adq but also where does error from server go in this screen? Jun 22 19:11:19 idk lol Jun 22 19:11:22 sorry :/ Jun 22 19:11:33 bobbiejim: look at line 107 Jun 22 19:11:56 lasserix: how about: replace the button with an error display. it would be useless for them to re-submit until they change a field anyway. Jun 22 19:12:08 groxx yeah that is what i just asked Jun 22 19:12:10 lasserix, i shake horizontally like someone denying with his head Jun 22 19:12:19 the window were an wrong input has been entered Jun 22 19:12:22 groxx: UnknownHostException it seems… :) thanks Jun 22 19:12:28 i'm not fan of chris bane stuff to be honnest Jun 22 19:12:35 but i see so many ppl liking it blablabla Jun 22 19:12:37 style-wise or code-wise? Jun 22 19:12:37 groxx: so hide sing in/ show error, then when did i hide error and put sign in ? Jun 22 19:12:41 and he seems to have quite an influence on google Jun 22 19:12:46 yeah its a problem with the viewswitcher not being created yet i believe. what exactly do you mean when you say to include the FindViewByID prefix? Jun 22 19:12:57 lasserix: as soon as something changes, probably Jun 22 19:13:14 bobbiejim: when you need to find a view inside a view you inflate in code, if you are in an activity, if you have to do mInflatedView.findViewById not findViewById Jun 22 19:13:23 is there a good way to implement a tuple with more than 2 elements Jun 22 19:13:45 groxx: ahh so put the focus back on the email, then if email or password changes swap it out Jun 22 19:13:58 lasserix: they're in an activity, findViewById() searches everything for you there. Jun 22 19:14:15 groxx it won't work if you haven't attached the view to that activity view hierarchy Jun 22 19:14:24 ok let me try mInflated Jun 22 19:14:28 setContentView is called before findViewById, so it should work. Jun 22 19:15:03 pagefault: `static class Tuple { final Whatever what; final Another ohNoes; final Third yay; }` :) Jun 22 19:15:44 well it would be nice if it was dynamically sized and tuples don't care about what data they hold Jun 22 19:15:46 it doesnt know what inflated view is haha Jun 22 19:15:52 pagefault: unless you want to make your own Triple wrapper. but personally I find those harder to read (except in the rare cases where "tuple.first" / .second / .third actually makes semantic sense) Jun 22 19:16:04 pagefault: so a list? Jun 22 19:16:07 yeah Jun 22 19:16:10 pagefault, dynamically sized?I think we call that list Jun 22 19:16:19 list is bloated but I guess the only solution here Jun 22 19:16:28 ArrayList is pretty much an array with helper methods Jun 22 19:16:31 list is bloated? Jun 22 19:16:36 arraydeque ftw Jun 22 19:16:38 compared to a tuple it is Jun 22 19:16:46 you dont want tuple Jun 22 19:16:57 ArrayList has two fields Jun 22 19:17:03 u want a dynamic number of items Jun 22 19:17:09 thats not called tuple. thats called list Jun 22 19:17:14 I usually just give up and make a class Jun 22 19:17:18 it's usually more readable anyway Jun 22 19:17:25 ArrayList just maintains an array. It's not very heavy. Jun 22 19:17:26 but it has all kinds of methods attached I never use Jun 22 19:17:55 methods don't really cost you anything Jun 22 19:17:59 who cares Jun 22 19:18:02 its just methods Jun 22 19:18:14 yeah who cares about memory usage Jun 22 19:18:21 it's already in memory, it costs you nothing Jun 22 19:18:23 methods cost kinda nothing Jun 22 19:18:45 it's just stupid Pair() is not extendable to support more than two elements Jun 22 19:18:57 because then you're better off with a Collection of some kind Jun 22 19:19:02 Then it wouldn't be a pair Jun 22 19:19:10 I know it would be a tuple Jun 22 19:19:10 ayy i got it Jun 22 19:19:20 pair is just a tuple capped at 2 elements Jun 22 19:19:25 fwiw: https://code.google.com/p/guava-libraries/wiki/IdeaGraveyard Jun 22 19:19:30 threw my entire viewswitcher_layout.xml into my mainactivity.xml Jun 22 19:19:32 why guava didn't implement a generic tuple type Jun 22 19:19:37 do you also dont used enums because they are so memory heavy compared to ints? Jun 22 19:20:08 and using a list I would have to do a list of Object and cast each one as I pull it out Jun 22 19:20:13 and ofc no strings. char[] ftw! Jun 22 19:20:37 If you're using ArrayList elsewhere, those extra methods should entail zero overheard. Jun 22 19:20:50 danijoo: thats not true anymore Jun 22 19:21:00 so make your own tuple, it's easy. and if you have a bunch of types in a dynamically sized "tuple"... how would you get type safety anyway? Jun 22 19:21:01 what is not true lasserix ? Jun 22 19:21:06 enum performance Jun 22 19:21:12 it was ironic.. Jun 22 19:21:20 pagefault: oh btw you might check out trove Jun 22 19:21:26 if you need primitive collections Jun 22 19:21:33 takes up like 60% less space Jun 22 19:21:36 and is much, much faster Jun 22 19:21:39 i'm not saying it's not easy i'm just wondering why it was never added Jun 22 19:22:13 lasserix: Enums are still less performant. Jun 22 19:22:33 They're objects that need to be collected. Jun 22 19:22:34 but negotable Jun 22 19:22:39 Right. Jun 22 19:22:51 its like caring that for(i: T) is less performant Jun 22 19:24:28 why i cant create a subclass inside a AsyncTask extended class? :( Jun 22 19:24:36 U CAN Jun 22 19:25:01 unless its already an inner class Jun 22 19:25:26 pagefault: because "tuple.first" is less descriptive than "tuple.descriptiveFieldName". and until you have profiled your code and can prove otherwise, it has identical performance to any tuple. Jun 22 19:26:11 i'm just saying the data type should exist Jun 22 19:26:17 since it does for every other OOP language Jun 22 19:26:27 Actually, I think what I said about enum instances being collected is wrong, since they're static fields. Jun 22 19:26:30 TacticalJoke: are you sure enums are GC'd? Jun 22 19:26:38 Yeah, I think they're not. Haha. Jun 22 19:26:39 the fact that it _does not_, despite java being around for so long, implies a very large number of people disagree with you about its existence. Jun 22 19:26:52 it's not a clear "it should exist". that's opinion. Jun 22 19:26:55 When you handle database in android, with like SQLiteOpenHelper. Then, is it mosly always the same that you create on method to put information to the database with the parameters as the values, and then one method to read the database information with no arguments(and in this method you first get the column index, and then the values from that) ? Jun 22 19:27:01 danijoo: Could not dispatch event: class com.myproject.mappscore.ConfigDownloader$ConfigDownloadErrorEvent to handler [EventHandler public void com.myproject.mappscore.MainActivity.onConfigDownloadError(com.myproject.mappscore.ConfigDownloader$ConfigDownloadErrorEvent)]: Can't create handler inside thread that has not called Looper.prepare() Jun 22 19:27:07 danijoo: getting this ^ Jun 22 19:27:11 TacticalJoke: yeah they take up more space, but that was in the early days, today it is preferable to use them since they make your code cleaner to read Jun 22 19:27:27 danijoops Jun 22 19:27:33 I have the following ImageView that I want to make clickable https://ghostbin.com/paste/brcaq I have an OnClickListener, but the Image is only clickable in the top left corner of the Image. How can I get the entire image to be clickable? Jun 22 19:27:35 lol Jun 22 19:28:09 like yours it's an opinion, but there seems to be other people like me asking the same question Jun 22 19:28:37 yep. and the answer is "make one" :) it takes less time to make one than to complain about its nonexistence Jun 22 19:28:44 pagefault: do you have an example of dynamic-size tuple in statically typed language? Jun 22 19:28:51 luist, am I your personal debugger? ^^ Jun 22 19:29:12 c++ Jun 22 19:29:15 c# Jun 22 19:29:18 python Jun 22 19:29:21 ruby Jun 22 19:29:21 also the error said whats wrong Jun 22 19:29:29 no Looper prepared Jun 22 19:29:33 danijoo: that would be great :P Jun 22 19:30:13 i cant instantiate it inside doInBackground unless its also async? Jun 22 19:30:25 pagefault, wheres that dynamic tuple in ruby Jun 22 19:30:50 luist, you can. you must prepare looper Jun 22 19:30:54 thats whay it says Jun 22 19:31:12 I tried using android:background="?android:selectableItemBackground", but still the same behavior. Jun 22 19:31:13 pagefault: if you're referencing C#, you probably mean that they have a varargs-like type param? java doesn't have that ability at all. Jun 22 19:31:37 http://ruby-doc.org/stdlib-2.0.0/libdoc/rinda/rdoc/Rinda/Tuple.html Jun 22 19:32:11 or does C# just provide a bunch of implementations of Tuple, and nobody realizes it? Jun 22 19:32:34 well. didnt know about this Jun 22 19:32:46 but the thing is in ruby you dont have to care because its not satically typed Jun 22 19:32:52 pagefault: *statically* typed. I don't know c# but it seems there are several kinds of tuples. can they change length? Jun 22 19:32:55 you could just use a list there Jun 22 19:33:49 you don't change the length of a tuple once it's been initialized Jun 22 19:33:55 they are immutable Jun 22 19:34:04 array it is then Jun 22 19:34:20 lol. ok, so no, C# does not have variable-length type arguments, it just has a bunch of implementations: https://msdn.microsoft.com/en-us/library/system.tuple%28v=vs.110%29.aspx Jun 22 19:34:23 an array that can hold different types of data Jun 22 19:34:28 yeah. Jun 22 19:34:29 an array can only hold one type Jun 22 19:34:29 you can do C#'s in java trivially Jun 22 19:34:40 in java yes Jun 22 19:34:48 just use a list man Jun 22 19:34:51 If I use ImageButton the whole thing is clickable, but I want to remove the borders and with style="?android:attr/borderlessButtonStyle" I can only trigger the OnClickListener from the top left corner. Jun 22 19:34:57 yes I know Jun 22 19:35:13 pagefault | well it would be nice if it was dynamically sized [tuples] Jun 22 19:35:16 that seems to be the only way to do it Jun 22 19:35:31 with type safety, yes. Jun 22 19:35:34 not even a bad one Jun 22 19:35:34 icedp: that was a quote Jun 22 19:35:38 pagefault: Jun 22 19:35:50 So excited my app has no memory leaks Jun 22 19:35:52 amazing Jun 22 19:36:02 no leaks you know about yet :pp Jun 22 19:36:17 well i have been using leakcanary Jun 22 19:36:19 does an infinitely-deep activity stack count? and can I build that? Jun 22 19:36:30 dynamically sized at init Jun 22 19:36:32 How useful are tuples in a static language? Saying foo.first/second/third isn't very nice in general. Jun 22 19:36:34 and nothing has popped up yet but a third party library Jun 22 19:36:38 anyway this is beyond the scope of my question Jun 22 19:36:44 fourth, etc. Jun 22 19:36:56 I think I'm still confused. what about any of this is actually dynamically-sized? C#'s isn't. C++'s isn't. Jun 22 19:36:57 pampersdroid called: http://i.imgur.com/QoC8dlg.jpg Jun 22 19:36:59 lasserix: When you handle database in android, with like SQLiteOpenHelper. Then, is it mosly always the same that you create on method to put information to the database with the parameters as the values, and then one method to read the database information with no arguments(and in this method you first get the column index, and then the values from that) ? Jun 22 19:37:12 leak canary is no guarantee Jun 22 19:37:25 danijoo: i did a bunch of other investigations too Jun 22 19:37:33 I was just asking if there was a good way to emulate a tuple type class from other languages, so list it is, thanks Jun 22 19:37:35 none of them is one Jun 22 19:37:45 what i need to do know is make some singeltons out of the exoplayer instances Jun 22 19:38:06 zajt: that presumes a) you'll never forgot b) you're not working with other people Jun 22 19:38:15 pagefault: just create class Tuple2(T1 t1, T2 t2) and so on Jun 22 19:38:20 zajt: you don't have to look up column indexes, but you might as well to be safe Jun 22 19:38:37 since they may change over time if the project is large or other people are also working on it Jun 22 19:38:39 yeah but it feels like it's similar Jun 22 19:38:42 yeah ofc Jun 22 19:38:47 what's similar? Jun 22 19:39:04 sorry i didn't quite get your question i guess Jun 22 19:39:06 but for like small apps, it same steps, like first get columnindex then value Jun 22 19:39:15 it's Jun 22 19:39:26 its just good programming style Jun 22 19:39:33 yeah Jun 22 19:39:43 the column indexes won't change during that execution Jun 22 19:39:44 or just accept Object ... o, because you're going to have to statically define the types or cast anyway Jun 22 19:40:02 just don't look up the column indexes inside the loop Jun 22 19:40:07 do you get teamviewer and wanna check what my returntype should be? not sure if it's correct as it is now and I don't think I should create an constructor in the class Jun 22 19:40:21 cuz I have connected the values to a jsonparser Jun 22 19:40:24 in that class Jun 22 19:40:27 zajt: just add the constructor to your class Jun 22 19:40:38 or use a builder motif Jun 22 19:41:02 constructor with 2 random strings? i'll try to see if it works but not sure if it's the correct strategy Jun 22 19:41:12 lasserix: inside the while loop? Jun 22 19:41:27 no Jun 22 19:41:30 that was an example Jun 22 19:41:38 look up the column indexes of your column names Jun 22 19:41:43 oh ok i did like this http://pastebin.com/Ln5HUuje Jun 22 19:41:47 to get the values from the row as you iterate Jun 22 19:42:07 or they are not inside the while loop now, so it looks good I guess Jun 22 19:42:11 sure but why are you stuffying json into a database? Jun 22 19:42:32 i'm not putting json in a database, but the class SearchResultItem is connected to a jsonparser Jun 22 19:42:32 kinda defeats the point of a relational database Jun 22 19:42:48 COLUMN_JSONSTRING ? Jun 22 19:44:41 yeah but that's good for my app, it's easy to use Jun 22 19:45:03 then I can get all data after I take the jsonstring and parse it Jun 22 19:47:01 you should parse it then put it into the sqlite table Jun 22 19:48:21 actually, if you're just always loading / saving all of it, you're probably better off with something like https://github.com/square/tape (or just a flat file). sql has some overhead. Jun 22 19:48:52 alright lasserix Jun 22 19:49:04 but I can change that later, wanna get this method to work first Jun 22 19:49:14 zajt: just use gson Jun 22 19:49:27 why are you bothering with sqlite table if you are not using the table for what it is supposed to be used for? Jun 22 19:49:42 why can't you use jsonstring in a database? Jun 22 19:51:09 you can but it defeats the points of both the json string and the table Jun 22 19:51:17 much easier to GSON to turn your json into java objects Jun 22 19:51:42 and denormalizing the string and turning it into its appropiate columns so you can do joins and fk lookups to take adv of relational database Jun 22 19:53:28 alright but why does it defeats the point? cuz my friend told me to do it, i can ask him Jun 22 19:53:48 because you should break up the json string into respective keys as columns Jun 22 19:53:56 then you can make a normalized or denormalized table Jun 22 19:54:01 alright Jun 22 19:54:02 and do joins and look ups and queries Jun 22 19:54:09 zajt: I think your technique is OK. Start off this way for bootstrapping but upgrade it to the way lasserix suggested later on. Jun 22 19:54:17 otherwise you are better off using GSON to write it down and turn it into actual java objects Jun 22 19:54:25 flat file to DB conversion is rough Jun 22 19:54:32 nah Jun 22 19:54:43 I have a clickable ImageView, but it is only clickable at the top border. I tried putting the ImageView inside a Framelayout, but I am still getting this problem. I tried. https://ghostbin.com/paste/9rvz9 Jun 22 19:54:47 json -> gson adapter -> java objets -> sqlite table Jun 22 19:55:25 barq add scaleType to your imageview? Jun 22 19:55:34 or show the code with the click listener Jun 22 19:56:38 I have a video to display in a set of view pager pages, is it better to use a single instance of the media player and share it among each page, or does this not matter? (Specifically I am using exoplayer, and am just trying to optimize memory and allocations) Jun 22 19:57:04 The code is just findViewById(framelayout).setOnClickListener Jun 22 19:57:22 What scaleType should I use? Jun 22 19:57:32 idk fit center? Jun 22 19:57:53 barq: by "top border" do you mean that you want the margin to be tappable (and the top border is the image), or something else? Jun 22 19:57:58 okay I'm starting to think I'm crazy Jun 22 19:58:08 I cannot setText() of a TextView from withing a handler Jun 22 19:58:14 the TextView *is* already there on the screen, I just want to modify it Jun 22 19:58:20 you can if its main thread handler Jun 22 19:58:21 but I keep getting a nullpointerexception Jun 22 19:58:25 groxx: I want the whole image to be clickable, but at the moment only the top border seems to register the clicks. Jun 22 19:58:28 it is Jun 22 19:58:33 the top border of the image Jun 22 19:58:35 its null then Jun 22 19:58:46 it's not. As I said, it's visible on the screen Jun 22 19:58:57 on screen != variable is present Jun 22 19:58:58 scaletype center or fitcenter doesnt help Jun 22 19:59:05 show some code? Jun 22 19:59:05 what do you mean? Jun 22 19:59:07 your reference can still be null Jun 22 19:59:08 Anyone got a set of links on measuring app performance for optimization? Jun 22 19:59:19 hold on... Jun 22 19:59:21 groxx: https://ghostbin.com/paste/9rvz9 Jun 22 19:59:26 I mean "on screen" just means it's part of the layout. "I have a reference to that object in a variable" is something else entirely. Jun 22 19:59:36 you can have it in a variable without it being visible, and vise versa Jun 22 19:59:45 I am setting the listener on frameLayout Jun 22 20:01:00 lasserix: http://developer.android.com/tools/performance/index.html Jun 22 20:01:20 but if I created a (global) reference to that TextView (or declared it) then, uh, I should be able to use that reference from within a handler? Jun 22 20:02:09 a global reference? Jun 22 20:02:10 entropyeqzero: if a) access to that variable is threadsafe / you're on the same thread as it was assigned, and b) the handler is running after the assignment, and c) you don't set it to null anywhere else, then yes. it should work. Jun 22 20:02:13 oh my god Jun 22 20:02:29 danijoo: huh? Jun 22 20:02:51 global like static or in a singleton? Jun 22 20:03:15 groxx: yeah all of the above is true but it doesnt work for some reason Jun 22 20:03:32 entropyeqzero, show the code :) Jun 22 20:03:34 danijoo: sorry, I meant outside the onCreate method Jun 22 20:03:48 entropyeqzero: show some code Jun 22 20:03:53 but dont static a textview Jun 22 20:04:01 let me make it human readable, just a sec Jun 22 20:04:06 it's not static Jun 22 20:04:07 use an interface in your thread Jun 22 20:04:15 why do you need a handler? Jun 22 20:04:24 the textview itself has post and post delayed Jun 22 20:04:35 good point Jun 22 20:04:40 didn't think of that Jun 22 20:04:44 also your name hurts my eyes entropyeqzero :/ Jun 22 20:04:54 entropy can never be zero! Jun 22 20:05:03 sure it can Jun 22 20:05:28 when absolute zero, or in a system which has done no work Jun 22 20:05:33 you want to abriged version or the raw version? Jun 22 20:05:43 (of the code) Jun 22 20:05:45 jeez Jun 22 20:05:46 sure Jun 22 20:05:54 just post the code already Jun 22 20:06:02 you are overcomplicating something Jun 22 20:06:08 groxx, not really true Jun 22 20:06:18 "i need to update a textview 5 seconds after event Y happens!" Jun 22 20:06:20 absolute zero kelvin water will still have an entropy Jun 22 20:06:40 it would also need to be a perfect crystall. which is impossible to obtain in reality Jun 22 20:06:48 entropy begins to have no definition when you get to that point Jun 22 20:06:51 danijoo what are you talking about? Jun 22 20:06:57 Afzal, physics! Jun 22 20:07:03 off topic!!! Jun 22 20:07:07 where's that moderator Jun 22 20:07:12 its like talking about gravity before the big bang, makes no sense Jun 22 20:07:14 off his head! Jun 22 20:07:37 lasserix, the definition of entropy does not exclude a 0K temperature Jun 22 20:07:52 http://pastebin.com/jkGCW6Ep Jun 22 20:08:16 no but what happens at 0K kelvin is beyond the realm of classical and even quantum physics of which entropy is born Jun 22 20:09:10 huh? where do you have that from? Jun 22 20:09:46 entropyeqzero: here's a little trick: http://pastebin.com/cbDbhRq3 Jun 22 20:10:02 for the record, the worker thread doesn't spawn until seconds after the activity is loaded and never nulls any TV's Jun 22 20:10:26 entropyeqzero: DO NOT pass views into background threads Jun 22 20:10:37 I didnt Jun 22 20:10:40 use an interface, that talks back through the background thread into the implementing class Jun 22 20:10:47 entropyeqzero: I think the problem is that you're declaring `TextView TV1` in both the activity and onCreate method. the ones inside onCreate will hide the ones in the activity - you never assign the activity ones, but that's what updateUI uses. Jun 22 20:11:04 you can use that UiThread singleton to run anything from a background thread on the Ui thread Jun 22 20:11:33 yeah well I guess I'll just have to use .postdelayed but I can't help but wonder why the handler doesnt work Jun 22 20:11:35 holy cow Jun 22 20:11:40 youre right groxx Jun 22 20:11:41 entropyeqzero: also why are you using setContentView(R.layout.whatever) Jun 22 20:11:43 didnt notice that Jun 22 20:12:00 because you did Handler h = new Handler() inside the background thread Jun 22 20:12:01 lasserix, you can even go unter 0K in quantum mechanics :) Jun 22 20:12:16 you need to do Handler h = new Handler(Looper.getMainLooper()) then it'll have the looper of hte main thread Jun 22 20:12:22 and anything you post to it will run on the main thread Jun 22 20:12:25 lasserix: they're not. they're creating a linearlayout and passing it to setContentView. that's fine. Jun 22 20:12:48 nah, new Handler is inside onCreate, it's on the main thread. Jun 22 20:12:54 danijoo: yeah yeah but who the f-k understands what that even means? like maybe 4 people in the entire world? Jun 22 20:13:11 groxx his code is such a mess i'm just offering random solutions Jun 22 20:13:12 ;p Jun 22 20:13:15 but yeah, I'd definitely recommend being explicit about the looper. never `new Handler()`, always `new Handler(some looper)` Jun 22 20:13:29 lasserix, i think about every 4th who studies with me Jun 22 20:13:31 http://www.nature.com/news/quantum-gas-goes-below-absolute-zero-1.12146 Jun 22 20:13:36 just have a singleton UI thread handler for your app Jun 22 20:13:50 easy, new Handler(Looper.getMainLooper()); and use it everywhere you need UI access from your app Jun 22 20:14:05 below absolute zero. /me's mind blown. or, it would be, if it had any energy. Jun 22 20:14:06 okay, testing time Jun 22 20:16:01 do you "have" reverence? Jun 22 20:16:06 or bear reverence Jun 22 20:16:07 or what Jun 22 20:16:10 bro, do you even revere Jun 22 20:16:14 lol Jun 22 20:16:16 4srs Jun 22 20:16:23 how do you say it Jun 22 20:16:23 groxx, 0K just means no atomic motion. you can still have energy due to dissorder of your system Jun 22 20:16:35 for example if the system is not a perfect crystall Jun 22 20:16:41 I approach this with reverence, or I have reverence for this? Jun 22 20:16:42 or what Jun 22 20:16:54 danijoo: that would be potential energy, yes. but once it moves, it's no longer 0k. Jun 22 20:16:54 let's ask #english Jun 22 20:17:33 thank you groxx, it works now Jun 22 20:18:02 er, it's working* Jun 22 20:18:18 groxx, yeah but entropy does not mean "nothing moves" Jun 22 20:18:31 entropyeqzero: cool :) Jun 22 20:18:46 it is a description of how many states a system can have. and a non-perfect crystall can have multiple equal states at 0 K Jun 22 20:18:56 Good material design apps are like zero entropy Jun 22 20:18:59 danijoo: it means work has been done. it would take work to _get_ it to absolute zero, but it can do no work without leaving zero. Jun 22 20:19:02 Perfect** Jun 22 20:19:31 groxx, what has doing work to do with entropy? Jun 22 20:21:08 Hi, there is a way to have a table layout where in on line I have 3 elements and in other I have two? but the line with two elements use all the line, instead of just the first two colums Jun 22 20:21:13 it's part of some definitions of entropy. e.g. things can move without increasing entropy, but only if they do no work. once work has been done, entropy increases. Jun 22 20:21:56 this is more opinion but what do you guys think is the best button to use for swapping between two views? Jun 22 20:21:58 wviana: there's a column-span attribute iirc Jun 22 20:22:10 i dont get your point :/ Jun 22 20:22:35 bobbiejim, there are different kinds> Jun 22 20:22:36 ? Jun 22 20:22:53 groxx: kind of it, but how it's two in one line, and three in the other, I would like to span kind of 1.5 Jun 22 20:23:44 wviana: I can think of bad ways to do it with only table layouts, but the easiest is probably to make a 3-column-spanning row, put a linearlayout inside that, and give the two "columns" equal weight Jun 22 20:23:46 yeah i know, but im switching between two views in the same activity. im using a toggle button right now but that feels strange cuz its not like the user is toggling the second view on, theyre just swapping to the second view Jun 22 20:25:03 oh, actually, TableRow _is_ a linearlayout. dunno how things play together if you just set weights on that row though. Jun 22 20:25:13 groxx: I'm trying to do something like this. http://imgur.com/bjMXI2T Jun 22 20:25:14 bobbiejim: Have you considered a ViewPager Jun 22 20:25:17 ? Jun 22 20:25:32 whats that? Jun 22 20:25:33 Or tabs or something. Jun 22 20:25:54 wviana, if its only that 2 rows, i'd use 2 liearlayouts Jun 22 20:25:56 tabs would be too much imo, since its just flipping between one of two views Jun 22 20:26:00 wviana: tbh I think I wouldn't use a tablelayout for that. you don't have clear columns. Jun 22 20:26:00 and set weight Jun 22 20:26:02 It enables swiping between pages. Jun 22 20:26:26 hmm i could try that out. gestures are always nice to have :P Jun 22 20:27:35 danijoo, groxx: There will be some rows with graphics that spans all three columns Jun 22 20:27:49 What are the details? Jun 22 20:28:05 How can I move the cursor before the first row ? Jun 22 20:28:42 wviana: if you have a vertical linearlayout with horizontal linearlayout "rows", you can set a background on the row, and it'll span all "columns" Jun 22 20:28:47 I'm running a for loop on an array to save the data of type LatLng inside the array when i debug i see the for loop running through the appropriate number of time (array size) but in the end it  save a random number of data in the array but never all the data http://pastebin.com/a1zEYYZT starting line 31 Jun 22 20:29:24 I have this ImageView: https://ghostbin.com/paste/b5ast I want to make it clickable and that works fine as the layout I pasted is. However, as soon as I ass layout_gravity=bottom Only the top bit of the image is clickable. How can I get the whole image to be clickable when using gravity bottom? Jun 22 20:30:13 groxx: could I do all this table behavior just with linear layouts ? Should I do it ? Jun 22 20:31:57 wviana: if you're trying to match the screenshot you pasted, yeah, I'd use linearlayouts. tablelayout is more for when you want column edges to align, which the screenshot does not do (the 2-column row doesn't line up with any other rows) Jun 22 20:33:39 groxx: How could I achieve equal size in my two columns ? same weight ? Jun 22 20:34:15 wviana: yep, same weight. or if you want everything to be the same, `weightSum=` is pretty simple (though I would NOT recommend using weightSum and children with weights. it just complicates things.) Jun 22 20:35:15 at least, I think weightsum works on its own. maybe not ¯\_(ツ)_/¯ equal weight will work though, yes Jun 22 20:36:06 weightSum just defaults to the sum of all child weights Jun 22 20:36:38 Not often there's a reason to set it Jun 22 20:37:11 yeah. I forget if it "turns on" weight based layout if it's set though Jun 22 20:40:45 cant you just programmatically set it in the adapter getview by getting the screen or parent width? Jun 22 20:41:10 There's not really anything to turn on.. Weight happens after all child views are measured, and just distributes whatever space is leftover among childs with weight Jun 22 20:41:30 Or makes childs with weight smaller if the content is larger than the linearlayout Jun 22 20:41:39 groxx: could you help me with a very noob question? In a linear layout, to align all the elements inside it to the center, should I use layout_gravity or gravity ? Take a look how it's getting. https://gist.github.com/wviana/54259750aea3d5f15660 Jun 22 20:41:43 http://inthecheesefactory.com/blog/android-design-support-library-codelab/en so many options but soooooo many wrapped layouts :/ Jun 22 20:44:21 groxx: PS: Thank you for the weight tip, I always get me asking my self how to set the value to get the result that I was waiting for, trying a lot of different values. Jun 22 20:46:12 wviana: "layout_" attributes are always for the _parent_ view. so if you want to put the view at e.g. the left of the parent, use layout_gravity=left / start. "gravity" is then for the view itself - if you want to e.g. right-align text, use "gravity=right" Jun 22 20:46:53 groxx: I just got it, I had to make it sub items to wrap width Jun 22 20:48:26 yeah, with match_parent, layout_gravity doesn't really make a difference, because it's already hitting both sides :) Jun 22 20:49:08 I reimplemented the layout using two linearlayouts instead of layout_gravity=bottom for imageView2, but I still can only click part of the image as a result. https://ghostbin.com/paste/arpwr How can I get the whole image to be clickable? Jun 22 20:49:50 barq: I dunno what's happening, but are those 0dp values right? Jun 22 20:50:08 I need 0dp if I use weight, don't I? Jun 22 20:50:26 ah, you're right, you have weights Jun 22 20:50:34 you don't _have_ to, but it's more efficient Jun 22 20:51:06 I had this version before: https://ghostbin.com/paste/gzvcf but gravity_bottom is giving me trouble Jun 22 20:51:19 If I don't set it the entire image is clickable, as soon as I set it only part of the image is clickable. Jun 22 20:54:51 thank you groxx for helping. I'm going. Bye bye. Jun 22 21:19:41 Anyone in the US on a TN Visa who currently has a side app? Jun 22 21:20:01 query too big Jun 22 21:20:02 :P Jun 22 21:35:34 i'm looping through this array to save the coord inside and draw a polygon with but somehow it one saves one element of the array http://pastebin.com/Dfi6izZ9 i don't see an error and debugging show the for loop being traversed many time bazed on array size Jun 22 21:41:28 Trying to get RetroLambda to work. apply plugin: "com.android.application" apply plugin: 'me.tatarka.retrolambda' Error:Cause: android.compileSdkVersion is missing! Jun 22 21:41:50 hello. anyone from google here? someone who can help with InstanceID tokens for GCM? Jun 22 21:41:55 When I don't have "com.android.application", I get a compiler error. When I do add it, I get a Gradle error. Jun 22 21:46:09 Can someone help me with Android UI testing. I am new to development. I want to automatically test the use of multiple apps on an Android phone. This test has to be repeated on two identical devices. Jun 22 21:47:48 Look into Calabash or Appium. They let you write tests using Cucumber scripts, and you can use those scripts to also test iOS Jun 22 21:49:10 s73v3r I looked into Appium. I tried setting it up but I can't figure out how to write testing scripts. Also, it seems I can't test multiple app? I have to install an apk one at a time? Jun 22 21:49:42 yes. but that should be ok as you’re only going to be running one app at a time Jun 22 21:50:36 s73v3r, With one test script, can I do test on multiple apps? Jun 22 21:50:53 possibly. I’m still not sure why you’d need this Jun 22 21:51:03 you’re only going to be running one app at a time Jun 22 21:51:05 s73v3r, What about installing apps from Play Store instead of just installing the apk Jun 22 21:51:10 no Jun 22 21:51:34 were material dialogs added to support library? Jun 22 21:51:42 but you should have the same release build you’d be uploading anyway, so it doesn’t matter Jun 22 21:53:50 hello. anyone from google here? someone who can help with InstanceID tokens for GCM? Jun 22 21:55:27 RetroLambda: If I separate apply plugin android and retrolambda, the build fails and can't find compileSdkVersion. com.android.application is normally found in submodule. retrolambda I want to put project-wide. What should I do? Jun 22 21:55:45 sp5292-android, no Jun 22 21:56:19 Do material dialogs appear for prelollipop if using the app compat design library? Jun 22 21:56:39 lasserix, yes, with the newest version\ Jun 22 21:56:50 and it must be appcompatdialog Jun 22 21:57:11 this? com.android.support:design:22.2.0 Jun 22 21:57:25 yes Jun 22 21:57:39 make sure to use the support version Jun 22 21:57:57 and you still have to set it a style imho Jun 22 21:58:05 s/imho/afaik Jun 22 22:00:58 got a link with example? Jun 22 22:01:42 example for what? you just replace the dialogbuilder with support version and set it a style Jun 22 22:02:13 http://stackoverflow.com/questions/29797134/how-to-use-and-style-the-new-alertdialog-from-appcompat-22-1 Jun 22 22:03:24 so seems down for me Jun 22 22:03:24 Hello, how can I use sprite sheet in android? Jun 22 22:03:25 wtf Jun 22 22:05:08 lasserix, from my own project: http://prntscr.com/7k4oa8 Jun 22 22:05:48 thanks Jun 22 22:08:49 No? Jun 22 22:09:42 http://lmgtfy.com/?q=sprite+sheet+android&l=1 Jun 22 22:14:38 I searched it but I can't find good doc Jun 22 22:21:04 danijoo: android:colorPrimary only works for 21+ so do you put colorPrimary in < 21 styles or just it is ignored? Jun 22 22:22:18 you use the version without android: for support lib Jun 22 22:22:38 err Jun 22 22:22:41 when declaring in styles Jun 22 22:22:54 android: is for styles in v21 and below that you just do colorPrimary? Jun 22 22:23:28 and is there a way to change the body content text color? Jun 22 22:31:13 android: means its part of android Jun 22 22:31:31 support library is part of your app. thats why if does not have a prefix Jun 22 22:32:19 yeah so I just have to add android: in v21 and prior to that just do ... Jun 22 22:33:23 no Jun 22 22:33:25 do you know what controls the "OK" color? primary pos text? Jun 22 22:33:29 it gives me an error Jun 22 22:33:46 no. maybe you need to have a look at the source to find out Jun 22 22:34:09 in v21 you still dont use android: if you rely on support lib. Jun 22 22:34:47 ahh ok Jun 22 22:34:51 http://postimg.org/image/mzlojms19/ Jun 22 22:34:58 so I just dont use android: then? Jun 22 22:35:04 thats in my styles/ Jun 22 22:35:08 .... Jun 22 22:35:11 if i do styles-v21 that works Jun 22 22:35:31 in v21 you still dont use android: if you rely on support lib. Jun 22 22:35:43 how can one debug RxJava schedulers? I have a observable that I'm using observeOn(AndroidScheduler.mainThread()) but the subscribers action is actually running on another thread Jun 22 22:36:15 danijoo: okay Jun 22 22:36:17 I've found RxJavaPlugins but I'm not sure it can help me Jun 22 22:36:22 do you know how to change the color of the pos text? Jun 22 22:36:35 pos? Jun 22 22:36:56 positive text Jun 22 22:37:04 no Jun 22 22:37:17 isnt that highlightColor? Jun 22 22:37:24 dunno Jun 22 22:37:31 ill play around till i figure it out thanks Jun 22 22:37:52 mmarklar, have you tried RxJavaDebug? Jun 22 22:38:04 danijoo: trying that right now Jun 22 22:38:16 but it doesn't seem to tell me the scheduler information Jun 22 22:38:25 just subscribe/unsubscribe/onnext/complete Jun 22 22:38:37 and error of course Jun 22 22:38:38 mmarklar, hmm, also you're aware of the difference between subscribeOn and observeOn right? :) Just checking. Jun 22 22:38:46 Mavrik: yeah I'm pretty sure :) Jun 22 22:39:03 this is an onNext call thats throwing an exception because its trying to touch a view Jun 22 22:39:47 I'm sure its something I'm doing wrong, not a bug in rxandroid Jun 22 22:40:29 sounds like you are not observing on ui thread then Jun 22 22:40:35 right Jun 22 22:40:54 thats why I'm trying to debug the call to observeOn(mainThread()) Jun 22 22:42:15 How can I first start a spinning animation with view.startAnimation(spin) and then stop it SO that the view remains where I press stop? Jun 22 22:42:28 I'm using view.clearAnimations() to stop the spinning Jun 22 22:44:36 danijoo: the pos text color is colorAccent Jun 22 22:45:00 petazz Jun 22 22:45:09 you need to save time when you start it, Jun 22 22:45:16 then divide it by the angular frequency to find the offset Jun 22 22:45:51 first timer here, looking to get help with Fused Location Provider's requestLocationUpdates in the background with an IntentService where Location is not being populated when I put extras onto my intent. Any assistance, guidance, or suggestions appreciated! http://stackoverflow.com/questions/30856910/sending-extra-to-requestlocationupdates-intentservice-breaks-location Jun 22 22:45:59 lasserix: I was hoping to use fillAfter=true Jun 22 22:46:10 that might work Jun 22 22:46:17 but not sure since you are cancelling it Jun 22 22:46:21 err clearing it Jun 22 22:47:14 Well it is running infinitely, how else can I stop it? Jun 22 22:48:38 And why I'm asking is that fillAfter does not do the trick Jun 22 22:48:47 yeah so what i am saying is Jun 22 22:48:51 you know how fast it is spinning Jun 22 22:49:03 so you can use angular frequency to calculate the angle it is at when it stops after time t Jun 22 22:49:34 right? if it spins at 40 hz and it spins for 40 ms, then you should be able to calculate what stop angle is Jun 22 22:49:37 then use setRotationX Jun 22 22:49:42 you can use animationlistener Jun 22 22:50:09 Hmm yea.. Well the original problem is that my loader is spinning but I'd like to add another animation to it to fade it away but still let it continue spinning Jun 22 22:50:35 But doing that (changing the animations) resets the position. Ofc I can still calculate the current position there.. Jun 22 22:50:40 Dagger2 users: is it preferred to have component interface methods named after what they inject? Jun 22 22:51:02 i.e. injectThing(Thing toInject); injectOtherThing(OtherThing toInject); Jun 22 22:51:03 or Jun 22 22:51:25 just call everything inject(TypeToInject objectName); Jun 22 22:55:46 danijoo: are you material alert dialogs rounded? Jun 22 23:08:53 i just watched a 5 minute video about guys DANCING a list sorting algorythm Jun 22 23:08:57 i want my time back Jun 22 23:09:28 I want to see someone dance the dancing links algorithm Jun 22 23:09:42 https://www.youtube.com/watch?v=ywWBy6J5gz8 Jun 22 23:10:24 danijoo: did you figure out how to round the corners? Jun 22 23:10:34 danijoo: I don't think time works that way - stealing 5 minutes from everyone else's life doesn't make you live 5 minutes longer Jun 22 23:11:04 trouble shared is a trouble halved Jun 22 23:12:01 lasserix, they are rounded by default. but only a tiny bit Jun 22 23:12:12 not that i can see Jun 22 23:12:36 but... Team Rocket is three main (visible) members, and they have double the trouble. does it become additive after halving? Jun 22 23:12:43 http://postimg.org/image/obql0xzgf/ Jun 22 23:12:44 ? Jun 22 23:12:50 they are for me. are you on an ldpi? Jun 22 23:13:01 hm. Jun 22 23:13:03 no idea Jun 22 23:13:09 for me they are rounded. Jun 22 23:13:17 maybe because its a 5.x device Jun 22 23:14:05 ahh yeah Jun 22 23:14:06 that is why Jun 22 23:15:09 brb watching merge sort :D Jun 22 23:21:44 danijoo: ahh actually easy to get rounded on pre lollipop Jun 22 23:27:43 lol danijoo (the quicksort vid), i'm glad they cannot do the flash sort (neubert) Jun 22 23:28:00 ^^ Jun 22 23:28:11 Any idea where I shud look if I want to track distance traveled Jun 22 23:28:26 a map Jun 22 23:28:30 Im looking at "Google Location Services for Android" Jun 22 23:30:32 or d = v / t, if you can continuously mesure the speed and keep track of time Jun 22 23:30:42 it will not be accurate on short distance Jun 22 23:30:59 im looking for a Class to use Jun 22 23:31:48 FusedLocationProviderAPI Jun 22 23:35:20 Is there a way to set the style of a textview in code from xml defined style? Jun 22 23:35:58 no Jun 22 23:36:16 new TextView(context, null, R.attr.myStyle) Jun 22 23:36:20 believe me, I’ve desired this for a while, since I have to instantiate textviews from web calls Jun 22 23:37:07 note its an attr value, not a style. You have to define the attr first Jun 22 23:37:15 What's in your style that you need to do programatically? Jun 22 23:37:37 i just want it for organization Jun 22 23:38:11 wait Jun 22 23:38:54 I think you can do it on 21+: http://developer.android.com/reference/android/view/View.html#View(android.content.Context, android.util.AttributeSet, int, int) Jun 22 23:38:59 yeah Jun 22 23:39:00 lasserix: what are you tryin to do? Jun 22 23:39:10 just want to set color, size, multiplier Jun 22 23:39:13 and hopefully padding Jun 22 23:39:18 but i can't, i can use setTextAppearance Jun 22 23:39:21 why not xml though? Jun 22 23:39:21 but that doesn't do layout Jun 22 23:39:29 and whats wrong with setting the site Jun 22 23:39:31 style Jun 22 23:39:47 Jun 22 23:40:01 At least in my case, I know I can’t use XML because I have to dynamically add the TextViews based on what the server says Jun 22 23:40:02 TextView from code Jun 22 23:40:16 maybe he needs to generate them at runtime Jun 22 23:40:18 or in your theme @style/MyStyle Jun 22 23:40:26 you can do it all from code Jun 22 23:40:58 yeah Jun 22 23:41:00 but for organization Jun 22 23:41:05 huh? Jun 22 23:41:12 damn lineSpacingMultiplier doesn't work for setTextAppearance Jun 22 23:41:14 you can just define an attr for your style, set that attr to your theme and then use it with new View(context, attr, R.attr.myAwesomeStyle) Jun 22 23:41:24 i can do it in code, but i want to group the style for the sake of my coworkers Jun 22 23:41:41 no Jun 22 23:41:44 we mean that Jun 22 23:41:49 see what danijoo said Jun 22 23:41:52 danijoo: how do you instantiate the attr? Jun 22 23:41:54 how does doing it in code help your coworkers? Jun 22 23:41:55 you define your own attr Jun 22 23:42:09 Jun 22 23:42:14 pop that in your resources Jun 22 23:42:23 normally in a file called attrs.xml but it doesnt matter Jun 22 23:42:56 now you can add @style/MyTextViewStyle to your theme Jun 22 23:43:19 Hey all, I'm trying to make the entire screen a color (red or yellow, determined programmatically) in an activity. What's the best way to hide/color the navigation and status bars? Jun 22 23:43:34 danijoo: i have to define the content view of the material styled alert dialog since you can't, say, change lineSpacingMultiplier Jun 22 23:43:41 then in code you can do new TextView(context, null, R.attr.myAwesomeStyle); and in layouts Jun 22 23:44:02 naplam Jun 22 23:44:03 ahh Jun 22 23:44:04 hmm Jun 22 23:44:05 lets see Jun 22 23:44:55 Also, I want to do this from Java, not XML. Jun 22 23:45:18 ethanmad: getWindow().setStatusBarColor(int color); and getWindow().setNavigationBarColor(int color); Jun 22 23:46:21 Napalm: Thanks. Right now I'm hiding the status bar and trying to set status bar color using the same code you posted, but it's not working. Any idea why? Jun 22 23:46:56 When I say not working, there is no coloration taking effect. I've wrapped the line in an API version check and my device is on 5.1 Jun 22 23:47:28 add Jun 22 23:48:14 true to your theme Jun 22 23:48:49 Will try that. Is it better practice to make a new theme for just this activity or add it to the main theme? Jun 22 23:49:25 if you want or do it in code Jun 22 23:49:43 getWindow().addFlags(WindowManager.LayoutParams.FLAG_DRAWS_SYSTEM_BAR_BACKGROUNDS); Jun 22 23:51:13 Napalm: ahh nice thank you i was always wondeirng how to do that Jun 22 23:51:27 lasserix: do what? Jun 22 23:51:38 oh the status bar color? Jun 22 23:51:49 Thanks Napalm! Works perfectly. Jun 22 23:52:13 that trick with the attr Jun 22 23:52:27 ethanmad: http://developer.android.com/reference/android/view/Window.html#setStatusBarColor(int) Jun 22 23:52:42 i just followed the docs Jun 22 23:52:42 :P Jun 22 23:53:00 lasserix: its not a trick.. its how the platform works Jun 22 23:53:04 yea yea Jun 22 23:53:10 :PP Jun 22 23:54:32 ethanmad: if you want to change the SYSTEM_UI_ flags then you'll want to do getWindow().getDecorView().setSystemUiVisibility(flags); Jun 22 23:55:36 Napalm: If I do that then I could turn on the SYSTEM_UI_FLAG_LAYOUT_HIDE_NAVIGATION flag? Jun 22 23:55:58 ethanmad: yes Jun 22 23:56:20 Napalm: Great. Hide navigation sounds better because it's available in API 16 versus 21 for coloring Jun 22 23:56:57 ethanmad: make sure you use getSystemUiVisibility() and remove the flags you dont wantr and what you do want Jun 22 23:57:13 Napalm: what's the variable flags in that case? Jun 22 23:57:44 ethanmad: huh? Jun 22 23:57:51 ethanmad: its an integer? Jun 22 23:58:00 got it Jun 22 23:58:02 ethanmad: if you really want to correctly control the SystemUI flags.. then i recommend https://chris.banes.me/2014/08/29/systemuihelper/ Jun 22 23:58:55 Napalm: Thanks. Is there a page in the docs explaining SystemUIVisibility stuff? Jun 22 23:59:06 not really Jun 22 23:59:15 read that example for best explination Jun 22 23:59:19 that or read each flag Jun 22 23:59:57 Napalm: ok. i'll see which works best. It's for a tiny, 40 line activity so I'll probably just use flags Jun 23 00:00:13 http://developer.android.com/reference/android/view/View.html#SYSTEM_UI_FLAG_FULLSCREEN Jun 23 00:00:18 and the rest below Jun 23 00:02:59 Can someone recommend an android development book? Jun 23 00:03:01 The Big nerd ranch is really out of date Jun 23 00:03:31 github: search[android] Jun 23 00:04:26 ? Jun 23 00:05:48 Hi!! Jun 23 00:05:55 sup Jun 23 00:06:14 I have an error with R.id.matchA_points, it says "cannot be resolved or is not a field"? Jun 23 00:06:26 why happens that with the ids? I don't understand Jun 23 00:06:31 Did you assign the id to something Jun 23 00:07:09 Can someone help me running a test file using UI Automator. I am trying to do this part: http://developer.android.com/training/testing/ui-testing/uiautomator-testing.html#run I see two build.gradle files in Android Studio project. I don't know which one to choose. Jun 23 00:09:19 yes, to a textView Jun 23 00:12:31 hey guys! Jun 23 00:13:31 Youd have to post the code Iarfen Jun 23 00:14:34 whats the normal size of the fab? Jun 23 00:14:34 which pastebin I should use? Jun 23 00:15:46 Iarfen: Github Gist & hastebin are both good Jun 23 00:16:49 http://hanhuy-acra.appspot.com/public/com.hanhuy.android.keepshare/5138131a1b124868651c0c156d538da3cbc8d195 Jun 23 00:16:56 interesting crash report... Jun 23 00:17:45 Guys I cant find the Location object Jun 23 00:17:47 docs Jun 23 00:17:47 https://gist.github.com/anonymous/7f6f9232c841b218b3eb Jun 23 00:17:54 im using the FusedLocationProviderAPi Jun 23 00:20:12 I have an error with R.id.matchA_points, it says "cannot be resolved or is not a field"? Here's the code: https://gist.github.com/anonymous/7f6f9232c841b218b3eb Jun 23 00:21:47 so? make the id Jun 23 00:22:12 or stop using the wrong R Jun 23 00:23:35 pfn: which is the R I have to use then? Jun 23 00:23:44 the correct one Jun 23 00:24:07 pfn: which is? it isn't badtyped Jun 23 00:24:22 not android.R Jun 23 00:24:23 Sawbones: Why a book? I'd recommend the official documentation, Google, and the source code. Jun 23 00:25:19 pfn: how I have to write it then? I really don0t know Jun 23 00:25:23 Even if a book is 100% up to date today (which is hard to achieve), it'll be out of date in the not-too-distant future. Jun 23 00:25:47 Iarfen, should consider learning some java Jun 23 00:27:06 pfn: I don't know why the reference is bad Jun 23 00:27:12 Hey guys, how can I get the current focused item in a Leanback app? I'd like to implement a lazy load function and I'd like it to be fired when the user gets to the last or before last item from the movie catalog Jun 23 00:27:32 Does fab in support library add a shadow on pre lollipop? Jun 23 00:28:48 Hey, I have a gridview that is full of pictures. On each picture, I want to have a couple of buttons and a a few lines of text. I've searched developer.android.com, but I can't find anything. Any help would be much appreciated Jun 23 00:29:27 Tentacular261 maybe recyclerview with itemdecorator Jun 23 00:29:47 Iarfen: Try Build > Rebuild Project and look at *all* the error messages. There's a reasonable chance you have an error in an XML file somewhere. (Another possibility is that you're trying to reference `R` from a subpackage and need to import `R`, but this is less likely, from what I've seen in this channel.) Jun 23 00:30:17 Usually, when people have the second problem, they mention packages at some point. Jun 23 00:30:29 I have an endpoint that is returning 2 different things. sometimes A sometimes B https://gist.github.com/px-amaac/1ef7da5a68c1c4512ba8. Is this normal? I created a Pojo and Trying to use GSON to parse but getting java.lang.IllegalStateException: Expected BEGIN_OBJECT but was BOOLEAN Jun 23 00:31:31 TacticalJoke, the error it throws is only for matchA_points, for matchA_cardsC it doesn't throw anything and the code is identical :S Jun 23 00:31:43 shadynastys: I use this to create my POJO classes: http://pojo.sodhanalibrary.com/ Jun 23 00:31:45 shadynastys: You can check what the current (or next, I think) token is when stream-parsing. Jun 23 00:32:16 Iarfen: Why not try what I just posted? Jun 23 00:32:26 shadynastys: try copying the current JSON and re-create the classes, you might be missing something, for example: "result": false Jun 23 00:32:32 TacticalJoke, it doesn't throw and error for my xml files Jun 23 00:32:38 Actually, scrap that. It would be an error everywhere, I guess. Jun 23 00:32:50 lazz: Does that solve the different data types being returned? one has an object and the other is a boolean Jun 23 00:33:10 for the same key Jun 23 00:33:20 I guess it'd be easiest if you posted the full files where it is a problem, and one full file where it isn't a problem. Jun 23 00:33:50 Or at least one of each. Jun 23 00:34:16 shadynastys: I had the same problem, mine was "result": false, but in my situation if the "result" was false then there is a problem. I experienced that by making a Login API call Jun 23 00:35:13 shadynastys: So in my situation, if the result was false, the user is not logged in and I showed up a toast informing the user that a problem has occurred Jun 23 00:35:53 lazz: i have other data in there that i want though hold on im posting Jun 23 00:37:06 A.JSON parses fine. B.JSON throws com.google.gson.JsonSyntaxException: java.lang.IllegalStateException: Expected BEGIN_OBJECT but was BOOLEAN at line 1 column 11908 path $..programs[9].Image Jun 23 00:37:13 https://gist.github.com/px-amaac/1ef7da5a68c1c4512ba8 Jun 23 00:39:31 I have never had an endpoint return false if the object was not there. I thought if object was not there then just dont return that key with the json. Jun 23 00:41:02 g00s, sorry for taking so long to respond. I was trying to look into itemdecorator. I think that is what I want, but the android developer site isn't very helpful to me. Do you know of a better site to learn about it? Jun 23 00:43:21 Thanks again Napalm|afk! I ended up using LOW_PROFILE and coloring the nav bar. Jun 23 00:52:12 TacticalJoke: Even the docs are out of date Jun 23 00:52:29 For instance there's nothing showing how to use android.app.Fragment Jun 23 00:52:32 only the support version Jun 23 00:52:38 Hey guys, how can I get the current focused item in a Leanback app? I'd like to implement a lazy load function and I'd like it to be fired when the user gets to the last or before last item from the movie catalog Jun 23 00:52:42 because google is notorious for having bad docs Jun 23 00:52:45 You should probably use the support version Jun 23 00:53:04 why? I'm not targetting below API 11 Jun 23 00:53:30 The support Fragments give you consistent behaviour regardless of Android version. Jun 23 00:54:16 http://stackoverflow.com/questions/17295497/fragment-or-support-fragment Jun 23 00:54:49 I'd trust the official documentation to be up to date more than I'd trust some book to be up to date. Jun 23 00:54:57 I don't use fragments that much, so I may not be eligible to speak on it, but that seems to be the consensus Jun 23 00:55:28 Hmmm ok Jun 23 00:55:48 I thought fragments were a big deal, big nerd ranch starts teaching them pretty immediately Jun 23 00:57:01 What's everyone's favorite way to move drawables into a project? Specifically material design icons. Right now I do it from the command line and make a bunch of cp commands from the parent directory of the icon i'm looking for Jun 23 00:58:24 osx (finally!) gives you the option of merging directories when you drop them on top of each other Jun 23 00:58:47 groxx really? In Finder? Jun 23 00:58:51 I don't use Finder :/ Jun 23 00:59:13 I just moved away from OS X... Jun 23 00:59:14 yep Jun 23 00:59:42 That's convenient, though. Jun 23 00:59:46 Are fragments a big deal? Jun 23 00:59:53 Find out more, when we come back. *theme music plays* Jun 23 01:00:09 Srsly, I don't know. A lot of people hate them. Jun 23 01:00:19 s/big/bug/ Jun 23 01:00:20 Some people love them. Jun 23 01:01:42 apple had to invent it first Jun 23 01:01:42 How are the new snackbars? I'm excited to move to an official implementation from the library I'm using Jun 23 01:05:34 Also, is there any point in defining app version and/or version code in the manifest when using gradle? Jun 23 01:05:48 Nah, you can just declare it in build.gradle. Jun 23 01:05:53 I think the manifest ones get overridden. Jun 23 01:05:57 Yeah Jun 23 01:06:43 Follow up: is there a way to access the version & version code in the build.gradle so I can make a string from them? I want to show the version in settings Jun 23 01:07:06 Tentacular261 dont know off hand; recyclerview is kinda DIY, batteries not included Jun 23 01:08:12 i read 'little manual of api design' from HN the other day http://www4.in.tum.de/~blanchet/api-design.pdf Jun 23 01:08:28 i think android devs should read it too ;) Jun 23 01:09:23 g00s, alright, thanks Jun 23 01:15:08 ethanmad: I think this: http://stackoverflow.com/a/21119027 Jun 23 01:35:48 Should I use Shared Preferences or savedInstanceState? Jun 23 01:36:15 Sawbones: they serve entirely different purposes Jun 23 01:36:34 what are you trying to save? Jun 23 01:37:05 A counter variable Jun 23 01:37:15 click a button and increase the counter Jun 23 01:37:34 When you flip to landscape the counter goes back to 0 Jun 23 01:37:38 do you want to "forget" the value when they hit the 'back' button, or should it always be retrieve-able? Jun 23 01:37:39 I don't want that Jun 23 01:37:55 the latter Jun 23 01:38:45 if you just want to handle rotation, you only need savedInstanceState - when you rotate, you're getting an _entirely new_ Activity. savedInstanceState lets you save data between those two Activity instances. Jun 23 01:39:00 (among other very useful things. rotation is just the easiest way to trigger it) Jun 23 01:40:45 Sawbones: http://developer.android.com/guide/topics/resources/runtime-changes.html Jun 23 01:41:22 Is that the only way to save info between screen rotation? Jun 23 01:42:02 it's the main / the correct way to do it. stuff you put in the savedInstanceState bundle will be written to disk, so it'll be given to you when your app is restarted (e.g. if it was in the background for too long) Jun 23 01:43:44 If you kill the app completely and restart is it still available? Jun 23 01:44:24 Coming from web design it bewilders me that the application restarts the activity when you rotate the screen Jun 23 01:44:36 bewilders Jun 23 01:44:38 nice word Jun 23 01:44:56 Sawbones: it's android specific pitfall Jun 23 01:45:09 you can disable the restarting-the-activity thing. but it's normal android behavior. Jun 23 01:45:20 Sawbones: think of you savedInstanceState as of cookies =) Jun 23 01:45:31 Sawbones: I believe you should use preferences for a count though Jun 23 01:45:45 and tbh it's a good thing it happens so easily - otherwise people would forget to put stuff in savedInstanceState, and cause crashes (you see this happen a _lot_ already, no need to make it 100x worse by hiding that it happens) Jun 23 01:45:46 lol Jun 23 01:46:18 This is a whole other way of thinking Jun 23 01:46:24 It will take some time to get used to it Jun 23 01:46:34 it all adds up to giving you apps that are reasonably resilient when they crash, and lets you kill off background stuff _entirely invisibly_ because it'll all be restored when the process restarts Jun 23 01:46:59 true Jun 23 01:47:53 I know a decent amount now, what's a good beginner challenge? Jun 23 01:48:07 I think my current project idea is a little too ambitious Jun 23 01:48:12 it's a bit unique, but embrace it. it has benefits, and the "what you are doing is on disk, and will be restored" is really really fundamental to how android works. it drives a lot of API design. Jun 23 01:49:14 what happens when phones come with 4G+ ram; the whole scheme is silly Jun 23 01:49:14 a notepad app, maybe :| gets you into a list, multiple activities, basic save-this-data-on-disk (just use SharedPreferences to start). Jun 23 01:49:17 You have to handle the activities-being-killed thing regardless of screen rotation. Jun 23 01:49:37 It also happens sometimes when your app is running in the background for a long time (when the OS wants to reclaim memory). Jun 23 01:49:52 g00s: then apps will get bigger. same as has happened to hard drives. Jun 23 01:49:55 it made sense back 2009 Jun 23 01:50:15 bah. they just cache more, the system runs faster, and everyone's happy Jun 23 01:50:31 Oh, groxx covered what I said. Jun 23 01:50:35 I'll try to make a notepad app Jun 23 01:50:54 and it'll be like 2025 before you can rely on your average user having 4gb of ram Jun 23 01:51:00 Sawbones notepad apps are denied! (like stairway to heaven) Jun 23 01:51:00 I think (I can't read tonight). Jun 23 01:51:12 The piano one is Fur Elise. Jun 23 01:51:17 My piano teacher banned that from her piano. lol Jun 23 01:51:17 i doubt android will exist in 2025 Jun 23 01:51:20 She had a sign up. Jun 23 01:51:35 g00s: What would you recommend then, person who's too good for notepad aoos Jun 23 01:51:36 in any recognizable form anyhow Jun 23 01:51:37 apps* Jun 23 01:51:45 Sawbones: if you get stuck, there's at least one or two notepad app samples. they might use sqlite for storage, for good or bad. more complex, if you've never done databases. Jun 23 01:51:58 I don't think a notepad app is a bad idea for a beginner. Jun 23 01:52:02 groxx: I have Jun 23 01:52:03 But don't release it! Jun 23 01:52:12 samples in the sdk manager / easily download-able via android studio's "import sample" Jun 23 01:52:18 releasing it and supporting it is a big thing though Jun 23 01:52:30 I'll release it and give it some hipster name like 'Notey' Jun 23 01:52:32 Every time someone releases a notepad app, a baby panda is slaughtered. Jun 23 01:52:44 Unless the app is actually good. Jun 23 01:52:53 I write a medium post about why it's great Jun 23 01:52:59 wait, whaaat, they haven't updated the notepad apps? bah. Jun 23 01:53:07 well, they're in older sample sets :| Jun 23 01:53:15 You could also post to /r/androiddev "Hey, androiddev, I just started Android programming and here is my first app!" Jun 23 01:53:25 And to /r/Android "Here's how you get started with Android programming". Jun 23 01:54:29 Sawbones: lol at medium post Jun 23 01:59:39 yeah, post it on ghost instead ! Jun 23 02:07:52 Guys is there a class to do conversions Jun 23 02:07:54 Like meters to miles Jun 23 02:08:08 Im doing meters/1609 to get miles, but its not working out Jun 23 02:08:29 meters/1609.0 Jun 23 02:08:56 It sometimes gives me 3.23432434E-24 Jun 23 02:08:59 or something like that Jun 23 02:09:00 Does someone know how to break when an ArrayList is edited (added,removed...) in debug? I've got this very very weird behaviour that when I want to pass that ArrayList as a ParcelableArrayListExtra, the object in that list has another parcelable with 2 arraylists. Everything goes fine when setting the values and adding stuff. But when I press a button it gets the ArrayList from the adapter and the 2nd arraylist of the object of that arraylist Jun 23 02:09:00 object has gone empty while the other one is fine. I track every single getter and setter in debug and everywhere the value is still there. I have been looking at this for literally 5 hours, it's 4AM and I'm about to give up. Does anyone know why this could be happening? Jun 23 02:09:03 if I dont move that much Jun 23 02:09:48 Like 8.093848384E-4 Napaml Jun 23 02:09:51 Napalm Jun 23 02:10:06 for how many meters Jun 23 02:10:10 yay i finally made a shitty little viewgroup for design library fab menus Jun 23 02:10:11 check with debug output Jun 23 02:10:15 Its if I dont move my phone at all Napalm Jun 23 02:10:31 So I guess Ill just round to 2 decimal places and it shud be fine Jun 23 02:10:31 Muchoz: can you provide some code? dpaste.de Jun 23 02:10:32 No? Jun 23 02:11:02 http://imgur.com/SFWQSZh Jun 23 02:11:12 Muchoz: I'd just track it with `Log.d` all over the place. Jun 23 02:11:15 abara, I'll provide the data classes. I cannot really give you the code because you'll be here all night. Jun 23 02:11:20 hmm, turned out kinda nice, too bad I never sit outside Jun 23 02:11:21 Divide and conquer. Jun 23 02:11:28 pfn: just commented on your G+ Jun 23 02:11:49 Napalm, saw Jun 23 02:12:12 TacticalJoke, well I'm tracking with debug and it's NEVER wrong until I use adapter.getItems() but calls to that method return normal results. It's so fucking weird Jun 23 02:12:41 addItem() etc are working fine (simple custom adapter with arraylist) Jun 23 02:12:49 It really boggles my mind Jun 23 02:12:50 mutable state ftw Jun 23 02:12:54 I'm about to explode Jun 23 02:20:05 use less mutable state Jun 23 02:20:07 win Jun 23 02:22:45 abara, here is the Adapter being used and models. The Adapter has a list of Model objects. The problem is that when I call getItems() in onCreate and Callbacks from API requests it returns everything as you expect. But when I call getItems() from an onClickListener the objectBList is empty somehow but the objectAList is normal:http://hastebin.com/cowazepira.java Jun 23 02:29:10 Why even have getItems? There's already a getItem method. Jun 23 02:30:22 TacticalJoke, I need it for calculations Jun 23 02:30:39 Don't mind the Adapter Jun 23 02:31:16 Anyone got any idea? Else I'm gonna go to sleep, it's 4:30AM Jun 23 02:31:56 That code doesn't show much. Jun 23 02:32:43 Well ya showing you everything isn't gonna help, I should just figure it out on my own Jun 23 02:32:57 Well It might, but it's 4:30AM Jun 23 02:33:02 I'm gonna go Jun 23 02:33:04 Goodnight Jun 23 02:33:12 actually, good luck to anyone trying to make a design support lib menu through a custom viewgroup Jun 23 02:33:27 there elevation shadow shit is all out of wack and makes measuring impossible Jun 23 02:44:11 hi is there anyone here who has used vuforia before? Jun 23 02:56:05 ugh I'm trying to add the http-request library to my android project and this is overly complicated Jun 23 02:56:20 gradle file Jun 23 02:57:15 pagefault: This the lib Jun 23 02:57:17 https://github.com/kevinsawicki/http-request **** ENDING LOGGING AT Tue Jun 23 02:59:58 2015