Skip to content

Commit

Permalink
Merge pull request #2317 from fossasia/development
Browse files Browse the repository at this point in the history
chore: merge development branch into master branch
  • Loading branch information
CloudyPadmal authored Feb 1, 2022
2 parents 8bd5fdf + 63c7c19 commit 575cc3d
Show file tree
Hide file tree
Showing 229 changed files with 10,419 additions and 3,078 deletions.
22 changes: 11 additions & 11 deletions .github/PULL_REQUEST_TEMPLATE
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
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]
**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" -->

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

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

**Checklist**: [Please tick following check boxes with `[x]` if the respective task is completed]
- [ ] I have used resources from `strings.xml`, `dimens.xml` and `colors.xml` without hard-coding them
- [ ] No modifications done at the end of resource files `strings.xml`, `dimens.xml` or `colors.xml`
- [ ] I have reformatted code in every file included in this PR [<kbd>CTRL</kbd>+<kbd>ALT</kbd>+<kbd>L</kbd>]
- [ ] My code does not contain any extra lines or extra spaces
- [ ] I have requested reviews from other members

**APK for testing**: [Compress the `app-debug.apk` file into a `<feature>.rar` or `<feature>.zip` file and upload it here]
**Checklist**: <!-- Please tick following check boxes with `[x]` if the respective task is completed -->
- [ ] I have used resources from `strings.xml`, `dimens.xml` and `colors.xml` without hard-coding any value.
- [ ] No modifications done at the end of resource files `strings.xml`, `dimens.xml` or `colors.xml`.
- [ ] I have reformatted code and fixed indentation in every file included in this pull request
- [ ] My code does not contain any extra lines or extra spaces.
- [ ] I have requested reviews from maintainers.
17 changes: 17 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
reviewers:
- "mariobehling"
- "cloudypadmal"

- package-ecosystem: "gradle"
directory: "/"
schedule:
interval: "weekly"
reviewers:
- "mariobehling"
- "cloudypadmal"
25 changes: 25 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Build

on:
pull_request:
branches:
- master
- development

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Download repository
uses: actions/checkout@v2

- name: Setup Java
uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: '11'

- name: Build with Gradle
run: |
bash ./gradlew build --stacktrace
109 changes: 109 additions & 0 deletions .github/workflows/push-event.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,109 @@
name: Push

on:
push:
branches:
- master
- development

env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

jobs:
build:
runs-on: ubuntu-latest
outputs:
branch: ${{ steps.branch-name.outputs.current_branch }}

steps:
- name: Download repository
uses: actions/checkout@v2

- name: Setup Java
uses: actions/setup-java@v2
with:
distribution: 'adopt'
java-version: '11'

- name: Build with Gradle
run: |
bash ./gradlew build --stacktrace
bash ./gradlew bundle --stacktrace
- name: Store APK files
uses: actions/upload-artifact@v2
with:
name: apk-files
path: |
app/build/outputs/apk/debug/app-debug.apk
app/build/outputs/apk/release/app-release-unsigned.apk
app/build/outputs/bundle/debug/app-debug.aab
app/build/outputs/bundle/release/app-release.aab
- name: Define branch
id: branch-name
run: echo "::set-output name=current_branch::${{ github.ref_name }}"

upload:
needs: build
runs-on: ubuntu-latest

steps:
- name: Clone APK branch
uses: actions/checkout@v2
with:
repository: fossasia/pslab-android
ref: apk

- name: Clean APK branch for master builds
if: ${{ needs.build.outputs.branch == 'master' }}
run: |
rm -rf app-debug-master.apk || true
rm -rf app-release-unsigned-master.apk || true
rm -rf app-debug-master.aab || true
rm -rf app-release-master.aab || true
- name: Clean APK branch for development builds
if: ${{ needs.build.outputs.branch == 'development' }}
run: |
rm -rf app-debug-development.apk || true
rm -rf app-release-unsigned-development.apk || true
rm -rf app-debug-development.aab || true
rm -rf app-release-development.aab || true
- name: Retrieve APK files
uses: actions/download-artifact@v2
with:
name: apk-files

- name: Rename files in master branch
if: ${{ needs.build.outputs.branch == 'master' }}
run: |
mv apk/debug/app-debug.apk app-debug-master.apk
mv apk/release/app-release-unsigned.apk app-release-unsigned-master.apk
mv bundle/debug/app-debug.aab app-debug-master.aab
mv bundle/release/app-release.aab app-release-master.aab
- name: Rename files in development branch
if: ${{ needs.build.outputs.branch == 'development' }}
run: |
mv apk/debug/app-debug.apk app-debug-development.apk
mv apk/release/app-release-unsigned.apk app-release-unsigned-development.apk
mv bundle/debug/app-debug.aab app-debug-development.aab
mv bundle/release/app-release.aab app-release-development.aab
- name: Setup credentials
run: |
git config user.name 'github-actions[bot]'
git config user.email 'github-actions[bot]@users.noreply.github.com'
- name: Update APK branch
run: |
git remote set-url --push origin https://github-actions[bot]:[email protected]/${GITHUB_REPOSITORY}
git checkout --orphan temporary
git add .
git commit -m "release: build files from ${{ needs.build.outputs.branch }} branch"
git branch -D apk
git branch -m apk
git push origin apk -f --quiet > /dev/null
38 changes: 0 additions & 38 deletions .travis.yml

