Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -81,3 +81,4 @@ lint/generated/
lint/outputs/
lint/tmp/
# lint/reports/
app/src/main/res/values/api_keys.xml
2 changes: 1 addition & 1 deletion .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

20 changes: 18 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@

This is being done as a hobby, and for experimenting, so probably there might be some flaws; As an example, the vendor ID of Arduino is hardcoded to only work with Arduino devices, but this is my use case and please feel free to change it to match your needs.

# Install
The app is available for free on Google Play Store (Arduino USB Terminal).
Otherwise, you can clone the project and run it locally.
Please read the **Sentry Reports** part on this page before running the project to avoid build failures.

## Terminal
A Simple terminal page which does what it is supposed to do interacting with an Arduino manually through the USB cable.

Expand All @@ -14,9 +19,20 @@
## Tests
Under Construction

## Sentry Reports
The project uses Sentry for the crash reports, if this is not needed, you can remove the following line in `AndroidManifest.xml`:
`<meta-data android:name="io.sentry.dsn" android:value="@string/sentry_dsn" />`
But if it is needed, you need to [create a Sentry dsn value](https://docs.sentry.io/platforms/android/) to put under the following path:
`app/src/main/res/values/api_keys.xml`
The file contents might look like similar to this:
`<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="sentry_dsn" translatable="false">YOUR_SENTRY_SPECIFIC_VALUE</string>
</resources>`


### Knows Issues
_On Android 5.1.1, the Arduino serial output cannot be shown. (It is said that an Android internal bug is the issue!)_ This was hopefully solved using LiveData
The Arduino output characters might be shown a bit weird in the app while skipping some characters when the message is too long. This will be fixed as I figure out the reason! Any suggestions will be appreciated. :)
_Still unknown! :)

Suggestions and PRs are welcome! :)

Expand Down
9 changes: 8 additions & 1 deletion app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,13 @@ apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'koin'

repositories {
jcenter()
}

android {
compileSdkVersion 29
buildToolsVersion "29.0.2"
buildToolsVersion "29.0.3"

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
Expand Down Expand Up @@ -39,6 +43,9 @@ dependencies {
implementation 'androidx.core:core-ktx:1.2.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'

// Sentry Tracking
implementation 'io.sentry:sentry-android-core:2.0.2'

// Koin for Android - ViewModel features
implementation "org.koin:koin-android-viewmodel:$koin_version"

Expand Down
5 changes: 5 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
package="org.kabiri.android.usbterminal">

<uses-feature android:name="android.hardware.usb.host" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />

<application
android:name=".MainApplication"
Expand All @@ -13,6 +15,9 @@
android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="@style/AppTheme">

<meta-data android:name="io.sentry.dsn" android:value="@string/sentry_dsn" />

<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
package org.kabiri.android.usbterminal

import android.content.Intent
import android.os.Bundle
import android.text.SpannableString
import android.text.method.ScrollingMovementMethod
Expand All @@ -10,10 +9,12 @@ import android.view.MenuInflater
import android.view.MenuItem
import androidx.appcompat.app.AppCompatActivity
import androidx.lifecycle.Observer
import io.sentry.core.Sentry
import kotlinx.android.synthetic.main.activity_main.*
import org.kabiri.android.usbterminal.viewmodel.MainActivityViewModel
import org.koin.android.viewmodel.ext.android.viewModel


class MainActivity : AppCompatActivity() {

companion object {
Expand Down
3 changes: 1 addition & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
ext.kotlin_version = '1.3.71'
ext.kotlin_version = '1.3.72'
ext.koin_version = '2.1.5'
repositories {
google()
jcenter()

}
dependencies {
classpath 'com.android.tools.build:gradle:3.6.3'
Expand Down