B4AServer - simplifies development of enterprise in-house Android applications

Erel

B4X founder
Staff member
Licensed User
Longtime User
1. You can set CheckInterval value in the config.properties file.
2. The PHP server is only responsible for coordinating the connection between the desktop and the device. Once connected all the communication is done directly between them.

3. B4AServer will only work when there is a local connection between the desktop and the device.

See this thread for a possible solution using a device as a server: No-IP Android client - Access your device over the internet
 

MrKim

Well-Known Member
Licensed User
Longtime User
A couple of things are not clear to me. I do need to implement communications between Android devices and Databases. If I do this their might be as many as 10 or 20 devices at any given time trying to connect.

1. Am I to understand that what happens is this:

The server tries to make a connection every second.
If it makes a connection it uploads/downloads/runs an external program, then uploads/downloads again.
Disconnects from that Android device and starts looking for connections again?

This seems like it might be very slow during periods of heavy use. I don't have the resources to test this.

2. Is a board web service really required? I don't want my customers (we have a lot) to have to setup MySQL.

It is my understanding that there are libs that will allow B4A to read and write files on network drives. My plan had been to simply read and write to a given location and have my app look for files and handle them. Larger customers could have multiple instances of my program running and "looking" for files.

You mention reliability. Why is this a better solution?

Thanks for your time.
Kim
 

B4A Enthusiast

Member
Licensed User
Longtime User
Hi, am new to b4a. When I run the example I get the error

java.lang.Exception: Sub service_start signature does not match expected signature.
public static anywheresoftware.b4a.pc.RemoteObject anywheresoftware.b4a.b4aserverexample.b4aserverservice_subs_0._service_start() throws java.lang.Exception

What should i do?

The Desktop is properly configure and the service is running well on the desktop.
 

B4A Enthusiast

Member
Licensed User
Longtime User
Great, when I changed the signature to ServiceStart (StartingIntent As Intent), that error is now gone however, my app. now crashes with a message:

An error occured:
(Line: 37) End Sub
java.lang.ArrayIndexOutOfBoundsException: 3


This is displayed immediately i click the SEND FILE Button

What is it that am doing wrong?
 

B4A Enthusiast

Member
Licensed User
Longtime User
Great, the other modes are working fine. The application no longer crashes. Http Request success. Only apache server cannot allow B4AServer.jar to get back to my device. Am layman in Apache stuff. Any help will be appreciated.
 

B4A Enthusiast

Member
Licensed User
Longtime User
Here is what is logged:

** Service (b4aserverservice) Create **
** Service (b4aserverservice) Start **
Server not connected. Calling board web service.
Error connecting: Forbidden
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>403 Forbidden</title>
</head><body>
<h1>Forbidden</h1>
<p>You don't have permission to access /b4a_server.php on this server.</p>
</body></html>

Connected = false
Task=1 completed. Success=false, Message=Task cancelled
 

B4A Enthusiast

Member
Licensed User
Longtime User
Here is the B4AServer.Jar Output attached. I guess it will shade more light:
 

Attachments

  • B4AServer JAR FILE Output.jpg
    B4AServer JAR FILE Output.jpg
    33.4 KB · Views: 256

B4A Enthusiast

Member
Licensed User
Longtime User
Okay I tried using the board web service that is hosted on this site as suggested, but after clicking the RECEIVE FILE Button the log window on my B4A IDE is populated with the following text:

Server not connected. Calling board web service.
Http success. Waiting for server to connect...
Connected = false
Task=1 completed. Success=false, Message=Task cancelled

Also when i start my desktop server (B4AServer.jar) using the run.bat it starts but immediately the Windows 7 File Preview window displays the message:
java -cp b4aserver.jar anywheresoftware.b4a.b4aserver.server
pause

Does the word pause on the second line mean that the desktop server is started and paused immediately?
I really need a fix on this B4AServer File Transfer thing. It is so key in the app. am developing. Thanks in advance Erel.
 

B4A Enthusiast

Member
Licensed User
Longtime User
Have not tried running the Desktop server from the command line. Will be back soon - am trying it right away.
 

B4A Enthusiast

Member
Licensed User
Longtime User
When I run the desktop server from command line I get the message:

Invalid or Corrupt Jar File B4AServer.jar.
B4AServerFromCommandLine.jpg

I have attached the image of my command prompt window for your advise Erel incase am doing it wrongly.
 
Top