开发者

android string how to hold large strings

String newpage = "<?xml version='1.0' encoding='UTF-8' standalone='yes'?>
<!DOCTYPE plist PUBLIC '-//Apple//DTD PLIST 1.0//EN' 'http://www.apple.com/DTDs/PropertyList-1.0.dtd'>
<plist version='1.0'> 
 <dict>
  <key>result</key>
<dict>
<key>balance</key>
<string>0.75</string>
<key>earned</key>
<string>0</string>
<key>imgurl</key>
<string>http://dev2.studentoffortune.com/user/djrecker/pic-large</string>
<key>mostrecent</key>
<array><dict><key>mostrecentdetails</key><dict><key>action</key><string>Solution Purchased</string><key>sid</key><string>8873</string><key>qid</key><string>6363</string><key>price</key><string>-0.25</string><key>seller</key><string>astrapp</string><key>dateforpuchase</key><string>May 16, 2011 at 9:15:03PM</string></dict></dict><dict><key>mostrecentdetails</key><dict><key>action</key><string>Solution Purchased</string><key>sid</key><string>8869</string><key>qid</key><string>6340</string><key>price</key><string>-5</string><key>seller</key><string>dstrapp</string><key>dateforpuchase</key><string>Mar. 18, 2011 at 08:20:31AM</string></dict></dict><dict><key>mostrecentdetails</key><dict><key>action</key><string>Solution Purchased</string><key>sid</key><string>8868</string><key>qid</key><string>6340</string><key>price</key><string>-5</string><key>seller</key><string>dstrapp</string><key>dateforpuchase</key><string>Mar. 18, 2011 at 08:12:04AM</string></dict></dict><dict><key>mostrecentdetails</key><dict><key>action</key><string>Solution Purchased</string><key>sid</key><string>8866</string><key>qid</key><string>6340</string><key>price</key><string>-5</string><key>seller</key><string>dstrapp</string><key>dateforpuchase</key><string>Mar. 18, 2011 at 07:46:17AM</string></dict></dict><dict><key>mostrecentdetails</key><dict><key>action</key><string>Solution Purchased</string><key>sid</key><string>8865</string><key>qid</key><string>6340</string><key>price</key><string>-5</string><key>seller</key><string>dstrapp</string><key>dateforpuchase</key><string>Mar. 18, 2011 at 07:19:14AM</string></dict></dict><dict><key>mostrecentdetails</key><dict><key>action</key><string>Solution Purchased</string><key>sid</key><string>8864</string><key>qid</key><string>6340</string><key>price</key><string>-5</string><key>seller</key><string>dstrapp</string><key>dateforpuchase</key><string>Mar. 18, 2011 at 07:14:35AM</string></dict></dict><dict><key>mostrecentdetails</key><dict><key>action</key><string>Solution Purchased</string><key>sid</key><string>8863</string><key>qid</key><string>6341</string><key>price</key><string>-5</string><key>seller</key><string>dstrapp</string><key>dateforpuchase</key><string>Mar 17, 2011 at 3:09:57PM</string></dict></dict><dict><key>mostrecentdetails</key><dict><key>action</key><string>Solution Purchased</string><key>sid</key><string>8862</string><key>qid</key><string>6341</string><key>price</key><string>-5</string><key>seller</key><string>dstrapp</string><key>dateforpuchase</key><string>Mar 17, 2011 at 3:06:44PM</string></dict></dict><dict><key>mostrecentdetails</key><dict><key>action</key><string>Solution Purchased</string><key>sid</key><string>8861</string><key>qid</key><string>6342</string><key>price</key><string>-5</string><key>seller</key><string>dstrapp</string><key>dateforpuchase</key><string>Mar 17, 2011 at 3:03:01PM</string></dict></dict><dict><key>mostrecentdetails</key><dict><key>action</key><string>Solution Purchased</string><key>sid</key><string>8860</string><key>qid</key><string>6342</string><key>price</key><string>-5</string><key>seller</key><string>dstrapp</string><key>dateforpuchase</key><string>Mar 17, 2011 at 3:00:49PM</string></dict></dict><dict><key>mostrecentdetails</key><dict><key>action</key><string>Solution Purchased</string><key>sid</key><string>8859</string><key>qid</key><string>6342</string><key>price</key><string>-5</string><key>seller</key><string>dstrapp</string><key>dateforpuchase</key><string>Mar 17, 2011 at 2:59:16PM</string></dict></dict><dict><key>mostrecentdetails</key><dict><key>action</key><string>Solution Purchased</string><key>sid</key><string>8858</string><key>qid</key><string>6342</string><key>price</key><string>-5</string><key>seller</key><string>dstrapp</string><key>dateforpuchase</key><string>Mar 17, 2011 at 2:49:10PM</string></dict></dict><dict><key>mostrecentdetails</key><dict><key>action</key><string>Solution Purchased</string><key>sid</key><string>8857</string><key>qid</key><string>6335</string><key>price</key><string>-5</string><key>seller</key><string>dstrapp</string><key>dateforpuchase</key><string>Mar 17, 2011 at 2:45:17PM</string></dict></dict><dict><key>mostrecentdetails</key><dict><key>action</key><string>Solution Purchased</string><key>sid</key><string>8856</string><key>qid</key><string>6335</string><key>price</key><string>-5</string><key>seller</key><string>dstrapp</string><key>dateforpuchase</key><string>Mar 17, 2011 at 2:35:57PM</string></dict></dict><dict><key>mostrecentdetails</key><dict><key>action</key><string>Solution Purchased</string><key>sid</key><string>8855</string><key>qid</key><string>6335</string><key>price</key><string>-5</string><key>seller</key><string>dstrapp</string><key>dateforpuchase</key><string>Mar 17, 2011 at 2:09:56PM</string></dict></dict><dict><key>mostrecentdetails</key><dict><key>action</key><string>Solution Purchased</string><key>sid</key><string>8854</string><key>qid</key><string>6335</string><key>price</key><string>-5</string><key>seller</key><string>dstrapp</string><key>dateforpuchase</key><string>Mar 17, 2011 at 2:03:18PM</string></dict></dict><dict><key>mostrecentdetails</key><dict><key>action</key><string>Solution Purchased</string><key>sid</key><string>8853</string><key>qid</key><string>6335</string><key>price</key><string>-5</string><key>seller</key><string>dstrapp</string><key>dateforpuchase</key><string>Mar 17, 2011 at 1:05:19PM</string></dict></dict><dict><key>mostrecentdetails</key><dict><key>action</key><string>Solution Purchased</string><key>sid</key><string>8852</string><key>qid</key><string>6335</string><key>price</key><string>-5</string><key>seller</key><string>dstrapp</string><key>dateforpuchase</key><string>Mar 17, 2011 at 1:00:47PM</string开发者_如何学Go></dict></dict><dict><key>mostrecentdetails</key><dict><key>action</key><string>Solution Purchased</string><key>sid</key><string>8851</string><key>qid</key><string>6335</string><key>price</key><string>-5</string><key>seller</key><string>dstrapp</string><key>dateforpuchase</key><string>Mar 16, 2011 at 2:13:41PM</string></dict></dict><dict><key>mostrecentdetails</key><dict><key>action</key><string>Solution Purchased</string><key>sid</key><string>8845</string><key>qid</key><string>6229</string><key>price</key><string>-6</string><key>seller</key><string>dstrapp</string><key>dateforpuchase</key><string>Feb 26, 2011 at 12:58:00PM</string></dict></dict><dict><key>mostrecentdetails</key><dict><key>action</key><string>Solution Purchased</string><key>sid</key><string>8842</string><key>qid</key><string>6218</string><key>price</key><string>-2</string><key>seller</key><string>aditya</string><key>dateforpuchase</key><string>Feb. 23, 2011 at 05:58:34AM</string></dict></dict><dict><key>mostrecentdetails</key><dict><key>action</key><string>Solution Purchased</string><key>sid</key><string>8837</string><key>qid</key><string>6212</string><key>price</key><string>-1</string><key>seller</key><string>SPQR</string><key>dateforpuchase</key><string>Feb 16, 2011 at 12:57:49PM</string></dict></dict></array></dict></dict></plist>";

System.out.println("page is"+newpage);

Can anyone tell me y is the full string not getting printed......


I'm using the code below do print out large output in logcat:

        int s   = 4000; //max length
        int len = line.length();

        for(int i = 0; i < (len / s); i++) {
            Log.d(TAG, (count + (i * s)) + "-" + (count + ((i + 1) * s)) + " ### " + line.substring(i * s, (i + 1) * s));
        }

        Log.d(TAG, (count + (s * (len / s))) + "-" + (count + len) + " ### " + line.substring(s * (len / s), len));
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