Skip to content

Commit 575cc3d

Browse files
authored
Merge pull request #2317 from fossasia/development
chore: merge development branch into master branch
2 parents 8bd5fdf + 63c7c19 commit 575cc3d

File tree

229 files changed

+10419
-3078
lines changed

Some content is hidden

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

229 files changed

+10419
-3078
lines changed

.github/PULL_REQUEST_TEMPLATE

+11-11
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,14 @@
1-
Fixes #[Add issue number here. Note: This will automatically closes the issue. If you do not solve the issue entirely, please change the message to e.g. "First steps for issues #IssueNumber]
1+
**Fixes** #<!-- Add issue number here. This will automatically closes the issue. If you do not solve the issue entirely, please change the message to e.g. "First steps for issues #IssueNumber" -->
22

3-
**Changes**: [Add here what changes were made in this issue and if possible provide links.]
3+
**Changes**:
4+
- <!-- Add here what changes were made in this issue and if possible provide links. -->
45

5-
**Screenshot/s for the changes**: [Add screenshot/s of the layout where you made changes or a `*.gif` containing a demonstration]
6+
**Screen shots for the changes**:
7+
<!-- Add screen shots/screen recordings of the layout where you made changes or a `*.gif` containing a demonstration -->
68

7-
**Checklist**: [Please tick following check boxes with `[x]` if the respective task is completed]
8-
- [ ] I have used resources from `strings.xml`, `dimens.xml` and `colors.xml` without hard-coding them
9-
- [ ] No modifications done at the end of resource files `strings.xml`, `dimens.xml` or `colors.xml`
10-
- [ ] I have reformatted code in every file included in this PR [<kbd>CTRL</kbd>+<kbd>ALT</kbd>+<kbd>L</kbd>]
11-
- [ ] My code does not contain any extra lines or extra spaces
12-
- [ ] I have requested reviews from other members
13-
14-
**APK for testing**: [Compress the `app-debug.apk` file into a `<feature>.rar` or `<feature>.zip` file and upload it here]
9+
**Checklist**: <!-- Please tick following check boxes with `[x]` if the respective task is completed -->
10+
- [ ] I have used resources from `strings.xml`, `dimens.xml` and `colors.xml` without hard-coding any value.
11+
- [ ] No modifications done at the end of resource files `strings.xml`, `dimens.xml` or `colors.xml`.
12+
- [ ] I have reformatted code and fixed indentation in every file included in this pull request
13+
- [ ] My code does not contain any extra lines or extra spaces.
14+
- [ ] I have requested reviews from maintainers.

.github/dependabot.yml

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: "weekly"
7+
reviewers:
8+
- "mariobehling"
9+
- "cloudypadmal"
10+
11+
- package-ecosystem: "gradle"
12+
directory: "/"
13+
schedule:
14+
interval: "weekly"
15+
reviewers:
16+
- "mariobehling"
17+
- "cloudypadmal"

.github/workflows/pull-request.yml

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Build
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- master
7+
- development
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Download repository
15+
uses: actions/checkout@v2
16+
17+
- name: Setup Java
18+
uses: actions/setup-java@v2
19+
with:
20+
distribution: 'adopt'
21+
java-version: '11'
22+
23+
- name: Build with Gradle
24+
run: |
25+
bash ./gradlew build --stacktrace

.github/workflows/push-event.yml

