**** BEGIN LOGGING AT Thu Jan 22 02:59:59 2015 Jan 22 03:02:21 * hesperaux sighs Jan 22 03:02:38 should I do this in a fragment? (would have to learn fragments at the same time) Jan 22 03:11:46 Can I reset a google play game services leaderboard, when my app is in alpha? Does it get automatically reset when I exit alpha? Jan 22 03:12:14 hesperaux, doesn't take more than a few minutes to get fragments. might as well make one so that it's not the barrier. Jan 22 03:12:31 I don't see how fragments would help here. Jan 22 03:13:17 How should I go about handling touch ambiguity if the user can swipe in three directions and three potential actions get initiated depending on swipe direction/location Jan 22 03:13:37 Jumblemuddle, you can reset it, but it doesn't do it automatically Jan 22 03:14:01 TacticalJoke, I was thinking of moving the listview to the right side, in a ListFragment, for landscape mode. In portrait mode, I'd still have to do something about the problem Jan 22 03:14:12 how would I go about implementing a "to do" type list like in google keep? where as soon as you start typing, it adds it to the list Jan 22 03:15:08 Hmm, is there a way to remove a single users score? I had a slight issue with my app, and my app pushed a very large highscore to the board. I would prefer to not be on the highscore board for my own game. Jan 22 03:17:42 hesperaux: Okay. Note that you could do that without fragments: just have a different layout file for portrait mode. Jan 22 03:17:56 One with the ListView on the right. Jan 22 03:17:58 yeah Jan 22 03:18:24 I realize that - I don't know why I was talking about fragments... Jan 22 03:18:49 Out of curiosity -- if you were to remove the ListView, would you still need a ScrollView here? Jan 22 03:20:11 Where in the API do you go to override touch handling so that, for instance, you can build a swipeable list view? Jan 22 03:22:05 Hello. I'm having trouble with playing sound - NotificationCompat.DEFAULT_SOUND and even with custom sound (raw): Here's the code: https://bpaste.net/show/7546f7d3c692 Thanks Jan 22 03:23:05 anybody seen any other implementations like that? adding to a list automatically when you type in an entry? Jan 22 03:23:10 hi Jan 22 03:23:33 Where is the source code for the new Android IDE? - There's an issue with packaging, and I want to submit a patch... Jan 22 03:24:54 AlecTaylor: I believe it's here Jan 22 03:24:55 http://tools.android.com/build Jan 22 03:25:38 TacticalJoke, yeah I would still need the scrollview Jan 22 03:38:23 Hi does anybody know if it is possible to directly use the audiotrack.cpp, mediaextractor.cpp and mediacodec.cpp files under frameworks/av/media/libmedia from a NativeActivity in the ndk? Jan 22 03:38:30 with no jvm involved. Jan 22 03:42:49 https://www.theinformation.com/Google-s-Next-Telecom-Move-Becoming-a-Wireless-Carrier Jan 22 03:50:50 xdaimon: your process always has a dalvik (or art) vm. Jan 22 03:51:06 because it's forked off of zygote, which has a pre-initialized copy of the vm ready to go Jan 22 03:52:24 NativeActivity is just a built-in java class, which then calls into JNI. So you still are using java, even if you don't actually write any java code for your app. Jan 22 03:56:56 JesusFreke: thanks i suspected this. I guess I should reduce my question to. Can i use those cpp and h files under libmedia in my native code? Jan 22 04:04:21 xdaimon: you could technically link against them, but if it's not in the ndk, there's no guarantee that they will actually be present on a device, or keep the same signatures, etc. Jan 22 04:07:38 cool. thanks for the information Jan 22 04:08:40 anyone know a good IRC chanel for windows phone dev Jan 22 04:09:06 I need to find out a good win phone to develop on for work Jan 22 04:18:05 n^izzo i'm waiting to jump in myself Jan 22 04:18:20 i'll probably wait until windows phone 10 Jan 22 04:18:52 my boss want me to start ASAP and get order the phone today Jan 22 04:19:39 not sure if there is an irc channel, would be lame if not Jan 22 04:20:03 or maybe their docs are so great they don't need one haha Jan 22 04:22:42 g00s_: "windows 10" Jan 22 04:24:05 shit, force quit AS again Jan 22 04:25:25 Hello. I'm having trouble with playing sound - NotificationCompat.DEFAULT_SOUND and even with custom sound (raw). Here's the code: https://bpaste.net/show/7546f7d3c692 Thanks Jan 22 04:32:48 g00s_, yea na I dont think so Jan 22 04:50:23 question about efficiency. My app uses Facebook login to provider user info, etc. Would it be more efficient to grab this on login and then pass it around to activities/fragments as needed, or to query the Facebook API whenever it's needed? I was thinking if I do the former, I could grab the user object that gets returned from the API call, store it in a TypedArray, and then pass that around? Jan 22 05:08:21 hi, has anyone here set up android studio w/ git? Jan 22 05:11:34 Probably loads of people. Jan 22 05:15:14 ya, perhaps even a majority Jan 22 05:15:59 t0astt: for just the user object, does the fb SDK cache that for you? Jan 22 05:17:44 I actually disable Mercurial integration. Not sure why. I feel kinda possessive over my repository. Jan 22 05:19:47 TacticalJoke: if I have an existing project that i created locally, how would I upload it to my bitbucket repo? do I go to VCS -> Import into CVS? Jan 22 05:19:58 I use the git integration, but not for most common git operations. Mostly history of a file/blame/history for selection types of stuff Jan 22 05:20:21 "show history for selection" is definitely one of my favorite features Jan 22 05:21:03 white_magic: I doubt you want to add it to a CVS repository :) Jan 22 05:21:22 white_magic: I would ignore the git stuff in AS, until you're comfortable with git on the command line Jan 22 05:21:37 i am quite comfortable w/ git in commandline Jan 22 05:21:43 i just wanted to integrate it nicely Jan 22 05:21:49 Try Settings > Version Control. Jan 22 05:21:58 i did prefer Atlassian's src control software over cmdline though Jan 22 05:22:00 Have you enabled it there? Jan 22 05:22:29 JesusFreke: Yeah, I can understand that. I'll probably do that once I get more comfortable with AS. :) Jan 22 05:22:45 It needs to enter my circle of trust. Jan 22 05:25:47 white_magic: I just made a new project in IDEA, then did a "git init" via the command line. idea noticed the new repository and showed a popup to enable git integration in the project Jan 22 05:26:13 or alternately, VCS -> enable VCS integration Jan 22 05:26:22 and then choose "git" in the dropdown in the dialog that pops up Jan 22 05:26:25 JesusFreke: yeah, that's about my limit to IDE git integration. never committing / etc. Jan 22 05:26:29 pretty simple Jan 22 05:26:56 "Enable Version Control Integration" rather Jan 22 05:27:30 sorry got disconnected - what did I miss Jan 22 05:27:33 If I go to Settings > Version Control I see "Unregistered Mercurial root: ". I guess both ways work. Jan 22 05:27:40 oh, hah. I didn't notice Jan 22 05:27:50 anyone have insights in how to get bitbucket going w/ AS? Jan 22 05:27:53 oh, I don't think you missed much Jan 22 05:27:57 white_magic: VCS > Enabled Version Control Integration or Settings > Version Control. Jan 22 05:28:06 k Jan 22 05:28:10 Enable* Jan 22 05:28:16 The latter has more options. Jan 22 05:28:32 yeah, just create the repository as per usual via the command line, and then enable the integration in AS Jan 22 05:28:35 pretty simple Jan 22 05:31:49 I can't believe this bug still exists (SMSes show received time and not sent time): . My dad's recently got a 2013 Moto G and complained about it. Though they'd fixed it. Jan 22 05:32:10 google? fix? Jan 22 05:33:15 Google: Fix? No, obsolete. Jan 22 05:33:37 on one hand, i android purists like stock android / nexus devices - otoh, the oems have to do QA and fix some of that stuff Jan 22 05:34:01 i wonder if google actually expects the oems to do some of the QA for them Jan 22 05:34:13 Yeah, I sometimes think that. Jan 22 05:34:28 and nexus users are crash test dummies Jan 22 05:35:50 Another hilarious one: Parcel, despite having a writeBooleanArray method, still has no writeBoolean method: https://code.google.com/p/android/issues/detail?id=5973 Jan 22 05:36:42 i'd do #3 probably, just like sqlite Jan 22 05:36:49 which has no boolean type Jan 22 05:37:39 As far as I recall, that's what they tend to do in AOSP. Jan 22 05:40:06 how does google keep make the EditText seamlessly become a list item, and then make a new blank? Jan 22 05:54:45 g00s_: fwiw I haven't encountered OEMS fixing the sms db's problems. some might, but overwhelmingly it seems not. it seems firmly in "not our problem" territory. Jan 22 05:55:08 they often layer on new problems, but not fixing existing ones. Jan 22 05:55:45 Sony seems to have fixed it (at least on the handsets I've tried). Jan 22 05:56:18 Hello. I'm having trouble with playing sound - NotificationCompat.DEFAULT_SOUND and even with custom sound (raw). Here's the code: https://bpaste.net/show/7546f7d3c692 Thanks :) Jan 22 06:27:42 If I add the same library to two modules would it add it twice or use the same file? Jan 22 06:29:57 TacticalJoke: happen to have a Sony phone on hand? I'm curious if they fixed one of my favorite bugs. Jan 22 06:30:26 it's possible I'm just jaded by a bunch of broken Samsung and weird old HTC devices. Jan 22 06:32:39 I have a Sony Xperia M right next to me right now. Jan 22 06:36:54 the bug is: send an sms to threads A and B, in that order (at least one second apart). then delete the message from B. thread B will still be at the top of the thread lists. Jan 22 06:37:20 if you do the same with MMS, it'll update correctly, and thread A will be at the top Jan 22 07:01:32 been so quiet today :) Jan 22 07:13:41 yeah, isn't it wonderful :p Jan 22 07:22:53 i thought i heard a ravioli O.o Jan 22 07:27:27 when defining a class (typical onSomethingListener), what's a typical way of providing local variables to the listener? Jan 22 07:27:43 override constructor and provide local fields? Jan 22 07:29:14 I want to use a variable from definition scope as in a closure Jan 22 07:29:59 how would you transition to a different Activity before the MAIN Jan 22 07:30:43 n^izzo, why would you? Jan 22 07:30:48 my MAIN is a login activity so I dont want to show that if they are allready authenticated Jan 22 07:31:04 and which activity will know if they are logged in? Jan 22 07:31:33 g00s_: ! Jan 22 07:31:37 knapper_tech: Yeah, providing a constructor. Jan 22 07:31:41 thepoosh ! Jan 22 07:31:41 last day of the week-long sprint Jan 22 07:31:52 today is suspected release rto 0.5% Jan 22 07:31:52 is the ANR squashed ? Jan 22 07:31:54 knapper_tech: But if you're defining an anonymous class then you can use final locals. Jan 22 07:31:58 nope Jan 22 07:32:09 well, cannot reproduce Jan 22 07:32:11 none< I'll have to set it as a Shared Preferences Jan 22 07:32:13 something has changed Jan 22 07:32:20 huh Jan 22 07:32:27 idk Jan 22 07:32:36 new thing is up Jan 22 07:32:45 s3 is not connecting to camera at times Jan 22 07:33:08 any ideas? Jan 22 07:33:31 n^izzo: what are you trying to do? Jan 22 07:34:07 thepoosh camera stuff is hard :( Jan 22 07:34:18 I dont want to show the MAIN activity if the app has a cookie and has already authenticated Jan 22 07:34:36 mmmmkay Jan 22 07:34:40 n^izzo: Have you considered making the login activity *not* the main activity? Jan 22 07:35:00 so in your onCreate of MainActivity you can check if going into the next one should happen Jan 22 07:35:39 you need a gate leeper Jan 22 07:35:45 *keeper Jan 22 07:36:17 n^izzo you can look to see how iosched handles this with logging into google+ Jan 22 07:36:24 I usually do this: App launches --> main activity runs --> if (!loggedIn) { showLoginActivity(); } Jan 22 07:36:34 "foo is hard ... let's drink beer" Jan 22 07:36:39 i think each activity extends BaseActivity or something, which checks for login Jan 22 07:37:18 like! Jan 22 07:37:25 thats cool thanks Jan 22 07:37:27 so no matter if the app is killed, and how you get back into it, the login code will verify Jan 22 07:38:40 TacticalJoke, but wont the main activity flash for a moment before transitioning to the auth activity Jan 22 07:38:51 Yeah, unfortunately. Jan 22 07:38:58 n^izzo you can make your auth a floating activity Jan 22 07:39:03 yea thats what I'm trying to avoid Jan 22 07:39:06 The documentation says this doesn't happen if you use startActivityForResult, but in my experience it does. Jan 22 07:40:12 This is what it says: Jan 22 07:40:13 As a special case, if you call startActivityForResult() with a requestCode >= 0 during the initial onCreate(Bundle savedInstanceState)/onResume() of your activity, then your window will not be displayed until a result is returned back from the started activity. This is to avoid visible flickering when redirecting to another activity. Jan 22 07:40:21 I wish that were true. Jan 22 07:42:13 g00s_, floating as in a dialog? e.g. https://github.com/afollestad/material-dialogs Jan 22 07:42:19 n^izzo: But in your case won't you get a flicker when they *are* logged in? Jan 22 07:43:05 TacticalJoke, using a dialog? Jan 22 07:43:27 If using a dialog, I guess not. Jan 22 07:44:00 what were you thinking? Jan 22 07:44:30 I assumed you were using a login Activity. Jan 22 07:46:08 at the moment I am Jan 22 07:49:52 Not sure, but this might be a solution for using an Activity: http://stackoverflow.com/questions/8500283/how-to-hide-action-bar-before-activity-is-created-and-then-show-it-again Jan 22 07:50:47 That combined with just showing the other Activity from MainActivity.onCreate. Jan 22 07:51:05 TacticalJoke, I think this might be a good idea: http://stackoverflow.com/questions/25564920/make-it-appear-as-if-only-one-activity-has-launched-when-implementing-a-eula Jan 22 07:51:20 Fragments that is Jan 22 07:52:30 Ah, yeah. Fragments could work. Jan 22 07:52:58 depends how much refactoring I would have to do Jan 22 07:53:19 its only a two activity app Jan 22 07:55:25 I'm guessing it'd be pretty easy with Fragments. Just have each Fragment talk to the Activity (and not to one another). Jan 22 07:57:48 I'm super curious with regards to howthis workhttp://developer.android.com/guide/webapps/webview.html#BindingJavaScript ? Jan 22 07:58:04 how client side JS invokes Android code? Jan 22 07:58:35 does Android inject some extra plugin code into the client side JS that makes it happens if yes then what sort of code, cuz any author could inject similar code and execute whatever they wanted to. Jan 22 08:00:53 interesting that on tablets, MS is just scaling down the desktop interface, rather than scaling up the phone UI Jan 22 08:00:56 Yeah, I'm guessing it's that because it says this: Jan 22 08:00:58 "This can be a very useful feature or a dangerous security issue. When the HTML in the WebView is untrustworthy (for example, part or all of the HTML is provided by an unknown person or process), then an attacker can include HTML that executes your client-side code and possibly any code of the attacker's choosing. As such, you should not use addJavascriptInterface() unless you wrote all Jan 22 08:00:58 of the HTML and JavaScript that appears in your WebView." Jan 22 08:01:00 this was the right approach Jan 22 08:09:56 I am embarrassed, I can't find the list of objectanimator attributes, someone ca help me ? Jan 22 08:25:33 If I start a service that is ment to be a background service, can getApplication() return null if called from that service? Jan 22 08:36:46 does everyone basically use android studio now? Jan 22 08:41:20 prinsen, no. Jan 22 08:41:29 Application is always instantiated. Jan 22 08:43:53 Mavrik: Can it ever be destroyed during the time the service is running? Jan 22 08:44:08 no way man Jan 22 08:44:12 prinsen, no, because it's the first object to be instantiated and the last to destroyed Jan 22 08:45:35 I have a question that I sort of already know the answer to Jan 22 08:46:25 if I were to have Android Studio running on some PC (fresh install, no SDK's yet) and I take the folders of SDK 21 and 14 for example and place them in the SDK folder of the freshly installed Android Studio on the other PC, place them under platforms, will this just work? Jan 22 08:46:36 because the platforms are just folders after all Jan 22 08:47:00 Mavrik: But activities can be killed at any time right? Jan 22 08:47:26 Mavrik: from the service point of view Jan 22 08:47:27 Now you're just asking stuff explained in one of the first pages of android tutorial. Jan 22 08:47:33 Odaym quick Q, if you use connectGatt (autoConnect = true) and the device gets disconnected, lets say out of range, should android attempt to reconnect with it ? Jan 22 08:47:50 it should just go back to scan Jan 22 08:48:10 Odaym hm, can you explain ? Jan 22 08:48:19 Hello! Sometimes when i query from my app content provider on my second app i see "E/ActivityManager( 4945): Still waiting to start provider ContentProviderRecord" and query is pending. What it means? Jan 22 08:48:44 as far as it knows, device is no longer available at all, not just became out of range, it's out of the room completely. so just scan again and see whoever else is in range again Jan 22 08:49:14 oic. i was wondering if android would attempt to reconnect with it once available again Jan 22 08:50:26 ah this is the comment I told you about the other day http://pastie.org/9850604 Jan 22 08:50:31 need video calling facility in my android app, ideas? Jan 22 08:50:42 that is inside my connect() Jan 22 08:51:12 that comment and the lines below it were never touched, and I never understood why the code there means that there was something previously connected Jan 22 08:51:36 Odaym hmm. i traced the way the nordic app does it, they nuke the previous gatt instance and close it on each connect Jan 22 08:51:52 this is what should be done Jan 22 08:51:56 best bet Jan 22 08:51:57 and on disconnect they use reflection to refresh the service cache Jan 22 08:52:11 to invvoke BluetoothGatt.refresh() Jan 22 08:53:17 yeah it would be great to sit down with one of the engineers of the app, "so, wtf did you learn about the android blte apis that aren't explained in the docs" Jan 22 08:54:04 does everyone basically use android studio now? Or is that mostly for beginners? Jan 22 08:54:54 raj i haven't seen any polls. but its the official ide Jan 22 08:55:02 so not for beginners Jan 22 08:55:22 ok, cuz everyone was using eclipse for the longest time Jan 22 08:56:17 yea you can't find the word Eclipse now on d.android.com Jan 22 08:57:46 ok cool Jan 22 08:57:48 thank you :) Jan 22 08:57:59 its like the ministry of truth went back and erased it Jan 22 08:58:06 haha Jan 22 09:11:23 hmm, is there a way in xml to set the textColor for a remoteView used in a notification? Jan 22 09:11:46 I set a TextView and the color of the notification background varies from device and OS Jan 22 09:16:48 I was wondering if Picasso can straighten or crop images that are taken, similar to what CamScanner does Jan 22 09:16:58 straighten how? Jan 22 09:17:02 crop, of course Jan 22 09:17:07 literally straighten Jan 22 09:17:15 you can do arbitrary rotation Jan 22 09:17:42 would this be doable before the image is set? Jan 22 09:17:55 ah I can take them to an activity where I have these controls, with "Done" checkmark Jan 22 09:18:12 ugh, do we have any alternative MTP driver for OS X yet? Jan 22 09:18:38 what about crop? I only used centerCrop() but Im talking about providing like a skeleton selector that I can move and drag around to choose the area where I want to crop Jan 22 09:19:18 like what you do with images that you take on Camera app and then choose whether you want to crop them Jan 22 09:20:46 we don't have a built-in operator for crop Jan 22 09:20:54 you can do it with a custom transformation quite easily Jan 22 09:21:06 just take the x, y and width, height in and do the manipulation Jan 22 09:21:21 CropSquareTransformation()? Jan 22 09:22:02 hey , my alarm repeats itself after one minute but when i check whether it exists or not ,it says does n't exist -> boolean alarmUp = (PendingIntent.getBroadcast(this, 0, Jan 22 09:22:04 new Intent("Alarm.class"), Jan 22 09:22:06 PendingIntent.FLAG_NO_CREATE) != null); Jan 22 09:22:47 Odaym: no, a custom one Jan 22 09:23:47 killer: you can't check if it exists, you can only set it or cancel it. Jan 22 09:23:56 killer: if you're talking about AlarmManager. Jan 22 09:24:35 appel1: so the above line that i stated will not work ? Jan 22 09:24:55 I doubt you intended to pass the String "Alarm.class" as an action.. Jan 22 09:25:35 Alarm.class contains my broadcast receiver (displays notification) Jan 22 09:25:43 killer: getBroadcast is for creating a pending intent so no, it will not work for checking if you've set an alarm with that pending itent in the AlarmManager. Jan 22 09:26:38 You're passing a String, not a Class Jan 22 09:27:14 that explains the behaviour of my app , thanx Jan 22 09:32:14 killer: what is it you do once per minute? =) Jan 22 09:32:25 check facebook! Jan 22 09:32:52 appel1: actually , it is once per day but for testing I changed it to once per minute Jan 22 09:33:07 killer: ah, ok. Makes more sense then. Jan 22 09:34:14 I guess you've read the docs about it? http://developer.android.com/training/scheduling/alarms.html Jan 22 09:35:26 Yes , but some misleading stack overflow solution lead me to the above condition Jan 22 09:42:06 So I;m trying to use this in Android Studio, https://crosswalk-project.org/documentation/embedding_crosswalk.html - I important it as module, but when using accessing it in my main app module using import org.xwalk.org...; it won't work, any idea why? path cannot be resolved Jan 22 09:48:06 Hello, do you guys think it is possible to make an application B that watch on an application A, and detect if application A is killed by android system ? Jan 22 09:48:54 then i could make a difference beetwen real crash from application A, and crashs caused by android system Jan 22 09:49:25 (by shutting down apps in background) Jan 22 09:52:11 specifically, im looking for what signal android system emit when it kills a process Jan 22 09:57:21 if I add a module to my android project, will it be accessbile from another module ? Jan 22 09:57:38 are there tools in the android-sdk to get info on an APK? e.g. version ? Jan 22 10:02:09 mtR_: does using an uncaught exception handler as for examle acra does not work for you? Jan 22 10:03:33 well never heard about that Jan 22 10:03:54 mtR_: http://www.acra.ch/ Jan 22 10:04:11 ill check it thx Jan 22 10:04:15 mtR_, there are no crashes "caused" by android system Jan 22 10:04:25 the whole notion of that is... funny. Jan 22 10:04:41 If your app gets killed it's business as usual, that's not a crash. Jan 22 10:04:58 well android kills app on background when he needs memory Mavrik Jan 22 10:05:22 Mavrik: well, in the logcat output Android does state that sticky services killed by the system are restarted because they crashed. Jan 22 10:05:23 And? Jan 22 10:05:45 and i dont want my app to be killed lol, or i want to know who killed it :) Jan 22 10:06:14 appel1: is acra open for commercial use ? Jan 22 10:06:31 mtR_: you want to circumvent the memory management in Android to ensure your users devices perform worse? how nice of you. Jan 22 10:07:09 wot Jan 22 10:07:32 i just want to know if my app crash by itself, or has been killed by android Jan 22 10:07:38 nothing else Jan 22 10:08:07 if it crashed by itself you'll have a stack trace in logcat Jan 22 10:08:08 mtR_: acra is apache licensed Jan 22 10:09:55 so technically i could make another application B, watching for stack trace of my app A ? Jan 22 10:10:37 mtR_: no, because in recent versions of Android apps can only see its own log. Jan 22 10:10:51 :'( Jan 22 10:11:24 mtR_: but why not use one of the many crash analytics libraries that already exists? Jan 22 10:11:25 mtR_, I don't get your issue Jan 22 10:11:41 mtR_, ACRA/Crashlytics/anything work by registering a top-level crash handler Jan 22 10:11:51 which stores and uploads stack trace from crashes of your app Jan 22 10:11:58 it seems what you're looking for right? Jan 22 10:12:02 yes :) Jan 22 10:12:12 i just heard that, 5mn ago Jan 22 10:12:17 thx for that :) Jan 22 10:12:26 so i want to use the Theme.WallpaperSettings for my wallpaper settings activity, but the bottom of the wallpaper preview has buttons and it looks bad behind the buttons at the bottom of the settings list. Any ideas on an alternative? I was using a dialog so you could see the wallpaper around the edges. but the wallpaper doesn't move or change until out of the settings activity so i'm Jan 22 10:12:26 probably going with just a fullscreen opaque theme... but any other suggestions or tips? Jan 22 10:13:35 the dialog one seemed to get choppy sometimes too... is that normal? Jan 22 10:16:07 hm i guess the default theme has the same choppyness when scrolling. Jan 22 10:42:45 Does anyone know how I can have another test directory, alongside 'androidTest' with more test cases etc. in [Android Studio]? Jan 22 10:44:43 ghost___, add another dir to test source set in Gradle Jan 22 10:44:45 http://tools.android.com/tech-docs/new-build-system/user-guide Jan 22 10:44:53 er, http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Configuring-the-Structure Jan 22 10:45:26 Ok thanks, looking at that currently, guess I must be close ! Jan 22 10:49:49 I struggle with permission SEND_SMS, is there a way to create one apk that will detect that you can send sms or not Jan 22 10:50:18 At this moment Nexus 7 is unsupported by my app Jan 22 11:03:40 hi guys, i have a relativelayout inside another relativlayout that i want to rotate the content of using the rotation tag, but i just can't seem to alight it correctly, is the width/height/align paramters somehow contected to its state prior rotation? Jan 22 11:23:32 asperon: which tag you mean? Jan 22 11:23:50 you can use setRotation for view Jan 22 11:25:52 Has anyone online used Roman Nurik's swipe to dismiss listeners? Jan 22 11:26:52 I was able to implement the listview one, but I am having trouble implementing the generic one. I think it's because I'm trying to swipe away an entire viewgroup, but I don't know how to verify that. I get an action_down in the listener, but never an action_up Jan 22 11:28:48 i’m trying to use a class extending BroadcastReceiver as a nested class, so I can do some things from its outer class before sending out notifications, but I’m getting the exception “no empty contructor” Jan 22 11:29:18 did you use the superclass constructor in the constructor? Jan 22 11:29:36 xgearx, yeah, the rotation tag, but it seems to mess with the align attributes, or it aligns first and then applies the rotation or something Jan 22 11:29:58 asperon, maybe force the viewgroup to remeasure somehow =/ Jan 22 11:30:12 ill try a requestLayout in code Jan 22 11:30:33 yeah Jan 22 11:30:40 feels hacky but maybe it'll work Jan 22 11:31:00 the only examples i’ve found just implement onReceive Jan 22 11:31:12 so i don’t know what the constructor is Jan 22 11:31:53 ultra-, usually when you extend a class you create a new constructor that often calls the superclass one. Try doing that Jan 22 11:32:27 typing super(ctrl+space in your IDE should offer an explanation, or ctrl+click super() in your new constructor Jan 22 11:32:56 you can also open the BroadcastReceiver class to check it there Jan 22 11:33:17 * hesperaux has to stop for the night Jan 22 11:33:59 ok, the docs list “BroadcastReceiver()” as the public constructor Jan 22 11:34:35 gives me an error saying return type required, so i have to figure out what that is Jan 22 11:36:22 the constructor doesn't return anything except an instance of the object Jan 22 11:36:32 not sure what's going on there Jan 22 11:36:40 asperon: maybe i am wrong, but as i know, if you rotate view in android - view coordinates and all other parameters are not changed. rotation is affect only how view wil draw on screen. Jan 22 11:37:26 xgearx, strange thing is that the aligns dont work, ill give it another shot Jan 22 11:38:06 so maybe try to rotate from code Jan 22 11:38:26 ok, i’ll keep looking… thanks Jan 22 11:39:18 guys, I fixed my problem from this link, in case anyone is curious: https://github.com/romannurik/Android-SwipeToDismiss/issues/16 Jan 22 12:01:47 hey guys.. i migrated my project to another name, everybody is working but the custom typeface i was using is not being applied anymore, any ideas? Jan 22 12:07:28 Hej could someone explain me why i need to click twice on my imagebutton to have it perform the connected onclick function Jan 22 12:08:56 <_genuser_> alright, implementing a picture gallery. what's the best approach? recycleview? Jan 22 12:09:07 <_genuser_> my reading so far has lead to the conclusion of recyclerview Jan 22 12:24:20 Hi ! My app is using the camera, and I use an Intent(MediaStore.ACTION_IMAGE_CAPTURE), so I won't have to make a lot of dev to have a fully operational camera. Is there any way to tell the APN to have some restriction (I want the picture to be a 640*640 image) Jan 22 12:24:24 ? Jan 22 12:41:58 I've got an activity with an appbar and a listview, and I need to add a control to select a week (just a number, will usually be close to the current week) Jan 22 12:42:08 anyone got some advice on how to implement the control? Jan 22 12:43:16 following material design Jan 22 12:45:09 how to change background of ImageButton Jan 22 12:45:53 i have used android:background="@color/black_overlay" in layout file Jan 22 12:46:12 in program how can i change it to white_overlay Jan 22 12:46:34 imageButton.setBackground(new ColorDrawable(R.color.white_overlay)); Jan 22 12:46:38 its not working Jan 22 12:46:55 Icon_1.setBackgroundColor(R.color.white_overlay); Jan 22 12:47:09 not working either Jan 22 12:47:13 any suggestions Jan 22 12:47:15 ? Jan 22 12:58:02 does any one knows a good lib to resize a jpg, without aliasing ? Jan 22 12:59:14 <_genuser_> dang, 672 milliseconds for startup. Jan 22 12:59:19 <_genuser_> makes the app seem bloated. Jan 22 13:18:45 Heya Jan 22 13:18:46 fast question Jan 22 13:18:53 i got a button inside my view Jan 22 13:19:08 now i wanna add a simple text counter (0 at start) Jan 22 13:19:22 and then increment it for 1 always when the button is clicked Jan 22 13:19:25 how do i do that fast? .p Jan 22 13:20:06 int counter = 0; ((Button) findViewById(R.id.myButton)).setOnclickListener() ... ? Jan 22 13:21:15 or even faster using the awesome JakeWharton's butterknife ? :D Jan 22 13:22:22 Hey , I just followed developer.android.com/training/scheduling/alarms.html , It says to re-enable the alarm , add ComponentName receiver = new ComponentName(context, SampleBootReceiver.class); , it is to be added in SampleBootReceiver itself? Jan 22 13:22:39 re-enable after reboot Jan 22 13:23:15 blusky: how do I set another text then Jan 22 13:23:19 for example i am inside the callback function Jan 22 13:23:31 and got this: private void click(View v) { Jan 22 13:23:31 v.findViewById(R.id.counter); Jan 22 13:23:31 Log.d("FirstApp", v.findViewById(R.id.counter)); Jan 22 13:23:31 } Jan 22 13:23:42 ignore the log stuff :P Jan 22 13:23:49 replace v.findViewById(R.id.counter); with findViewById(R.id.counter); Jan 22 13:23:55 killer: yes, you can schedule your alarms in a boot receiver. Jan 22 13:24:24 did Jan 22 13:24:46 now i just want something like findviewbyid(r.id.counter) = findviewbyid(r.id.counter) +1 Jan 22 13:24:49 ((TextView) findViewById(R.id.counter)).setText('xxx'); Jan 22 13:24:55 what ??? Jan 22 13:25:03 this is a Java problem you got, not android :D Jan 22 13:25:29 Na Jan 22 13:25:32 I dont know how to get the text lol Jan 22 13:25:32 :P Jan 22 13:25:36 .getText Jan 22 13:25:38 .cause obv theres no gettext Jan 22 13:25:41 oh, my ide is trolling me then Jan 22 13:25:48 cast the view into textview Jan 22 13:25:58 yea androidstudio is trolling me somehow Jan 22 13:26:10 w/e =) Jan 22 13:26:17 letsa test it :p Jan 22 13:26:53 how do i import textview? .p Jan 22 13:27:11 nvm Jan 22 13:27:43 appel1: I did as stated in docs , but still alarm doesn't run after reboot(without reboot works Ok), http://pastebin.com/HtvQvFMn Jan 22 13:27:57 killer: is your boot receiver called? Jan 22 13:28:48 Hmm Jan 22 13:28:59 appel1: Yes, alarm.class is my bootreceiver .http://pastebin.com/HtvQvFMn Jan 22 13:29:09 blusky: another question :P Jan 22 13:29:11 ((TextView) findViewById(R.id.counter)).setText( ((TextView) findViewById(R.id.counter)).getText() + 1); Jan 22 13:29:12 this is what i got now Jan 22 13:29:21 killer: and why do you try to enable the boot receiver in onReceive of said boot receiver? Jan 22 13:29:25 how can I cast the getText view into an int so i can use the + operator? =) Jan 22 13:29:47 killer: if it wasn't already enabled it wouldn't get called in the first place. Jan 22 13:29:58 anybody got an idea? :P Jan 22 13:30:13 killer: of course, it is a good idea to disable it if the app knows that it doesn't need to reschedule anything after a reboot. Jan 22 13:30:32 Xatenev: you parse the text Jan 22 13:30:36 How? =( :P Jan 22 13:30:45 this android is so different from other programming lol Jan 22 13:30:45 sorry Jan 22 13:30:52 Xatenev: make an int variable Jan 22 13:30:54 and use it Jan 22 13:31:02 don't use getText() Jan 22 13:31:21 int counter=0, setText(Integer.toString(counter++)) Jan 22 13:31:34 it's simple java Jan 22 13:31:45 but how do i get the text then Jan 22 13:31:47 i dont want int counter = 0 Jan 22 13:31:53 i want int counter = the counter number inside the view Jan 22 13:31:54 it's a start value ... Jan 22 13:31:55 blusky: but it is so different =D =D Jan 22 13:32:06 Dont want a start value Jan 22 13:32:12 the start value should be the text inside the view Jan 22 13:32:12 :P Jan 22 13:32:21 appel1: I should try to enable it , then , I think I read in docs , that I should enable it Jan 22 13:32:23 thats my problem actually. I want something like int counter = getText() .. Jan 22 13:32:40 killer: if it is initially disabled in your manifest then yes Jan 22 13:32:44 Integer.valueOf(getText()) Jan 22 13:32:54 killer: but you need to do it somewhere else in your application that will actually get executed =D Jan 22 13:35:02 appel1: why not enable it in manifest itself ? by android:enabled="true" ? Jan 22 13:35:10 int counter = Integer.valueOf(((TextView) findViewById(R.id.counter)).getText()) + 1; Jan 22 13:35:15 cannot resolve method java language char sequence Jan 22 13:35:17 O>o Jan 22 13:35:38 killer: that depends on what the needs of your app is Jan 22 13:36:20 .getText().toString() Jan 22 13:36:48 ah thats it Jan 22 13:36:49 thanks a lot Jan 22 13:36:51 for my noobeing Jan 22 13:36:51 :D Jan 22 13:41:15 Can someone explain use case for square okio lib. i mean individually in project. Jan 22 13:42:03 and second question. for saving images i use bitmap.compress, is there any way to speedup it? Jan 22 13:44:45 appel1: seems like enabling it in manifest worked for me , thnx Jan 22 13:46:00 is there a way to stub a method on any instance of a class with mockito? Jan 22 13:54:36 I'm trying to run an automator with genymotion but I need to parse adb to check if the machine is loaded (i.e ready to be slid open), what's the message that says everything's good to go? Jan 22 13:57:31 Hello, I like to install the NDK. https://developer.android.com/tools/sdk/ndk/index.html Jan 22 13:57:32 My overall goal is to use opencv for android. Jan 22 13:57:57 the Issue I do have is that, the NDK is not listed as shown in tutorials at the official update page, when trying to install it for eclipse Jan 22 13:58:13 Step 6: http://docs.opencv.org/doc/tutorials/introduction/android_binary_package/android_dev_intro.html Jan 22 13:58:30 https://dl-ssl.google.com/android/eclipse/ Jan 22 13:58:50 do you see the NDK? My eclipse Version is Version: Luna Service Release 1 (4.4.1) Jan 22 14:09:18 hi Jan 22 14:11:36 If you got an app where you can purchase smiley in it. Do you think it's a good idea to use a sql databse ? Jan 22 14:11:44 *database Jan 22 14:20:43 http://stackoverflow.com/questions/28091026/ndk-is-not-listed-at-the-update-page-why Jan 22 14:30:50 Is there a way of finding out why onDestroy() is called in an activity while debugging/runtime? Jan 22 14:32:54 why or when? Jan 22 14:35:50 why Jan 22 14:36:11 apparently a suicide message is sent which kills the process, wtf Jan 22 14:38:04 after switching airplane mode off again Jan 22 14:38:48 and how is it a problem ? Jan 22 14:39:26 Why should my activity be destroyed just because I switched to Airplane mode and back on again Jan 22 14:40:01 your activity gets destroyed for even more mundane reasons than that Jan 22 14:41:05 there is no guarantee of your activity to continue running so you should be always prepared for destruction ;) Jan 22 14:44:47 hello people Jan 22 14:45:51 I'm running the same app both on my genymotion virtual device and my actual Galaxy phone Jan 22 14:46:17 And it runs perfectly on the first one, but it has issues on the phone Jan 22 14:46:52 virtual device is 5.0.0 and my phone is 4.4.4 Jan 22 14:52:11 anybody? help! Jan 22 14:52:20 hey guys… my webview is loading extremely slow on a bad hardware tabled (only the webview, the rest is okay). how can i make it faster? Jan 22 15:01:15 Hello, i would improve my self. i need something about smali code, i would learn something about smali coding. somebody can help? Jan 22 15:02:23 I would never help a blind killer. Jan 22 15:13:42 huh, what's up with GC on Galaxy S4 Jan 22 15:16:27 Mavrik, expanding universe? Jan 22 15:20:38 mmh? Jan 22 15:20:48 I'm running CM12 on a Galaxy S3. The front facing camera doesn't have the proper resolution/aspect ratio. Jan 22 15:20:53 I've found this: http://forum.xda-developers.com/showthread.php?t=2645592 Jan 22 15:21:58 a smali language guide? Jan 22 15:24:31 can you use keypaths in @SerializedName? Like @SerializedName("thing.sub_thing") or @SerializedName("thing/sub_thing")? Jan 22 15:29:39 Good morning all! Jan 22 15:30:39 I have started development on a new app and I had a question regarding Volley and the overall structure for making REST calls. I have read that a generic Loader class should be used so that orientation change will not mess up the request. Jan 22 15:31:13 Right now i have it structured: Fragment-->Loader (loader adds volley request to queue). I only have this for GET right now Jan 22 15:31:44 i am wondering the correct structure/way to handle all the REST calls Jan 22 15:31:56 and where those calls should be made from Jan 22 15:36:29 greetings android developers. i'm inheriting an app that had listviews populated by values from strings.xml but now i need to dynamically update the values (they may change on each start up). so, i'm planning on instead saving the data i need in sqllite and querying for the required info in the activity's onCreate() method. then, i'. my question is this: should this be an asynchronous task or synchronous? i am a noob to android. t Jan 22 15:36:47 I don't know where I should be asking this, so I come here.. When I forward a call using Intent.ACTION_DIAL, is the phone behaving as a proxy for the call? Jan 22 15:38:14 My team is developing an Android app for the first time (we are taking over for an existing dev team). Is there anything that we need aside from the play store credentials in order to publish a new version? Any resources about this topic? Thanks Jan 22 15:38:52 emehrkay: you don't need the play store credentials, you can use your own accounts and be given permission to do so Jan 22 15:39:12 does any one's familiar with facebook graphapi ? I'm using it for authentication on my app, and I also would like my users to be able to browse their facebook photos library. But I want facebook's calls to be made from the mobile, should I use the same facebook token for both ? Jan 22 15:39:14 emehrkay: you will need the application's keystore as well Jan 22 15:39:40 (the one from authentication, and the other for local call) Jan 22 15:39:56 nb-ben: thank you. Is the keystore something that the old developers can easily package up and give to us? Jan 22 15:39:58 emehrkay: 1. playstore access, 2. application's keystore that was used to publish previous versions, 3. codebase Jan 22 15:40:18 emehrkay: yes, it's a file, it may be password-locked. ask for all the information to use it. Jan 22 15:40:31 nb-ben: Thank you very much Jan 22 15:40:33 emehrkay: it's a standard keystore file really. Jan 22 15:41:46 Anyone have experience using Volley in their application? Jan 22 15:44:03 Hello is this also the right place for asking question about android studio? Jan 22 15:44:22 sure Jan 22 15:45:12 I have recently upgraded to 1.0.2 and now i get " Jan 22 15:45:12 Error:(21, 0) Gradle DSL method not found: 'runProguard()' Jan 22 15:45:12 Possible causes:
  • The project 'TicketApplication' may be using a version of Gradle that does not contain the method. Jan 22 15:45:12 Open Gradle wrapper file
  • The build file may be missing a Gradle plugin. Jan 22 15:45:12 Apply Gradle plugin
  • Jan 22 15:45:38 I'm not sure what to do Jan 22 15:45:53 this is really a gradle issue Jan 22 15:46:14 it tells you that the method runProguard() is not defined within your gradle script files Jan 22 15:46:44 ya Jan 22 15:47:02 is gradle not updated when i update android studio? Jan 22 15:47:32 I'm a real newby when it is about android development. Jan 22 15:47:33 change RunProguard() to : minifyEnabled true Jan 22 15:47:34 http://www.lmgtfy.com/?q=Gradle%20DSL%20method%20not%20found:%20%27runProguard()%27 Jan 22 15:48:08 the first result has the answer Jan 22 15:48:17 along with the rest of the 10 other results after it Jan 22 15:48:27 well, 9 :P Jan 22 15:48:41 you're right nb-ben , I should have sent a lmgtfy too.... Touche. Jan 22 15:50:18 Very help full Jan 22 15:50:21 NOT Jan 22 15:50:37 dude, I gave you the answer. Jan 22 15:50:51 where do i need to change that? Jan 22 15:50:57 But I shouldn't have, you should have just Googled it. Jan 22 15:51:19 oh sorry that the help is not to your taste Jan 22 15:51:22 change runProguard to minifyEnabled in build.gradle Jan 22 15:51:30 perhaps you should hire someone to service your needs Jan 22 15:51:33 nb-ben, two in a row! :D Jan 22 15:51:43 build.gradle Jan 22 15:51:50 can we take the fighting to another channel Jan 22 15:51:52 I'll only go as far as directing you. Jan 22 15:52:30 osxorgate, Give me a break, he's not even trying. Double clicking on the error would bring him to the right place. Jan 22 15:52:30 osxorgate: thanks Jan 22 15:53:11 osxorgate: I'd think that this is rather educational, directing a person towards researching solutions to their problems rather than consuming service. But sure. Jan 22 15:53:17 * nb-ben off to work Jan 22 15:54:17 anyways... anyone on that has experience with Volley? Jan 22 15:54:22 general question, yall: should all sqllite queries be in async tasks? Jan 22 15:54:51 pablq, not necessarily. Jan 22 15:54:54 MikeWallaceDev: yes i clicked on those links but it did not make any sense to me. thats why i jumped into here Jan 22 15:55:00 pablq, they should not be done on the main thread. Exactly how you do them is up to you Jan 22 15:55:56 nielsNL: replace "runProguard" with "minifyEnabled" in your build.gradle files. Jan 22 15:56:05 pablq the key is whether they are potentially complex enough to substantially delay the UI Thread Jan 22 15:56:17 nebiros: that's a direct copy/paste from the stackoverflow answer, which part is not clear? I'll help you understand it Jan 22 15:56:44 nebiros: sorry, nielsNL ^ Jan 22 15:57:11 nb-ben, NO don't be sarcastic!!! osxorgate will ground you!! Jan 22 15:57:22 I'm not sarcastic Jan 22 15:57:33 ok, phew. Jan 22 15:57:36 FlipBill: MikeWallaceDev: k thanks. yeah i suspect in my particular case there is no reason to do them async... they are very simple queries and the user display depends entirely on their result --> that is, there would be nothing to show the user until the queries are complete Jan 22 15:57:49 I was like that when I started out Jan 22 15:58:19 I am thankful to this day to those who denied service and provided me with direction, so I'll do that for others Jan 22 15:58:39 i agree Jan 22 15:58:41 pablq, be careful. There may be subtle performance requirements even if the user is waiting for data retrieval. Jan 22 15:58:59 That's what we are all here for. But we also expect people to try their best to figure out the answer first. Jan 22 15:59:08 Stupid things, like simply being able to scroll an existing list, etc. Jan 22 15:59:25 Only you can answer that question ultimately. Jan 22 15:59:30 FlipBill: k. considered. i need to look up how to do queries off the main thread. is this something the SQLiteOpenHelper class handles for me? Jan 22 15:59:43 pablq, Then just put a "refreshing" label, or something. Jan 22 16:00:00 pablq, look into the Loader classes Jan 22 16:00:01 MikeWallaceDev: right. thanks. Jan 22 16:00:42 appreciate the help. i'm a junior dev inheriting this android app update... never even written Java before... welp. Jan 22 16:00:49 is anyone familiar about the nature of call forwarding in Android? whether forwarding a call using ACTION_DIAL will keep the phone actively participating as a proxy, or redirect the originator and neglect it? Jan 22 16:00:54 pablq, I don't know about that class. The pattern I use involves a Handler the obtains results in the UI Thread that are queued from other Threads. Jan 22 16:01:39 pablq: im in the same boat ;) Jan 22 16:02:13 We're happy to help pablq :) Jan 22 16:02:16 nielsNL: good luck dude. Jan 22 16:03:59 Hmm are there multiple places where the build.gradle are stored Jan 22 16:04:31 nielsNL, the one in the project folder is global. You want the one in your module folder Jan 22 16:06:32 thanks now it is starting to make sense Jan 22 16:07:30 The basics of Gradle (for Android) are simple. It only becomes difficult when you want to try something special Jan 22 16:08:27 Anyone using Scala with AS? Jan 22 16:11:36 Yes now i can build the app again. Jan 22 16:12:13 Thanks. MikeWallaceDev Jan 22 16:12:29 No Problemo Jan 22 16:15:46 Now on other issue. We did had an app on google that performed badly (Made by someone else). Jan 22 16:15:47 While i was learning to debug and fix the issues at hand, Google blocked my account and removed the APP. Jan 22 16:15:47 I tried to contact by them by mail, but without any response. Jan 22 16:15:47 How can we get our fixed plugin back online? Jan 22 16:16:52 another one bites the dust.... Jan 22 16:17:04 who Jan 22 16:21:43 anyone know about using Loader + Volley? Jan 22 16:22:20 siegs_: you shouldn't need to use the two. Can you pastebin your code? Jan 22 16:22:26 I didn't use Volley, but isn't the point that you don't need both? Jan 22 16:22:48 I have read that using Volley alone you can run into issues when for example orientation is changed Jan 22 16:23:11 I was hoping/thinking Volley alone should be sufficient but I have read both sides Jan 22 16:23:21 MikeWallaceDev: you were trying to build android on Fedora a while ago. were you successful? Jan 22 16:24:01 Any Arabic speaking users in? I am looking for a co-founder for my website called http://dardeshni.com Jan 22 16:24:15 donniezazen, yes, I wrote a blog post about building it using Docker. I wrote a container, it's a breeze to use. Jan 22 16:24:37 evanc: http://pastebin.com/VTwug9zw Jan 22 16:25:13 thats my loader that adds the requests to queue Jan 22 16:25:40 MikeWallaceDev: let me search for the link Jan 22 16:29:14 donniezazen, I had to reboot, did you answer back? Jan 22 16:29:57 MikeWallaceDev: no just looking up the link Jan 22 16:30:03 hello everybody Jan 22 16:30:17 I have a problem with Volley API Jan 22 16:30:19 http://stackoverflow.com/questions/28093807/volley-jsonobjectrequest-sending-3-jsonobject-in-same-request Jan 22 16:30:31 anybody could help me ? Jan 22 16:30:35 MikeWallaceDev: A quick question does it require OpenJDK 7 or above or a hard requirement of OpenJDK 7 only? Jan 22 16:31:11 It's super duper picky on JDK, says it wants one thing, then asks for another... Jan 22 16:31:15 VERY annoying. Jan 22 16:31:25 The dock answers that nicely. Jan 22 16:32:07 evanc: were you able to take a look? Jan 22 16:32:49 oh okay because there is no OpenJDK 7 on Fedora 21. JDK 7 is going EOL before Fedora 22's EOL so they dropped the support for JDK 7. Jan 22 16:32:55 when i click a button in my app the keyboard closes automatically. i have absolutely nothing set up programatically to do that.. how could this be? and how can i force it to NOT close Jan 22 16:32:59 MikeWallaceDev: ^^ Jan 22 16:33:22 donniezazen, sooooo you don't know what Docker is, is what you are saying ;) Jan 22 16:33:32 what button is that? Jan 22 16:33:41 Wait a sec, still loading, I'll get you the link Jan 22 16:34:14 man it's just beautiful to upgrade to SDK Tools 24 and Gradle reports "Build finished, 0 Errors, 0 Warnings" Jan 22 16:34:20 this is the life Jan 22 16:35:03 donniezazen, http://androiddevcorner.blogspot.ca/2014/11/how-to-build-aosp-with-docker.html Jan 22 16:35:27 thanks Jan 22 16:37:30 what chu mean Odaym? Jan 22 16:38:21 what button did you press, MartialLaw ? Jan 22 16:38:33 what is the label on it Jan 22 16:40:37 MartialLaw, that sounds like normal behavior to me... Jan 22 16:44:21 normal behavior? Jan 22 16:44:34 not on 100% of the other apps i've made Jan 22 16:44:49 it's not a button even. it's a clickable relativelayout Jan 22 16:44:59 man.... Jan 22 16:45:02 fix your question Jan 22 16:45:39 i'm developing two apps right now that are basically the same. they both have this same layout. i write some text in an edittext field and then press a clickable relativelayout. in one app the keyboard stays open in the other it closes Jan 22 16:45:50 i'm not doing anything programatically to do this Jan 22 16:52:03 don't know Jan 22 16:52:27 I just know I'd never make a layout clickable :P Jan 22 16:52:37 wat-worthy behavior Jan 22 16:55:17 evanc: you there? Jan 22 17:00:27 man, a good library is a good thing Jan 22 17:00:31 it's so valuable Jan 22 17:01:09 good for you Jan 22 17:01:28 good libraries even gives noobs like me a reason to stand behind "Don't reinvent the wheel!" Jan 22 17:01:46 while in reality you end up a noob copy paster and not invent anything new :P Jan 22 17:02:28 ok noob so stop raggin me on the fact that i have a tiny layout that must be clickable Jan 22 17:02:57 it was 1 sentence about how I wouldn't do what you mentioned, I did not tell you that you shouldn't do it Jan 22 17:03:16 do what you like, I am free to express my opinion of what you are doing if you are announcing it Jan 22 17:03:20 brah Jan 22 17:04:28 see this is android BS... now it has the behavior i want. so f-ing unreliable Jan 22 17:04:45 you just mad Jan 22 17:04:58 start digging, someone will have the problem you are having Jan 22 17:08:01 apparently not Jan 22 17:10:02 exit Jan 22 17:10:04 lol Jan 22 17:10:05 NO! Jan 22 17:10:06 fail Jan 22 17:10:10 :D Jan 22 17:11:52 If a user logs in and I retrieve their corresponding model object, where is the best place to store that as session data so I can access it from anywhere in my app? Jan 22 17:12:13 database? Jan 22 17:13:30 Odaym: and then retrieve it from there every screen i need it? I feel like there should be a better way Jan 22 17:13:39 there are many ways Jan 22 17:13:48 there's SharedPreferences Jan 22 17:14:13 but I wouldn't advise it Jan 22 17:14:35 hmm Jan 22 17:14:35 alright Jan 22 17:14:37 but you definitely have to define what you mean by better way Jan 22 17:15:12 the opposite of worse way! Jan 22 17:15:14 * JesusFreke ducks Jan 22 17:15:20 that's 1 definition Jan 22 17:15:28 better whale Jan 22 17:16:24 a global variable for example Jan 22 17:16:41 Help Jan 22 17:16:48 nah that's unheard of siegs_ Jan 22 17:16:54 this ain't C# brah! Jan 22 17:17:01 alright folks i've got more questions about accessing sqllite. i'm trying to create a generic class that offers a simple interface for *basic crud operations (probably almost entirely simple read queries < 50 results in db of <400 items). what should i subclass for this? i've considered IntentService, but i think that's overkill for my needs here. Jan 22 17:17:20 I am trying to implement a plugin for something Jan 22 17:17:32 and they say, extend the activity, like this: xyz... Jan 22 17:17:50 a plugin? Jan 22 17:17:52 but, I do not want to extend the activity Jan 22 17:17:55 Android? Jan 22 17:17:58 a JS-Java plugin for Cordova Jan 22 17:18:03 wrong channel Jan 22 17:18:08 Right channel Jan 22 17:18:16 ok, ask away Jan 22 17:18:20 Left channel Jan 22 17:18:55 I'm trying to figure out how to phrase the question... Jan 22 17:19:43 each plugin has a class called CordovaPlugin Jan 22 17:19:46 https://github.com/apache/cordova-android/blob/master/framework/src/org/apache/cordova/CordovaPlugin.java Jan 22 17:20:47 Within that plugin, I can access the activity. Jan 22 17:20:49 Like this: Jan 22 17:21:01 Activity activity = cordova.getActivity (); Jan 22 17:21:36 So what I need to do is to add functions to the activity. Jan 22 17:21:45 Basically Jan 22 17:21:52 Odaym: I think im gonna give the database option a shot. Ill just store an instance of my database helper in my custom Application class so Im not creating a new instance every scren Jan 22 17:21:58 Odaym: thanks Jan 22 17:22:07 yes Application class can be used for that Jan 22 17:22:21 but better to go with Singleton that you write Jan 22 17:22:48 Is there some way to add functions to an Activity without actually adding it to the class? Jan 22 17:22:53 yeah I will Jan 22 17:23:05 how do i compare 2 strings from resources? if(item.get_titleRes().equals(R.string.txt_menu_login)) doesnt work because they’re both ints Jan 22 17:23:13 Agamemnus: that... doesn't make any sense Jan 22 17:23:20 Agamemnus: you mean a static method or something? Jan 22 17:23:25 can I give you some code? Jan 22 17:23:50 non-working Jan 22 17:23:55 if you are in an Activity, luist, you can do if (getString(R.string.resource_string_1).equals(getString(R.string.resource_string_2)) Jan 22 17:24:20 if not in an activity, you have to have context, and from context you replace getString() with context.getResources().getString() Jan 22 17:24:22 Odaym: okay ill try that Jan 22 17:24:26 here is my activity: Jan 22 17:24:28 http://pastebin.com/dndJTUS7 Jan 22 17:25:14 best you can do I think is to have it implement an Interface? Jan 22 17:25:24 but what you have there is absurd Jan 22 17:25:25 here's my plugin code.. check out line 111 on Jan 22 17:25:29 http://pastebin.com/yysBzGAG Jan 22 17:25:37 or at least I've never seen code like that Jan 22 17:25:49 are you talking to me? Jan 22 17:25:55 Odaym: to check if they are different, can i just add a ! before the expression? Jan 22 17:26:05 yea Agamemnus, never seen more than 1 super at a time!! Jan 22 17:26:10 sorry, 1 exclamation mark Jan 22 17:26:15 yes luist Jan 22 17:26:21 Odaym: it's totally normal. Jan 22 17:26:28 really Jan 22 17:26:34 strange never seen it Jan 22 17:26:56 the documentation calls for adding functions to the Activity Jan 22 17:27:05 I.E. SafariJigsawFree Jan 22 17:27:17 but an Activity isn't something that can have functions added to it, that's a class Jan 22 17:27:21 but to keep my code a plugin, I can't modify the Activity code Jan 22 17:27:35 ok I guess if that class extends an Activity than the "class" is an Activity Jan 22 17:27:50 there is only one active activity Jan 22 17:27:56 yea Jan 22 17:28:04 so i need to somehow make the activity call my extended class Jan 22 17:28:16 The way you "add" methods to a class is to subclass it and create them.. No other way Jan 22 17:28:16 and I am lost on that aspect. Jan 22 17:28:34 I created it.. Jan 22 17:28:41 but it isn't being activated Jan 22 17:29:23 Agamemnus, you might want to try just coding some Java apps before jumping into Android... Learn the basics :) Jan 22 17:29:35 ,_, Jan 22 17:30:08 here is something else that gets events from Activity Jan 22 17:30:27 i think I need to do something with startActivityForResult maybe? Jan 22 17:30:48 http://pastebin.com/f89kvLWY -- this code works Jan 22 17:32:14 So, something about... getting the activity, and calling startActivityForResult on it with a specific Intent. Jan 22 17:32:37 In that code, the Intent is AccountPicker.newChooseAccountIntent ... that is kind of built in I guess.. Jan 22 17:33:26 I'm not entirely clear if that will work at all. :( Jan 22 17:33:39 Hi Folks, I'm building a hybrid application that have a sticky bottom navigation with css property position: fixed; bottom: 0; but when I try to input in the app the sticky nav is going above the virtual keyboard ( android 4.2.2 ) Jan 22 17:33:40 I can take the easy route and muck up my Activity. Jan 22 17:37:14 sharpshooter, Cordova? Jan 22 17:37:46 phonegap Jan 22 17:38:08 I'm pretty much the only one alive in this channel who is using that. Jan 22 17:38:25 It's probably a Chrome bug. Jan 22 17:38:56 any reference ? Jan 22 17:39:02 although i am confused on what you mean Jan 22 17:39:08 workaround for this ? Jan 22 17:39:14 the virtual keyboard is always below everything else Jan 22 17:39:30 good evening Jan 22 17:39:42 hey john67 Jan 22 17:40:23 i dont understant why TextView text = (TextView)getActivity().findViewById(R.id.article); is sending a null Jan 22 17:40:28 in a fragment Jan 22 17:41:13 where is the article? in the Activity, or the Fragment? Jan 22 17:41:22 Agamemnus, here is the screenshot http://picpaste.com/personal_details-SYZmulRE.png Jan 22 17:41:43 so what's the problem Jan 22 17:42:27 http://pastebin.com/BeGaCpgX Jan 22 17:42:50 sharpshooter, set imeOptions to adjustPan or adjustNothing Jan 22 17:42:54 MikeWallaceDev: just posted the code http://pastebin.com/BeGaCpgX Jan 22 17:42:54 sharpshooter, on your activity. Jan 22 17:43:42 Mavrik, its just html and css Jan 22 17:44:06 sharpshooter, what's your point? Jan 22 17:44:35 You're still running inside Android. Jan 22 17:44:36 in the layout Jan 22 17:44:49 If you want Android to change it's behaviour, then use Android properties. Jan 22 17:45:25 You can't display anything below the keyboard unless you do something in Java Jan 22 17:45:26 TextView text = (TextView)getView().findViewById(R.id.article); Jan 22 17:45:34 john67, ^^^ Jan 22 17:45:35 it doesnt work Jan 22 17:45:42 Mavrik, i'm kinda newbie in this thats why, so you are saying that if I need to change the css fixed position issue i need to use the android behaviour using native code ? Jan 22 17:45:44 have tried already Jan 22 17:45:56 MikeWallaceDev: doesnt work have tried already Jan 22 17:46:07 when is update being called? Jan 22 17:46:14 before the views are created? Jan 22 17:46:21 just check for null... Jan 22 17:46:26 oki Jan 22 17:47:11 sharpshooter, what. Jan 22 17:47:19 sharpshooter, I'm just telling you to change property on your activity Jan 22 17:47:31 so Android isn't going to resize it when keyboard is displayed Jan 22 17:47:46 g00s_: ? Jan 22 17:47:51 The activity that contains your webview. Jan 22 17:48:03 MikeWallaceDev: i got to go, will be back soon$ Jan 22 17:48:19 adios Jan 22 17:49:15 sharpshooter, in AndroidManifest.xml Jan 22 17:50:13 It doesn't. Jan 22 17:50:20 It doesn't resize it. Jan 22 17:50:25 thanks Jan 22 17:50:28 Well Jan 22 17:50:33 Ok, it does. Jan 22 17:51:04 Is there anything else I would want appcompat-v7 in my app for if my minSdk is 14? Jan 22 17:51:48 version 14 and up have ActionBar built in without support, and that's all I'm aware it's used for Jan 22 17:52:16 Toolbar instead of ActionBar? Jan 22 17:52:29 yiati, Material design stuff. Jan 22 17:52:40 Welcome to 2015 ;) Jan 22 17:53:03 Yeah I'm just not aware of what specifically is in "appcompat-v7" Jan 22 17:53:26 It says "This library includes support for material design user interface implementations." Jan 22 17:53:41 I know ActionBar isn't really a thing anymore with ToolBars Jan 22 17:53:42 Um, d.android.com lists all the classes for each of the libs. Jan 22 17:54:14 It has material style action bar, not the old one. Jan 22 17:54:41 Ahh cool found it here http://android-developers.blogspot.com/2014/10/appcompat-v21-material-design-for-pre.html Jan 22 17:54:48 Alright that's what I though Jan 22 17:54:50 t Jan 22 17:54:54 cool thanks Jan 22 17:55:01 Mavrik, yiati yeah, updating appcompat-v7 automatically made my action bar look materially Jan 22 17:55:05 how can i access a function in my MenuFragment from the parent activity? http://paste.ofcode.org/vTW8by9f3WytvcaGguR3bG Jan 22 17:56:31 luist use supportFragmentManager to get it, typecast it, then you can access functions in it. What are you trying to do? Jan 22 17:56:32 luist: Accessing functions in a fragment from an activity is dangerous because of the lifecycle Jan 22 17:57:04 you can directly access the functions from the object, but you never know if the fragment will be null/attached/etc Jan 22 17:57:13 It's best to use the built in bundle system Jan 22 18:16:31 guys, i have a bunch of objects in a recyclerview Jan 22 18:16:41 i can clickc on one to start a new activity to edit it Jan 22 18:16:57 but how can i pass my changed back to the recyclerview when i close the activity? Jan 22 18:17:26 wait nvm dumb question Jan 22 18:20:42 I would use a spoon. <- Dumb answer :D Jan 22 18:24:34 Hi! Jan 22 18:24:47 am new here. Jan 22 18:24:54 I'm not Jan 22 18:25:24 mattblang: yiati: i know but, this fragment has the side menu which is supposed to be always alive Jan 22 18:25:44 and i need to enable/disable the itens when the user is logged in/off Jan 22 18:25:46 need help on how to best structure content for an app Jan 22 18:26:37 I can wait in queue, thanks! Jan 22 18:27:09 luist: Okay, how do you check if the user is logged in/off Jan 22 18:28:09 javann: http://tools.android.com/tech-docs/new-build-system/user-guide#TOC-Project-Structure Jan 22 18:28:10 yiati: a flag in shared preferences maybe Jan 22 18:28:44 luist: Okay you can access SharedPreferences from a Fragment Jan 22 18:29:01 you just need a context which the fragment has Jan 22 18:29:26 yiati: but the enable/disable should trigger when the login/logout button is pressed, which happens inside the login fragment. its worse to access the menu fragment function from inside the login fragment, right Jan 22 18:30:54 Yes it is, that's not what I was suggesting Jan 22 18:31:35 yiati: i know.. i cant use the sharedprefs for that Jan 22 18:32:09 yiati: if i call a function in the parent activity from the login fragment, its still better than accessing the menu fragment directly right Jan 22 18:33:41 javann, You can ask your question. We can follow as long as there is only 2, maybe 3 topics at a time Jan 22 18:33:56 luist: I don't see how those two things are comparable, but yes you should not access functions in a fragment from an Activity Jan 22 18:35:15 yiati: any idea to solve this? Jan 22 18:35:52 I have big collection of songs classified into genres which I want in app Jan 22 18:36:53 I need help on adopting the best structure to implement either a database or any collection Jan 22 18:36:54 Hello. I am trying to follow this: https://developers.facebook.com/docs/android/getting-started but in step number 4 under Android Studio Setup, I have two build.gradle files unlike the picture. This is how my picture looks like: http://i.xomf.com/vncjs.png To which build.gradle file should I add the code? Jan 22 18:37:22 thanks, ask for clarifications! Jan 22 18:37:40 I assume the difference between the two pictures is due to different versions of the Android Studio. Jan 22 18:38:07 luist: The MenuFragment should be able to listen for updates about signing in without the Activity itself having to tell it Jan 22 18:38:39 You can have a seperate singleton object that exists in your application to handle that Jan 22 18:55:29 Rashad, one build.gradle is project wide, the other is just for the module. Jan 22 18:55:43 What's a module? Jan 22 19:05:11 application are separated into modules in Gragle. You have some reading to do my friend :) Jan 22 19:06:56 It's my first day trying to make an android app. Jan 22 19:06:56 Gragle is Gradle's half-sister that was raised by wolves. Jan 22 19:07:33 I heard that she eats mice. Jan 22 19:08:04 Here: https://developers.facebook.com/quickstarts/463472020440634/?platform=android it is asking me to execute the command: keytool -exportcert -alias androiddebugkey -keystore %HOMEPATH%\.android\debug.keystore | openssl sha1 -binary | openssl base64 but I don't know where to run it Jan 22 19:08:16 <_Auron_> anyone know if android will ever be cognizant of whether or not the camera is being used, and actually 'release' a dead connection? Jan 22 19:08:23 I tried on the "terminal" in the Android Studio but it didn't work. Jan 22 19:09:06 Rashad, welcome to AndroidDev :) Lot's to learn, I would venture to say that this is a good place to ask how to do particular things, but not a great place to learn the basics... You have to read up! :) (I don't want to talk for anyone else, but I think that's a good way to say it...) Jan 22 19:09:33 OK. Jan 22 19:10:42 Do we have a guide/rules page somewhere? I would be good for noobs (and us!) to see what the objectives of the channel are Jan 22 19:11:46 Not even that. Jan 22 19:12:00 Everything related to Android seems to suffer from documentation issues. Jan 22 19:12:20 Even this channel! :D hahaha Jan 22 19:12:47 strange looking dane http://i.imgur.com/gQSDSOS.jpg Jan 22 19:13:16 'really smelled so i gave her a bath' haha Jan 22 19:13:21 Agamemnus: Yeah, that's a google thing in general. Jan 22 19:13:46 Hell, even Android is better than some of their JS libraries I've used.. Jan 22 19:13:46 Hi, I can't seem to find this information through googling; I was wondering if the ContactContract's _ID column is guaranteed to increment? Or can it re-use IDs? I can't seem to find the column definitions for these tables or anything about this in the official documentation.. Thanks! Jan 22 19:14:13 ampoz _ID is likely sqlite primary key autoincrement Jan 22 19:15:03 g00s_, as a Canadian, I'm embarrassed :-/ Jan 22 19:15:10 g00s_: I'm trying to confirm this but I can't find any source code or something similar to see where these columns are declared :s I'd like to verify instead of assuming :S Jan 22 19:15:25 ampoz chould be in the Contacts content provider Jan 22 19:15:53 g00s_: alright, having a look! thx Jan 22 19:23:09 hi Jan 22 19:23:23 Gusy when I use setImageUri on an image view in my recyclerview it makes the screen lag when the view created Jan 22 19:23:28 What am I doing wrong? Jan 22 19:23:39 does anyone know a good resource (even if it's paid) for learning good Android practices for intermediate-advanced android programmers? Jan 22 19:26:51 amcsi: https://github.com/google/iosched Jan 22 19:27:50 How do I load images into my listview without lag? Jan 22 19:28:12 amcsi: Google releases it every year after their Google IO conference. They try to implement best practices and it's the best place to learn about things you didn't know before. Jan 22 19:28:13 They're offline, stored on internal storage on the device Jan 22 19:28:35 But it still lags a lot when I do imageView.setImageUri()...? Jan 22 19:31:01 And you can't use another thread to do setImageUri() Jan 22 19:33:49 AKK9, they arent part of the apk? Jan 22 19:34:39 danijoo_, I ask the user to select an image, I crop it to 500 x 400 and store it on the device Jan 22 19:34:58 In the listview I pull the images from the files I saved Jan 22 19:35:08 AKK9, Use picasso and get it implemented without lag in 5 minutes Jan 22 19:36:05 danijoo_, is it really only 5 minutes to switch all my code to picasso? I've coded all the imagey parts of my app and everything works perfectly except this Jan 22 19:36:31 danijoo_, I can download images from the net and display them in my listview and it's completely smooth Jan 22 19:36:32 AKK9, you dont have to switch all at once. You can just start using it and migrate over and over Jan 22 19:36:43 but loading from the device is slower somehow...? Jan 22 19:36:48 Doesn't make sense. Jan 22 19:36:54 AKK9: in what way does it lag? when loading the image? Jan 22 19:36:55 AKK9, show the code. Jan 22 19:37:35 alexfu, as soon as I call imageView.setImageUri(), the UI freezes to perform this action Jan 22 19:37:48 it's like a split second freeze but happens on every single item in my list Jan 22 19:38:24 AKK9: if its a big image, you should be decoding the bitmap on a worker thread Jan 22 19:38:36 AKK9, show the code you are using and let us find the bottleneck Jan 22 19:39:13 danijoo_, the bottleneck is this one line holder.taskGroupImageView.setImageURI(Uri.parse(taskGroup.getImgPath())); Jan 22 19:39:20 even if I put a string in there Jan 22 19:39:34 AKK9: is the image packaged with the APK? Jan 22 19:39:45 alexfu, thanks I'll give this a go and see how it works out Jan 22 19:39:50 for images in lists, its important to have that images cached in the correct size so they arent recreated every time user goes up and down Jan 22 19:39:51 alexfu, no, it's a user selected image Jan 22 19:39:55 from their device Jan 22 19:40:01 and load them off ui thread Jan 22 19:40:18 if you dont want to implement that all by hand (which is a pain), you should use picasso ;) Jan 22 19:40:48 danijoo_, alexfu thanks, I'll lookup caching and decoding a bitmap. and also picasso. Jan 22 19:40:57 is it a large library? Jan 22 19:40:57 In Retrofit, how do I make a somewhat inner bit of data map to a Hashmap rather than concrete values since those object keys are dynamic? Jan 22 19:41:59 static functions can't be void? Jan 22 19:42:05 no wait... Jan 22 19:42:23 AKK9, dont know the size. But if you use proguard, it shoudnt be bigger then implementing it all by hand ;) Jan 22 19:42:28 AKK9: instead of using the setImageURI method, I would grab the image path and give it to a FileInputStream and decode the image using BitmapFactory all on a seperate thread and then set the Bitmap to the ImageView on the main thread. Jan 22 19:42:49 mixed up the ordering Jan 22 19:42:52 no need to replace your current implementation Jan 22 19:43:02 and this ^ is was takes hours to implement by hand. Jan 22 19:43:14 danijoo_: no it doesnt Jan 22 19:43:22 danijoo_: at most, 30 min Jan 22 19:43:28 that sounds easier than I thought, I've already done this when I do my image cropping Jan 22 19:43:32 that won't take much time to implement Jan 22 19:44:03 at most 30 min, if you know exactly what to do. Jan 22 19:45:05 plus, it's a learning experience. Jan 22 19:45:25 yeah. or you do Picasso.load(imageUri, imageView) and get the same result ;) Jan 22 19:45:52 ok. well.. if its for learning, do it by hand Jan 22 19:46:25 so how does one make a backwards-compatible floating action button that has a shadow? Jan 22 19:46:35 I've found a couple of third-party libraries, anyone have opinions on which ones to use? Jan 22 19:47:57 I have a question regarding Google Play. I've just published my app there, and wonder if it is possible to change the "publisher" from my name to something random like "my company"? Jan 22 19:48:38 aceus, in the Settings. Jan 22 19:48:39 aceus, Settings -> Developer name Jan 22 19:48:52 Hm Jan 22 19:49:49 Oh cool Jan 22 19:49:56 Is it OK to use whatever I want there? Jan 22 19:50:03 Like my app name? Jan 22 19:51:43 test Jan 22 19:51:51 In Gson, how do I make a somewhat inner bit of data map to a Hashmap rather than concrete values since those object keys are dynamic? Jan 22 19:52:06 test question? Jan 22 19:54:17 danijoo_: I was just testing if the webchat is working. Anyway, not a test question Jan 22 19:54:50 I dont understand it anyways. Jan 22 19:55:02 alexfu, done, I'm doing the work in a new Thread, its a lot smoother but still a bit jerky Jan 22 19:56:05 danijoo_: say there's an array of objects deep down in a json string with key-value pairs. But those objects' key-value pairs are dynamic, and therefore it's not suitable to define every possible key as Java class property Jan 22 19:56:33 danijoo_: so I want to extract any object from that array as a HashMap or something similar Jan 22 19:56:48 amcsi, whats the problem? Jan 22 19:57:17 let retrofit return the jsonobject and parse your hashmap from it Jan 22 19:57:17 AKK9: are these images in a listview? Jan 22 19:57:34 alexfu, recyclerview Jan 22 19:57:44 danijoo_: in scalability terms, say there are 1000 different possible keys, but only 3 will be on any 1 object. So it's not feasible to define all the 1000 properties of the Java class the json object should be mapped to. So what's a good dynamic solution? Jan 22 19:58:16 alexfu, this is how I'm doing it Jan 22 19:58:17 http://hastebin.com/ibubupekap.avrasm Jan 22 19:58:24 if you dont mind having a look Jan 22 19:58:41 danijoo_: I come from a non-type-strict language background (PHP and JavaScript) and it has always been a no-brainer for me that those languages just map json to anonymous objects and I can do whatever I want with them. But Java is different Jan 22 19:58:53 amcsi, map them on your own and dont let retrofit/json do it Jan 22 20:00:27 AKK9: you should read: http://developer.android.com/training/displaying-bitmaps/load-bitmap.html Jan 22 20:01:17 AKK9: you're on the right track, that article explains an optimization technique you can use to minimize memory footprint Jan 22 20:01:46 danijoo_: JsonObject. Wonderful. Thanks! Jan 22 20:02:04 AKK9: basic idea is to scale Bitmap down to a size you only need instead of loading the full size into memory. Jan 22 20:02:48 alexfu, the images im loading are always 500 x 400 Jan 22 20:02:57 i thought that was reasonably small Jan 22 20:03:04 ill try some of the optimisations anyay Jan 22 20:03:18 AS 1.1 preview 2 :) Jan 22 20:03:19 AKK9: are you displaying them as 500x400? Jan 22 20:03:24 that shouldnt have an impact on listview speed if you load them off ui though.. Jan 22 20:03:39 iys just a memory saver Jan 22 20:03:46 its* Jan 22 20:03:58 What happens if you dont own the same domain as your package name in Google play? Jan 22 20:04:26 aceus, nothing Jan 22 20:04:29 alexfu, doesn't that depend ont eh screen size? Jan 22 20:04:34 Ok cool Jan 22 20:04:34 I'm not seeing that on yet. Jan 22 20:05:10 Is updating Android Studio sensible nowadays? Jan 22 20:05:48 TacticalJoke, Never update if you want to get work done :p Jan 22 20:06:12 haha Jan 22 20:06:39 danijoo_: logically it would make sense that the smaller memory footprint, the faster GC will run. Although not sure if it's true but it doesnt hurt to use that optimization Jan 22 20:06:42 TacticalJoke: it's like clicking the 'I'm feeling lucky' button, but more like 'Are you feeling lucky punk!?' button ;) Jan 22 20:07:11 :) Jan 22 20:07:25 shmooz, additionally, you only have one try :p Jan 22 20:08:31 alexfu, i think if GC causes your listview to be slow, you are doing something wrong. Jan 22 20:08:36 AKK9: Either way, the method described in that article I linked you is how you should load bitmaps. Jan 22 20:08:48 its usually a loading issue in listviews, not a gc issue Jan 22 20:08:51 *usually* Jan 22 20:09:57 garbage collection can cause stutter if it happens often enough Jan 22 20:10:07 Anybody know a difference between these two permissions for GCM? com.google.android.c2dm.permission.RECEIVE vs com.google.c2dm.permission.RECEIVE? And which one to use for push notifications? Jan 22 20:10:27 alexfu, Yeah but the list must be really weird if it causes that many gcs.. Jan 22 20:10:36 Not seeing much about the latter one Jan 22 20:10:45 like tiny tiny views with large objects attached Jan 22 20:12:15 alexfu, probably gonna go with picasso at this point Jan 22 20:12:34 either way, loading at their original size is a serious bad idea Jan 22 20:12:46 *loading bitmaps at their original size Jan 22 20:12:46 huge page of code required to handle async loading of images in a listview Jan 22 20:13:28 that page suggests loading a large image at 5xx X 3xx Jan 22 20:13:32 AKK9: just use picasso it will be a one liner Jan 22 20:13:35 my images are 500 x 400 Jan 22 20:13:44 cant be that serious Jan 22 20:13:55 thanks for the help though Jan 22 20:14:07 shmooz, will do Jan 22 20:14:25 theres absolutely no reason for reinventing the wheel if somebody already wrote all that code down for you Jan 22 20:14:59 yeah but i have a lot to learn with android so i like to do some stuff the long way :) Jan 22 20:15:09 im back Jan 22 20:15:19 unless its toooo long haha Jan 22 20:15:35 AKK9: a single bitmap can easily take up 10+ MB of heap if not done correctly, you'll hit a OOM issue. Picasso simply handles all of this for you. only difference in using Picasso is that you dont need to go through the trials and tribulations the people had to go through to develop the library. Jan 22 20:15:49 AKK9: then you might want to look at the LazyList example , you can find it by searching for it Jan 22 20:16:27 Most phones only have 20-30MB of heap allocated to your application Jan 22 20:17:01 yeah i get that, but why load a 500 x 400 image into a marginally smaller image? Jan 22 20:17:07 its already quite small right? Jan 22 20:17:20 AKK9, correct. dont do it :p Jan 22 20:17:23 and the image is displayed the full width on a 1080p device screen Jan 22 20:18:53 if you're scaling your image up, thats a different scenario. Jan 22 20:19:45 do i need root to rw in sdcard? Jan 22 20:19:52 linuxuz3r, no Jan 22 20:20:06 thanks Jan 22 20:21:26 linuxuz3r, you need WRITE_EXTERNAL_STORAGE / READ_EXTERNAL_STORAGE as permission Jan 22 20:22:09 g00s_: ? Jan 22 20:22:15 hey thepoosh Jan 22 20:22:22 http://i.imgur.com/MWlPsZS.png Jan 22 20:22:32 g00s_: just finished the week long sprint Jan 22 20:22:37 there is an RC out there Jan 22 20:22:40 looks ok Jan 22 20:22:50 i am not proud of some of that code Jan 22 20:22:51 thepoosh how does the team feal about it ! Jan 22 20:22:56 but it feels nice Jan 22 20:23:00 :) Jan 22 20:23:04 no Jan 22 20:23:11 i fucking hate these sprints Jan 22 20:23:19 i feel nice knowing it looks ok Jan 22 20:23:27 even though some of the code is bad Jan 22 20:23:30 real bad Jan 22 20:23:41 hm, technical debt Jan 22 20:23:47 when will you guys pay it off ? Jan 22 20:24:13 at least you know the code is bad. i'm looking at something i just wrote, and can't decide if its ingenious or stupid Jan 22 20:24:39 When doing layouts, lets say I have a repeated format of: textview on the left, checkbox on the right, new line; textview on the left, checkbox on the right, etc...should I make a custom view (or layout) of textview on the left and checkbox on the right and just use that view (or include the layout) multiple times in my final layout? Jan 22 20:24:54 pastebin away Jan 22 20:24:55 g00s_: Where did you hear about Preview 2? I'm not seeing that anywhere (and I'm scared to try searching for updates). Jan 22 20:24:59 Also, the thing I worry about is having too many RelativeLayouts Jan 22 20:25:11 TacticalJoke i just did 'check for updates' Jan 22 20:25:14 Ah. Jan 22 20:25:31 i think 1.1 is just bugfixes so far Jan 22 20:25:34 so i'll take those Jan 22 20:25:51 gman23, every custom view will add another layer in the view hierachy so its a good idea to avoid that. Jan 22 20:26:05 what about layout? Jan 22 20:26:09 and using Jan 22 20:26:19 for what you want to do, id, use a and include that multiple times in my view Jan 22 20:26:33 ? Hmm, I've never used that. Jan 22 20:27:13 It's a way of using without defining a new ViewGroup. Jan 22 20:27:17 http://developer.android.com/training/improving-layouts/reusing-layouts.html Jan 22 20:27:28 Holy shit Jan 22 20:27:31 Yeah, I'm reading that Jan 22 20:27:41 Wow, there's soooo many places we should be using that Jan 22 20:27:52 Thank you very much, guys Jan 22 20:27:56 gman23: merge doesnt work everywhere Jan 22 20:28:04 or you could have TableRow in one file with the Text and button in it, and then include that multiple times in a tablelayout. Jan 22 20:28:42 using include creates a bunch of unnecessary viewgroups though Jan 22 20:29:00 alexfu: What do you mean Jan 22 20:29:07 not if you include merges or viewgroups you need anyways (like a row in a table) Jan 22 20:29:29 oh Jan 22 20:30:02 merge is like an include where no rootviewgroup is defined in the given file Jan 22 20:30:30 In this case, I'm making a drawer come from the right Jan 22 20:30:39 you have a file with a merge in it, and if you include it for example in a linear layout, its like putting that views directly in the linearlayout Jan 22 20:30:42 and it just lists a bunch of the same text/checkbox combos Jan 22 20:30:51 perfect Jan 22 20:30:56 that is exactly what I need right now Jan 22 20:31:23 So I would use include to bring in the layout? Jan 22 20:31:37 Exactly. Jan 22 20:31:52 Perfect. Jan 22 20:32:02 Thanks a lot Jan 22 20:39:59 Oh, except...it isn't respecting android:layout_below Jan 22 20:40:15 I guess I NEED a table view or something Jan 22 20:40:19 not RelativeLayout Jan 22 20:56:43 The @Nullable checks that AS does seem to make the feature useless. Jan 22 20:57:07 For example, unless you check for null when calling Activity.getActionBar you get a warning. Jan 22 20:57:23 Even in cases where you know that the ActionBar will always be there. Jan 22 20:57:52 ignore it ;_) Jan 22 20:58:40 Yeah, I'm just gonna disable the warning. Maybe I can re-enable in future if they optimize cases such as this. Jan 22 20:58:43 wireless providers block spam sms senders right Jan 22 21:14:03 linuxuz3r: some. but not the new ones, and they're often slow on banning (sometimes it's just someone who installed a malicious app, so that's not necessarily a bad thing) Jan 22 21:15:23 They've announced Preview 2: http://tools.android.com/recent Jan 22 21:16:46 is spamming a form of cyber terrorism? Jan 22 21:19:38 It's not like cyber terrorism is a well defined term or anything. Jan 22 21:19:50 choose a definition, and see if it applies Jan 22 21:19:51 * JesusFreke shrugs Jan 22 21:23:22 i think it is Jan 22 21:23:36 wow google is such a big company Jan 22 21:24:06 i wonder if they should help supermarket groceries Jan 22 21:28:07 google plus and google maps and google services is cool Jan 22 21:28:25 hope they ad more small business shops there Jan 22 21:29:32 they dont do that. shops have to add themselves Jan 22 21:29:51 yes and barber shops Jan 22 21:30:05 and taco places Jan 22 21:30:15 Hello, I've seen a few stackoverflow responses mention that putting a viewpager into a list/recycler view is kind of an anti-practice and wanted to know what the alternative would be. Jan 22 21:30:59 AnimeCYC, what are you trying to do? Jan 22 21:31:00 local social kinda thing Jan 22 21:31:26 drinfernoo: I am trying to get a carousel-like pager into a list of data Jan 22 21:32:03 maybe horizontal scrollview Jan 22 21:32:32 i got some problem with the code, i dont get why i have this error http://pastebin.com/LN6R7K48 , this is the code http://pastebin.com/4XYMQBVZ Jan 22 21:32:35 I had a feeling, but why? does your use case make it necessary? it seems kind of ambiguous to use like that Jan 22 21:33:06 danijoo_: Thats what I see some people have been suggesting. I have an implementation working with a recyclerview now, its just I need the "snapping" seen on the viewpager. Jan 22 21:33:21 drinfernoo: This is for a news application and the expectation is to support "carousels" of data. Jan 22 21:33:36 why not use a list inside of a viewpager instead? Jan 22 21:34:07 that way, your list scrolls beneath your tabs, and you still get side-to-side carousels Jan 22 21:34:19 so material very easy Jan 22 21:34:27 the pager itself only takes up a portion of the list; One moment, I have a screenshot of a working impl. Jan 22 21:34:41 (it must scroll with the rest of the list) Jan 22 21:35:05 If I inflate a menu from my Activity, can I handle clicks on the items in my Fragment, assuming I setHasOptionsMenu? Jan 22 21:36:03 i dont get why i have this error java.lang.NullPointerException: Attempt to invoke virtual method 'void android.widget.TextView.setText(java.lang.CharSequence)' on a null object reference Jan 22 21:36:16 on the method Jan 22 21:37:09 john67: getView().findViewById(...) should work. Jan 22 21:37:28 TacticalJoke: it doesnt work Jan 22 21:37:33 i have try Jan 22 21:38:56 drinfernoo: http://cl.ly/image/2r3C3D0Q2h3Y -> the carousel can appear anywhere in the recyclerview Jan 22 21:39:19 Running 4.1 virtual device, am I correct that if I want to run google play services on it I have to manually push google framework apks? Jan 22 21:40:39 john67: See whether v.findViewById(R.id.article) evaluates to null in onCreateView. If it does, you must be doing something wrong (such as not defining R.id.article). Jan 22 21:41:24 yeah I get it now. you can do it, people just suggest against it because it's kind of a funky navigation method Jan 22 21:42:21 TacticalJoke: how can i check that should i call inside the onCreateView? Jan 22 21:42:35 I agree; I am only running into one problem. When the viewpager gets recycled the first view swipes animation completes immediatly and its a bit jarring. I am unsure if it is related to it being in a recyclerview. Jan 22 21:43:10 john67: what is an Ipsum.Articles Jan 22 21:43:31 its a static Class Jan 22 21:43:37 AnimeCYC, probably, but I don't really know Jan 22 21:43:57 did you import it Jan 22 21:44:06 john67, the reason this doesnt work is the position of update() Jan 22 21:44:16 you call update() in onStart() Jan 22 21:44:35 then when shud i call it? Jan 22 21:44:39 at this point the view isnt created yet, so findViewById returns null Jan 22 21:44:49 even if you replace getActivity() with getView() Jan 22 21:45:18 get the args of the bundle and store them in a local variable, then set the text in onCreateView Jan 22 21:45:59 drinfernoo: no worries; I appreciate the insight. I can provide a screen recording of whats happening to see if that could help visualize what is occuring. If not, I can continue to troubleshoot. Jan 22 21:46:02 oki, i get u Jan 22 21:46:16 anyone got an idea on how to scroll a spinner all the way to the bottom when it's opened? Jan 22 21:46:51 danijoo_: shud i get the args in the oncreateView too? Jan 22 21:47:04 john67: where is Ipsum article Jan 22 21:47:17 its a class in the same package Jan 22 21:47:28 ok Jan 22 21:48:28 danijoo_: Hmm, I thought onCreateView ran before onStart (and therefore "getView().findViewById(whatever);" should be fine in onStart). Jan 22 21:49:30 TacticalJoke: onCreate ran before start Jan 22 21:49:36 TacticalJoke: according to the doc Jan 22 21:51:04 john67: FWIW, I think a good pattern here is to, in onCreate, store the argument. Then access it in onCreateView (as danijoo_ said). Jan 22 21:51:18 That's analogous to a normal constructor storing something passed as a parameter. Jan 22 21:51:32 yeah but getView seems do be weired on that (at least thats my experience) Jan 22 21:51:50 you generally cant rely on it to not return null until everything is visible and set Jan 22 22:12:26 TacticalJoke: danijoo_ i have done this but the value isnt given http://pastebin.com/HAcC6mEH Jan 22 22:18:17 john67: Use "v.findViewById(whatever)" in onCreateView. Jan 22 22:23:41 or maybe your xml is wrong.. Jan 22 22:23:43 TacticalJoke: it changes nothing the view is empty Jan 22 22:23:53 danijoo_: my xml? Jan 22 22:23:55 how? Jan 22 22:24:18 What do you mean "the view is empty"? Jan 22 22:24:35 Is v.findViewById(whatever) returning null? Jan 22 22:25:11 no ,isnt null but cant get the val from the value Jan 22 22:26:17 I don't know what that means. Jan 22 22:26:34 i mean the vue , to be display is empty Jan 22 22:26:48 danijoo_: my view? Jan 22 22:27:05 You might need to post some updated code. Jan 22 22:29:04 http://pastebin.com/JA2LJZHS Jan 22 22:29:13 posted Jan 22 22:31:46 When is update() called? Jan 22 22:32:06 normally it was on the onstart Jan 22 22:32:11 but u told me not to Jan 22 22:32:23 so i did call it on the OncreateView Jan 22 22:32:55 In the code you posted, you're not calling it in onCreateView. Jan 22 22:33:08 Or anywhere. Jan 22 22:33:08 you are not calling it at all.. Jan 22 22:33:45 update(positions); Jan 22 22:33:58 i forgot to send it Jan 22 22:36:25 john67: First, verify that "text.setText("ttotototottoto");" works by calling that and not calling "update()". Second, try to get "update()" working. Jan 22 22:36:47 i have done both Jan 22 22:36:47 but the view is empty Jan 22 22:37:57 The view is empty when you call "text.setText("ttotototottoto");" without calling "update();"? Jan 22 22:39:25 TacticalJoke: yeah Jan 22 22:42:50 and i have also done the opossite use the method update too Jan 22 22:44:02 show your xml Jan 22 22:44:11 article_view.xml Jan 22 22:45:01 http://pastebin.com/E96X4TzH Jan 22 22:45:26 waaaaiiit Jan 22 22:45:36 wrong fragment.. Jan 22 22:45:48 in oncreate of your activity you are creating HeadlinesFragment Jan 22 22:46:04 so the fragment we are talking about isnt displayed Jan 22 22:46:14 or how does onArticleSelected get called? Jan 22 22:47:15 when u clicked on the HeadlinesFragment Jan 22 22:48:23 Hi, how can I force Picasso to update an image in the cache Jan 22 22:48:23 ? Jan 22 22:49:17 danijoo_: when u click on the item (HeadlinesFragment) then its supppose to call the ArticleFragment which contain the article_view Jan 22 22:49:23 danijoo_: i dont get why u said so? Jan 22 22:49:43 cant see whats wrong with that code.. sorry Jan 22 22:51:36 a whole day just to use a frag, wow Jan 22 22:52:39 AKK9, Picasso.load(someImage).into(myView)skipMemoryCache() Jan 22 22:52:57 AKK9, Picasso.load(someImage).into(myView).skipMemoryCache( Jan 22 22:53:03 forgot the point :p Jan 22 22:53:03 that doesn’t update the cache, it just skips it Jan 22 22:53:15 danijoo_, what f2a said Jan 22 22:53:20 mh Jan 22 22:53:34 i think you only have the option to skip it or clear the whole cage Jan 22 22:53:39 use .memoryPolicy(NO_CACHE).networkPolicy(NO_CACHE) with 2.5.0-SNAPSHOT Jan 22 22:53:49 you can also delete a Uri from the memory cache Jan 22 22:53:57 either will work Jan 22 22:55:10 danijoo_: i was just trying to understand fragments with google doc, Jan 22 22:55:13 wow Jan 22 22:56:13 john67 yeah, fragments have a steep learning curve Jan 22 22:56:28 mattblang: where? Jan 22 22:56:53 john67 I just mean in general, they take some time to get used to Jan 22 22:57:32 mattblang: lol, i see ,u mean its very hard to learn Jan 22 22:57:45 luist: did you ever get your issue worked out Jan 22 22:58:04 mattblang: no Jan 22 22:58:16 mattblang: couldnt find a viable way to do it yet Jan 22 22:58:22 luist: I had to go to lunch earlier. Tell me again what you were wanting to do Jan 22 22:58:33 mattblang: what issue you talking about? i asked about 3 issues i think Jan 22 22:58:56 luist: haha, you were wanting to handle login and change a fragment I think Jan 22 22:59:04 mattblang: well… i have a fragment with a sliding menu and each item opens a new fragment in the content Jan 22 22:59:20 JakeWharton, hi thanks where can I find 2.5.0-snapshot? Jan 22 22:59:29 sonatype's snapshot repo Jan 22 22:59:34 see the README for a link Jan 22 22:59:46 mattblang: 1 of these fragments is a login page, and when logged in, i want to change the menu (like disable/change colors) Jan 22 23:03:54 john67: I lost track of the conversation. But I think you srsly need to break things down so that you're doing things one tiny step at a time. Jan 22 23:05:10 TacticalJoke: im just trying to learn how to learn fragments, so im using the google docs, but it seems something is wrong !! but im using their tutorial Jan 22 23:05:23 luist: you could have the containing Activity implement a callback that invalidates the menu and redraws with a different menu.xml Jan 22 23:05:42 john67: Did you copy-paste their code or did you start from nothing and write the code yourself while reading the tutorial? Jan 22 23:06:01 I am trying to do a volley request to https://api.github.com I overrode parseNetworkResponse and when I try to convert the data to a String I keep getting garbage for the conversion. Jan 22 23:06:16 luist: http://developer.android.com/reference/android/app/Activity.html#invalidateOptionsMenu() Jan 22 23:06:24 TacticalJoke: i did every thing at fresh Jan 22 23:06:48 to convert from byte[] in response.data to a String I am doing String json = new String response.data, Charset.forName("UTF-8"); Jan 22 23:06:49 john67: Would you be able to post everything? Java files, XML files, the lot. Perhaps in one big PasteBin thingy. Jan 22 23:07:03 oki Jan 22 23:07:03 i will Jan 22 23:07:06 mattblang: nice… ill try that Jan 22 23:07:23 JakeWharton, i can only see a 2.4.1 snapshot in there Jan 22 23:07:26 I know I should take the charset from the headers, but I am focused on getting the body back without any issue. I need to be able to convert it to json. Jan 22 23:07:30 maybe im looking in the wrong place Jan 22 23:07:33 yeah that's it Jan 22 23:07:38 we didn't bother changing the version number Jan 22 23:07:46 drinfernoo: I found the problem area and have a pseudo-fix for the animation glitch I was having (having a variable-placed viewpager in a recyclerview). Thanks for the insight earlier, just wanted to let you know I figured things out. Jan 22 23:08:40 luist: So in your Login Fragment, whenever the auth request comes back successful, you would run callbacks.redrawMenu (or whatever you name it), then @Override redrawMenu in your Activity would call invalidate, then in your onOptionsCreated you can check for ifAuthenticated Jan 22 23:08:55 I found this post on SO. Which talks about exactly what I am looking into. http://stackoverflow.com/questions/19267616/why-does-volleys-response-string-use-an-encoding-different-from-that-in-the-res Jan 22 23:09:34 am I missing something, shouldn't I just be able to take the byte[] that comes back from response.data and convert it to a string as long as I supply the encoding type? Jan 22 23:09:50 mattblang: that sounds great… thank you Jan 22 23:09:58 luist: yw, let me know how it works out Jan 22 23:10:29 TacticalJoke: this is the link https://drive.google.com/file/d/0B1aH_yFA-4WcekJkeGVaMkRjb0U/view?usp=sharing Jan 22 23:10:30 is there a better channel to talk about Android volley in? Jan 22 23:11:07 there's #android-volley, but it's just me and I'm pretty busy. volley-users@ on google groups is pretty responsive, though far less real-time Jan 22 23:11:17 If I want to run some code when a button in the action bar is clicked, there are two ways as far as I know: 1. switch() the item id in onOptionsItemSelected() or 2. use the onClick attribute in the menu xml. Which is preferable and why? #2 seems cleaner to me but the default code that android studio generates is #1. Jan 22 23:12:07 luist: you could actually avoid using a callback and just getActivity().invalidate in the fragment, but make sure you are careful not to leave yourself open to a NPE Jan 22 23:16:14 mattblang: i dont think theres a possibility of that happening since i only have the main activity, i think Jan 22 23:17:00 JakeWharton, it works! :) thank you! Jan 22 23:17:57 ah nevermind, "Android 3.0 adds the ability for you to define the on-click behavior for a menu item in XML, using the android:onClick attribute." so my API 10 targeting project won't work with it Jan 22 23:18:00 i knew your name seemed familiar Jan 22 23:18:06 john67: Is HeadlinesFragment.onListItemClick even being called? Jan 22 23:18:06 thanks again Jan 22 23:18:30 hey all. Jan 22 23:19:25 TacticalJoke: yeah Jan 22 23:19:55 anyone located near palo alto, ca interested in doing a project Jan 22 23:19:59 hey all Jan 22 23:20:26 yo Jan 22 23:20:37 is there a good way to color a button if you are using appcompat Jan 22 23:20:47 for api 21 Jan 22 23:20:54 john67: Are ArticleFragment.onCreateView and ArticleFragment.update being called? Jan 22 23:22:22 n^izzo, I often use Shapes for that Jan 22 23:23:02 You have "public View onCreateView(LayoutInflater infrate , ViewGroup container, int root){". Jan 22 23:23:17 Put @Override on top and I guess you'll get a compile error, revealing the mistake. Jan 22 23:23:37 MikeWallaceDev, but then how do I get that sexy material design button? Jan 22 23:24:06 n^izzo, this is done with one button, that has a shape, that I change color : ic_stroke_neon Jan 22 23:24:38 TacticalJoke: must super override or implement a supertype method Jan 22 23:24:46 Right. Jan 22 23:24:52 The last parameter is of the wrong type. Jan 22 23:24:59 oh.. thats a hidden one! Jan 22 23:25:00 Hence its not being called at all. Jan 22 23:26:08 MikeWallaceDev, so you make your own buttons out of base shapes and then color them? Jan 22 23:26:58 yeah Jan 22 23:27:21 in my case, yes. The buttons are configurable.To add a whole new color to my app I just add one line : new PlainColorType(resources.getColor(R.color.yellow)) Jan 22 23:27:46 TacticalJoke: according to the doc u shud not call the last parameter Jan 22 23:28:04 that will automatically create a new button with the correct background (and add all the functionality in my app) Jan 22 23:28:07 MikeWallaceDev, is there a libary for this or do I need to start from scratch? Jan 22 23:28:13 I don't understand that. You don't call that method: the framework does. Jan 22 23:28:26 You just need to define the override so that you can be called. Jan 22 23:28:31 n^izzo, no library, it's basic Android stuff Jan 22 23:29:17 john67: Is it all working now? Jan 22 23:29:27 no Jan 22 23:29:59 n^izzo, even the button itself is a shape : http://pastebin.com/iAZxW5GZ Jan 22 23:31:06 TacticalJoke: got same error, like pointer for the findViewById Jan 22 23:31:22 Use "v.findViewById(...)" in onCreateView, as I said earlier. Jan 22 23:31:31 hey everyone does anyone have knowledge on encoding and decoding audio Jan 22 23:33:17 ginhinio: ask your actual question. if someone can answer, they will :) Jan 22 23:34:02 TacticalJoke: but im now using the method, so i will do it on the createView then Jan 22 23:34:11 String thetext = EditText.getText(); ?? Jan 22 23:34:11 john67: I have to go in a minute, so "john67.setReplyTime(ReplyTime.FAST);". Jan 22 23:34:20 Is that how you get a string out of an edit text field? Jan 22 23:34:48 DragonPunch: someEditText.getText().toString(); Jan 22 23:34:59 ok sounds good. Jan 22 23:35:52 It's that way because the text might be more elaborate than a string (e.g., it could be a Spanned). Jan 22 23:36:10 In fact, I guess it will be with EditText. Jan 22 23:36:28 MikeWallaceDev, I'm still not really getting this, how do I use that shape? I pasted it into one of my layout and it throws errors Jan 22 23:36:28 it is Jan 22 23:36:30 luist: it could happen if you leave the screen but your login http request finishes (asynchronously) and tries to call getActivity when really the fragment isn't attached. Jan 22 23:36:52 I made sure to change all the referance to your sizes and colors Jan 22 23:36:53 Yeah, I guess the selection start/end makes it a Spanned. Jan 22 23:37:01 TacticalJoke: it does work in the onCreateView, but not on the method Jan 22 23:37:17 Yeah, probably because of what danijoo_ said earlier. Jan 22 23:37:31 anyone know how far this is from being usable? http://www.w3.org/2012/nfc/web-api/ Jan 22 23:39:02 n^izzo, a Shape is a Drawable. http://pastebin.com/cqAumN0V Jan 22 23:39:06 TacticalJoke: he said what? i dont remember ? Jan 22 23:39:23 That you shouldn't use "getView().findViewById()" in onStart or whatever. Jan 22 23:39:33 john67: Just use onCreateView. That's where everyone else does it. Jan 22 23:40:07 You have the very view right there, in fact. Why look for it elsewhere? Jan 22 23:40:46 so I am trying to use opencv with an android studio project, I followed http://answers.opencv.org/question/14546/how-to-work-with-opencv4android-in-android-studio and imported the project, it shows the opencv module alongside app but I still can't import it Jan 22 23:41:06 TacticalJoke: so u mean i cant use findById some where else appart execept on the onCreateView? Jan 22 23:41:43 john67, you can also use after it. in callbacks and stuff like that Jan 22 23:42:00 just not before the view is being created Jan 22 23:42:14 danijoo_: do u have an example? Jan 22 23:42:19 or a link Jan 22 23:42:50 If you really want to use this 'update()' thing, you should probably have a TextView field which is set in onCreateView. Jan 22 23:43:59 fxmulder, I don't understand, if you see the module, then it's "imported" Jan 22 23:44:03 An alternative would be to pass the View you inflate in onCreateView to the update method, but that doesn't seem as nice. Jan 22 23:44:17 And I guess that breaks for other instances of calling update. Jan 22 23:44:48 i get u Jan 22 23:45:05 MikeWallaceDev: it still doesn't know what 'import org.opencv' is when I try to import it into my activity's package file Jan 22 23:45:31 oh! THAT import :D Sorry man :D Jan 22 23:45:32 TacticalJoke: then dont get why google was able to use getActivity ? and onStart Jan 22 23:45:42 fxmulder, sync gradle Jan 22 23:45:43 john67: Where? Jan 22 23:45:52 MikeWallaceDev: yeah I tried that Jan 22 23:46:25 TacticalJoke: on their code, download this code http://developer.android.com/training/basics/fragments/creating.html Jan 22 23:46:38 is org.opencv the correct namespace? Jan 22 23:46:49 TacticalJoke: the fragmentBasic Code Jan 22 23:47:32 what happens if you do org. and hit Ctr-Space ? Jan 22 23:47:52 john67: what are you attempting to do? Jan 22 23:48:25 herriojr: im just learning fragments Jan 22 23:48:32 using the doc Jan 22 23:48:38 john67: ok, what's your question in particular Jan 22 23:49:01 MikeWallaceDev: it is according to the path, from root I see openCVLibrary2410/java/org.opencv/..., org.[ctrlsp] lists 5 items none of which are opencv Jan 22 23:49:55 guys so I take the audio from the mic and encode it to aac and then decode it into audio Jan 22 23:50:01 time to paste bin your build.gradle :) fxmulder Jan 22 23:50:36 herriojr: it was just u cant use findViewById on a different method, outside the onCreateView Jan 22 23:50:45 john67: I'm not sure. Does their code work if you run it without changing it? Jan 22 23:50:58 TacticalJoke: yeah Jan 22 23:50:59 MikeWallaceDev: I see 3 of them, the project, the app module and the opencv module Jan 22 23:51:00 it does Jan 22 23:51:01 john67: in the fragment, you save a reference to the root view you inflated, then you can Jan 22 23:51:24 Does it work in your code? Jan 22 23:51:29 If you use "getActivity().findViewById". Jan 22 23:51:32 john67: but like Activities (w/out Fragments) it's best practice to cache important views Jan 22 23:51:39 no Jan 22 23:51:55 I have no idea. Jan 22 23:52:06 I'm gonna call it the john67 Phenomenon. Jan 22 23:52:15 john67: can you pastebin your code john67 Jan 22 23:52:18 fxmulder, paste all 3... Jan 22 23:52:53 TacticalJoke: u shud ask google Jan 22 23:53:25 herriojr:https://drive.google.com/file/d/0B1aH_yFA-4WcekJkeGVaMkRjb0U/view Jan 22 23:54:13 If that's the unfixed code, john67, you're just wasting herriojr's time. Jan 22 23:54:16 MikeWallaceDev: http://nsab.us/public/gradle/ Jan 22 23:55:00 TacticalJoke: I'm good at fixing shit, so it's no problem Jan 22 23:55:35 herriojr: u have change the int to Bundle, in the onCreateView Jan 22 23:55:50 fxmulder, look at you with the public folder! Nice :) Jan 22 23:56:31 herriojr: and i just want to know why the getActivity doesnt work outside the onCreateView . But on google doc it does Jan 22 23:57:13 john67: which file is this? Jan 22 23:57:17 fxmulder, your app build.gradle doesn't have the openCV dependency Jan 22 23:57:37 herriojr: ArticleFragment Jan 22 23:57:50 fxmulder, can you add your settings.gradle to the public folder too, please Jan 22 23:58:01 where were you trying to call it? Jan 22 23:58:40 TacticalJoke: im a bit confuse if it doesnt work , according their code Jan 22 23:58:50 herriojr: calling? Jan 22 23:59:12 herriojr: u need to call update Jan 22 23:59:41 MikeWallaceDev: that was all it took, adding compile project(':openCVLibrary2410') to the dependency list Jan 22 23:59:43 john67: no, I see no location you're calling getActivity() Jan 22 23:59:59 its bcos i replace it with getView Jan 23 00:00:28 fxmulder, perfect Jan 23 00:01:22 john67: so the only way getActivity() would fail is if the fragment wasn't attached yet, etc. Jan 23 00:01:51 in your particular case, you're following the activity lifecycle with your fragment, so that's not the problem Jan 23 00:02:04 herriojr: whats the problem then? Jan 23 00:02:20 john67: I'll have to run this really quick to see, is it in a runnable state? Jan 23 00:02:28 yeah Jan 23 00:03:13 help Jan 23 00:03:26 i don't know if this is actually cordova stuff or what Jan 23 00:03:28 Intent intent = new Intent(context, XAPKDownloaderActivity.class); Jan 23 00:03:37 can i do this without having that activity defined in my xml file? Jan 23 00:03:46 MikeWallaceDev: thanks for the help! Jan 23 00:03:53 i.e., inside the class instead? Jan 23 00:04:03 fxmulder, my pleasure mate :) Jan 23 00:04:29 http://pastebin.com/KQcr4tu7 for example Jan 23 00:04:31 but it crashes Jan 23 00:05:07 "E/AndroidRuntime( 4632): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.sample/com.sample.Sample}: android.content.ActivityNotFoundException: Unable to find explicit activity class {com.sample/com.flyingsoftgames.xapkreader.XAPKReader$XAPKDownloaderActivity}; have you declared this activity in your AndroidManifest.xml?" Jan 23 00:05:26 Agamemnus what are you doing with the intent ? Jan 23 00:05:49 startActivity ? Jan 23 00:05:56 yeah, it needs to be in the manifest Jan 23 00:06:05 yes Jan 23 00:07:03 okay Jan 23 00:10:10 @john67: your onCreateView is wrong — it doesn't override a parent method Jan 23 00:10:58 @john67: so you're literally creating a headless fragment Jan 23 00:11:09 because by default, it returns null for the view Jan 23 00:11:23 @john67: always mark methods you're overriding with @Override Jan 23 00:11:32 to prevent these issues from happening Jan 23 00:14:52 #2, calling getActivity() is probably not what you want unless you are guaranteed that the activity has the view attached at this point Jan 23 00:15:11 which I don't think it does — which is why you want to ask the Fragment for its view Jan 23 00:16:01 @john67_: still there? Jan 23 00:17:39 TacticalJoke: herriojr danijoo_ i have find some on the doc Jan 23 00:17:45 herriojr: im here Jan 23 00:17:53 Caution: If you need a Context object within your Fragment, you can call getActivity(). However, be careful to call getActivity() only when the fragment is attached to an activity. When the fragment is not yet attached, or was detached during the end of its lifecycle, getActivity() will return null. Jan 23 00:17:56 can anyone tell me how I can encode PCM to AAC and decode that to working audio Jan 23 00:18:16 john67_: yeah, I said that earlier Jan 23 00:18:30 john67_: anyways, your current problem is you didn't properly override the onCreateView Jan 23 00:18:51 john67_: annotate it with @Override and watch it complain Jan 23 00:18:56 yeah, i change that Jan 23 00:19:02 kk Jan 23 00:19:28 so yeah, when you're in onCreateView, it hasn't returned a view to be attached yet Jan 23 00:19:34 so asking your activity doesn't make sense Jan 23 00:19:56 what's commonplace is to ask the view you just created for each important view and cache them as variables in the fragment Jan 23 00:19:56 herriojr: then cant u put that on a onStart? Jan 23 00:20:33 john67_: I haven't looked through the fragment source in a while — depends on when the fragment's view is guaranteed to be attached to the activity Jan 23 00:20:56 herriojr: have u checked the google code source? Jan 23 00:21:08 u will see that they use it during on start Jan 23 00:21:23 john67_: that's fine, but that's not my point I'm getting at Jan 23 00:21:45 herriojr: i dont get u Jan 23 00:21:54 yes, I've noticed :P Jan 23 00:22:22 for most purposes, it's not a good practice to refer to your activity directly from the fragment itself Jan 23 00:23:45 herriojr: oki, Jan 23 00:24:06 A fragment should be self-contained Jan 23 00:24:07 herriojr: so how then? Jan 23 00:24:12 oki Jan 23 00:24:57 depends on what approach you want to take Jan 23 00:25:03 so u mean all shud be on the onCreateView Jan 23 00:25:08 im just a newbie Jan 23 00:25:14 yes, I understand that Jan 23 00:25:41 so in onCreateView() you generally want to cache all important views as fragment member variables if you can Jan 23 00:25:44 and in your case, you can Jan 23 00:25:55 so from the view you're about to return, you do view.findViewById() Jan 23 00:26:06 and cache that Jan 23 00:26:19 findViewById() can be expensive, so you want to minimize it Jan 23 00:26:23 yeah, on the CreateView Jan 23 00:26:30 yes Jan 23 00:26:57 minimize the findViewById? Jan 23 00:27:03 with a viewHolder? Jan 23 00:27:06 no Jan 23 00:27:13 well, similar Jan 23 00:27:18 how? Jan 23 00:27:19 the fragment acts as a viewHolder Jan 23 00:27:25 oki Jan 23 00:28:19 also, you probably want a newInstance() function for your fragment to minimize boilerplate bundle construction Jan 23 00:28:57 ii dont know that newInstance , have to rewrite it some where to check Jan 23 00:29:20 question Jan 23 00:29:36 Agamemnus: just ask, don't state you have a question :) Jan 23 00:29:41 is there something that opens the small, compact version of the dropdown bar? Jan 23 00:29:47 the black bar. Jan 23 00:29:53 with time, battery, etc Jan 23 00:29:53 herriojr: so in order to minimize the findViewById u use the newInstance? Jan 23 00:30:14 john67_: sorry, no, I'm touching on multiple topics, I have a hard time focusing on one thing sometimes Jan 23 00:30:26 It seems that when I create a new and empty activity, the black bar will open (and then close) temporarily Jan 23 00:31:21 john67_: let me pastebin something Jan 23 00:31:39 herriojr: oki Jan 23 00:36:50 john67_: http://pastebin.com/GiqZW8Ey Jan 23 00:37:42 herriojr: newinstances? Jan 23 00:37:44 why?* Jan 23 00:37:53 simplifies constructing your fragment Jan 23 00:38:12 is there anything strange with this line: Jan 23 00:38:16 Intent intent = new Intent(context, XAPKDownloaderActivity.class); Jan 23 00:38:16 john67_: it's a common pattern Jan 23 00:38:23 for? Jan 23 00:38:43 john67_: creating fragments dynamically which require arguments Jan 23 00:38:52 i see Jan 23 00:38:53 basically, I put two changes in there Jan 23 00:39:01 cool Jan 23 00:39:04 first is caching your TextView in onCreateView Jan 23 00:39:12 Agamemnus, no. Excetpt for you inline class... Jan 23 00:39:14 and adjusting update() accordingly Jan 23 00:39:32 Agamemnus, did you declare your Activity in the manifest now? Jan 23 00:39:33 as well as adding a newInstance method for you Jan 23 00:40:47 john67_: this is also assuming you are not going to make this a retained fragment Jan 23 00:41:10 yes. Jan 23 00:41:44 is your Activity still inlined? Is there a reason why you need it inlined? Jan 23 00:42:54 john67_: does that all make sense? Jan 23 00:43:13 herriojr: a bit but need more pratice Jan 23 00:43:14 Is there a way to make it inlined? Jan 23 00:43:21 and not crash. Jan 23 00:43:37 I am trying to go around a Chromium bug Jan 23 00:44:04 Not sure what Chromium has to do with this? Jan 23 00:44:20 it does Jan 23 00:44:27 but is there a way to make it work inline? Jan 23 00:44:34 john67_: yeah, np, I should be on more now that I'm back to doing android dev after 2 years of server dev, so feel free to hit me up Jan 23 00:45:04 Agamemnus: what is the exception? Jan 23 00:45:05 I guess it would have to be public static. Still not sure that it would work... Jan 23 00:45:09 herriojr: oki,thnx again Jan 23 00:45:18 I don't know how to make it work inline Jan 23 00:45:22 is all Jan 23 00:45:50 Agamemnus: context.startActivity(new Intent(context, MyActivity.class)) Jan 23 00:45:55 Agamemnus, what makes you think this will fix your bug? Read it online? Don't they mention how to do it? Jan 23 00:46:09 this is a very obscure bug Jan 23 00:46:19 ok, thanks, i'll try that Jan 23 00:46:19 Agamemnus: can you provide the stack trace for it? Jan 23 00:46:30 wait Jan 23 00:46:34 Agamemnus: we're throwing darts here without a stack trace Jan 23 00:46:36 how is that inline? Jan 23 00:46:41 It's a visual bug. Jan 23 00:46:57 The dropdown black bar on top appears, then disappears. Jan 23 00:47:19 herriojr: you didn't make that inline. Jan 23 00:47:28 How do I make MyActivity inline and run it? Jan 23 00:47:32 Agamemnus: ah, sorry, missed some part of you issue, thought you were saying it was a crash Jan 23 00:47:45 Agamemnus: I think you're wording your question wrong Jan 23 00:48:09 yes, it does crash, if I don't declare it in the XML File Jan 23 00:48:12 http://pastebin.com/KQcr4tu7 Jan 23 00:48:24 Agamemnus: ok, let's start from scratch, what are you trying to fix Jan 23 00:48:27 How do I run the Activity inside the class without declaring it? Jan 23 00:48:28 hey MikeWallaceDev Jan 23 00:48:46 I'm trying to isolate the problem as much as I can Jan 23 00:49:02 How do I run the Activity inside the class without declaring it *inside an XML file? Jan 23 00:49:04 hey Napalm what's up? Jan 23 00:49:29 Agamemnus, I really don't think that is possible. Jan 23 00:49:31 Agamemnus: where is this activity coming from? Jan 23 00:49:45 the class Jan 23 00:49:47 See? Jan 23 00:49:48 It's there. Jan 23 00:49:51 MikeWallaceDev: it's possible, just not a good idea — see ActivityGroup Jan 23 00:49:54 MikeWallaceDev: see pm Jan 23 00:49:55 line 21 Jan 23 00:50:10 help me try that PLEASE Jan 23 00:50:27 please please please with a cherry on top Jan 23 00:50:48 Agamemnus: #1 that needs to be a static class Jan 23 00:51:09 if it is in your CordovaPlugin class Jan 23 00:51:10 I mentioned that earlier Agamemnus Jan 23 00:51:29 and you do need to declare that in your AndroidManifest Jan 23 00:51:52 via "com.flyingsoftgames.xapkreader.XAPKReader$XAPKDownloaderActivity Jan 23 00:52:03 herriojr: thnx again for the info Jan 23 00:52:08 TacticalJoke: thnx also Jan 23 00:52:08 john67_: np Jan 23 00:52:13 So I can't do it without declaring it? Jan 23 00:52:15 danijoo_: thnx again Jan 23 00:52:20 in the manifest Jan 23 00:52:31 Agamemnus: is this a library you're creating? Jan 23 00:52:43 also, what needs to be a static class? Jan 23 00:52:49 good night Jan 23 00:52:51 sort of, it's already created Jan 23 00:52:51 I'm trying to understand why you don't want it to be in the AndroidManifest Jan 23 00:53:07 i'm trying to figure out what causes the bar to appear Jan 23 00:53:10 and disappear Jan 23 00:53:26 and I narrowed it down to: creating an Activity that has an onCreate function, with an Intent. Jan 23 00:53:26 the status bar? Jan 23 00:53:32 yeah, i guess Jan 23 00:53:41 ok, that has to do with 2 things Jan 23 00:54:18 no I guess, is this a bar that names your activity or the bar at the top with the battery icon, etc.? Jan 23 00:54:28 I'm using Crosswalk.. built-in Chrome. Version 9 doesn't have the problem. Version 10 has a worse problem -- sometimes it won't disappear and gets stickied Jan 23 00:54:35 yes it's with the battery icon Jan 23 00:54:46 Why does Android not have the concept of a Service Mark:? Jan 23 00:55:03 Apparently, the sticky part was a Chromium bug. Version 10 uses a different version of Chromium Jan 23 00:55:11 than version 12 Jan 23 00:55:20 Agamemnus: if it disappears then reappears, it most likely has to do with one activity declaring itself as not wanting to show the status bar and the next one saying it does (or not specifying) Jan 23 00:55:22 Version 9 is different, too. Jan 23 00:55:28 AHA Jan 23 00:55:36 and the first activity proxying the intent to the next activity Jan 23 00:55:37 How do I set that?!?!?!!? Jan 23 00:55:49 is this your application? Jan 23 00:55:53 yes Jan 23 00:56:23 Wait Jan 23 00:56:25 in your activity you are making the call, are you showing the bar? Jan 23 00:56:27 Is what my application? Jan 23 00:56:36 I am not showing the bar. Jan 23 00:56:45 it is very small Jan 23 00:56:56 @Override public void onCreate (Bundle savedInstanceState) {super.onCreate (savedInstanceState); finish ();} Jan 23 00:57:05 oh, in the caller? Jan 23 00:57:07 Yeah, I'm not. Jan 23 00:57:21 so you explicitly set your activity to be full screen? Jan 23 00:57:41 http://pastebin.com/qMREXpdt Jan 23 00:57:57 Actually, I do Jan 23 00:58:03 the first one Jan 23 00:58:08 but not I Jan 23 00:58:21 Cordova does. Via a config file Jan 23 00:58:42 So you're saying that the second one needs to be set to full-screen or have the same settings Jan 23 00:58:47 But how do I do that? Jan 23 00:58:55 do you own the second activity? Jan 23 00:59:14 I'm not entirely sure what you mean by "own". I can modify it. Jan 23 00:59:20 It's part of my plugin. Jan 23 01:01:06 define: plugin Jan 23 01:01:31 The two files in the pastebin Jan 23 01:01:40 It's a cordova interface between JS and Java Jan 23 01:03:34 oh jesus, ok, you're doing non-standard dev Jan 23 01:03:46 which explains why you don't know what's going on Jan 23 01:04:50 Agamemnus: ok, so my understanding thus far is in the first activity, it doesn't show the bar, but in the transition between the two activities, it flickers the bar on for a second before not showing it again? Jan 23 01:05:02 Yes Jan 23 01:05:06 I think I see the problem Jan 23 01:05:21 They removed a function called loadConfiguration for some reason, in version 10 Jan 23 01:06:00 or maybe it's a cordova issue Jan 23 01:06:05 hold on, trying to add it back.. Jan 23 01:06:08 has doing android apps via html+css+js not suck anymore? Jan 23 01:07:59 yeah, except if you g et too complex Jan 23 01:08:31 ok anyways, I got to go — you're going to have difficulty getting help with cordova stuff here fyi Jan 23 01:08:49 see if there is a cordova channel, honestly Jan 23 01:13:01 If im getting a NullPointerException on line 5 of this http://pastie.org/9853149 Jan 23 01:13:11 Does it most likely mean that there is no response coming in? Jan 23 01:14:41 Which line is line 5? Jan 23 01:15:00 its the .show() Jan 23 01:15:55 'toast' is null? Jan 23 01:16:17 Its saying NullPointerException on line 47 which is that line Jan 23 01:16:44 Might be something with my server side code though, gonna mess with it Jan 23 01:17:04 I don't think it's possible for 'toast' to be null there. Jan 23 01:17:11 Assuming no memory corruption. Jan 23 01:17:17 Yeah, same Jan 23 01:17:44 Make sure you're looking at the exact code that corresponds with the app you're running Jan 23 01:18:08 i.e. that you didn't add/remove some lines after compiling the version of the app that you're running Jan 23 01:18:10 the response from the server is an array that is json_encoded Jan 23 01:18:14 speaking of Toast being null... I'm out of bread. Jan 23 01:18:24 lol Jan 23 01:18:37 Is there a way I could simply check if a response is coming in Jan 23 01:19:00 unless onResponse isn't on the main thread Jan 23 01:19:07 I guess ill just set the toast string to something pre-defined, and it will run if I get a response Jan 23 01:19:27 drose379, ^^^ Jan 23 01:19:48 What are you pointing to MikeWallaceDev? Jan 23 01:20:14 to onResponse not being on the UI thread Jan 23 01:21:03 Hmm, I never did anything that would start a new thread Jan 23 01:21:43 onResponse is probably called by your JSON thread... Jan 23 01:21:53 Ok, so the toast crashes even when i through a "Hello" into it, so its not the response Jan 23 01:22:00 OkHttp uses a background thread for Call.enqueue. Jan 23 01:22:07 Oh shit!! Jan 23 01:22:16 Forgot about that, I need to throw it in a Runnable right? Jan 23 01:22:27 OH MY GOD Jan 23 01:22:31 yes? Jan 23 01:22:38 I'm guessing so. I've never thought about the possibility of using Toast.show in a background thread. Jan 23 01:22:42 That guy herriojr literally saved my life! Jan 23 01:23:04 Runnable will bring me back to my background thread? Jan 23 01:23:14 View/Handler.post(Runnable) Jan 23 01:23:18 handler Jan 23 01:23:58 Actually, now that I think of it, it doesn't seem to make sense to try to show a Toast in a background thrad. Jan 23 01:24:00 thread* Jan 23 01:24:03 It's still View stuff. Jan 23 01:24:11 What about the TextView.post? Jan 23 01:24:17 Whats View/Handler.post? Jan 23 01:24:19 Yeah, any View. Jan 23 01:24:26 You can use View.post or Handler.post. Jan 23 01:24:38 Any difference? Jan 23 01:25:15 I think View.post just calls Handler.post under the hood (or something very similar). Jan 23 01:25:41 Ok, do I have to define View first? Jan 23 01:26:32 Nah, I'm just talking about the method in general. "someTextView.post(someRunnable);" is an example of calling this method. Jan 23 01:26:50 ohhh ok Jan 23 01:26:52 Thank you Jan 23 01:27:04 Can I use my Layout instead of the textview? Will that work? Jan 23 01:27:43 yes Jan 23 01:27:56 and instead of R.id just R.layout Jan 23 01:27:59 A Layout is a View(Group) Jan 23 01:28:19 great, thanks guys. Gonna try this again Jan 23 01:28:20 no, you have to get an instance of your layout Jan 23 01:28:39 with FindViewById... oh. Right. then Yes :D Jan 23 01:28:42 Layout activityLayout = (Layout) findViewById(R.layout.subject_dashboard); Jan 23 01:29:07 no, wait... fuck, I'm lost. Give your layout an ID in the XML file Jan 23 01:29:21 Ok Jan 23 01:29:37 then findVBI with that ID Jan 23 01:30:23 Its saying I should define it as a View instead of a Layout? Jan 23 01:30:25 Is that ok? Jan 23 01:30:38 sorry? Jan 23 01:30:58 too many "it"s in your question :) Jan 23 01:31:08 Instead of Layout ... I had to do View... Jan 23 01:31:09 Look Jan 23 01:31:10 View activityLayout = findViewById(R.id.subject_home_layout); Jan 23 01:31:16 I don't think this will work if you try to inflate a layout in a background thread. Jan 23 01:31:50 I think ive done it before Jan 23 01:31:53 Worth a try at least Jan 23 01:31:58 yes, that's correct drose379 (or else you would have to cast the return from fVBI, either way...) Jan 23 01:32:23 Yeah I was gonna ask, why dont I have to cast it? Jan 23 01:32:35 wait, you're creating a view just for the Handler?? Jan 23 01:32:49 Just for the runnable yeah Jan 23 01:33:29 hey guys Jan 23 01:33:33 https://developer.android.com/training/multiple-threads/communicate-ui.html Jan 23 01:33:35 how do I throw exceptions in Android? Jan 23 01:33:41 drose379, https://developer.android.com/training/multiple-threads/communicate-ui.html Jan 23 01:33:49 for example Jan 23 01:33:57 home, same way as in any Java application Jan 23 01:33:57 I have a fraction program, but I don't know Jan 23 01:34:05 Ok thanks MikeWallaceDev Jan 23 01:34:09 Is what im doing incorrect? Jan 23 01:35:18 not really... Jan 23 01:35:26 the article shows you exactly how to do it Jan 23 01:35:37 and........... food. Jan 23 01:35:39 Later. Jan 23 01:35:46 Peace, thank you Jan 23 01:35:49 I want to throw an exception Jan 23 01:35:53 and a warning Jan 23 01:36:00 when someone attempts to divide by zero Jan 23 01:36:14 I am using the EditText to get input Jan 23 01:36:29 and TextView to show output Jan 23 01:36:47 still pretty new to Java/Android Dev Jan 23 01:37:29 how would I make them reset input Jan 23 01:37:42 drose379: That article doesn't really mention what you're doing. It seems to be all about using Handler.handleMessage. Jan 23 01:37:48 if they try to compute a fraction with zero in the denominator? Jan 23 01:37:58 All you need to do is say something like "handler = new Handler(Looper.getMainLooper());" somewhere. Jan 23 01:38:10 Then "handler.post(whateverRunnable);". Jan 23 01:38:12 Ok, what we just tried didnt work Jan 23 01:38:13 That's it. Jan 23 01:38:24 never used handler or looper before, Ill check it out Jan 23 01:38:58 I got a nullpointer exception on this line: Jan 23 01:39:00 activityLayout.post(new Runnable() Jan 23 01:39:05 I think View.post is just a convenience method for this Handler business. Jan 23 01:39:36 home: How are you parsing the input? Jan 23 01:39:37 Does it make sence that I got a nullpointer on that line though? Jan 23 01:39:48 I am saving them to an int value Jan 23 01:39:52 drose379: I'm guessing that activityLayout is null. Jan 23 01:40:13 But I defined it Jan 23 01:40:16 How could it be null? Jan 23 01:40:40 I guess findViewById is returning null. Jan 23 01:40:53 TacticalJoke: http://pastebin.com/zxQZqA0f Jan 23 01:40:57 there is my code.. Jan 23 01:41:19 Thats weird, So handler is what I need to use? Jan 23 01:41:40 Wait! I know why I think Jan 23 01:41:48 TacticalJoke: so I have to check in the .parseInt function Jan 23 01:41:52 and make sure it's not zero? Jan 23 01:42:38 I mixed up my XML files Jan 23 01:44:26 home: I guess just check for 0 and then say something like [ denominatorTextView.setError("The denominator cannot be zero."); ]. Jan 23 01:45:07 Oops, "EditText". Jan 23 01:45:26 yeah, that would work Jan 23 01:45:47 oh, I didn't know that .setError was a function Jan 23 01:45:49 going to try it out! Jan 23 01:46:24 Also, Integer.parseInt throws a NumberFormatException if it's not an int. Jan 23 01:48:48 so I’m having an issue with SuperscriptSpan not being applied Jan 23 01:49:09 It’s not superscripting the text Jan 23 01:50:43 TacticalJoke: it doesn't detect my variables anymore >.> Jan 23 01:52:08 Define 'detect' and 'anymore'. :) Jan 23 01:55:52 okay Jan 23 01:56:01 i did an if, that chekced when 0, it sent an error Jan 23 01:56:21 but it didn't say the string message Jan 23 01:57:20 It needs focus. Jan 23 01:58:14 focus? Jan 23 01:58:30 Try clicking the EditText. Jan 23 01:58:57 yeah Jan 23 01:59:04 is the error suppose to be shown there Jan 23 01:59:09 I have it set to another textview Jan 23 02:00:36 I think you're supposed to set it for the EditText. Jan 23 02:01:31 hm. is there a way to allow installing an app on an intel ABI, when you only have ARM-based binaries? the binary isn't necessary for the app to work. Jan 23 02:01:38 my google-fu is failing me Jan 23 02:03:31 Tactical, okay its working better Jan 23 02:05:26 hello developers Jan 23 02:05:38 any one tried his hands on ble4 Jan 23 02:05:51 i am stuck in a development Jan 23 02:06:51 trying to push notification on ble4 Jan 23 02:07:26 working on this awesome concept Jan 23 02:07:54 any one interested can check out this video Jan 23 02:08:45 TacticalJoke if my JSON array looks like this ["value1","value2"] Jan 23 02:09:01 bascially with no keys, would I access those with 0 and 1 Jan 23 02:09:06 Yeah. Jan 23 02:09:11 Got it, thanks Jan 23 02:09:17 That's just an array with two strings. Jan 23 02:09:28 Right, no keys Jan 23 02:09:35 TacticalJoke: apparently, I was using the same two textfields for the same input, instead of the other text fields 0_0 Jan 23 02:09:38 Yeah, keys and values apply only to objects. Jan 23 02:09:40 fixed that >.> Jan 23 02:10:04 so i could do getJsonObject(0) Jan 23 02:10:18 or getJSONObject(0) and it would get the first value? Jan 23 02:10:19 I guess I should s/keys/names/. Jan 23 02:10:34 ? Jan 23 02:11:02 Isn't that getJSONObject(String key)? Jan 23 02:11:21 I think you're thinking of JSONArray.get(int index). Jan 23 02:12:24 Shit yeah Jan 23 02:12:37 I need to get that value, I have a JSONObject Jan 23 02:13:43 so I need to use JSONArray instead Jan 23 02:15:03 So I'm guessing you have a JSON object that contains a JSON array. Jan 23 02:15:19 I have a JSON string Jan 23 02:15:22 looks like this Jan 23 02:15:36 ["value1","value2","value3"] Jan 23 02:15:43 I need to take that, and convert it to a Java array Jan 23 02:16:08 Why do you need to convert it to a Java array? Can't you just access the elements as is? Jan 23 02:16:25 I need to pass the Java array to a Adapter for a ListView Jan 23 02:17:35 Okay. I think you'll have to loop through the JSONArray. Jan 23 02:18:03 Right, Im using a for loop Jan 23 02:18:03 BTW, it's generally preferable to use Lists over arrays. They're more flexible and more common. Jan 23 02:18:16 List<> = new ArrayList? Jan 23 02:18:20 Though Android gives us arrays sometimes (e.g., with array resources). Jan 23 02:18:24 Yeah. Jan 23 02:18:36 Can I just do List<>= new List? or do I need arrayList? Jan 23 02:18:47 List is an interface, ArrayList is an implementation Jan 23 02:18:52 Ah ok Jan 23 02:18:57 This is the typical Java 7 way: List list = new ArrayList<>(); Jan 23 02:19:09 Ok, so Im doing this: Jan 23 02:19:15 list.add(json.get(i)); Jan 23 02:19:27 ids say use array over list as long as you know that it wont change TacticalJoke :) Jan 23 02:19:58 Yeah, couldnt I get rid of the List all together and just use a regular String[]? Jan 23 02:20:01 eh, it's mostly a premature optimization. lists are so much easier to do things with. Jan 23 02:20:10 Yeah, that often works. But sometimes you need a List (for something else), in which case you'd have to use Arrays.asList. Jan 23 02:20:12 Which is slightly less nice. Jan 23 02:20:46 drose379: Note that ArrayList (and others) just use an array under the hood. Jan 23 02:20:54 groxx, depends on what you are working on. youll see a difference if you have to work with that list/array every frame for example Jan 23 02:20:55 They present a nice interface to a resizable array. Jan 23 02:20:58 Right, then I can just do .toArray at the end Jan 23 02:21:18 danijoo_: sure. but it's still premature. profile, odds are there are waaaaaay higher value things elsewhere. Jan 23 02:21:30 so I guess json.get() returns an object? Jan 23 02:21:39 Cause Im getting an error when i try to add it to the list Jan 23 02:21:59 drose379: If 'json' is a JSONArray, it returns that array element (which could be a string, an integer, or whatever). Jan 23 02:22:12 https://www.youtube.com/watch?v=yd1CXYpUxHI Jan 23 02:22:18 check this out Jan 23 02:22:18 It should be a string, but for some reason AS is saying its an object Jan 23 02:22:35 if any one interested in this project Jan 23 02:22:37 Are you sure the JSON is really ["value1","value2"]? Jan 23 02:22:51 can help me with android studio Jan 23 02:23:00 for notifications Jan 23 02:23:01 Positive TacticalJoke Jan 23 02:23:15 I could just do String.valueof(json.get(i)) Jan 23 02:23:16 If it's an object, i'll look like this: [{"name": "Steven"}, {"name": "Alice"}] Jan 23 02:23:34 No curly braces, just the [] Jan 23 02:23:34 Can you paste the exact JSON? Jan 23 02:24:06 Its a toast on the android device Jan 23 02:24:15 I could copy it over exactly if you want by typing it Jan 23 02:24:32 Where are you getting the JSON from? Jan 23 02:24:37 The server Jan 23 02:25:46 drose379: What error message are you seeing? Jan 23 02:26:16 I don't think you can have duplicate names in an object, can you? Jan 23 02:26:25 oh, the outer thing is a list, nevermind Jan 23 02:26:43 add (java.lang.string) in list to java.lang.object Jan 23 02:27:43 Is this a compile error or a runtime error. Jan 23 02:28:01 There may be another problem, let me show you the method Jan 23 02:28:32 http://pastie.org/9853247 Jan 23 02:28:35 Looking at line 2 Jan 23 02:28:39 I have that defined as null Jan 23 02:28:45 And it gets assigned on server response Jan 23 02:28:56 so maybe this method thinks its a null? Could that be the issue? Jan 23 02:29:29 Try .getString. Jan 23 02:29:42 where? Jan 23 02:29:46 Instead of .get Jan 23 02:29:51 json.getString(i) Jan 23 02:29:59 Fixed Jan 23 02:30:01 Hmm Jan 23 02:30:27 ohh Jan 23 02:30:30 .get returns an object Jan 23 02:30:32 get() is generic. It returns an Object which has to be casted. Jan 23 02:30:40 ahhh, theres the problem Jan 23 02:30:46 Thank you for the help with that Jan 23 02:30:48 By using getString() you're saying "I believe this is a string JSON value". Jan 23 02:30:53 Right Jan 23 02:30:53 You'll get an exception if it's not. Jan 23 02:31:02 I could do .get((String)) Jan 23 02:31:22 well .get((String) json.getString(i) Jan 23 02:31:23 ) Jan 23 02:31:40 Right, and .getString is just a convenience method for that. Jan 23 02:31:46 https://github.com/douglascrockford/JSON-java/blob/master/JSONArray.java#L328 Jan 23 02:31:55 Beautiful. Now I just return list.toArray Jan 23 02:32:57 drose379: http://stackoverflow.com/questions/716597/array-or-list-in-java-which-is-faster/716619#716619 Jan 23 02:33:08 Lists FTW. :) Jan 23 02:33:38 Ill stick with Lists then, thank you Jan 23 02:34:34 arrays only matter for HUGE datasets or if you do something A LOT of times (like every frame iterate over it) Jan 23 02:34:53 Ok Jan 23 02:35:29 Yeah, and I think there are cases where arrays seem more natural. However, if we're using a ListView then I think Lists make a lot of sense in most cases. Jan 23 02:35:44 so any one interested in this project Jan 23 02:35:46 https://www.youtube.com/watch?v=yd1CXYpUxHI Jan 23 02:36:03 what is this? Jan 23 02:36:19 Looks cool Jan 23 02:36:44 a screen showing notifications ? Jan 23 02:39:20 OKay, so I have a dialogfragment i do dialog.show(fm, "some string here); Jan 23 02:39:24 what is this 2nd parameter for?? Jan 23 02:39:48 DragonPunch, its for fm.findFragmentByTag("some string here"); Jan 23 02:40:35 I think you can pass 'null' for the tag. Jan 23 02:40:42 danijoo_: hmm okay yeah idk Jan 23 02:40:54 danijoo: what is it for though? what does it mean? Jan 23 02:41:32 DragonPunch, well. maybe you want to get a reference to that fragment at some time. to call a method on it or whatever Jan 23 02:41:44 then you can find it by its tag Jan 23 02:42:11 danijoo_: when i type some string in there it underlines as red Jan 23 02:42:20 danijoo_: why does it keep underlining itself Jan 23 02:42:24 or if you want to check if there is already fragment of that type present, you can check it with (findFragmentByTag("myTag") == null) Jan 23 02:42:43 DragonPunch: Hover your mouse over and see! Jan 23 02:43:02 http://puu.sh/eTEen/cd76f68ff1.png Jan 23 02:43:03 it says Jan 23 02:43:07 cannot resolve method Jan 23 02:43:30 because you are mixing fragments with support fragments Jan 23 02:43:43 use getSupportFragmentManager() if you use support fragments Jan 23 02:44:41 thats not the case though Jan 23 02:44:42 http://puu.sh/eTEqL/a1f712a5b0.png Jan 23 02:44:43 look Jan 23 02:44:48 i ahve a diff dialog fragment Jan 23 02:44:50 that works just fine Jan 23 02:44:55 but when i try making my own Jan 23 02:44:58 its giving me a error Jan 23 02:45:13 I told you.You are mixing support fragments with normal fragment manager Jan 23 02:45:30 either change the fragment manager to support fragment manager Jan 23 02:45:35 I guess one is a v4 DialogFragment and one isn't. Jan 23 02:45:42 or check your imports in ChatDialog.java Jan 23 02:45:45 well Jan 23 02:45:48 the FIRST one Jan 23 02:45:51 does it just fine? Jan 23 02:46:04 DragonPunch, maybe your autoimport fucked it up Jan 23 02:46:18 hmm Jan 23 02:46:19 okay Jan 23 02:46:21 check it. EditNameDialog will import android.app.Fragment Jan 23 02:46:21 i fixed it Jan 23 02:46:28 Yeah Jan 23 02:46:31 while the other one imports support.v4... Jan 23 02:46:31 Thanks, I get what you meant now. Jan 23 02:46:46 DragonPunch, also you should use the support fragments Jan 23 02:46:49 not the native once Jan 23 02:47:00 Ok Jan 23 02:47:51 the native fragments suck. You cant do viewpager with them, and some other things too. Jan 23 02:48:09 Ok my app is crashing but log cat is not showing me the exception Jan 23 02:48:24 Wait, nevermind Jan 23 02:48:25 :) Jan 23 02:49:33 danijoo_: my app is built aroudn view pager hehe Jan 23 02:52:48 drose379: Are you working on the task-setting app? Jan 23 02:52:52 s/task/goal/ Jan 23 02:53:01 Yeah, the self education one Jan 23 02:53:06 Nice. Jan 23 02:53:14 self education/task/goal Jan 23 02:53:20 Hows your app coming? Jan 23 02:53:40 Going pretty well. Just did a huge refactoring which I liked. Jan 23 02:53:53 Had some subtle duplication across some classes. Was insidious. Jan 23 02:53:54 TacticalJoke, the reddit app? Jan 23 02:54:06 Yeah. Jan 23 02:54:28 tell me when you need a beta tester :> Jan 23 02:54:32 Cool, thanks. :) Jan 23 02:55:20 and now im off to sleep. 4 am here.. :/ Jan 23 02:55:30 Almost 3am here. ;| Jan 23 02:55:33 Good night. Jan 23 02:55:47 sounds like UK Jan 23 02:55:52 Yeah. Jan 23 02:55:55 :p **** ENDING LOGGING AT Fri Jan 23 02:59:59 2015