Android Tutorial Basic4Android for Linux (Ubuntu) - Installation Script

Hy everyone,

Here is a little script to install Basic4Android on Linux (realized and tested on Ubuntu 12.04 LTS 64bit )

To run this script:
1 - Edit B4A_Installer_en.sh with your favorite text editor
2 - replace the contents of variables ProgInstallB4A and UrlB4A ...
ProgInstallB4A=b4a-trial.exe
UrlB4A=http://www.b4x.com/android/files/$ProgInstallB4A​
...by the name and the url for downloading full version program.
3 - run a terminal
4 - from the terminal run the script B4A_Installer_en.sh
5 - respond with 'y' ( yes) to all questions of installation process

except Java for Linux and Wine 1.6, all components are installed on $HOME/workspace_b4a. So simply delete directory to remove this installation.

There is no copyright, then you can modify this script.

Note for Erel : I think it's not very hard to do Basic4android fully compatible Linux.
It should :
- Adapt the code for Mono (few changes to do).
- Allow to execute scripts and bin included in Android SDK for Linux.
- Allow to execute java bin for linux.
I think it is worth to implement this solution. I would thrilled to participate (if you want).

Sorry for this very bad translation - Thanks to Google Translate ;-)

Best Regards.

File updated 15/11/2013: change the installation script, replacing installation of "windows6.1-KB976932-X86.exe" (too heavy) by adding command "WINEDLLOVERRIDES=gdiplus=n" in the launcher.

File updated 05/05/2014: change the installation script, included Java 1.7.0_55 and android-sdk_r22.6.1-linux

File updated 06/05/2014:Update installation script, few fixes in lib_Installer.sh and B4A_Installer_en.sh
 

Attachments

Last edited:
@zolive33
PS the .desktop file used by the script is Basi4android.desktop. However, the script actually creates Basic4android.desktop. Could you explain why?

Hello John, I made a mistake, I'll correct it for next update. But I don't understand why the launcher is created with the name Basic4android.desktop.
 
Last edited:
@zolive33
/home/john/Downloads/lib_Installer.sh: line 25: /dosdevices/c:/windows/temp/override-dll.reg: No such file or directory
/home/john/Downloads/lib_Installer.sh: line 26: /dosdevices/c:/windows/temp/override-dll.reg: No such file or directory
/home/john/Downloads/lib_Installer.sh: line 27: /dosdevices/c:/windows/temp/override-dll.reg: No such file or directory
/home/john/Downloads/lib_Installer.sh: line 33: /dosdevices/c:/windows/temp/override-dll.reg: No such file or directory
wine: invalid directory in WINEPREFIX: not an absolute path
rm: cannot remove ‘/dosdevices/c:/windows/temp/override-dll.reg’: No such file or directory

Oh! it's a very bad bug ;-) the variable $Winedir is not initialized.
I'll correct it, test it and update it tonight.

Regards.
 
Last edited:
Oh! it's a very bad bug ;-) the variable $Winedir is not initialized.
I'll correct it, test it and update it tonight.

Regards.

Thanks. New version worked OK.

The original script had lines like:
echo "[Desktop Entry]" >$wksB4A/Basi4android.desktop

This is why I didn't understand why the launcher was created with name Basic4android rather than Basi4android.

Latest script has had these lines changed e.g.
echo "[Desktop Entry]" >$wksB4A/Basic4android.desktop

The script installed the trial version. I wanted to install the latest paid version. So I amended the script & it installed OK:
ProgInstallB4A=b4a-u760.exe
UrlB4A=

Just one question: when I try to 'Tools -> Configure Paths' in B4A (needed in order to compile an app), I need to browse for javac.exe but Ubuntu's Dash couldn't find it. However, AFAIK I don't think that it is available since Linux version of OpenJDK rather than Windows version of Java is installed. Any suggestions as to where to find javac.exe? I wondered if the Windows version of Java needs to be installed?
PS android.jar was where B4A suggested it should be i.e. in Wine's Program Files. And I had the license file & Additional Libraries saved in appropriate places.
 
Last edited by a moderator:
Thanks. New version worked OK.
Just one question: when I try to 'Tools -> Configure Paths' in B4A (needed in order to compile an app), I need to browse for javac.exe but Ubuntu's Dash couldn't find it. However, AFAIK I don't think that it is available since Linux version of OpenJDK rather than Windows version of Java is installed. Any suggestions as to where to find javac.exe? I wondered if the Windows version of Java needs to be installed?
PS android.jar was where B4A suggested it should be i.e. in Wine's Program Files. And I had the license file & Additional Libraries saved in appropriate places.

Of course, JDK for Windows must be installed. This component is required to compile and package a B4A project. Unfortunately, B4A can't use linux binaries.

android.jar usually found under .[...]/android-sdk-linux/platforms/android-xx/....

For example, I added a screenshot with my settings.
Capture du 2014-05-07 22:56:08.png


Note : If you update "Android SDK Tools" with the SDK Manager, you must restart my installation script to re-write android.bat and re-add platform-tools components. (all old files are deleted whenever SDK is updated).

