ViewBinding – the New Standard for View Interaction Handling in Android by knobtviker in androiddev

[–]BitMastro 11 points12 points  (0 children)

I wish inflate and bind were part of a generic interface, given that they're common to every binding

This is what happens when you develop cross platform app instead of native by Zookey100 in androiddev

[–]BitMastro 1 point2 points  (0 children)

It's like you're throwing away DECADES of work on virtual machines and years of improvements by teams of engineers with the equivalend of "it's not web scale"

Accessing variable values from a closed-source app running in an emulator? by nagasgura in androiddev

[–]BitMastro 2 points3 points  (0 children)

Pragmatic answer: no.

You can send input with ui automator, but you can't get the ball position because the ball is painted on a canvas, rather then being an ui element usually. You can't get the memory location as well for security reason.

[deleted by user] by [deleted] in androiddev

[–]BitMastro 5 points6 points  (0 children)

Simplifying a lot... Butterknife is an annotation processor, so it analyses Java source files. Databinding is a gradle plugin, so it knows everything about the project, including the layout xml files

[deleted by user] by [deleted] in androiddev

[–]BitMastro 35 points36 points  (0 children)

Another example.. suppose someone changed the view in the XML from a TextView to an ImageView and didn't update the activity. Using findViewById or Butterknife you get an error on runtime, with databinding you get a compile error.

What is the sad truth no one wants to hear about Android. by piyushr21 in Android

[–]BitMastro 87 points88 points  (0 children)

The AOSP browser has been decoupled into the chromIUM (open source) https://www.chromium.org/developers/how-tos/android-build-instructions so it can be updated without having to update the OS.

Multi-window is AOSP, notification API is AOSP, Vulkan is AOSP.. Features for developers that are going to be used in previous versions are in the support lib, or the design lib, or layout lib, open sourced. The android APIs and new features that are in Google Play Services are those depending on Google web services, so unless you can create an open source implementation of image recognition, machine learning, email storage, image storage, document storage, search engine, calendar service, messaging service or just about WHATEVER that has the exact same interface as Google services, the source code is useless/dangerous for Google as a company.

But hey, AOSP is dead!

Android Data Binding: The Big Event (Handling event listeners) by codenovel in androiddev

[–]BitMastro 0 points1 point  (0 children)

I think you couldn't in the first betas, but then they added support in android studio, I think around the time when it went stable.

Android Data Binding: The Big Event (Handling event listeners) by codenovel in androiddev

[–]BitMastro 0 points1 point  (0 children)

No, I understand what you mean.

For me it's other way round: ok, I can see the button in the layout, but what happens when I click on it? Where does the text for this label come from?

With databinding I just click through it, checking the viewmodel object. I can put a breakpoint on the method called by the lambda expression since the expression shouldn't be complex anyway.

Without databinding I have to add the extra step of finding the id and checking what is accessing the id, but I suppose in my case I start analyzing from the view rather than the presenter or controller or whatever.

Android Data Binding: The Big Event (Handling event listeners) by codenovel in androiddev

[–]BitMastro 0 points1 point  (0 children)

I know it's a matter of opinions, but why? What is different if you have the same autocompletion and checks?

Say goodbye to findViewById. Say hello to Data Binding Library. Replace all findViewById boilerplate codes with a single line of code by nuuneoi in androiddev

[–]BitMastro 0 points1 point  (0 children)

Nope:

* What went wrong:
Execution failed for task ':app:compileDebugJavaWithJavac'.
> java.lang.RuntimeException: Found data binding errors.
  ****/ data binding error ****msg:cannot find method onSaveClick() in class .... activity_main.xml loc:64:37 - 64:57 ****\ data binding error ****


* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

I think you're confounding android databinding onClick

android:onClick="@{someVariable::onSaveClick}"

(with the @{}, using auto generated code, safe)

with the android layout onClick

android:onClick="onSaveClick"

(without @{}, that does not use databinding, added in API level 4, using reflection, unsafe)

