온라인 데이터베이스에서 사용자 목록을 얻는 것과 관련된 j2me 프로젝트에서 작업 중이므로 목록의 사용자 이름을 채우기 위해 숫자가 매우 커질 수 있습니다. . 내 질문은 - 당신이 목록에 추가 할 수있는 항목의 수에 제한이 있습니까?J2ME 목록의 최대 항목 수
HttpConnection hc = (HttpConnection);
String reply;
Connector.open("http://www.xxxxxxxxxxxx.com/......?xx=xx");
InputStream is = new hc.openInputStream();
int ch;
// Check the Content-Length first
long len = hc.getLength();
if(len!=-1) {
for(int i = 0;i<len;i++)
if((ch = is.read())!= -1)
reply += (char) ch;
} else {
// if the content-length is not available
while ((ch = is.read()) != -1)
reply += (char) ch;
}
is.close();
hc.close();
DataParser parser = new DataParser(reply); // This is a custom class I created to process the XML data returned from the server to split it into groups and put in an array.
List user list = new List("Users");
if (parser.moveToNext()) {
do {
list.append(parser.get(), null);
}
}
이 코드는 잘 동작하는 것 같지만 몇몇 예외가 발생하면 킵 호출 list.append ("", NULL을), 그것은 어쩌면의 경우, 지점에 도착한다면 내 문제는, 50,000 개의 이름 (목록 항목)?
당신이 시작한 것을 공유 할 수 있다면 개념보다는 실제 구현을 의미할까요? –
그게 내가 추가 할 수있는 최고의, 난 안드로이드 장치에서 입력이야 – francis994
그냥 테스트! for (int i = 0; i <50000; i ++) {list.append ("item"+ i);} 작동하지만 느려질 수도 있습니다. – Meier