https://github.com/donglua/ZoomEye-API
ZoomEye Android API SDK.
https://github.com/donglua/ZoomEye-API
Last synced: 28 days ago
JSON representation
ZoomEye Android API SDK.
- Host: GitHub
- URL: https://github.com/donglua/ZoomEye-API
- Owner: donglua
- License: apache-2.0
- Created: 2016-04-21T15:12:33.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2016-05-05T10:22:46.000Z (about 9 years ago)
- Last Synced: 2025-03-22T18:15:56.337Z (3 months ago)
- Language: Java
- Homepage: https://www.zoomeye.org/api/doc
- Size: 118 KB
- Stars: 4
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-ip-search-engines - ZoomEye Android SDK API
README
# ZoomEye-API
ZoomEye Android API## Gradle
[](https://bintray.com/donglua/maven/zoomeye-api/_latestVersion)
```gradle
compile 'org.droiders:zoomeye-api:0.1.3'
```
## Usage
* CreateZoomEyeApiService
object
```Java
Retrofit retrofit = new Retrofit.Builder() //
.client(client) //
.baseUrl("http://api.zoomeye.org") //
.addConverterFactory(GsonConverterFactory.create(gson)) //
.addCallAdapterFactory(RxJavaCallAdapterFactory.create()) //
.build();
ZoomEyeApiService api = retrofit.create(ZoomEyeApiService.class);
```
* Request and error handle
```java
ErrorBodyHandler errorHandler = new ErrorBodyHandler(retrofit);api.login(new LoginRequest(username, password))
.observeOn(AndroidSchedulers.mainThread())
.subscribe(tokenResponse -> {
if (tokenResponse.isSuccessful()) {
String accessToken = tokenResponse.body().toString();
Log.d("ZoomEye", "accessToken = " + accessToken);
...
} else {
ErrorBody errorBody = errorHandler.parseError(tokenResponse.errorBody());
Log.d("ZoomEye", errorBody.getMessage());
...
}
});
```
## App* [ZoomEyeAndroid](https://github.com/donglua/ZoomEyeAndroid)
## License
```
Copyright 2016 Huang DongluLicensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License athttp://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.```