Android AccountManager has a method which i've used for google oAUTH but i'd like to use it for twitter or instagram. Im not certain if these two apps work with android account manager to get Oauth token. Here is the code :
accountManager.getAuthToken(userAccount, "oauth2:" + "https://www.googleapis.com/auth/glass.timeline", null, this, new OnTokenAcquired(), null);
the onTokenAcquired is just a callback interface called AccountManagerCallBack from the account manager class in android. But my question is how to make this work for instagram or twitter ? can anyone provide an example ? would the twitter app have to already be installed ?
I do not know for sure if it is possible or not to get Twitter or Instagram tokens. But generally for it to be possible the user have to have the app installed and the app must have explicitly implemented support for it. In addition you must also know which auth token type to use. If you are unable to find any documentation about how to do this on Twitter's and Instagram's homepages it is most likely that they have no support for it.