Code Monkey home page Code Monkey logo

badgemagic-android's Introduction

Badge Magic

Join the chat at https://gitter.im/fossasia/badge-magic Github

Python Library to program via desktop https://github.com/fossasia/led-name-badge-ls32

Magically Create Text and Draw Cliparts on LED Name Badges using Bluetooth

The Badge Magic Android app lets you create moving text and draw clipart for LED name badges. The app provides options to portray names, cliparts, and simple animations on the badges. For the org.fossasia.badgemagic.data transfer from the smartphone to the LED badge it uses Bluetooth. The project is based on the work of Nilhcem.

Get it on F-Droid

Download

Permissions

  • Bluetooth: For sending org.fossasia.badgemagic.data to the badge.
  • GPS Location: This has been the standard set by Android for use with Bluetooth Low Energy (BLE) devices. For more information, please read the notes on Android website.
  • Storage: For storing and saving badges.

Communication

Please talk to us on the badge-magic Gitter channel here.

Available Devices

There are a number of devices with Bluetooth on the market. As far as we can tell they are mostly from the same manufacturer. When you get a org.fossasia.badgemagic.device ensure it comes with Bluetooth. There are devices that don't support Bluetooth. These are not supported in the app currently.

Screenshots

Reverse-Engineering Bluetooth LE Devices

Security in Bluetooth LE devices is optional, and many cheap products you can find on the market are not secured at all. This applies to our Bluetooth LED Badge. While this could lead to some privacy issues, this can also be a source of fun, especially when you want to use an LED Badge in a different way. It also makes it easy for us to get started with the development of a Free and Open Source Android app.

As we understand how the Bluetooth LED badge works, converting a text to multiple byte arrays, we can send using the Bluetooth LE APIs. An indepth blog post about reverse-engineering the Bluetooth community is here.

The implementation in the Android app consists of manipulating bits. That may be tricky. A single bit error and nothing will work, plus it will be hard to debug. For those reasons, and since the specs are perfectly clear the reverse engineer Gautier Mechling strongly recommends to start writing unit tests before the code implementation.

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. PRs to development branch must pass a build check on Travis CI.
  • master This contains shipped code. After significant features/bugfixes are accumulated on development, we make a version update and make a release.
  • apk This branch contains many apk files, that are automatically generated on the merged pull request a) debug apk b) release apk
    • There are multiple files in the apk branch of the project, this branch consists of all the APK files and other files that are relevant when an APK is generated.
    • Once a pull request is merged, the previous APK branch is deleted and a new APK branch is created.
    • If a PR is merged in development branch then the new APKs for the development branch are generated whereas the APKs corresponding to the master branch are not regenerated and simply the previously generated files are added.

Contributions Best Practices

Please read FOSSASIA's Best Practices before contributing. 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. Here are some basics:

  • Single commit per pull request
  • For writing commit messages please read the CommitStyle.md.
  • 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.
  • Before you join development, please set up the project on your local machine, run it and go through the application completely. Press on any button you can find and see where it leads to. Explore.
  • If you would like to work on an issue, drop in a comment at the issue. If it is already assigned to someone, but there is no sign of any work being done, please free to drop in a comment and start working on it.

LICENSE

The application is licensed under the Apache License 2.0. Copyright is owned by FOSSASIA and its contributors.

OTHER BADGE APPS

badgemagic-android's People

Contributors

abhishek-55 avatar adityastic avatar akri16 avatar amrsalah3 avatar anhanh11001 avatar atharwa-24 avatar balaji-ramavathu avatar cloudypadmal avatar cweitat avatar dependabot-preview[bot] avatar dependabot[bot] avatar gitter-badger avatar govinddixit avatar hariom1625 avatar hpdang avatar iamareebjamal avatar liveharshit avatar mariobehling avatar mohitm15 avatar naman653 avatar nilhcem avatar rahulsain avatar refactor-droidyy avatar ruplsingh avatar shridhargoel avatar sparrow007 avatar tanmayrauth avatar tronku avatar yashk2000 avatar yatri1609 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

badgemagic-android's Issues

Keyboard always stays up until back button is pressed.

Describe the bug
The keyboard does not disappear unless the back button is pressed.

