Basic4Android: Drawbacks (if any)?

Shohreh

Member
Hello

I'd like to write applications for Android devices (smartphones and tablets) and someone mentionned Basic4Android.

A short investigation shows that Android appears to run on a JVM, and since there's no BASIC compiler for the JVM, the normal way to write Android applications is through Java (or JavaScript).

I have a couple of questions:
1. Does it mean that Basic4Android applications bypass the JVM entirely and are native Linux applications?

2. Would I be missing features/add-ons by writing applications in Basic4Android instead of Java?

Thank you.
 

NJDude

Expert
Licensed User
Longtime User
I have a couple of questions:
1. Does it mean that Basic4Android applications bypass the JVM entirely and are native Linux applications?

B4A generate native bytecode.

2. Would I be missing features/add-ons by writing applications in Basic4Android instead of Java?

Thank you.

Not exactly what you mean by that but B4A has a growing number of libraries.
 
Last edited:
Upvote 0

Shohreh

Member
Thanks for the infos.

What I meant is: Compared to writing Android applications in Java, should I expect to have significantly less options when writing Android applications in Basic4Android?

As a similar example, there are a lot less third-party add-on's for Delphi than VB.Net. Which explains why Delphi is a niche product.
 
Upvote 0

thedesolatesoul

Expert
Licensed User
Longtime User
Let me put it this way for you.
If you learn to write Java and libraries for B4A then there are no less options for you.
If you cannot write libraries then still you are well covered.
If you have some specific app in mind then maybe it will be easier to answer your question.


Sent from my GT-I9000 using Tapatalk
 
Upvote 0

Jost aus Soest

Active Member
Licensed User
Longtime User
The libraries will give you nearly everything you will need.

But...

The language is BASIC and not Java, so currently you may miss some nice programming concepts, e. g. Classes or Overloading.
But Erel is developing the product continuously and the Basic4Android-compiler is based on Java... :cool:

For me - as I know very well Visual Basic and Java - it was better to use Basic4Android, because of a much faster development cycle and the superb community in this forum.
 
Upvote 0

Shohreh

Member
Thanks everyone for the feedback.

Am I correct in understanding that
  • Android require all apps to run above its Dalvik Virtual Machine
  • An application must first be compiled to bytecode, before the DVM will compile it into a Dalvik Executable (.dex) that the DVM can run
  • B4A compiles BASIC source code into bytecode
?

Also, I read about native/non-native applications: Do non-natives bypasse the DVM and make calls to Linux directly?
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Android require all apps to run above its Dalvik Virtual Machine
An application must first be compiled to bytecode, before the DVM will compile it into a Dalvik Executable (.dex) that the DVM can run
B4A compiles BASIC source code into bytecode
This is correct. B4A actually generates Java code which is then compiled with the Java compiler into bytecode.

Non-native applications run inside the WebView control (browser engine). Just to avoid confusion, Basic4android creates native applications.
 
Upvote 0

NeoTechni

Well-Known Member
Licensed User
Longtime User
The main downside is programming for B4A is so easy/fast, that you'll never want to touch java again.
 
Upvote 0

Shohreh

Member
Thanks for confirming what I thought I understood from reading various articles on the web.

A couple more questions :)

  • Google only mentions Java as the language to write Android application: Does it mean there are downsides when using other languages (Basic, Python, etc.)? Otherwise, why would people bother using a harder/less productive language?
  • Will applications written in B4 run on any Android device, whether it's smartphones or tablets, or should I expect compatibility issues?
  • And out of curiosity, why is it called "Basic4ppc"? Because it started as a language used to write applications for the Mac when it was still using PPC processors?

Thank you.

Edit: I'm still confused about what native/non-native apps are. Depending on the articles I read, it can either mean:
  • compiled for the DVM/web apps
  • compiled for the DVM/compiled in library into non-bytecode and called by Java through JNI
  • compiled as non-bytecode apps, bypassing the DVM entirely
 
Last edited:
Upvote 0

Osi

Member
Licensed User
Longtime User
If you do not find any libraries you need in B4A, you can create them in Java :) The only library I have not found so far is a game/opengl 2d library. Other than that, smooth sailing so far ... (oops, except for the lack of classes, but the creator of B4A says classes are coming).
 
Upvote 0

Cableguy

Expert
Licensed User
Longtime User
•And out of curiosity, why is it called "Basic4ppc"? Because it started as a language used to write applications for the Mac when it was still using PPC processors?

Back "in the old days", Erel created Basic4ppc( ppc - Pocket Personal Computer ), when Windows Mobile was about the only real bet in the "PDA" market... Basic4Ppc is also capable of creating Win32 executables...
We...yes, I dare say "we"... started as a very small community, and the forum was hosted and mantained by one of the "users", GeoTrail at the time... Then Erel decided that the traffic/buzz created by B4Pc was justifying a webhost of its own, so he created Basic4ppc.com...This was years before Google introducing the Android OS...
With the growing buzz created by the forum users, Erel crated Basic4Android, but, since the webpage/forum already existed as is, he kept it, sub-dividing the forum into product related sections...
Hope to be clear and exact enought...:sign0089:
 
Last edited:
Upvote 0

NeoTechni

Well-Known Member
Licensed User
Longtime User
Thanks for confirming what I thought I understood from reading various articles on the web.

A couple more questions :)

  • Google only mentions Java as the language to write Android application: Does it mean there are downsides when using other languages (Basic, Python, etc.)? Otherwise, why would people bother using a harder/less productive language?
  • Will applications written in B4 run on any Android device, whether it's smartphones or tablets, or should I expect compatibility issues?

Thank you.

Edit: I'm still confused about what native/non-native apps are. Depending on the articles I read, it can either mean:
  • compiled for the DVM/web apps
  • compiled for the DVM/compiled in library into non-bytecode and called by Java through JNI
  • compiled as non-bytecode apps, bypassing the DVM entirely

-Actually Google also mentions C++ in the NDK.
-They program in java mainly cause that's what Android is set up to accept. The B4A program converts Basic to java. And devs use java cause they're masochistic.
-It runs on any Android device, be it phone or tablet
-Native is C++ done in the NDK, non-native is Java, which runs in the virtual machine
 
Upvote 0

Shohreh

Member
Basic4Ppc is also capable of creating Win32 executables.

Really? I understand that B4PP is deadware, but I'd be curious to know if it's a good solution to write Win32 apps in object BASIC. I find .Net a pain because of its dependence on the .Net framework + slow startup time.
 
Upvote 0

andymc

Well-Known Member
Licensed User
Longtime User
Yes, that's correct. Apps that use C++/NDK code, will bypass the dalvik virtual machine (DVM) and use the hardware more directly. However the drawback to this is that your app may have problems on certain devices that may use different hardware, such as the upcoming intel based Android devices.
 
Upvote 0

Shohreh

Member
Yes, that's correct. Apps that use C++/NDK code, will bypass the dalvik virtual machine (DVM) and use the hardware more directly. However the drawback to this is that your app may have problems on certain devices that may use different hardware, such as the upcoming intel based Android devices.

Thanks for the confirmation.

As for using B4PPC to write Win32 apps:
Basic4ppc is based on Microsoft’s .NET technology – the latest standard from Microsoft. Applications written with Basic4ppc are then compiled to .NET executables (modern Windows .exe files) and can be distributed freely
(The Essential Basic4ppc.pdf)

So it's .Net-based just like VB.Net and there's no point in choosing B4PPC to write small applications that run on Win32 directly?
 
Upvote 0
Top