[android-developers] How to handle large HTTPS server XML-RPC response

2011-06-22 Thread naveen kumar
i am getting large response of https server. i am not able to store
complete response in string variable, there fore i am witting the file
by using fileoutputstrem, it's takes more time for write on file and
parse them.

Please fix this issue in android also.


thanks,
Naveen Kumar

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] How to handle large HTTPS server XML-RPC response

2011-06-22 Thread Kumar Bibek
Parse the stream using XMLPullParser if it's an XML.

If not, then, there is not other way. Saving to string first for such a
large response is not good.

*Thanks and Regards,
Kumar Bibek*
*
http://techdroid.kbeanie.com
http://www.kbeanie.com*



On Wed, Jun 22, 2011 at 7:35 PM, naveen kumar
kumarnaveen.si...@gmail.comwrote:

 i am getting large response of https server. i am not able to store
 complete response in string variable, there fore i am witting the file
 by using fileoutputstrem, it's takes more time for write on file and
 parse them.

 Please fix this issue in android also.


 thanks,
 Naveen Kumar

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] How to handle large HTTPS server XML-RPC response

2011-06-22 Thread NaveenShrivastva
On Wed, Jun 22, 2011 at 7:37 PM, Kumar Bibek coomar@gmail.com wrote:

 Parse the stream using XMLPullParser if it's an XML.

 If not, then, there is not other way. Saving to string first for such a
 large response is not good.

 *Thanks and Regards,
 Kumar Bibek*
 *
 http://techdroid.kbeanie.com
 http://www.kbeanie.com*



 On Wed, Jun 22, 2011 at 7:35 PM, naveen kumar kumarnaveen.si...@gmail.com
  wrote:

 i am getting large response of https server. i am not able to store
 complete response in string variable, there fore i am witting the file
 by using fileoutputstrem, it's takes more time for write on file and
 parse them.

 Please fix this issue in android also.


 thanks,
 Naveen Kumar

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en


  --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en


i am Parsing file by XMLPullParser.it's take approx 10mints, i want time
perforate, when tring to store in string then outofmemory exception,so
writing in file, then parsing the file, give me idea for imporve the time
performance ,

-- 
Naveen Shrivastava
BCA+MCA(LAST SEM)+O/A/B Level(DOEACC SOCITY IT GOVT INDIA)

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] How to handle large HTTPS server XML-RPC response

2011-06-22 Thread Kumar Bibek
Are you parsing stream or string?

*Thanks and Regards,
Kumar Bibek*
*
http://techdroid.kbeanie.com
http://www.kbeanie.com*



On Wed, Jun 22, 2011 at 7:45 PM, NaveenShrivastva 
kumarnaveen.si...@gmail.com wrote:



 On Wed, Jun 22, 2011 at 7:37 PM, Kumar Bibek coomar@gmail.com wrote:

 Parse the stream using XMLPullParser if it's an XML.

 If not, then, there is not other way. Saving to string first for such a
 large response is not good.

 *Thanks and Regards,
 Kumar Bibek*
 *
 http://techdroid.kbeanie.com
 http://www.kbeanie.com*



 On Wed, Jun 22, 2011 at 7:35 PM, naveen kumar 
 kumarnaveen.si...@gmail.com wrote:

 i am getting large response of https server. i am not able to store
 complete response in string variable, there fore i am witting the file
 by using fileoutputstrem, it's takes more time for write on file and
 parse them.

 Please fix this issue in android also.


 thanks,
 Naveen Kumar

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en


  --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en


 i am Parsing file by XMLPullParser.it's take approx 10mints, i want time
 perforate, when tring to store in string then outofmemory exception,so
 writing in file, then parsing the file, give me idea for imporve the time
 performance ,

 --
 Naveen Shrivastava
 BCA+MCA(LAST SEM)+O/A/B Level(DOEACC SOCITY IT GOVT INDIA)

  --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en


-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en

Re: [android-developers] How to handle large HTTPS server XML-RPC response

2011-06-22 Thread NaveenShrivastva
On Wed, Jun 22, 2011 at 7:48 PM, Kumar Bibek coomar@gmail.com wrote:

 Are you parsing stream or string?


 *Thanks and Regards,
 Kumar Bibek*
 *
 http://techdroid.kbeanie.com
 http://www.kbeanie.com*



 On Wed, Jun 22, 2011 at 7:45 PM, NaveenShrivastva 
 kumarnaveen.si...@gmail.com wrote:



 On Wed, Jun 22, 2011 at 7:37 PM, Kumar Bibek coomar@gmail.comwrote:

 Parse the stream using XMLPullParser if it's an XML.

 If not, then, there is not other way. Saving to string first for such a
 large response is not good.

 *Thanks and Regards,
 Kumar Bibek*
 *
 http://techdroid.kbeanie.com
 http://www.kbeanie.com*



 On Wed, Jun 22, 2011 at 7:35 PM, naveen kumar 
 kumarnaveen.si...@gmail.com wrote:

 i am getting large response of https server. i am not able to store
 complete response in string variable, there fore i am witting the file
 by using fileoutputstrem, it's takes more time for write on file and
 parse them.

 Please fix this issue in android also.


 thanks,
 Naveen Kumar

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to
 android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en


  --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en


 i am Parsing file by XMLPullParser.it's take approx 10mints, i want time
 perforate, when tring to store in string then outofmemory exception,so
 writing in file, then parsing the file, give me idea for imporve the time
 performance ,

 --
 Naveen Shrivastava
 BCA+MCA(LAST SEM)+O/A/B Level(DOEACC SOCITY IT GOVT INDIA)

  --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en


  --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en



Sir,

writing server response using fileoutputstream

