Coder Social home page Coder Social logo

hhy5277 / pslab-android Goto Github PK

View Code? Open in Web Editor NEW

This project forked from fossasia/pslab-android

0.0 1.0 0.0 973.45 MB

PSLab Android App https://github.com/fossasia/pslab-android/blob/apk/app-master-release.apk

Home Page: https://pslab.io

License: Apache License 2.0

Java 99.75% Shell 0.25%

pslab-android's Introduction

PSLab Android App

Get it on Google Play Get it on F-Droid

Build Status Gitter Codacy Badge Mailing List Twitter Follow

This repository holds the Android App for performing experiments with PSLab. PSLab is a tiny pocket science lab that provides an array of equipment for doing science and engineering experiments. It can function like an oscilloscope, waveform generator, frequency counter, programmable voltage and current source and also as a data logger. Our website is at https://pslab.io

Communication

Please join us on the following channels:

Roadmap

  • First we need to get communication between Android App and PSLab working.
  • Implement Applications and expose PSLab Hardware functionality to the user.
  • Implement Functionality to Perform Experiment using PSLab Hardware Device.

Screenshots

Video Demo

Features

Feature Description Status
Home Screen Show status and version of PSLab device
Instruments Exposes PSLab instruments like Oscilloscope, etc
Oscilloscope Shows variation of analog signals
Multimeter Measures voltage, current, resistance and capacitance
Logical Analyzer Captures and displays signals from digital system
Wave Generator Generates arbitrary analog and digital waveforms
Power Source Generates programmable voltage and currents
Lux Meter Measures the ambient light intensity

How to set up the Android app in your development environment

Minimum Android version 4.1 (API Level 16)

Maximum Android version 8.1 (API Level 27)

Development Setup

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

Setting up the Android Project

  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.

  2. Open Android Studio, you will see a Welcome to Android window. Under Quick Start, select Import Project (Eclipse ADT, Gradle, etc.)

  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.

  4. Once this process is complete and Android Studio opens, check the Console for any build errors.

  • 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.
  1. Once all build errors have been resolved, you should be all set to build the app and test it.

  2. To Build the app, go to Build>Make Project (or alternatively press the Make Project icon in the toolbar).

  3. 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/

Note :

  1. If you built your own hardware, change VendorID and/or ProductID in CommunicationHandler.java

Permissions Required

  1. Record_Audio : It is required for oscilloscope to accept inputs from the phone inbuilt microphone. You can find its implementation in AudioJack.java.
  2. Access_Fine_Location and Internet : It is required for use in lux meter and compass to get the coordinates for tagging the data on the map. You can find its implementation in GPSLogger.java.
  3. Write_External_Storage : It is required for storing log files from instruments that can be transferred out for future analysis.
  4. Read_External_Storage : While writing logs in the storage, CSVLogger.java first checks whether there is any CSVLogger directory exist or not and that require this read permission.

Setup to use PSLab with Android App

To use PSLab device with Android, you simply need an OTG cable, an Android Device with USB Host feature enabled ( most modern phones have OTG support ) and PSLab Android App. Connect PSLab device to Android Phone via OTG cable. Rest is handled by App itself.

Contributions Best Practices

Code practices

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.

How to git squash?

As a tip for new developers those who struggle with squashing commits into one, multiple commits may appear in your pull request mostly due to following reasons.

  • Intentionally adding multiple commit messages after each change without just git adding.
  • Updating the current branch with the remote so a merge commit takes place.

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;

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

  • 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

$ git reset --soft upstream/development

  • 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

$ git commit -m "tag: commit message"

  • If you have already made a pull request,

$ git push -f origin <branch-name>

Branch Policy

We have the following branches

  • development All development goes on in this branch. If you're making a contribution, you are supposed to make a pull request to development. Make sure it passes a build check on Travis.

  • master This contains the stable code. After significant features/bugfixes are accumulated on development, we move it to master.

  • apk This branch contains automatically generated apk file for testing.

Code style

Please try to follow the mentioned guidelines while writing and submitting your code as it makes easier for the reviewer and other developers to understand.

  • While naming the layout files, ensure that the convention followed is (activity/fragment) _ (name).xml like activity_oscilloscope.xml , fragment_control_main.xml .
  • Name the views and widgets defined in the layout files as (viewtype/widget) _ (fragment/activity name) _ (no. in the file) like spinner_channel_select_la1 , button_activity_oscilloscope1 .
  • The activity/fragment file name corresponding to the layout files should be named as (activity/fragment name)(activity/fragment).java like ChannelsParameterFragment.java corresponding to the layout file fragment_channels_parameter.xml .
  • The corresponding widgets for buttons, textboxes, checkboxes etc. in activity files should be named as (viewtype/widget)(fragment/activity name)(no. in the file) like spinnerChannelSelect1 corresponding to spinner_channel_select1 .

License

This project is currently licensed under the Apache License 2.0. A copy of LICENSE is to be present along with the source code. To obtain the software under a different license, please contact FOSSASIA.

Maintainers

The project is maintained by

Alumni

pslab-android's People

Contributors

abhinavraj23 avatar akarshan96 avatar akashagra avatar asitava1998 avatar avjeet avatar chanmol1999 avatar cloudypadmal avatar cweitat avatar hardik124 avatar harsh-2711 avatar harshdevl avatar hrprt96 avatar iamareebjamal avatar imrajat7 avatar jithinbp avatar mariobehling avatar mirnal1409 avatar namanrawat1 avatar neel1998 avatar nikit19 avatar princejhabak avatar rimjhim28 avatar smit2010 avatar thisisnsh avatar vikasmahato avatar vikum94 avatar viveksb007 avatar wavicles avatar woshikie avatar yatri1609 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.