• Stars
    star
    2,419
  • Rank 19,018 (Top 0.4 %)
  • Language
    Kotlin
  • License
    Apache License 2.0
  • Created about 8 years ago
  • Updated about 2 years ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

SUSI.AI Android App https://play.google.com/apps/testing/ai.susi

SUSI.AI Android App

Dev CircleCI Master CircleCI Codacy Badge Preview the app Gitter Mailing List Twitter Follow

The main feature of the app is to provide a conversational interface to provide intelligent answers using the loklak/AskSusi infrastructure. The app also offers login functionalities to connect to other services and store personal data. Additionally, the application uses data provided by the user's phone to improve Susi answers. Geolocation information, for example, helps to offer better answers related to questions about "things nearby".

Roadmap

Planned features & enhancements are:

  • Hotword Detection training
  • Full-Screen Voice interaction
  • Feedback for skills.
  • Displaying SUSI skills
  • Susi Smart Speaker Configuration and Control

Communication

Please join our mailing list to discuss questions regarding the project: https://groups.google.com/forum/#!forum/susiai

Our chat channel is on gitter here: https://gitter.im/fossasia/susi_android

Screenshots

Development

A native Android app using both Java and Kotlin for writing code. The answers for user queries comes from SUSI Server which further uses skills defined in SUSI Skill Data.

Android App Development Set up

Please find info about the set up of the Android app in your development environment here.

Libraries used and their documentation

  • Realm Docs
  • Retrofit Docs
  • ButterKnife Docs
  • Espresso Docs
  • Tajchert Waiting Dots Docs
  • Picasso Docs
  • LeakCanary Docs
  • LeonardoCardoso/Android-Link-Preview Docs
  • Gericop/Android-Support-Preference-V7-Fix Docs
  • Snowboy Hotword Detection Docs
  • zagum/SpeechRecognitionView Docs
  • MPAndroidChart Docs
  • Timber Docs
  • Play services authentication Docs

Project Conventions

There are certain conventions we follow in the project, we recommend that you become familiar with these so that the development process is uniform for everyone:

MVP

The project follows Model-View-Presenter design pattern and requires schematic interfaces for each component to be written first as contracts and then implemented.
All the interactions are done using interfaces only. This means any model, view or presenter will only be referenced by its interface. We do so it is easy to mock and test them and there is no discrepancy in the callable methods of the concrete class and the interface.
We realize that MVP is opinionated and there is no strict boundary between the responsibility of each component, but we recommend following this style:

  • View is passive and dumb, there is no logic to be exercised in View, only the ability to show data provided by the presenter through contract is present in the View. This makes it easy to unit test and remove the dependence on Android APIs, thus making the need for instrumentation tests scarce.
  • Presenter is responsible for most of the business logic, manipulation of data and organising it for the view to present. All logic for the app is present here and it is devoid of ANY Android related code, making it 100% unit testable. We have created wrapper around common Android APIs in form of models so that they can be mocked and presenter stays clean. The responsibility of presenter includes the fetching of data from external source, observing changes and providing the view with the latest data. It also needs to handle all View interactions that require any logic, such as UI triggers causing complex interactions. Notable exception for this is launching of an Activity on click of a button. There is no logic required in the action and is completely dependent on Android APIs. Lastly, presenter should always clean up after the view is detached to prevent memory leaks.
  • Model has the responsibility to hold the data, load it intelligently from appropriate source, be it disk or network, monitor the changes and notify presenter about those, be self sufficient; meaning to update data accordingly as needed without any external trigger (saving the data in disk after updating from network and providing the saved data from next time on), but be configurable (presenter may be able to ask for fresh data from network). The presenter should not worry about the data loading and syncing conditions (like network connectivity, failed update, scheduling jobs, etc) as it is the job of model itself.

Use of Kotlin

Around 50% of the App is written in Kotlin. Kotlin is a very similar language to Java but with much more advantages than Java. It is easy to adapt and learn. So, you need not worry if you don't have prior experience with it. Follow these docs for syntax reference. The latest Android Canary Version has in built support for Kotlin but if you don't have the Canary version, you can add Kotlin Plugin in your Android Studio. Follow this link to see how to do that.

Project Structure

Generally, projects are created using package by layer approach where packages are names by layers like ui, activity, fragment, etc but it quickly becomes unscalable in large projects where a large number of unrelated classes are crammed in one layer and it becomes difficult to navigate through them.
Instead, we follow package by feature, which at the cost of flatness of our project, provides us packages of isolated functioning related classes which are likely to be a complete self-sufficient component of the application. Each package contains all related classes of view, presenter, their implementations like Activities and Fragments.
A notable exception to this is the helper module and data classes like Models and Repositories as they are used in a cross component way.
Note: The interface contract for Presenter and View is present in contract package in each module

