Code Monkey home page Code Monkey logo

salemove.droid's Introduction

SaleMove.Droid

Implementing SaleMove API in Android, a proof of concept, for SaleMove's Hack the CX hackathon.

  • Team: Swift
  • Members: Anna, John, Aare

Plan

Build an interactive user interface in Android, implementing Salemove's API, which features, among other things, WebRTC. Essentially creating a prototype for SaleMove's Android SDK

... and all that utilizing both Kotlin and Java (because why the hell wouldn't we want to make our lives even more difficult), because Java was common ground for us, but Kotlin is fun.

Process

Soon after we had started, it became apparent that SaleMove does not have a public API for their WebSocket solution, so for a while I tried to decode the crypic messages to write a solution from scratch, using an Android implementation of Socket.IO. But all that backfired in a tremendous way when by the end of Friday I still had no idea what the hell was going on. It was an ambitious task, and I admit defeat.

The next-best thing was to create a WebView-based solution, so I threw together a small site (available in the /web folder) with the help of site_hosting_and_conf.md, implemented the SDK, asked the mentors for all the necessary access keys and hosted it on a server where our application could access it from.

Sounds great, right? Wrong. SaleMove's audio and video features require the use of https protocol... and I don't own any site with that license, so it had to be purely text-chat-based. Drats, foiled again.

That's still fine: so we created a WebView, loaded the site from the url, thinking everything would be great, but the chat button wouldn't appear. What!?

After some debugging, as it turns out, Android WebViews didn't even support sockets until v4.4 (KitKat), but we had newer operation systems, so everything should have been fine. But no. It didn't give any errors, just didn't open the Websocket connection. I have no idea why.

Fun fact: the only reason I could debug the application and find out everything is fine is because I'm using the newer, Chromium-based WebView, else I would've been pulling my hair out by now.

So the final, worst, solution would be to implement a hack that opens the Chrome app from our App without asking the user for confirmation, so it would, at least somewhat, look like the user was still in the application.

And here we are: an application featuring a list where each item has two buttons: one to close the app and start a phone call with a SaleMove operator, and another to open Chrome that goes on a website where SaleMove SDK is implemented, but only with text-based chat. >:(

Components

  • Android application using http requests to retrieve data from SaleMove
  • Web application implementing SaleMove SDK

Libraries and tools used

  • Picasso - A powerful image downloading and caching library for Android

  • ButterKnife - Annotate fields with @BindView and a view ID for Butter Knife to find and automatically cast the corresponding view in your layout

  • Socket.IO - Socket.IO enables real-time bidirectional event-based communication

  • Fuel - The easiest HTTP networking library for Kotlin/Android

  • Coroutines - Simplifies asynchronous programming by putting the complications into libraries

salemove.droid's People

Contributors

alienfractal avatar nikituh avatar anna-bass avatar

Watchers

 avatar  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.