ExoForm: The Android Library - BigStep Technologies
2889
post-template-default,single,single-post,postid-2889,single-format-standard,ajax_fade,page_not_loaded,,qode_grid_1200,vss_responsive_adv,qode-child-theme-ver-1.0.0,qode-theme-ver-1.0.0,qode-theme-bridge child,bridge-child,wpb-js-composer js-comp-ver-5.1.1,vc_responsive

ExoForm: The Android Library

0

Android applications often rely upon data provided by users. However, unlike the form tag in HTML, there is no tag option or alternative in Android that can be used commonly for all the forms. Developers need to handle each an every aspect of form element right from submission, validation to layout design which turns out to be a very lengthy and tiresome process in implementation. This is a major problem for business applications where forms are dynamic and changes need to be done in the layout on a frequent basis. Changing each form individually throughout the application is a tiresome and repetitive task.

We at BigStep Technologies also faced problems because of this. We noticed that a lot of our development time was getting invested in something that was quite a repetitive process and was thus affecting our overall productivity. Being a mobile application development company, we decided that we needed to find out a solution to this that would cut down our development time and at the same time meet our requirements effectively.

Our developers after much research developed the ExoForm, which is a step to implement something similar to the form tag in HTML in Android by which developer can render any complex form structure in few lines of code. It is very efficient in handling nested forms, API validations, playing with subforms, etc.

Development Process

One of our developers when working on the pricing feature in one of our plugins found that the process to handle countrywise, state wise and region wise pricing was quite complex as countries have their respective list of states which in turn have their respective list of regions and furthermore individual regions have their specific fields. This entire structure required around 4 layers of nesting. Further, to handle forms the developer had to use individual core widgets to build a structure and then handle each and every aspect of the form element individually. He discussed the problem with the senior team members who collectively agreed upon how tedious the task is and decided that we being a renowned mobile applications development company had to find a solution to it.

The developer with the help of other team members and seniors explored the different options available and after much research and efforts, developed the ExoForm. For those of you who’ve never heard of ExoForm, you’ve stumbled across a golden egg. ExoForm is a truly superior form library in all regards. It provides device friendly, feature rich layout designs for both fields and forms. ExoForm is easy to customize and extend, in the context of data and event handling. You can even use your own custom media picker, custom element injection, etc.

Core Widgets vs ExoForm

In essence, ExoForm is just plain-old better than core widget pattern.
Very easy to play with nested subforms
Multiple form layout designs & all major fields availability
Auto-Suggest feature for text fields
Developer free to choose own Media Picker for input type File element
Very easy to use & fully customizable

Implementation and Examples

ExoForm provides three types of layout designs which can be used simultaneously in a single project with different forms. Available designs are given below

form
form
form
⇒ Cool auto suggest feature with associated API to the edittext elements and just use value location for attribute inputType to populate location auto suggestion.
Google Play
⇒ Form field specific error handling for both static and dynamic type.
Google Play

Implementation / Compile

Add it in your root build.gradle at the end of repositories:
allprojects {
repositories {

maven { url ‘https://jitpack.io’ }
}
}

Step 2. Add the dependency
dependencies {
implementation ‘https://github.com/BigStepTechnologies/ExoForm’
}

HOW TO USE?
@formResponse JSONObject,
@mContext Activity
FormWrapper formWrapper = new FormWrapper(mContext);
formWrapper.setFormSchema(formResponse);
View formLayout = formWrapper.getFormWrapper(mContext, formResponse);
// Inject form layout in any view as per your requirement.

Forms / Fields Response Format
// Fields JSON Format
{“name”:”title”,”type”:”Text”,”required”:true,”label”:”Page Title”}

// Forms JSON Format
{“form”:[{“name”:”title”,”type”:”Text”,”required”:true,”label”:”Content Title”},{“name”:”limit”,”type”:”checkbox”,”label”:”Limit Integrations”,”hasSubForm”:true }],”subForm”:{“limit_1”:[{“name”:”quantity”,”type”:”Text”,”label”:”Quantity”}]}}

Field Attribute Description
Common Attributes type Field type Ex. text, select, checkbox etc.
name Name of the field [It must be unique in the form.]
label Label of the field which will be visible to user
value Value of the field
description Description of the field, to more explain the input specific terms
required To validated(Not allowed empty if true) the field at application level, it can be true or false. It is false by default.
hasSubForm If any field contains child form/field [like category >> sub-category] then make it true to render subForm. It can be true/false, by default it is false.
TextField inputType Specific attribute of TextField element which allowed type of input[number, phone, location etc]
hint Hint for editbox inputs for better user experience
Select multiOptions Option menus for select type field
DateTime spinnerType It can be true or false, by default it is false. If ture it will render spinner view for date/time, otherwise calendar view.
inputType *Date : For date only *Time : For time only *DateTime : For date and time both
minDate To restrict minimum date
minDate To restrict minimum date
Checkbox All common attributes are valid for checkbox element
SwitchElement All common attributes are valid for switch element.
FileElement fileType To restrict the populating specific files in gallery like photo, video etc.
Heading It just uses label and very useful to categories the fields.
MultiSelect It’s layout is like grouped checkboxes which is useful when multiple choices for a single field.
multiOptions Option menus for MultiSelect type field

Kandarp Tiwari

A multi-verticals trained Digital Marketing Professional with 8+ years of Corporate Experience and an everlasting zeal to acquire knowledge. Particularly have a good capture over Digital Marketing and Emerging Tech.

No Comments

Sorry, the comment form is closed at this time.

Get Connected with our Experts

Request a Quote

Tell us about your requirements and we'll get back to you soon.