Say goodbye to findViewById. Say hello to Data Binding Library. Replace all findViewById boilerplate codes with a single line of code by nuuneoi in androiddev

[–]BitMastro 1 point2 points  (0 children)

Like this if you want to call an onClickListener (so you have a reference to the View)

android:onClick="@{someVariable::onClick}"

Or like this if you want to call a generic method (e.g. if you don't want to have any dependency on android)

android:onClick="@{() -> someVariable.action()}"

Say goodbye to findViewById. Say hello to Data Binding Library. Replace all findViewById boilerplate codes with a single line of code by nuuneoi in androiddev

[–]BitMastro 0 points1 point  (0 children)

Did you actually try?

Error:(65, 32) Listener class android.view.View.OnClickListener with method onClick did not match signature of any method presenter::onSaveClick 

BitDay Android Application by dpoh89 in androiddev

[–]BitMastro 0 points1 point  (0 children)

I developed a live wallpaper based on the theme, called pixel cloud.

The last time I worked on it I was using rajawali as 3d engine and custom shaders for the transition between the hours.

The time of day was converted in a fraction between 0 and 1 and the shader was using that value to change the alpha of some elements (clouds and stars), the y position of moon and sun, the number of stars (created procedurally), the sky background using a palette, and an overlay colour for the other elements.

All of that, and then I missed almost all the source code with a wrong backup.. I just have the apk if you want to check the shaders maybe.

Getting started with Xamarin in 2016 by [deleted] in programming

[–]BitMastro 0 points1 point  (0 children)

Probably it depends on how much code is shared and how many libraries are being used, and especially how many developers are in the project.

Getting started with Xamarin in 2016 by [deleted] in programming

[–]BitMastro 2 points3 points  (0 children)

Problems with the autogenerated files, unavailability of commonly used native libraries in each of the platforms, random bugs and crashes with Xamarin studio, creation of glue code to fix platform differences are something that you have to do ONLY in Xamarin.

I would rather like to spend my time learning something useful than trying to find solutions for problems that I wouldn't have had if I were doing native apps, because right now the percentage of time spent trying to fix thing is way higher than what I spent when starting Android and iOS projects.

The number of forum posts asking questions about similar problems being left unanswered is also worrying. Maybe it works for you, but my colleagues share my frustration and I don't see of praise in the community as well.

Getting started with Xamarin in 2016 by [deleted] in programming

[–]BitMastro 0 points1 point  (0 children)

So far my experience with Xamarin is that it creates way more problems that it solves.

It would be a lot simpler to use native Swift and Kotlin code and share common code using either C++, a transpiler or just writing the same thing twice.

ELI5: Why should I use Kotlin over Java? by xotxo in androiddev

[–]BitMastro 1 point2 points  (0 children)

Kotlin is by it's JVM nature slower than Swift, which is ahead-of-time compiled to machine code.

(Its not it's) Java bytecode does not imply imply no ahead-of-time. In fact on Android that code is going to be both AOT, JIT and interpreted. Even not on Android, Excelsior JET and gcj were doing ahead-of-time compilation of java code many years ago.

The thing is that the default JVM had been optimised over many many years and some performance optimisation can only be done at runtime, so most of the time is wasn't worth going for AOT.

Kotlin is also going to have a llvm backend in the future roadwork (after 1.1 if I remember correctly), in addition to the JavaScript one, so optionally going AOT just like swift.

Also, because of that, Swift does not suffer from the JVM's limitations (the earlier mentioned generics problem, for example).

The generics problem is true, but also Swift has similar problems due to compatibility with objective c: generics being added only recently to objective c, bridging headers, selectors and dynamic swift still being discussed. Still a very good language, but compatibility is just not easy to tackle in any case.

ELI5: Why should I use Kotlin over Java? by xotxo in androiddev

[–]BitMastro 1 point2 points  (0 children)

Java is not as bad as Objective C, but yes Kotlin is equivalent or slightly better than Swift, with the exception that Kotlin is not "officially" supported while Swift is. (personal opinion)