Skip to content

Commit

Permalink
AC-981 : Working on the encapsulation for the library. (#896)
Browse files Browse the repository at this point in the history
* AC-981 : intialized the sdk

1. Understood the login flow
2. Initialized the sdk

* AC-981 : Models and Entites moved to sdk

for now some of the classes have been duplicated
1. OpenMRSLogger
2. few toast resources
3. Utility section Utils

* AC-981 : Updated permissions access network state

* AC-981 : Migrated dao and databases

1. dao
2. databases and helper

* AC-981 : Shared prefs moved to OpenmrsAndroid

1. removed redundant utility classes.
2. moved all functions from OpenMRS to OpenMRS Android.
3. Image utils split into 2 for context requirements.

* AC-981 : Fixed broken tests with the changes

1. mocked static methods of OpenmrsAndroid.

* AC-981 : RestAPI moved up with the rest services builder.

1. 2 NPE Issues observed but I think those are from previous Issues
2. AC-967 and AC-982

* AC-981 : Moving all the repository files over. along with the workers.

1. created string duplicate files.

* AC-981 : Prepping for test release

1. typo fixed.

2. Update build.gradle

* AC-981 : Added docs for Repository package

* AC-981 : Added correct package name as domain name and docs

1. added correct package openmrs instead of example
2. generated kdoc for the kotlin files.

* AC-981 : Added tool to generate html form of javadoc

Update README.md

* AC-981 : Update README.md and further documentation
  • Loading branch information
LuGO0 authored Aug 12, 2021
1 parent 6242fb5 commit cbb230c
Show file tree
Hide file tree
Showing 320 changed files with 6,851 additions and 2,406 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,7 @@ captures/
.idea/markdown-navigator-enh.xml
.idea/markdown-navigator.xml
/openmrs-client/.idea
.idea/intellij-javadocs-4.0.1.xml

# Code style from https://github.com/openmrs/openmrs-core/blob/master/tools/src/main/resources/eclipse/OpenMRSFormatter.xml
# stored in .idea/OpenMRSFormatter to be compatible with eclipse code formatter
Expand Down
52 changes: 47 additions & 5 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,22 +3,64 @@ OpenMRS is a collaborative open-source project to develop software to support th

The purpose of the Android Client is to provide an OpenMRS 2.x client for Android devices. The app is designed to cover most of the functionality currently on the web application. The app communicates with OpenMRS instances using REST. It supports working offline.

You can get to know more about the OpenMRS Android Client at the [Android Client Wiki](https://wiki.openmrs.org/display/projects/OpenMRS+2.x+Android+Client)

## Installing Git
The first step to starting to contribute to the Android Client is installing Git Bash. You can also use Github Desktop, but using Bash is recommended. This is because Bash allows the user to perform more commands as compared to the latter. After downloading, you need to log into Git Bash using your GitHub credentials.
The first step to starting to contribute to the Android Client is installing Git Bash. You can also use Github Desktop, but using Bash is recommended. This is because Bash allows the user to perform more commands as compared to the latter. After downloading, you need to log in to Git Bash using your GitHub credentials.
* [Download Git Bash for Mac](https://git-scm.com/download/mac)
* [Download Git Bash for Windows](https://git-scm.com/download/win)
* [Download Git Bash for Linux/UNIX](https://git-scm.com/download/linux)
* [Download Github Desktop](https://desktop.github.com/)


## Forking and Cloning the repository
## Steps to set up:
1. Fork the repository and clone your fork.
2. From the Android Studio menu select `File` > `New` > `Import Project`. Alternatively, from the `Welcome screen`, select `Import project`.
3. Navigate to the folder where you have cloned this repo and select the `build.gradle` file inside. Select `Import`.
4. Done! Wait for dependencies to load and download from Maven, then you're ready to go!
5. Make sure that you have the latest SDK and build tools downloaded, as we always build against the latest release.

### Forking and Cloning the repository
The first actual step in contributing to any open source project is forking and cloning the repository. Just head on to the repository on GitHub and click on the *Fork* button.

The next step is to clone your fork of the repository. You can do that by running
```git clone https://github.com/[username]/openmrs-contrib-android-client``` in Git Bash or your terminal.


### Code Style
The coding conventions used by OpenMRS are outlined [here](https://wiki.openmrs.org/display/docs/Developer+How-To+Setup+And+Use+IntelliJ#DeveloperHow-ToSetupAndUseIntelliJ-SetupCodeStyleAndFormatForOpenMRS). These can be applied to Android Studio by following the steps given below.
1. Install [Eclipse Code Formatter](https://github.com/krasa/EclipseCodeFormatter) plugin in Android studio
I. Go to `Settings` > `Preferences` > `Plugins`
II. Select Marketplace and search for the plugin by name.
Then install it
2. Copy the required [XML](https://github.com/openmrs/openmrs-core/blob/master/tools/src/main/resources/eclipse/OpenMRSFormatter.xml)
3. Go to `Settings` > `Eclipse Code Formatter` and import the XML created in the previous step
4. Now go to `Editor` > `Code Style` in the same window
5. Select `Java` in the menu on the left and update values in `Imports` as shown in the below picture
![Java:Imports settings](https://wiki.openmrs.org/download/attachments/3346739/Screen%20Shot%202017-03-02%20at%2013.01.04.png?version=1&modificationDate=1488438089000&api=v2)
5. Now select `XML` in the menu on left and update values in the `Tabs and Indents` tab as shown in the below picture
![XMLOther setings](https://wiki.openmrs.org/download/attachments/3346134/Screen%20Shot%202017-03-10%20at%2010.52.44.png?version=2&modificationDate=1489121590000&api=v2)


Please follow the below instructions while contributing:
1. When project is opened with Android Studio, go to `File` > `Settings` > `Editor` > `Code Style`
2. Select Project from the Scheme dropdown
3. Make sure that **hard wrap** is set to **125** for Java and XML language settings.


### Model pattern
We are following [Google's MVP sample](https://github.com/googlesamples/android-architecture/tree/todo-mvp) for this application's development.


### HTTP call debugging
In order to debug HTTP calls, we have integrated [Chuck Library](https://github.com/jgilfelt/chuck) (a GUI-based open-source library) to track network calls. Apps using Chuck will display a notification showing a summary of ongoing HTTP activity. Tapping on the notification launches the full Chuck UI.

[In-depth tutorial](https://github.com/codepath/android_guides/wiki/Getting-Started-with-Gradle)

Note:
- If you are working behind a proxy, check [this](https://wiki.appcelerator.org/display/guides2/Using+Studio+From+Behind+a+Proxy) to get things working.
- To start development on a local server, type http://10.0.2.2:8080/openmrs (for Android Studio AVD) or http://10.0.3.2:8080/openmrs (for Genymotion) as URL.


## Finding an Issue
Now that you've created a local repository, the next step is to find an issue to work on. You can either choose an existing issue or create an Issue ticket of your own.
All the Issues for the Android Client can be found [here](https://issues.openmrs.org/projects/AC/issues).
Expand Down Expand Up @@ -51,7 +93,7 @@ To create an issue, you would need access to the Issue Tracker. To gain access,
* Make the changes to the files that will solve the issue according to you.

## Performing a Gradle Check (for Android Projects)
It is always advised to run a gradle check before you create a pull request. You can do this by typing ```./gradlew check``` in your terminal of Android Studio. If the check is failing, please fix all the errors.
It is always advised to run a Gradle check before you create a pull request. You can do this by typing ```./gradlew check``` in your terminal of Android Studio. If the check is failing, please fix all the errors.

## Committing your changes
When you're done with the changes, type these commands in the Git Bash.
Expand All @@ -66,7 +108,7 @@ Also, make sure you're in the branch that you created.
When you're done with all the steps above, you're finally ready to make a pull request. A pull request is you requesting the org maintainers to merge your changes to the actual project.
* You can make a pull request by heading over to your repository link, where you'll see your latest commit, and a button with the text ```Create Pull Request``` on it.
* Title your Pull Request as ```[AC-<IssueNumber>] <Short Description of what you did>```
* Fill all the details in the Pull Request template and finally post the Pull Request.
* Fill in all the details in the Pull Request template and finally post the Pull Request.

## Squashing your commits
It is very common that a PR doesn't get approved on the first try and you are told to do some edits to your code. In a situation like this, your PR is obviously going to have a lot of commits. A large number of commits makes it difficult to manage the commit tree. That's when squashing is going to help you combine all the commits into one single one. You can squash your commits by typing these commands in the Bash:
Expand Down
86 changes: 0 additions & 86 deletions GSoC_2016.md

This file was deleted.

Loading

0 comments on commit cbb230c

Please sign in to comment.