Separation of concerns

Lastly, each class should only perform one task, do it well, and be unit tested for it. For example, if a presenter is doing more than it should, i.e., parsing dates or implementing search logic, better move it in its own class. There can be exceptions to this practice, but if the functionality can be generalised and reused, it should most definitely be transferred in its own class and unit tested.

Contributions Best Practices

For first time Contributor

First time contributors can read CONTRIBUTING.md file for help regarding creating issues and sending pull requests.

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 and a unit-test check on Circle CI.
  • master This contains shipped code. After significant features/bugfixes are accumulated on development, we make a version update and make a release.
    • Please Note that :-

      Each push to master branch automatically publishes the application to Play Store as an Alpha Release. Thus, on each merge into master, the versionCode and versionName MUST be changed accordingly in app/build.gradle

    • versionCode : Integer : To be monotonically incremented with each merge. Failure to do so will lead to publishing error, and thus is a crucial step before any merge

    • versionName : String : User visible version of the app. To be changed following semantic versioning

  • apk This branch contains many apk files, that are automatically generated on the merged pull request a) debug apk for Fdroid and Playstore b) release apk for Fdroid and Playstore
    • 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.

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

  • For writing commit messages please read the COMMITSTYLE carefully. Kindly adhere to the guidelines.

  • 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. (Don't worry ... Nothing will happen to the app or to you due to the exploring ๐Ÿ˜‰ Only thing that will happen is, you'll be more familiar with what is where and might even get some cool ideas on how to improve various aspects of the app.)

  • 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 so that the issue can be assigned to you if the previous assignee has dropped it entirely.

For Developers: Adding Fabric API KEY

  1. Go to AndroidManifest.xml Replace the fabric_api_key with the Real Fabric API Key by adding :

    <meta-data android:name="io.fabric.ApiKey" android:value="fabric_api_key" />
    
  2. Open the app/fabric.properties: Replace the fabric_api_key with your actual Fabric API Secret.

  3. Open MainApplication.java, a) After adding the API KEYS and API Secret uncomment the line : Fabric.with(this, new Crashlytics())

    b) Add imports : import com.crashlytics.android.Crashlytics; import io.fabric.sdk.android.Fabric;

  4. Uncomment the line in the app/gradle:

    apply plugin: 'io.fabric'
    

For Developers: Updating the URL of the smart speaker

  1. Go to build.gradle file and the URL of the smart speaker local server under the name of SPEAKER_BASE_URL as a buildConfigField can be updated there under the buildtypes section in both the release and debug blocks :
    buildConfigField "String", "SPEAKER_BASE_URL", '"http://10.0.0.1:5000"'	
    
    

For Developers: Adding the YouTube API key

Go to AndroidManifest.xml and replace the ${YOUTUBE_API_KEY} with the real youtube API Key by adding :

<meta-data
android:name="com.google.android.youtube.API_KEY"
android:value="${YOUTUBE_API_KEY}" />

For Testers: Testing the App

If you are a tester and want to test the app, you have two ways to do that:

  1. Installing APK on your device: You can get debug APK as well as Release APK in apk branch of the repository. After each PR merge, both the APKs are automatically updated. So, just download the APK you want and install it on your device. The APKs will always be the latest one.
  2. Testing on appetize.io: If you don't want to download the APKs, you can simply go on this link and use the App on an online simulator. You will always find the latest version of App on that link because it is updated after each PR merge.

License

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

More Repositories

1

visdom

A flexible tool for creating, organizing, and sharing visualizations of live, rich data. Supports Torch and Numpy.
Python
10,012
star
2

open-event-server

The Open Event Organizer Server to Manage Events https://test-api.eventyay.com
Python
2,906
star
3

phimpme-android

Phimp.me Photo Imaging and Picture Editor https://play.google.com/store/apps/details?id=org.fossasia.phimpme
Java
2,576
star
4

susi_server

SUSI.AI server backend - the Artificial Intelligence server for personal assistants https://susi.ai
Java
2,503
star
5

open-event-frontend

The frontend for the Open Event API Server https://test.eventyay.com
JavaScript
2,335
star
6

open-event-droidgen

Open Event Android App Generator https://github.com/fossasia/open-event-android/raw/apk/sample-apk-fossasia17-development.apk
Java
2,048
star
7

pslab-android

PSLab Android App https://play.google.com/store/apps/details?id=io.pslab
Java
2,046
star
8

susi.ai

SUSI.AI Web Client https://susi.ai
JavaScript
2,033
star
9

open-event-wsgen

Open Event Website App Generator https://sched.eventyay.com
JavaScript
2,013
star
10

open-event-attendee-android

