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

  • B4A_Installer_en.zip
    6.4 KB · Views: 989
Last edited:

zolive33

Active Member
Licensed User
Longtime User
@Erel : I understand that the work to adapt the IDE is hard. But is it possible to do some changes to improve compatibility with Linux (using Wine)?
 

zolive33

Active Member
Licensed User
Longtime User
Thank you Erel, it's a very good news. I will prepare a list of problems as soon as possible.
 

zolive33

Active Member
Licensed User
Longtime User
Hello Erel,

I took time to share the problems with you, because I wanted to stand back a little bit and limit the number of changes to bring to Basic4Android.

I work on the principle that, in order to function properly, Basic4Android requires the following components :
  • JDK for linux
  • Androïd SDK for linux
  • Wine (at least version 1.4)
    • Dotnet 2.0
    • Using DLL gdiplus (native)
In order to assure the compatibility with Linux, it would be appropriate :
  • Ability to use JDK for Linux
    • Module "Paths Configuration" should allow adding bin "javac".
    • Project should be compilable with jdk for linux.
  • Ability to use Android SDK for Linux
    • Launch AVD: use shell sdk/tools/android with avd option (instead of batch android.bat)
    • Restart ADB server: use adb bin (instead of the executable adb.exe)
    • Allow to call zipalign bin (instead of the executable zipalign.exe)
These first few changes should be made to improve accounting problems with linux.

Best regards.
 
Last edited:

zolive33