+109
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,109 @@
1+
name: Push
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
- development
8+
9+
env:
10+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
outputs:
16+
branch: ${{ steps.branch-name.outputs.current_branch }}
17+
18+
steps:
19+
- name: Download repository
20+
uses: actions/checkout@v2
21+
22+
- name: Setup Java
23+
uses: actions/setup-java@v2
24+
with:
25+
distribution: 'adopt'
26+
java-version: '11'
27+
28+
- name: Build with Gradle
29+
run: |
30+
bash ./gradlew build --stacktrace
31+
bash ./gradlew bundle --stacktrace
32+
33+
- name: Store APK files
34+
uses: actions/upload-artifact@v2
35+
with:
36+
name: apk-files
37+
path: |
38+
app/build/outputs/apk/debug/app-debug.apk
39+
app/build/outputs/apk/release/app-release-unsigned.apk
40+
app/build/outputs/bundle/debug/app-debug.aab
41+
app/build/outputs/bundle/release/app-release.aab
42+
43+
- name: Define branch
44+
id: branch-name
45+
run: echo "::set-output name=current_branch::${{ github.ref_name }}"
46+
47+
upload:
48+
needs: build
49+
runs-on: ubuntu-latest
50+
51+
steps:
52+
- name: Clone APK branch
53+
uses: actions/checkout@v2
54+
with:
55+
repository: fossasia/pslab-android
56+
ref: apk
57+
58+
- name: Clean APK branch for master builds
59+
if: ${{ needs.build.outputs.branch == 'master' }}
60+
run: |
61+
rm -rf app-debug-master.apk || true
62+
rm -rf app-release-unsigned-master.apk || true
63+
rm -rf app-debug-master.aab || true
64+
rm -rf app-release-master.aab || true
65+
66+
- name: Clean APK branch for development builds
67+
if: ${{ needs.build.outputs.branch == 'development' }}
68+
run: |
69+
rm -rf app-debug-development.apk || true
70+
rm -rf app-release-unsigned-development.apk || true
71+
rm -rf app-debug-development.aab || true
72+
rm -rf app-release-development.aab || true
73+
74+
- name: Retrieve APK files
75+
uses: actions/download-artifact@v2
76+
with:
77+
name: apk-files
78+
79+
- name: Rename files in master branch
80+
if: ${{ needs.build.outputs.branch == 'master' }}
81+
run: |
82+
mv apk/debug/app-debug.apk app-debug-master.apk
83+
mv apk/release/app-release-unsigned.apk app-release-unsigned-master.apk
84+
mv bundle/debug/app-debug.aab app-debug-master.aab
85+
mv bundle/release/app-release.aab app-release-master.aab
86+
87+
- name: Rename files in development branch
88+
if: ${{ needs.build.outputs.branch == 'development' }}
89+
run: |
90+
mv apk/debug/app-debug.apk app-debug-development.apk
91+
mv apk/release/app-release-unsigned.apk app-release-unsigned-development.apk
92+
mv bundle/debug/app-debug.aab app-debug-development.aab
93+
mv bundle/release/app-release.aab app-release-development.aab
94+
95+
- name: Setup credentials
96+
run: |
97+
git config user.name 'github-actions[bot]'
98+
git config user.email 'github-actions[bot]@users.noreply.github.com'
99+
100+
- name: Update APK branch
101+
run: |
102+
git remote set-url --push origin https://github-actions[bot]:[email protected]/${GITHUB_REPOSITORY}
103+
git checkout --orphan temporary
104+
git add .
105+
git commit -m "release: build files from ${{ needs.build.outputs.branch }} branch"
106+
git branch -D apk
107+
git branch -m apk
108+
git push origin apk -f --quiet > /dev/null
109+

.travis.yml

-38
This file was deleted.

README.md