Expected behavior
When the user has created the badge needed and pressed the send button, the keyboard should go down automatically. It should pop up again only when the edit text is pressed.

Would you like to work on the issue?
YES.

Show alert dialog instead of exiting the application

Current, if the user does not allows permissions, app exit with a toast message. It is not a good user experience to close the whole application.
Show an alert dialog after denying the permission and ask again.

Request for open the bluetooth

Describe the bug
When there bluetooth is not open and we click on send button, it is showing the toast instead of request for open the bluetooth.

To Reproduce
Step 1. Accept all permissions

Step 2.After entering in the app , turn off the bluetooth of android device

Step 3. Click on send button.

Expected behavior
It should make a request instead of toast.

Smartphone Info:

|Device | Asus Zenfone 2|
|Android Version| marshmallow 6.0.1 |

Would you like to work on the issue?
Yes.

No option to exit the app if user denies Bluetooth permission.

Describe the bug
If the user denies Bluetooth permission to the app, there is no option shown in the dialog box for exiting the app.

Expected behavior
There should be an option to exit the app in the dialog if the user wants to deny Bluetooth permission.

Smartphone Info:

Device Nokia 7 plus
Android Version Android 9.0

Would you like to work on the issue?
YES

Color of speed and mode text views inside the spinner.

Describe the bug
The color of speed and mode text views inside the spinner have become grey instead of black due to a recent commit.

Expected behavior
The color should be black.

Screenshots

screencap

Smartphone Info:

Device Nokia 7 Plus
Android Version Android 9.0

Would you like to work on the issue?

YES.

Implement a Splash Screen

Describe the feature you'd like
A splash screen to improve look and feel of app

Screenshots

device-2019-03-17-033829

Would you like to work on the issue?
yes :)

Implement an in-app saving and export function for badges

Currently badges cannot be saved. Please add a save button. It would make it easier if the user does not necessarily has to add a name. However the name of the saved file - it should be possible to change it. Also ensure the user can export the saved file and open it e.g. on another phone.

Send button gets disabled after one click

Describe the bug
When you add a text and click on send button once, it gets disabled and then when we change some settings like speed or add marquee effect, the send button doesn't get enabled. One needs to exit the app and then again press send button

To Reproduce

  1. Open app and add text
  2. Press Send
  3. Change settings like speed
  4. Again try and press Send. (here it gets disabled)

Expected behavior
On changing any setting, Send button must be made clickable

Logs
N/A

Screenshots
ezgif com-video-to-gif

Smartphone Info:

Device Redmi 4
Android Version Android 7.1.2

Would you like to work on the issue?
YES

Configure Build of apk branch to only build a) dev branch apps or b) master branch apps on merged PR

Please configure the building of the apks in the apk branch as follows:

  • Only build and overwrite apks from dev branch once dev branch PRs are merged
  • Only build and overwrite apks from master branch once master branch PRs are merged
  • The goal is that we see in the apk branch the different dates of the last merge and save build time as there are less apps to be build.

Naming Convention

  • BadgeMagic-dev-debug.apk
  • BadgeMagic-dev-release.apk
  • BadgeMagic-master-debug.apk
  • BadgeMagic-master-release.apk

Use AndroidX artifacts

Describe the chore
Migrate to androidX artifacts.
this means we don't have to use same support library version for all support libraries. Every support or better to say AndroidX library will maintain its own versioning . Maintaining support versions could be huge issues in the long run.

Would you like to work on the issue?
Yes

IllegalArgumentException when SEND button click 3 times

Describe the bug

App Stopped working due to FATAL EXCEPTION: main.

To Reproduce

Install App and allow Bluetooth, with no device connected. With empty field, click on SEND more than 3 times.

Expected behavior

If no device is connected, the device should give a message, may be in the form of Toast that device not connected or Scan could not find any device.

Logs

