Android Question Advice needed - Dynamically created page

fixit30

Active Member
Licensed User
Longtime User
Hi All.

I have been away from B4X for a number of years.

I am looking at creating a new app, initially for B4A, but later for B4i too.

The app will be a job dispatching system. A job will be sent to the app and the user will complete the job, recording various information on what is done, and then capture a customer signature, and then send the information back to our server. The main functionality of the app is not a problem (I created a similar app many years ago with B4A), however there is one issue I need advice on.

There could be many different types of 'job' and each type of job would require different types of information to be recorded, added to this, the information required could change fairly frequently and new job types added.

I had initially thought to be able to dynamically create the information capture page using a JSON definition file sent with the job from the server, however I have read many times on the forum from @Erel that it is NOT the correct way to build a page using only code (especially for B4i), therefore my question is how can I correctly handle such situations where different information needs to be captured? I do not want a hard coded view for each job type that would require an update to the app every time some additional information needs to be captured or a new job type added.

I look forward to hearing your suggestions.
 

kisoft

Well-Known Member
Licensed User
Longtime User
Hi
What would you say for that :
 
Upvote 0

fixit30

Active Member
Licensed User
Longtime User
Thanks for the reply, I have seen that thread, however in the video it still shows the use of the visual designer to create the views for each platform.

Since my above post, I have found this thread which looks exactly what I need, however I would really like to be able to implement the form builder into an existing .NET web app.
 
Upvote 0

Cableguy

Expert
Licensed User
Longtime User
I would create a "database" of sorts, with a job's name, definition and required field, and based on the current job, either turn visibility on/off or simply load the corresponding layout.
Dynamically creating the layout is something that to me seems too complicated and would not offer the best results visually and the user experience would not be the best possible.
 
Upvote 0

Andrew (Digitwell)

Well-Known Member
Licensed User
Longtime User
We are currently working on a project which is similar, and we took the PreferenceDialog as a basis. It was slightly rewritten to work in a panel rather than a dialog. This dynamically creates a screen based on a JSON file at runtime.

This seems to give the best of both worlds as it uses (sub)layouts to build the larger screen.

We are modifying the UI for each of the components to suit our need, but this may be a way for you to go.

 
Upvote 0

kisoft

Well-Known Member
Licensed User
Longtime User
however I would really like to be able to implement the form builder into an existing .NET web app.
You can use WebView for this. I still think B4XPages will be perfect in this case. You can build multiple pages in one activity and easily switch between views ... B4XPages simplifies a lot...
 
Upvote 0

Erel

B4X founder
Staff member
Licensed User
Longtime User
Since my above post, I have found this thread which looks exactly what I need, however I would really like to be able to implement the form builder into an existing .NET web app.
Forms builder generates a simple json file with the preferences templage. You can generate it in any way you like.
 
Upvote 0
Top