The Official XING API client for Java/Android
If you want to keep using the SDK Client, even though it is not maintained, consider that it can only be used if you already have an application registered at dev.xing.com
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 to Retrofit
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 own Resource
class implementation.CallSpec<RT, ET>
- Similar to Call<T>
in Retrofit, but with a few key deference's:
CallSpec
is aware of both return types RT
for success and ET
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.#execute()
and #enqueue()
methods CallSpec
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.
If you have any problems or feedback, feel free to contact us:
#stream()
or #rawStream()
).android-oauth
artifact)Copyright (C) 2016 XING SE (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.