This file was deleted.

75 changes: 45 additions & 30 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

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

[![Build Status](https://travis-ci.org/fossasia/pslab-android.svg?branch=development)](https://travis-ci.org/fossasia/pslab-android)
[![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)
[![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)
[![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)
[![Mailing List](https://img.shields.io/badge/Mailing%20List-FOSSASIA-blue.svg)](https://groups.google.com/forum/#!forum/pslab-fossasia)
![Minimum API Level](https://img.shields.io/badge/Min%20API%20Level-23-green)
![Maximum API Level](https://img.shields.io/badge/Max%20API%20Level-28-orange)
![Maximum API Level](https://img.shields.io/badge/Max%20API%20Level-31-orange)
![GitHub repo size](https://img.shields.io/github/repo-size/fossasia/pslab-android)
[![Gitter](https://badges.gitter.im/fossasia/pslab.svg)](https://gitter.im/fossasia/pslab?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge)
[![Twitter Follow](https://img.shields.io/twitter/follow/pslabio.svg?style=social&label=Follow&maxAge=2592000?style=flat-square)](https://twitter.com/pslabio)
Expand Down Expand Up @@ -84,6 +84,11 @@ This repository holds the Android App for performing experiments with [PSLab](ht
<td><img src="/docs/images/instrument_compass_view.png" width = "500"></td>
<td><img src="/docs/images/instrument_thermo_view.png" width = "500"></td>
</tr>
<tr>
<td><img src="/docs/images/instrument_sensors_view.png" width = "500"></td>
<td><img src="/docs/images/instrument_gas_sensor_view.png" width = "500"></td>
<td><img src="/docs/images/instrument_dust_sensor_view.png" width = "500"></td>
</tr>
</table>
<table>
<tr>
Expand All @@ -93,10 +98,10 @@ This repository holds the Android App for performing experiments with [PSLab](ht
</table>

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

## Features
| **Feature** | **Description** | **Status** |
Expand Down Expand Up @@ -133,31 +138,41 @@ There are 2 flavors (build variants) of PSLab Android application.
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)

### Setting up the Android Project
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.

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.
### By downloading the zip file

2. Open Android Studio, you will see a **Welcome to Android** window. Under Quick Start, select _Import Project (Eclipse ADT, Gradle, etc.)_
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.

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.
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).

4. Once this process is complete and Android Studio opens, check the Console for any build errors.
* **Note :**
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).

- _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.
### By direct cloning

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

6. To Build the app, go to _Build>Make Project_ (or alternatively press the Make Project icon in the toolbar).
- _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.

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.
8. Once all build errors have been resolved, you should be all set to build the app and test it.
9. To Build the app, go to _Build>Make Project_ (or alternatively press the Make Project icon in the toolbar).
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.

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.

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.

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

Note :
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)
* **Note :**
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).

### Permissions Required

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

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.

* Single commit per pull request
* Reference the issue numbers in the commit message. Follow the pattern ``` Fixes #<issue number> <commit message>```
* Follow uniform design practices. The design language must be consistent throughout the app.
* 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.
* If the PR is related to any front end change, please attach relevant screenshots in the pull request description.
* Single commit per pull request.
* Reference the issue numbers in the commit message. Follow the pattern ``` Fixes #<issue number> <commit message>```
* Follow uniform design practices. The design language must be consistent throughout the app.
* 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.
* If the PR is related to any front end change, please attach relevant screenshots in the pull request description.

#### How to `git squash`?

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

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

* Setup remote to upstream branch if not set before;
* Setup remote to upstream branch if not set before

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

* Check into the branch related to the pull request
* Check into the branch related to the pull request

`$ git checkout <branch-name>`

* Perform a soft reset to retain the changes while removing all the commit details
* Perform a soft reset to retain the changes while removing all the commit details

`$ git reset --soft upstream/development`

* Add files to the staging area
* Add files to the staging area

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

* Create a new commit with a proper message following commit message guidelines
* Create a new commit with a proper message following commit message guidelines

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

* If you have already made a pull request,
* If you have already made a pull request

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

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

### Alumni
- Neel Trivedi ([@neel1998](https://github.com/neel1998))
- Akarshan Gandotra ([@akarshan96](https://github.com/akarshan96))
- Asitava Sarkar ([@asitava1998](https://github.com/asitava1998))
- Vivek Singh Bhadauria ([@viveksb007](https://github.com/viveksb007))
Expand Down
Loading

0 comments on commit 575cc3d

Please sign in to comment.