Skip to content
This repository was archived by the owner on Apr 9, 2021. It is now read-only.

Commit e5cebb3

Browse files
Directory Picker
Directory Picker Fixed typos fixed Null pointer exception reformated code in xml added /ODK to filePath Changed method names Added /odk Deleted some unused changes Made code Checkstyle removed unused strings
1 parent 8922412 commit e5cebb3

File tree

131 files changed

+4283
-911
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

131 files changed

+4283
-911
lines changed

README.md

+49-9
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,15 @@
1818
3. [View Received forms](#view-received-forms)
1919
4. [Review forms](#review-forms)
2020
2. [Send filled forms](#send-filled-forms)
21+
1. [hotspot](#send-hotspot)
22+
2. [bluetooth](#send-bluetooth)
2123
3. [Receive filled forms](#receive-filled-forms)
22-
4. [Setting up your development environment](#setting-up-your-development-environment)
23-
5. [Contributing code](#contributing-code)
24+
1. [hotspot](#receive-hotspot)
25+
2. [bluetooth](#receive-bluetooth)
26+
4. [Switch Transferring Method](#switch-transferring-method)
27+
5. [Setting up your development environment](#setting-up-your-development-environment)
28+
6. [Contributing code](#contributing-code)
29+
2430

2531

2632
## 1. Introduction<a name="introduction"></a>
@@ -54,11 +60,11 @@ skunkworks-crow app can be downloaded and installed from the link provided below
5460
[Download APK](https://github.com/opendatakit/skunkworks-crow/releases)
5561

5662
## 3. Using skunkworks-crow<a name="using-skunkworks-crow"></a>
57-
Share app can be used by enumerators in sharing forms and by supervisor in reviewing the forms.
63+
Skunkworks-crow app can be used by enumerators in sharing forms and by supervisor in reviewing the forms.
5864

5965
### 3.1 Viewing category of forms<a name="view-category"></a>
6066

61-
Launch the app to see a listing of all distinct versions of blank forms on the home screen. Tapping on any form will open a screen with four different tabs showing the statistics, sent, received and reviewed.
67+
On launching the app, the first screen that we see contains a list of forms available in ODK Collect. Tapping on any form opens a screen with 4 tabs - statistics, sent, received, and reviewed.
6268

6369
To view details of any form category tap on any category shown on home screen.
6470
<p align="center">
@@ -94,9 +100,6 @@ To view the details of forms received, navigate to the ‘Received’ tab. To re
94100
To view the details of forms reviewed, tap on the ‘Reviewed’ tab. This shows all the forms reviewed by you with the form status. To send it back to the enumerator who asked for the feedback, select the forms and tap on ‘Send’. This will send all the forms with reviewed status as well as feedback back to the enumerator. If the enumerator didn’t send those forms for review then it won’t send any forms back, only those enumerators will get the feedback who asked for it.
95101

96102

97-
98-
99-
100103
### 3.2 Send filled forms<a name="send-filled-forms"></a>
101104

102105
After the launch of the app, on the home screen a 'Send' button is shown at the bottom. Tap on that button to open the screen which consists of a list showing all the filled forms available in ODK Collect and user can select any number of forms of any version of blank form which is required to be sent. It contains all the filled forms irrespective of its send/receive status.
@@ -107,6 +110,14 @@ After selecting the forms, press ‘Send’ to initiate the connection process s
107110

108111
Tapping on ‘Send’ button opens up the screen which will initiate the communication process and start the wifi hotspot so that receiver can connect to it and start receiving the forms.
109112

113+
In the Skunkworks-crow, forms can be exchanged using either Wifi Hotspot or Bluetooth. The default preference for the transferring method can be modified through the settings page.
114+
115+
<p align="center">
116+
<img src="/screenshots/choose_default_method.png" width="280" height="500"/>
117+
</p>
118+
119+
#### 3.2.1 Wifi Hotspot<a name="send-hotspot"></a>
120+
110121
A Wifi Hotspot is used as the sender’s communication method, which creates a wifi network and sends files using the socket connection. When the wifi hotspot is initiated, it turns off the wifi if already enabled and creates new wifi configuration and saves the last saved hotspot configuration which is restored at the end of a transfer.
111122

112123
If hotspot initiation is successful then the screen will show the QR Code generated so that receiver can scan the QR Code to connect to it and start receiving the forms.
@@ -120,9 +131,20 @@ If user wants to manually connect to it then the screen shows the network name s
120131
For devices having Android version 7.0 and 7.1 user will be sent to settings to enable the wifi hotspot functionality. The user will then need to tap the device back button to come back to skunkworks-crow.
121132
And for other device it will be enabled automatically.
122133

134+
#### 3.2.2 Bluetooth<a name="send-bluetooth"></a>
135+
136+
The bluetooth has a shorter transferring distance than hotspot, so you may need to put sender and receiver closed to establish a valid connection. In the receiver's settings page, you can enable the secure mode of bluetooth, it allows you to establish an encrypted transmission (needs a pair code when first pairing).
137+
138+
The bluetooth feature needs location permission. After a bluetooth socket was create, you will see a dialog to ask to make your device discoverable, after clicking that, You have 120s to let the receiver connect. Our application will automatically start data transfer if the bluetooth connection is successful.
139+
140+
<p align="center">
141+
<img src="/screenshots/send_data.gif" width="280" height="500"/>
142+
</p>
143+
123144

124145
### 3.3 Receive filled forms<a name="receive-filled-forms"></a>
125146

147+
#### 3.3.1 Wifi Hotspot<a name="receive-hotspot"></a>
126148
Tap on the 'Receive' button shown at the bottom of the home screen to see a list of all wifi networks available in the nearby area which are started by only skunkworks-crow app.
127149

128150
A receiver will need to connect to the network the sender has created. There are two ways to connect to the network:
@@ -138,7 +160,25 @@ For some devices, the user is not allowed to configure the wifi hotspot from the
138160
<img src="/screenshots/received_qr_code.gif" width="280" height="500"/>
139161
</p>
140162

141-
## 4. Setting up your development environment<a name="setting-up-your-development-environment"/>
163+
#### 3.3.2 Bluetooth<a name="receive-bluetooth"></a>
164+
165+
If we use bluetooth to receive forms, you can find a bluetooth device list in the receiver page. Just clicking the sender's item, the Skunkworks-crow will connect and start receiving once connected. You can click the `refresh` button to refresh the list if you cannot find your target sender.
166+
167+
<p float="left" align="center">
168+
<img src="/screenshots/send_data.gif" width="280" height="500"/>
169+
<img src="/screenshots/receive_data.gif" width="280" height="500"/>
170+
</p>
171+
172+
## 4. Switch Transferring Method<a name="switch-transferring-method"></a>
173+
We have two methods to use, you can set a default method in settings. But when you have trouble sending/receiving forms, you can click the `switch` icon button in the tool bar, that offers a quick way for you to switch from this method to another.
174+
175+
<p align="center">
176+
<img src="/screenshots/method_switching.gif" width="280" height="500"/>
177+
</p>
178+
179+
If you changed the method of sender/receiver, don't forget to be consistent with another device.
180+
181+
## 5. Setting up your development environment<a name="setting-up-your-development-environment"/>
142182

143183
1. Download and install [Git](https://git-scm.com/downloads) and add it to your PATH
144184

@@ -154,7 +194,7 @@ For some devices, the user is not allowed to configure the wifi hotspot from the
154194

155195
1. Open the project in the folder of your clone from Android Studio. To run the project, click on the green arrow at the top of the screen.
156196

157-
## 5. Contributing code<a name="contributing-code"/>
197+
## 6. Contributing code<a name="contributing-code"/>
158198
Any and all contributions to the project are welcome. Skunkworks-Crow is used across the world primarily by organizations with a social purpose so you can have real impact!
159199

160200
Issues tagged as [good first issue](https://github.com/opendatakit/skunkworks-crow/labels/good%20first%20issue) should be a good place to start. There are also currently many issues tagged as [needs reproduction](https://github.com/opendatakit/skunkworks-crow/labels/needs%20reproduction) which need someone to try to reproduce them with the current version of Skunkwork-Crow and comment on the issue with their findings.

build.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ buildscript {
77
jcenter()
88
}
99
dependencies {
10-
classpath 'com.android.tools.build:gradle:3.3.2'
10+
classpath 'com.android.tools.build:gradle:3.5.1'
1111

1212

1313
// NOTE: Do not place your application dependencies here; they belong

config/pmd-ruleset.xml

+47-76
Original file line numberDiff line numberDiff line change
@@ -1,25 +1,13 @@
1-
<?xml version="1.0"?><!--
2-
~ Copyright 2015 Vincent Brison.
3-
~
4-
~ Licensed under the Apache License, Version 2.0 (the "License");
5-
~ you may not use this file except in compliance with the License.
6-
~ You may obtain a copy of the License at
7-
~
8-
~ http://www.apache.org/licenses/LICENSE-2.0
9-
~
10-
~ Unless required by applicable law or agreed to in writing, software
11-
~ distributed under the License is distributed on an "AS IS" BASIS,
12-
~ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
~ See the License for the specific language governing permissions and
14-
~ limitations under the License.
15-
-->
1+
<?xml version="1.0"?>
162

17-
<ruleset xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" name="Android Application Rules"
18-
xmlns="http://pmd.sf.net/ruleset/1.0.0"
19-
xsi:noNamespaceSchemaLocation="http://pmd.sf.net/ruleset_xml_schema.xsd"
20-
xsi:schemaLocation="http://pmd.sf.net/ruleset/1.0.0 http://pmd.sf.net/ruleset_xml_schema.xsd">
3+
<ruleset name="Custom Rules"
4+
xmlns="http://pmd.sourceforge.net/ruleset/2.0.0"
5+
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
6+
xsi:schemaLocation="http://pmd.sourceforge.net/ruleset/2.0.0 https://pmd.sourceforge.net/ruleset_2_0_0.xsd">
217

22-
<description>Custom rule-set for Android application</description>
8+
<description>
9+
Custom rule-set for Android application
10+
</description>
2311

2412
<exclude-pattern>.*/R.java</exclude-pattern>
2513
<exclude-pattern>.*/gen/.*</exclude-pattern>
@@ -48,52 +36,26 @@
4836
<exclude name="AvoidBranchingStatementAsLastInLoop" />
4937
<exclude name="ReturnFromFinallyBlock" />
5038
</rule>
51-
<rule ref="rulesets/java/naming.xml">
52-
<exclude name="AbstractNaming" />
53-
<exclude name="LongVariable" />
54-
<exclude name="ShortMethodName" />
55-
<exclude name="ShortVariable" />
56-
<exclude name="VariableNamingConventions" />
57-
<exclude name="AvoidFieldNameMatchingMethodName" />
58-
<exclude name="ShortClassName" />
59-
<exclude name="MethodNamingConventions" />
60-
<exclude name="AvoidFieldNameMatchingTypeName" />
61-
</rule>
62-
<rule ref="rulesets/java/design.xml">
63-
<exclude name="ConfusingTernary" />
64-
<exclude name="TooFewBranchesForASwitchStatement" />
65-
<exclude name="AbstractClassWithoutAbstractMethod" />
66-
<exclude name="SwitchStmtsShouldHaveDefault" />
67-
<exclude name="AvoidDeeplyNestedIfStmts" />
68-
<exclude name="ImmutableField" />
39+
<rule ref="category/java/design.xml">
40+
<exclude name="AvoidCatchingGenericException" />
41+
<exclude name="AvoidThrowingRawExceptionTypes" />
42+
<exclude name="ClassWithOnlyPrivateConstructorsShouldBeFinal" />
43+
<exclude name="CollapsibleIfStatements" />
44+
<exclude name="CyclomaticComplexity" />
45+
<exclude name="DataClass" />
46+
<exclude name="ExcessiveImports" />
47+
<exclude name="ExcessiveMethodLength" />
6948
<exclude name="GodClass" />
70-
<exclude name="FieldDeclarationsShouldBeAtStartOfClass" />
71-
<exclude name="SwitchDensity" />
72-
<exclude name="UseCollectionIsEmpty" />
73-
<exclude name="UncommentedEmptyMethodBody" />
74-
<exclude name="MissingBreakInSwitch" />
75-
<exclude name="CompareObjectsWithEquals" />
76-
<exclude name="SimplifyConditional" />
49+
<exclude name="ImmutableField" />
50+
<exclude name="LawOfDemeter" />
51+
<exclude name="NcssCount" />
52+
<exclude name="NPathComplexity" />
53+
<exclude name="SignatureDeclareThrowsException" />
7754
<exclude name="SingularField" />
78-
<exclude name="UseVarargs" />
79-
<exclude name="UncommentedEmptyConstructor" />
80-
<exclude name="AccessorClassGeneration" />
81-
<exclude name="AvoidReassigningParameters" />
82-
<exclude name="AvoidProtectedMethodInFinalClassNotExtending" />
83-
<exclude name="AvoidSynchronizedAtMethodLevel" />
84-
<exclude name="PreserveStackTrace" />
85-
<exclude name="ConstructorCallsOverridableMethod" />
86-
<exclude name="PositionLiteralsFirstInCaseInsensitiveComparisons" />
87-
<exclude name="PositionLiteralsFirstInComparisons" />
88-
<exclude name="AvoidInstanceofChecksInCatchClause" />
89-
<exclude name="LogicInversion" />
90-
<exclude name="SimplifyBooleanReturns" />
91-
<exclude name="EmptyMethodInAbstractClassShouldBeAbstract" />
92-
<exclude name="UseUtilityClass" />
93-
<exclude name="ClassWithOnlyPrivateConstructorsShouldBeFinal" />
94-
<exclude name="AssignmentToNonFinalStatic" />
95-
<exclude name="OptimizableToArrayCall" />
96-
<exclude name="AccessorMethodGeneration" />
55+
<exclude name="SwitchDensity" />
56+
<exclude name="TooManyFields" />
57+
<exclude name="TooManyMethods" />
58+
<exclude name="UseObjectForClearerAPI" />
9759
</rule>
9860
<rule ref="rulesets/java/optimizations.xml">
9961
<exclude name="LocalVariableCouldBeFinal" />
@@ -121,18 +83,27 @@
12183
<!-- Decided not to use in #1519 -->
12284
<exclude name="UselessParentheses" />
12385
</rule>
124-
<rule ref="rulesets/java/codesize.xml">
125-
<exclude name="CyclomaticComplexity" />
126-
<exclude name="TooManyMethods" />
127-
<exclude name="ModifiedCyclomaticComplexity" />
128-
<exclude name="StdCyclomaticComplexity" />
129-
<exclude name="TooManyFields" />
130-
<exclude name="ExcessiveMethodLength" />
131-
<exclude name="NPathComplexity" />
132-
<exclude name="NcssConstructorCount" />
133-
<exclude name="ExcessivePublicCount" />
134-
<exclude name="ExcessiveClassLength" />
135-
<exclude name="NcssMethodCount" />
86+
<rule ref="category/java/codestyle.xml">
87+
<exclude name="AtLeastOneConstructor" />
88+
<exclude name="CallSuperInConstructor" />
89+
<exclude name="ClassNamingConventions" />
90+
<exclude name="CommentDefaultAccessModifier" />
91+
<exclude name="ConfusingTernary" />
92+
<exclude name="DefaultPackage" />
93+
<exclude name="FieldDeclarationsShouldBeAtStartOfClass" />
94+
<exclude name="FieldNamingConventions" />
95+
<exclude name="IdenticalCatchBranches" />
96+
<exclude name="LinguisticNaming" />
97+
<exclude name="LocalVariableCouldBeFinal" />
98+
<exclude name="LongVariable" />
99+
<exclude name="MethodArgumentCouldBeFinal" />
100+
<exclude name="OnlyOneReturn" />
101+
<exclude name="ShortClassName" />
102+
<exclude name="ShortMethodName" />
103+
<exclude name="ShortVariable" />
104+
<exclude name="TooManyStaticImports" />
105+
<exclude name="UnnecessaryConstructor" />
106+
<exclude name="UselessParentheses" />
136107
</rule>
137108
<rule ref="rulesets/java/unusedcode.xml" />
138109
</ruleset>

config/quality.gradle

+1-1
Original file line numberDiff line numberDiff line change
@@ -108,5 +108,5 @@ android {
108108

109109
//------------------------ ALL ------------------------//
110110
task checkCode(type: GradleBuild) {
111-
tasks = ['pmd', 'checkstyle', 'lint', 'findbugs']
111+
tasks = ['pmd', 'checkstyle', 'lint', 'findbugs', 'testDebugUnitTest']
112112
}
+2-2
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#Wed Mar 20 08:07:11 IST 2019
1+
#Mon Oct 28 17:15:18 IST 2019
22
distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
44
zipStoreBase=GRADLE_USER_HOME
55
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-4.10.1-all.zip
6+
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip

screenshots/choose_default_method.png

151 KB
Loading

screenshots/method_switching.gif

1.87 MB
Loading

screenshots/receive_data.gif

828 KB
Loading

screenshots/send_data.gif

859 KB
Loading

skunkworks_crow/build.gradle

+15
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,11 @@ android {
2121
targetCompatibility 1.8
2222
sourceCompatibility 1.8
2323
}
24+
testOptions {
25+
unitTests {
26+
includeAndroidResources = true
27+
}
28+
}
2429
}
2530

2631
dependencies {
@@ -32,6 +37,12 @@ dependencies {
3237
androidTestImplementation 'androidx.test:runner:1.1.1'
3338
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0-alpha4'
3439

40+
// testing-only
41+
testImplementation "junit:junit:4.12"
42+
testImplementation "org.mockito:mockito-core:2.11.0"
43+
testImplementation "org.robolectric:robolectric:4.3"
44+
testImplementation "org.robolectric:shadows-multidex:4.3"
45+
3546
// butterknife
3647
implementation "com.jakewharton:butterknife:${rootProject.butterknifeVersion}"
3748
annotationProcessor "com.jakewharton:butterknife-compiler:${rootProject.butterknifeVersion}"
@@ -59,4 +70,8 @@ dependencies {
5970

6071
//MPAndroidChart
6172
implementation 'com.github.PhilJay:MPAndroidChart:v3.0.3'
73+
74+
// Permissions Dispatcher
75+
implementation "org.permissionsdispatcher:permissionsdispatcher:4.5.0"
76+
annotationProcessor "org.permissionsdispatcher:permissionsdispatcher-processor:4.5.0"
6277
}

0 commit comments

Comments
 (0)