[android-developers] Re: Max size of string array

2010-05-07 Thread fadden
On May 6, 3:12 pm, fadden fad...@android.com wrote:
 I'm not sufficiently familiar with the asset management stuff to
 suggest a workaround.  I'll file a bug and ask around.

The bug has been fixed for a future release of Android.

In the mean time:

  He'll need to split his strings into multiple arrays.  Or another
option is to put them in an XML file and pull them out of that.

Hopefully that helps.

-- 
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


[android-developers] Re: Max size of string array

2010-05-06 Thread fadden
On May 5, 7:49 am, Alain aarn...@gmail.com wrote:
 The issue is not string[] or Liststring but with Dalvik VM issuing a
 ReferenceTable overflow (max=512)

 The call to String[] items =
 getResources().getStringArray(R.array.arrayname);

 The array has 770 entries. I can split the array into two arrays or
 can the ReferenceTable size be increased?

Sounds like buggy JNI code in the Android framework.  I'm guessing the
above is eventually calling into
android_content_AssetManager_getArrayStringResource in frameworks/base/
core/jni/android_util_AssetManager.cpp.

The function there is looping over all entries, creating new strings,
and not deleting local references as it goes.  Eventually the local
ref table overflows.

I'm not sufficiently familiar with the asset management stuff to
suggest a workaround.  I'll file a bug and ask around.

-- 
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


[android-developers] Re: Max size of string array

2010-05-05 Thread Alain
The issue is not string[] or Liststring but with Dalvik VM issuing a
ReferenceTable overflow (max=512)

The call to String[] items =
getResources().getStringArray(R.array.arrayname);

The array has 770 entries. I can split the array into two arrays or
can the ReferenceTable size be increased?

On May 3, 12:27 pm, niko20 nikolatesl...@yahoo.com wrote:
 Check your logcat to see if you have out of memory errors. Java Dalvik
 programs are hard limited to 16Megs.

 -niko

 On May 3, 10:53 am, Jose Gomez j...@josecgomez.com wrote:



  Not quite sure how they handle regular old arrays in the implementation of
  android. But List has never given me any problems.

  Sincerely
  Jose C Gomez

 http://www.josecgomez.com

  On Mon, May 3, 2010 at 11:49 AM, Alain aarn...@gmail.com wrote:
   I am usingString[]

  String[] items = getResources().getStringArray(R.array.arrayname);

   I will try ListString

   Why wouldString[] be limited in the number of items?

   Thanks

   On May 3, 10:34 am, Jose Gomez j...@josecgomez.com wrote:
Are you usingString[] or ListString ? If using ListString it should
basically be unlimited.
Sincerely
Jose C Gomez

   http://www.josecgomez.com

On Mon, May 3, 2010 at 9:47 AM, Alain aarn...@gmail.com wrote:
 I have astring-array with 2000 items, each item can be 60 characters
 long, the program crashes when it tries to load the completestring-
 array. Then I split thestring-array in 4 sections, and the program
 loads each section with no problem.

 My question, what's the max number of items in astringarray? Is that
 device or sdk level dependent? Can it be changed?

 --
 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.comandroid-developers%2Bunsubs
  cr...@googlegroups.com
   android-developers%2bunsubscr...@googlegroups.comandroid-developers%252Bu
nsubscr...@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.comandroid-developers%2Bunsubs
 cr...@googlegroups.com
For more options, visit this group athttp://
   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.comandroid-developers%2Bunsubs
cr...@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 
  athttp://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 
 athttp://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


[android-developers] Re: Max size of string array

2010-05-03 Thread Alain
I am using String[]

String[] items = getResources().getStringArray(R.array.arrayname);

I will try ListString

Why would String[] be limited in the number of items?

Thanks

On May 3, 10:34 am, Jose Gomez j...@josecgomez.com wrote:
 Are you using String[] or ListString ? If using ListString it should
 basically be unlimited.
 Sincerely
 Jose C Gomez

 http://www.josecgomez.com



 On Mon, May 3, 2010 at 9:47 AM, Alain aarn...@gmail.com wrote:
  I have a string-array with 2000 items, each item can be 60 characters
  long, the program crashes when it tries to load the complete string-
  array. Then I split the string-array in 4 sections, and the program
  loads each section with no problem.

  My question, what's the max number of items in a string array? Is that
  device or sdk level dependent? Can it be changed?

  --
  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.comandroid-developers%2bunsubscr...@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 
 athttp://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] Re: Max size of string array

2010-05-03 Thread Jose Gomez
Not quite sure how they handle regular old arrays in the implementation of
android. But List has never given me any problems.

Sincerely
Jose C Gomez

http://www.josecgomez.com


On Mon, May 3, 2010 at 11:49 AM, Alain aarn...@gmail.com wrote:

 I am using String[]

 String[] items = getResources().getStringArray(R.array.arrayname);

 I will try ListString

 Why would String[] be limited in the number of items?

 Thanks

 On May 3, 10:34 am, Jose Gomez j...@josecgomez.com wrote:
  Are you using String[] or ListString ? If using ListString it should
  basically be unlimited.
  Sincerely
  Jose C Gomez
 
  http://www.josecgomez.com
 
 
 
  On Mon, May 3, 2010 at 9:47 AM, Alain aarn...@gmail.com wrote:
   I have a string-array with 2000 items, each item can be 60 characters
   long, the program crashes when it tries to load the complete string-
   array. Then I split the string-array in 4 sections, and the program
   loads each section with no problem.
 
   My question, what's the max number of items in a string array? Is that
   device or sdk level dependent? Can it be changed?
 
   --
   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.comandroid-developers%2bunsubscr...@googlegroups.com
 android-developers%2bunsubscr...@googlegroups.comandroid-developers%252bunsubscr...@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.comandroid-developers%2bunsubscr...@googlegroups.com
  For more options, visit this group athttp://
 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.comandroid-developers%2bunsubscr...@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

[android-developers] Re: Max size of string array

2010-05-03 Thread niko20
Check your logcat to see if you have out of memory errors. Java Dalvik
programs are hard limited to 16Megs.

-niko

On May 3, 10:53 am, Jose Gomez j...@josecgomez.com wrote:
 Not quite sure how they handle regular old arrays in the implementation of
 android. But List has never given me any problems.

 Sincerely
 Jose C Gomez

 http://www.josecgomez.com





 On Mon, May 3, 2010 at 11:49 AM, Alain aarn...@gmail.com wrote:
  I am using String[]

  String[] items = getResources().getStringArray(R.array.arrayname);

  I will try ListString

  Why would String[] be limited in the number of items?

  Thanks

  On May 3, 10:34 am, Jose Gomez j...@josecgomez.com wrote:
   Are you using String[] or ListString ? If using ListString it should
   basically be unlimited.
   Sincerely
   Jose C Gomez

  http://www.josecgomez.com

   On Mon, May 3, 2010 at 9:47 AM, Alain aarn...@gmail.com wrote:
I have a string-array with 2000 items, each item can be 60 characters
long, the program crashes when it tries to load the complete string-
array. Then I split the string-array in 4 sections, and the program
loads each section with no problem.

My question, what's the max number of items in a string array? Is that
device or sdk level dependent? Can it be changed?

--
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.comandroid-developers%2Bunsubs
 cr...@googlegroups.com
  android-developers%2bunsubscr...@googlegroups.comandroid-developers%252Bu 
  nsubscr...@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.comandroid-developers%2Bunsubs
cr...@googlegroups.com
   For more options, visit this group athttp://
  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.comandroid-developers%2Bunsubs 
  cr...@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 
 athttp://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