Android Open Source - gm-httpengine-studio Main Activity






From Project

Back to project page gm-httpengine-studio.

License

The source code is released under:

GNU Lesser General Public License

If you think the Android project gm-httpengine-studio 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 org.gemini.httpengine.examples;
/*from  w  ww  .ja v a  2  s  . c  om*/
import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
import android.view.Menu;
import android.view.MenuItem;
import android.view.View;
import android.widget.Button;
import android.widget.Toast;

import org.gemini.httpengine.library.GMHttpParameters;
import org.gemini.httpengine.library.GMHttpRequest;
import org.gemini.httpengine.library.GMHttpResponse;
import org.gemini.httpengine.library.GMHttpService;
import org.gemini.httpengine.library.OnResponseListener;


public class MainActivity extends Activity implements View.OnClickListener,OnResponseListener{

    private Button mTestButton;
    private LoginAPI mLoginAPI;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        mTestButton = (Button)findViewById(R.id.test_btn);
        mTestButton.setOnClickListener(this);
        mLoginAPI = new LoginAPI();
    }

    @Override
    public void onClick(View v) {
        if(v == mTestButton) {
            mLoginAPI.login(null, null, this);
        }
    }

    @Override
    public void onResponse(GMHttpResponse response, GMHttpRequest request) {
        String result = null;
        try {
            result = response.parseAsString();
            Log.d("test", result);
        } catch (Exception e) {
            result = "no content";
        }

//        Toast.makeText(this,result,Toast.LENGTH_LONG).show();
    }
}




Java Source Code List

org.gemini.httpengine.examples.LoginAPI.java
org.gemini.httpengine.examples.MainActivity.java
org.gemini.httpengine.library.Config.java
org.gemini.httpengine.library.FormUrlEncodedParser.java
org.gemini.httpengine.library.GMHttpEngine.java
org.gemini.httpengine.library.GMHttpException.java
org.gemini.httpengine.library.GMHttpLoader.java
org.gemini.httpengine.library.GMHttpMethodExecutor.java
org.gemini.httpengine.library.GMHttpParameters.java
org.gemini.httpengine.library.GMHttpRequest.java
org.gemini.httpengine.library.GMHttpResponse.java
org.gemini.httpengine.library.GMHttpResult.java
org.gemini.httpengine.library.GMHttpService.java
org.gemini.httpengine.library.GMModelParser.java
org.gemini.httpengine.library.GMTrustManager.java
org.gemini.httpengine.library.HttpMethod.java
org.gemini.httpengine.library.HttpParameter.java
org.gemini.httpengine.library.HttpRequestParser.java
org.gemini.httpengine.library.HttpResponseParser.java
org.gemini.httpengine.library.LOG.java
org.gemini.httpengine.library.MultiPartParser.java
org.gemini.httpengine.library.MultipartEntity.java
org.gemini.httpengine.library.OnProgressUpdateListener.java
org.gemini.httpengine.library.OnResponseListener.java