Open Event Attendee Android General App https://github.com/fossasia/open-event-android/blob/apk/open-event-dev-app-playStore-debug.apk
Kotlin
1,947
star
11

star-me

Star FOSSASIA Repositories on Github and Support the Community
JavaScript
1,905
star
12

fossasia.org

FOSSASIA Website https://fossasia.org
Less
1,883
star
13

susi_iOS

SUSI AI iOS app http://susi.ai
Swift
1,869
star
14

loklak_search

Frontend Search for loklak server https://loklak.org
TypeScript
1,831
star
15

badgemagic-android

Badge Magic with LEDs - Android App https://play.google.com/apps/testing/org.fossasia.badgemagic
Dart
1,828
star
16

badgeyay

Attendee Badge Generator for Conferences
JavaScript
1,787
star
17

open-event-organizer-android

Open Event Mobile App for Organizers and Entry Managers https://play.google.com/store/apps/details?id=com.eventyay.organizer
Java
1,784
star
18

meilix

Beautiful Linux System https://meilix.org | APT Repo: http://meilix.fossasia.org
Python
1,772
star
19

pslab-desktop

PSLab Desktop Application https://pslab.io
JavaScript
1,763
star
20

susper.com

Susper Decentralised Search Engine https://susper.com
TypeScript
1,734
star
21

open-event

Open Event Project, Samples, Documentation and Artwork http://open-event-dev.herokuapp.com
Python
1,701
star
22

neurolab-android

NeuroLab Android https://github.com/fossasia/neurolab-android/raw/apk/neurolab-dev-debug.apk
Java
1,700
star
23

labs.fossasia.org

Projects Website for FOSSASIA http://labs.fossasia.org
CSS
1,669
star
24

query-server

Query Server Search Engines
Python
1,659
star
25

gci16.fossasia.org

FOSSASIA Google Code-In Website 2016/17 http://gci16.fossasia.org
HTML
1,652
star
26

pslab-hardware

PSLab Hardware Design and Schematics https://pslab.io
Prolog
1,642
star
27

codeheat.org

Codeheat Coding Contest Website https://codeheat.org
Less
1,628
star
28

pslab-python

Python Library for PSLab Desktop: https://pslab.io
Python
1,624
star
29

pslab-scripts

Pocket Science Lab - Scripts for Sensor Experiments
Python
1,604
star
30

susi_linux

Hardware for SUSI AI https://susi.ai
Python
1,604
star
31

flappy-svg

Flappy Bird in SVG. Play it at http://fossasia.github.io/flappy-svg/
JavaScript
1,604
star
32

gci17.fossasia.org

FOSSASIA Google Code-In Website 2017/18 https://gci17.fossasia.org
CSS
1,598
star
33

gci15.fossasia.org

FOSSASIA Google Code-In Website 2015/16 http://gci15.fossasia.org
HTML
1,596
star
34

2017.fossasia.org

FOSSASIA Summit 2017 https://2017.fossasia.org
HTML
1,580
star
35

2018.fossasia.org

FOSSASIA Summit 2018 https://2018.fossasia.org
HTML
1,577
star
36

fossasia-communities

FOSSASIA API Files of Communities in Asia
1,576
star
37

susi_skill_cms

A web application framework to edit susi skills http://skills.susi.ai
JavaScript
1,572
star
38

open-event-attendee-ios

iOS app for open event
Swift
1,570
star
39

gci14.fossasia.org

FOSSASIA Google Code-In Website 2014/15 http://gci14.fossasia.org
JavaScript
1,569
star
40

2016.fossasia.org

FOSSASIA Summit 2016 https://2016.fossasia.org
CSS
1,564
star
41

2012.fossasia.org

FOSSASIA Summit 2012 Event Site https://2012.fossasia.org
CSS
1,563
star
42

knittingpattern

A Python Library for Knitting Patterns
Python
1,562
star
43

loklak_webclient

loklak web application
JavaScript
1,553
star
44

pslab-firmware

Firmware for PSLab Open Hardware Platform https://pslab.io
C
1,550
star
45

loklak_wok_android

"loklak wok" is a harvesting peer for the loklak_server https://github.com/fossasia/loklak_wok_android/raw/apk/loklak_wok_1.2_20160201.apk
Java
1,549
star
46

directory.api.fossasia.net

Python
1,547
star
47

neurolab-hardware

Neurolab Hardware
1,541
star
48

yaydoc

Docs! Yay! http://yaydoc.org
JavaScript
1,540
star
49

2015.fossasia.org

FOSSASIA Summit 2015 Event Site https://2015.fossasia.org
CSS
1,539
star
50

susi_chromebot

SUSI.AI Chrome Extension
JavaScript
1,538
star
51

meilix-systemlock