E/AndroidRuntime: FATAL EXCEPTION: main
Process: com.nilhcem.blenamebadge, PID: 10565
java.lang.IllegalArgumentException: scanner already started with given callback
at no.nordicsemi.android.support.v18.scanner.BluetoothLeScannerImplLollipop.startScanInternal(BluetoothLeScannerImplLollipop.java:61)
at no.nordicsemi.android.support.v18.scanner.BluetoothLeScannerCompat.startScan(BluetoothLeScannerCompat.java:112)
at com.nilhcem.blenamebadge.device.bluetooth.ScanHelper.startLeScan(ScanHelper.kt:57)
at com.nilhcem.blenamebadge.ui.message.MessagePresenter.sendBytes(MessagePresenter.kt:36)
at com.nilhcem.blenamebadge.ui.message.MessagePresenter.sendBitmap(MessagePresenter.kt:25)
at com.nilhcem.blenamebadge.ui.message.MessageActivity$onCreate$3.onClick(MessageActivity.kt:58)
at android.view.View.performClick(View.java:6614)
at android.view.View.performClickInternal(View.java:6587)
at android.view.View.access$3100(View.java:784)
at android.view.View$PerformClick.run(View.java:26125)
at android.os.Handler.handleCallback(Handler.java:873)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:193)
at android.app.ActivityThread.main(ActivityThread.java:6715)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:911)
I/Process: Sending signal. PID: 10565 SIG: 9
Application terminated.

Screenshots

image

Smartphone Info:

Device Nokia 5.1 Plus
Android Version Android Pie

Would you like to work on the issue?

Yes

Add NDK version in README.md

Build failed in the newer version of NDK 17c due to no toolchains for mips64el-linux-android. Working fine with version 16b. It should mention in the readme file to use an older version of NDK or provide a link to download a zip file for toolchain mips64el-linux-android.

Send button becomes non clickable after pressing once for 10s.

Describe the feature you'd like
Right now, the send button is non-clickable after being pressed once for 10s. Instead it should just be disabled so that even if a user presses it, it appears to be clickable.

Would you like to work on the issue?

YES

Set up travis CI

Travis is already connected but not yet set up. Please help with that.

Updating issue templates.

Describe the chore
An option of yes or no should be provided in the issue templates.

screenshot from 2019-03-05 16-47-50

Would you like to work on the issue?
YES.

Crash when bluetooth is off and Send button is clicked

Describe the bug
Bluetooth adapter is not turned on error is showing up as there's no check in the code.

To Reproduce
Turn off bluetooth and click send button.

Expected behavior
App should not crash.

Logs
AndroidRuntime: FATAL EXCEPTION: main
Process: com.nilhcem.blenamebadge, PID: 15932
java.lang.IllegalStateException: BT Adapter is not turned ON
at no.nordicsemi.android.support.v18.scanner.BluetoothLeUtils.checkAdapterStateOn(BluetoothLeUtils.java:136)
at no.nordicsemi.android.support.v18.scanner.BluetoothLeScannerImplLollipop.startScanInternal(BluetoothLeScannerImplLollipop.java:57)
at no.nordicsemi.android.support.v18.scanner.BluetoothLeScannerCompat.startScan(BluetoothLeScannerCompat.java:112)
at com.nilhcem.blenamebadge.device.bluetooth.ScanHelper.startLeScan(ScanHelper.kt:57)
at com.nilhcem.blenamebadge.ui.message.MessagePresenter.sendBytes(MessagePresenter.kt:36)
at com.nilhcem.blenamebadge.ui.message.MessagePresenter.sendBitmap(MessagePresenter.kt:25)
at com.nilhcem.blenamebadge.ui.message.MessageActivity$onCreate$3.onClick(MessageActivity.kt:69)
at android.view.View.performClick(View.java:6291)
at android.view.View$PerformClick.run(View.java:24931)
at android.os.Handler.handleCallback(Handler.java:808)
at android.os.Handler.dispatchMessage(Handler.java:101)
at android.os.Looper.loop(Looper.java:166)
at android.app.ActivityThread.main(ActivityThread.java:7529)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:245)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:921)

Smartphone Info:

|Device | Huawei Honor 7x |
|Android Version| Oreo 8.1 |

Additional context
Need to check if the bluetooth is enabled before starting the scan.

Would you like to work on the issue?
Yes.

Updating gradle plugin version.

Describe the chore
Current gradle plugin version is 3.1.4. It should be updated to the latest version i.e., 3.3.0 along with all other dependencies used in the app.

Would you like to work on the issue?
Yes.

