Android StatusLine - top ranked examples from Open Source projects

These code examples were ranked by Codota’s semantic indexing as the best open source examples for Android StatusLine class.

This code example shows how to use the following methods: getReasonPhrase, getStatusCode
//      request.addHeader("x-wap-profile", "http://www.htcmms.com.tw/Android/Common/nexusone/ua-profile.xml"); 
      request.addHeader("x-wap-profile", "http://www.google.com/oha/rdf/ua-profile-kila.xml");
      HttpResponse response = client.execute(target, request);
      StatusLine status     = response.getStatusLine();
 
      if (status.getStatusCode() != 200)
        throw new IOException("Non-successful HTTP response: " + status.getReasonPhrase());
 
      return parseResponse(response.getEntity());
    } catch (URISyntaxException use) {
      Log.w("MmsSendHelper", use);
      throw new IOException("Couldn't parse URI.");
    } finally { 
      if (client != null)
        client.close();
    } 
  } 
 
  public static SendConf sendMms(Context context, byte[] mms, String apn,
                                 boolean usingMmsRadio, boolean useProxyIfAvailable)
Full Snippet Info
8
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: getStatusCode
                    "x-wap-profile", 
                    "http://www.openmobilealliance.org/tech/profiles/UAPROF/ccppschema-20021212#"); 
 
            HttpResponse response = client.execute(req);
            StatusLine status = response.getStatusLine();
            if (status.getStatusCode() != 200) { // HTTP 200 is success.
                if (DEBUG) Log.d(TAG, "HTTP error: " + status.getReasonPhrase());
                return null; 
            } 
 
            HttpEntity entity = response.getEntity();
            byte[] body = null;
            if (entity != null) {
                try { 
                    if (entity.getContentLength() > 0) {
                        body = new byte[(int) entity.getContentLength()];
                        DataInputStream dis = new DataInputStream(entity.getContent());
                        try { 
                            dis.readFully(body);
                        } finally { 
Full Snippet Info
7
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: getReasonPhrase, getStatusCode
    private Object handleResponse(HttpResponse response) throws HttpException, IOException {
        if (response == null) {
            throw new HttpException("response is null");
        } 
        StatusLine status = response.getStatusLine();
        int statusCode = status.getStatusCode();
        if (statusCode < 300) {
            HttpEntity entity = response.getEntity();
            Object responseBody = null;
            if (entity != null) {
                lastUpdateTime = SystemClock.uptimeMillis();
                if (isDownloadingFile) {
                    String responseFileName = autoRename ? OtherUtils.getFileNameFromHttpResponse(response) : null;
                    responseBody = mFileDownloadHandler.handleEntity(entity, this, fileSavePath, autoResume, responseFileName);
                } else { 
 
                    // Set charset from response header info if it's exist. 
                    String responseCharset = OtherUtils.getCharsetFromHttpResponse(response);
                    charset = TextUtils.isEmpty(responseCharset) ? charset : responseCharset;
 

6
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: getReasonPhrase, getStatusCode
            responseBody = EntityUtils.toString(entity,"UTF-8");
        } catch(IOException e) {
            sendFailureMessage(e, null);
        } 
 
        if(status.getStatusCode() >= 300) {
            sendFailureMessage(new HttpResponseException(status.getStatusCode(), status.getReasonPhrase()), responseBody);
        } else { 
            sendSuccessMessage(responseBody);
        } 
    } 
} 
Full Snippet Info
6
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE
This code example shows how to use the following methods: getReasonPhrase
    /** 
     * @return The HTTP status message from the server 
     */ 
    public String getHttpStatusMessage ()
    { 
        return httpStatusLine == null ? null : httpStatusLine.getReasonPhrase();
    } 
 
    /** 
     * @return The version of HTTP used. 
     */ 
    public String getHttpVersion ()
    { 
        return httpStatusLine == null ? null : httpStatusLine.getProtocolVersion().toString(); 
    } 
 
} 
Full Snippet Info
6
CodeRank
Stop searching for code, let great code find you!  Add Codota to your java IDE

Related Android StatusLine Questions & Answers:

See Code Examples for Android StatusLine Methods: