Re: [android-developers] How to read the large sized text file

2012-03-17 Thread Narendra Singh Rathore
On Fri, Mar 16, 2012 at 8:18 PM, TreKing treking...@gmail.com wrote:

 You posted the exception itself. You did NOT post the exception's MESSAGE.
 I said before, if you call getMessage() on the exception object, it gives
 you a REASON WHY the generic IOException was raised.


OK, I got what you mean.

Well, I tried this to show the exception's MESSAGE --

*catch (IOException e) {
String err = (e.getMessage()==null)?No message
here:e.getMessage();
Log.e(IOException:,err);

throw new RuntimeException(e);
}*




 So, again ... what is the exception's MESSAGE?





so, here is the MESSAGE as follows:

1) *In case of using Byte Array, my message is:*

 *No message here*

 The above message indicates that *getMessage() returns NULL* here.

Now, when I used e.printStackTrace() instead of e.getMessage, I got
following result.

03-17 12:43:28.631: WARN/System.err(480): java.io.IOException
03-17 12:43:28.771: WARN/System.err(480): at
android.content.res.AssetManager.readAsset(Native Method)
03-17 12:43:28.782: WARN/System.err(480): at
android.content.res.AssetManager.access$700(AssetManager.java:36)
03-17 12:43:28.820: WARN/System.err(480): at
android.content.res.AssetManager$AssetInputStream.read(AssetManager.java:571)
03-17 12:43:28.850: WARN/System.err(480): at
com.universal.dictionary.onCreate(dictionary.java:30)
03-17 12:43:28.870: WARN/System.err(480): at
android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047)
03-17 12:43:28.870: WARN/System.err(480): at
android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2627)
03-17 12:43:28.892: WARN/System.err(480): at
android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2679)
03-17 12:43:28.892: WARN/System.err(480): at
android.app.ActivityThread.access$2300(ActivityThread.java:125)
03-17 12:43:28.920: WARN/System.err(480): at
android.app.ActivityThread$H.handleMessage(ActivityThread.java:2033)
03-17 12:43:28.920: WARN/System.err(480): at
android.os.Handler.dispatchMessage(Handler.java:99)
03-17 12:43:28.939: WARN/System.err(480): at
android.os.Looper.loop(Looper.java:123)
03-17 12:43:28.939: WARN/System.err(480): at
android.app.ActivityThread.main(ActivityThread.java:4627)
03-17 12:43:28.951: WARN/System.err(480): at
java.lang.reflect.Method.invokeNative(Native Method)
03-17 12:43:28.961: WARN/System.err(480): at
java.lang.reflect.Method.invoke(Method.java:521)
03-17 12:43:28.961: WARN/System.err(480): at
com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:868)
03-17 12:43:28.971: WARN/System.err(480): at
com.android.internal.os.ZygoteInit.main(ZygoteInit.java:626)
03-17 12:43:28.991: WARN/System.err(480): at
dalvik.system.NativeStart.main(Native Method)
*

2) In case of using BufferedInputStream, here is my message:*

The output is same even in this case.

-- 
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 read the large sized text file

2012-03-17 Thread TreKing
On Sat, Mar 17, 2012 at 3:16 AM, Narendra Singh Rathore 
nsr.curi...@gmail.com wrote:


  The above message indicates that *getMessage() returns NULL* here.


Well, that is unfortunate. At this point, I would recommend you grab the
source and look up AssetManager.readAsset and see where it throws
exceptions.

-
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

Re: [android-developers] How to read the large sized text file

2012-03-16 Thread Narendra Singh Rathore
On Fri, Mar 16, 2012 at 8:06 AM, Miguel Morales therevolti...@gmail.comwrote:

  Try using a buffered input stream.  In other words, stream read the
 file.  You should also know that phones are very limited in memory.
 Loading more than a few MB into memory spells trouble.


I even tried that, but still faced the same exception.

-- 
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 read the large sized text file