FileOutputStream fileOutputStream = null;
try {
fileOutputStream = new FileOutputStream(
sdImageMainDirectory.toString() + / + test.xml,
true);
// fileOutputStream =null;
} catch (FileNotFoundException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
BufferedOutputStream bos = new BufferedOutputStream(
fileOutputStream);

try {
InputStreamReader resultInputStream = new InputStreamReader(
conn.getInputStream());
BufferedReader rd = new BufferedReader(resultInputStream);
String line;

while ((line = rd.readLine()) != null) {
by_new = line.getBytes();
// st=st+new String(line);

try {
fileOutputStream.write(by_new, 0, by_new.length);
fileOutputStream.flush();

} catch (IOException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}

Log.i(Huzza, RES Message:  + line);
}
fileOutputStream.close();
rd.close();
resultInputStream.close();
} catch (IOException ioex) {

Log.e(Huzza, error:  + ioex.getMessage(), ioex);
}


then parsing the file
public Object ParsingResponse(String responsData) throws XMLRPCException {
System.out.print(##);
String path = Environment.getExternalStorageDirectory() +
/test.xml;
File file = new File(path);
XMLRPCCommon obj1 = new XMLRPCCommon();

try {
fis = new FileInputStream(file);
// setup pull parser
XmlPullParser pullParser =
XmlPullParserFactory.newInstance().newPullParser();
Reader reader;
responsData = ;

Re: [android-developers] How to handle large HTTPS server XML-RPC response

2011-06-22 Thread Kumar Bibek
IF the data is big, it would of course take time.

You could do some debugging, to figure out which part of your code is taking
so much time.

That would help you in figuring out the actual problem.

*Thanks and Regards,
Kumar Bibek*
*
http://techdroid.kbeanie.com
http://www.kbeanie.com*



On Wed, Jun 22, 2011 at 7:57 PM, NaveenShrivastva 
kumarnaveen.si...@gmail.com wrote:



 On Wed, Jun 22, 2011 at 7:48 PM, Kumar Bibek coomar@gmail.com wrote:

 Are you parsing stream or string?


 *Thanks and Regards,
 Kumar Bibek*
 *
 http://techdroid.kbeanie.com
 http://www.kbeanie.com*



 On Wed, Jun 22, 2011 at 7:45 PM, NaveenShrivastva 
 kumarnaveen.si...@gmail.com wrote:



 On Wed, Jun 22, 2011 at 7:37 PM, Kumar Bibek coomar@gmail.comwrote:

 Parse the stream using XMLPullParser if it's an XML.

 If not, then, there is not other way. Saving to string first for such a
 large response is not good.

 *Thanks and Regards,
 Kumar Bibek*
 *
 http://techdroid.kbeanie.com
 http://www.kbeanie.com*



 On Wed, Jun 22, 2011 at 7:35 PM, naveen kumar 
 kumarnaveen.si...@gmail.com wrote:

 i am getting large response of https server. i am not able to store
 complete response in string variable, there fore i am witting the file
 by using fileoutputstrem, it's takes more time for write on file and
 parse them.

 Please fix this issue in android also.


 thanks,
 Naveen Kumar

 --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to
 android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en


  --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to
 android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en


 i am Parsing file by XMLPullParser.it's take approx 10mints, i want time
 perforate, when tring to store in string then outofmemory exception,so
 writing in file, then parsing the file, give me idea for imporve the time
 performance ,

 --
 Naveen Shrivastava
 BCA+MCA(LAST SEM)+O/A/B Level(DOEACC SOCITY IT GOVT INDIA)

  --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en


  --
 You received this message because you are subscribed to the Google
 Groups Android Developers group.
 To post to this group, send email to android-developers@googlegroups.com
 To unsubscribe from this group, send email to
 android-developers+unsubscr...@googlegroups.com
 For more options, visit this group at
 http://groups.google.com/group/android-developers?hl=en



 Sir,

 writing server response using fileoutputstream

 FileOutputStream fileOutputStream = null;
 try {
 fileOutputStream = new FileOutputStream(
 sdImageMainDirectory.toString() + / + test.xml,
 true);
 // fileOutputStream =null;
 } catch (FileNotFoundException e) {
 // TODO Auto-generated catch block
 e.printStackTrace();
 }
 BufferedOutputStream bos = new BufferedOutputStream(
 fileOutputStream);

 try {
 InputStreamReader resultInputStream = new
 InputStreamReader(
 conn.getInputStream());
 BufferedReader rd = new BufferedReader(resultInputStream);
 String line;

 while ((line = rd.readLine()) != null) {
 by_new = line.getBytes();
 // st=st+new String(line);

 try {
 fileOutputStream.write(by_new, 0, by_new.length);
 fileOutputStream.flush();

 } catch (IOException e) {
 // TODO Auto-generated catch block
 e.printStackTrace();
 }

 Log.i(Huzza, RES Message:  + line);
 }
 fileOutputStream.close();
 rd.close();
 resultInputStream.close();
 } catch (IOException ioex) {

 Log.e(Huzza, error:  + ioex.getMessage(), ioex);
 }


 then parsing the file
 public Object ParsingResponse(String responsData) throws XMLRPCException {
 System.out.print(##);
 

Re: [android-developers] How to handle large HTTPS server XML-RPC response

2011-06-22 Thread TreKing
On Wed, Jun 22, 2011 at 9:27 AM, NaveenShrivastva 
kumarnaveen.si...@gmail.com wrote:

 But taking more time approx 10minutes.


You're reading a huge chunk of data, writing it to a file, then turning
around and reading the data back a second time. Why would this be fast?


 i want reduce time here.

 please help me.


Kumar gave you the answer in the very first response: Parse the stream
using XMLPullParser if it's an XML.

-
TreKing http://sites.google.com/site/rezmobileapps/treking - Chicago
transit tracking app for Android-powered devices

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en