Description: Android library for Argon API
To start using the Argon SDK you first need to do:
Copy the argonsdk.jar to your project libs folder
Steps needed to initialize the sdk ####Setup Argon SDK credentials: public class YourApplication extends Application { ... @Override public void onCreate(){ super.onCreate(); ... ArgonSDK.setCredentials(this, YOUR_ARGON_ACCES_TOKKEN, YOUR_ARGON_CLIENT_ID, YOUR_ARGON_CLIENT_SECRET); ... } }
In the project manifest:
...
<application
android:name=".YourApplication"
...
In your Activity/Fragment file run the following to types of AsyncRequest to access the API calls:
Ex:
ArgonSDK.registerUser(context, argonUser, new IOnPreExecuteCallback(), new IOnFinishWithUserCallback(), new IOnExceptionCallback());
argonUser - an instance of the ArgonUser Object class - in this object you can set the register parameters of the user.
Ex:
ArgonSDK.loginUser(context, basicUserFields, new IOnPreExecuteCallback(), new IOnFinishWithUserCallback(), new IOnExceptionCallback());
basicUserFields - and Instance of BasicUserFields, this Object has screenname and password fields needed to login. Login request returns an ArgonUserResponse object.
Ex:
ArgonSDK.getUser(context, argonUser, new IOnPreExecuteCallback(), new IOnFinishWithUserCallback(), new IOnExceptionCallback());
argonUser - an instance of the ArgonUser Object class - in this object you can set the get information parameters of the user.
Ex:
ArgonSDK.updateUser(context, argonUser, new IOnPreExecuteCallback(), new IOnFinishWithUserCallback(), new IOnExceptionCallback());
argonUser - an instance of the ArgonUser Object class - in this object you can set the update parameters of the user.
Ex:
ArgonSDK.getScreenNameSuggestion(context, screenName, new IOnPreExecuteCallback(), new IOnFinishWithSuggestionCallback(), new IOnExceptionCallback());
screenName - the username that the user wants to use.
Checks if the user is available
Ex:
ArgonSDK.getScreenNameAvailability(context, screenName, new IOnPreExecuteCallback(), new IOnFinishWithAvailabilityCallback(), new IOnExceptionCallback());
screenName - the username that the user wants to use.
List topics from server
Ex:
ArgonSDK.listTopics(context, offset, limit, new IOnPreExecuteCallback(), new IOnFinishWithTopicCallback(), new IOnExceptionCallback());
offset - number of entries to skip.
limit - number of topics in request (min 0, max 100, default:10)
List single topic from server
Ex:
ArgonSDK.listSingleTopic(context, topic, new IOnPreExecuteCallback(), new IOnFinishWithTopicCallback(), new IOnExceptionCallback());
topic - instance of Topic Object containing the information to list
Create topic
Ex:
ArgonSDK.createTopic(context, topic, new IOnPreExecuteCallback(), new IOnFinishWithTopicCallback(), new IOnExceptionCallback());
topic - instance of Topic Object containing the information to create the topic
Update topic
Ex:
ArgonSDK.updateTopic(context, topic, new IOnPreExecuteCallback(), new IOnFinishWithTopicCallback(), new IOnExceptionCallback());
topic - instance of Topic Object containing the information to update the topic
Lookup for a topic
Ex:
ArgonSDK.topicUrlLookup(context, topic, new IOnPreExecuteCallback(), new IOnFinishWithTopicCallback(), new IOnExceptionCallback());
topic - instance of Topic Object containing the information to lookup for the topic
Delete a specific topic
Ex:
ArgonSDK.deleteTopic(context, topicId, new IOnPreExecuteCallback(), new IOnFinishWithTopicCallback(), new IOnExceptionCallback());
topicId - the topic id that you want to delete.
Undelete a specific topic
Ex:
ArgonSDK.undeleteTopic(context, topic, new IOnPreExecuteCallback(), new IOnFinishWithTopicCallback(), new IOnExceptionCallback());
topic - instance of Topic Object containing the information to undelete the specific topic
List topics from server
Ex:
ArgonSDK.listComments(context, comment, new IOnPreExecuteCallback(), new IOnFinishWithTopicCallback(), new IOnExceptionCallback());
comment - instance of Comment object, lists the comments specified in the comment topic id togheter with the limit and offset provided
List single comment from server
Ex:
ArgonSDK.listSingleComment(context, comment, new IOnPreExecuteCallback(), new IOnFinishWithTopicCallback(), new IOnExceptionCallback());
comment - instance of Comment object, lists the comment specified in the comment topic id togheter with the comment id
Create comment
Ex:
ArgonSDK.createComment(context, comment, new IOnPreExecuteCallback(), new IOnFinishWithTopicCallback(), new IOnExceptionCallback());
comment - instance of Comment Object containing the information to create the comment for the specified topic id
Delete a specific comment
Ex:
ArgonSDK.deleteComment(context, comment, new IOnPreExecuteCallback(), new IOnFinishWithTopicCallback(), new IOnExceptionCallback());
Undelete a specific comment
Ex:
ArgonSDK.undeleteComment(context, comment, new IOnPreExecuteCallback(), new IOnFinishWithTopicCallback(), new IOnExceptionCallback());
Lists scoredPoints for a specific user
Ex:
ArgonSDK.listScorePoints(context, limit, offset, new IOnPreExecuteCallback(), new IOnFinishWithTopicCallback(), new IOnExceptionCallback());
Make an unkown call to the server. The call is not documented in the standard api
Ex:
ArgonSDK.unkownCall(context, unkownObject, new IOnPreExecuteCallback(), new IOnFinishWithTopicCallback(), new IOnExceptionCallback());
- unkownObject - an instance of UnkownObject, here you provide the type of call by setting the apiMethod, json information by setting callObject. Togheter with this you have to provide an url for the callUp and the userToken if needed in the request.
Reset user password. This sends a sms message to the user on the phone number he registered with. To reset password you can use the screenName or the phone number
Ex:
ArgonSDK.resetPassword(context, screenName, new IOnPreExecuteCallback(), new IOnFinishWithResetCallback(), new IOnExceptionCallback());
ArgonSDK.resetPassword(context, phoneNumber, new IOnPreExecuteCallback(), new IOnFinishWithResetCallback(), new IOnExceptionCallback());
- screenName - user screen name.
- phoneNumber - user phone number.
Resets the password on the server with the received token
Ex:
ArgonSDK.resetPasswordWithToken(context, token, password, passwordConfirmation, new IOnPreExecuteCallback(), new IOnFinishWithResetWithTokenCallback(), new IOnExceptionCallback());
- screenName - user screen name.
- phoneNumber - user phone number.
The caller callback for the IOnFinishWithResetWithTokenCallback (caller.response) returns an argonUser object