In my app I need to pull text from this website. http://www.cellphonesolutions.net/help-en-lite
Notice how its a very large file. When I try to pull the text it doesn't get the first half of the text. Is there a limit to the amount of characters a textview can hold? if so how do I go around this problem. Here is the code I use to gather the text.
//in the oncreate method
TextView faq = (TextView) findViewById(R.id.tvfaq);
faq.setText((Html.fromHtml(
cleanhtml(getText("http://www.cellphonesolutions.net/help-en-lite)
)));
This clears up the comments that Html.fromHtml doesn't filter out
public String cleanhtml(String original) {
String finalText = original.replaceAll("<![^>]*>", "");
return finalText;
}
This is how I get the text from the website
public String getText(String uri) {
HttpClient client1 = new DefaultHttpClient();
HttpGet request = new HttpGet(uri);
ResponseHandler<String> responseHandler = new BasicResponseHandler();
try {
String response_str = client1.execute(request, responseHandler);
return response_str;
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
return "";
}
}
Here is my xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout android:background="@drawable/splash_fade"
xmlns:android="http://schemas.android.com/apk/res/android"
android:orientation="vertical" android:layout_width="fill_parent"
android:layout_height="fill_parent">
<ScrollView android:layout_width="fill_parent" android:layout_height="wrap_content">
<TextView android:layout_gravity="center" android:text="TextView" android:gravity="center"
android:id="@+id/tvfaq" android:layout_width="wrap_content" android:textColor="#000000"
android:layout_height="wrap_content"></TextView>
</ScrollView>
</LinearLayout>