You can start developing a DHIS2 app with basic software development knowledge on OSX, Windows or Linux, some DHIS2 fundamentals knowledge, access to a DHIS2 instance and the DHIS command line interface (CLI) to perform most operations. In this introduction, you will install the prerequisites and optionally start up a local DHIS2 instance. Then you can follow the path of creating and connecting an app (either Web or Android, see Next Steps below).
In order to create DHIS2 apps you need a software development background which varies depending on whether you'll be creating Web apps (App Platform) or Mobile apps (with our Android SDK).
Web development background
Android development background
General Android development knowledge based on Java is required (we use Java 8 in the Android SDK). Some newer components are implemented in Kotlin so knowledge of Kotlin is a plus. If you're a Kotlin native developer you can probably get up and running quickly due to similarities between Java and Kotlin. We use RxJava to facilitate the asynchronous treatment of some methods. Other libraries internally used by the Android SDK are: Dagger for dependency injection, Jackson for JSON parsing, Retrofit and OkHttpClient for API communication and SQLBrite for DB migrations. Familiarity with all these languages, frameworks and libraries will get you up and running quickly.
As a developer you need to understand the domain in which you're working. DHIS2 is a Health Information Software with particulars that can be learned in our Fundamentals Academy, a highly advised self-paced set of online courses, offered free of charge, that will provide you with an introduction to DHIS2 principles and terminology, and help you gain an overall understanding of how DHIS2 can be used to collect and analyze aggregate and individual-level data through instructional video presentations, system demonstrations, short quizzes, and hands-on exercises and assignments.
If you're already familiar with DHIS2 you now need a DHIS2 instance to run your apps. If you're part of an organization that runs development DHIS2 environments you can request access and test your apps there. If you don't have access to a DHIS2 instance you have alternatives: use a demo DHIS2 instance, look for DHIS2 hosting options or run a containerized DHIS2 instance in your local machine as explained below.
For specific DHIS2 server requirements for an Android app please take a look at this page.
Running DHIS2 locally in a container (optional)
It's useful to run a local container with a DHIS2 instance for ease of development (you can then create and connect apps to your local instance for easy debugging and as playground).
If you are using Debian Linux,
- Follow the DHIS2 Docker guide to install the prerequisites
If you are using OSX or Windows,
yarn global add @dhis2/cli
Now that you have installed Docker and the CLI you are ready to start up a local DHIS2 instance.
Starting a local DHIS2 container instance
- From the terminal, start up DHIS2 and seed the database
d2 cluster up 184.108.40.206 --db-version 2.38 --seed
- From the browser, navigate to http://localhost:8080. If DHIS2 is running, you should see the following page:
Sign in as
admin (username) and
district (password). If you can load DHIS2 in the browser, you are ready to create a new app.
For more info on how to correctly set up command line tools please check our Environment Setup tutorial.
Now that you havea DHIS2 instance you can put it to the test by developing DHIS2 apps.