![]() |
Chilkat HOME Android™ AutoIt C C# C++ Chilkat2-Python CkPython Classic ASP DataFlex Delphi DLL Go Java Node.js Objective-C PHP Extension Perl PowerBuilder PowerShell PureBasic Ruby SQL Server Swift Tcl Unicode C Unicode C++ VB.NET VBScript Visual Basic 6.0 Visual FoxPro Xojo Plugin
(Android™) Setting a HTTP Max Response SizeDemonstrates the
// Important: Don't forget to include the call to System.loadLibrary // as shown at the bottom of this code sample. package com.test; import android.app.Activity; import com.chilkatsoft.*; import android.widget.TextView; import android.os.Bundle; public class SimpleActivity extends Activity { private static final String TAG = "Chilkat"; // Called when the activity is first created. @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); boolean success = false; CkHttp http = new CkHttp(); int maxSz = 16384; http.put_MaxResponseSize(maxSz); // Try to get something larger, such as hamlet.xml which is 279658 bytes String xmlStr = http.quickGetStr("https://chilkatsoft.com/hamlet.xml"); if (http.get_LastMethodSuccess() == false) { // If the LastErrorText contains the string "MaxResponseSize", // then the HTTP request failed because the response body would've been larger than the max allowed response size. Log.i(TAG, http.lastErrorText()); return; } Log.i(TAG, "OK"); } static { System.loadLibrary("chilkat"); // Note: If the incorrect library name is passed to System.loadLibrary, // then you will see the following error message at application startup: //"The application <your-application-name> has stopped unexpectedly. Please try again." } } |
© 2000-2025 Chilkat Software, Inc. All Rights Reserved.