Can I create a HTTP server?

Hi,

I'm pretty new in the app inventor community, but I have been creating small apps for my projects for a couple of years, and recently I have been working on a project that consist of a score board that will be hosted in a Android tablet and I want the app to act as a HTTP server where clients that are connected to the same network can access the IP address and be able to see the game time and score.

I'm not sure if it possible with app inventor or even if the HTTP server is the correct rout to take (or should it be a TCP/IP server?), or simply this is to big for me because I have 0 experience at HTTP coding.

Any guidance is appreciated.

No need to set up your owen server, you have many choices to store your score board, like TinyWebDB, CloudDB, FirebaseDB, Spreadsheet....

Thank you for your replay, I have dealt with TinyDB and Spreadsheet before, but how can I display the game time and score in real time on other devices while the game in going on?

If people are in the same room, with BlueTooth distance, there is also the possibility of basing score exchange on a BlueTooth Chat sample.

Search the board.

1 Like

BT won't do it, the distance between devices is around 50 meters

Spreadsheet can be shared, and data exchange is real time I guess.

firebasedb and clouddb both have real time events like 'when data changed', just check the drawer of each component.

I don't need to store the time nor the score, I want to display it in a monitor/tv, if I use firebasedb or clouddb I'll need an internet connection which it won't always be available.

For what I have been researching its going to be a server or cast the screen of the host device, but I can't seem to find a app that lets me to 2 or more devices.

Well, it is not an android phone thing to be a server. It can be done but not ideal. Better you make a laptop a server and phones connect to that, probably through a router(does not have to be internet). You can write apps here that works clients-wise, aka connect your server and ask the data, but there are no blocks here for make a server. There is a http server app on google play, you can try that, or as I said, use a laptop as a server. Wider range and better softwares available for desktop applications.

1 Like

I have not yet played with SMS.

Maybe you could find an SMS chat sample , with message forwarding?

You would have to add the equivalent of IP protocol logic to limit message propagation.

The App Inventor companion includes an HTTP server implementation, but it's not easily exposed as a component. It's possible someone would be willing to build an extension around the logic.

In particular, Legacy mode for connections starts an HTTP server on port 8001 and then makes HTTP calls to that server to execute your app. This is implemented by the class AppInvHTTPD in the Java code, and it inherits from NanoHTTPD, which is a bit more generic. I could easily imagine an extension that extends NanoHTTPD to do what you want.

what about this extension?
https://groups.google.com/g/mitappinventortest/c/-tn-UY7YJGs/m/tpivqjkVCgAJ?pli=1

I have been trying to use that extension, but now I need to learn HTML and CCS.