IMPORTANT: This API Client can only be used if you already have an application registered at dev.xing.com
- Meaning you are already in posession of a ConsumerKey + ConsumerSecret pair since it is no longer possible to register a new application.
Add all the power of the XING platform to your app.
This library provides a java implementation of a network layer infrastructure required to access the XING Web Services.
It's center class the XingApi
allows users to access resources that reflect the XING API public, documentation for
which can be found here.
Add the XING API Client as a dependency:
Either through Gradle:
compile 'com.xing.api:api-client:x.y.z'
or by using Maven:
<dependency>
<groupId>com.xing.api</groupId>
<artifactId>api-client</artifactId>
<version>x.y.z</version>
</dependency>
For Android we made an additional step and implemented an oauth helper library, to simplify Login with XING implementation in your app. To benefit from this library just add the following dependency in you gradle build file:
compile 'com.xing.api:android-oauth:x.y.z'
Snapshots of the development version are available in Sonatype's snapshots
repository.
Add your OAuth Consumer Key and OAuth Consumer Secret to your project.
The OAuth information can be obtained after registering a new app on https://dev.xing.com/applications
oauth_consumer_secret=xxxxxxxxxxxxxxxxxxxx
oauth_consumer_key=yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy
sdk.dir=/path/to/sdk
You are also free to provide this information in any other way. For example using Preferences or a helper class containing the API credentials as CONSTANTS.
To build your Android app with the XING API Client check out the Get started page
The XING API Client is fully based on the Okio stack. We use OkHttp for networking, Moshi for Json parsing, and the request building/execution system is a fork of Retrofit.
If you are using Retrofit as an HTTP client, you will find this api to be very
familiar.
Here are somme key differences and similarities are:
XingApi
- This class acts as a key entry point and resource provider (Similar toRetrofit
in Retrofit 2.)Resource
- Namespace/Api provider class. We try to reflect the public api documentation in such a way that every resource section will have it's ownResource
class implementation.CallSpec<RT, ET>
- Similar toCall<T>
in Retrofit, but with a few key deference's:CallSpec
is aware of both return typesRT
for success andET
for error responses. And will parse them out of the box.CallSpec
allows users to alter the underlying request to a certain degree (you can add query or form params, as well as completely change the request body. This will become useful for those who want to benefit form optional request parameters accepted by XING WEB Services.- In addition to
#execute()
and#enqueue()
methodsCallSpec
provides#stream()
and#rawStream()
if you are into RxJava (WARNING: usage of these methods will require you to have RxJava in your classpath).
If you have an idea how to improve this library, feel free to either suggest your idea using the issues, or send us a Pull Request. If you do the latter please make sure you observe the rules for contributing below.
- Fork this repository.
- Create your feature branch (git checkout -b my-new-feature).
- Commit your changes (git commit -am 'Add some feature').
- Make sure to cover your new feature with sufficient unit tests.
- Create a new Pull Request.
- Wait for us to review your feature, discuss internal and eventually accept your Pull Request.
- Enjoy using your feature inside the XING API Client.
If you have any problems or feedback, feel free to contact us:
- OkHttp
- Moshi
- RxJava (Required if you use
#stream()
or#rawStream()
). - Signpost (Required by
android-oauth
artifact)
Copyright (C) 2016 XING AG (http://xing.com/)
Licensed 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 at
http://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.