Skip to content

Commit bdfb7bb

Browse files
authored
Finish release/v2.0.1
Finish Release/v2.0.1
2 parents dab97b4 + 927ae44 commit bdfb7bb

File tree

22 files changed

+909
-361
lines changed

22 files changed

+909
-361
lines changed

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ out/
1616
# Gradle files
1717
.gradle/
1818
build/
19+
release/
1920

2021
# Local configuration file (sdk path, etc)
2122
local.properties
@@ -45,7 +46,8 @@ captures/
4546

4647
# Keystore files
4748
# Uncomment the following line if you do not want to check your keystore files in.
48-
#*.jks
49+
*.jks
50+
keystore.properties
4951

5052
# External native build folder generated in Android Studio 2.2 and later
5153
.externalNativeBuild

.idea/modules.xml

Lines changed: 2 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

README.md

Lines changed: 27 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -31,16 +31,37 @@ git clone https://github.com/openimis/openimis_android_app_java
3131

3232
### Configuration
3333

34-
In order to run the openIMIS IMIS Android Application, you need to
35-
know the openIMIS Web Services domain (DNS or IP address) and to
36-
configure it in the imispolicies.AppInformation java file.
34+
The configuration of the application is done through product flavors and build variants. The configuration can be found in ```app\build.gradle``` file. The default configuration contains demoProd or demoRelease flavors. Here is an example of product flavor.
3735

3836
```
39-
private static String _Domain = "http://demo.openimis.org/";
37+
demoProd {
38+
applicationId "org.openimis.imispolicies.demoProd"
39+
buildConfigField "String", "API_BASE_URL", '"http://demo.openimis.org/rest/"'
40+
buildConfigField "String", "RAR_PASSWORD", '")(#$1HsD"'
41+
buildConfigField "boolean", "SHOW_CONTROL_NUMBER_MENU", 'false'
42+
resValue "string", "app_name", "Policies Demo"
43+
dimension = 'std'
44+
}
4045
```
4146

42-
For demo purposes, the default Web Services domain is set to the openIMIS
43-
demo server: demo.openimis.org.
47+
Parameters:
48+
49+
* ```applicationId``` allow to build the application with its own application id. This allows to run different version of the application on the same device.
50+
* ```API_BASE_URL``` represents the openIMIS REST API URL (based on DNS or IP address) to connect to.
51+
* ```RAR_PASSWORD``` represents the password to be used for the offline extract.
52+
* ```SHOW_CONTROL_NUMBER_MENU``` allow to show or hide the Control Number menu item in case the implementation does not implement the ePayment module.
53+
* ```app_name``` is a resource string allowing to change the name of the application.
54+
55+
Escape procedures can be configured and language resource files can be changed. Please follow the ```sourceSets``` record. Look in ```app\src\demo``` folder for an example.
56+
57+
```
58+
sourceSets {
59+
demoProd.java.srcDir 'src/demo/java'
60+
demoRelease.java.srcDir 'src/demo/java'
61+
}
62+
```
63+
64+
You can add your own product flavor. Make sure you choose the updated built variant or your product flavor when running or building the application.
4465

4566
### Running the app
4667

app/app.iml

Lines changed: 109 additions & 49 deletions
Large diffs are not rendered by default.

app/build.gradle

Lines changed: 67 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,74 @@
11
apply plugin: 'com.android.application'
22

