This is work sample given for the job position of Mobile Developer at EQ Works. The description of the work sample is here.
- An standalone SDK in Kotlin for logging user's location
- Feature to deliver result on desired thread
- Error logging if API failes due to any result
- Retry mechansim if API fails.
- Minimal and can be used universally (Android OR Pure Java/Kotlin)
- httpbin has been used for API
- Unit test cases using JUnit4
- Import the ws-mobile-kotlin in your existing project(File -> New -> Import Module)
- In your application/main class, initialize the library as below:
Library.instance.setUp(YourCustomeOkhttpClient)
- Pass users LocationEvent (lat, long, time(optional), extradata(optional)) object to the log function as below:
Library.instance.log(LocationEvent object)
- OkHttp - Open source project designed to be an efficient HTTP client developed by Square Inc.
- Gson - Used to convert Java Objects into their JSON representation developed by Google
- Import EQWorks project in Android Studion IDE(File -> New -> Import Project)
- Open file MockViewmodelTest under com.huk.eqworks package
- Right click on work space and hit Run MockViewmodelTest
- Observe the result
- Import EQWorks project in Android Studion IDE(File -> New -> Import Project)
- From configurations, select app if not selected.
- Select the device you want to run on and click the run button next to device selection.
- Click on Send location button in application to log the location to the server.
- CoLocation - For getting location from all possible providers in Android using kotlin coroutines
- OkHttp - Open source project designed to be an efficient HTTP client developed by Square Inc.
- Android Architecture Componnets - Android architecture components for morder way of android development
- Add security
- Handle various other methods such as PUT/DELETE/GET
Feel free to contact me if you have any question regarding code running.