Java Question How do you get the full java source code (including dependencies) which compile

simonsmith

Member
Licensed User
Longtime User
Hello,

Supposing I have a simple App, that says MsgBox("Hello","Hi") and ends.

1. This created me a main.java file, I see that - that cannot be opened in Java on its own without all the dependencies.

Before it starts to show my code in main.java there is a good 4-5 pages of b4a code setting up the environment, and these appear to be the default reliant dependencies.

package b4a.example;

import anywheresoftware.b4a.B4AMenuItem;
import android.app.Activity;
import android.os.Bundle;
import anywheresoftware.b4a.BA;
import anywheresoftware.b4a.BALayout;
import anywheresoftware.b4a.B4AActivity;
import anywheresoftware.b4a.ObjectWrapper;
import anywheresoftware.b4a.objects.ActivityWrapper;
import java.lang.reflect.InvocationTargetException;
import anywheresoftware.b4a.B4AUncaughtException;
import anywheresoftware.b4a.debug.*;
import java.lang.ref.WeakReference;


So, how do I
a) Get the full source code of the java application that gets sent to the compiler including the dependencies.
b) Do we get source to the dependencies or do we get the libraries, if so, where are they, how are they compiled, is everything in the one spot?

My basic question is:

How do I make a java project that will run standalone in Eclipse or any java editor and display my MsgBox, as even the logic and relies on the B4A libraries. Is there 1 project file, or do I have to find each dependency and construct my own project? If so, how?

I'd like to have the full java source code to the project I have written, in a subroutine, just the logic is fine- naturally I understand the GUI related items depend on the build type.

Assume I'm recreating a Hello World normal java app with no UI just a sub main. Which files do I need from B4A to make my project?

Hope this makes sense.

Thank you,
Simon
 

simonsmith

Member
Licensed User
Longtime User
Thank you, however,

1. I can find no such file even starting with b4as* on my system; and
2. No core.jar, whose core.jar? I presume maybe you mean the IDE I'm compiling in, their version?
 

simonsmith

Member
Licensed User
Longtime User
Hello, this unfortunately isn't really getting to the heart of the question.
I'll try and word it better,

Apart from UI, I understand that "everything" including the B4A libraries reliant on is converted to Java.

Platform aside, supposing you simply made one module with one call MsgBox("Hi","Hello")..

It had no layout and that was its sole purpose, that's it.

When you compile, all should work but what EXACT files make up the entire java project. I want to be able to pick this up, put the files in a directory and simply open Eclipse (or ANY java editor) and press Run and see my MsgBox. No Android screens or platform code is there. It is JUST purely for logic - ie converting B4A into Java.

How can I convert my small tiny module which just has a messagebox so I can run it on any Jave IDE regardless of platform - and what exact files make up a project, and what is the project saved as?

Remember, interface and platform is not relevant. I just want raw code converted into raw code.

How?
 

simonsmith

Member
Licensed User
Longtime User
Ok accepted.

The goal is not relevant whether android is there. So, yes, we are making a 1 page Android App with a messagebox. Exactly what exact files get sent to the Android compiler, your main.java plus what else? Is it zipped as a package, does it go as a project? How does the Java SDK know how to deal with it. What is the standardised format.

My goal is to convert B4A logic to Java - doesn't matter if it is within Android, I just want to see the full java source before compile (including everything that gets passed to the compiler).
 

simonsmith

Member
Licensed User
Longtime User
So I understand it as separate files. There is no such 'project' file. Correct? Do your dependencies (core.jar+b4ashard.jar) have dependencies?
 
Top