Skip to content

Update readme #5

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
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
15 changes: 15 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
*.iml
.gradle
/local.properties
/.idea/caches
/.idea/libraries
/.idea/modules.xml
/.idea/workspace.xml
/.idea/navEditor.xml
/.idea/assetWizardSettings.xml
.DS_Store
/build
/captures
.externalNativeBuild
.cxx
local.properties
3 changes: 3 additions & 0 deletions .idea/.gitignore

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

1 change: 1 addition & 0 deletions .idea/.name

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

6 changes: 6 additions & 0 deletions .idea/compiler.xml

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

17 changes: 17 additions & 0 deletions .idea/deploymentTargetDropDown.xml

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

20 changes: 20 additions & 0 deletions .idea/gradle.xml

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

6 changes: 6 additions & 0 deletions .idea/kotlinc.xml

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

9 changes: 9 additions & 0 deletions .idea/misc.xml

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

6 changes: 6 additions & 0 deletions .idea/vcs.xml

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

90 changes: 62 additions & 28 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
# Gambit challenge
## TUF-2000M Mobile App

## Problem description
## Product Description
The TUF-2000M Mobile App is designed to provide a user-friendly interface for viewing data from the TUF-2000M ultrasonic energy meter. This app fetches data from the associated REST API and presents it to the user in a readable and intuitive manner.

