Android Question Can b4A use non-Java functions written in C, VB, or PHP?

aedwall

Active Member
Licensed User
Longtime User
I'm not sure how to ask a proper question. The Swiss Ephemeris source code is written in C. I have a compiled version of it. I also have working .dll files and PHP scripts that use the compiled C programs as Linux executables and as VB .exe files. Can b4A somehow use any of these libraries' functions? The Swiss Ephemeris does not have an up-to-date Java port of the original C code. Can anyone please help me understand if this is possible? Thank you.

UPDATE: I see there is something called "swisseph.cli" on Google Play, which seems to be exactly what I need. But how do I utilize it from b4A? That is what I have to find out next, I think.
 
Last edited:

MicroDrie

Well-Known Member
Licensed User
Longtime User
I am in no way hampered by any knowledge of Swiss Ephemeris methodology. But you can find on http://www.th-mack.de/international/download/ Java jars. One is used with the 470JavaCalendarApp2021 on Github. This project contains some Java files that you might find useful. The jar file used in that project appears to be Java 1.8 so you can use SLC.
 
Upvote 0

aedwall

Active Member
Licensed User
Longtime User
I am in no way hampered by any knowledge of Swiss Ephemeris methodology. But you can find on http://www.th-mack.de/international/download/ Java jars. One is used with the 470JavaCalendarApp2021 on Github. This project contains some Java files that you might find useful. The jar file used in that project appears to be Java 1.8 so you can use SLC.
The calendar project and Thomas Mack's page both reference v2.01 or v2.00, with the current version written in C being v2.10.03. So the two prior projects are very old code, with old delta-T data, as well as other features. Thank you for your thoughts and ideas. I will keep these in mind going forward.
 
Upvote 0

MicroDrie

Well-Known Member
Licensed User
Longtime User
I don't know how handy you are with Eclipse, but this groupio site shows you how to create the latest version v2.10.03.
 
Upvote 0

aedwall

Active Member
Licensed User
Longtime User
I don't know how handy you are with Eclipse, but this groupio site shows you how to create the latest version v2.10.03.
Not handy enough, it would seem. I have used it to make some custom indicators for the MotiveWave financial software, yet I don't feel comfortable with it like I do with VB or PhpED, etc. Hard to know everything in detail. Just not enough time or energy to know everything well. One might think that someone out there has a tool to convert and/or compile C code to Java code, ending with a .jar file. I need to read more about "Simple Library Compiler (SLC)" at https://www.b4x.com/android/forum/t...-libraries-without-eclipse.29918/#post-173756 and "Native Library Generator (C/C++ to B4A)" at https://www.b4x.com/android/forum/threads/native-library-generator-c-c-to-b4a.62163/, among other things.
 
Upvote 0

MicroDrie

Well-Known Member
Licensed User
Longtime User
The first of three Maven sources, which I look to, was incomplete.
 
Upvote 0

MicroDrie

Well-Known Member
Licensed User
Longtime User
Simply put, if you don't have enough money to book a vacation, it won't be a vacation. Time for plan B, the other way around, which program in the Google Play Store do you think is good enough?
 
Upvote 0

aedwall

Active Member
Licensed User
Longtime User
Good enough for what? Everything in the GooglePlay Store is okay. It's the programs that aren't there yet that need the greater accuracy (the one's for my client, not my own personal programs).
 
Upvote 0

aedwall

Active Member
Licensed User
Longtime User
All this is becoming a lot more trouble than it is worth. I thought I could make it "simpler", but nothing I have investigated and tried is making anything simpler or easier, or better. I believe I will stick with my v2.01 library/code, adjust for the various values of delta-T, and call it a day. After all, I get the same values as the desktop version of the Swiss Ephemeris v2.10.03, so why kill myself. Some things just aren't worth the extra trouble. But I gave it my best shot, all things considered. That is where I'm at right now.
 
Upvote 0

QSerg

Member
Hm, I have not tried it by myself, but I fail to see why it is impossible to call EXE from B4A. make this EXE dump results to file and then analyze that file.
 
Upvote 0

QSerg

Member
What would you use to call the .exe file? What might the b4A instruction for that be?
I think it is impossible to run Windows EXE file in Android environment. Theoretically there may be some simulators, but I never heard of anything like that. Instead you can create service in suitable Windows machine that can launch Windows executable that may also use any DLL. Then trigger executable launch from Android via network TCP/IP protocol and you in business. If necessarily you may return results back to Android device via the same TCP/IP channel. It sounds extra complicated, but in reality once you write core that establish connection between device and service everything else became streamlined. If you need I can post here pieces of code from both B4A and VB6 that compiles to client-server pair.
NB. If you can re-write all required stuff in B4A it would be most straightforward solution, though may take a lot of time.
 
Upvote 0

QSerg

Member
What would you use to call the .exe file? What might the b4A instruction for that be?
BTW if you mean "executable" as executable program in Android environment then you may use Shell.Run() method. However I thought that you are talking about Windows executable and Windows DLL.
 
Upvote 0

aedwall

Active Member
Licensed User
Longtime User
I have been advised that the person who seeks something akin to this does not want to be forced to be online to make things work. Therefore, calling an API is not suitable to them. I set that up already and know that that works. But with the criteria stated, it is not a solution for him. As it turns out, a mistake on my part in my code caused a certain inaccuracy in some calculations, which caused me to think I needed a different solution than what I was previously using. When I fixed my error, then the need for a different solution disappeared and I am apparently in good shape. Still, it's always good to think of possible "Plan B"'s, as you never know when they might come in handy. Thanks to all for your thoughts on the matter.
 
Upvote 0
Top