Android Question Http server embedded in an android app.

Eme Fibonacci

Well-Known Member
Licensed User
Longtime User
I have some games in html5.
Previously I tried embedded them in a webview but it did not work because the games don't work offline.

Then I saw that possibility.

https://www.b4x.com/android/forum/threads/embed-an-http-server-in-your-android-application.25984/

I make an app that is at the same time http server and uses a webview to run the games.

I tested. it works.

I have some doubts. What are the cons of having a server and an app consuming a page at the same time?
Slow? Battery consumption?
What are the security risks for the user? to have a server embedded ?

Thanks for your comments.
 

DonManfred

Expert
Licensed User
Longtime User
i dont see a big problem if you want to use the server only "locally" on your device. (Localhost)
 
Upvote 0

Eme Fibonacci

Well-Known Member
Licensed User
Longtime User
I have some games in html5.
Previously I tried embedded them in a webview but it did not work because the games don't work offline.

Then I saw that possibility.

https://www.b4x.com/android/forum/threads/embed-an-http-server-in-your-android-application.25984/

I make an app that is at the same time http server and uses a webview to run the games.

I tested. it works.

I have some doubts. What are the cons of having a server and an app consuming a page at the same time?
Slow? Battery consumption?
What are the security risks for the user? to have a server embedded ?

Thanks for your comments.

Hi, thanks for commenting.
What worries me the most is the security issue (an embedded server). Any comments on that?
Thank you again.
 
Upvote 0

Eme Fibonacci

Well-Known Member
Licensed User
Longtime User
I don't see a real problem with such solution. The server will only be accessible over the local network and only the resources that you explicitly expose will be accessible.
I think that I found a problem with such solution.
If a have two games then each game has a own server and its seems a big problem if them are running on same time. Two servers or more on same device? Can I solution it?
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Use another port for each server.
The correct solution is probably that the server itself needs to be able to handle multiple clients. So only ONE server is needed.

Why are two apps running? If one app is running all other apps should be paused or did i miss something here?
 
Upvote 0
Top