Android Question Running B4A as portable app?

Troberg

Well-Known Member
Licensed User
I already have a large set (around 200) of portable applications on an USB stick (and on my phone, runnable on the computer when connected as USB mass storage). That way, regardless of what computer I'm at, I have almost all the applications I might need.

Almost all. I hate to risk being without my favourite development tool, and, I thought it would be nice if I could use B4A as a portable app as well.

Is this possible?

I suspect that the Java SDK/Android might be problematic, but even without it, I could still use the IDE to write code and get it syntax checked, even if I can't build or run it. But, if the Java/Android SDK can be made to work, even better. Perhaps a Thinstall or Cameyo repacking?

Anyone who has tried?

Edit: All this assuming the correct .Net framework is installed on the computer, of course.
 
Last edited:

sorex

Expert
Licensed User
B4x doesn't seem to use the registry and has its settings files & required dll's in his folder.

So I don't think that would be a problem.

I guess you only need java installed and the SDK stuff can be on the USB disk aswell as you tell B4A where he needs to get it.
My bet is that B4A send the required parameters to the javac compiler so that it knows where the base folders are.
 

Troberg

Well-Known Member
Licensed User
Sounds workable. There is one possible snafu, though, in that the drive letter might change, meaning that the paths has to be adjusted. Should be easy enough to make a small program that does that automatically, though.

SOme parts of the SDK won't be likely to work, though, such as ADB.
 

sorex

Expert
Licensed User
it depends on the OS and device I guess. iPhone drivers get installed automatically, maybe the recent samsun stuff aswell?
 

Cableguy

Expert
Licensed User
Recent Samsung devices get their drivers for mass storage installed automatically. Just special features as debugging need device/brand specific drivers. I would be interested in a "make b4a portable" tutorial
 

Troberg

Well-Known Member
Licensed User
Testing shows that the IDE works. I have not tested debugging/building yet, as the laptop I tested on was a 32 bit, and the android SDK I had on the stick was 64 bit.

One small thing to note:

In the paths configuration, relative paths using . didn't work. For example, this didn't work:

.\sdk\platforms\android-21\android.jar

However, this worked nicely:

\PortableApps\Basic4android4.30\sdk\platforms\android-21\android.jar

The license key had to be re-entered as well, so that might be stored locally.
 

Troberg

Well-Known Member
Licensed User
Further info: It works to build and deploy once the SDK was the correct version. Deploy over USB didn't work (expected), but bluetooth worked fine. Didn't try wifi.
 

Troberg

Well-Known Member
Licensed User
Since this seems to has reached it's end, I'll sum up how to set up a portable Environment:

* Copy the B4A installation to the portable media.
* Copy the license key to the portable media. Make a backup copy of it with another name as well, as it's deleted when applied, and you'll need to apply it on each new machine.
* Copy the Java SDK to the portable media.
* Copy the Android SDK to the portable media.
* Start B4A and setup paths.
** You must write the paths on this format: \path\to\file\Android.jar, in other words, starting with the root, but no drive letter.

You can only compile on the same system type (32/64 bit) as the installed SDKs. I assume you can have multiple installations and run the appropriate, but haven't tried it.

Minor issues:

* Debugging/deploying over USB does not work. Use Bluetooth or wifi instead.
* License and paths are lost when you use a new machine, and has to be reentered. Perhaps something Erel could look over in some future version.
* As license and paths are lost when using a new machine, I suspect some settings are stored locally, which, in a formal sense, doesn't make it fully portable. While it would be nice to have it fixed (both so that one doesn't have to reenter information and for a true "leave no trace" portable installation), it works in most practical applications.

I hope this helps someone.
 
Top