B4J Tutorial [example] B4X Time Tracker

Time tracker example with a server component and iOS and Android client apps.
The client apps allow the employees to check in and out (based on the current status).
upload_2015-7-29_16-5-40.png
upload_2015-7-29_16-4-50.png



SS-2015-07-29_16.29.07.png


The server collects all the data in a SQLite db and can print reports with the employee work times.
As you can see in the code, the B4A and B4i projects are very similar.
Both use KeyValueStore and HttpUtils2 components.

The server address is hard coded in the client code. You will need to change it based on your PC address.
If you run it on Windows then you need to add an incoming rule in Windows firewall. The port is 55555.

Took me about two and a half hours to write all three components. This is a nice example of the power of B4J, B4A and B4i combined :)
 

Attachments

  • TimeTracker-B4A.zip
    11.8 KB · Views: 609
  • TimeTracker-B4i.zip
    9.2 KB · Views: 465
  • TimeTracker-B4J.zip
    7.1 KB · Views: 680
Last edited:

AzureCrystal

Member
Licensed User
Longtime User
B4A newbie here, still pinching myself every time I use this, thank you so much for so many examples and tutorials, and for such a rich, well documented, and well thought out tool. Kudos to you Erel, B4A beats some of the more well established IDEs out there, my hat is off to you! Thank You!

Note: One question; If I also purchase B4I, is there a lot of code changes from B4A, are there tutorials on that (I bet yes!), thanks in advance...
 

AzureCrystal

Member
Licensed User
Longtime User
@Erel - Is there an SQL create script or any directions on setting up the server portion of this example? Grateful thanks in advance...

P.S. 1st going to check the B4J.zip file, perhaps my answer is there ;)
 
Last edited:

Cableguy

Expert
Licensed User
Longtime User
B4A newbie here, still pinching myself every time I use this, thank you so much for so many examples and tutorials, and for such a rich, well documented, and well thought out tool. Kudos to you Erel, B4A beats some of the more well established IDEs out there, my hat is off to you! Thank You!

Note: One question; If I also purchase B4I, is there a lot of code changes from B4A, are there tutorials on that (I bet yes!), thanks in advance...

Almost all of the non-UI related code can be reused in either IDEs, and most UI code needs little tweaking and adapting... that's what makes this toll so amazing!
 

AzureCrystal

Member
Licensed User
Longtime User
Running Windows 7, I am running the server B4J program, I added the 5555 port as a firewall exception, but I still get this error from the B4A client program, any help will be greatly appreciated :)

B4X:
org.apache.http.conn.HttpHostConnectException: Connection to http://0.0.0.0:55555 refused

Interesting - This example works, with 8888 as port:
https://www.b4x.com/android/forum/threads/server-building-web-servers-with-b4j.37172
 
Last edited:

AzureCrystal

Member
Licensed User
Longtime User
Got it to work, I forgot to add the server's actual ip addy to the client main as follows:
B4X:
Private const serverAddress As String = "http://xx.0.0.x9:5555"
it works!
 

AzureCrystal

Member
Licensed User
Longtime User
Almost all of the non-UI related code can be reused in either IDEs, and most UI code needs little tweaking and adapting... that's what makes this toll so amazing!

Thanks for the reply!
 

AzureCrystal

Member
Licensed User
Longtime User
Thank you Erel, I figured I was missing a server component so I downloaded the B4J code and got it running ;)
 
Top