Skip to content

Application Variants

idelcano edited this page May 12, 2016 · 6 revisions

Variants explanation

EDS variant

HNQIS variant

Json settings

The variants are different versions of the same application from a single project.

QApp have two variants, EDS and HNQIS, and two build types for each one(debug and release).

That flavours are defined in the gradle build file, and each flavour contains the flavour directory and a "duplicate" file with the changes.

To change the active variant in the android studio, you need: 1 click on the left button "build variants" 2 click in the app build variant option and select the option.

To create a product flavour, you need:

  1. define the product flavours in the build file.
  2. Create additional source directories for each flavour.
  3. Add the flavour-specific sources to your project.

More information

All the EDS variant files:

Path: malariapp/app/eds/

The EDS csv database:

Path: malariapp/app/eds/assets

Files: Answer.csv, CompositeScores.csv, Headers.csv, Matches.csv, Options.csv, OrgUnitLevels.csv, OrgUnits.csv, Programs.csv, QuestionOptions.csv, QuestionRelations.csv, Questions.csv, TabGroups.csv, Tabs.csv.

Path: malariapp/app/eds/res/drawable

EDS variant drawable

Files: background_even.xml, background_even_wo_border.xml, background_footer.xml,background_header.xml, background_odd.xml, background_odd_wo_border.xml, background_parent.xml, background_textfield.xml, button_borders.xml, cell_borders.xml, radiobutton.xml

Path: malariapp/app/eds/res/

EDS variant images:

Folders: drawable-hdpi, drawable-mdpi, drawable-xhdpi, drawable-xxhdpi

Files: ic_menu_add.png, qualityapp_logo.png.

Folders: drawable-large, drawable-normal, drawable-small

radio_off.png, radio_off_pressed-png, radio_on-png, radio_on_pressed.png.

Path: malariapp/app/eds/res/layout

EDS variant layouts:

Files: assessment_header.xml, assessment_record.xml, assessment__sent_header.xml, assessment_sent_record.xml, create_survey_fragment_custom_button.xml, create_survey_fragment_orgunit_options.xml, create_survey_fragment_program_options.xml, create_survey_fragment_tab_options.xml, create_survey_org_unit_item_customtext.xml, create_survey_org_unit_spinner.xml, headers.xml, label_style.xml, main_header.xml, main_spinner_item.xml, survey.xml.

Path: malariapp/app/eds/res/

EDS raw files:

The raw folder contains English files.

The raw-fr folder contains the French files.

The raw-pt folder contains the Portuguese files.

The raw-es folder contains the Spanish files.

All this folders contains: about us text(about.txt file), copyright (copyright.txt file), eula (eula.txt file), and licenses (licenses.txt file).

And a unique settings.json file in malariapp/app/eds/res/raw/ to build the app.

Path: malariapp/app/eds/res/

EDS variant strings:

The values/strings.xml file contains English strings.

The values-fr/strings.xml file contains the French strings.

The values-pt/strings.xml file contains the Portuguese strings.

The values-es/strings.xml file contains the Spanish strings.

Eds variant values files for all the languages: The file malariapp/app/eds/res/values/colors.xml contains eds variant colors.

The file malariapp/app/eds/res/values/dimen.xml contains eds dimens.

The file malariapp/app/eds/res/values/donottranslate.xml contains eds appname and the default eds server string in login screen.

All the HNQIS variant files:

Path: malariapp/app/hnqis /

The HNQIScsv database:

Path: malariapp/app/hnqis/assets

Files: Answer.csv, CompositeScores.csv, Headers.csv, Matches.csv, Options.csv, OrgUnitLevels.csv, OrgUnits.csv, Programs.csv, QuestionOptions.csv, QuestionRelations.csv, Questions.csv, TabGroups.csv, Tabs.csv.

EDS variant strings:

Path: malariapp/app/hnqis/res

The values/strings.xml file contains English strings.

The values-fr/strings.xml file contains the French strings.

The values-pt/strings.xml file contains the Portuguese strings.

The values-es/strings.xml file contains the Spanish strings.

HNQIS variant values files for all the languages:

The file malariapp/app/eds/res/values/donottranslate.xml contains HNQIS appname and the default HNQIS server string in login screen.

The path of the settings.json file are: /app/src/[variant]/res/raw/

In that json file we can define the application settings, for example.

"database": {

`"originType": "dhis",`

`"uri": "https://eds-dev.psi-mis.org",`

`"fullHierarchy":true`

},

"dashboard": {

`"orientation": "vertical",`

`"layout":"vertical_main",`

`"modules": [{`

  `"title": "assess",`

  `"icon": "tab_assess",`

  `"backgroundColor": "tab_yellow_assess",`

  `"layout": "dashboard_details_container",`

  `"controller": "AssessModuleController"`

`},{`

  `"title": "improve",`

  `"icon": "tab_improve",`

  `"backgroundColor": "tab_blue_improve",`

  `"layout": "dashboard_completed_container",`

  `"controller": "ImproveModuleController"`

`}`

`]`

}

The Json contains a database json object with the parameters: oringinTYpe: set dhis for a pull from the server, or csv to populate from csv. uri: the server url. fullHierarchy: true to download all the organisation units levels, or false to download only the organisation units with programs.

In the dashboard object we can define the modules and the orientation of the application. orientation: To set the application horizontal or vertical. layout: To set the main layout(vertical_main or horizontal_main at the moment). modules, in that example, Assess and Improve modules.

The modules contains: title: It is the title. icon: It is the tab icon. backgroundColor: It is the tab background colour. layout: It is the fragment container. controller: It is the module controller.

Actually we have other example of settings.json: {

"database": {

`"originType": "dhis",`

`"uri": "https://hnqis-dev-ci.psi-mis.org",`

`"fullHierarchy":false`

},

"dashboard": {

`"orientation": "horizontal",`

`"layout":"tab_dashboard",`

`"modules": [{`

  `"title": "plan",`

  `"icon": "tab_plan",`

  `"backgroundColor": "tab_orange_plan",`

  `"layout": "dashboard_planning_tab",`

  `"controller": "PlanModuleController"`

`}, {`

  `"title": "assess",`

  `"icon": "tab_assess",`

  `"backgroundColor": "tab_yellow_assess",`

  `"layout": "dashboard_details_container",`

  `"controller": "AssessModuleController"`

`},{`

  `"title": "improve",`

  `"icon": "tab_improve",`

  `"backgroundColor": "tab_blue_improve",`

  `"layout": "dashboard_completed_container",`

  `"controller": "ImproveModuleController"`

`},{`

  `"title": "monitor",`

  `"icon": "tab_monitor",`

  `"backgroundColor": "tab_green_monitor",`

  `"layout": "dashboard_charts_container",`

  `"controller": "MonitorModuleController"`

`}`

`]`

}

}

Clone this wiki locally