Best Regards.
 
Of course, JDK for Windows must be installed. This component is required to compile and package a B4A project. Unfortunately, B4A can't use linux binaries.

android.jar usually found under .[...]/android-sdk-linux/platforms/android-xx/....

For example, I added a screenshot with my settings.
View attachment 24814

Note : If you update "Android SDK Tools" with the SDK Manager, you must restart my installation script to re-write android.bat and re-add platform-tools components. (all old files are deleted whenever SDK is updated).

Best Regards.
Have I missed something? When I ran the script, it didn't install JDK for Windows but it installed JDK for Linux.
 
Have I missed something? When I ran the script, it didn't install JDK for Windows but it installed JDK for Linux.

you must intall both JDK. After installing dotnet 2.0, the script prompts you to install JDK for Windows.
Capture du 2014-05-08 00:21:50.png
Capture du 2014-05-08 00:21:15.png
 
I think appt.exe is not required for B4A. Also you can add it manually.
Regards.
 
for packaging? b4a throws err msg because it is missing. i tried to add it manually but still same err msg
 
@zolive33,
I've just ran your script again only saying 'y' to the request to update B4A (i.e. to Erel's latest version 3.80). It downloaded it OK (after I changed the URl for B4A in the script) but it hung after many repetitions of:
fixme:win:UnregisterDeviceNotification (handle=0xcafecafe), STUB!
fixme:win:RegisterDeviceNotificationA (hwnd=0x13ad50, filter=0x93e598,flags=0x00000001) returns a fake device notification handle!
fixme:win:UnregisterDeviceNotification (handle=0xcafecafe), STUB!

PS it didn't update the B4A version when invoking B4A.
 
@zolive33,
I've just ran your script again only saying 'y' to the request to update B4A (i.e. to Erel's latest version 3.80). It downloaded it OK (after I changed the URl for B4A in the script) but it hung after many repetitions of:
fixme:win:UnregisterDeviceNotification (handle=0xcafecafe), STUB!
fixme:win:RegisterDeviceNotificationA (hwnd=0x13ad50, filter=0x93e598,flags=0x00000001) returns a fake device notification handle!
fixme:win:UnregisterDeviceNotification (handle=0xcafecafe), STUB!

PS it didn't update the B4A version when invoking B4A.

Sorry, I am traveling on business. I will look at the problem this weekend.
 
Successful install on Ubuntu 14.04 LTS using the PlayOnLinux method described earlier. Wireless will connect to my device. Next step add JDK and Android SDK.
 
Thanks Theera. Google translate is a bit rubbish. But I saw you were using PlayOnLinux.

I downloaded PlayOnLinux. I Ran it and went into "Tools", "Manage Wine versions" and selected the latest version.

I then installed Basic4Android using the PlayOnLinux "Install a non-listed program" option.

Once it was installed I then used the "Configure" option and installed the following components: NET framework v2.0, msxml6, gdiplus and Microsoft Core Fonts as directed on a site that I found (http://www.floryn90.it/installare-basic4android-linux-playonlinux/).

Basic4Android then ran OK. All I had to do was set the paths for the SDK, and Java to point to the versions I had previously downloaded.

For some reason I have to stop the ADB server manually in the terminal window and then start it using sudo in order to be able to access connected Android devices. That's a minor issue.

At last I have got Basic4Android working on Linux!
Do you know if this solution will work on Ubuntu, which is what I use? Also, can you provide links to the JAVA Linux jdk and the Android sdk for Linux? Thans.
 
Sorry, I am traveling on business. I will look at the problem this weekend.
Did you look at problem detailed in my post 33 i.e.
I've just ran your script again only saying 'y' to the request to update B4A (i.e. to Erel's latest version 3.80). It downloaded it OK (after I changed the URl for B4A in the script) but it hung after many repetitions of:
fixme:win:UnregisterDeviceNotification (handle=0xcafecafe), STUB!
fixme:win:RegisterDeviceNotificationA (hwnd=0x13ad50, filter=0x93e598,flags=0x00000001) returns a fake device notification handle!
fixme:win:UnregisterDeviceNotification (handle=0xcafecafe), STUB!

PS it didn't update the B4A version when invoking B4A.
 
Did you look at problem detailed in my post 33 i.e.
I've just ran your script again only saying 'y' to the request to update B4A (i.e. to Erel's latest version 3.80). It downloaded it OK (after I changed the URl for B4A in the script) but it hung after many repetitions of:
fixme:win:UnregisterDeviceNotification (handle=0xcafecafe), STUB!
fixme:win:RegisterDeviceNotificationA (hwnd=0x13ad50, filter=0x93e598,flags=0x00000001) returns a fake device notification handle!
fixme:win:UnregisterDeviceNotification (handle=0xcafecafe), STUB!

PS it didn't update the B4A version when invoking B4A.

Sorry, I no longer have time to take care of this project for the moment. Can someone take care of?
 
Back
Top