Discussion in 'Chit Chat' started by Erel, Jan 29, 2015.
Erel, that's fantastic!!!
So it handles activity/service/class events as well!?
(What do you mean with class events?)
It works with hooks that I add to the template code.
Will it support external library (.jar file) ? If yes, can I compile it to B4A wrapper?
I guess Java should be the next language I learn. I mean that in the broadest of terms, attempt to understand might have been more precise.
Thanks for this.
I guess a B4A class is also coming from a Java class, which has events like onCreate etc? To be honest, there is no point in hooking into class events, but I just wanted to be generic.
I may be complicating things but there are a couple of scenarios I think about:
- There is a possibility of running setTheme in onCreate BEFORE calling super.onCreate and setContentView to change the theme at runtime
- There is a possibility of running onPreparedOptionsMenu AFTER the template code to decontruct and reconstruct the menu
- There is a possiblity of completely overriding events like onPrepareOptions (not a good option, but it means you dont have to deconstruct things)
I know this is for the savy, the slick and the spurious, but hey, you are the sublime!
Can you elaborate on this?
The answer to this is yes.
Add AdditionalJar to the attributes.
You will have to do imports in the inline java. And call methods.
If you write your code in a class you can compile to B4A lib.
But again, it also depends on the complexity of the lib. It will be less typing than Java Object but I think it will offer the same features.
My thoughts: It IS very helpful to many developers but hopefully there is not too much Java coding & questions here in the forum the next months or new functions which will be coded only in Java. The main reason for me using B4A is not to use Java. We will see.
Yes. This is exactly the example in the first post.
You will be able to prevent the standard onPreparedOptionsMenu from running at all and run your code instead (or run both where your code runs first).
Not really understanding all what is said but seems to be a great step for B4A
That is very impressive then.
I just realized that _onCreate runs first then Activity_Create and then Test.
Its a little bit insane and dizzying!
Why "#if Java"? Shouldn't it be something like "#begin Java"? It's not really a test, it's an indication that what is to follow is Java, not B4A.
Or am I just stupid and missing the obvious?
You can say the same thing about #If B4A or #IF B4J.
The inline Java feature is based on the same conditional compilation system.
This will add a new level of possibilities. Many, many thanks.
But, will there ever be a situation when #If Java is false? And, if there is, wouldn't that kind of break the useability of this feature pretty hard?
I can easily see why #If B4A or #If B4J could be false, so there it makes sense, but if we are in a situation where Java is not available, wouldn't that break everything?
Edit: Nevermind. After reading the post on inline ObjectiveC in B4i, I get it. I forgot that we don't always compile to Java...
Thank you Erel so much, you succeeded in dragging me to java that I always didn't like.. now I can tweet java codes until I learn the language and one day can write entire app with java.
Is this ironical?
I think the inline feature will be a great feature. For instance you can implement code-snippets in JAVA directly in your B4a-code without the hassle of writing a wrapper and loosing time. I think the aim of this feature is just to make B4a even more flexible than it is today. If you want to use it, that is up to you.
Knowing Beja, it is absolutely not ironical. He only wanted to thank Erel for letting us use Java easily along with B4A