Android Open Source - OOB-Sample-App Do Request






From Project

Back to project page OOB-Sample-App.

License

The source code is released under:

GNU General Public License

If you think the Android project OOB-Sample-App 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 com.example.oobexampleapp;
/*from w w w. j  av a 2s  . c  o  m*/
/** Copyright 2014 Dr Richard Wallace */

import java.io.IOException;

import android.os.AsyncTask;
import android.util.Log;

public class DoRequest extends AsyncTask<String, Void, String> {
    private final MainActivity main;
    private static final String TAG = "PandorabotsTalkAPIDemo";
    public static String botname = // insert botname here
  PandorabotsAPI pApi;
    
    public DoRequest(MainActivity main, String clientName) {
        super();
        this.main = main;
        this.pApi = new PandorabotsAPI(MagicParameters.hostname, MagicParameters.username, MagicParameters.userkey, clientName);
    }
   
    @Override
    protected String doInBackground(String... strings) {
        return pApi.talk(botname, strings[0]);
    }
    @Override
    protected void onPostExecute(String result) {
      main.processBotResponse(result);
    }
}




Java Source Code List

com.example.oobexampleapp.DoRequest.java
com.example.oobexampleapp.MagicParameters.java
com.example.oobexampleapp.MainActivity.java
com.example.oobexampleapp.OOBProcessor.java
com.example.oobexampleapp.PandorabotsAPI.java