News for hackers. Stuff that matters.
Re:Dart for Android apps with 120fps by cel1ne on Saturday May 02, 2015 @06:21AM (#9476547)
The problem with Android isn't Java, but that it has one of most terrible, buggy, undocumented and confusing SDKs I have ever seen. It tries hard to touch every anti-pattern on the planet.

Android could be much more performant, but one would have to replace almost everything regarding UI and layout. Apps built with Dart cannot be much faster unless they do that.

I thought about rewriting/extending the base-class "View.java" to get more performance and less bugs (the default layouting algorithm seems to have exponential runtime! [0]), but the problem is

a) it would break compatibility with many other UI-components and

b) the behaviour and structure of the code is almost impossible to understand and imitate.

Just look at this beast: 8866 LOC without comments in one class [1].

[0] https://stackoverflow.com/questions/17493819/is-android-layo...

[1] http://grepcode.com/file/repository.grepcode.com/java/ext/co...

Re:Dart for Android apps with 120fps by gagege on Saturday May 02, 2015 @12:25PM (#9477582)
The obtuse answers on that thread are also the typical types of answers I see from the Android community as well. It's like the people heavily involved in Android are unaware that there is a whole other world of nicer and more efficient SDKs out there.
Re:Dart for Android apps with 120fps by aboodman on Saturday May 02, 2015 @02:07PM (#9477936)
Did you watch the video? This project replaces everything about ui and layout within your app.
Re:Dart for Android apps with 120fps by bicx on Saturday May 02, 2015 @10:24AM (#9477159)
What do you mean? There are tons of comments in that class.
Re:Dart for Android apps with 120fps by jsnell on Saturday May 02, 2015 @10:35AM (#9477207)
8866 LOC after lines containing comments have been excluded from the count, I'd assume.
Re:Dart for Android apps with 120fps by 5ersi on Saturday May 02, 2015 @12:24PM (#9477578)
According to 'cloc' this file contains 8866 lines of code, 10281 lines of comments and 1844 blank lines.
Re:Dart for Android apps with 120fps by TazeTSchnitzel on Saturday May 02, 2015 @04:54PM (#9478527)
Trying to open [1] in Firefox froze the browser for several seconds. Wow, Google.
[dead]
Re:Dart for Android apps with 120fps by cel1ne on Sunday May 03, 2015 @06:31AM (#9480763)
Granted, the use of word "bugs" was a bit too much.

I consider it a bug when ´Environment.getExternalStorageState´ tells me the SDCard is mounted, when the SD-slot is empty. That was because parts of Samsung's internals storage where referred to as external storage.

I consider it very bad design when Android allows me to write Views that cause layout-passes multiple times during construction. (Because of setTypeFace). That Views are riddled with methods which cause re-layouts mixed with others that don't. There should be an annotation for this. I know, nowadays there's a logging-statement if that occurs, that wasn't there in Android 4.2 IIRC.

On a complicated app you can either do proper separation of concern and compose everything in nested Views, but you have to throw everything back into a single View to get more performance. Or you write your own layout-manager which is what I did.

It's impossible to define constraints on animations. I can't tell android, hey that view is going to change it's height, but not it's width and it won't affect anything else, so save yourself some time and stop calculating the height of this letter for the 546th time in the last 10 seconds. rant rant

Hardware-Acceleration is a different matter. I ended up disabling it completely, because it would accelerate some animations, fades and make some other parts jittery. Most fine-grained layer-control specified in the Guide doesn't seem to affect anything.

And so on, and so forth.

Android development is painful compared to other SDKs and that's why app-quality is so low. You can claim that stems from confusion: no it doesn't, i've read large parts of the (UI) code by now and I've written software in many languages for many years.

Or ignorance: Maybe in the sense that I refuse the reason for all this: That most of Android was baked hastily in the beginning to get something out and fixing mistakes which would require most APPs to be redone is close to impossible. Android is the new Windows. ;)

Re:Dart for Android apps with 120fps by esrauch on Saturday May 02, 2015 @01:13PM (#9477748)
> But let's have a look at the actual code that you stated didn't have comments

He meant it was 8800 lines excluding the comment lines, not that the file didn't have any comments.

Re:Dart for Android apps with 120fps by bitmapbrother on Saturday May 02, 2015 @02:18PM (#9477977)
I still don't see why this is a bad thing. Sure it would be nice if they split the file into multiple source files for maintainability. But, should we also chastise the Linux kernel for having source files that have more than 5K+ LOC that aren't documented nearly to the extent the Android source is?
Re:Dart for Android apps with 120fps by bane on Saturday May 02, 2015 @11:23AM (#9477382)
That's kind of scary that it passed internal code reviews and made it into production without comments. It speaks to Google's internal processes quite a bit.
Re:Dart for Android apps with 120fps by duaneb on Saturday May 02, 2015 @02:26PM (#9478010)
It has comments. They do not contribute to the line count.
Re:Dart for Android apps with 120fps by myko on Saturday May 02, 2015 @12:58PM (#9477692)
Android is a different beast within Google.

I'm hoping with Rubin out this changes and Android is held to similar standards as the rest of the company.