Create Feed app

Discussion in 'Chit Chat' started by yiankos1, Mar 19, 2017.

  1. yiankos1

    yiankos1 Active Member Licensed User

    Hello my friend,
    My next project is an app with facebook like feed. I would to talk with you about the wider context for this communication server - app and how could this be achieved.
    Thank you in advance.
     
  2. Erel

    Erel Administrator Staff Member Licensed User

    You can use B4J to implement the server side. Each client will be connected with WebSockets. This will make it relatively simple to download or upload new messages.
    The messages should be stored in a SQL database.
     
    yiankos1 likes this.
  3. yiankos1

    yiankos1 Active Member Licensed User

    Thank you very much for your answer. Moreover, in order to get data from sql server, do you prefer json or php method.
    Wish you a great day!
     
  4. Erel

    Erel Administrator Staff Member Licensed User

    You don't need PHP if you are creating a B4J server. The server should connect to the database directly (see ConnectionPool in jServer library).
     
    yiankos1 likes this.
  5. yiankos1

    yiankos1 Active Member Licensed User

    b4j server is a non-ui element? Something like .php files that handles communication with sql databases?
    So this b4j server file needs to be uploaded on a custom host?
    Sorry about these questions, but I am very new to server side apps. Till now I developed apps with "local" databases
     
  6. udg

    udg Well-Known Member Licensed User

    I make large use of b4j servers so this may help you.
    B4j server is a non-ui object so you can install it wherever JRE (8.40+ if I recall well) goes. This "java requirement" means that you generally can't deploy it on a shared hosting server because on those plans you're not allowed to install/activate java. But if you run your own hw server or make use of a VPS plan (there are cheap ones), you can easily deploy a b4j server.
    It will be the responsability of the b4j component to access your database (I use mainly MySql) because for security reasons you won't expose the DB on the Internet. In order to do so, use the ConnectionPool object to make your server talk to your DB.

    Just to share an idea: in my case I have my B4A apps to query a server-module that I named "dispatcher"; its use is to verify credentials and return the full address of the b4j server needed for that specific program. This way I'm free to move my b4j server from physical server to physical server not touching my mobile apps. And, even decompiling those apps, you end up just with the dispatcher address, nothing more.

    udg
     
    yiankos1 likes this.
  7. Erel

    Erel Administrator Staff Member Licensed User

  8. udg

    udg Well-Known Member Licensed User

    @Erel: is there a reason you didn't mention MQTT as a way to manage messages exchange between parties?
    I read in post#1 a reference to Facebook, but since I don't use it nor any other social network I can't say whether MQTT could be an alternative or even a part of the system.
     
  9. Erel

    Erel Administrator Staff Member Licensed User

    udg likes this.
  10. udg

    udg Well-Known Member Licensed User

    Thank you, Erel.
    Recently I implemented a mixed-tech solution: I use an B4J server as a common point between desktop app and mobile app when it comes to read/write data to a MySql DB (btw Serializator is simply fantastic!) and MQTT to signal each other of some updates (specifically, date and time set/change for appointments).

    udg
     
Loading...