Android Open Source - aInstagram a Instagram






From Project

Back to project page aInstagram.

License

The source code is released under:

GNU General Public License

If you think the Android project aInstagram listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package net.jackbeasley.aInstagram;
// ww  w.  ja  va  2  s  .  c  o m
import android.util.Log;

import org.jinstagram.Instagram;
import org.jinstagram.auth.InstagramApi;
import org.jinstagram.auth.InstagramAuthService;
import org.jinstagram.auth.oauth.InstagramService;

/**
 * Created by Jack on 10/9/2014.
 */
public class aInstagram {
    private Instagram instagram;
    private String apiKey;
    private String apiSecret;
    private String callbackURL;

    public aInstagram(){

    }

    /**
     *
     * @param apiKey
     * @param apiSecret
     * @param callbackURL
     */
    public aInstagram(String apiKey, String apiSecret, String callbackURL){
        setApiKey(apiKey);
        setApiSecret(apiSecret);
        setCallbackURL(callbackURL);
    }

    public void setApiKey(String apiKey){
        this.apiKey = apiKey;
    }

    public void setApiSecret(String apiSecret){
        this.apiSecret = apiSecret;
    }

    public void setCallbackURL(String callbackURL){
        this.callbackURL = callbackURL;
    }

    public boolean signIn(){
        Thread signinThread = new Thread(new Runnable() {
            @Override
            public void run() {
                InstagramService authService = new InstagramAuthService()
                        .apiKey(apiKey)
                        .apiSecret(apiSecret)
                        .callback(callbackURL)
                        .build();
            }
        });
        try{
            signinThread.join();
            signinThread.run();
        } catch (Exception e){
            Log.e("aInstagram", "Login thread interrupted");
            return false;
        }
        //No exception
        return true;
    }
}




Java Source Code List

net.jackbeasley.aInstagram.LoginDialog.java
net.jackbeasley.aInstagram.SignIn.java
net.jackbeasley.aInstagram.aInstagram.java
net.jackbeasley.ainstagram.ApplicationTest.java