wwregistry Member Licensed User Longtime User Mar 7, 2014 #1 i have a large array of strings (4000+) i am getting this error: java:6: error: too many constants is there a maximum size for arrays in b4a?
i have a large array of strings (4000+) i am getting this error: java:6: error: too many constants is there a maximum size for arrays in b4a?
wwregistry Member Licensed User Longtime User Mar 7, 2014 #2 forgot to get email notifications - fixed here Upvote 0
wwregistry Member Licensed User Longtime User Mar 7, 2014 #3 connection there are 40,000 strings in the array Upvote 0
margret Well-Known Member Licensed User Longtime User Mar 8, 2014 #4 I think the only limit is memory, maybe Erel or one of the other gurus will confirm this. Upvote 0
Erel B4X founder Staff member Licensed User Longtime User Mar 9, 2014 #5 There isn't any maximum limit. Can you post the full error message and the relevant code? Upvote 0
wwregistry Member Licensed User Longtime User Mar 9, 2014 #6 here is the error Parsing code. 1.59 Compiling code. 2.54 Compiling layouts code. 0.23 Generating R file. 0.31 Compiling debugger engine code. Error javac 1.7.0_25 shell\src\com\HRGincSoftware\David_Gray_SocSec\datad_subs_0.java:6: error: too many constants public class datad_subs_0 { ^ 1 error Upvote 0
here is the error Parsing code. 1.59 Compiling code. 2.54 Compiling layouts code. 0.23 Generating R file. 0.31 Compiling debugger engine code. Error javac 1.7.0_25 shell\src\com\HRGincSoftware\David_Gray_SocSec\datad_subs_0.java:6: error: too many constants public class datad_subs_0 { ^ 1 error
M Mrjoey Active Member Licensed User Longtime User Mar 9, 2014 #7 why dont u use Map instead of array? Upvote 0
M Mrjoey Active Member Licensed User Longtime User Mar 9, 2014 #9 wwregistry said: map: not sure what u mean? Click to expand... Dim M as map and u create a loop to put data inside the map and then u get the data u want. Upvote 0
wwregistry said: map: not sure what u mean? Click to expand... Dim M as map and u create a loop to put data inside the map and then u get the data u want.
wwregistry Member Licensed User Longtime User Mar 9, 2014 #10 here is the code module Attachments xxx.zip xxx.zip 206.9 KB · Views: 306 Upvote 0
wwregistry Member Licensed User Longtime User Mar 9, 2014 #11 i could put the data in an external file and the read the file item into the array? but how would include the file in the program apk package. or maybe the MAP would somehow solve this? But i would still have to include the file? Upvote 0
i could put the data in an external file and the read the file item into the array? but how would include the file in the program apk package. or maybe the MAP would somehow solve this? But i would still have to include the file?
margret Well-Known Member Licensed User Longtime User Mar 9, 2014 #12 The issue is the code is to large for the IDE editor. It gives the same error in B4J. I put the complete array in just one sub and it started to compile and about 2 seconds in, it gave the error: Code To Large. This is not a limit of Java or B4A but may be a limit to the IDE or compiler. You will have to read it in from a file. Place the file with this data in the project folder in the Files folder. Then you can get the data with: Code: Copy Dim MyList As List MyList = File.ReadList(File.DirAssets, "yourfilename.txt") Upvote 0
The issue is the code is to large for the IDE editor. It gives the same error in B4J. I put the complete array in just one sub and it started to compile and about 2 seconds in, it gave the error: Code To Large. This is not a limit of Java or B4A but may be a limit to the IDE or compiler. You will have to read it in from a file. Place the file with this data in the project folder in the Files folder. Then you can get the data with: Code: Copy Dim MyList As List MyList = File.ReadList(File.DirAssets, "yourfilename.txt")
wwregistry Member Licensed User Longtime User Mar 9, 2014 #13 >>Place the file with this data in the project folder in the Files folder. How do i do this? Upvote 0
wwregistry Member Licensed User Longtime User Mar 9, 2014 #14 oh i get it -- the Files folder is incorporated into the apk thanks guy's/margret this will be soooo easy Upvote 0
oh i get it -- the Files folder is incorporated into the apk thanks guy's/margret this will be soooo easy
DonManfred Expert Licensed User Longtime User Mar 9, 2014 #15 In your project folder c:\path_to_project\ You will find a folder FILES Put the file into this folder and then compile your project... See this example. It has your data in a file in files folder and load the data to a listview. ALL 38000 lines... Attachments xxx2.zip xxx2.zip 212.3 KB · Views: 319 Upvote 0
In your project folder c:\path_to_project\ You will find a folder FILES Put the file into this folder and then compile your project... See this example. It has your data in a file in files folder and load the data to a listview. ALL 38000 lines...
wwregistry Member Licensed User Longtime User Mar 10, 2014 #16 DonManfred, thank u, excellent piece of programming Upvote 0