2012-03-16 Thread TreKing
On Fri, Mar 16, 2012 at 3:32 AM, Narendra Singh Rathore 
nsr.curi...@gmail.com wrote:

 I even tried that, but still faced the same exception.


Which you still have failed to elaborate on. What is the exception MESSAGE?
What does it tell you the problem is?

-
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

Re: [android-developers] How to read the large sized text file

2012-03-16 Thread Narendra Singh Rathore
On Fri, Mar 16, 2012 at 7:25 PM, TreKing treking...@gmail.com wrote:

 On Fri, Mar 16, 2012 at 3:32 AM, Narendra Singh Rathore 
 nsr.curi...@gmail.com wrote:

 I even tried that, but still faced the same exception.


 Which you still have failed to elaborate on. What is the exception
 MESSAGE? What does it tell you the problem is?


Well, the exception is same as I told you earlier. There isn't any change
in it.

-- 
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 read the large sized text file

2012-03-16 Thread TreKing
On Fri, Mar 16, 2012 at 8:59 AM, Narendra Singh Rathore 
nsr.curi...@gmail.com wrote:

 Well, the exception is same as I told you earlier. There isn't any change
 in it.


You posted the exception itself. You did NOT post the exception's MESSAGE.
I said before, if you call getMessage() on the exception object, it gives
you a REASON WHY the generic IOException was raised. The fact that an
IOException was raised is, in and of itself, rather useless information.

So, again ... what is the exception's MESSAGE?

-
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

Re: [android-developers] How to read the large sized text file

2012-03-15 Thread Narendra Singh Rathore
On Thu, Mar 15, 2012 at 4:16 AM, 김유섭 j.rechard...@gmail.com wrote:

 I think you'd better use database like sqlite.


Thanks for suggesting me, but I m actually having a large text file.
And thus it would be much difficult for me to fill database one by one a
lot of records.

Do you have any suggestion for filling my database using that text file?

-- 
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 read the large sized text file

2012-03-15 Thread Miguel Morales
I think the problem is that you're reading the whole file into a byte
array.  This is bad.  Try using a buffered input stream.  In other words,
stream read the file.  You should also know that phones are very limited in
memory.  Loading more than a few MB into memory spells trouble.

On Mar 15, 2012 12:07 AM, Narendra Singh Rathore nsr.curi...@gmail.com
wrote:



On Thu, Mar 15, 2012 at 4:16 AM, 김유섭 j.rechard...@gmail.com wrote:

 I think you'd better use da...
Thanks for suggesting me, but I m actually having a large text file.
And thus it would be much difficult for me to fill database one by one a
lot of records.

Do you have any suggestion for filling my database using that text file?





-- 
You received this message because you are subscribed to the Google
Groups Android Developers...

-- 
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 read the large sized text file

2012-03-14 Thread 김유섭
I think you'd better use database like sqlite.
2012. 3. 14. 오후 1:05에 TreKing treking...@gmail.com님이 작성:

 On Tue, Mar 13, 2012 at 1:50 AM, Narendra Singh Rathore 
 nsr.curi...@gmail.com wrote:

 Caused by: java.lang.RuntimeException: java.io.IOException


 OK. What is the message given with the exception? What is the value of
 getMessage() or toString() on the exception? That would help.


 -
 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

-- 
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 read the large sized text file

2012-03-13 Thread TreKing
On Sun, Mar 11, 2012 at 12:16 PM, Narendra Singh Rathore 
nsr.curi...@gmail.com wrote:

 Hi Treking, haven't you checked the attachment I provided?


No. Sorry, but I'm not downloading a random RAR file off the internet, nor
am I so bored that I would want to dig through decipher whatever
information you have enclosed in said file.

Post the relevant portions directly into this thread. If you want people to
help you, don't make them do more work to do so =)

-
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

Re: [android-developers] How to read the large sized text file