Improve UX for sending bytes

Description

currently User clicks send , No visual representation is shown
button becomes non-responsive

ScreenShots

Non Responsive UX when sendBytes() works

Expected UX

  1. Details(Or Name) of device where bytes are being sent should be shown to user
  2. Progress when bytes are being sent to user
  3. failure message when sendBytes() fails
  4. Send button should be disabled when bluetooth found

Would you like to work

YES

Add Navigation Drawer to support different sections

Describe the feature you'd like
Navigation Drawer will show if the Bluetooth device is connected or not and also support the About and FAQ section making the app more user friendly

Additional context
It could be somewhat similar to that in case of PSLab app

Would you like to work on the issue?
Yes

Make an icon for the app.

Describe the chore
There should be an icon for the app instead of the default android logo.

Would you like to work on the issue?
YES.

I was thinking of making the icon like the badgeyay website. Could you please give your opinions @iamareebjamal @mariobehling of how the app icon should be designed?

Change App Name and Colors

  1. Please change the app name in the app to Badge Magic. Please ensure strings everywhere in the app are changed.
  2. Please change the colors to red similar to pslab.

Color of navigation bar.

Describe the feature you'd like
The color of the navigation bar is currently black. It should be made red to match the app theme.

Would you like to work on the issue?
YES.

Spinner item's width is not till the end

Describe the feature you'd like
The "Speed" and "Mode" spinners have items that are hard to click, since their width is too less.

Screenshots

spinner-item-badge

Would you like to work on the issue?
Yes!

Multiple bluetooth dialogs being created on rotation

Describe the bug

The AlertDialog asking for bluetooth permission is being recreated on rotation of the device.

To Reproduce

1 Open the app
2 Bluetooth alert dialog pops up
2 Rotate the device
3 Dismiss a dialog
4 An AlertDialog is still present

Expected behavior

Only one dialog should be present

Logs

Screenshots

ezgif com-video-to-gif

Smartphone Info:

Device Nokia 6.1 Plus
Android Version Pie 9.0

Additional context

Would you like to work on the issue?

Yes

Typo in readme.md

Describe the bug
Reverse Engeneering... must be changed to Reverse Engineering...

To Reproduce
Open readme.md file

Expected behavior
Reverse Engineering must be there in the title

Logs
N/A

Screenshots
Screenshot_2019-03-20 fossasia badge-magic-android

Smartphone Info:
N/A

Additional context
N/A

Would you like to work on the issue?
Yes

Add FAQs section

Describe the feature you'd like
A simple FAQs section which will guide users with simple questions.

Additional context
Dependent on #52

Would you like to work on the issue?
YES

App crashes if a symbol which is not implemented is previewed.

Describe the bug
Some symbols such as cent, yen, or pounds are not yet implemented in the app symbols. When these symbols are typed and preview is pressed, the app crashes.

To Reproduce
Type the cent or yen symbols in the edit text and press preview. The app crashes.

Expected behavior
The app should not crash.

Smartphone Info:

Device Nokia 7 plus
Android Version Android 9.0

Would you like to work on the issue?

YES.

Update Version of dependencies

Describe the bug

Source Code using older versions when newer versions are available for dependencies.

To Reproduce

Clone Source Code and after importing gradle.build will fail.

Expected behavior

Source Code should run and build successfully/

Logs

Screenshots

whatsapp image 2019-01-24 at 5 42 42 pm

Smartphone Info:

Device Nokia 5.1 Plus
Android Version Pie 9.0

Would you like to work on the issue?
Yes

NULLPointerException , when characterstics is null

Describe the bug
In GattClient, while connecting to gatt , if characterstic is null, it generates Unhandled Exception

To Reproduce
just try to connect any BLE device

Expected behavior
Handle this exception

Logs

Screenshots

