Getting back into app development, and this %#$! is real, and I need help.

NFOBoy

Active Member
Licensed User
Longtime User
Alright,

This will be a long post with some questions on how to proceed, such that I can get myself up to speed to develop A/I/J applications. It has been a while since I have developed applications, and even longer since I used B4A for development. My current concern is making progress towards my research, and as such, I would like to do longitudinal studies outside of a lab, and I remember how much fun I had creating B4A apps. I also remember making good progress at getting apps made, so figured I could jump back in. However, my previous apps were not tied to any backend (did utilize Google's Play Services, and even wrapped it for use by others with B4A... but that was a long time ago)

For my research, I want to create an app that allows users to handle taking surveys, based upon their interaction with the application. The key point here is, I have never done backend integration before, and I may be missing some basic requirements with what I have below.

Just hoping that others, with a little more experience using B4?, can chime in and help me out with moving forward.

Requirements (as I see them):

1) Backend with a database that will
1a) serve up data for display in the app (images/questions/etc)
1b) be updated with the responses for survey questions
1c) each account login will be associated with its own data (but be part of the same database)
1d) data will be downloadable/accessible for analysis/aggregation by myself (or other researchers)
1e) allow for push notifications of several kinds (update to presented variables, request for initiating survey follow-ups, etc.)

For those familiar with Qualtrics, the data captured by Qualtrics is equivalent to 1b), but instead of an open link, the user login/auth will be utilized for association to the correct response fields

2) Frontend will (start off) serve as the GUI/UX to access/interact with the backend.
2a) allow for displaying login/auth screen
2b) show different GUI items (images/text/buttons/etc)
2c) send the appropriate REST commands to interact with the backend (SQL queries, auth, login etc)

Does anyone have a recommendation on which backend service to use? (AWS/Azure/Firebase) I am looking for simple/simple/simple integration requirements (and lots of easy sample code that I can modify like I stole it), that I can use across B4 A/I/J, as I am sure participants will utilize all of those platforms, and thus I need to be able to provide for each of them. (same/similar interface for all 3)

Any assistance before I go to far down a path that becomes too hard is much appreciated.

Ross
 

udg

Expert
Licensed User
Longtime User
Hi Ross, it shouldn't be too difficult to reach your goal. As you anticipated there are three main aspects: fontend, backend and push management.

Backend: if you have an VPS just install your favourite DBMS, RDC2 (as middle-layer) and your B4J "server" app.
Frontend: using B4A and B4i you send commands to the RDC2 middle-layer which result in data exchange as needed
Push: FireBase Notification, MQTT (e.g. mosquitto) or an mqtt broker embedded in your B4J app

A few decision points relate strictly to the final design of your app. For example, point 2b (images/text/buttons); if they're a standard set you can include them in the app itself and activate the right ones depending on the survey/question. Otherwise you have to send them from server each time, which involves understanding the nature and amount of data, the number of clients and so on in order to devise the best startegy.

Welcome back to the B4x Community!
 
Last edited:

MarkusR

Well-Known Member
Licensed User
Longtime User
I want to create an app that allows users to handle taking surveys
i found a simple survey example at ms power apps and i also ported it for asp.net

it have some tables
questions
QuestionText QuestionId

the options each question
OptionText QuestionId OptionId

responses with user and answer
ResponseId Answer1 Answer2 Answer3 Answer4 Answer5 Username

and a welcome note table with title and message
WelcomeTitle WelcomeMessage WelcomeId


if you use B4J as backend http server and b4a/b4j as front end you can use B4XSerializator which will make data exchange simple.
 

LucaMs

Expert
Licensed User
Longtime User
Mine will not be a very useful post...

I would modify the title of this thread; that title is fine as an introduction, in the first post. As a title I would write something like "How to do [etc]"

I think that there are many ways to implement such a "service" and depend on both your knowledge and the means you have available (for example a hw server, a VPS or a simple web space).

Backend: if you have an VPS just install your favourite DBMS, RDC2 (as middle-layer) and your B4J "server" app.
If you already have a RDC2, do you also need to create another b4J server? (I should go back and read RDC2 well!)
 

NFOBoy

Active Member
Licensed User
Longtime User
Hi Ross, it shouldn't be too difficult to reach your goal. As you anticipated there are three main aspects: fontend, backend and push management.

Backend: if you have an VPS just install your favourite DBMS, RDC2 (as middle-layer) and your B4J "server" app.
Frontend: using B4A and B4i you send commands to the RDC2 middle-layer which result in data exchange as needed
Push: FireBase Notification, MQTT (e.g. mosquitto) or an mqtt broker embedded in your B4J app

A few decision points relate strictly to the final design of your app. For example, point 2b (images/text/buttons); if they're a standard set you can include them in the app itself and activate the right ones depending on the survey/question. Otherwise you have to send them from server each time, which involves understanding the nature and amount of data, the number of clients and so on in order to devise the best startegy.

Welcome back to the B4x Community!


Thanks much.

For the backend: I will probably use VPS with Azure (as that comes with a good amount of free $ as a student). DBMS = SQL. For B4J "server" app, my understanding this is the app on the VPS that handles commands from RDC2 that are received from the frontend?

For the frontend: I will keep all the relevant interface items within the app, and fill the textual part from reads from the database.

For Push: MQTT (for apps) is something I can do with Azure? (if you know)


So, to push through getting started.

1) setup a VPS on Azure (follow steps on Azure
2) read-up on how to install/utilize SQL on my VPS
3) install RDC2 on VPS (hopefully there is a good walk-thru)
4) install B4J "server" app, with my first goal just to have it "talk" to my B4J/I/A frontend app (a "hello world") moment.
5) then start expanding the "conversations" between the server app and the frontend

Did I miss a step?
 

udg

Expert
Licensed User
Longtime User
Your 1-5 steps looks ok to me.
MQTT: my experience is limited to an installation of mosquitto on a very cheap VPS (the hardest part was about the quirks about the SSL vertificate, if I recall it correctly, although well explained in the documentaion).
The I tried with success Firebase Notification, so I can say that both methods work well for a "pushing message" based solution. FB seemed to work better when the client device was turned off at the time the message was sent (I mean, messages arrived on successive turn on of it).
 

NFOBoy

Active Member
Licensed User
Longtime User
Your 1-5 steps looks ok to me.
MQTT: my experience is limited to an installation of mosquitto on a very cheap VPS (the hardest part was about the quirks about the SSL vertificate, if I recall it correctly, although well explained in the documentaion).
The I tried with success Firebase Notification, so I can say that both methods work well for a "pushing message" based solution. FB seemed to work better when the client device was turned off at the time the message was sent (I mean, messages arrived on successive turn on of it).

I shall start powering through! Thanks.
 

NFOBoy

Active Member
Licensed User
Longtime User
Follow up here. (can do a new thread if that seems pertinent).

B4J up and running, and sample code gone thru, so think I am good to go with comfort of front end on that front.

I am at the point of where I am ready to setup the VPS on Azure, and then try for that "connection successful" moment between my PC and the VPS. However, I have a choice between Linux (Ubuntu, Red Hat, etc.) or Windows (Server, 10, etc.), and too many choices at that!

With B4A/I/J/X and RDC2, which configuration for the VPS is the best choice? I have seen example code , with varying focus between Windows and Linux, and just want the easiest start (I think I want to go with MySQL for the DBMS, if that matters) with B4.

TIA.
 
Top