Step 1. Add the JitPack repository to your build file
Add it in your root settings.gradle at the end of repositories:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url 'https://jitpack.io' }
}
}
Add it in your settings.gradle.kts at the end of repositories:
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
mavenCentral()
maven { url = uri("https://jitpack.io") }
}
}
Add to pom.xml
<repositories>
<repository>
<id>jitpack.io</id>
<url>https://jitpack.io</url>
</repository>
</repositories>
Add it in your build.sbt at the end of resolvers:
resolvers += "jitpack" at "https://jitpack.io"
Add it in your project.clj at the end of repositories:
:repositories [["jitpack" "https://jitpack.io"]]
Step 2. Add the dependency
dependencies {
implementation 'com.github.mgarciaguerrero:Instagram-Android-API:0.0.1'
}
dependencies {
implementation("com.github.mgarciaguerrero:Instagram-Android-API:0.0.1")
}
<dependency>
<groupId>com.github.mgarciaguerrero</groupId>
<artifactId>Instagram-Android-API</artifactId>
<version>0.0.1</version>
</dependency>
libraryDependencies += "com.github.mgarciaguerrero" % "Instagram-Android-API" % "0.0.1"
:dependencies [[com.github.mgarciaguerrero/Instagram-Android-API "0.0.1"]]
Instagram API Platform has been deprecated. Check Instagram developers and Platform Changelog for further information.
Android wrapper for the Instagram API (Work in progress...)
Add it in your root build.gradle at the end of repositories:
allproject{
repositories {
...
maven { url "https://jitpack.io" }
}
}
Add the following dependency to your build.gradle:
dependencies {
compile 'com.github.mgarciaguerrero:Instagram-Android-API:0.0.1'
}
You can also do it manually, by downloading the source code, importing the library folder as an Android Library Module, and adding a dependency on your project to that module.
To get started, you will need to register an application with Instagram. They will provide you with a client id, and a client secret. They will additionally ask you for a callback URL. This is simply a URL that your browser will redirect back to during the Instagram Auth flow.
On your application class, use this snippet:
@Override
public void onCreate() {
super.onCreate();
//Init InstagramManager with context application
InstagramManager.init(getApplicationContext());
}
<application>
...
<meta-data
android:name="instagram.ClientId"
android:value="YOUR_INSTAGRAM_CLIENT_ID" />
<meta-data
android:name="instagram.ClientSecret"
android:value="YOUR_INSTAGRAM_CLIENT_SECRET" />
<meta-data
android:name="instagram.RedirectUrl"
android:value="YOUR_INSTAGRAM_REDIRECT_URL" />
</application>
To use this library you just need to use InstagramManager. This library has been builded following The Instagram API Platform.
The Instagram API requires authentication but it is automatically managed by the library.
[TODO] -- add an example
[TODO] -- add an example
All endpoints are available in InstagramManager and have been builded following the instagram documentation.
[TODO] -- retrofit
[TODO] -- add an example
Special thanks to Jorge Guerrero for their thoughts and code.
Any contribution in order to make this library better will be welcome!
Copyright 2016 Marc Garcia Guerrero
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.