3+
// Load keystore
4+
def keystorePropertiesFile = file("keystore.properties");
5+
def keystoreProperties = new Properties()
6+
if ( keystorePropertiesFile.exists() ) {
7+
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
8+
}
9+
310
android {
4-
compileSdkVersion 27
5-
buildToolsVersion '27.0.3'
11+
compileSdkVersion 28
12+
buildToolsVersion '28.0.3'
13+
if ( keystorePropertiesFile.exists() ) {
14+
signingConfigs {
15+
releaseConfig {
16+
storeFile file(keystoreProperties['storeFile'])
17+
storePassword keystoreProperties['storePassword']
18+
keyAlias keystoreProperties['keyAlias']
19+
keyPassword keystoreProperties['keyPassword']
20+
}
21+
}
22+
}
623
defaultConfig {
724
applicationId "org.openimis.imispolicies"
8-
minSdkVersion 15
25+
minSdkVersion 19
926
targetSdkVersion 27
10-
versionCode 2
11-
versionName "2.0.0"
27+
versionCode 3
28+
versionName "2.0.1"
1229
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
1330
useLibrary('org.apache.http.legacy')
1431
}
1532
buildTypes {
1633
release {
1734
minifyEnabled false
1835
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
36+
debuggable = false
37+
if ( keystorePropertiesFile.exists() ) {
38+
signingConfig signingConfigs.releaseConfig
39+
}
40+
}
41+
debug {
42+
debuggable = true
1943
}
44+
flavorDimensions 'std'
45+
}
46+
flavorDimensions 'std'
47+
productFlavors.all {
48+
buildConfigField "String", "API_BASE_URL", '"http://demo.openimis.org/rest/"'
49+
buildConfigField "boolean", "SHOW_CONTROL_NUMBER_MENU", 'false'
50+
buildConfigField "String", "RAR_PASSWORD", '")(#$1HsD"'
51+
resValue "string", "app_name", "openIMIS Policies"
52+
}
53+
productFlavors {
54+
demoProd {
55+
applicationId "org.openimis.imispolicies.demoProd"
56+
buildConfigField "String", "API_BASE_URL", '"http://demo.openimis.org/rest/"'
57+
buildConfigField "String", "RAR_PASSWORD", '")(#$1HsD"'
58+
resValue "string", "app_name", "Policies Demo"
59+
dimension = 'std'
60+
}
61+
demoRelease {
62+
applicationId "org.openimis.imispolicies.demoRelease"
63+
buildConfigField "String", "API_BASE_URL", '"http://release.openimis.org/rest/"'
64+
buildConfigField "boolean", "SHOW_CONTROL_NUMBER_MENU", 'true'
65+
resValue "string", "app_name", "Policies Release"
66+
dimension = 'std'
67+
}
68+
}
69+
sourceSets {
70+
demoProd.java.srcDir 'src/demo/java'
71+
demoRelease.java.srcDir 'src/demo/java'
2072
}
2173
}
2274

@@ -38,12 +90,15 @@ dependencies {
3890
})
3991
compile(name: 'CaptureActivity', ext: 'aar')
4092
compile(name: 'General', ext: 'aar')
41-
implementation 'com.android.support:appcompat-v7:27.1.1'
42-
implementation 'com.android.support:design:27.1.1'
43-
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
44-
implementation 'com.squareup.picasso:picasso:2.5.2'
45-
implementation 'com.android.support:support-v4:27.1.1'
46-
testImplementation 'junit:junit:4.12'
47-
implementation 'com.android.support:recyclerview-v7:27.1.1'
93+
implementation 'com.android.support:appcompat-v7:28.0.0'
94+
implementation 'com.android.support:design:28.0.0'
95+
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
96+
implementation 'com.squareup.picasso:picasso:2.5.2'
97+
implementation 'com.android.support:support-v4:28.0.0'
98+
implementation 'com.android.support:recyclerview-v7:28.0.0'
99+
testImplementation 'junit:junit:4.12'
48100
compile files('libs/zip4j-1.2.7.jar')
101+
compile files('libs/httpclient-4.2.3.jar')
102+
compile files('libs/httpcore-4.2.3.jar')
103+
//compile 'com.android.support:support-annotations:27.1.1'
49104
}

app/keystore.properties.dist

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
storeFile=store_file
2+
storePassword=my.keystore
3+
keyPassword=key_password
4+
keyAlias=my_key_alias

app/libs/httpclient-4.2.3.jar

423 KB
Binary file not shown.

app/libs/httpcore-4.2.3.jar

222 KB
Binary file not shown.
File renamed without changes.

0 commit comments

Comments
 (0)