Skip to content
This repository has been archived by the owner on Jun 11, 2020. It is now read-only.

Create a connector for consuming Restful APIs on Android client #18

Open
mcicolella opened this issue Oct 25, 2017 · 16 comments
Open

Create a connector for consuming Restful APIs on Android client #18

mcicolella opened this issue Oct 25, 2017 · 16 comments

Comments

@mcicolella
Copy link
Contributor

The interaction with our framework is based on a RESTful API https://github.com/freedomotic/freedomotic/tree/master/plugins/devices/restapi-v3/src/main/java/com/freedomotic/plugins/devices/restapiv3
To try it start Freedomotic and point your browser to http://localhost:9111.

In the first prototype of this client we used Retrofit and Robospice.

They should be updated to the last version and the code properly changed.
Alternatively you can propose a better solution (if so) with the same goal: interacting with our APIs and receiving updates from backend (for example when an object changes its state).

@mcicolella
Copy link
Contributor Author

@paulnunezm @paynemiller92 what do you think?

@paynemiller92
Copy link

If version 3 of the Freedomotic API is stable and ready for consumption, I say let's just plug it in and update the app accordingly. Do we have sample requests and responses for each endpoint contained within the API?

I definitely say we continue to use Retrofit and my recommendation is that we use RxJava for event and stream handling.

@paulnunezm
Copy link
Contributor

I'll go with @paynemiller92, Retrofit+RxJava or RxKotlin would be great for this.

@mcicolella
Copy link
Contributor Author

mcicolella commented Oct 26, 2017

@paynemiller92 @paulnunezm the API is available and all the doc is served by Swagger. So you have to download the last dailybuild from http://teamcity.jetbrains.com/guestAuth/repository/download/bt1177/.lastSuccessful/freedomotic-5.6.0-%7Bbuild.number%7D.zip, run it and point your browser to http://localhost:9111/
Default credentials are admin/admin.
Thanks a lot for your support.

@paynemiller92
Copy link

@mcicolella Thank you for the info!

@mcicolella
Copy link
Contributor Author

@paynemiller92 I just merged your PR. Sorry but our public API demo isn't available. I updated the docs. You need to work with a local installation of Freedomotic.
Anyway the framework is intended to be independent from cloud services.
Thanks

@paynemiller92
Copy link

@mcicolella That's a bummer. Is there any way we as contributors can get a development environment set up? We really need to have the ability to validate successful and unsuccessful API calls. It would really be unfortunate if every developer had to stand up their own database and connect it to their own unique instance of the Freedomotic API.

@ubaldop
Copy link

ubaldop commented Oct 27, 2017

@paynemiller92 I guess is enough just downloading and launch the daily build available here. It starts a local API server responding at port 9111. No hussle in creating any local DB then.

@paynemiller92
Copy link

@p3trur0 At least for me, when I launch the API locally, no data exists, which makes it difficult to create a similar environment that our users will have. Also, it's best to not call localhost from Android apps. Emulators may work, with some tweaking, but physical devices cannot connect to a localhost api.

@paulnunezm
Copy link
Contributor

@paynemiller92 @mcicolella I know there's a way to test to mock the results for a non-release environment using mockwebserver and retrofit but we still need to know how is the response going to be like to create the models.

@mcicolella
Copy link
Contributor Author

@paynemiller92 @paulnunezm I don't know why you can't access APIs locally. Anyway there is a temporarly online demo at http://104.236.92.231:9111/

@mcicolella
Copy link
Contributor Author

@paynemiller92 @paulnunezm have you tried the online demo?

@paynemiller92
Copy link

@mcicolella Yes, it appears to be functioning properly! I will start integrating some endpoints.

@mcicolella
Copy link
Contributor Author

@paynemiller92 are you still on this?

@paynemiller92
Copy link

@mcicolella Sorry, took a few months off to due my 9-5 coding obligations! Is this issue still open?

@mcicolella
Copy link
Contributor Author

Yes it is open.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

4 participants