2019-03-09 12:36:48.080 22582-22603/com.nilhcem.blenamebadge W/BluetoothGatt: Unhandled exception in callback
    java.lang.NullPointerException: Attempt to invoke virtual method 'int android.bluetooth.BluetoothGattCharacteristic.getProperties()' on a null object reference
        at android.bluetooth.BluetoothGatt.writeCharacteristic(BluetoothGatt.java:1155)
        at com.nilhcem.blenamebadge.device.bluetooth.GattClient.writeNextData(GattClient.kt:72)
        at com.nilhcem.blenamebadge.device.bluetooth.GattClient.writeDataStart(GattClient.kt:60)
        at com.nilhcem.blenamebadge.ui.message.MessagePresenter$sendBytes$2$3.invoke(MessagePresenter.kt:49)
        at com.nilhcem.blenamebadge.ui.message.MessagePresenter$sendBytes$2$3.invoke(MessagePresenter.kt:14)
        at com.nilhcem.blenamebadge.device.bluetooth.GattClient$gattCallback$1.onServicesDiscovered(GattClient.kt:42)
        at android.bluetooth.BluetoothGatt$1$5.run(BluetoothGatt.java:328)
        at android.bluetooth.BluetoothGatt.runOrQueueCallback(BluetoothGatt.java:770)
        at android.bluetooth.BluetoothGatt.access$200(BluetoothGatt.java:39)
        at android.bluetooth.BluetoothGatt$1.onSearchComplete(BluetoothGatt.java:323)
        at android.bluetooth.IBluetoothGattCallback$Stub.onTransact(IBluetoothGattCallback.java:111)
        at android.os.Binder.execTransact(Binder.java:731)
2019-03-09 12:36:48.138 22582-22603/com.nilhcem.blenamebadge D/BluetoothGatt: onConnectionUpdated() - Device=D3:C3:10:49:09:D8 interval=36 latency=0 timeout=500 status=0

Smartphone Info:
Device : Nokia 6.1
Android Version : 9.0 android pie

Would you like to work on the issue?
Yes

App couldn't detect my badge

Describe the bug
I have a LED Badge which has its Bluetooth ID: FF:FF:2A:00:19:CA, and app is not able to detect it and send data while other app is able to detect and send data.

Expected behavior
It should detect this device and send data.

Smartphone Info:

Device Android Version
Redmi 4 Android 7.1.4

Additional context
I tried CoolLED1248 app

Would you like to work on the issue?
YES, if it is a real issue to just an issue with my device. I'm not sure if it is a problem with my badge or with Scanning feature in the app.

Add hardcoded values to dimen.xml

Describe the chore
Hardcoded values used must be in dimen.xml file since it is a good practice to follow.

Would you like to work on the issue?
YES

Disable Send button when there is no bluetooth device connected

Describe the feature you'd like
A message should show up when there is no bluetooth device connected. For example a toast message or an alert.

Additional context
We could also disable the send button when there is no bluetooth device connected.

Would you like to work on the issue?
Yes

Issue when edit text is empty.

Describe the bug
When the edit text is empty, the keyboard goes down and no alert is shown.

To Reproduce
Keep the edit text empty and press send. The keyboard goes down.

Expected behavior
The keyboard should not go down and an alert should be shown in the edit text.

Smartphone Info:

Device Nokia 7 plus
Android Version Android 9,0

Additional context
A hint shall also be added to the edit text.

Update: Now the preview button has been introduced. Changes have to made for it also.

Would you like to work on the issue?
YES

Close keyboard whenever send button is clicked

Describe the bug
Currently the keyboard closes only when the send button is clicked and bluetooth is on.

Expected behavior
The keyboard should close even when bluetooth is off and the send button is clicked.

Would you like to work on the issue?
Yes

Add Bug Report page

Describe the feature you'd like
Adding bug report or feature request form to get bug reports or requests

Additional context
Dependent on #52 where Navigation Drawer will be added

Would you like to work on the issue?
Yes

Implement more symbols.

Describe the feature you'd like
Some symbols such as cent, yen, pound are not yet implemented in the app. I would like to implement these symbols.

Additional context
I would also implement any other missing symbols that I find.

Would you like to work on the issue?

YES.

Change toasts to snackbars

Describe the chore
Snackbars should be used instead of toasts for better UI.

Would you like to work on the issue?
Yes

Add feature to display bitmap

Please implement the possibility to send a Bitmap to the LED badge directly. Since we have a full control over the badge device, we can create a 40x11px bitmap and write some code to convert it into byte arrays we can send to the LED badge.

screenshot from 2018-12-17 08-00-16

09_final

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.