Active Member
Licensed User
Longtime User
Thank you. Other than these issues, does the IDE itself work properly (the code editor)?
Yes, the code editor works properly. Except the position of name of modules (I'm not sure for the translation, sorry).
 

Attachments

  • B4A-SCREENSHOT.PNG
    B4A-SCREENSHOT.PNG
    171.1 KB · Views: 922
Last edited:

gareth thomas

Member
Licensed User
Longtime User
This is cool I much prefer to use Ubuntu and am currently having trouble connect b4a to my device inside an XP virtualbox vm inside an ubuntu host.

I would much rather just run it in ubuntu
 

zolive33

Active Member
Licensed User
Longtime User
So, you can try my solution.
You can also provide feedback.
 
Last edited:

gareth thomas

Member
Licensed User
Longtime User
I will see if I can use it and let you know tnx

OK I took a look at the script - I already have wine, ADK, eclipse & JAVA set up both on my host and on virtual machines so its not really of use for me.

Also I tried to install B4A directly with wine - it ran the installer fine but will not run the application at all and wont uninstall it now either
 
Last edited:

zolive33

Active Member
Licensed User
Longtime User
I will see if I can use it and let you know tnx

OK I took a look at the script - I already have wine, ADK, eclipse & JAVA set up both on my host and on virtual machines so its not really of use for me.

Also I tried to install B4A directly with wine - it ran the installer fine but will not run the application at all and wont uninstall it now either
It is not normal. I tested my script on several systems, but I've never had this problem.
 

seaton

New Member
Licensed User
Longtime User
I am new to Basic4Android. I am also looking at migrating from Windows XP to Linux Mint 16.

I tried getting Basic4Android working under Wine manually following instructions from these forums and failed. So I uninstalled everything (B4A, SDK, JDK and Wine) and then tried this script. All seemed to run smoothly and everything looks to be installed OK.

Clicking on the link in workspace_b4a directory causes an entry to appear in the task bar which says "Starting Basic4Android". The mouse pointer indicates the system is busy. But after about 15 seconds the entry disappears from the task bar and the mouse pointer goes back to normal without any sign of the B4A IDE.

Something very similar happens if I go to where the B4A executable is located, right click and choose "Open with Wine Windows Program Loader".

I can't find any diagnostic information to indicate what is wrong. Anybody got any ideas?
 

zolive33

Active Member
Licensed User
Longtime User
I am new to Basic4Android. I am also looking at migrating from Windows XP to Linux Mint 16.

I tried getting Basic4Android working under Wine manually following instructions from these forums and failed. So I uninstalled everything (B4A, SDK, JDK and Wine) and then tried this script. All seemed to run smoothly and everything looks to be installed OK.

Clicking on the link in workspace_b4a directory causes an entry to appear in the task bar which says "Starting Basic4Android". The mouse pointer indicates the system is busy. But after about 15 seconds the entry disappears from the task bar and the mouse pointer goes back to normal without any sign of the B4A IDE.

Something very similar happens if I go to where the B4A executable is located, right click and choose "Open with Wine Windows Program Loader".

I can't find any diagnostic information to indicate what is wrong. Anybody got any ideas?
Hello,

The installation script is expected to linux-ubuntu. I've never tested it on Linux-Mint.

Regards.
 

seaton

New Member
Licensed User
Longtime User
Hi,

As Mint is related to Ubuntu I was hoping it would work. After a couple of syntax tweaks to the script it seemed to run OK. I'm guessing the problem is something minor but I can't work out what.

I'll keep trying and if I get it to work I'll report back.
 

Theera

Well-Known Member
Licensed User
Longtime User
I had tested with Linux Mint14. It works as same as done in Ubuntu.
 

seaton

New Member
Licensed User
Longtime User
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!
 

johnaaronrose

Active Member
Licensed User
Longtime User
@zolive33,
B4A_Installer_en.sh has a problem with installing JavaJDK for Windows. Relevant part of terminal output:
Do you want to install JDK for windows? (y/n) y
--2014-05-05 14:35:47-- http://download.oracle.com/otn-pub/java/jdk/7u45-b18/jdk-7u45-windows-i586.exe
Resolving download.oracle.com (download.oracle.com)... 23.62.0.226, 23.62.0.225
Connecting to download.oracle.com (download.oracle.com)|23.62.0.226|:80... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: https://edelivery.oracle.com/otn-pub/java/jdk/7u45-b18/jdk-7u45-windows-i586.exe [following]
--2014-05-05 14:35:47-- https://edelivery.oracle.com/otn-pub/java/jdk/7u45-b18/jdk-7u45-windows-i586.exe
Resolving edelivery.oracle.com (edelivery.oracle.com)... 23.198.86.140
Connecting to edelivery.oracle.com (edelivery.oracle.com)|23.198.86.140|:443... connected.
HTTP request sent, awaiting response... 302 Moved Temporarily
Location: http://download.oracle.com/errors/download-fail-1505220.html [following]
--2014-05-05 14:35:48-- http://download.oracle.com/errors/download-fail-1505220.html
Connecting to download.oracle.com (download.oracle.com)|23.62.0.226|:80... connected.
HTTP request sent, awaiting response... 200 OK
Length: 5307 (5.2K) [text/html]
Saving to: ‘/home/john/workspace_b4a/temp/jdk-7u45-windows-i586.exe’

100%[======================================>] 5,307 --.-K/s in 0.001s

2014-05-05 14:35:48 (9.43 MB/s) - ‘/home/john/workspace_b4a/temp/jdk-7u45-windows-i586.exe’ saved [5307/5307]

wine: Bad EXE format for Z:\home\john\workspace_b4a\temp\jdk-7u45-windows-i586.exe.
--2014-05-05 14:35:48-- https://app.box.com/s/dg8n6baz96y3vi8040w3

Looking at Oracle's website, I noticed that current version (for 7) of it is 7u55. Do you suggest changing to this? If so, would the following need changing & what to:
UrlJdkWindows=http://download.oracle.com/otn-pub/java/jdk/7u45-b18/$ProgInstallJdk
wget --no-cookies --no-check-certificate --header "Cookie: gpw_e24=http%3A%2F%2Fwww.oracle.com" -P $TmpDir $UrlJdkWindows
PS I tried changing just the 7u45 to 7u55 & got the same result i.e. wine: Bad EXE format...

Also, android-sdk_r22.6.1-linux.tgz is available now (as opposed to 22.2.1 in your script).

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

johnaaronrose

Active Member
Licensed User
Longtime User
@john : thank you for your comments. I have updated the installation script.

Regards
@zolive33
Java installed OK. However, I think that there is another problem afterwards:
2014-05-06 08:58:47 (521 KB/s) - ‘/home/john/workspace_b4a/temp/b4a-trial.exe’ saved [3815553/3815553]

/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

PS the .desktop file used by the script is Basi4android.desktop. However, the script actually creates Basic4android.desktop. Could you explain why?
 
Top