Android Question Compiling a native android application in more detail?

Caligari

Member
Hi all!
And hi Erel!

B4X - very cool project!
I am engaged in programming from time to time - as needed, for my own needs. Mobile development is a new challenge for me. B4X seems to be the right tool for this. Just started studying. And my first question: can you explain the process of compiling a native android application in more detail?
 

Erel

B4X founder
Staff member
Licensed User
Longtime User
Welcome to B4X.

Best to start with the guides: https://www.b4x.com/android/documentation.html

Compiling an app, that can be distributed, is a matter of:
1. Switch to Release:

1612859253058.png


2. Click on the Run button (play icon).

The APK will be created in the Objects folder of your project.
 
Upvote 0

Caligari

Member
Thank you, it's very simple - I figured it out a long time ago. I meant what happens "under the hood". Is the B4A code compiled to bytecode immediately, or is it first generated into Java code? If the second option, where can I see the Java code?
 
Upvote 0

Caligari

Member
There is nothing good to do with the Java code. No need to touch it.
Thank you, I understand. I just wanted to know how it works. It turns out that before compilation, the program is translated from one high-level language to another. Haven't seen this before)
 
Upvote 0

Caligari

Member
B4X is an impressive example showing this does works good.
Judging by the activity of the forum, the number of examples and libraries - certainly yes :)
I just want to understand why the entry threshold is lower and the development speed is ensured compared to Java + Android Studio or Flutter, for example.
Trying to decide what to choose.
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Android Studio or Flutter,
There is NO relevance for Android Studio or Flutter.
The Code generated by B4X is not useable in both of them.

Talking about Development speed. Most probably you are faster using B4X than using any other Platform.
 
Last edited:
Upvote 0

Caligari

Member
There is NO relevance for Android Studio or Flutter.
Probably you didn't understand me.
That's what I meant: I need to write a couple of applications for my own micro business. Programming is not my main activity, but I have experience in writing programs in Delphi, VBA, JS (for Adobe Indesign), etc. Mobile development is a new experience for me. And I'm trying to pick a development tool. And here are the options I am considering:
Java + Android Studio
Flutter + AS or VSCode
B4X \ B4A
Options 2 and 3 are tempting with the ability to make cross-platform applications. B4A (as, indeed, and Flutter) promise not very high threshold of entry and rapid development.
And so I'm trying to figure out how these promises are fulfilled in B4A. The question of the compilation process arose during the study.
 
Upvote 0

Brian Dean

Well-Known Member
Licensed User
Longtime User
... not very high threshold of entry and rapid development.
I think that you will find B4X fulfils both of these requirements. I also came here from a Delphi coding background and found it very easy to transfer. The biggest hurdle is understanding the Android life-cycle, but that has nothing to do with B4A and can be largely avoided if you use the B4XPages approach. But I would add one more thing - This forum is excellent, and far better than any other that I have found. (StackOverflow is perhaps the closest). You will usually get an expert answer to any question in less than an hour - that is a real benefit.
 
Upvote 0

agraham

Expert
Licensed User
Longtime User
That's what I meant: I need to write a couple of applications for my own micro business.
For that use, where what is important is the functionality and the ease of making any adjustments to the app then I would heartily recommend starting with B4A and B4Xpages. If for some reason you then wanted to change later on you will have your program structure and algorithms coded and have some experience of the Android environment.

As a bit of background to my recommendation I would class myself as an (ex) professional software developer very familiar with Visual Studio, C#, Windows Forms and WPF. I have also written some of the libraries available here using Java in Eclipse. I have never (and will never) use Android Studio as I want to enjoy playing with producing code for Android and not fight it. B4A takes care of all the nitty-gritty details needed to make an installable apk some of which can easily trip you up in AS.
 
Last edited:
Upvote 0

josejad

Expert
Licensed User
Longtime User
Options 2 and 3 are tempting with the ability to make cross-platform applications
I've just made some small apps for my workmates. But days ago, I test with B4XPages (as Erel said, you should use it even if your target is just one platform) and made my little test. After that, I opened the project with B4J, I got some errors... and with a few forum searches, the code was working with B4J too (windows, mac, linux...). Now a mate of the forum has opened it with B4i and with a few more changes, it will be working in iOS too... (changes due I'm not used to make things thinking in multiplatform)
I don't know with flutter, but with B4X it's quite easy to make multiplatform apps, at least easy ones. And you can take a look to the B4X Pleroma example from Erel, complex ones can be made too...
 
Last edited:
Upvote 0

josejad

Expert
Licensed User
Longtime User
And here are the options I am considering
Come on¡¡ Stay with us...
Try to post in a flutter forum. If in less than a few hours you have 14 answers, including the platform's creator (and two experts) saying "welcome"... Then give a try...
 
Last edited:
Upvote 0

Cableguy

Expert
Licensed User
Longtime User
Upvote 0

agraham

Expert
Licensed User
Longtime User
Dont forget to create a keystore and change the programme default one!!
He won't need to as the apps appear to be for his own small business use and won't need to be published - which gives a lot more flexibility by not having to abide by Play Store rules.
 
Upvote 0

agraham

Expert
Licensed User
Longtime User
One of the apps must be installed on clients' devices.
If you side load it by B4ABridge or by FTP or by inserting an SD card or any by any other non Play Store means you don't need to worry about signing the apk with your own key. This makes things dead simple. Test, compile in Release mode and distribute the apk.
 
Upvote 0

Caligari

Member
If you side load it by B4ABridge or by FTP or by inserting an SD card or any by any other non Play Store means you don't need to worry about signing the apk with your own key
Yes, I understand that. In the process of experimenting, that's exactly what I do: debugging with adb over wifi and for testing on other devices, I send apk via telegram. But in the future, for installation on client devices, I will have to redistribute through the Play Store.
 
Upvote 0
Top