+45-30
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
Repository for the PSLab Android App for performing experiments with the [Pocket Science Lab](https://pslab.io) open-hardware platform.
44

5-
[![Build Status](https://travis-ci.org/fossasia/pslab-android.svg?branch=development)](https://travis-ci.org/fossasia/pslab-android)
6-
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/dd728d91bb5743ff916c16c1251f8dd5)](https://www.codacy.com/app/praveenkumar103/pslab-android?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=fossasia/pslab-android&amp;utm_campaign=Badge_Grade)
5+
[![Build](https://github.com/fossasia/pslab-android/actions/workflows/pull-request.yml/badge.svg)](https://github.com/fossasia/pslab-android/actions/workflows/pull-request.yml)
6+
[![Codacy Badge](https://app.codacy.com/project/badge/Grade/3383ddffb53b4c82a822f3a5991fe0a1)](https://www.codacy.com/gh/fossasia/pslab-android/dashboard?utm_source=github.com&amp;utm_medium=referral&amp;utm_content=fossasia/pslab-android&amp;utm_campaign=Badge_Grade)
77
[![Mailing List](https://img.shields.io/badge/Mailing%20List-FOSSASIA-blue.svg)](https://groups.google.com/forum/#!forum/pslab-fossasia)
88
![Minimum API Level](https://img.shields.io/badge/Min%20API%20Level-23-green)
9-
![Maximum API Level](https://img.shields.io/badge/Max%20API%20Level-28-orange)
9+
![Maximum API Level](https://img.shields.io/badge/Max%20API%20Level-31-orange)
1010
![GitHub repo size](https://img.shields.io/github/repo-size/fossasia/pslab-android)
1111
[![Gitter](https://badges.gitter.im/fossasia/pslab.svg)](https://gitter.im/fossasia/pslab?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
1212
[![Twitter Follow](https://img.shields.io/twitter/follow/pslabio.svg?style=social&label=Follow&maxAge=2592000?style=flat-square)](https://twitter.com/pslabio)
@@ -84,6 +84,11 @@ This repository holds the Android App for performing experiments with [PSLab](ht
8484
<td><img src="/docs/images/instrument_compass_view.png" width = "500"></td>
8585
<td><img src="/docs/images/instrument_thermo_view.png" width = "500"></td>
8686
</tr>
87+
<tr>
88+
<td><img src="/docs/images/instrument_sensors_view.png" width = "500"></td>
89+
<td><img src="/docs/images/instrument_gas_sensor_view.png" width = "500"></td>
90+
<td><img src="/docs/images/instrument_dust_sensor_view.png" width = "500"></td>
91+
</tr>
8792
</table>
8893
<table>
8994
<tr>
@@ -93,10 +98,10 @@ This repository holds the Android App for performing experiments with [PSLab](ht
9398
</table>
9499

95100
## Video Demo
96-
- [PSLab Android App Overview](https://www.youtube.com/watch?v=JJfsF0b8M8k)
97-
- [Observing Sound Waveforms Using PSLab Device](https://www.youtube.com/watch?v=5bxDd1PiOMQ)
98-
- [Real-time Sensor Data Logging Using Pocket Science Lab](https://www.youtube.com/watch?v=_A8h6o-UcNo)
99-
- [Generating and Observing Waveforms Using Pocket Science Lab](https://www.youtube.com/watch?v=Ua9_OCR4p8Y)
101+
* [PSLab Android App Overview](https://www.youtube.com/watch?v=JJfsF0b8M8k).
102+
* [Observing Sound Waveforms Using PSLab Device](https://www.youtube.com/watch?v=5bxDd1PiOMQ).
103+
* [Real-time Sensor Data Logging Using Pocket Science Lab](https://www.youtube.com/watch?v=_A8h6o-UcNo).
104+
* [Generating and Observing Waveforms Using Pocket Science Lab](https://www.youtube.com/watch?v=Ua9_OCR4p8Y).
100105

101106
## Features
102107
| **Feature** | **Description** | **Status** |
@@ -133,31 +138,41 @@ There are 2 flavors (build variants) of PSLab Android application.
133138
Before you begin, you should already have the Android Studio SDK downloaded and set up correctly. You can find a guide on how to do this here: [Setting up Android Studio](http://developer.android.com/sdk/installing/index.html?pkg=studio)
134139

135140
### Setting up the Android Project
141+
For setting up the PSLab Android project you may follow any of the two methods listed below, that is, you may download the repository zip file or you may directly clone the repository to Android Studio.
136142

137-
1. Download the _pslab-android_ project source. You can do this either by forking and cloning the repository (recommended if you plan on pushing changes) or by downloading it as a ZIP file and extracting it.
143+
### By downloading the zip file
138144

139-
2. Open Android Studio, you will see a **Welcome to Android** window. Under Quick Start, select _Import Project (Eclipse ADT, Gradle, etc.)_
145+
1. Download the _pslab-android_ project source. You can do this either by forking and cloning the repository (recommended if you plan on pushing changes) or by downloading it as a ZIP file and extracting it.
140146

141-
3. Navigate to the directory where you saved the pslab-android project, select the "pslab-android" folder, and hit OK. Android Studio should now begin building the project with Gradle.
147+
2. Open Android Studio, you will see a **Welcome to Android** window. Under Quick Start, select _Import Project (Eclipse ADT, Gradle, etc.)To debug over Wi-Fi follow the steps given in this [Blog](http://blog.fossasia.org/android-app-debugging-over-wifi-fo).
142148

143-
4. Once this process is complete and Android Studio opens, check the Console for any build errors.
149+
* **Note :**
150+
If you built your own hardware, change VendorID and/or ProductID in [CommunicationHandler.java](blob/master/app/src/main/java/io/pslab/communication/CommunicationHandler.java).
144151

145-
- _Note:_ If you receive a Gradle sync error titled, "failed to find ...", you should click on the link below the error message (if available) that says _Install missing platform(s) and sync project_ and allow Android studio to fetch you what is missing.
152+
### By direct cloning
146153

147-
5. Once all build errors have been resolved, you should be all set to build the app and test it.
154+
1. Open Android Studio, you will see a **Welcome to Android** window. Under Quick Start, select "check out project from version control".
155+
2. Select git from the drop down menu that appeared.
156+
3. Go to the repository and click clone or download button.
157+
4. From the dropdown that appeared, copy the link.
158+
5. Paste the URL that you copied and press clone.
159+
6. Android studio should now begin building the project with gradle.
160+
7. Once this process is complete and Android Studio opens, check the Console for any build errors.
148161

149-
6. To Build the app, go to _Build>Make Project_ (or alternatively press the Make Project icon in the toolbar).
162+
- _Note:_ If you receive a Gradle sync error titled, "failed to find ...", you should click on the link below the error message (if available) that says _Install missing platform(s) and sync project_ and allow Android studio to fetch you what is missing.
150163

151-
7. If the app was built successfully, you can test it by running it on either a real device or an emulated one by going to _Run>Run 'app'_ or pressing the Run icon in the toolbar.
164+
8. Once all build errors have been resolved, you should be all set to build the app and test it.
165+
9. To Build the app, go to _Build>Make Project_ (or alternatively press the Make Project icon in the toolbar).
166+
10. If the app was built successfully, you can test it by running it on either a real device or an emulated one by going to _Run>Run 'app'_ or pressing the Run icon in the toolbar.
152167

153168
If you want build apk only, go to Build>Build apk and apk would be build and directory where apk is generated would be prompted by Android Studio.
154169

155170
You can't debug the usual way as PSLab device is connected to micro-USB port through OTG cable. So Android Device is not connected to PC through USB cable.
156171

157-
To debug over Wi-Fi: http://blog.fossasia.org/android-app-debugging-over-wifi-for-pslab/
172+
To debug over Wi-Fi follow the steps given in this [Blog](http://blog.fossasia.org/android-app-debugging-over-wifi-for-pslab/).
158173

159-
Note :
160-
1. If you built your own hardware, change VendorID and/or ProductID in [CommunicationHandler.java](https://github.com/fossasia/pslab-android/blob/master/app/src/main/java/io/pslab/communication/CommunicationHandler.java)
174+
* **Note :**
175+
If you built your own hardware, change VendorID and/or ProductID in [CommunicationHandler.java](https://github.com/fossasia/pslab-android/blob/master/app/src/main/java/io/pslab/communication/CommunicationHandler.java).
161176

162177
### Permissions Required
163178

@@ -175,11 +190,11 @@ To use PSLab device with Android, you simply need an OTG cable, an Android Devic
175190

176191
Please help us follow the best practice to make it easy for the reviewer as well as the contributor. We want to focus on the code quality more than on managing pull request ethics.
177192

178-
* Single commit per pull request
179-
* Reference the issue numbers in the commit message. Follow the pattern ``` Fixes #<issue number> <commit message>```
180-
* Follow uniform design practices. The design language must be consistent throughout the app.
181-
* The pull request will not get merged until and unless the commits are squashed. In case there are multiple commits on the PR, the commit author needs to squash them and not the maintainers cherrypicking and merging squashes.
182-
* If the PR is related to any front end change, please attach relevant screenshots in the pull request description.
193+
* Single commit per pull request.
194+
* Reference the issue numbers in the commit message. Follow the pattern ``` Fixes #<issue number> <commit message>```
195+
* Follow uniform design practices. The design language must be consistent throughout the app.
196+
* The pull request will not get merged until and unless the commits are squashed. In case there are multiple commits on the PR, the commit author needs to squash them and not the maintainers cherrypicking and merging squashes.
197+
* If the PR is related to any front end change, please attach relevant screenshots in the pull request description.
183198

184199
#### How to `git squash`?
185200

@@ -190,27 +205,27 @@ As a tip for new developers those who struggle with squashing commits into one,
190205

191206
Despite any reason, follow the steps given below to squash all commits into one adhering to our best practices.
192207

193-
* Setup remote to upstream branch if not set before;
208+
* Setup remote to upstream branch if not set before
194209

195210
`$ git remote add upstream https://github.com/fossasia/pslab-android.git`
196211

197-
* Check into the branch related to the pull request
212+
* Check into the branch related to the pull request
198213

199214
`$ git checkout <branch-name>`
200215

201-
* Perform a soft reset to retain the changes while removing all the commit details
216+
* Perform a soft reset to retain the changes while removing all the commit details
202217

203218
`$ git reset --soft upstream/development`
204219

205-
* Add files to the staging area
220+
* Add files to the staging area
206221

207222
`$ git add <file paths or "." to add everything>`
208223

209-
* Create a new commit with a proper message following commit message guidelines
224+
* Create a new commit with a proper message following commit message guidelines
210225

211226
`$ git commit -m "tag: commit message"`
212227

213-
* If you have already made a pull request,
228+
* If you have already made a pull request
214229

215230
`$ git push -f origin <branch-name>`
216231

@@ -239,9 +254,9 @@ The project is maintained by
239254
- Lorenz Gerber ([@lorenzgerber](https://github.com/lorenzgerber))
240255
- Wei Tat ([@cweitat](https://github.com/cweitat))
241256
- Wai Gie ([@woshikie](https://github.com/woshikie))
242-
- Neel Trivedi ([@neel1998](https://github.com/neel1998))
243257

244258
### Alumni
259+
- Neel Trivedi ([@neel1998](https://github.com/neel1998))
245260
- Akarshan Gandotra ([@akarshan96](https://github.com/akarshan96))
246261
- Asitava Sarkar ([@asitava1998](https://github.com/asitava1998))
247262
- Vivek Singh Bhadauria ([@viveksb007](https://github.com/viveksb007))

0 commit comments

Comments
 (0)