2012-03-13 Thread TreKing
On Tue, Mar 13, 2012 at 1:50 AM, Narendra Singh Rathore 
nsr.curi...@gmail.com wrote:

 Caused by: java.lang.RuntimeException: java.io.IOException


OK. What is the message given with the exception? What is the value of
getMessage() or toString() on the exception? That would help.

-
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

Re: [android-developers] How to read the large sized text file

2012-03-11 Thread TreKing
On Fri, Mar 9, 2012 at 9:21 PM, Narendra Singh Rathore 
nsr.curi...@gmail.com wrote:

 Please suggest me what should I do in this case in order to solve my
 problem.


Provide the details of the exception: the message and stack trace, at the
every least. And the sample code that calls it.

-
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

Re: [android-developers] How to read the large sized text file

2012-03-11 Thread Narendra Singh Rathore
On Sun, Mar 11, 2012 at 9:30 PM, TreKing treking...@gmail.com wrote:

  On Fri, Mar 9, 2012 at 9:21 PM, Narendra Singh Rathore 
 nsr.curi...@gmail.com wrote:

 Please suggest me what should I do in this case in order to solve my
 problem.


 Provide the details of the exception: the message and stack trace, at the
 every least. And the sample code that calls it.


Hi Treking, haven't you checked the attachment I provided?
That will provide you all the needed information.

-- 
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 read the large sized text file

2012-03-08 Thread TreKing
On Thu, Mar 8, 2012 at 7:16 AM, Narendra Singh Rathore 
nsr.curi...@gmail.com wrote:

 So, what should I do to read large sized text files?


Presumably the same thing you're doing for the small sized text file.
What is the problem you're experiencing when trying to do this?

-
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

Re: [android-developers] How to read the large sized text file

2012-03-08 Thread Narendra Singh Rathore
  What is the problem you're experiencing when trying to do this?


I am just unable to read the contents of large file, and thus unable to
display the contents on my view, unlike the small sized file on which my
code is working well.

-- 
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 read the large sized text file

2012-03-08 Thread TreKing
On Thu, Mar 8, 2012 at 12:10 PM, Narendra Singh Rathore 
nsr.curi...@gmail.com wrote:

 What is the problem you're experiencing when trying to do this?


 I am just unable to read the contents of large file


That tells us nothing about the why of the actual problem you're having.

-
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

Re: [android-developers] How to read the large sized text file

2012-03-08 Thread Narendra Singh Rathore
On Fri, Mar 9, 2012 at 12:22 AM, TreKing treking...@gmail.com wrote:

  On Thu, Mar 8, 2012 at 12:10 PM, Narendra Singh Rathore 
 nsr.curi...@gmail.com wrote:

  What is the problem you're experiencing when trying to do this?


 I am just unable to read the contents of large file


 That tells us nothing about the why of the actual problem you're having.


Okay, in that case, here is some more clarification.

I am actually displaying the contents/words of text file in
AutocompleteTextView.
If I reduce the word limit of that file to 150 or something around it, then
it works well.
But in my case, I require large amount of words, near about 10,000.
I applied the same code here, and then trying to fill my ArrayAdapter with
those words, but that seems to be of no use.

AFAIK, this is just because I am trying to read large file.

I guess, you got my problem now, didn;t you?

-- 
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 read the large sized text file

2012-03-08 Thread TreKing
On Thu, Mar 8, 2012 at 1:08 PM, Narendra Singh Rathore 
nsr.curi...@gmail.com wrote:

 I guess, you got my problem now, didn;t you?


Nope, sorry. You're being vague. How does fewer words work well? How does
more words break it? You applied the same code but it's still of no use
still doesn't explain the actual problem. What is of no use?

What *exactly* is the problem that occurs when you have a larger file? Does
it crash? Are there exceptions? Is your adapter filled with only half the
words? Are the words translated to Arabic for no good reason? WHAT IS THE
PROBLEM? Do you see what I'm getting at?

-
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