**** BEGIN LOGGING AT Thu Nov 20 02:59:58 2014 Nov 20 03:20:54 MS docs are so good, you can get spoiled http://msdn.microsoft.com/en-us/library/hh211949(v=vs.103).aspx Nov 20 03:21:18 first - you can provide feedback right there Nov 20 03:21:31 towards the bottom, code samples, etc Nov 20 03:21:46 So if I use appcompat-v7 and have the base Activity be ActionBarActivity, on Lollipop will it use the default Toolbar/ActionBar or the appcompat one? Nov 20 03:42:14 does anyone know if the nexus 7 supports OpenGL ES 2.0 Nov 20 03:42:15 ? Nov 20 03:44:19 I'm pretty sure it does Nov 20 03:45:45 so, in the example app for eclipse, it says "R cannot be resolved to a variable".. what's that mean :/ Nov 20 03:46:29 R is the resource thingy. Nov 20 03:46:40 It links to stuff such as layouts. Nov 20 03:46:50 i forget the solution for that error Nov 20 03:46:55 You might need to go Project > Clean or to use an import statmenet. Nov 20 03:46:58 statement* Nov 20 03:46:58 i'd try cleaning and then rebuilding Nov 20 03:47:25 rebuilding? Nov 20 03:47:35 Building should happen automatically. Nov 20 03:47:48 sorry, total newb if you didn't know from last night Nov 20 03:47:56 Project > Clean. Nov 20 03:48:03 If that doesn't fix it, post something. Nov 20 03:48:15 do you guys use eclipse or android studio? Nov 20 03:48:16 Or hover the mouse over the red underline. Nov 20 03:48:17 got that part, I think it finished and it's still there Nov 20 03:48:20 I use Eclipse. Nov 20 03:48:21 AS has been in beta forever Nov 20 03:48:29 hmm, play store launched in China... Nov 20 03:48:32 laspahr_mint17: What does it say when you hover your mouse over the red underline? Nov 20 03:48:36 Does it suggest "import foo"? Nov 20 03:48:43 I use Eclipse since my computer's old, but I use Studio on my laptop (did) Nov 20 03:48:59 RustyShackleford: I'll switch to AS when they support JVM unit testing. :) Nov 20 03:49:17 import 'R' (android) ? Nov 20 03:49:32 Oh, no. Nov 20 03:49:34 Probably not that. Nov 20 03:49:37 Could you post the file you're editing? Nov 20 03:49:44 TacticalJoke: uh what? You can't write unit tests with AS? Nov 20 03:49:55 RustyShackleford: You can't run them on the JVM without jumping through hoops. Nov 20 03:49:56 ah... no... *merchants* in China, not users Nov 20 03:50:02 You can run them on devices or the emulator. Nov 20 03:50:04 literally the example app in Eclipse lol Nov 20 03:50:12 I've not touched anything Nov 20 03:50:14 Define "the example app". Nov 20 03:51:06 If you hit New and create the project, it's Android Application Project or something, and I haven't made any changes Nov 20 03:51:08 you don't have to jump through hoops to run robolectric tests on eclipse? Nov 20 03:51:30 TacticalJoke, I imagine it should be as easy as creating a plain java project in android studio... Nov 20 03:51:33 I've not tried Robolectric. I thought it was easy, though? Nov 20 03:51:43 unless android studio disallows plain java projects... Nov 20 03:51:47 Running JVM unit tests in Eclipse is extremely easy. I know that. :) Nov 20 03:51:52 Oh, you just want plain tests... Nov 20 03:52:02 hello Nov 20 03:52:12 I thought you want robolectric specifically Nov 20 03:52:19 okay, how do I make the DDMS shutup? :/ Nov 20 03:52:33 pfn: I think you'd have to make the code-to-be-tested a plain Java module. Nov 20 03:52:34 I have 6 fragments. When some button is pressed in fragment 3, I want an edittext box to update with some values in fragment 5 Nov 20 03:52:37 how can i do that? Nov 20 03:52:37 As well as the JVM unit tests. Nov 20 03:52:54 DeviceMonitor Connection Attempts: *increasing numbers per second* Nov 20 03:53:35 ir7466: Use the Activity to manage it all. Callbacks, etc. Nov 20 03:53:35 TacticalJoke, just make a plain java module that depends on the android module Nov 20 03:53:43 then run unit tests on plain module... Nov 20 03:53:44 pfn: I think that doesn't work in Android Studio. Nov 20 03:53:48 It's a Gradle thing. Nov 20 03:53:53 * pfn shrugs Nov 20 03:54:06 TacticalJoke, can you elaborate a bit further? Nov 20 03:54:10 I don't use android studio nor eclipse, life is happy Nov 20 03:54:20 pfn: Which build system do you use, if I may ask? Nov 20 03:54:38 maven Nov 20 03:54:49 wait but android studio and eclipse aren't build sytems... Nov 20 03:55:10 when the button call occurs in fragment 3, what do you suggest happens in the activity? Nov 20 03:55:27 TacticalJoke, i use sbt for build, but for ide I use intellij Nov 20 03:55:30 The activity be notified. Nov 20 03:55:37 don't mean to interrupt a conversation.. but could I get a little assistance..? Nov 20 03:55:38 The activity then tells the other fragment to do stuff. Nov 20 03:55:50 is there a name for this? Nov 20 03:56:02 ir7466: Maybe "the listener pattern" or something? Not sure. Nov 20 03:56:03 so i can search the android docs Nov 20 03:56:09 ok Nov 20 03:56:11 It's kinda like the observer pattern. Nov 20 03:56:28 ir7466: It's the recommended way of using fragments, I believe. Nov 20 03:56:35 Helps reduce coupling, thereby making them versatile. Nov 20 03:56:48 ok Nov 20 03:56:55 Basically, a fragment 'calls back' to its host activity when it needs something. The activity controls everything. Nov 20 03:57:07 just out of interest, I have a helper class where I store the data from each fragment Nov 20 03:57:14 The fragment also doesn't refer to a FooActivity or whatever. It refers to an interface instance. Nov 20 03:57:19 would it be possible to someone have a listener event attached tothat? Nov 20 03:57:40 so that when the value in the helper class property changes, some event is fired in the fragment or the activity? Nov 20 03:57:51 more likely the activity based on what you said Nov 20 03:58:23 otto is the shizznit Nov 20 03:58:43 Not sure what you mean, but it sounds like the kinda situation where the fragment would get the noficiation that the property has changed and then the fragment would notify the listener (the Activity). Nov 20 03:58:47 notification* Nov 20 04:00:04 should a service and an app run in the same process? Nov 20 04:00:07 ir7466: Search for "Creating event callbacks" on this page: http://developer.android.com/guide/components/fragments.html Nov 20 04:00:13 That's the listener pattern (thingy). Nov 20 04:00:18 RustyShackleford: Service runs inside App Nov 20 04:00:27 App runs inside process Nov 20 04:00:32 Wait, here's a link: http://developer.android.com/guide/components/fragments.html#EventCallbacks Nov 20 04:00:36 pretty sure you can run them in separate processes Nov 20 04:00:42 uh, let me read some docs Nov 20 04:00:55 That would be running two separate Application instances in two separate processes Nov 20 04:01:21 IIRC, you declare something in the manifest file, and the service will be started in another process Nov 20 04:01:31 remote = true iirc Nov 20 04:01:53 yeah thats it Nov 20 04:06:37 Android SDK Content Loader encountered a problem? parseSdkContent failed (could not initialize class android.graphics.Typeface) Nov 20 04:07:30 Reddit's terminology is so bad. There's an object called a "more". Nov 20 04:07:35 How can something be a more? Nov 20 04:07:43 Could've called it "an extra" or something. Nov 20 04:08:17 And a post is called a link. Even if it's a text post (and doesn't have a link). Nov 20 04:09:03 But a text post is a "self post". Oh, come on. :D Nov 20 04:13:16 bankai_au http://i.imgur.com/uaoQsJ4.gif Nov 20 04:13:50 aww just like my puppies Nov 20 04:14:24 RustyShackleford, it's rare to want to have a service in a separate process Nov 20 04:15:41 the only good reason I've come up with is memory space isolation when you're using really shitty libraries Nov 20 04:16:04 so when your service takes a dump, the rest of your app can recover Nov 20 04:16:26 (native libraries) Nov 20 04:17:28 otherwise, inter app communication, but that's uncommon and not really tied to requiring it be a separate process within your own app Nov 20 04:20:53 screw it, this can wait a week .-. Nov 20 04:21:05 I'm tired, Night all Nov 20 04:25:54 TacticalJoke: I'm looking at http://developer.android.com/guide/components/fragments.html#EventCallbacks Nov 20 04:26:12 what does it mean by Then the activity that hosts the fragment implements the OnArticleSelectedListener interface ? Nov 20 04:27:21 It implements the Java interface. Nov 20 04:27:36 If that doesn't make sense, google "java interface". Nov 20 04:28:27 oh right Nov 20 04:28:42 so I just need to put "implements OnArticleSelectedListener" after the class definition in the activity class Nov 20 04:28:43 Yeah. Nov 20 04:28:51 And implement the method (though Eclipse will tell you to do that). Nov 20 04:29:08 those fragments though, on that link Nov 20 04:29:16 they talk about fragment a and b Nov 20 04:29:16 It's just a way of making the fragment flexible. It can call back to *anything* that implements OnArticleSelectedListener. Nov 20 04:29:16 but only provide code for a? Nov 20 04:29:37 I haven't read it recently, but I seem to remember it being a not-so-great example. Nov 20 04:29:51 I think I found it overly complicated (given the scope). Nov 20 04:30:13 for my activity Nov 20 04:30:23 I am already extending a general fragment browser activity Nov 20 04:30:27 (i use fragments in a few places) Nov 20 04:30:40 can i implement that listener as well as extending the base class? Nov 20 04:31:01 pfn: thanks I'll keep that in mind Nov 20 04:31:03 Yes. Nov 20 04:31:12 You can implement as many interfaces as you want. Nov 20 04:31:13 But you can extend only one class. Nov 20 04:31:14 ie public class MyActivity extends MyBrowserActivity implements OnArticleSelectedListener Nov 20 04:31:36 In some programming languages, you can extend multiple classes, but many people think that's a bad concept. Nov 20 04:31:43 That entails certain ambiguities. Nov 20 04:32:00 Google "multiple inheritance" if you're interested in that huge discussion. :) Nov 20 04:32:14 but can i do it in java? Nov 20 04:32:25 As you typed above. Nov 20 04:32:40 so the bulk of the work in this application will be done in the Service Nov 20 04:32:46 You can implement an interface and extend a class. You can even implement multiple interfaces. Nov 20 04:32:59 The only restriction is that you can't extend multiple classes. Nov 20 04:33:17 the only graphical parts of the app are for settings Nov 20 04:34:03 so this app warns you about speed cameras while you're driving. I wonder if there is a way to start the app automatically if you start driving Nov 20 04:34:30 perhaps keep the service open in the background always Nov 20 04:34:38 oh boy Nov 20 04:35:48 g00s: bad idea? Nov 20 04:37:32 TacitcalJoke, i am getting "implements OnArticleSelectedListener" Nov 20 04:37:39 have a setting the user can set if connected to car dock always start, or integrate with google now or something. give user options dont force Nov 20 04:37:42 sorry, wrong paste Nov 20 04:37:44 OnArticleSelectedListener cannot be resolved to a type Nov 20 04:37:54 when i do implements OnArticleSelectedListener Nov 20 04:37:56 You need to define the interface. Nov 20 04:38:02 The typical place is inside the Fragment. Nov 20 04:38:05 A nested interface. Nov 20 04:38:08 i thought I just needed to implement the methods? Nov 20 04:38:12 Then "implements FooFragment.FooListener". Nov 20 04:38:37 The article shows all this, BTW. Nov 20 04:38:45 I don't understand... I have Fragment1, Fragment2, Fragment3, Fragment4, Fragment5, Fragment6 and MyActivity Nov 20 04:38:56 in MyActivity i have "implements OnArticleSelectedListener" Nov 20 04:39:13 ir7466, do some reading, he said implement interface then you have to add the methods for that interface in the implementing class Nov 20 04:39:17 now I need to implement the methods for OnArticleSelectedListener in my fragment? Nov 20 04:39:42 i have been reading http://developer.android.com/guide/components/fragments.html#EventCallbacks Nov 20 04:39:46 Define the interface inside your Fragment subclass. Nov 20 04:39:51 are we talking about the same article? Nov 20 04:39:57 Yes. Nov 20 04:40:09 yes, my point was I have six fragments Nov 20 04:40:14 do i need to implement this in each of them? Nov 20 04:40:23 No. Nov 20 04:40:24 or just the one I want to listen to the button press on? Nov 20 04:40:26 Only the one with the button. Nov 20 04:40:31 ok Nov 20 04:40:38 It's the Fragment's way of communicating with the outside world. Nov 20 04:41:09 You could say "public interface OnFooButtonClickedListener { void onFooButtonClicked(String blah); }". Nov 20 04:41:47 Note that that example is "wrong". Nov 20 04:41:56 oh Nov 20 04:41:56 sorry Nov 20 04:42:01 I have misunderstood Nov 20 04:42:04 You shouldn't declare an interface's methods as "public". Nov 20 04:42:06 I thought OnArticleSelectedListener was a Java/Android construct Nov 20 04:42:08 Just "void whatever". Nov 20 04:42:13 I see now Nov 20 04:42:16 sorry for the confusion Nov 20 04:42:32 i'll have a play around with this for a while. thanks for your help Nov 20 04:42:37 Interfaces are really cool. Nov 20 04:42:41 It sounds like you haven't used them before. Nov 20 04:43:00 They basically enable us to treat objects of basically any type as the same. Nov 20 04:43:04 -basically Nov 20 04:44:49 You could have an interface ElectronicDevice which has a switchPowerOn method. Then, if Television, Computer, and Cellphone implement this interface, you can say someDevice.switchPowerOn regardless of which type the device happens to be. Nov 20 04:55:12 good stuff. i always screw this up http://blog.danlew.net/2014/11/19/styles-on-android/ Nov 20 04:55:32 'spagehtti styles' :) Nov 20 05:04:01 TacticalJoke: played around with interfaces a bit with .net Nov 20 05:04:07 but was more through events Nov 20 05:04:16 so it's a learning curve for sure with java/android Nov 20 05:06:01 I came from .NET too. Nov 20 05:06:05 so do ya get it now? he explained pretty decently. if ya dont, he loves him some c# so maybe he can detail it more Nov 20 05:06:10 It seems that MS is making build tools for Android now. Nov 20 05:06:24 I guess the C# case is basically identical. Nov 20 05:06:43 C# = (Java - baggage) + some_baggage Nov 20 05:19:55 whatitis: yes I get it, I'm able to get it firing the event Nov 20 05:20:28 I'm confused that i've got a breakpoint on Log.d("EVENTFIRED", "EVENTFIRED"); inside the method in the Activity, and the breakpoint hits but the log message doesn't get recorded Nov 20 05:20:33 but besides that it seems to be making sense Nov 20 05:21:33 dont break on a log, just read logcat, and if it doesnt get recorded maybe however you are viewing logcat is filtering Nov 20 05:22:03 ah Nov 20 05:22:03 yeah Nov 20 05:22:05 it was the filter Nov 20 05:22:13 :) Nov 20 05:25:18 The Log class is nice. IIRC, .NET didn't have anything like that built in. Nov 20 05:25:36 yeah, visual studio was better for debugging though Nov 20 05:25:43 eclipse is a bit clunky in debug mode Nov 20 05:25:53 eclipse is a bit clunky in general Nov 20 05:26:16 i'm looking forward to android studio once it's more established Nov 20 05:26:53 Yeah. Nov 20 05:26:58 Same here. Nov 20 05:27:38 Hmm, are the Log.d (and so on) methods threadsafe? Nov 20 05:27:43 I just googled and couldn't get any results. Nov 20 05:27:48 ok i have a question... in my Activity I have this method: public void onReasonSelected() Nov 20 05:27:56 so ultimately that gets fired on the button click Nov 20 05:28:02 how do I then update my 5th fragment? Nov 20 05:28:26 Via the FragmentManager, I guess. Nov 20 05:28:37 findFragmentById or something. Nov 20 05:28:43 Unless it already has a reference. Nov 20 05:29:15 Your fragment would need a public method. Nov 20 05:29:31 ok thats not a problem Nov 20 05:29:39 so how can I call that public method from onReasonSelected? Nov 20 05:30:22 you can tag your fragment so you can access it as long as the manager has it Nov 20 05:30:22 from having a reference of 5th fragment in activity Nov 20 05:31:22 can I extract the reference from fragment manager? Nov 20 05:31:31 by defining the class name for example Nov 20 05:31:32 hmmmm Nov 20 05:31:40 get[Support]FragmentManager.findFragmentById Nov 20 05:31:45 If it's in the activity's layout file. Nov 20 05:31:59 Otherwise, the tag thing dbrosyth mentioned. Nov 20 05:32:29 findFragmentByTag Nov 20 05:32:59 when you add a fragment where do you define the tag? Nov 20 05:33:03 is it in .add? Nov 20 05:33:10 apparently if i have MyFragment.newInstance (""); for getItem in a fragmentpageradapter and i set an global variable in the fragment as , it sets it on all my fragments... Nov 20 05:33:13 ir7466: Is your fragment declared in your activity's layout file? Nov 20 05:33:18 no, programatically Nov 20 05:33:30 Okay. Then I guess you have to use a tag. Nov 20 05:34:05 it looks like i've already specified a tag Nov 20 05:34:06 well, you can get it by id after you add it Nov 20 05:34:07 .add(_fragmentContainer, fragment, fragment.getClass().getName()) Nov 20 05:34:15 it looks like the third argument is the tag? Nov 20 05:34:26 chaos dont use static for your fragment Nov 20 05:34:38 okay Nov 20 05:34:43 The third is the tag. Nov 20 05:34:57 avoid static at all Nov 20 05:35:07 would MyFifthFragment.class.getName() Nov 20 05:35:08 if it's not a constant it usually shouldn't be static Nov 20 05:35:13 be equivalent to the tag that is set? Nov 20 05:35:35 ir7466: It's better to specify a tag manually. That stuff is unnecessarily complicated. Nov 20 05:35:35 ie. getFragmentManager().findFragmentByTag(MyFifthFragment.class.getName()) would get my reference? Nov 20 05:35:38 whatitis: i cant reference the newinstance method in the fragment if its nto static Nov 20 05:35:46 IMO. Nov 20 05:36:00 i might change it, but i just want to get it working first Nov 20 05:36:08 seeing it's already saving the class name as a tag Nov 20 05:37:36 chaosagent, dont set/use static variables in newInstance, just get your instance, then do whatever with it in onCreate etc Nov 20 05:37:43 On a side note, I feel that fragment tags (and onSaveInstanceState keys) are one example of magic literals being okay. Nov 20 05:37:48 Though some might still prefer constants. Nov 20 05:37:53 whatitis: i need to pass info to the fragment Nov 20 05:38:22 chaosagent: Can't you use setArguments? Nov 20 05:38:26 and the bundle thingy doesnt work cuz it thinks it doesnt exist Nov 20 05:38:33 you, use a bundle to get passed to your instance through bundle Nov 20 05:38:33 kk lookign that up Nov 20 05:38:41 ok giving it a crack now... Nov 20 05:39:02 with Android TV, are those apps that will run on the TV? Nov 20 05:39:08 oh nice i can setargs Nov 20 05:39:18 Then, in onCreate, call getArguments. Nov 20 05:39:22 It's like having two constructors. :) Nov 20 05:39:35 But neither is technically a constructor. Nov 20 05:40:26 TacticalJoke Nov 20 05:40:28 it worked :) Nov 20 05:40:32 Great. Nov 20 05:40:36 thanks for teaching me a new concept Nov 20 05:40:46 i think this is something i will use more in the future Nov 20 05:40:46 Now that you're using interfaces, your fragments are quite independent. Nov 20 05:40:48 No worries. Nov 20 05:40:55 Yeah, it's a good pattern (and it's used on Android a lot). Nov 20 05:41:05 called the listener pattern? Nov 20 05:41:08 I think so. Nov 20 05:41:16 It's similar to the observer pattern. Nov 20 05:41:20 But simpler. Nov 20 05:41:31 what does the observer pattern offer that this doesn;t? Nov 20 05:42:00 Trying to remember. I think that the observer pattern usually allows for multiple observers. Nov 20 05:42:04 Whereas this has just one listener. Nov 20 05:42:11 The observer pattern would have a list or array of observers. Nov 20 05:42:22 But I could be misremembering. Nov 20 05:42:57 ok Nov 20 05:43:07 Perhaps they're fundamentally the same concept. Nov 20 05:43:19 If you had a List, maybe it'd qualify as the observer pattern. Nov 20 05:44:20 alright Nov 20 05:45:00 TacticalJoke: the setargs thing worked :D Nov 20 05:45:03 thx a lot Nov 20 05:45:14 :) Nov 20 06:12:24 would be nice if AS had that 'preview' you can scroll around in Nov 20 06:12:29 i love that thing Nov 20 06:12:46 of SublimeText Nov 20 06:14:02 AS + flavor + wear = mess Nov 20 06:14:24 the auto-packaging of the wear app in the mobile/handheld one is not working lol, I have to do it by hand Nov 20 06:22:40 your flavor needs more flav Nov 20 06:25:02 Flavor of Love Nov 20 06:30:49 i dont hear much about wear Nov 20 06:30:55 that died quick Nov 20 06:32:47 maybe you're in with the wrong crowd, anyone who's anyone has one Nov 20 06:32:59 new devices are still shipping, but now most of the vendors have something on the market, it'll be interesting to see how long it takes them to rev - if there's no new hardware for 6 months, it'll lose a lot of buzz Nov 20 06:33:10 or maybe everyone has gone into lockdown until the iWatch ships Nov 20 06:34:19 the iwatch hasn't shipped yet ? Nov 20 06:34:53 no, it hasn't Nov 20 06:35:44 the SDK - sorry, WatchKit - was released this week Nov 20 06:39:15 g00s, it's rising lol, not dying Nov 20 06:39:25 oh Nov 20 06:39:38 as Leeds said, few constructors released a watch recently Nov 20 06:39:50 moto lg asus sony Nov 20 06:40:35 LG are the only ones who've released 2 models, AFAIK Nov 20 06:40:59 yup, I have the G watch (square) Nov 20 06:41:50 has anyone been able to successfully use "--compiler-backend=portable" with dex2oat ? Nov 20 06:41:54 whats interesting with watchkit - no native apps until 2015. so atm, your app runs on the phone O.o Nov 20 06:42:08 like sony did with their 2 previous model Nov 20 06:42:17 very laggy to send a bitmap each time you need to refresh Nov 20 06:42:56 but you have an enormous processing power Nov 20 06:43:05 and a better battery life than if it was running on the watch Nov 20 06:43:32 but i prefer the watch being able to run things without the handheld Nov 20 06:43:39 g00s: that's in 40 days Nov 20 06:43:46 it does seem like they're a bit worried about battery life and bandwidth Nov 20 06:44:57 yeah i kinda wonder if it would have been better if google defined a BLE profile and let watch oems use whatever, but have integration with android phones Nov 20 06:45:09 whatever OS Nov 20 06:45:38 which means, almost no OS unless you're something like a garmin forerunner Nov 20 07:03:39 nice a book on rx patterns Nov 20 07:03:46 ugh, in scala :( Nov 20 07:05:50 i have a complicated state machine and wonder, if i could turn this into rx instead. not sure how Nov 20 07:12:10 the answer is always yes Nov 20 07:13:29 but why? Nov 20 07:15:56 heh http://flatmapthatshit.com/ Nov 20 07:16:53 nerd Nov 20 07:18:52 The download link here says "WITH SDK" https://developer.android.com/sdk/installing/studio.html. But I'm not able to see sdk in the .app directory or elsewhere! Android studio is actually coming "WITHOUT SDK" ? Nov 20 07:19:25 you have to download the sdk urself Nov 20 07:19:28 u get the sdk tools Nov 20 07:20:45 ok it was unclear from the instructions tho Nov 20 07:21:09 previous releases used to include sdk as well IIRC Nov 20 07:21:09 How do you use paint filters and do hardware acceleration? Nov 20 07:29:05 napster: https://developer.android.com/sdk/index.html Nov 20 07:29:12 napster: look at "existing IDE" Nov 20 07:29:24 Yep, downloading already. Nov 20 07:29:33 thanks kevel1 JakeWharton Nov 20 07:35:11 Whoa. I was just thinking of the old Napster service. I hadn't even look at this channel. Bizarre coincidence. :) Nov 20 07:35:41 :) What mp3 would you like to download sir TacticalJoke Nov 20 07:36:20 lol Nov 20 07:36:34 Nowadays, we have YouTube for that. :D Nov 20 07:36:57 Rich people use iTunes :) Nov 20 07:39:31 JakeWharton, do you know of any decent camera libs? Nov 20 07:39:37 no Nov 20 07:39:41 I was using commonsware but it seems to break a lot :( Nov 20 07:39:49 and theres so much restriction Nov 20 07:42:59 What is the difference between Android Support Library and Android Support Repository? Nov 20 07:43:29 one is a jar, the other is for use with Gradle Nov 20 07:44:09 Does the repo contains this jar? Nov 20 07:44:34 And I assume if I'm using Android Studio, I just need to install the repository. Nov 20 07:45:02 I guess the build system basically downloads/retrieves the JAR and includes it in the project. Nov 20 07:45:16 (It might retrieve a local copy.) Nov 20 07:45:49 All the docs needs to be improved much more. Many things are unclear from the view point of a beginner. Nov 20 07:46:02 I agree. The Android documentation isn't great, in general. Nov 20 07:46:46 They need to copy MSDN: "exemplify all the things!" Nov 20 07:47:05 napster: it contains an aar Nov 20 07:47:41 the gradle 0.14.4 samples came out today (and the others were taken down) - and its still missing a bunch of examples that seem "lost" Nov 20 07:47:56 ok Nov 20 07:48:12 g00s: this question was already answered Nov 20 07:50:48 an 0.14.3 was not working with AS Nov 20 07:50:53 and* Nov 20 07:50:56 use 0.14.4 Nov 20 07:51:03 yup i saw the issue Nov 20 07:51:10 https://code.google.com/p/android/issues/detail?id=80003 Nov 20 07:51:39 Better to use binary semaphore or just straight up wait/notify? Nov 20 07:51:45 (for thread signalling) Nov 20 07:59:14 anyone use sonarqube? Nov 20 08:03:24 i have before Nov 20 08:04:10 any useful? Nov 20 08:04:23 it can be, yes Nov 20 08:04:30 cool thanks Nov 20 08:04:32 we ended up determining that it was too much hassle for too little value Nov 20 08:05:34 hehe Nov 20 08:05:43 yeah that is why i was asking Nov 20 08:05:52 code analyzers always fun though Nov 20 08:06:11 good morning guys, anybody could give me a hint to only upload (upload scrictp to nexus-maven repo) one module of my android studio project? Nov 20 08:06:24 JakeWharton: Is it possible to basically packet-sniff the OkHttpClient in my app by querying it somehow? I've seen networkResponse(), but it seems like I need more to see everything that's going on. Nov 20 08:06:33 no Nov 20 08:06:41 Ideally, I'd just use a packet sniffer, but I have no idea (yet) how to set one up. Nov 20 08:06:41 lasserix: we still use those, we just use standalone reports Nov 20 08:06:42 Okay. Nov 20 08:06:42 my current script is gradlew upload Nov 20 08:06:49 TacticalJoke: look at Charles Nov 20 08:07:09 Oh, a proxy? Nice idea. Nov 20 08:08:34 Would I have to use the emulator for that? Nov 20 08:09:01 nope Nov 20 08:10:34 How would my phone see the proxy running on my laptop? Nov 20 08:10:42 TacticalJoe Have a look at mitm-proxy Nov 20 08:11:31 I'm confused about how my phone would see all this stuff. Nov 20 08:15:12 either be on the same network or use adb and port-forward the proxy to the phone Nov 20 08:16:42 (or sniff your own network with tool like tcpdump or wireshark) Nov 20 08:17:37 My phone and laptop are both connected to my router, yeah. Nov 20 08:18:04 I used https://play.google.com/apps/testing/org.gawst.proxy few times too, but I'm not sure it will meet your requirements Nov 20 08:19:19 How hard is it to sniff my own network (two devices connected wirelessly to a router)? Nov 20 08:19:27 I've never sniffed a whole network before (only a single node). Nov 20 08:20:07 Would I need to do something on my router? Nov 20 08:20:14 Like, install something. Nov 20 08:20:22 Lol. I sound like such a n00b. Nov 20 08:20:54 no need to install anything, it's pretty straight-forward without encryption enabled on your wifi Nov 20 08:22:50 What is the TL;DR? Just curious. :) Nov 20 08:22:58 I'll have to do one of these things at some point, I think. Nov 20 08:23:42 the tldr is when you're using wpa-psk or above standard, if you're not on the same node who is authenticated Nov 20 08:24:17 just search for tutorial on wireshark and wifi Nov 20 08:24:23 Okay. Nov 20 08:29:19 JakeWharton: Would I port-forward within Charles or within adb? Nov 20 08:29:24 adb Nov 20 08:29:41 then you'd set a proxy on the OkHttpClient for localhost:5000 (or whatever port) Nov 20 08:29:46 and it'd route back to your computer to charles Nov 20 08:30:27 Nice. That sounds like a simple method. Nov 20 08:33:39 How would I determine the remote port? Nov 20 08:33:47 (The one for the device.) Nov 20 08:34:07 you make it up Nov 20 08:35:38 TacticalJoke probably > 1024 Nov 20 08:35:59 The documentation suggests it's "adb forward ". If Charles is listening on localhost:5000, it's "adb forward localhost:5000 ", right? Though I'm not sure what would be. Nov 20 08:36:13 not probably, definitely Nov 20 08:36:31 TacticalJoke: it's whatever you want Nov 20 08:36:38 pick a number between 1024 and 65k Nov 20 08:37:02 it's above 1024 because otherwise you need to have root privileges in order to listen port below 1024 Nov 20 08:37:31 right. but even if you had root, why even bother? Nov 20 08:37:40 definitely :) Nov 20 08:38:00 So I could just say "adb forward tcp:5000 tcp:1234" and, if Charles is running on 5000, my phone will now connect to it? Nov 20 08:38:00 no one's hitting your phone with a web browser expecting something on port 80 anytime soon Nov 20 08:38:14 if you proxy to localhsot:1234 yes Nov 20 08:42:16 And I proxy to localhost:1234 within Charles, right? Nov 20 08:42:58 lol, this shouldn't be so difficult Nov 20 08:44:01 port forwarding = connection aliasing; it makes it so that when you connect to localhost:, you are really connecting to someotherplace: Nov 20 08:44:07 that's all there is to it Nov 20 08:44:15 Right. Nov 20 08:44:20 I don't get how "adb forward" works. Nov 20 08:44:32 um, it is the thing that makes the alias? Nov 20 08:44:37 how else would you do it? Nov 20 08:44:42 you proxy in the app Nov 20 08:44:46 to localhost:1234 Nov 20 08:44:56 and that is port forwarded to your laptop on port 5000 Nov 20 08:46:35 i'm passing a context in constructors from my mainactivity to various asynctasks. i trigger some toasts and intents in the onpostexecute method. everything worked yesterday but now nothing will work that is associated with that context (toasts and intents for example) Nov 20 08:50:07 Okay, so I say "adb forward tcp:5000 tcp:1234", get my app to connect to localhost:1234, run Charles on localhost:5000, and it should all work? Nov 20 08:50:26 why don't you just do it instead? Nov 20 08:50:28 very odd behavior Nov 20 08:51:09 ravilov: Because I like to plan rather than dive in head-first like a neanderthal. Nov 20 08:51:52 that only makes any kind of sense if there's some risk of damage involved Nov 20 08:52:10 otherwise, it is wasted time Nov 20 08:52:13 its like it loses the reference to context Nov 20 08:52:30 MartialLaw, what do you expect us to do? Nov 20 08:53:16 ravilov: I just spent the last two hours tracking down a bug. If I spend the next three trying to get port forwarding to work over adb, I will lose my mind entirely. Nov 20 08:53:23 That is the risk. Nov 20 08:53:41 (Those two hours were not fun.) Nov 20 08:53:56 the way you're doing it (seriously overthinking it), you are definitely heading that way (losing your mind) Nov 20 08:54:28 ravilov: Do you never plan for things? Nov 20 08:54:32 I spend half my life planning. Nov 20 08:54:38 that's not what I said Nov 20 08:54:40 https://www.saikoa.com/blog/the_upcoming_jack_and_jill_compilers_in_android Nov 20 08:54:52 there is a sane limit to planning, and then there's overthinking and obsessing Nov 20 08:54:52 should I try? :) Nov 20 08:55:26 there could be an infinite number of "what if"s if you keep just theoretizing Nov 20 08:56:06 MartialLaw: What are the symptoms? Log messages, etc. Nov 20 08:59:01 TacticalJoke: I figured it out. thnx Nov 20 08:59:14 What was it? Just wondering. Nov 20 08:59:28 I'm nosy. :D Nov 20 08:59:56 BTW, I wonder whether it's more sensible, generally speaking, for an Activity, not an AsyncTask, to worry about stuff such as showing Toasts, meddling with Intents, etc. Nov 20 09:06:50 http://stackoverflow.com/questions/27033260/android-gradle-plugin-multidex-zipexception Nov 20 09:07:03 anyone has experience with ndk image processing ? Nov 20 09:07:44 looking for something like imagemagik but small binary size Nov 20 09:08:18 TacticalJoke: responsibility would mean activity should Nov 20 09:08:26 *at least show intent Nov 20 09:15:17 Do you guys think its possible to get ‘good’ downloads from just keywords in the description ( without spamming of course) as I haven’t heard back from any of the review sites I have contacted - which I was sort of expecting anway. Nov 20 09:15:23 *anyway Nov 20 09:16:13 What is your app, if I can ask? Nov 20 09:16:53 Morning All Nov 20 09:17:09 Sure it a matching / puzzle game for young kids, I haven’t released it yet as I was waiting to see if I would hear back from anyone first Nov 20 09:17:34 But being as I haven’t I’m tempted to just release it and see what happens Nov 20 09:20:59 well now i have an onItemClick for a ListView but the context I am passing (defined in the parent activity) is being passed as null. Nov 20 09:40:41 argh, I just updated google keyboard and now my menu back button does nothing :( Nov 20 09:41:27 oh ok just temporary I guess Nov 20 09:47:10 God, Reddit's JSON responses are so bloated. Nov 20 09:47:21 They could easily cut them by 1/3 or so, I'd say. Nov 20 09:47:32 So much pointless metadata. Nov 20 09:47:48 I don't care! your app better be good! Nov 20 09:48:21 I am using sendEmptyMessageDelayed to send a message with a delay, and have a handleMessage method. But the same message keeps on being received... Nov 20 09:48:27 how do I fix this? Nov 20 09:49:20 by posting relevant code Nov 20 09:49:28 the context i use in my AdapterView.OnItemClickListener ALWAYS comes out null Nov 20 09:49:35 how can i possibly pass it a context? Nov 20 09:50:28 Napalm: ok, now i have more detail about my bug (yesterday) Nov 20 09:50:38 my friends have a parental control feature on his device ... Nov 20 09:50:57 no idea why my static content is detected though ... but it's not an android issue Nov 20 09:51:31 good too hear Nov 20 09:53:10 shmoooz: lol Nov 20 09:53:39 MyActivity.this does not work, is there absolutely no way to pass a context in an AdapterView.OnItemClickListener? Nov 20 09:53:41 MartialLaw: parent.getContact Nov 20 09:53:47 getContext Nov 20 09:54:22 that didn't work Nov 20 09:54:24 or view.getContext (second arguement) Nov 20 09:54:37 MartialLaw: is there a constructor anywhere ? Nov 20 09:54:55 i get this: Attempt to invoke virtual method 'boolean android.view.Window.hasFeature(int)' on a null object reference Nov 20 09:55:06 now, and it points to my startActivity(intent) Nov 20 09:55:45 are you doing this < 11 Nov 20 09:56:04 or Nov 20 09:56:06 can you post the code Nov 20 09:56:14 because if the context is null something else is wrong Nov 20 09:56:23 minSDK is 16, target 21 Nov 20 09:56:25 20 Nov 20 09:56:34 eg you can't have a view that is current without it having a context reference Nov 20 09:58:39 my context is not null until it enters onItemClick(.....) Nov 20 09:58:50 post ze code Nov 20 09:59:23 don't worry everyone will steal your genius code so it'll just improve the standard of coding and everyone will benefit. Nov 20 10:00:41 actually it is not null but when i startActivity(intent) it gives me Attempt to invoke virtual method 'boolean android.view.Window.hasFeature(int)' on a null object reference Nov 20 10:02:32 here: http://pastebin.com/gxy2u8FB Nov 20 10:02:53 Has anyone came across this issue so far? : "Error:compileSdkVersion android-21 requires compiling with JDK 7" Nov 20 10:03:03 in the onItemClick(...) where i start the intent is the issue Nov 20 10:03:23 napster, yes, many Nov 20 10:03:44 ravilov Has anyone fixed it in a way that works for many? :) Nov 20 10:03:55 upgrade your jdk? Nov 20 10:04:16 * napster is already on Java 8 Nov 20 10:04:22 from whence do you call blistParser? Nov 20 10:04:25 Java 8 u 25 Nov 20 10:04:32 jdk or jre? Nov 20 10:04:36 both Nov 20 10:04:48 then point your IDE to it? Nov 20 10:05:28 lasserix: it is called in an onPostExecute from an asynctask to populate the list with the grabbed results Nov 20 10:05:53 ravilov In AS, Preference > Compiler > Java Compiler, below use compiler, I have selected javac and the version is 1.8. Still not working. Nov 20 10:06:04 MartialLaw, the argumentless constructor (public BSActivity() { }) is pointless because it will (should) never be called Nov 20 10:06:17 ok then Nov 20 10:06:23 napster, dunno then Nov 20 10:06:25 is the async task toplevel or static inner class? Nov 20 10:06:30 ok Nov 20 10:07:07 toplevel Nov 20 10:07:10 so Nov 20 10:07:21 this wouldn't refer to the context Nov 20 10:07:25 it would refer to the async task Nov 20 10:07:28 hence the context is null Nov 20 10:07:48 you can verify it by using the debugger and see what the debugger points too for "this" Nov 20 10:07:58 oh i mean Nov 20 10:07:59 BSearchListAdapter adapter = new BSearchListAdapter(this, rowItems, inflater); Nov 20 10:08:08 * napster assumes the JDK location is different for Java 8 on mac. compared to Java 6 Nov 20 10:08:28 this is the async task (since it's top level) Nov 20 10:09:13 you'd need to pass in the context and then use it Nov 20 10:09:14 ah so the this is pointing to the async Nov 20 10:09:19 ah ok lets see Nov 20 10:09:19 probably Nov 20 10:09:50 im not sure but you shouldn't probably do all this junk in the async Nov 20 10:09:57 nevermind Nov 20 10:10:32 but you can verify it with debugger, just set a breakpoint there and look at the stack and see what this is refering too Nov 20 10:10:49 Ok, for all mac users, Java 8 jdk location is now /Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home Nov 20 10:11:12 http://paste.fedoraproject.org/152396/14164782 has all(?) the relevant code snippets & some diagnostic output showing repeated messages Nov 20 10:11:46 do you guys know about any libraries providing bindable properties for android? Nov 20 10:11:52 lasserix: i know...also that didn't work. still get the same error Nov 20 10:12:43 you mean like 78 is fired? Nov 20 10:12:47 *line Nov 20 10:13:21 ok now everything works. Thanks ravilov Nov 20 10:13:30 where is the async task? Nov 20 10:20:28 is there a possibility to automate sharing in my app? let's say my user gets a new highscore and shares it from within our app with a friend via an App of his choice (whatsapp, fb messenger, sms). my idea would be a checkbox he could tick that says: "always share with xyz when i have a new highscore". is this doable? Nov 20 10:21:20 yes Nov 20 10:22:59 ravilov, can you point me towards a tutorial, a documentation, stack overflow etc? Nov 20 10:24:25 ravilov, I am PMing you my work for today, I expect you to finish it within 5 hours or so, thanks in advance Nov 20 10:25:09 it's just that when i google it, i only find other stuff. keywords on what to look for would help Nov 20 10:30:35 VnM, no problem, I will just make sure my work is crappy as usual Nov 20 10:31:22 God, programming would be so hard without a revision-control thingy. Nov 20 10:32:01 I remember being a teenager and discovering programming. How did I cope? I have no idea. Nov 20 10:32:07 fancy42, in a nutshell: create your own intent picker ("complete with"), include a checkbox in it, then if checkbox is checked save the selected intent (in sharedprefs for example) before launching it Nov 20 10:33:20 ok, but i don't want to launch another app, i just want the text to be shared in the background Nov 20 10:33:25 * ravilov only ever uses version control at work, and only because more than one person works on the code, privately I am perfectly able to keep track and control of my code without it :p Nov 20 10:33:43 fancy42, I'm not sure what you mean Nov 20 10:33:44 How do you guys go about getting a unique persistan uuid for each app install? Nov 20 10:34:07 ravilov: No wai. Nov 20 10:34:36 How do you keep track of changes and keep backups? Nov 20 10:34:50 fancy42, you can't share anything via, say, whatsapp "in the background" Nov 20 10:35:02 Mrdarknezz, android system id (or whatever it's called)? Nov 20 10:35:08 ok this will probably be a big security issue: in the end i want my app to send i.e. a whatsapp or fb message without my user... asking for it? :D Nov 20 10:35:19 no can do Nov 20 10:35:41 makes sense :D Nov 20 10:36:31 TacticalJoke, yes way. I work on a single or at most a couple of functionalities at the time, when I'm done I always have at least a rough idea of what I've done, and when I'm happy with it I rsync the complete source to my home server as a backup Nov 20 10:37:31 if I'm always the only person that touches the code, I see no need for any version control, like I said I am perfectly capable of keeping track myself Nov 20 10:37:47 I sometimes have 10-20 branches going at once. Nov 20 10:37:54 we wanted our user to be able to share his progress independent of what kind of platform they're having and whether or not they have our app, too... Nov 20 10:38:13 I just can't see how someone could do any serious programming without a revision-control system. Nov 20 10:38:22 What happens if you're in the middle of adding a huge feature and you notice a bug? Nov 20 10:38:32 You wanna stop working on the feature to fix the bug. Nov 20 10:38:43 in other words, even when I do use version control, it is only to make it easier for multiple people to work on it, it is not for keeping track of changes Nov 20 10:40:07 What if your IDE changes one of your files and causes an issue? Nov 20 10:40:30 I am shocked that you do programming without an RCS. ;o Nov 20 10:40:57 TacticalJoke, depends, if I decide it'll be a quick fix I go ahead, it's easy enough to get back on track then; if not, I either postpone the bugfix until I'm done with the feature (if I'm almost done with the feature or if the bug isn't that serious/important), or I get on bugfixing immediately and then possibly lose some time when getting back to my feature Nov 20 10:41:13 But you can't fix the bug and release just the fix, right? Nov 20 10:41:26 You'd have to either release the fix and the not-yet-done changes or not release the fix till the future. Nov 20 10:41:32 I see nothing shocking about it, some people have full control over their source code, others might not and might need external help Nov 20 10:42:14 I would go so far as to say that serious programming is impossible wihout a revision-control system. Nov 20 10:42:26 You can do some things without it, but you're HUGELY limited. Nov 20 10:42:32 I also work in a completely different environment, with three staging steps before production/release Nov 20 10:42:56 TacticalJoke, that would be your view of it, doesn't mean it is correct Nov 20 10:43:18 I actually make a living out of this, so I guess how I'm doing it is working out for me Nov 20 10:43:21 It's a fact that you're hugely limited. Nov 20 10:43:28 uh, sure Nov 20 10:45:07 also, what kind of IDE just "changes stuff" out of nowhere? I would either reconfigure or ditch that IDE immediately Nov 20 10:45:13 Eclipse does. Nov 20 10:45:19 mine doesn't Nov 20 10:45:21 Visual Studio used to do it. Nov 20 10:45:25 I told it not to Nov 20 10:45:29 How would you know? Nov 20 10:45:29 :D Nov 20 10:45:34 You don't watch over your files for changes. Nov 20 10:45:44 because I don't look at my code just through eclipse Nov 20 10:46:10 I think every IDE I've ever used has annoyed me by changing files it shouldn't have at times. Nov 20 10:46:12 no, *you* don't, your version control system does it for you instead Nov 20 10:46:53 I actually *do* watch my files. what do you think "keeping track" and "keeping control over" means? Nov 20 10:47:16 Using revision control is just common sense. It's amazing that you deprive yourself here. Nov 20 10:47:26 trust me, my IDE has been set up to not ever do anything I'm not aware of Nov 20 10:47:32 And what if it has a bug? Nov 20 10:47:36 Such naivety. Nov 20 10:47:42 uhhuh Nov 20 10:48:07 well, I guess you know better, so no point in arguing Nov 20 10:48:57 In this case, yes. I know enough about programming and revision-control systems to say that someone doing serious programming without one is hugely, and pointlessly, limiting himself/herself. Nov 20 10:49:05 I'm pretty sure everyone in this channel would say the same. Nov 20 10:49:19 ok, sure Nov 20 10:49:26 you can believe that if you want Nov 20 10:49:56 hi Nov 20 10:50:29 Mercurial is a nice system, BTW. Highly recommended. Nov 20 10:50:39 The power of Git without the awful UI of Git. Nov 20 10:51:00 (notice I never said version control is useless or anthing, it is actually pretty cool and useful and definitely comes in handy at times, but crucial and mandatory? no.) Nov 20 10:51:06 * capella uses mercurial Nov 20 10:51:18 It's mandatory if you want to be *productive*. Nov 20 10:51:22 ravliov is stuck in the past Nov 20 10:51:24 generally speaking should you implements onRestoreInstanceState for every activity? Nov 20 10:51:25 eclipse Nov 20 10:51:28 no git Nov 20 10:51:30 ChrisUK: No. Nov 20 10:51:36 likes supporting 2.x Nov 20 10:51:47 lasserix, you are wrong there Nov 20 10:51:59 RVS is crucial and necessary Nov 20 10:52:01 I *use* 2.x but I like supporting 1.6 ;) Nov 20 10:52:07 oh yeah my mistake Nov 20 10:52:09 ;p Nov 20 10:52:19 tactical when would you not use that? Nov 20 10:52:29 (notice it's not 1.5 though :p ) Nov 20 10:52:31 ChrisUK: Use it only when you need to save stuff in onSaveInstanceState, which is not always. Nov 20 10:52:37 git as ui? Nov 20 10:52:41 *has Nov 20 10:52:46 (Or use the Bundle in onCreate.) Nov 20 10:52:54 lasserix: Yeah, the command-line UI. Nov 20 10:52:57 The CLI. Nov 20 10:52:59 ah Nov 20 10:53:00 tactical: what if the OS restarts your activity Nov 20 10:53:03 Mercurial is just better, if you ask me. Nov 20 10:53:06 and the members are invalid? Nov 20 10:53:18 ChrisUK: you'll have to have your state saved Nov 20 10:53:23 onPause is guarenteed to be called Nov 20 10:53:36 ChrisUK: Which data are we talking about? Nov 20 10:53:56 since it's a new instance, you don't have to worry about the old assignments, just make sure you have some way or knowing whether you are starting fresh or resuming (or this is a ux decision really) Nov 20 10:54:12 tactical: members of your activity Nov 20 10:54:17 Such as what? Nov 20 10:54:20 ChrisUK, you need to implement saving/restoring state when you have a need to save/restore state, it is just common sense and cannot be generalized like you seem to want to do Nov 20 10:54:23 say file name or settings Nov 20 10:55:09 Well, settings generally go into SharedPreferences, right? Nov 20 10:55:18 That's a global object which isn't saved with an Activity's state. Nov 20 10:55:39 ahem global? not so much, written to disssskk Nov 20 10:55:48 ok I am storing these in the activity as members Nov 20 10:55:58 I'd call it a global. Available in memory globally. Nov 20 10:56:00 Even if it's persisted. Nov 20 10:56:14 thats the whole thing its not in memory, its on disk Nov 20 10:56:30 and that's not a trivial distinction, since that's why you must call commit on your editor for it to write to disk Nov 20 10:56:31 lasserix: But it's in memory. :D Nov 20 10:56:43 well usually "in memory" means volatile memory Nov 20 10:56:49 In fact, apply() won't write to disk right away. But it will write to memory right away. Nov 20 10:56:54 disk storage is typically never considered "in memory" Nov 20 10:57:02 But it is in volatile memory. Nov 20 10:57:10 You don't read it from disk every time. It's stored and mutated in memory. Nov 20 10:57:18 Writing to disk is just for later persistence. Nov 20 10:57:23 restoring* Nov 20 10:57:35 oh someone told me it was xml file Nov 20 10:57:37 ok this probably isnt the best way of doing this then Nov 20 10:57:47 and when you call commit, you can tell it is writing to disk cause it takes too long Nov 20 10:57:52 to be a memory swap Nov 20 10:57:57 ChrisUK: Your activity should concern itself only with data that's intimately related to that particular activity. Nov 20 10:58:03 Everything else should be somewhere else. Nov 20 10:58:11 ok Nov 20 10:58:20 Nothing is where the Buddha sits. Nov 20 10:58:43 but if you activity has members that are needed if the OS restores your activity after it shuts it down Nov 20 10:58:54 This sums it up: "Unlike commit(), which writes its preferences out to persistent storage synchronously, apply() commits its changes to the in-memory SharedPreferences immediately but starts an asynchronous commit to disk and you won't be notified of any failures." Nov 20 10:58:54 you should put them in the bundle and saved them Nov 20 10:59:00 then you should read those and initialize again Nov 20 10:59:02 then reload in OnCreate? Nov 20 10:59:40 TacticalJoke: ahh thanks didn't know about that Nov 20 11:00:04 so sharedprefs are cached with a convience method that does an async disk write Nov 20 11:00:14 Right. Nov 20 11:00:30 lasserix, also just for the record, you (and many others) may call it "stuck in the past" or whatever, truth is I only use what works best for me, be it old or new, I don't care Nov 20 11:00:33 guess you could call that a global tn Nov 20 11:01:17 ChrisUK: If the data is closely related to my Activity and I want it to persist, I'll save it in onSaveInstanceState. If it's not related to my Activity and I want it to persist, I'll write it to disk manually. Nov 20 11:01:35 Unless I just want it to persist for as long as the process is around, in which case there's no need to write to disk. Nov 20 11:01:44 But keeping it away from the Activity does prevent it from going down on screen rotation and such. Nov 20 11:01:51 ravilov: i think its only because we've all been there, but then we adopted more useful things Nov 20 11:02:04 there's a lot more to git than just backups as tactical was saying Nov 20 11:02:05 Yeah, revision control is an absolute necessity. Nov 20 11:02:09 It's basically #1. Nov 20 11:02:15 like being able to solve a bug mid big change for instance Nov 20 11:02:17 I can't think of something more important unless we're including, like, the compiler. Nov 20 11:02:17 you say that as if to mean I've never tried anything newer Nov 20 11:02:26 ok thanks alot Nov 20 11:02:37 ravilov: Have you tried a new revision-control system such as Git or Mercurial? Just wondering. Nov 20 11:02:45 Because I could understand not wanting to use CVS or something. Nov 20 11:02:49 ravilov: what if you want to fuck around with a new idea in your code? Nov 20 11:02:56 being able to branch and play on a detached head Nov 20 11:03:02 and then merge it back in if you like it, Nov 20 11:03:07 Exactly, lasserix. Nov 20 11:03:10 It gives you enormous power. Nov 20 11:03:13 that's like essential editing power Nov 20 11:03:15 In like 1,000 ways. Nov 20 11:03:38 can you assume static final int values will be reinitialised when the activity is reactivated Nov 20 11:03:51 of course Nov 20 11:03:53 ChrisUK: They never change. lol Nov 20 11:03:58 They'll always have that value. Nov 20 11:03:59 unless you change them with reflection Nov 20 11:04:00 ok Nov 20 11:04:03 Oh, true. lol Nov 20 11:04:09 TacticalJoke, yes I have Nov 20 11:04:25 lasserix, I just go ahead? what's to stop me? Nov 20 11:04:34 was startic to worry I have to assume everything will just have to be reset Nov 20 11:04:34 ChrisUK: Note that static variables are *not* related to the activity life-cycle. Nov 20 11:04:38 TacticalJoke: there's a huge difference between trying something and knowing how to use Nov 20 11:04:46 They're bound by the process's life-cycle, I believe. Nov 20 11:04:51 lasserix: True. Nov 20 11:05:00 so the process will save them automatically for you? Nov 20 11:05:05 No. Nov 20 11:05:13 you can dabble in git and like go oh cool i can push and commit blah blah but that's not even scratching the surface Nov 20 11:05:14 But the process will often last longer than an activity. Nov 20 11:05:22 ok Nov 20 11:05:24 If you rotate the screen, by default, the current activity gets destroyed. Nov 20 11:05:27 But the process does not. Nov 20 11:05:28 ChrisUK: but a final static will -always- have that value Nov 20 11:05:38 ok Nov 20 11:05:45 Having said that, a process might be killed in some cases (e.g., running in the background for a long time). Nov 20 11:05:49 this whole destroying and recreating classes makes me a bit worried lol Nov 20 11:05:53 But it tends to last longer. Nov 20 11:06:02 and no, I would never say I know how to *use* hg or git, because the features it offered were never appealing enough to want to learn it; and it's not like I like to stick to old known stuff because I'm afraid or too lazy to learn new stuff, btw Nov 20 11:06:04 Yeah, it introduces complication, ChrisUK. Nov 20 11:06:07 adds an extra level of compexity Nov 20 11:06:09 But it's not too bad when you get used to it. Nov 20 11:06:10 Ribght. Nov 20 11:06:13 Right.* Nov 20 11:06:16 so as a beginner Nov 20 11:06:22 ChrisUK: like i said, if you have state you need to save, do something in onPause--it's the only callback on the destruction path that is guarenteed to be called Nov 20 11:06:43 lasserix: Or onSaveInstanceState, if he wants it in that Bundle. :) Nov 20 11:06:45 if I just implement onRestoreInstanceState and OnCreate correctly for all variables I will probably be ok? Nov 20 11:06:54 lasserix, just wondering, is onPause called even in the event of kill -9? Nov 20 11:06:57 Like, if it's just "we need to restore this" stuff. Nov 20 11:06:57 onSave is not guarenteed to be called Nov 20 11:07:03 ravilov: yeah i believe it is Nov 20 11:07:13 that is kind of hard to believe tbh Nov 20 11:07:15 easy enough to test anyways Nov 20 11:07:16 Yeah, but it'll be called if the activity is going down for recreation. Nov 20 11:07:22 true that, might do it Nov 20 11:07:36 good interview question Nov 20 11:07:42 I did think OnPause and OnResume would be better to store and restore state Nov 20 11:07:43 (-9 is a non-catcheable signal btw) Nov 20 11:07:52 but I dont have a bundle object in those Nov 20 11:08:16 I doubt a process-kill will entail onPause being called. Nov 20 11:08:25 http://i.imgur.com/pNF0kJm.png Nov 20 11:08:31 ChrisUK: Not for the Bundle thing. Nov 20 11:08:38 onPause is good for saving stuff such as databases. Nov 20 11:08:43 ChrisUK: if you do, you might want to implement a isDirty flag Nov 20 11:08:51 onSaveInstanceState is perfect for stuff that you just wanna restore when the activity comes back up. Nov 20 11:08:55 and definatly do whatever saving off the UI thread since you don't want to Nov 20 11:09:02 block while exiting the app Nov 20 11:09:17 *if its more than just a few lines so to speak Nov 20 11:09:59 ChrisUK: Note that the framework saves some stuff for you, such as the text and selection of an EditText. Nov 20 11:10:16 I did read that the UI is resoted Nov 20 11:10:18 You often don't need to worry about saving anything. Depends on the activity and so on. Nov 20 11:10:20 restored for you Nov 20 11:10:24 like listbox position etc etc Nov 20 11:10:28 Yeah. Nov 20 11:10:33 ListBox. :D Nov 20 11:10:37 Nostalgic. Nov 20 11:11:24 ListView sorry lol Nov 20 11:11:55 Have you done a lot of programming in the past, ChrisUK? Just curiuos Nov 20 11:11:57 curious.* Nov 20 11:12:01 I need to cut my nails. ;| Nov 20 11:12:02 yes a while ago Nov 20 11:12:05 K. Nov 20 11:12:08 mainly C++ on windows Nov 20 11:12:12 C/C++ with win32 Nov 20 11:12:18 Did you use MFC? Nov 20 11:12:24 God, I hated MFC with a passion. Nov 20 11:12:25 a bit but more win32 Nov 20 11:12:32 and WTL Nov 20 11:12:38 Same here. I chose the naked Win32 API over MFC. Nov 20 11:12:51 I got back into programming recently Nov 20 11:12:59 because I was interested in the google cardboard project Nov 20 11:13:36 your win32 must come in really handy now, right? lol Nov 20 11:13:42 win32 experience* Nov 20 11:13:56 well not really Nov 20 11:14:07 :) Nov 20 11:14:19 although to a certain extent programming is programming Nov 20 11:14:48 TacticalJoke, you'd have plenty of time to deal with such personal stuff if you weren't too busy dealing with commits/pushes/pulls/clones/whatever :p Nov 20 11:15:04 The revision-control system makes me way less busy. Nov 20 11:15:06 is anyone else here interested in google cardboard and android VR? Nov 20 11:15:07 It just makes everything easier. Nov 20 11:15:13 You should try Mercurial. Seriously. Nov 20 11:15:17 Like, properly try. Nov 20 11:15:27 I often work on 20 branches at once. Nov 20 11:15:29 TacticalJoke, like I said, I have. not appealing. Nov 20 11:15:52 ChrisUK, yes but from what I've seen programming for some certain platforms can often times taint your mindset for life Nov 20 11:15:53 I could be fixing three bugs while working on 17 features. Nov 20 11:15:59 Imagine trying to do that with copy-and-paste. Nov 20 11:16:09 ravilov: well that is true Nov 20 11:16:10 Some of my features take months to implement; others, hours. Nov 20 11:16:21 You basically have *one* branch. Nov 20 11:16:24 Like a thread pool that has a single thread. Nov 20 11:16:27 I have made some mistakes on android because I try to just apply what I know Nov 20 11:16:34 and assume I know how android is working Nov 20 11:16:36 Every other task blocks while *one* thing is done. Nov 20 11:16:39 That's not efficient at all. Nov 20 11:17:02 TacticalJoke: you must have a lot of keyboards, to be working on those 20 things at the same time? Nov 20 11:17:03 If you're working on a feature that takes three months to implement, your entire development has to stop, right? Nov 20 11:17:05 Waiting three months. Nov 20 11:17:13 TacticalJoke, you are obviously too closed-minded to accept even the possibilty of anything else working just as well as what you have. that's okay, I'm done arguing, it's getting pointless. Nov 20 11:17:24 It's not being closed-minded. Nov 20 11:17:28 if you access the intent in your onCreate Nov 20 11:17:32 It's simply a fact that you're hugely limiting yourself. Nov 20 11:17:45 can you assume it will be there when the activity is recreated after shut down? Nov 20 11:17:52 yeah, people like to call all kinds of things "facts" Nov 20 11:18:04 Well, good luck with your one-task-at-a-time workflow. Nov 20 11:18:21 ChrisUK, yes, the initial intent will always be there Nov 20 11:18:29 Anyone using a revision-control system can fix any bug, in any version, at any time. And then release. Nov 20 11:18:33 now if you change it later with setIntent, I'm not sure if that will stick Nov 20 11:18:40 And not interrupt their three-month feature work. Nov 20 11:19:48 ravilov: I think if you have programming experience on any platform it helps you with another platform Nov 20 11:20:04 it's not so much the experience that helps Nov 20 11:20:06 there is alot of common concepts even when you go from win32 to android Nov 20 11:20:06 One strong analogy between Windows and Android is, I think, the message queue. Nov 20 11:20:16 Also the obvious stuff such as widgets. Nov 20 11:20:18 it's the mindset and simply being able to think like a programmer Nov 20 11:20:38 but it can make you over confident and you just think you can do android programming with what you know and a bit of java Nov 20 11:20:38 :) Nov 20 11:21:23 if you have the proper mindset, there is simply no chance of "overconfidence", because that same mindset *will* get you through, one way or another Nov 20 11:21:55 it's just being able to think and assemble/visualize information in a structured and systematic way Nov 20 11:24:26 <_flip> Hi guys. I've got an async task that updates my dataset (for RecyclerView adapter). It crashes some times because I call notifyDatasetChanged while the RecyclerView is "computing a layout or scrolling" Nov 20 11:24:39 <_flip> any ideas how i can make it NOT crash? Nov 20 11:24:54 ravilov: what did you develop on before android? Nov 20 11:25:18 Umm, shouldn't you be calling notifyDataSetChanged in the main thread only? Nov 20 11:25:20 what do you mean, did? I still work on multitude of platforms/languages Nov 20 11:26:08 I've even touched win32 long time ago :p Nov 20 11:26:11 ahh with all tabbing i can stay deeply nested in this snuggie Nov 20 11:26:32 what about voice control/recognition? Nov 20 11:26:38 way too slow Nov 20 11:26:45 and only if i could subvocalizer Nov 20 11:27:04 <_flip> TacticalJoke, I call it onPostExecute - that should be OK, right? Nov 20 11:27:05 that's the real problem with vc/recog Nov 20 11:27:19 it should all be subvocal or camera tracked, not require volume Nov 20 11:27:32 ok, then mind control Nov 20 11:27:36 complete with a tinfoil hat Nov 20 11:27:58 actually MIT students showed that tinfoil hats actually amplify your brain waves Nov 20 11:28:03 Yeah, onPostExecute runs in the main thread. Nov 20 11:28:11 "amplify" --> easier to scan for Nov 20 11:28:38 so in terms of "hacking one's mind" it might actually help? Nov 20 11:28:49 _flip: I dunno; try googling maybe. Nov 20 11:28:50 (in protecting the mind, not in hacking it) Nov 20 11:28:53 well, Nov 20 11:28:55 I haven't used RecyclerView yet. Nov 20 11:29:22 what was it? i think it was that the tinfoil hat acts as an amplifier for your brain waves if you were trying to read them with say a radar gun Nov 20 11:30:01 yeah but I'm not talking about reading, I'm talking about *writing*, ie. influencing Nov 20 11:30:39 would it help? I mean even if it doesn't deflect some mind control device, it at least amplifies my own waves, making it more difficult for me to get hacked Nov 20 11:30:56 similar to outlouding a guy with a bullhorn Nov 20 11:33:58 Is there a difference between in app payment via credit card or via paypal? Nov 20 11:34:22 can you write to perception and cognitive thinking by blasting the brain with waves? haven't ever heard of that, usually writing/encoding is endogenous/biofeedback type of deal Nov 20 11:34:24 yes? Nov 20 11:34:29 Syzygy, ^ Nov 20 11:34:51 ravilov, isn't it abstracted by the google payment system? Nov 20 11:35:35 lasserix, dunno, I don't believe in it personally, all I know is, certain kind of wackos like to wear tinfoil hats in order to protect themselves from alien mindreading/mindwriting powers Nov 20 11:35:43 hello Nov 20 11:35:56 Syzygy, I don't know about the API to be honest, I was talking about the user end, lol Nov 20 11:35:57 whats the easiest way to prompt a user for his location? Nov 20 11:36:18 it is much different to me if I have to pay with paypal username/password or by entering my credit card number somewhere Nov 20 11:36:19 magnets is where its at, not tinfoil hats ;p Nov 20 11:36:29 lasserix, tell it to them :p Nov 20 11:36:55 pellis, textfield with online lookup Nov 20 11:37:02 and uh the mindreading stuff isn't actually so far off, Nov 20 11:37:10 some scientists have been able to visualize dreams Nov 20 11:37:13 ravilov: what about starting a map activity and letting the user pick location from the map? Nov 20 11:37:14 I know Nov 20 11:37:20 others can anticipates thought patterns, etc etc Nov 20 11:37:29 lasserix, in theory you can, and minds can be affected by targeting and triggering brain activity via non invasive means Nov 20 11:37:35 pellis, certainly possible, you asked for the easiest way though Nov 20 11:37:35 good thing the brain is of degree 5 or greater and linearly unsolvable Nov 20 11:38:21 ravilov: i see.. i think online lookup will be harder, no? (i've never done that on android). I figured if there's a way to "send" a user to google maps and then retreive what he selected there Nov 20 11:38:25 ravilov: is there such a way? Nov 20 11:38:34 ahh this is the kind of conversation that happens after a day of sitting behind a moniter, time to take a break Nov 20 11:38:51 startActivityForResult Nov 20 11:39:21 lasserix: so startActivityForResult with a map activity? Nov 20 11:39:41 dunno if it works like that but yeah that is the standard way to start another app for some data Nov 20 11:39:49 pellis, well, you certainly can just start a map fragment and get the user location Nov 20 11:39:51 another app -- not just another activity Nov 20 11:40:16 i think its not possible to start the google maps app and get result from it Nov 20 11:40:21 looking at this http://stackoverflow.com/questions/12021377/startactivityforresult-to-get-user-entered-location-on-map Nov 20 11:40:46 pellis, you can include maps in your app, you might need an api key though Nov 20 11:40:57 to include maps you do need api key Nov 20 11:41:06 hmm. now im starting to think back to the online lookup thing ravilov suggested. Nov 20 11:41:17 thats terrible Nov 20 11:41:54 you mean you want the user to have to open chrome, do some shit in the horrible ux of the mobile browser just to use your app? Nov 20 11:42:12 Survey time: "Util" or "Utils"? Nov 20 11:42:16 I guess Android tends to use the latter naming style. Nov 20 11:42:33 pellis, you can also access the users location service Nov 20 11:43:12 Syzygy: yes i did but sometimes the user would like to set another location. think about world clocks or weather. when I'd like to change location just to check what's going on in another country Nov 20 11:46:17 well, a map fragment would be the smartest way. you can let him enter an address and use the geocoder to get longitude and latitude as well as other infos you might need Nov 20 11:46:40 with the mapfragment the user would just have to click it though, so that's faster Nov 20 11:46:51 or might be faster at least Nov 20 11:47:38 Hey guys, I have a backstack problem: in my app you can navigate a few screens in and then choose to log out, logging out will bring you back to the sign in page Nov 20 11:47:58 but if you hit back, you will end up on the page before the one with the sign out button Nov 20 11:48:27 override on back pressed Nov 20 11:48:28 can I clear my app completely from the activity backstack after launching my login screen? Nov 20 11:48:31 verify they want to log out Nov 20 11:49:36 Home=>Settings=>Logout=>Login<=Home Nov 20 11:49:45 make your app crash if they press back, by dereferencing null :p Nov 20 11:49:57 ravilov: genius Nov 20 11:51:59 boolean bool = (boolean) null; should do it, right? Nov 20 11:54:02 nah, the compiler will catch that Nov 20 11:55:16 I wonder whether apps that insult the user are against the rules. Nov 20 11:55:43 what rules? Nov 20 11:56:00 well Nov 20 11:56:18 "Noob, ask for a refund already" wouldprobably get pulled Nov 20 11:56:22 but Nov 20 11:56:54 "This app is a pile of floating shit you hold in your head" in small, french text underneath a neat looking logo wouldn't proibably get pulled Nov 20 11:57:00 all about delivery Nov 20 11:57:19 that's an insult of your app, not the user Nov 20 11:57:36 think about it some more rav Nov 20 11:57:51 ...oh head Nov 20 11:57:53 not hand Nov 20 11:57:53 Boolean bool = (Boolean) null; bool.toString(); Nov 20 11:58:00 there you go Nov 20 11:58:00 i meant hand but same thing ;p Nov 20 11:58:23 ((Object) null).toString(); Nov 20 11:58:38 what if my app was in fact some sort of insult generator, and it just so happens it has the "insult me" option? Nov 20 11:58:53 thats entertainment Nov 20 11:58:54 TacticalJoke: nice Nov 20 11:59:05 lasserix, technically I'm insulting the user though Nov 20 11:59:09 what's the best approach for make something like this: http://i.imgur.com/Vttb88F.png (Android People App KITKAT) - Should i use a listview or linearlayout to inflate view rows? Nov 20 11:59:15 How about an app that threatens the user? "I'm gonna find you." Nov 20 11:59:19 technically you are entetaining them with insults Nov 20 11:59:52 TacticalJoke, would it say that after it asks you to pinpoint your location and you do it? Nov 20 11:59:56 Isn't that a LinearLayout thingamijig, yuriheupa? Nov 20 12:00:04 ravilov: lol Nov 20 12:00:41 yuriheupa, looks like tableview to me, in any case fairly trivial Nov 20 12:00:59 mmm ok Nov 20 12:01:34 lasserix, I wonder whether apps that insult the user are against the rules. <-- says nothing about users *asking* for it :p Nov 20 12:02:37 What about an app that crashes at random? Nov 20 12:02:52 if (new Random().next(500) == 1) { throw new ApplicationException(); } Nov 20 12:02:57 Would that classify as malware or something? Nov 20 12:03:19 nextInt* Nov 20 12:03:34 And that should probably be 0. Nov 20 12:04:02 the money manager app - if your balance hits 0, the app crashes Nov 20 12:04:08 what better way of saying you're screwed Nov 20 12:04:14 RuntimeException (my brain has stopped working tonight) Nov 20 12:04:39 i want to reproduce the editing rows behavior of people app, i'm inflating views to a linearlayout > http://i.imgur.com/fUX7TME.png Nov 20 12:05:07 ok? Nov 20 12:05:12 so do it then Nov 20 12:05:17 but it dont looks the best approach to me Nov 20 12:05:34 ok Nov 20 12:05:45 you were already given opinions, weren't you? Nov 20 12:05:49 should i use a tableview to better manage the rows? Nov 20 12:07:38 you should do whateve you decide to do Nov 20 12:08:04 you might want to *try* that approach though, but it's all up to you Nov 20 12:08:12 in the end* Nov 20 12:09:05 the problem is i want to use an listadpter, but linearlayout dont implement adapters Nov 20 12:09:20 i need to manage the rows by self Nov 20 12:10:29 each row reprents a model object, when i made changes to the view it reflects to the model, using adapter make easier to manage this, but i cant use it Nov 20 12:11:11 you can adapt the behavior of listview too if you want Nov 20 12:18:05 Hey has anyone had issues with dex2oat failing with the error line 1181: CHECK(!method->IsAbstract()); Nov 20 12:18:22 or can generally point me at resources for getting my apk working with ART Nov 20 12:19:35 some form of debugging mode would be helpful, to tell me what it's failing to compile so I can tweak and experiment with it Nov 20 12:47:47 Let's say that I have two classes: Parent and Child. Child extends Parent. Nov 20 12:47:52 Parent defines a foo method; Child overrides it. Nov 20 12:48:12 Does it make sense for Child.foo to throw an exception (an unchecked exception) that Parent.foo does *not* throw? Nov 20 12:48:21 Does this violate the Liskov Substitution Principle? Nov 20 12:49:04 Apparently it does: "No new exceptions should be thrown by methods of the subtype, except where those exceptions are themselves subtypes of exceptions thrown by the methods of the supertype." Nov 20 12:49:06 http://en.wikipedia.org/wiki/Liskov_substitution_principle Nov 20 12:50:22 TacticalJoke, perhaps a better place would be ##java ? Nov 20 13:22:37 is there a way to test google plays in app billing with paypal? Nov 20 13:30:33 Blah. Nov 20 13:30:42 I have code duplication and it's basically impossible to get rid of it. Nov 20 13:30:46 Because of Runnable. Nov 20 13:30:59 If I get rid of it, I violate the Liskov Substitution Principle. Nov 20 13:31:02 And make my code horrible. Nov 20 13:37:59 code duplication is an optimization technique ;) Nov 20 13:38:10 roll out your for loops Nov 20 13:38:19 :D Nov 20 13:38:37 in logcat what does "([BLjava/lang/String;I)V" mean? thats at the end of a exception my app is causing Nov 20 13:40:08 To be fair, there is only slight duplication. Nov 20 13:40:18 Hence (I guess) the impossibility to get rid of it. Nov 20 13:40:41 I440r: That doesn't look familiar. Nov 20 13:40:49 java.lang.UnsatisfiedLinkError: Native method not found: com.mimiv.naf.naf.NAFCopy:([BLjava/lang/String;I)V <-- thats the whole error Nov 20 13:40:50 What's the rest of the exception message? Nov 20 13:40:52 Oh. Nov 20 13:41:02 same error as before but on a different emulator which gave me that last part Nov 20 13:41:04 No idea. Never done native stuff. Nov 20 13:41:31 well its just the last part i cant read. is there some sort of documetation on logcat that might explain it? Nov 20 13:42:05 why is it calling out java/lang/string for example Nov 20 13:42:09 I440r: it's the type of something Nov 20 13:42:18 java.lang.String Nov 20 13:42:21 and what does the :I mean and what is the V bit? Nov 20 13:42:22 [B is an array of bytes Nov 20 13:42:38 It's the full name of the String class. Nov 20 13:42:45 and the L? and the V at the end? Nov 20 13:42:49 who can help navi drawer and fragment Nov 20 13:42:54 Those are just smileys. Nov 20 13:42:58 (Just kidding.) Nov 20 13:44:03 ok so NAFCopy is NAFCopy(byte[] dst, String src, int len) Nov 20 13:44:36 I think that's what your log message is saying Nov 20 13:44:37 with JNI when you get the error im getting its usually because of either a JNI function misnaming or a prototype error Nov 20 13:44:56 so is it saying it cannot find an instance of NAFCopy that is looking for a string? Nov 20 13:44:56 [B is byte[], Ljava...String is the String, I is the integer Nov 20 13:45:09 aha Nov 20 13:45:41 ok that explains the logcat Nov 20 13:45:48 it still does not explain the error. Nov 20 13:46:02 and i think the V is something about the method type, v... virtual? Nov 20 13:46:13 i mean... the function exists. its name is correct according to javah and the prototype is also correct Nov 20 13:46:28 im calling NAFCopy(a, b, c) where a b and c are the right types Nov 20 13:46:31 can you call some other function in that native lib Nov 20 13:46:41 i can call every other function in it Nov 20 13:47:27 oh, the V might be return type void. Not that it helps at all Nov 20 13:47:38 yea it is void Nov 20 13:48:03 it does help, it helps me understand the logcat messages better Nov 20 13:48:05 :) Nov 20 13:49:55 yeah, and the log message says you're calling with the types you expect. The only thing I can think is that isn't how it's actually defined Nov 20 13:50:01 is this a public library or something internal Nov 20 13:50:02 ? Nov 20 13:50:19 i have a package called com.mimiv.naf. in this i have a class called naf. one of the methods in that is called copy. so i can call naf.copy(...) which is a gateway into the native function NAFCopy(...) Nov 20 13:50:31 its a native android forth library i wrote Nov 20 13:50:57 the forth works. the breakage is because i had code in my library that was specific to ONE use case Nov 20 13:51:06 i.e. the game im writing that uses the library Nov 20 13:51:20 the game should have knowledge of the library but the library should not have knowledge of the game Nov 20 13:51:41 naf.copy is a new method im using to break that association Nov 20 13:51:43 Okay, lesson learned today: if it's impossible to remove duplication from your code, that might mean there isn't actually any duplication. Nov 20 13:51:59 I spent about 30 minutes extracting classes and stuff. Nov 20 13:52:43 i guess ill paste the code. this java wrapper and the C wrapper to the forth functions arent that top secret Nov 20 13:52:47 what color determines the background of the listview when there are not enough elements to completely fill it? Nov 20 13:53:08 Isn't it transparent? Nov 20 13:53:17 Not sure. Nov 20 13:53:32 what is the compile sdk you people are using for app publishing these days. api 19/20/21 ? Nov 20 13:53:45 21. Nov 20 13:53:50 Always the latest. Nov 20 13:54:07 TacticalJoke: build tool v 20 ? Nov 20 13:54:29 The latest major version, I think. Whatever that is. Nov 20 13:54:40 ok Nov 20 13:54:48 the view it was in was resizing lol Nov 20 13:56:40 got it Nov 20 13:56:41 http://pastebin.com/UrmxFUdT Nov 20 13:56:45 this shows the offending code Nov 20 13:57:03 it shows the JNI C code and the java wrapper that calls it Nov 20 13:57:48 i can reference naf.copy() in my game and i know it works because i can log.d from there. its the call to NAFCopy that is failing Nov 20 13:57:56 and i cant see why Nov 20 13:59:41 can anyone see a reason why the call to NAFCopy() fails? Nov 20 14:00:07 i objdump the library and Java_com_mimiv_naf_naf_NAFCopy is in there Nov 20 14:00:17 yet at run time its not there Nov 20 14:00:52 its almost as if the JNIEXPORT is not happening Nov 20 14:04:50 anyone? Nov 20 14:05:04 Hi, i want to store some data on the "cloud" which my app can read. Which "API" of google apps engine is the correct one to use? (The writing can be done outside the app too) Nov 20 14:05:25 (ideally the data would be a serialized java object or an XML Nov 20 14:05:33 anyone know where to get a list of android device names like this: https://storage.googleapis.com/support-kms-prod/86F10623D45D7F7A7801EA401300D7E9818B but in a better format to import into a database? Nov 20 14:06:36 Candy Crush Saga: "I don't think you're ready for this jelly." Nov 20 14:09:20 is there something wrong with the C functions prototype? is it saying it cannot find a function thats expecging the specified data types as parameters? Nov 20 14:12:44 not many people in here working with JNI/NDK Nov 20 14:13:02 i know Nov 20 14:13:46 I440r: did you get around to generating headers with javah this time? Even if you don't want to USE the generated code, at least compare them? Nov 20 14:14:20 yes Nov 20 14:14:26 And they match? Nov 20 14:14:29 yes Nov 20 14:14:38 i verified by cutting and pasting Nov 20 14:14:51 replacing what i have typed with what javah gave Nov 20 14:15:22 Can you pastebin the complete stacktrace? Nov 20 14:16:21 http://pastebin.com/xBTPeP3U is this enough? Nov 20 14:18:37 wait. why is it looking for com.mimiv.naf.naf.NAFCopy instead of com_mimiv_.. .. Nov 20 14:18:56 I'm pretty sure that's just the JVMs internal translation for package names Nov 20 14:18:58 Hi guys, for the GradientDrawable rounded corners, it is asking for a float value. But it is not specified if the float value represents pixel value or dp value Nov 20 14:20:08 Sorry, what I meant to say was that it represents the pixel value. Is it possible to specify a dp value Nov 20 14:20:24 what does the method look like in objdump? Nov 20 14:20:37 I don't think so, pangelovski. Nov 20 14:20:42 Check Google. Nov 20 14:20:47 But I think you can't. Nov 20 14:21:19 TacticalJoke: what im trying to retrieve is a create a function for setting the corner radius in dp, and the setting the background seperately Nov 20 14:22:18 this bug kills any further development on this game :/ Nov 20 14:22:31 The gradient thing isn't very well made. Some of the values are in pixels. Nov 20 14:22:35 i cant see why its link failuer at all Nov 20 14:22:35 And you can't even use dimens.xml. Nov 20 14:23:20 I440r: can you pastebin the full C source file and the full java source file? I'd like to look at it with a little more context. JNI errors are often trivial naming errors, but I don't think I can spot them from this small extract Nov 20 14:23:39 so i need to create a shape containing radius, bgcolor for each button that has different background? Nov 20 14:24:08 No one an idea? basically i just need some tiny storage (1MB~). I feel the GCS is an overkill - is there something else? Nov 20 14:25:34 ktwo: can't you store in the user's gdrive? Nov 20 14:27:11 http://pastebin.com/d7WqVpjp Nov 20 14:27:29 sonOfRa, thats both files i marked where the second file starts Nov 20 14:28:33 i skipped part of the first file, its being removed from there and when its removed the asset manager stuff will go to so ignore the asset manager stuff Nov 20 14:31:23 naf.init, naf.eval are both called prior to the call to naf.copy. they work. im not currently using naf.exec anywhere in my java code but i tested it and it works Nov 20 14:31:50 naf.copy does not work Nov 20 14:32:33 I440r: JNIEXPORT jint JNICALL Java_com_mimiv_naf_naf_NAFCopy( Nov 20 14:32:40 this is wrong, the method returns void, not jint Nov 20 14:33:05 oh. that was an experiment i added a return 0 but when i deleted it i forgot to remove that Nov 20 14:33:16 setting it to void does not fix the problem Nov 20 14:33:30 https://gist.github.com/sonOfRa/2476a87441a3b8fe7a22 I generated the header myself, I replaced AssetManager with String so I don't run into classpath problems Nov 20 14:33:35 Leeds, ive thought about that, do you think google is against it? or does it violate the TOS? Nov 20 14:34:35 Also, the next issue is that the URLs (the direct ones without html code) for a file seem to "expire" Nov 20 14:34:44 which would make it hard to hardcode into an app Nov 20 14:35:19 TacticalJoke:I solved it by creating a function that takes floatValue (px) and theres a function where you can get the density. so i multiply the px value with the density and get the radius in dp Nov 20 14:35:26 java.lang.UnsatisfiedLinkError: Native method not found: com.mimiv.naf.naf.NAFCopy:([BLjava/lang/String;I)V this indicates you didn't have the method. Are you sure it doesn't work when you change the return type back to void? Nov 20 14:35:45 changed it back to void, rebuilt and reran in emu... same error Nov 20 14:36:07 pangelovski: Oh, cool. Nov 20 14:36:21 For sanity's sake, have you completely removed the app from the device, rebuilt again, and deployed a completely new version (after cleaning your workspace) Nov 20 14:36:33 I am eating chocolate. Nov 20 14:36:35 erm. let me try that Nov 20 14:36:45 ktwo: there is explicit support for apps to store their data in gdrive Nov 20 14:38:19 ah ok this seems to be what im after: https://github.com/googledrive/android-querying thx Nov 20 14:38:26 If your signature for NAFCopy matches that in my gist, it should definitely not result in a linkage error Nov 20 14:38:28 https://developers.google.com/drive/android/appfolder Nov 20 14:39:27 which is why ive been calling this as a bug in either java or android somewhere, not my code Nov 20 14:40:09 mhh maybe not, it seems to be how an app can save and read from the user's gapp, but not mine (i want to upload a file to MY drive and then read it from android) Nov 20 14:40:32 which should be easy if the links of files wouldnt get invalid after while Nov 20 14:40:37 (the raw ones) Nov 20 14:40:58 I've struggled with similar things in jni before, it was /always/ a programming error so far Nov 20 14:41:06 I440r, what's your problem Nov 20 14:41:13 sometimes I took weeks to find them, but in the end they all turned out to be my fault Nov 20 14:41:14 I'm too lazy to read all of the backlog Nov 20 14:41:24 zharf jni error. Nov 20 14:41:31 where none should exist Nov 20 14:41:31 I440r, summarize Nov 20 14:41:50 you're doing it wrong Nov 20 14:42:19 what's the error? Nov 20 14:42:23 i have a native android forth lib. i have a C wrapper to the asm forth functions. i have a java wrapper that calls the C wrappers. all but ONE of them work perfectly Nov 20 14:42:29 java.lang.UnsatisfiedLinkError: Nov 20 14:42:58 i pasted the code link above Nov 20 14:43:40 Oh well, I hope you can find the solution, I've got to run. Good luck! Nov 20 14:43:43 i think this is a java bug in the version of java i have Nov 20 14:43:46 sonOfRa, ty Nov 20 14:44:08 the pastebin link doesn't explain the error Nov 20 14:44:09 or maybe android is not compatible with the version of java 7 i have installed Nov 20 14:44:21 nothing explains the error Nov 20 14:44:38 java.lang.UnsatisfiedLinkError: Native method not found: com.mimiv.naf.naf.NAFCopy:([BLjava/lang/String;I)V Nov 20 14:44:41 ... you're useless, stop avoiding the problem Nov 20 14:45:00 im NOT avoiding the problem Nov 20 14:45:14 ive been hacking on this for two days Nov 20 14:45:43 i have no idea why the fuck this ONE jni call is failing when all the others in the pasted code work flawlessly Nov 20 14:45:56 NOTHING explains this problem Nov 20 14:46:09 if your so fucking good show me where i fucked up Nov 20 14:46:39 sorry Nov 20 14:46:44 well if you'd keep your exceptions up-to-date, you'd have a better chance of finding it out Nov 20 14:46:45 im getting frustrated with it now Nov 20 14:46:54 you say you fixed the void vs. int problem... but that exception still shows it Nov 20 14:46:58 keep my exceptions up to daate? Nov 20 14:47:18 it was an experiment. i made the void function return an int Nov 20 14:47:28 changed everything that needed to chage to affect that Nov 20 14:47:44 undid all those changes but left the jint return in there by accident Nov 20 14:48:14 com.mimiv.naf.naf.NAFCopy:([BLjava/lang/String;I)V <-- does not the V on the end specify a void return? Nov 20 14:48:30 yes, but your in your paste doesn't reflect that Nov 20 14:49:03 yes i know. forget the jint its void and i still have exactly the same problem Nov 20 14:49:34 it was a do followed by a 99% undo Nov 20 14:49:53 i finished the undo now. the function is prototyped void Nov 20 14:50:34 did you try javah to create the function prototypes Nov 20 14:50:38 there are only two reasons why that link error would happen. im trying to call a function that expects different parameters or im trying to call a function that is named wrong Nov 20 14:50:41 yes i used javah Nov 20 14:51:16 and there was no difference between what javah gave me and what i had other than every functions second parameter was jobject obj and should have been jclass cls Nov 20 14:51:39 everything still worked with a wrong parameter 2 except this one function which still didnt work after correcting parameter 2 Nov 20 14:51:52 jobject vs. jclass doesn't really matter when using C compiler Nov 20 14:51:58 nope Nov 20 14:52:54 so i have a function that returns the expected value (void) and expects the correct parameters and which is named right yet is STILL an unsatisfied link error at run time when nothing else in that file is Nov 20 14:53:18 tell me this does not sound like a java bug or an android bug Nov 20 14:55:18 it doesn't Nov 20 14:56:05 then where did i fuck up Nov 20 14:57:16 hi. when using strings from XML is it possible to get the locations of tokens to be inserted into the string? ie the location of “%1$s” Nov 20 14:57:23 ive pasted the sources, where is my error Nov 20 14:58:17 (and android-y way I mean, of course i can just do simple string matching) Nov 20 14:59:01 or tell me why you think this is not some java/android bug Nov 20 14:59:13 other than because im "fucking useless" Nov 20 15:01:29 right, thats what i thought Nov 20 15:01:31 I440r, try adding JNI_OnLoad function... I'm not sure but it might default to some older JNI version that doesn't work the way you expect... Nov 20 15:01:45 i HAVE a jni onload function Nov 20 15:01:49 its not in the C wrapper Nov 20 15:01:51 I440r, also, stop assuming I have the answers without investigating, you're being a fucking retard about this Nov 20 15:01:53 its in the Forth assembler code Nov 20 15:02:16 well, also paste all the fucking relevant code, make a working test case Nov 20 15:02:21 stop being a bitch Nov 20 15:02:27 im not pasting the entire fucking library Nov 20 15:02:35 and the only sob i see here is you Nov 20 15:02:43 I don't want you to, I want you to reproduce the problem in a single contained testcase Nov 20 15:02:47 learn what a test case is Nov 20 15:02:49 nobody else here is calling anyone else a fucking retard Nov 20 15:03:00 http://eel.is/iso-c++/testcase/ Nov 20 15:04:31 Can we stop swearing now? Nov 20 15:04:35 no Nov 20 15:04:36 :) Nov 20 15:05:39 let me just go have a look at our JNI layer. i think we have statics too Nov 20 15:06:09 I would just use RegisterNatives instead of that crappy javah function signature thingie Nov 20 15:06:51 I440r: could you restate your problem please? i can’t see it for the noise :) Nov 20 15:07:26 samskiter, jni c functions in one file. java wrappers in another. all java wrappers are able to call all c native functions except one. Nov 20 15:07:47 there is nothing anyone can point to that says why that one call fails with a run time link error Nov 20 15:08:02 which one doesn’t work. NAFCopY? Nov 20 15:08:09 yup Nov 20 15:08:57 because your testcase isn't complete, there's incorrect information there and it's not compilable to demonstrate the problem... it's impossible to just "see" it as you've clearly demonstrated Nov 20 15:09:39 you want me to re paste that one file showing i changed the jint return type to void like its supposed to be? Nov 20 15:10:05 you have all the information you need, theres NOTHING else in any of the other source files that can tell you why this ONE function has a link error Nov 20 15:10:26 no, I want you to paste a working example of the problem, one that I can deploy on a device to get the error myself and work on it from there... that's a proper testcase Nov 20 15:10:50 then write a testcase with the same problem, if you can't then you've overlooked something Nov 20 15:10:54 I440r: yes please Nov 20 15:11:06 I440r: could you just pasetbin both files separately? Nov 20 15:14:24 I440r: have you reduced the problem? can you make it work withouth the byte[] ? Nov 20 15:14:30 https://bpaste.net/show/83d4ec05ff12 Nov 20 15:14:52 the last function in that file does not belong in there. it was put there just to get up and running. Nov 20 15:14:59 https://bpaste.net/show/93ab3cfb79dd Nov 20 15:15:02 thats both files Nov 20 15:15:19 how do i make it work without the byte[] Nov 20 15:15:32 this is a copy to java from forth. the byte[] is the destination Nov 20 15:15:40 i mean just comment out the byte[] Nov 20 15:16:04 my suspicions would be arg lengths on the c file or the byte array Nov 20 15:16:17 the byte array is 256 bytes Nov 20 15:16:24 i mean the typing Nov 20 15:16:39 GTG. back in 40 mins or so Nov 20 15:16:50 where do you want me to comment out byt[]? Nov 20 15:16:53 everywhere/ Nov 20 15:16:55 ? Nov 20 15:17:02 try it yes Nov 20 15:17:08 remove the byte array completely Nov 20 15:17:15 and see if you get a compile error Nov 20 15:17:22 unsatisfied link error* Nov 20 15:18:05 and can you also pastebin the full exception output Nov 20 15:18:14 i did Nov 20 15:18:16 hang on Nov 20 15:18:54 commented out the byte[] parameters from everywhere Nov 20 15:19:07 running debug again. will paste the error if it happens still Nov 20 15:19:08 (and obviously the jbyearray parameter too right? ) Nov 20 15:19:12 yes Nov 20 15:19:24 i inserted a char *dst; in the fucntion to replace the parameter Nov 20 15:19:46 pasting error ... Nov 20 15:20:16 http://pastebin.com/2fu5CAcL Nov 20 15:20:22 well if you have no byte[] from the java, it’s not going to match Nov 20 15:20:32 so if you remove a param in the java, you remove a param in the jni right? Nov 20 15:20:36 oh i see Nov 20 15:20:37 nvm Nov 20 15:21:03 back soon… Nov 20 15:22:55 actually im running that test again Nov 20 15:23:18 i rebuilt the library but i dont recall if i reinstalled it in the project thats using it Nov 20 15:24:32 right Nov 20 15:24:47 and sanity check: the library is loaded and you can call another of the JNI methods immediately before this one? Nov 20 15:25:20 yea and i got a different error Nov 20 15:25:34 ? Nov 20 15:25:35 because i forgot to change the call to the lib too Nov 20 15:25:49 so i was calling byte, string, int Nov 20 15:26:01 re-running after fixing the call Nov 20 15:26:26 this laptop is very slow Nov 20 15:27:13 ok i still get the original link error Nov 20 15:28:42 I440r: have you updated and re-deployed the .apk so that the updated lib.so is installed? Nov 20 15:28:50 yes Nov 20 15:29:20 intellij idea does that for me when i tell it to debug project Nov 20 15:29:27 it rebuilds and redeploys for debug Nov 20 15:32:32 this is not a bug in my code Nov 20 15:33:55 hi guys, im trying to get the screen density from a "subclass" Nov 20 15:33:59 is this possible Nov 20 15:38:00 i renamed NAFCopy to NAFReadMem but left naf.copy unchanged Nov 20 15:38:22 testing now. it will still fail but will show the new name Nov 20 15:39:33 yup still failed Nov 20 15:39:45 trying on physical instead of emu Nov 20 15:40:25 same failure Nov 20 15:45:54 I440r, try migrating to using RegisterNatives instead of that horrible javah syntax, I haven't really used the javah created stuff in years... ever since I found out about RegisterNatives Nov 20 15:46:21 no idea how to do that, let me go look it up Nov 20 15:50:10 ok where i see how this works, where do i get a list of all the one character parameter type codes? Nov 20 15:50:37 I just get them off the top of my head, not too many of them :) Nov 20 15:50:51 obviously I is integer Nov 20 15:50:53 V is void Nov 20 15:51:03 what is byte[]? what is String ? Nov 20 15:51:10 http://www.public.iastate.edu/~java/docs/guide/nativemethod/types.doc.html Nov 20 15:51:26 [B is byte[], string is Ljava/lang/String; Nov 20 15:51:34 ... if String was in java.lang... can't remmeber :p Nov 20 15:52:20 all classes are Lcom/example/Name; Nov 20 15:52:39 arrays are [X Nov 20 15:52:56 where x is the code so [B is byte[] ? Nov 20 15:52:56 it's all there in that table 3.2 Nov 20 15:53:01 yep Nov 20 15:56:38 erm. what would a string be Nov 20 15:56:42 i cant see one for string Nov 20 15:56:44 [B ? Nov 20 15:57:08 no i see it Nov 20 15:57:29 I just said it up there Nov 20 15:57:36 Hey all. I have an Android Device that has an integrated Barcode Reader (Laser 1D). The reader has 3 working modes: 2 is keyboard-simulator, 3 is BroadcastReceiver, and 1 is something different: it somehow injects the text in a text-view, but is not keyboard-emulator. My app has no text-input fields, but I'd like to handle all three methods of Barcode reading. The device has no documentation. What can I do? What could this method be, and can I simulta Nov 20 16:00:50 Lachezar, your sentence got cut off Nov 20 16:01:00 can I simulta Nov 20 16:01:46 ... What can I do? What could this method be, and can I simultate that? Nov 20 16:02:37 I have a 'gut feeling' that this does something with the IME framework or something of the sort, but I can't catch it. Nov 20 16:02:48 it sounds like an alternate ime Nov 20 16:03:38 there is a method that gives you a list of enabled imes, i think Nov 20 16:04:12 dbrosyth: I had a similar thought, but wouldn't this IME show in Settings/Languages? Nov 20 16:04:50 Can I somehow design my Activity to 'simulate' editing abilities? I have onKey* methods handled, but they're not called. Nov 20 16:05:29 have you tried this method? http://developer.android.com/reference/android/view/inputmethod/InputMethodManager.html#getEnabledInputMethodList%28%29 Nov 20 16:06:25 * Lachezar is looking into it. Nov 20 16:06:44 I440r: back Nov 20 16:06:52 it probably should show up in settings, but it wouldnt suprise me if there is some attribute you need to set somewhere to register it. and if your device is undocumented it wouldnt surprise me if they forgot that attribute. Nov 20 16:06:57 where have you got ti Nov 20 16:07:01 hi just trying registernativews() Nov 20 16:07:10 dont know if i have done it right tho Nov 20 16:08:03 lol no Nov 20 16:08:09 it cant find registerNatives() Nov 20 16:08:16 thats an android thing right Nov 20 16:08:22 anyway, leave that for now Nov 20 16:08:33 what i did notice was our JNI layer doesn’t use ‘JNIEXPORT' Nov 20 16:08:39 I440r: RegisterNatives is the C function. Nov 20 16:08:58 dbrosyth: Only 'com.android.inputmethod.latin/.LatinIME' Nov 20 16:08:59 it's a jni function to be specific Nov 20 16:09:02 yes and its got the same problem as the NAFCopy. its not visible Nov 20 16:09:09 found in the JNIEnv Nov 20 16:09:11 I440r: Did you #include ? Nov 20 16:09:11 samskiter, IIRC JNIEXPORT is required for MSVC compiler, not GCC Nov 20 16:09:16 yes Nov 20 16:09:22 ahh yes. Nov 20 16:09:44 GCC exports by default Nov 20 16:09:54 JNIEXPORT isn't for exporting Nov 20 16:09:56 Lachezar: hm. i dont really have any other ideas off the top of my head vOv Nov 20 16:09:56 I440r: so you toook out the byte arrays and it couldn’t find the function still? Nov 20 16:09:58 it's for setting the calling convention Nov 20 16:09:59 reduce further Nov 20 16:10:01 i have a function called registerNatives inside my C module Nov 20 16:10:13 it calls (*env)->registerNatives() Nov 20 16:10:19 t's RegisterNatives Nov 20 16:10:19 jonp, #define JNIEXPORT __attribute__ ((visibility ("default"))) Nov 20 16:10:23 not registerNatives Nov 20 16:10:24 I believe you're wrong. Nov 20 16:10:29 Since C has only one calling convention :) Nov 20 16:10:35 lol. no. Nov 20 16:10:43 you done any Windows programming? Nov 20 16:10:45 there's JNICALL, isn't there? Nov 20 16:10:48 there's like 4 Nov 20 16:10:55 jonp, you're talking about C++ calling conventions Nov 20 16:10:57 __cdecl, __stdcall, __fastsomething... Nov 20 16:11:06 Mavrik: fastcall, cdecl, syscall, stdcall, safecall, *pascal*... Nov 20 16:11:07 i assure you, __stdcall applies to C as well Nov 20 16:11:09 jonp, which, yes, are several due to C++ not having a standard ABI Nov 20 16:11:11 and always has Nov 20 16:11:14 no, this is C Nov 20 16:11:15 I440r: so to recap. you can call NAFEval just fine, but NAFCopy doesn’t work Nov 20 16:11:18 predates C++ Nov 20 16:11:19 by years Nov 20 16:11:19 Mavrik: C also doesn't have a standard ABI. Nov 20 16:11:25 yup Nov 20 16:11:25 jonp, anyway, I've pasted you to what JNIEXPORT expands :) Nov 20 16:11:31 indeed. sorry. Nov 20 16:11:34 and if you take the byte array out of NAFCopy it still doesnt work Nov 20 16:11:43 and if you rename NAFEval, it still works Nov 20 16:11:44 but WinAPI is still a C API, not C++, and it's almost entirely __stdcall Nov 20 16:11:54 i would say continue simplifying the problem Nov 20 16:11:57 didnt try but im guessing yes Nov 20 16:12:00 which is not the default C __cdecl convention Nov 20 16:12:04 jonp, hrmpf, think you're right Nov 20 16:12:11 been years since I've done any win/C programming Nov 20 16:12:11 gcc also supports those bizarre windows calling-convention-isms Nov 20 16:12:19 I440r: try these things Nov 20 16:12:33 Well, it should, otherwise it'd be useless on windows. Nov 20 16:12:41 right Nov 20 16:12:59 i cant call my registerNatives() c wrapper to the env-> function because its suffering the same problem as NAFCopy Nov 20 16:13:02 iirc they also support them on Linux...because it's in the compiler already, right? Nov 20 16:13:03 so this is not a solution Nov 20 16:13:07 im backing out this change Nov 20 16:13:25 I440r: i see. you originally said you’re other methods were working fine Nov 20 16:13:47 you would generally do RegisterNatives in JNI_OnLoad Nov 20 16:14:11 they are Nov 20 16:14:18 zharf yea that would be sane Nov 20 16:14:21 btw, javap is the tool that can dump signatures for JNI so you don't have to write them manually :) Nov 20 16:14:21 that might even work Nov 20 16:14:24 will try that later Nov 20 16:14:31 registernatives is for renaming your C functions right? Nov 20 16:14:35 javah writes the stubs, so. Nov 20 16:14:36 but trying to deduce the signatures is SO MUCH FUN! Nov 20 16:14:47 samskiter: RegisterNatives is for arbitrary binding instead of using discovery. Nov 20 16:14:49 javah syntax is horrible, registernatives makes the code readable :p Nov 20 16:14:57 samskiter: RegisterNatives() is for when you don't want to follow the default JNI convention Nov 20 16:15:12 jonp: yes, but i didn’t think I440r needed that Nov 20 16:15:13 samskiter: many parts of AOSP use RegisterNatives() so they can use `static` C functions Nov 20 16:15:27 reduce symbol exports from .so's, etc. Nov 20 16:15:40 registerNatives would make the source files less cluttered wtih function names that read like complete sentences Nov 20 16:15:44 I use it just to make my functions have sane names Nov 20 16:15:56 i use it because i have to. :-) Nov 20 16:16:02 right, but that seems like a distraction from the original problem? Nov 20 16:16:04 Java_fully_qualified_package_name_ClassName is a sane name. Nov 20 16:16:04 which are also much less error prone Nov 20 16:16:15 freeone3000, no, it's not Nov 20 16:16:22 freeone3000: it is...until you want to call it from another function. Nov 20 16:16:24 then ugh. Nov 20 16:16:44 no its utter insanity Nov 20 16:16:50 jonp: cls->invokeMethod("normalName"). :P Nov 20 16:17:03 its like saying ONLY methods in THIS class in THIS package can call THIS jni function Nov 20 16:17:04 1. that doesn't exist. 2. OMFGWTFBBQ?! Nov 20 16:17:07 utterly moronic Nov 20 16:17:16 specifly where you can be called from wtf Nov 20 16:17:19 oh, C++. misread. Nov 20 16:17:34 still crazy and...not entirely sure that's possible. Nov 20 16:17:50 I440r: i don’t knwo what your problem is anymore. i might step out. good luck Nov 20 16:17:57 i renamed NAFCopy to NAFReadMem() and have the same problem Nov 20 16:18:00 the real issue is JNI is a terrible FFI system Nov 20 16:18:06 nobody knows what the problem is Nov 20 16:18:15 I440r: what's the current source + exception? Nov 20 16:18:17 I440r: Because you don't give us any output from any of the tools. Nov 20 16:18:31 java.lang.UnsatisfiedLinkError: NAFReadMem Nov 20 16:18:34 well the source you sent me didnt use registernatives.... Nov 20 16:18:42 I440r: well NAFReadMem is wrong Nov 20 16:18:46 i did. i pasted the entire error Nov 20 16:18:51 it should be Java_... Nov 20 16:18:54 no thats NAFCopy i just renamed it Nov 20 16:19:01 it is called Java_.. .. Nov 20 16:19:14 oh wait. maybe not maybe i didnt back out my changes far enough Nov 20 16:19:59 I440r: so all of your methods get an unsatisfied link error now?\ Nov 20 16:20:01 yea slight snafu on my part Nov 20 16:20:06 small question about text selection with the android v7 compat libraries Nov 20 16:20:08 no. only that one Nov 20 16:20:26 jonp, I don't really have much to bash jni for, I use it on a regular basis Nov 20 16:20:33 as do i Nov 20 16:20:45 and if you've ever used .NET P/Invoke... there's much to bash JNI for. Nov 20 16:20:49 SO MUCH PAIN Nov 20 16:20:53 since switching to a Toolbar, the text selection options (cut, copy ect) have moved my entire layout down rather than just overlaying the toolbar Nov 20 16:20:57 ok. so i recommend this: reduce the bad one to something simple. one variable at a time. for every change you make, change the name of another method that already works. and make sure you call that method right before the bad one. Nov 20 16:20:57 why's this? Nov 20 16:21:11 jonp, JNI is really simple though, there can't be *that* much pain :p Nov 20 16:21:22 all the pain is all the code you have to write. Nov 20 16:21:26 this way you know that you are rebuilding your .so succesfully for each trial Nov 20 16:21:36 all the damn Java_... functions, and the javah, and the javap, and the ... UGH EVERYTHING Nov 20 16:21:50 I never use javah or javap in my JNI adventures.. Nov 20 16:22:01 not sure if that's better or worse ;-) Nov 20 16:22:10 you must have really internalized the JNI rules Nov 20 16:22:12 well as I said, I always just RegisterNatives Nov 20 16:22:25 and internalized the JNI signature rules Nov 20 16:22:25 function types are really easy for that Nov 20 16:22:30 which, granted, aren't that bad... Nov 20 16:22:32 but still Nov 20 16:22:48 I440r: i’ll keep an eye on this window, let me know fi you try that and what the results are Nov 20 16:22:57 kk Nov 20 16:23:08 and yes im rebuilding the .so every time Nov 20 16:23:09 hey, I'm trying to make an interface like http://novaember.com/s/693482316.png, can anyone give me some pointers? Nov 20 16:23:16 both the java stuff and the asm/c stuff Nov 20 16:23:20 I440r: but verify you are. this stuff is delicate Nov 20 16:23:44 I've been thinking about calculating everything programatically but maybe there's a clean way to maybe use views in custom views? Nov 20 16:23:46 delete all built objects ;) Nov 20 16:23:54 samskiter, ive reduce the bad one to void blah(void) { ; } and it still fails Nov 20 16:24:08 I440r: and you renamed another function and called it right before? Nov 20 16:24:20 yes Nov 20 16:24:29 please repaste source and exception? :) Nov 20 16:24:40 jonp, the worst time I had with JNI was when I accidentally used long instead of jlong in the middle of a function signature... the value overflowed on top of the jbyteArray that I had next Nov 20 16:24:44 fun time Nov 20 16:24:47 s Nov 20 16:24:55 indeed. Nov 20 16:25:22 worst time i had was when the NDK toolchain had some bizarre size limit in output .so's which i was running into, and needed to add an extra gcc flag to fix Nov 20 16:25:25 but I haven't made that mistake since, I learn/internalize these things really fast Nov 20 16:25:28 because that kind of shit isn't obvious Nov 20 16:25:38 jonp what flag? Nov 20 16:25:39 the worst time i had was the UTF encoding being different in the JNI to in java Nov 20 16:25:47 samskiter, heh Nov 20 16:25:55 i nearly died when i foudn that Nov 20 16:26:06 java using utf16 is fucked up anyway Nov 20 16:26:07 yeah, UTF-8 isn't enough for JNI, oh no. Nov 20 16:26:14 it's fucked up but at least SANE. Nov 20 16:26:18 JNI UTF-8? not so sane. Nov 20 16:26:19 ‘modified utf-8’ AHHHHHH Nov 20 16:26:27 only sane utf is utf8 (not-modified :) Nov 20 16:26:28 i just lost it. Nov 20 16:26:34 well, maybe utf32 too Nov 20 16:26:51 so I hear Lollipop is having some issues. anyone updated? Nov 20 16:26:53 so i think i had to move the utf decoding into the jni layer or visa versa. can’t remember Nov 20 16:26:55 java.lang.UnsatisfiedLinkError: NAFReadMem at com.mimiv.naf.naf.NAFReadMem(Native Method) Nov 20 16:26:59 yeah, UTF-32 actually makes alot of sense Nov 20 16:27:06 The modified utf-8 uses the application-specific range and the Unicode reserved range. It's not *that* broken. Nov 20 16:27:13 I440r: can you repase to pastebin or seomthing please? Nov 20 16:27:16 I440r: logcat? Nov 20 16:27:22 thats saying Java_com_mimiv_naf_naf_NAFReadMem() is trying to call NAFReadMeme() wtf Nov 20 16:27:26 i want to see the full method signatures and the rrorr Nov 20 16:27:36 yea i can re paste Nov 20 16:28:04 thanks Nov 20 16:28:10 https://bpaste.net/show/e213f28a4082 Nov 20 16:28:18 getting other files now... Nov 20 16:28:36 https://bpaste.net/show/f0522da000b4 Nov 20 16:29:25 stack trace? Nov 20 16:29:46 working on it lol Nov 20 16:30:16 https://bpaste.net/show/bb21bb7e33b6 Nov 20 16:30:18 that doesn’t look like the correct JNI file. the method still has arguments Nov 20 16:30:39 ? Nov 20 16:30:46 eww, I just noticed Nov 20 16:30:53 your class name doesn't start with an upper case letter Nov 20 16:31:06 is that a requirement? Nov 20 16:31:07 (not related to the issue :p) Nov 20 16:31:11 or just some anal rule lol Nov 20 16:31:20 it's just a java thing to do Nov 20 16:31:30 I'm pretty sure it doesn't matter Nov 20 16:31:30 It's not "anal". It allows you to look at an identifier and go "class, not-a-class". Nov 20 16:31:43 although any sane IDE would do that with colours Nov 20 16:31:44 I440r: any other useful logcat? Nov 20 16:31:48 like dlopen errors? Nov 20 16:31:53 jonp nope Nov 20 16:31:58 I440r: you said you had it to void methodname(){;} and it still broke. can you copy paste that please? Nov 20 16:32:01 including error Nov 20 16:32:09 which is why using any sort of convention in field names to differentiate them from variables is just retarded Nov 20 16:32:18 just prior to calling NAFReadMem i call NAFEval() and that works Nov 20 16:32:30 i know it works because if it didnt i would not have made it to the read mem Nov 20 16:32:52 samskiter, its exactly the same error Nov 20 16:32:53 which Android version is this? Nov 20 16:33:03 I440r: can you just humour me? Nov 20 16:33:18 min sdk = 9 Nov 20 16:33:30 no, the target Nov 20 16:33:33 targeted sdk = 20 Nov 20 16:33:36 your stack doesn't look like this one: http://stackoverflow.com/questions/24131404/android-ndk-unsatisfiedlinkerror-native-method-not-found Nov 20 16:33:44 e.g. java.lang.UnsatisfiedLinkError: Native method not found: io.hpp.soundtouch.SoundTouch.getVersionString:()Ljava/lang/String; Nov 20 16:33:46 ive tried other targets Nov 20 16:33:56 yours just mentions NAFReadMem Nov 20 16:34:23 yes. it would be good to see the following: Nov 20 16:34:24 because the jni onload happend LONG before this error Nov 20 16:34:38 the JNI method changed to void NAME(){;} Nov 20 16:34:41 i'm referring to the line in the stack trace Nov 20 16:34:42 the jave changes the match Nov 20 16:34:49 another method name changed Nov 20 16:34:49 not the onload part Nov 20 16:34:52 and the stack trace Nov 20 16:34:55 prior to this error i already have the forth library compile AND RUN forth sources and a bunch of other stuff happens too Nov 20 16:35:28 and the source from where you call this method, showing that you have *JUST* called another method in the JNI Nov 20 16:35:36 are you editing the stack trace before pasting? Nov 20 16:36:07 naf.eval( "$" + Integer.toString(mx, 16) + " $" + Integer.toString(my, 16) + " unpack"); Nov 20 16:36:24 that line of java is run and then i call naf.readMem() Nov 20 16:36:39 it would be much easier to evaluate from pastebin.... Nov 20 16:37:19 the point is, i can call every function in my jni C file except NAFReadMem Nov 20 16:37:31 i have already proved that to myself over and over Nov 20 16:37:42 check `nm -D` against the .so and ensure it's there. Nov 20 16:37:43 yes, but allow us to try and go through debuggin it with you Nov 20 16:38:15 hi which sdks to i really need? Nov 20 16:38:17 i.e. 4 links: 1. JAVA jni wrapper 2. C++ code 3. the 2/3 lines of code where you make these 2 calls IMMEDIATELY after each other. 4. the full stack trace. Nov 20 16:38:18 jonp ive viewed the .so in midnight commander Nov 20 16:38:20 its there Nov 20 16:38:24 ehm images* Nov 20 16:38:24 but whats nm? Nov 20 16:38:28 let me try it Nov 20 16:38:35 arm eabi v7? Nov 20 16:39:16 000060fc T Java_com_mimiv_naf_naf_NAFReadMem Nov 20 16:39:31 v7a? Nov 20 16:39:46 how many ABIs in your .apk? Nov 20 16:39:59 jonp me? Nov 20 16:40:02 yes Nov 20 16:40:06 no idea, starting this for the first time Nov 20 16:40:08 how do i tell? Nov 20 16:40:19 unzip -l your.apk | grep lib/ Nov 20 16:40:35 oh. theres only one thing under lib Nov 20 16:40:45 ok, just one ABI then. goodl Nov 20 16:40:49 and its armeabi Nov 20 16:41:05 less good, but okay Nov 20 16:41:06 Hello, I need help - I'm making an Xposed module, most of the stuff are working - What is not working is, I have an IntentService, invoked from the Xposed module, that adds Notification with 2 buttons. I can't find out how to run some code inside my service when a button is clicked in the Notification. Any help would be much appreciated. Nov 20 16:41:08 only one instance of libnaf.so Nov 20 16:41:35 eitama: Did you try http://developer.android.com/training/notify-user/build-notification.html#click ? Nov 20 16:42:01 freeone3000: Iv'e been drowning in documentation since 08:00 AM Nov 20 16:42:02 i can change the Android.mk Nov 20 16:42:15 i doubt that will fix this tho Nov 20 16:42:26 Mind you it's 18:42 here... and I can't get past this. Nov 20 16:43:24 freeone3000: And to the specific page your referred me to, yes I have read it. Nov 20 16:43:46 dang, are we still on this weird naf JNI thing? lol Nov 20 16:44:14 jbyteArray dst, jstring src, jint len) <-- there has to be something wrong with this bit Nov 20 16:44:29 eitama: So is your PendingIntent's contentIntent not triggered, or...? Nov 20 16:44:39 or theres a bug in java/android/whatever and my code is fine Nov 20 16:44:55 freeone3000: I have adb logcat Nov 20 16:45:01 sorry missend - writing again. Nov 20 16:45:09 I440r: no, it's not that bit Nov 20 16:45:34 well im stumped Nov 20 16:45:35 I440r: you're in C, not C++, so there's no name mangling, so function parameters are not relevant to dlsym(3) behavior Nov 20 16:45:36 still Nov 20 16:45:42 yes not c++ Nov 20 16:45:54 freeone3000: I have logcat grepped for my tag, and no, I can see my contentIntent is not being called, and neither the other PendingIntents for my addAction buttons. I'm sure I am doing something wrong Nov 20 16:45:55 and you're getting the UnsatisfiedLInkError because dlsym(3) can't find the symbol Nov 20 16:46:13 I440r: which is why i don't like this: java.lang.UnsatisfiedLinkError: NAFReadMem Nov 20 16:46:19 freeone3000: freeone3000 is it ok to paste 2 lines here? Nov 20 16:46:22 because NAFReadMem is NOT the symbol it should be looking for Nov 20 16:46:28 are you editing that line? Nov 20 16:46:31 I440r: you need to reduce the problem Nov 20 16:46:32 no Nov 20 16:46:37 thats it verbatum Nov 20 16:46:47 then for giggles Nov 20 16:46:56 add NAFReadMem to your libnaf.so Nov 20 16:47:02 at com.mimiv.naf.naf.NAFReadMem(Native Method) <-- thats the next line Nov 20 16:47:14 just "NAFReadMem()? Nov 20 16:47:18 same declaration as Java_com_mimiv_naf_naf_NAFReadMem Nov 20 16:47:24 kk Nov 20 16:47:26 and just have the implementation delegate to Java_com_mimiv_naf_naf_NAFReadMem() Nov 20 16:47:39 ill make it a wrapper to the Java_ version Nov 20 16:47:44 right Nov 20 16:48:16 freeone3000: All the examples I saw on the net are for Activity that interacts with Notifications. Even though Android docs explicitly say I can do it with Services as well. What I am doing is : Intent intentDefault = new Intent("Default"); Nov 20 16:48:18 PendingIntent pendingIntentDefault = PendingIntent.getService(this, 579, intentDefault, PendingIntent.FLAG_UPDATE_CURRENT); Nov 20 16:48:30 And I got 2 more lines from each for my buttons. Nov 20 16:49:27 This is performed from inside my service, I expect startService to occur, and then in onHandleIntent I should have my intents. But it's not being called. Nov 20 16:50:10 same error Nov 20 16:50:23 let me wgetpaste the new c file to show what i did Nov 20 16:50:32 * Lachezar gives up… Nov 20 16:50:36 full logcat? Nov 20 16:50:57 how do i get the full logcat out of intellij idea Nov 20 16:51:04 https://bpaste.net/show/350d5dcb9006 Nov 20 16:51:09 thats the new c file Nov 20 16:51:21 I440r: You go to android. You go to the logcat tab. You copy. You paste. Nov 20 16:51:46 https://bpaste.net/show/9fe16301c9d2 Nov 20 16:51:58 I440r: also, if you're using GetStringUTFChars(), you should also call ReleaseStringUTFChars() Nov 20 16:52:11 ooh i was wondering if i missed that lol Nov 20 16:52:13 ty Nov 20 16:52:35 there we go! 11-20 10:50:15.991 7667-7679/com.reality.retrorpg W/dalvikvm﹕ No implementation found for native Lcom/mimiv/naf/naf;.NAFReadMem([BLjava/lang/String;I)V Nov 20 16:53:50 but why? Nov 20 16:54:16 What causes " java.lang.NoSuchMethodError: No virtual method setEndpointIdentificationAlgorithm(Ljava/lang/String;)V in class Ljavax/net/ssl/SSLParameters; or its super classes (declaration of 'javax.net.ssl.SSLParameters' appears in /system/framework/core-libart.jar)"? Nov 20 16:54:41 freeone3000: it means you're invoking a method which doesn't exist. Nov 20 16:55:09 jonp: But that's https://docs.oracle.com/javase/7/docs/api/javax/net/ssl/SSLParameters.html#setEndpointIdentificationAlgorithm(java.lang.String) Nov 20 16:55:21 so? Nov 20 16:55:23 freeone3000: http://developer.android.com/reference/javax/net/ssl/SSLParameters.html Nov 20 16:55:29 note: does not exist. Nov 20 16:55:38 android != JDK Nov 20 16:55:39 jonp: Okay. Awesome. How do I update android to use java 7 libraries? Nov 20 16:55:45 uh, you don't Nov 20 16:55:56 OR, re-start Harmony and get Google to use your updated Harmony? Nov 20 16:56:24 (note: not going to happen) Nov 20 16:56:57 Android is more or less "stuck" using an ancient Java classlib version that i suspect will rarely/never get updates Nov 20 16:57:35 I440r: alas, i'm out of ideas. :-( Nov 20 16:57:46 Okay. So if I want to use a bayeux websocket library over HTTPS, what's my best option? Nov 20 16:57:53 jonp i reinstate my idea about android being broken Nov 20 16:58:00 and my code being fine Nov 20 16:58:11 I440r: time to checkout the AOSP source! Nov 20 16:58:16 HHOS Nov 20 16:58:37 jonp i wouldnt know where to look or what i was looking at or if it was broken or not Nov 20 16:58:46 `grep` ;-) Nov 20 16:59:04 specifically, you'd grep for 'No implementation found for native' Nov 20 16:59:08 in all .c* files Nov 20 17:00:25 grep -r "foo" *.c cannot find any directories called *.c Nov 20 17:00:26 wtf Nov 20 17:00:36 use --include Nov 20 17:00:44 grep -rl --include=\*.c\* ... Nov 20 17:01:46 I440r: which would find e.g. https://android.googlesource.com/platform/dalvik/+/android-4.4.4_r2.0.1/vm/Native.cpp Nov 20 17:01:48 line 121 Nov 20 17:01:51 this might take a while. these sources are huge and the laptop a buddy gave me to use after mine blew up is reallllly slow Nov 20 17:02:06 it didnt find anything yet lol Nov 20 17:02:50 it also might be a java bug not android Nov 20 17:02:56 and dvmThrowUnsatisfiedLInkError() is: https://android.googlesource.com/platform/dalvik/+/android-4.4.4_r2.0.1/vm/Exception.cpp Nov 20 17:03:00 in which case looking in android sources would be pointless Nov 20 17:03:08 i cant read c++ Nov 20 17:03:10 which, for this branch, throws a distinctly different message Nov 20 17:03:17 this code is more C than C++ Nov 20 17:03:44 key point is line 1438, in which the UnsatisfiedLinkError has a message format of "%s: %s.%s:%s" Nov 20 17:03:49 which is NOT in your logcat output Nov 20 17:03:54 wtf android target is this? Nov 20 17:04:17 i answered that before Nov 20 17:04:20 i.e. the actual device + manufacturer Nov 20 17:04:21 android 20 Nov 20 17:04:24 oh Nov 20 17:04:25 which i don't recall seeing before Nov 20 17:04:36 any and all emulators i run it on and my droid incredible Nov 20 17:04:47 the emulators? weird. Nov 20 17:04:59 i didnt try on my thunderbolt Nov 20 17:05:21 ive run it on 2.3.3 and 4.x Nov 20 17:05:31 if your target is API-20, then your emulators will be armeabi-v7a... Nov 20 17:05:36 ...except API-10 (v2.3.3) Nov 20 17:05:46 they are i believe Nov 20 17:05:56 i'd strongly suggest avoiding armv5 if at all possible; you can't write thread-safe native code there. Nov 20 17:06:02 but the arm asm code runs just fine on them Nov 20 17:06:17 this already isnt thread safe Nov 20 17:06:22 the armv5 ABI doesn't have the required instructions; they were added in iirc armv6 or v7 Nov 20 17:06:31 you cant have more than one thread calling the forth library Nov 20 17:06:36 and never will be able to Nov 20 17:06:46 then add some locks around your Java code ;-) Nov 20 17:06:52 my asm code has armv7 opcodes in it Nov 20 17:07:05 jonp its on the todo list Nov 20 17:07:12 its not as important as fixing this bug lol Nov 20 17:07:14 uh...then it should fail on an actual armv5 emulator...if you execute those opcodes Nov 20 17:07:25 anyway, wrt this bug, i'm out of ideas. Nov 20 17:07:31 ya Nov 20 17:07:34 me 2 Nov 20 17:07:51 actually, one last idea Nov 20 17:08:16 adjust paths as appropriate: Nov 20 17:08:18 I440r: /opt/android/ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/darwin-x86/bin/arm-linux-androideabi-ld \ Nov 20 17:08:18 --unresolved-symbols=report-all \ Nov 20 17:08:18 -L/opt/android/ndk/platforms/android-9/arch-arm/usr/lib \ Nov 20 17:08:18 -lm -lc -lz -ldl -llog \ Nov 20 17:08:18 FILENAME Nov 20 17:08:32 dafq? Nov 20 17:08:35 perhaps your libnaf.so is referencing some other .so which can't be found/resolved? Nov 20 17:08:41 nope Nov 20 17:08:44 oh Nov 20 17:08:48 erm Nov 20 17:08:51 it uses libc Nov 20 17:08:51 above ld command will check Nov 20 17:08:56 libc will work Nov 20 17:09:02 but its already successfully used it by the time i get this far Nov 20 17:09:12 forth has already loaded, compiled and executed forth sources Nov 20 17:09:18 lazy linking. :-) Nov 20 17:09:42 though i don't see anything in Java_com_mimiv_naf_naf_NAFReadMem() that shouldn't already be linked in Nov 20 17:10:01 it never executes it Nov 20 17:10:03 it cant find it Nov 20 17:10:15 the code inside the function could be buggy as hell and i would never know Nov 20 17:10:17 its invisible Nov 20 17:10:48 like the export doesnt work Nov 20 17:10:56 except it does Nov 20 17:11:26 there must be a limit on the number of JNI functions you can have in one source file till you have paid google the license fee Nov 20 17:11:59 I440r: so you fixed it? Nov 20 17:12:03 no Nov 20 17:12:11 what is all of this Nov 20 17:12:15 have you reduced the number of JNI functions you have? Nov 20 17:12:22 to test that interesting hypothesis Nov 20 17:12:34 im not using exec. ill comment that out :) Nov 20 17:12:55 is this project open source? Nov 20 17:13:25 no Nov 20 17:13:40 well... not yet Nov 20 17:13:43 maybe not ever Nov 20 17:14:05 ok. have you tested your hypothesis yet? Nov 20 17:14:20 (there is no WAY that that is the case btw) Nov 20 17:14:31 given that i can compile offline Nov 20 17:14:55 i know but im clutching at straws here Nov 20 17:15:27 if you’d like to send me the project i’m happy to have a look. but i understand the nature of closed source and all Nov 20 17:15:30 yea. readmem still failed Nov 20 17:16:09 samskiter, if your in dallas texas you can come here and look :) Nov 20 17:16:16 no no. cambridge, UK Nov 20 17:16:22 i used to live there Nov 20 17:16:30 big change Nov 20 17:16:31 my mother worked in fulborne hospital Nov 20 17:16:39 <_Auron_> mm I live in Plano Nov 20 17:16:43 near cherryhinton Nov 20 17:16:47 auron cool :) Nov 20 17:16:54 you a JNI guru? Nov 20 17:17:06 <_Auron_> nope, someday I will be though Nov 20 17:27:40 freeone3000: I got working, changed the whole concept a bit. Nov 20 17:30:53 Anyone know of a cometd client supporting bayeux for android? The official one depends on a method in a library class not available on Android. Nov 20 17:42:56 I440r: i know a great deal about JNI... Nov 20 17:43:27 yes i know you do Nov 20 17:43:45 not sure i'd say i'm a guru... Nov 20 17:44:03 <_Auron_> I need to do JNI for my game engine Nov 20 17:49:54 JakeWharton: Damn butter knife is marvelous, @OnClick removes all pain of having to use an old Java. Thank you very much Nov 20 17:55:32 glad it's helpful Nov 20 17:56:21 Foxandxss I know right. Using Butterknife, retrofit, okhttp, otto, and picasso. They all make my life a lot easier. haha Nov 20 17:56:47 wonder how much of my DEX is square Nov 20 17:56:53 Indeed Nov 20 17:57:24 I always hated those anonymous implementations of interfaces for listeners on swing, oh, that was a bad year back on school Nov 20 17:59:07 Foxandxss haha! I've grown to hate Java after doing Node development. We are a Spring back-end shop where I work. Nov 20 17:59:56 I am a Javascript dev, I really really love it, I've grown with .NET (with what that means vs Java) but even when I love Javascript, it is so refreshing seeing interfaces again, proper classes and well, some good stuff Nov 20 18:01:12 Does anyone have experience with gradle + jacoco + robolectric? Nov 20 18:02:44 mattblang: I just started with Android tho, but the Java here is not that bad, few things I don't really like, but not any bad Nov 20 18:03:47 the IDE usually smoothes out any rough edges with Java Nov 20 18:04:19 hello, I am getting a segfault - only when stepping through debugging, and as of yet I cannot reproduce consistently, but it does happen most of the time when stepping through a particular section of code. Should I bug report this somewhere? Nov 20 18:04:19 11-20 10:59:20.748 1922-1929/? A/libc﹕ Fatal signal 11 (SIGSEGV), code 1, fault addr 0xc in tid 1929 (JDWP) Nov 20 18:04:21 I have to say that Android Studio is marvelous, I am a big fan of Jetbrains tho, always end picking some licenses Nov 20 18:04:27 one little but tho, reported it already Nov 20 18:04:30 bug* Nov 20 18:08:05 Uh, doesn't Java has something like Javascript's .map? So instead of a foreach to extract a value from every item on a list, I do it one-liner Nov 20 18:08:44 that's java 8 Nov 20 18:08:50 ohh Nov 20 18:08:59 every time I code a for, I feel bad :P Nov 20 18:09:26 there's libraries which add it (RxJava, Guava) but they're overkill for just transforming a list Nov 20 18:09:37 no doubt Nov 20 18:10:00 I guess Java 8 supports lambda as well, so that would be lovely Nov 20 18:10:03 for it is :P Nov 20 18:10:22 yes, lambdas are nice when paired with all the other java 8 features Nov 20 18:11:13 I hope Google considers Java 8, but I guess they are still fighting will oracle about Java Nov 20 18:13:39 Foxandxss http://flatmapthatshit.com/ Nov 20 18:14:53 g00s: don't rub it in! Nov 20 18:15:01 I feel bad already ;( :P Nov 20 18:18:16 So I am seeing this udemy mini course (not too fan of udemy myself) and damn, he has like a 10 feets sidebar if I stop the video to copy something, I can't, too wide lines and not enough room, heh Nov 20 18:18:24 shame I don't speak english very well to do my own videos Nov 20 18:18:58 hey, I'm trying to make an interface like http://novaember.com/s/693482316.png, can anyone give me some pointers? Nov 20 18:19:01 I've been thinking about calculating everything programatically but maybe there's a clean way to maybe use views in custom views? Nov 20 18:22:56 g00s: flatMap is really sexy tho Nov 20 18:33:06 I have an issue with my app Nov 20 18:34:23 I have categories listed and each has a list, but when I change one item on the list, it changes for every category rather than just for that one Nov 20 18:36:06 I'd probably have to send you the project so you can understand it better Nov 20 18:40:05 just got Professional Android 4 in the mail Nov 20 18:40:08 feeling the proness Nov 20 18:40:10 oh yea Nov 20 18:40:31 nice Nov 20 18:40:48 I've already become pro by virtue of buying it Nov 20 18:40:56 * Odaym never opens it Nov 20 18:41:26 I may have to get it if nobody can help with my issue Im having Nov 20 18:41:44 you should get it anyways Nov 20 18:42:09 * z4rd0z kicks android Nov 20 18:42:34 I can't believe that I don't yet have lollipop Nov 20 18:42:36 what the hell Nov 20 18:42:53 my carrier hasnt pushed it yet Nov 20 18:42:58 I have a note 3.. Nov 20 18:42:59 Odaym: tell me, moto g, first mobile with lollipop, still kitkat for me :P Nov 20 18:43:11 yeah Im still rocking kitkat as well Nov 20 18:43:14 I have Nexus 5 from AMERICA Nov 20 18:43:21 I mean if those devices dont get it first, who does! Nov 20 18:43:36 gotta love android.. bunch of communists Nov 20 18:43:42 verizon* Nov 20 18:43:44 I feel cheated sir, I feel cheated! Nov 20 18:44:09 Odaym: that should have OTA already Nov 20 18:44:11 if I want an activity to store a string to a selected path after it has been destroyed what is the best place to put that? Nov 20 18:44:44 it is basically a file browser activity Nov 20 18:44:49 id have to send my project to someone to see what issume im having Nov 20 18:45:17 Odaym: and tell me if that book is any good :) Nov 20 18:45:45 it's reto meier Nov 20 18:45:49 it can't not be good! Nov 20 18:46:03 * Odaym loves idolising Nov 20 18:46:09 Odaym reto come out with a new book ? Nov 20 18:46:25 well, pro android 4 development Nov 20 18:46:29 the one with the terminator cover Nov 20 18:46:39 it isn't that new Nov 20 18:47:11 yeah thats over 2 years old :D Nov 20 18:47:50 I think it is a new edition Nov 20 18:48:28 ravioli probably uses http://www.amazon.com/Professional-Android-2-Application-Development/dp/0470565527 Nov 20 18:49:03 oh, terminator cover is the old one yeah Nov 20 18:49:17 yea Nov 20 18:49:24 been seeing it a long time on Amazon Nov 20 18:49:39 it'll be some time before books about 5 roll out Nov 20 18:50:44 yeah, one full of examples Nov 20 18:51:00 grrr, I hate red wiggles on android studio when you can't stop them from happening Nov 20 18:53:47 can you assume SharedPreferences will be available after your app is shut down by OS? Nov 20 18:54:22 still be available when you get back into your app after it was shut down by OS? Nov 20 18:54:52 well put in the background Nov 20 18:55:01 even when shut down by the OS, yes Nov 20 18:55:44 they are stored on the disk? Nov 20 18:55:51 I don't know Nov 20 18:56:18 probably not Nov 20 18:56:22 yes Nov 20 18:56:26 http://stackoverflow.com/questions/6146106/where-are-shared-preferences-stored Nov 20 18:56:30 on disk yea Nov 20 18:56:43 https://developer.android.com/guide/topics/data/data-storage.html#pref Nov 20 18:57:02 "This data will persist across user sessions (even if your application is killed)." Nov 20 18:57:03 does anyone knows how the translations editor works? Nov 20 18:57:04 Damn jUnit Nov 20 18:57:46 oh, seems to work now Nov 20 18:58:30 anyone think they may be able to give me some assistance? Nov 20 18:59:01 nice tool the translation editor Nov 20 18:59:20 * Foxandxss cross the "Web App for translations" off his todo list Nov 20 18:59:45 z4rd0z: IRC is run by volunteers so you need to have patience, explain your issue the best you can and just wait Nov 20 19:05:05 is there any way to run a callback function or something after an event listener? I run a OnItemClick and I want to close the popup after I do it and I can't simply access the popup within the event listener Nov 20 19:05:54 Foxandxss: create a Handler associated with the Looper thread you want to run the callback on, and send a message/runnable to it Nov 20 19:07:11 Oh, I am called Jesus too :P Nov 20 19:07:18 and I don't have enough knowledge for that Nov 20 19:07:30 it is just a demo app from a tutorial and I wanted to do it better Nov 20 19:07:58 it's better to use @id/id_of_element when using layout_below and properties like that so you could have them fail when the elements aren't defined in that sequence in the xml Nov 20 19:08:34 if you use @+id/ the code will run and the UI will look wrong because you had thought this element was defined below that one and naturally gets "below" or etc. while it isn't Nov 20 19:10:13 Is there a way to print infos when running an AndroidTest case? Nov 20 19:15:57 using log Nov 20 19:20:34 everything fixed Nov 20 19:35:23 hey all Nov 20 19:35:34 i want to manage the back stack Nov 20 19:35:37 how do i do that Nov 20 19:36:27 well objdump -d shows a very nice disassembly of the function thats supposedly missing Nov 20 19:36:34 gobl: With fragments? Nov 20 19:36:38 yes Nov 20 19:36:43 particularly Nov 20 19:36:59 i want to switch between a submenu fragment and a item fragment Nov 20 19:37:13 both fragments are view pagers Nov 20 19:37:18 not sure if that matters Nov 20 19:38:22 im not sure if i can switch between fragments if they are both viewpagers- can i? Nov 20 19:38:41 (i think that implies nesting ) Nov 20 19:39:47 Question! Nov 20 19:39:54 How can I jump to the current file in the project explorer? Nov 20 19:40:36 Right Click > show in explorer Nov 20 19:40:52 or Right click > show in Finder Nov 20 19:41:18 Is it possible to bundle a TTS engine in your application? Nov 20 19:41:26 oops, that's not what I meant Nov 20 19:41:30 but I figured it out Nov 20 19:41:39 Navigate > Select In... Nov 20 19:41:54 and choose Project View Nov 20 19:54:13 JakeWharton have you looked at this at all http://www.reactive-streams.org/ ? is it complimentary to rxjava or another impl ? Nov 20 19:54:29 yes Nov 20 19:54:48 they have a github https://github.com/reactive-streams/reactive-streams Nov 20 19:54:56 are you using it ? Nov 20 19:55:54 no Nov 20 19:58:59 it'll be relevant in a few years Nov 20 19:59:19 ah looking at http://www.slideshare.net/rolandkuhn/reactive-streams , slide 41 Nov 20 19:59:33 i just learned about it, trying to understand it Nov 20 20:00:04 seems like a scenario where there is more data passing throigh the stream so it needs to be handled with better push/pull Nov 20 20:00:58 what's to understand? it's just people trying to standardize Nov 20 20:04:44 the rxjava presentation i just looked at had some reactive-streams content towards the end; pitty though there is no audio so i have no idea what ben was talking about. still trying to understand what the difference between them is, when they are complimentary, and when one is better suited than the other. Nov 20 20:05:09 netflix guys are also participating with a bunch of others Nov 20 20:05:51 Do I have to create a custom class implementation in order to retrieve Contacts? Nov 20 20:06:34 Documentation makes it seem so, but I figured there would be something like "Contacts.get" Nov 20 20:12:15 my OnClickListener doesn't work... Nov 20 20:12:43 but in debugger i see it is registered for my imageview Nov 20 20:16:13 man this FES e-ink watch looks cool Nov 20 20:18:28 why doesn't JSONObject.toString output the kvp in the order I put them? Nov 20 20:18:47 shekibobo: I would guess because it uses a HashMap to store them Nov 20 20:18:55 just a guess though :) Nov 20 20:19:26 if you have any way to influence the underlying collection, you could try a LinkedHashMap instead Nov 20 20:20:01 is the order they're put predictable? it's done using object.hash, right? so if I figured out what order they come out, they'll always come out that way? Nov 20 20:20:27 you can't rely on the order of items from a HashMap Nov 20 20:20:39 it depends on the size of the hashmap, what order they were inserted, etc. Nov 20 20:21:03 A LinkedHashMap keeps a secondary data structure to keep track of the order of insertion Nov 20 20:21:51 is there a better way to test the string output of an object to json than just raw string compare? Nov 20 20:22:46 Does anyone know what a raw phone number is formatted like? Can someone give an example? Nov 20 20:29:47 if anyone is able to take a look at this one, I'd appreciate it. Nov 20 20:29:48 http://stackoverflow.com/questions/27047248/getting-permission-denied-in-my-app-but-i-have-the-right-permissions Nov 20 20:29:50 thanks. Nov 20 20:33:25 I have Android Studio installed. Nov 20 20:33:35 Is there a quick way to access Gradle from the terminal on a Mac? Nov 20 20:33:46 So I can run some command line options etc? Nov 20 20:36:51 pBlack: if you set up your project with gradle-wrapper you can just go into your project dir and do ./gradelw Nov 20 20:36:56 you might need to chmod +x it Nov 20 20:37:13 and of course, spell it right. I didn't do that. Nov 20 20:37:58 Ahh ok. Nov 20 20:38:13 It's a part of the gradle wrapper, not in the sdk install dir? Nov 20 20:38:59 I have a list of items that look nice in a ListView. I also can click on these to make a toast, what I would like is to pass the list of items to a ViewPager and have its focus on the item that was clicked in the ListView. Is there a way for a listView and PageView to share an adapter? Nov 20 20:39:03 dragorn: By chance is it "gradlew"? Nov 20 20:39:11 It has the little w on the end. Nov 20 20:39:19 I assume that means 64-bit. :P Nov 20 20:39:32 yes, gradlew and not gradelw :P Nov 20 20:39:49 w is just there for 'wrapper' to distinguish it from a system version Nov 20 20:40:08 Ahh w is for wrapper got it. Nov 20 20:40:09 Thanks in advance. Nov 20 20:40:20 So basically I have 1 executable per project? Nov 20 20:40:35 Not really useful to set it on the system Path then. :( Nov 20 20:40:59 i just download gradle and put it on the system path :) Nov 20 20:42:12 I finally got the 5.0 OTA upgrade notification. should I upgrade now? I currently target api 20 in my project Nov 20 20:42:17 now it would be cool if you could in one step, by cli, download the right gradle, sdk, sdk-tools, and sdk-built-tools. and Nov 20 20:42:53 all this stuff really should just be in some big online repo along with the support lib, play services, etc Nov 20 20:43:03 pBlack: if you use gradlewrapper, yes - because then you can have different gradle versions per project Nov 20 20:43:16 Ahh ok, that makes sense. Nov 20 20:43:19 My next question is this. Nov 20 20:43:32 Using gradle, can I print out each .class file it finds? Nov 20 20:43:48 I'm having an error where my project has 2 *.class files with the same package and file name. :( Nov 20 20:43:50 pBlack: you could install gradle system-wide via whatever mechanism you use on osx (maybe ports or whatever bundles it?) or you can put it in a bin/ dir or whatever and set it to your path... but generally you might find it better to use per-project versions Nov 20 20:43:52 And I need to find 1, and remove 1. Nov 20 20:44:08 Yea, I'll stick to per project. :) Nov 20 20:44:20 don't know about that one; you can use find ./ -name Foo.class Nov 20 20:44:28 and just search by file name Nov 20 20:44:45 I don't know if gradle has a smarter way Nov 20 20:47:35 Ahhh yea use the Unix command. :) Nov 20 20:48:19 Probably because the Unix command is the smartest way lol. Nov 20 20:48:42 So if my build is failing because of multiple class file "redefinitions" Nov 20 20:48:56 They are actual files that I can delete? Or are they part of some .jar potentially? Nov 20 20:51:24 hi, can anyone help me with getting a decompiled function from an android application to work again? Here's a paste with input value and expected output value and what is left of the code: http://paste.debian.net/hidden/b2b94130/ Nov 20 20:58:03 append("0") ? is this an ETag function or something? Nov 20 21:01:40 Hypfer: Either way, everything from i = 0; to _L1: looks like it is supposed to be a loop of some kind, the rest should work just fine? Nov 20 21:03:43 Thorbear: I have no idea :/ Nov 20 21:04:14 In other words you have very little experience programming for android? :) Nov 20 21:05:02 anyone know if NSData *imagedata = UIImagePNGRepresentation(UIImage); Nov 20 21:05:12 can this be decoded in android Nov 20 21:05:13 ? Nov 20 21:05:37 subsignal: What does it do? Nov 20 21:05:40 Bitmap bitmap = BitmapFactory.decodeByteArray(imageData , 0, imageData.length); Nov 20 21:05:52 im trying to decode it on android Nov 20 21:06:10 i thought that would work but its saying the bytes should be 16 instead of 12 Nov 20 21:06:47 Thorbear: exactly. ^^ Nov 20 21:07:21 UIImagePNGRepresentation Nov 20 21:07:22 Return Value Nov 20 21:07:22 A data object containing the PNG data, or nil if there was a problem generating the data. This function may return nil if the image has no data or if the underlying CGImageRef contains data in an unsupported bitmap format. Nov 20 21:07:24 flan3002: Nov 20 21:07:32 Thorbear: the input values and the expected values weren't correct. this is the right paste: http://paste.debian.net/hidden/a52cdffa/ but I still don't know about that funciton Nov 20 21:08:02 subsignal: I didn't want the documentation. Are you asking if you can decode a png image in Android? Nov 20 21:08:15 yea i know you can Nov 20 21:09:08 i dont get why it wont decode the png data array on android properly Nov 20 21:11:23 Hypfer: without bothering to do any actual testing of input/output I would expect it to look something like this http://pastebin.com/VzGJF8js Nov 20 21:12:02 ermagerd lollipop update is here Nov 20 21:12:16 matt_j: They broke https in nio. Nov 20 21:12:23 matt_j: Have fun with that. Nov 20 21:12:29 huh? Nov 20 21:12:30 nio? Nov 20 21:12:50 matt_j: https://code.google.com/p/android-developer-preview/issues/detail?id=328 didn't get fixed for the current round of updates. It's only relevant because it's breaking my app. Nov 20 21:12:59 Well, that, and it only affects lollipop users. Nov 20 21:13:09 Thorbear: thanks, I'll take a look at that :) Nov 20 21:13:24 Does this mean I can't use https in chrome? Nov 20 21:14:27 matt_j: No, that works. Nov 20 21:14:50 did they change all the alert sounds? Nov 20 21:14:58 is my new-email sound gonna be something completely different? Nov 20 21:19:44 Thorbear: could you please bother to test that since I'm planning to implement that in another langage Nov 20 21:20:23 Hypfer: This channel is not for decompiling apps Nov 20 21:20:30 SimonVT: which channel is? Nov 20 21:20:37 Not this Nov 20 21:21:17 *sigh* Nov 20 21:22:09 #smali/#apktool ;) Nov 20 21:22:28 matt_j: They did and it's awful. Nov 20 21:23:03 what is the best way to do some kind of background sync without using accounts and sync adapters Nov 20 21:23:11 services or just a Thread running Nov 20 21:23:25 freeone3000: and I guess holo is gone? Nov 20 21:23:25 rxjava :) Nov 20 21:23:32 * matt_j is still waiting on the install Nov 20 21:23:39 i dont need access to the activity Nov 20 21:26:05 matt_j: It's *material* now. MATERIAL. Nov 20 21:26:22 matt_j: Which, as far as I can tell, means it's impossible to tell what's clickable anymore. Nov 20 21:26:28 what's with the white background behind my apps? Nov 20 21:26:31 seriously Nov 20 21:27:13 I am trying to get the pitch angle of the phone, but when I tilt it left or right, the angle changes as well. I tried using SensorManager.remapCoordinateSystem, but now when the phone lies flat, it show 90 degress, and when it's held straight, it shows 0, it's supposed to be the opposite. How can fix this? this is the code I use: https://gist.github.com/Bennyz/d89bc11a4f816701897b Nov 20 21:27:38 Hello! Nov 20 21:27:38 java.lang.ClassNotFoundException: org.sqldroid.SqldroidDriver Nov 20 21:28:01 havv: If it consistently shows 90 at horizontal and 0 at held straight... isn't this the same? Nov 20 21:28:01 Have you looked under the couch cushions? Nov 20 21:28:14 You never know where those SqldroidDrivers might be hiding Nov 20 21:28:45 fuck this sucks Nov 20 21:28:53 seriously Nov 20 21:29:05 freeone3000: it is, but I still must be doing something wrong and I'm trying to understand what that is Nov 20 21:29:08 just because apple hires a bunch of design hipsters to make their OS look stupid doesn't mean google does Nov 20 21:29:11 Hmm Nov 20 21:29:32 No, they aren't there Nov 20 21:29:36 anyone Nov 20 21:31:17 These stupid SqldroidDrivers Nov 20 21:31:28 ok I wanna downgrade Nov 20 21:31:44 shit now I probably need CM to fix this Nov 20 21:33:45 TELL ME WHERE THEY ARE! Nov 20 21:36:23 this android 5 thing looks very much like ios 8 Nov 20 21:36:47 ios 8 with a back button Nov 20 21:37:11 yeah that's important. I'm missing it in the appstore app Nov 20 21:37:16 i'm installing android 5 on my nexus 5 right now Nov 20 21:37:55 has it been released OTA ? Nov 20 21:37:59 yes Nov 20 21:38:07 just a few minutes ago (germany) Nov 20 21:39:06 wtf did they do to the keyboard Nov 20 21:39:10 If any of you have BBC News app.. you'll get an update with compatiblity for Lollipop early next week Nov 20 21:39:20 either that, or side-load it Nov 20 21:39:46 Cool Napalm Nov 20 21:39:50 let me see if it breaks my own app ^^ Nov 20 21:40:29 installing my app Nov 20 21:41:02 works Nov 20 21:41:12 congratz :) Nov 20 21:42:23 I guess I should change the target api to 21 and retry Nov 20 21:42:39 Thorn: theres a difference "it works on device" and if the play store will distribute it to the device Nov 20 21:43:06 Thorn: what are you currently targeting? Nov 20 21:43:28 I just installed it from play. not sure if updates are going to be pushed to devices running 5 though Nov 20 21:43:32 I'm targeting 20 Nov 20 21:44:38 Thorn: are you currently using the AppCompat library? Nov 20 21:45:45 Hands up if you loathe TextWatcher Nov 20 21:45:49 * gman23 raises hand Nov 20 21:45:52 I'm using android-support-v4 Nov 20 21:46:13 Thorn: so native ActionBar then? Nov 20 21:46:19 right Nov 20 21:46:26 min 16, target 20 Nov 20 21:46:34 I'm trying to resize an ImageView. If I set the width & height in the LayoutParams while it's loading it updates the dimensions, but if I do it later it won't change them. Any ideas? Nov 20 21:46:40 you might have problems with the ActionBar in v21 Nov 20 21:47:10 If you do I'd suggest you import the AppCompat and add a Toolbar into your layout and do setSupportActionBar Nov 20 21:47:37 <_Auron_> ugh, coding for android feels extremely awkward sometimes Nov 20 21:47:44 oh, i already love it! Nov 20 21:48:04 anix: read my reply http://stackoverflow.com/questions/26926127/home-button-in-action-bar-not-working-in-lollipop Nov 20 21:48:25 okay thanks for the warning Nov 20 21:49:28 <_Auron_> I can't seem to figure out how to get an activity to launch after an asynctask finishes Nov 20 21:49:50 thanks napalm! Nov 20 21:52:50 _Auron_: do it in onPostExecute Nov 20 21:53:33 <_Auron_> Can't. "Calling startActivity() from outside of an Activity context requires the FLAG_ACTIVITY_NEW_TASK flag. Is this really what you want?" Nov 20 21:53:55 <_Auron_> Though if I add that flag, my app activity flow gets screwed up. Nov 20 21:54:28 https://www.irccloud.com/pastebin/uJ2SkGdL Nov 20 21:54:51 _Auron_: why are you doing it from outside the Activity? Nov 20 21:54:58 what did they do to the screen brightness control. it used to be at like 10% and now I have to set it to >50% Nov 20 21:55:25 Thorn: you have Adaptive brightness turned on Nov 20 21:55:34 <_Auron_> In the app I'm selecting an event that needs to grab specific data from a server before launching an activity that pertains to that data. Nov 20 21:56:35 _Auron_: have the activity set a callback to the AsyncTask Nov 20 21:56:45 _Auron_: i think perhaps you need to think about this a little more Nov 20 21:57:25 that's right Nov 20 21:57:38 Start the Activity before you start fetching data Nov 20 21:57:44 You don't want to randomly start activities Nov 20 21:58:09 You have no idea how long it takes to grab data from the server, the user could have left your app by then Nov 20 21:58:34 <_Auron_> I have a progress pop-up that indicates it's loading data Nov 20 21:58:36 _Auron_: it sounds like you want to use a Loader and have your current Activity as the callback.. this way if it finishes and the user has left that activity you do nothing Nov 20 21:59:51 <_Auron_> Napalm: Thanks, I'll look into that. Nov 20 22:32:17 at 39 days consecutive on SO. if I forget before I get to 100, I'm gonna be mad. it's gonna happen though Nov 20 22:32:39 ** curse you gamification ** Nov 20 22:33:40 im trying to download a picture via java. But something is not working :/. I added the internet permission to the manifest. And i tried to do the downloading in an AsyncTask, because afaik android blocks such things in the main thread Nov 20 22:34:23 i tried to debug the code as far as possible, and it gets stuck during the con.getResponseCode(); in line 20 Nov 20 22:34:28 http://dpaste.com/1FZAEY6 Nov 20 22:34:51 day check out https://github.com/square/picasso Nov 20 22:35:05 day you will be very happy you did Nov 20 22:35:38 mattblang: yeah, i already stumbled across it, but i would like to know whats going wrong there :/ Nov 20 22:36:21 or if i am doing something fundamentally wrong Nov 20 22:37:46 day does it never error out? Nov 20 22:38:17 day: even if response would work, the code woudlnt Nov 20 22:38:21 mattblang: the application doesnt crash. it just runs. Even response to button presses Nov 20 22:38:32 you are not allowed to modify gui elements from inside an async task Nov 20 22:38:37 mattblang: i made it to 70 days and then missed one Nov 20 22:38:38 its not the whole code Nov 20 22:38:41 mattblang: was pissed Nov 20 22:38:44 so line 28 will throw an exception Nov 20 22:38:45 danijoo: that DEFINITELY works ;P Nov 20 22:38:53 JakeWharton oh man, I bet Nov 20 22:39:52 well i dont know if line 28 would work, im stuck at line 20. But ive no issues changing textviews within the asyctask Nov 20 22:40:31 day you can only interact with the GUI on the main thread, so you will need to do that in onPostExecute Nov 20 22:41:03 mattblang: why can i change textviews within the asynctask then? line 19 e.g.? Nov 20 22:44:15 day you definitely shouldn't be able to Nov 20 22:44:23 day make sure you aren't interupretting something incorrectly Nov 20 22:45:23 mattblang: theres nothing in there. Its just a new/empty project with some buttons and textviews to try asynctask etc. Nov 20 22:45:43 day email the project to matt@mattblang.com. will look at it when I get home Nov 20 22:46:05 mattblang: oh, its not a project. Just a learning thing Nov 20 22:46:13 http://dpaste.com/2QAZ14K Nov 20 22:48:50 day: all your textview updates have ot be on the ui thread Nov 20 22:49:06 aka not in doInBackground... in onProgressUpdate/onPostExecute Nov 20 22:49:39 If you're trying to load images I would take a look at github.com/square/picasso or whatever Nov 20 22:49:51 pi-pi-pi-picassssoooooooo Nov 20 22:50:55 Well now that Jake is actually here I should recommend github.com/koush/ion :) Nov 20 22:51:01 hahaha Nov 20 22:51:09 :D Nov 20 22:52:45 hwrdprkns don't forget glide ! Nov 20 22:52:48 i don't care what you use Nov 20 22:52:54 just don't do it yourself Nov 20 22:53:08 ^ words of wisdom Nov 20 22:53:25 hwrdprkns: everone here says ui changes shouldnt be in background. but why? Its working, what is the problem? Nov 20 22:53:39 day try it Nov 20 22:54:07 day: everyone is saying it because its not working in background. Nov 20 22:54:47 danijoo: you see that function call new changeName().execute(testvar)? Nov 20 22:54:53 thats working :/ Nov 20 22:54:53 should this set the background of a view to black: android:background="#000000" ? Nov 20 22:55:25 day: didnt you say your code stops before t? Nov 20 22:56:04 danijoo: my code stops here responseCode = con.getResponseCode(); Nov 20 22:56:15 right before that i do text.setText("test2");//does show up which works Nov 20 22:56:17 how can you know that the line below that is working then :p Nov 20 22:58:15 for some reason it comes up as white Nov 20 22:59:24 ChrisUK: works for me Nov 20 23:01:14 Maybe it's transparent, and the view behind it is white Nov 20 23:01:18 must be something else going on ill check Nov 20 23:01:29 yes seems to be ignoring the color all together infact :) Nov 20 23:01:40 obviously Nov 20 23:02:21 Probably because you omitted the alpha Nov 20 23:04:13 Just attach a debugger and inspect the background at runtime, should tell you what's happening Nov 20 23:04:52 Alpha is between 0 and 1? Nov 20 23:05:30 Sometimes Nov 20 23:06:37 Color resources are #aarrggbb tho Nov 20 23:07:43 cant you set them as rrggbb? Nov 20 23:11:57 ChrisUK: yes Nov 20 23:12:37 How do I stop interstitial ad from leaking? I'm using it basically in the same way as in the official example https://developers.google.com/mobile-ads-sdk/docs/admob/android/interstitial and it still leaks Nov 20 23:19:27 day: hey.. https://gist.github.com/slightfoot/05d2715efb2cda5058ed Nov 20 23:19:42 SimonVT: dont hate me, but i got bored :D Nov 20 23:23:31 what does 'context' mean? Picasso.with(context).load("http://example.com/logo.png").into(imageView); Nov 20 23:24:06 day: http://developer.android.com/reference/android/content/Context.html Nov 20 23:24:18 It's the core of how you interact with the UI in Android Nov 20 23:25:24 yiati: nice try but its not related to UI Nov 20 23:26:00 yiati: day: http://en.wikipedia.org/wiki/Context_%28computing%29 Nov 20 23:26:11 in that case, why would the 'context' be marked as wrong in that context? Nov 20 23:26:32 day: did you look at the example I did for you? Nov 20 23:27:04 it's very much related to UI Nov 20 23:27:29 I feel like I just walked into this room mid conversation, I don't understand your question day Nov 20 23:28:05 JakeWharton: explain? Plenty of things in Android are a Context without UI Nov 20 23:28:23 i didn't say Context was UI Nov 20 23:28:55 oh snap, what did I join into Nov 20 23:29:00 lol Nov 20 23:38:45 what's the hottest for android testing? Nov 20 23:47:33 "Android Studio 1.0 Release Candidate 1 released" Nov 20 23:47:51 really android studio going stable:D Nov 20 23:48:26 "Finally, we are now bundling a local Maven repository containing the Android Gradle plugin and all its dependencies" Nov 20 23:48:29 UGGH! Nov 20 23:48:34 nooooooo Nov 20 23:48:48 well, that's fine if they also publish to central Nov 20 23:49:06 I understand nothing but I like releases Nov 20 23:49:14 g00s: where are you seeing this? Nov 20 23:49:29 http://tools.android.com/recent Nov 20 23:49:34 http://tools.android.com/recent/androidstudio1rc1_releasecandidate1released Nov 20 23:49:36 That's a snazzy new logo tho Nov 20 23:49:59 oh, no big deal there Nov 20 23:50:04 Oohhh Nov 20 23:50:07 Upgrading now :D Nov 20 23:51:25 Oh man, I want to be able to disable the red wiggles when I want to Nov 20 23:51:27 Yaaaay https://www.dropbox.com/s/iqesxtyjv35y5ek/Schermafdruk%202014-11-21%2000.51.21.png?dl=0 Nov 20 23:51:45 oh, my sdk is inside android, what a pain Nov 20 23:52:16 New colors! :O Nov 20 23:52:25 spoilers! :P Nov 20 23:52:48 https://www.dropbox.com/s/wl0uo90qabr176u/Schermafdruk%202014-11-21%2000.52.41.png?dl=0 Nov 20 23:53:10 It's not detecting the classes :o Nov 20 23:53:37 Ah, need to import gradle again Nov 20 23:53:39 Weird Nov 20 23:54:15 turn off the tab bar, it's useless Nov 20 23:54:17 I really hope they make a new design that's all flat and perhaps even material design Nov 20 23:54:18 cmd+e is all you need Nov 20 23:54:40 JakeWharton: definitely Nov 20 23:54:45 also the toolbar Nov 20 23:54:49 I have to "tune" AS, but webstorm is like sublime Nov 20 23:55:05 and click the little icon in the absolute lower left to hide the collapsed panels on the border Nov 20 23:56:00 material design IDE would be chilly af Nov 20 23:56:24 I hardly see material for non-mobile Nov 20 23:56:32 but worth the try heh Nov 20 23:56:33 I like the new icon: https://www.dropbox.com/s/dyx8d3oqkzzoo59/Schermafdruk%202014-11-21%2000.56.20.png?dl=0 Nov 20 23:56:41 Foxandxss: gotta get an inbox invite Nov 20 23:56:48 I have one Nov 20 23:56:51 hwrdprkns, I hav eone Nov 20 23:56:52 I mean, account Nov 20 23:56:55 buut, not using it Nov 20 23:57:04 I have 3 unused invites Nov 20 23:57:11 I do angular, we have material there, but meh, not so sure Nov 20 23:57:14 Don't like inbox Nov 20 23:57:27 classic gmail is good Nov 20 23:57:32 inbox is fantastic Nov 20 23:57:41 bundle all the things Nov 20 23:58:27 Oh that iNbox Nov 20 23:58:38 I confused it with Mailbox from Dropbox Nov 20 23:58:41 Mac Beta Nov 21 00:00:29 Napalm: ah thanks, no i didnt see your example Nov 21 00:00:30 I remember why I haven't signed up for Inbox, they don't accept Google Apps yet (my email is hosted on Google Apps) Nov 21 00:00:50 as JakeWharton said, all the bars and stuff on AS is useless Nov 21 00:00:51 http://puu.sh/cZ2Ea/cb94d7a000.png Nov 21 00:00:53 that is my webstorm Nov 21 00:00:58 seems like sublime Nov 21 00:01:03 but with the power of an IDE Nov 21 00:01:27 i kept the breadcrumbs (which keeps the run config stuff on the right) Nov 21 00:01:42 Foxandxss, I really wish there was a good Monokai theme for AS. Nov 21 00:01:52 They're all literally HORRIBLE Nov 21 00:02:12 So called 'monokai' when it's totally not the same Nov 21 00:02:37 JakeWharton: so far I am good with the setup. Need to see what are those things I like from AS to not delete them Nov 21 00:02:52 Muchoz: http://www.ideacolorthemes.org/home/ Nov 21 00:03:13 my mac is gonna explore, 101º Nov 21 00:03:19 is a dev name like "OverCoder" is nice? :P Nov 21 00:03:50 Foxandxss: http://i.imgur.com/I6Dj4iF.jpg Nov 21 00:03:51 is mine Nov 21 00:04:23 I see, it is cool yeah, sometimes I miss the statusbar Nov 21 00:04:36 alright, AS RC here Nov 21 00:05:00 oh man, thats fucking stupid. i clicked on custom install, pointed to my SDK, and it started re-downloading the SDK and clobbered my installation Nov 21 00:05:16 g00s: same Nov 21 00:05:35 well, it's just overwriting things i already have Nov 21 00:05:45 so the issue I had with AS is gone but then I get some "This is min api 11" when had no complains earlier, good Nov 21 00:06:18 oh, I didn't see that dialog Nov 21 00:06:21 it is destroy time? Nov 21 00:06:31 Napalm, better than the rest but not perfect though https://www.dropbox.com/s/vhemf9k7g49zt6x/Schermafdruk%202014-11-21%2001.06.15.png?dl=0 Nov 21 00:06:33 nah, I close it Nov 21 00:06:38 I'll give it a shot perhaps Nov 21 00:06:57 damn, it comes again, grr Nov 21 00:07:17 alright, same here as well Nov 21 00:07:31 oh thats interesting, samples api 21 rev 3 Nov 21 00:07:32 Napalm, this one comes soooo close: http://www.ideacolorthemes.org/themes/89/ Nov 21 00:07:41 Muchoz: theres a crap ton to choose from Nov 21 00:08:00 i find monokai to be horrendously ugly Nov 21 00:08:27 not as bad as solarized though Nov 21 00:08:31 oh man i need to learn how to import these in AS Nov 21 00:08:31 JakeWharton, I love it! Nov 21 00:08:38 I used to like solarized light Nov 21 00:08:47 hwrdprkns: instructions are on the site Nov 21 00:09:09 Planet Earth in 4K https://www.youtube.com/watch?v=Ybh11kcDhfM oh yea! Nov 21 00:09:10 Love my Sublime Text theme: https://www.dropbox.com/s/i2z37xe666al6nz/Schermafdruk%202014-11-21%2001.08.59.png?dl=0 Nov 21 00:09:13 yap, easy as cake Nov 21 00:09:58 I think I'm gonna enable tabs and disable Open files again Nov 21 00:10:09 i use this for sublime: https://github.com/kkga/spacegray/blob/master/Screenshots/spacegray.png Nov 21 00:10:20 https://www.dropbox.com/s/xrqifql4auf8ue9/Schermafdruk%202014-11-21%2001.10.17.png?dl=0 Nov 21 00:10:37 JakeWharton, the one I'm using is AmCoder. A Monokai version of Spacegray. Nov 21 00:11:06 https://github.com/auiWorks/amCoder Nov 21 00:11:16 my AS is really default in visuals (changed fonts, size, stuff like that, but not theme) Nov 21 00:13:55 is roboelectric the cool kid on testing? I like what I see at least Nov 21 00:14:04 Napalm, the theme is horrible. Barely any colors (all white) Nov 21 00:14:20 so… Android 4.4.2 and Bluetooth.. anyone noticed anything funky going on? Incomplete data perhaps? Nov 21 00:14:23 Muchoz: what theme? Nov 21 00:14:26 And too much blue Nov 21 00:14:30 The monokai theme Nov 21 00:14:43 Muchoz: I have no idea, never seen it before Nov 21 00:14:44 N6 is sweet, btw I recommend it Nov 21 00:15:01 Just use solarized light Nov 21 00:15:03 Link me tricknology Nov 21 00:15:12 it's not the most beautiful but it's the best on your eyes Nov 21 00:15:20 marrrk: used it on the past, hated it but that one seems really really cool Nov 21 00:15:24 N6 as in Nexus 6. Nov 21 00:15:28 (the alternate one) Nov 21 00:15:43 Or at least Nov 21 00:16:00 at least don't use a dark background theme Nov 21 00:16:20 They look cooler but when you look at stackoverflow afterwards you explode Nov 21 00:16:58 bah, there's no way around this stupid wizard. its going to dl whether you want it or not Nov 21 00:17:07 solution: don't sit 2 cm away from your screen Nov 21 00:17:27 tricknology, I switched to the iPhone 6 last month. I'd like my phone to just work and got tired of some stuff in Android. I do like programming for Android :D (HATE TRAIN COMING) Nov 21 00:17:30 bullshit Nov 21 00:17:48 CHOO CHOO Nov 21 00:17:50 marrrk, use f.lux Nov 21 00:17:57 I am using f.lux Nov 21 00:18:10 I also have an iPhone 5s — popular people have blue text messages Nov 21 00:18:14 Nobody having BT trouble in 4.4.2? Nov 21 00:18:23 lame people show up green Nov 21 00:18:34 hwrdprkns, yay! Love texting on my Macbook Pro! Nov 21 00:18:41 I’m having an average success rate of about 40% Nov 21 00:18:43 we are in the cult Nov 21 00:18:53 Muchoz i got a luma 521 for the same reason; it just works. and for $69 off contract Nov 21 00:19:08 g00s, friend of me got a lumia too for super cheap. Nov 21 00:19:15 …across 4 different devices Nov 21 00:19:40 I had a Nexus 5, not many complaints. But I just want my computer and phone to work together. Nov 21 00:19:54 My mail showed up on my computer and my phone. Nov 21 00:19:54 eh? they don’t? Nov 21 00:19:58 g00s: it downloaded crap for me, but the SDK manager seems to be correct, no extra shit nor missing stuff Nov 21 00:20:02 I need to see the responding "..." . It's killer Nov 21 00:20:11 I never ever used my notifications on Android anymore because of it. Nov 21 00:20:24 hwrdprkns, hahaha Nov 21 00:20:24 Foxandxss yeah i don't need x86 images, etc Nov 21 00:20:46 Muchoz: How do you do that? Nov 21 00:20:57 marrrk, what? Nov 21 00:21:12 oh right, it installed everything from the API I had Nov 21 00:21:14 well Nov 21 00:21:18 Texting on your MBP Nov 21 00:21:21 I use x86 for HAXM emulators Nov 21 00:21:25 marrrk, iPhone Nov 21 00:21:28 waiting for geny for lollipop image Nov 21 00:21:37 marrrk, you could use Pushbullet on Android. Nov 21 00:21:51 Hi guys! Is there anyone who had problems creating client id for android app in dev console? When I try to create one, it complains about already used id but it creates two not-working id after that :( Nov 21 00:22:06 I have an iPhone. I thought you were using Android. Nov 21 00:22:11 oh, there are lollpop images already Nov 21 00:22:11 yay Nov 21 00:22:23 well, kinda Nov 21 00:22:24 It's quite pointless though, for me, as long as it does not support WhatsApp Nov 21 00:22:44 Foxandxss: https://plus.google.com/u/0/+GenymotionEmulator/posts/48mTLjGfrB7 Nov 21 00:23:03 Napalm: yeah, just checked again today and saw it Nov 21 00:24:31 oh, AS needs the new options menu tho Nov 21 00:25:03 Wut: https://www.youtube.com/watch?v=IaddB_GQ4Ps Nov 21 00:28:25 anybody know where AS downloads the SDK to ? Nov 21 00:28:27 jesus christ Nov 21 00:28:32 i hate automagical bullshit Nov 21 00:29:19 ~/Library/Android Nov 21 00:29:27 oh god Nov 21 00:30:21 g00s, can it download the SDK? I've always downloaded that seperately. Nov 21 00:30:29 separately Nov 21 00:30:41 from a fresh install, you have no choice. it must Nov 21 00:31:15 g00s: Why don't you use IntelliJ? Nov 21 00:32:08 i'm used to AS Nov 21 00:32:27 its fine Nov 21 00:33:02 i'm just wondering about this release, why would they bundle all the gradle plugin stuff but then force download the sdk Nov 21 00:33:30 JakeWharton: I ended putting AS more or less like you, edited the nav bar a little bit to add the sync gradle button which is useful Nov 21 00:33:43 yeah i should do that too Nov 21 00:33:52 g00s: the reasons are on the site Nov 21 00:34:24 yeah but, if you dont' have network connection you can't start the IDE anyhow, cause it needs to download the sdk (from fresh install) Nov 21 00:34:38 that's not what it's for Nov 21 00:34:58 cmd+e all the way down then Nov 21 00:35:08 Foxandxss what is cmd+e ? Nov 21 00:35:20 a popup with recent files Nov 21 00:35:21 it's like tabs Nov 21 00:35:24 but it doesn't suck Nov 21 00:35:29 cmd+e and then intro Nov 21 00:35:35 you swap to the previous one Nov 21 00:37:24 JakeWharton: I get a weird behavior Nov 21 00:37:49 oh, not weird at all Nov 21 00:38:02 if I have two vertical tabs Nov 21 00:38:08 left is layout, right is code Nov 21 00:38:15 I get, layout - code - preview Nov 21 00:38:22 but preview is not part from the layour, is a side panel Nov 21 00:38:25 right Nov 21 00:38:59 the translations panel is awesome too Nov 21 00:39:06 no idea of how to trigger it, but good Nov 21 00:48:35 Hi could someone help me out with converting a Timestamp (string) into a date and hour (String), I've been spening hours on this matter, Any help is greatly appreciated: Simplified code is at: http://pastebin.com/j4sxfv9h Nov 21 00:54:25 Quitta: what are you trying to do exactly? Nov 21 00:54:55 I'm trying to get from a timestamp the matching hh:mm:ss Nov 21 00:55:04 whats with the timezone crap Nov 21 00:55:09 no idea :D Nov 21 00:55:25 http://stackoverflow.com/questions/18717111/to-get-date-and-time-from-timestamp-android Nov 21 00:55:45 Quitta: do you just want the time? Nov 21 00:55:56 I tried almost every mentioning on Stack Overflow about how to change a timestamp to a time string Nov 21 00:56:12 preferebly a string for the date and one for the time Nov 21 00:56:48 however, it seems every function I use return a totally crappy time/date Nov 21 00:57:06 how hard can it be to fetch the date/time from a timestamp.. :/ Nov 21 00:57:15 lol.. “Something went wrong, please try again” when pulling down the notification bar in 5.0.. wut? Nov 21 00:57:16 man, this has been a bad day. now outta the blue my bash prompt changed to something fucked up Nov 21 00:57:43 sry, g00s, I feel you Nov 21 00:57:44 tricknology they had to get this out for oems by xmas, ready or not Nov 21 00:57:47 or not Nov 21 00:58:25 lol Nov 21 00:58:34 well then I guess 5.1 will be coming a little sooner than expected? Nov 21 00:59:13 i blame AS for deleteing my .bash_profile Nov 21 00:59:14 Quitta: https://gist.github.com/slightfoot/a9f609b753b83c8ad1b2 Nov 21 00:59:21 g00s: it did what! Nov 21 00:59:36 mutha fu*ker Nov 21 00:59:47 I would go absolutely mental if it did that Nov 21 00:59:55 it dissapeared Nov 21 01:00:07 do i assume correctly, that pictures on the UI are always connected to a imageview object? And dynamic picture orientation requires me to move the imageview objects within the visible space? Nov 21 01:00:11 * g00s rages Nov 21 01:00:35 lol, it seems my timestamp is just totally wrong :/ 1416526844375 results in Wed, 12 Dec 46857 14:59:35 GMT, while I took it like an hour ago :/ Nov 21 01:01:06 day: possibly? what are you trying to do exactly? Nov 21 01:01:39 Quitta: erm, no its right.. its altering the input UTC to local TimeZone Nov 21 01:01:43 for display Nov 21 01:01:47 ^ Nov 21 01:02:21 Quitta: are you sure your Locale is set right on your device? Nov 21 01:02:27 and its current time Nov 21 01:02:29 Thursday, November 20, 2014 11:40:44 PM GMT Nov 21 01:02:30 Napalm: atm just wrapping my head around things. Shortterm writting a small learning app that dynamically displays pictures on the ui and opens a chrome instance to a specific webpage if i click on the picture Nov 21 01:02:37 Thu, 20 Nov 2014 23:40:44 GMT Nov 21 01:03:15 day you can get rid of the browser bar with a meta tag Nov 21 01:03:17 on your page Nov 21 01:04:15 tricknology: one step at a time :) Nov 21 01:04:20 http://stackoverflow.com/questions/4068559/removing-address-bar-from-browser-to-view-on-android Nov 21 01:04:23 for when you get there :) Nov 21 01:04:57 tricknology: well once i get there i will want to play the html5 video directly in my app :p Nov 21 01:04:57 Napalm: I just checked my Virtual device and it's local time is correct, it's 2:04 here Nov 21 01:05:35 I believe the problem is related to how I obtain the timestamp in the first place, which isn't explained in the pastebin Nov 21 01:05:44 tricknology: here's a new one for you... you can set the window chrome color and recents-ui color with Nov 21 01:06:14 Quitta: no its not.. its the correct timestamp Nov 21 01:06:22 Quitta: Thu, 20 Nov 2014 23:40:44 GMT Nov 21 01:06:51 g00s your .bash_profile? that sucks.. once while settign up ADB I somehow removed something that didn’t let me cd, ls, or any of the regular commands. It was terrifying. Nov 21 01:06:52 Quitta: GMT == UTC in this case Nov 21 01:07:30 That’s a neat trick, Napalm Nov 21 01:07:31 Hmm, if I fill in 1416526844375 at http://www.onlineconversion.com/unix_time.htm it results in the weird 46857 year Nov 21 01:07:51 so there has to be some issue :D Nov 21 01:07:52 yes because it does seconds not milliseconds Nov 21 01:07:56 http://www.fileformat.info/tip/java/date2millis.htm Nov 21 01:07:58 remove 375 from the end Nov 21 01:08:02 Quitta: ^ Nov 21 01:08:33 don’t make it 000, truncate it Nov 21 01:09:18 tricknology: http://www.epochconverter.com/ WTF Nov 21 01:09:24 FTW Nov 21 01:09:42 Cool! let's see if this fixed the issue Nov 21 01:10:32 oh that’s sweet.. the interface could be a little cleaner but I like the code at the bottom Nov 21 01:10:52 My Tesco Hudl 2 is showing 9h 8m Android OS keep-awake in a period of 9h 38m. :/ Nov 21 01:10:55 seems to work, the year is correct etc, still there is 1 extra hour, instead of 2:06 they made it 3:06 :/ Nov 21 01:11:06 Quitta, use this if you need to: Nov 21 01:11:08 long epoch = new java.text.SimpleDateFormat("MM/dd/yyyy HH:mm:ss").parse("01/01/1970 01:00:00").getTime() / 1000; Nov 21 01:11:31 errrrr Nov 21 01:11:39 String date = new java.text.SimpleDateFormat("MM/dd/yyyy HH:mm:ss").format(new java.util.Date (epoch*1000)); Nov 21 01:11:45 :) Nov 21 01:12:00 Quitta: read again, thats because your 1 hour ahead of GMT Nov 21 01:12:20 this is weird. so the AS wizard downloaded sdk built-tools 21.0.2 instead of 21.1.1 Nov 21 01:13:36 hmm, but howcome doesn't it automatically solve that, since my local time is set to GMT+1 on my device. Nov 21 01:14:07 Anyone aware of any good small Material design open source samples other than googles half-materialised iosched app? Nov 21 01:14:18 god the whole g+ to do beta testing is so fucking lame Nov 21 01:14:56 ifmw half materialized = half baked ? Nov 21 01:14:59 half wit ? Nov 21 01:15:01 :D Nov 21 01:15:14 soo… Lollipop has a flappy bird easter egg Nov 21 01:15:44 tap 5.0 a bunch of times, then long press the lollipop Nov 21 01:15:57 g00s: iosched isn't very true to material docs, especially regards animations Nov 21 01:16:17 yeah Nov 21 01:16:19 But there seem to be absolutely no OSS small material samples other than that Nov 21 01:16:30 i wonder if the NSA has a backup of my .bash_profile Nov 21 01:16:31 so I'm hoping that someone in the channel has spotted some around the web Nov 21 01:17:30 g00s it’s probably right there with the nude selfies you deleted Nov 21 01:17:39 lol Nov 21 01:18:43 i've never been without my feathers Nov 21 01:19:05 you qauck me up Nov 21 01:19:09 quack* Nov 21 01:20:25 So does anyone want to go in on this idea I have for blind people? I probably wont be able to make it materialize but it’s pretty legit.. Nov 21 01:21:29 using Tactus, make a braille phone / reader Nov 21 01:22:47 ifmw: they have now released samples for v21 in the SDK Manager Nov 21 01:23:03 Napalm: I didn't notice that, THANK YOU! Nov 21 01:24:16 oop, it’s going down already I guess. https://www.youtube.com/watch?v=ZSFpxVc0Gm8 Nov 21 01:24:36 tricknology: prob with tactus is it is too specialized Nov 21 01:25:23 meayh i suppose, but maybe tactus-like technology? Nov 21 01:25:38 well the key is to taking existing shit and making it work Nov 21 01:25:47 unless you have some ees and don't mind doing a kickstarter Nov 21 01:26:08 ie why not make a keyboard that uses haptic to spit out morse code? Nov 21 01:26:11 tricknology: its done https://www.youtube.com/watch?v=WJFwHuCs3Yw Nov 21 01:26:20 My uncle is an EE Nov 21 01:26:40 taht.. is a long advert Nov 21 01:27:20 Napalm that is just tactus Nov 21 01:28:01 take those bubbles, make them smaller, and everywhere Nov 21 01:28:21 yea, and? Nov 21 01:28:37 making things small its easy nowadays Nov 21 01:28:43 and then you can display braile Nov 21 01:29:37 TBH, you probably wouldn’t even need a conventional LED display Nov 21 01:29:44 Seems more useful for blinddeaf people than just blind people. Otherwise they'd just use an iPhone Nov 21 01:30:02 but Siri has to talk to you Nov 21 01:30:17 how are you going to talk shit on someone when you have to dictate it to siri? Nov 21 01:30:43 heh, probably don’t need a camera either Nov 21 01:31:04 talking shit is generally accepted to be something you shouldn't do. But I've seen deaf people use iPhones on the train Nov 21 01:31:30 yeah but that’s deaf.. back in the day deaf ppl used to use sidekicks Nov 21 01:31:52 a blind person would have a tough time using a phone without hard keys Nov 21 01:33:02 What is a good simple and clean way to parse out xml data? Nov 21 01:33:47 besides start = string.indexOf(begintag); end = string.indexOf(endtag); … etc Nov 21 01:33:53 substring... Nov 21 01:35:49 tricknology: http://simple.sourceforge.net/ Nov 21 01:38:34 tricknology: http://en.wikipedia.org/wiki/StAX Nov 21 01:38:54 tricknology: http://stax.codehaus.org/ Nov 21 01:39:55 tricknology: https://docs.oracle.com/javase/tutorial/jaxp/stax/example.html Nov 21 01:40:43 eeeh does it need to be a file? I have a string response from a server Nov 21 01:41:00 is this open sauce? I don’t see any sauce anywhere Nov 21 01:41:17 trying to get an idea of size and speed Nov 21 01:41:27 tricknology: no it doesnt need to be a file Nov 21 01:41:50 ah ok because the examples in the doc are with files Nov 21 01:51:57 can i dynamically add a view to a layout? Nov 21 01:52:17 or actually i want to make a a toolbar as new Toolbar() then add it to the layout as an actionbar Nov 21 01:52:58 OverCoder yes you can Nov 21 01:53:09 idk about the toolbar part Nov 21 01:53:30 layout.add(view) Nov 21 01:53:36 oh, nice, thanks Nov 21 01:53:41 err Nov 21 01:53:57 layout.addView(view) Nov 21 01:54:06 http://developer.android.com/reference/android/view/ViewGroup.html Nov 21 01:54:06 oh, o nice Nov 21 01:54:07 :) Nov 21 01:54:10 * OverCoder reads Nov 21 01:54:45 You code can get a little long but I personally enjoy creating layouts programmatically Nov 21 02:01:32 tricknology well sometimes it just feels better/easier/more error free but that actually takes more resources? Nov 21 02:01:39 :P Nov 21 02:09:19 Doing UI stuff in code is a bad practice. Nov 21 02:09:26 ok, so I'm very new to Android Devevlopment, so here is my question: If another app is sending out a Broadcast that I'm using a BroadcastReceiver to listen to...If I want to make my app do something in the background that responds to that, is there a reason not to put that code in the BroadcastReceiver? Like, should I put it in a Service or something? Nov 21 02:09:28 Do it only when necessary, IMO. Nov 21 02:09:40 Maintenance is much easier if you separate UI stuff from problem-domain stuff. Nov 21 02:13:12 anyone? Nov 21 02:14:07 hmmm, i actually setActionBar(new Toolbar(this) and this i set the action bar again after the setContentView, so now the app uses the one specified in the layout, that's not the case, the thing is that the navigation bar is on the top of the actionbar Nov 21 02:14:30 and since it's DrawerLayout there's no android:layout_below Nov 21 02:38:08 Can someone help me out to put the top bar in opera browser on the bottom? Nov 21 02:38:13 Can someone help me out to put the top bar in opera browser on the bottom? Nov 21 02:38:28 A) don't spam B) this channel is for coding Nov 21 02:38:47 #android Nov 21 02:39:23 C) android is driving me crazy ._. Nov 21 02:40:34 A) my client said it didn't send Nov 21 02:41:01 The first message. B) yes its a coding question. It can't be done by default Nov 21 02:42:16 did you decompile it? Nov 21 02:42:34 No why would I? Nov 21 02:42:54 they how you're gonna modify opera's code without it's source code? Nov 21 02:43:12 intellij update requires gradle plugin 0.14.2 ! Nov 21 02:43:53 OverCoder: I'm sure I have the source code Nov 21 02:44:37 a, android studio is in version 1.0.0RC Nov 21 02:47:03 facebook sdk question. I keep getting errors that my key hashes don't match any uploaded to facebook. They are clearly there. Do I need to setup a release hash while developing? Nov 21 02:47:41 make developemnt project in developers.facebook.com Nov 21 02:48:52 http://i.imgur.com/AILE6rp.png Nov 21 02:49:10 When I put my dev key into the top input...it says I have no key hashes configured Nov 21 02:49:25 Shouldn't I be able to use the same app? Nov 21 02:51:42 fuck facebook Nov 21 02:54:31 can anyone with a mac tell me what .bash* files exist by default ? Nov 21 02:54:47 like .bash_profile, i think 1 or 2 others Nov 21 02:54:50 ciree: we have special dev build Nov 21 02:55:52 g00s: .bash_profile .bash_history .bashrc Nov 21 02:55:54 I guess Nov 21 02:55:58 fuck, i don't even have .bashrc Nov 21 02:56:12 oyu dont have to Nov 21 02:56:14 it's empty Nov 21 02:56:29 gordon_ your .bashrc is empty ? Nov 21 02:56:37 just my stuff like variables Nov 21 02:57:10 seems like .bash_profile is rvm stuff only Nov 21 02:57:21 and .bash_history is... you know what :) Nov 21 02:57:36 seems like you dont need those files Nov 21 02:57:44 also -> use zsh Nov 21 02:57:47 with oh-my-zsh Nov 21 02:58:45 i would use zsh, but oh-my-zsh seemed like a ton of crap Nov 21 02:59:38 you dont need to use everything, right? just plugins you want **** ENDING LOGGING AT Fri Nov 21 02:59:58 2014