TUF-2000M is an ultrasonic energy meter that has a [Modbus](https://en.wikipedia.org/wiki/Modbus) interface described in docs/tuf-2000m.pdf.
Gambit has access to one of these meters and it is providing you a live text feed that shows the time of the reading followed by the first 100 register values which look like this:

Gambit has access to one of these meters and it is providing you a [live text feed](http://tuftuf.gambitlabs.fi/feed.txt) that shows the time of the reading followed by the first 100 register values which look like this:

```
2017-01-11 19:12
1:7579
2:48988
Expand Down Expand Up @@ -108,36 +106,72 @@ Gambit has access to one of these meters and it is providing you a [live text fe
98:17105
99:3374
100:17839
```

To help you on your way with data conversion I will give you a few clues based on the example data above:
## Features
- Display parsed data from the TUF-2000M ultrasonic energy meter.
- User-friendly interface for easy data visualization.
- Secure authentication for user access.

## User Manual
Information on the registries, variable names, units, notes, and formats are available on pages 39-42. docs/tuf-2000m.pdf

- Register 21-22, Negative energy accumulator is -56.
- Register 33-34, Temperature #1/inlet is 7.101173400878906.
- Register 92, Signal Quality is 38.
## Getting Started
Follow these steps to set up the project and run the app locally:

The registers and their respective datatypes are explained in detail in [docs/tuf-2000m.pdf](https://github.com/gambit-labs/tuf-2000m/blob/master/docs/tuf-2000m.pdf) on pages 39-42.
1. Clone the repository to your local machine.
2. Open the project in Android Studio.
3. Build and run the app on an Android emulator or a physical device.

## Your task
## Usage
1. Launch the app.
2. Tap on the Sign-up text to register or use dummy credentials to log in ([email protected] / Atea@123#)
3. View the parsed data from the TUF-2000M ultrasonic energy meter in the home view pager screen.

Select one task from below. There is no single solution to these problems and we don't expect a complete solution to consider you for a position.
## Technologies Used
- Kotlin
- Android Studio

### Option 1: Create an REST API that parses the data to a readable form
- .NET Core or maybe node.js?
- JSON output is greatly appreciated
- Easily deployable and testable
- Authentication
## Dependencies
- [Retrofit](https://square.github.io/retrofit/) for making HTTP requests.
- [Gson](https://github.com/google/gson) for JSON serialization and deserialization.
- Hilt for dependency injection
- Jetpack components
- Firebase
- -Etc...

### Option 2: Create UI for showing the data for user
- Modern javascript frameworks or maybe an mobile app. It's up to you
- Easily deployable and testable
- UX will be also a key factor on this
- Authentication
## Testing
1. Signed apk distributed link for internal testing: https://appdistribution.firebase.dev/i/0bde28dffa675f6a
Copy link
Author

@MinchalaVenkatSunil MinchalaVenkatSunil Oct 16, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

  1. To install the signed APK for testing
  2. The link of a video demo is provided as well to know about the application

(Please follow the instructions, once registered I need to approve and you can install the application, its a signed build, but need to allow from unknown source)
2. To view the demo video, here is the link - https://drive.google.com/drive/folders/1b5gtmzvwHqkAr0e5juCrw9oakHomrRjF
3. Unit and UI tests are yet to be implemented to ensure the app's functionality and user interface work as expected.

## Presenting your solution
## Additional info:
1. Some supporting information in this Google Drive link - https://drive.google.com/drive/folders/1b5gtmzvwHqkAr0e5juCrw9oakHomrRjF
2. https://my-json-server.typicode.com/MinchalaVenkatSunil/demo - "my-json-server.typicode.com", used the restricted sample with limitations to fetch JSON response.

Provide your solution as a *private* Git repository, then share your private repo with our GitHub account `ateaimf` (https://github.com/ateaimf).
## Additional Thoughts:
1. **Localization** support based on language ID stored in the registry. Initiated but still needs to be completed fully.
2. **Offline** support to access previously fetched data and other few timestamps.
3. Ask for **user feedback** once on a scheduled basis.
4. **Charts, graphs** presentation, maybe on the favorite items for better visualization.
5. User settings for font size, **dark mode** support
6. Add more UI and unit test coverage.
7. Support for multiple form factors.
8. Extend the support to Apple devices and others using **cross-platform technologies** using React Xamarin forms.
9. An eye on code quality and best practices.
10. Automatically publish to Play or App Store on production repo commit using **CICD pipelines**. Just to let you know, it was started and is in progress.
11. Need to utilize **analytics** to analyze user behavior and generate reports for decision-making and UI improvements.
12. iPasS **serverless triggers** (e.g., logic apps, functions, Azure stream job analytics) for data processing and desired output transformation.
13. Tokens to keep all the information shared between the app and the server safe and secure.
14. I believe we can implement some features to the existing list to make a user-friendly UI.
a. Sort by category
b. Sort by Alphabet
c. Favorites (if the user wants to see specific Readings only)
d. Search as the list might be big
e. Grouping the related content

We appreciate if you can host your solution somewhere in the cloud or VPS so we can see an actual demo of it, rather than just looking at code.
## Backend
[TODO: Once the actual backend is ready in a separate repo we will add more info on how to consume those API's later]

Good use of Git version control is appreciated.
## License
This project is licensed under the [MIT License](LICENSE).
1 change: 1 addition & 0 deletions app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
/build
83 changes: 83 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,83 @@
plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
id 'kotlin-kapt'
id 'com.google.dagger.hilt.android'
id 'com.google.gms.google-services'
}

android {
namespace 'com.tuf2000m.energymeter'
compileSdk 34

defaultConfig {
applicationId "com.tuf2000m.energymeter"
minSdk 24
targetSdk 34
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_17
targetCompatibility JavaVersion.VERSION_17
}

kotlinOptions {
jvmTarget = '17'
}

buildFeatures {
dataBinding true
viewBinding true
}
}

dependencies {
implementation 'androidx.core:core-ktx:1.12.0'
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'com.google.android.material:material:1.9.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'

// Retrofit
def retrofitVersion = '2.9.0'
implementation "com.squareup.retrofit2:retrofit:$retrofitVersion"
implementation "com.squareup.retrofit2:converter-gson:$retrofitVersion"
implementation "com.squareup.okhttp3:okhttp:4.9.3"
implementation "com.squareup.okhttp3:logging-interceptor:4.9.3"

// Hilt
def hiltVersion = '2.44'
implementation("com.google.dagger:hilt-android:$hiltVersion")
kapt "com.google.dagger:hilt-android-compiler:$hiltVersion"

// Coroutines
def coroutineVersion = '1.5.2'
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-android:$coroutineVersion"

// Kotlin Extensions
implementation "androidx.activity:activity-ktx:1.8.0"
implementation "androidx.fragment:fragment-ktx:1.6.1"
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:2.6.2"
implementation "androidx.lifecycle:lifecycle-runtime-ktx:2.6.2"
implementation 'androidx.savedstate:savedstate:1.2.1'

// Firebase
implementation(platform("com.google.firebase:firebase-bom:32.3.1"))
implementation("com.google.firebase:firebase-auth-ktx")

// Navigation Components
implementation "androidx.navigation:navigation-fragment-ktx:2.2.1"
implementation "androidx.navigation:navigation-ui:2.7.4"
}
48 changes: 48 additions & 0 deletions app/google-services.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
{
"project_info": {
"project_number": "154914327689",
"project_id": "tuf-2000mmobileapp",
"storage_bucket": "tuf-2000mmobileapp.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:154914327689:android:5e7ed85d6e06c7e71d0a58",
"android_client_info": {
"package_name": "com.tuf2000m.energymeter"
}
},
"oauth_client": [],
"api_key": [
{
"current_key": "AIzaSyDVbXOCACRUmIahXhLIYgljK4x8YOow1Ys"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": []
}
}
},
{
"client_info": {
"mobilesdk_app_id": "1:154914327689:android:088275fa4f98382f1d0a58",
"android_client_info": {
"package_name": "com.venkat.tuf2000m"
}
},
"oauth_client": [],
"api_key": [
{
"current_key": "AIzaSyDVbXOCACRUmIahXhLIYgljK4x8YOow1Ys"
}
],
"services": {
"appinvite_service": {
"other_platform_oauth_client": []
}
}
}
],
"configuration_version": "1"
}
21 changes: 21 additions & 0 deletions app/proguard-rules.pro
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Add project specific ProGuard rules here.
# You can control the set of applied configuration files using the
# proguardFiles setting in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}

# Uncomment this to preserve the line number information for
# debugging stack traces.
#-keepattributes SourceFile,LineNumberTable

# If you keep the line number information, uncomment this to
# hide the original source file name.
#-renamesourcefileattribute SourceFile
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
package com.tuf2000m.energymeter

import androidx.test.ext.junit.runners.AndroidJUnit4
import androidx.test.platform.app.InstrumentationRegistry
import org.junit.Assert.*
import org.junit.Test
import org.junit.runner.RunWith

/**
* Instrumented test, which will execute on an Android device.
*
* See [testing documentation](http://d.android.com/tools/testing).
*/
@RunWith(AndroidJUnit4::class)
class ExampleInstrumentedTest {
@Test
fun useAppContext() {
// Context of the app under test.
val appContext = InstrumentationRegistry.getInstrumentation().targetContext
assertEquals("com.tuf2000m.energymeter", appContext.packageName)
}
}
Loading