Meilix system lock
Python
1,537
star
52

2014.fossasia.org

FOSSASIA Summit 2014 Event Site http://2014.fossasia.org
HTML
1,537
star
53

x-mario

x-mario, the gaming distro
Shell
1,534
star
54

phimpme-drupal

Phimp.me - Photo App on Drupal
PHP
1,534
star
55

knitlib

Knitting backend library for knitting machines
Python
1,532
star
56

yaydoc-artwork

Open Source Books
1,532
star
57

phimpme-wordpress

Phimp.me - Photo App on Wordpress
PHP
1,532
star
58

sg18.sciencehack.asia

UNESCO Hackathon Website at the FOSSASIA Summit Singapore https://sg18.sciencehack.asia
CSS
1,532
star
59

searss

Search to RSS tool
Python
1,531
star
60

CommonsNet

Sharing and Transparency for WiFi Networks
JavaScript
1,531
star
61

knitweb

knitting web app frontend and backend
JavaScript
1,530
star
62

meilix-generator

WebApp for generating a custom ISO image based on Meilix http://meilix.org
HTML
1,530
star
63

pslab-case

PSLab Case https://pslab.io
1,530
star
64

fossasia.net

FOSSASIA.net Website https://fossasia.net
HTML
1,530
star
65

2011.fossasia.org

FOSSASIA Summit 2011 Event Site http://2011.fossasia.org
HTML
1,530
star
66

unesco.sciencehack.asia

UNESCO Hackathon Website https://unesco.sciencehack.asia
CSS
1,530
star
67

pslab-expeyes

PSLab for ExpEYES - Science Experiments and Data Acquisition for Physics Education https://pslab.io
Python
1,529
star
68

api.fossasia.net

FOSSASIA API
JavaScript
1,529
star
69

xmario_buildscript

x-mario build script
Shell
1,529
star
70

fossasia-nodemailer

JavaScript
1,529
star
71

2023.fossasia.org

HTML
1,528
star
72

hotelxoai.com

The Open Source Hotel in the Mekong Delta in Vietnam
HTML
1,527
star
73

2010.fossasia.org

FOSSASIA Summit 2010 Event Site http://2010.fossasia.org
HTML
1,527
star
74

fossasia11-drupal

FOSSASIA 2011 Drupal Site
PHP
1,526
star
75

blog.fossasia.org

Issue Tracker for https://blog.fossasia.org
1,526
star
76

susi_smart_box

SUSI.AI Smart Box https://susi.ai
1,526
star
77

fossasia10-drupal

FOSSASIA 2010 Drupal Site
PHP
1,525
star
78

perspektive89.com

Open Source Journal Perspektive89.com
1,525
star
79

cmap.api.fossasia.net

FOSSASIA Community Map
JavaScript
1,523
star
80

feed.api.fossasia.net

PHP
1,522
star
81

loklak-webtweets

FOSSASIA Tweets with loklak http://fossasia.github.io/loklak-webtweets/
Less
1,522
star
82

foss.vn

FOSS.vn Website http://foss.vn
HTML
1,522
star
83

labyrinth

FOSSASIA Labyrinth
JavaScript
1,519
star
84

pslab-test-jig

PSLab Test Jig - Boards to test PSLab hardware https://pslab.io
1,518
star
85

jugaadfest.com

Jugaadfest in India https://jugaadfest.com
HTML
1,518
star
86

knitpat

Knitting Pattern Format
Python
1,518
star
87

susi_tweetbot

Twitter Bot for Susi http://susi.ai
JavaScript
1,517
star
88

open-event-scraper

Google spreadsheet parsing for Open Event JSON
Python
1,516
star
89

fossasia.github.io

FOSSASIA.GitHub.io
HTML
1,516
star
90

knitserver

JavaScript
1,515
star
91

open-event-next

Open Event Frontend "Next Version" with Vue.js
TypeScript
1,515
star
92

susi_skill_data

A storage place for SUSI.AI skills https://susi.ai
1,514
star
93

loklak_tweetheatmap

Heat map with tweets by search query using Loklak API and OpenLayers 3
JavaScript
1,513
star
94

sciencehack.asia

Science Hack Website http://sciencehack.asia
CSS
1,512
star
95

fossasia-artwork

Artwork related to FOSSASIA
1,512
star
96

susi_telegrambot

Susi Telegram Bot http://susi.ai
JavaScript
1,511
star
97

timeline.api.fossasia.net

JavaScript
1,511
star
98

susi_fbbot

Susi Facebook Bot http://susi.ai
JavaScript
1,510
star
99

susi_slackbot

Ask Susi Messengers http://susi.ai
JavaScript
1,510
star
100

kniteditor

Kniteditor
Inno Setup
1,509
star