Android Question What are formularies best practices?


Licensed User
Longtime User
Well, I'm looking for this in the forum with no success.

My question is to know what is the best practice to build a form with a header-detail structure. I come from Windows (specifically from Delphi) and in there we have grids and the clientdataset. Here doesn't exist, so I'm bit lost.

I made many basic tutorials, but in none gave this info. All I have found is saving records from a simple table, with no relationship with others.

I don't know what's the best, no only to build, also to the final user:
1 - two activities with two different forms (one for head and one for detail)?
2 - make a form to introduce new records, or use the same form for all, saving changes when the user change, or edit something?
3 - save a record when a data change (for examples when a record lost focus)?

Don't know. Many questions, and many doubts, and no answer...
So tell me, what are best practices for this? Or what are most used in Android community?



Well-Known Member
Licensed User
Longtime User
Lots of Android apps which utilize more complex database schema use ORM (object/relational mapping) libraries such as GreenDAO, B4A doesn't have anything like that so I have written my own classes to simulate what you call a clientdataset because Android SQLite cursors are read only.

As for grids there are quite a few libraries for grids available. IMO the best one is UltimateListView. As for how to present the header / detail I think it really depends on the target audience for the app and the target devices. On smaller sized devices (phones) I tend to use two views. In portrait mode it shows the header and in landscape mode it shows a grid with the detail. I have also used sliding panels. As for adding/editing records to the detail I give the user the option of either using a new view or in grid editing; especially if they have a bluetooth keyboard attached.

No idea if this is best practice or not (probably not) but that's how I do things.
  • Like
Reactions: RSL
Upvote 0