BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 06-26-2011, 03:07 PM   #1 (permalink)
New Member
 
Join Date: Jun 2011
Model: 9800
PIN: N/A
Carrier: none
Posts: 8
Post Thanks: 1
Thanked 0 Times in 0 Posts
Default how to reduce the number of classes

Please Login to Remove!

hai...!

i m new to blackberry development. i have developement an order processing application in BB. when i look at the bin folder i was having more than 100 classes.

eg: i have created a main screen class for new client addition. the screen is having 7 label fields and 7 corresponding text fields. i have defined a vertical field manager and add all these fields to it and then add the vertical field manger to the screen.

for the above screen, i have got 14 class files in the bin folder. it seems, for every field the progam is compiled.
eg:NewClient.class
NewClient$1.class
......NewClient$14.class.

is there anybody knows how design the UI in order to reduce the number of compiled classes.
Offline  
Old 06-26-2011, 03:36 PM   #2 (permalink)
Appleinator
 
Dubdub's Avatar
 
Join Date: Nov 2005
Location: New Hampshire
Model: App5
OS: AJBR549
PIN: Ask
Carrier: ATT & Verizon
Posts: 20,020
Post Thanks: 54
Thanked 778 Times in 740 Posts
Default Re: how to reduce the number of classes

Moved to a more appropriate section.
__________________
-->>BB FAQ

-->>Stinsonddog's Tip Site!

-->>Twitter


If someone helps, tell them by clicking the Thanks button.!!
Offline  
The Following User Says Thank You to Dubdub For This Useful Post:
asriragu (06-26-2011)
Old 06-26-2011, 06:13 PM   #3 (permalink)
BlackBerry Extraordinaire
 
Join Date: Jan 2006
Model: LEZ10
OS: 10.0.10
Carrier: Rogers CA
Posts: 1,704
Post Thanks: 20
Thanked 77 Times in 68 Posts
Default Re: how to reduce the number of classes

I'm not sure what your question is. Did you sub-class each of these Field classes so that you defined 14 new classes? If so, you may want to ask youself if you really needed to sub-class, ie) what functionallity does each sub-class provide that is not provided by the base class.

If you are just concerned that you have 14 classes to support 7 input fields, then you may want to consider that the Text fields (BasicEditField etc) have a built in label, and a MainScreen provides a manager that does what a VerticalFieldManager does.
__________________
My other Blackberry is a PlayBook.
Offline  
Old 06-27-2011, 12:34 PM   #4 (permalink)
New Member
 
Join Date: Jun 2011
Model: 9800
PIN: N/A
Carrier: none
Posts: 8
Post Thanks: 1
Thanked 0 Times in 0 Posts
Default Re: how to reduce the number of classes

thank you for reply guys..!

I here by explain in detailed...

i have define a class named "NewClient" extends from MainScreen, where i defined 7 label fields and their corresponding RichTextFields. so altogether 14 fields have been defined in the above class.

when i look at the bin folder of the project , i have seen 15 compiled classes in the name of "NewClient".

eg:- NewClient.class
NewClient$1.class.......NewClient$14.class.
therefore, for every class, having plenty of .class files depending on the field.

therefore i end up more than 100 .class files in the bin folder.

when i run the program it says create process error regarding .Jar file.

why does the "$" come with the .class file?

how can i reduce the number of compiled classes? is thr any structure to develop the blackberry program in order to reduce the .class files?

thank you!
Offline  
Old 06-27-2011, 03:57 PM   #5 (permalink)
BlackBerry Extraordinaire
 
Join Date: Jan 2006
Model: LEZ10
OS: 10.0.10
Carrier: Rogers CA
Posts: 1,704
Post Thanks: 20
Thanked 77 Times in 68 Posts
Arrow Re: how to reduce the number of classes

What you are refering to are anonymous classes. Without seeing your code it is difficult to say why they are being created. I also assume you are using Eclipse. I am unfamiliar with how Eclipse handles specific cases so someone else may have a better answere. Where I have seen anonymous classes created are situations like:

Code:
UiApplication.getUiApplication().invokeLater(new Runnable() {
    public void run() {
        // some code
    }
});
Will create an anonymous Runnable class.
__________________
My other Blackberry is a PlayBook.
Offline  
Old 12-23-2011, 01:05 AM   #6 (permalink)
New Member
 
Join Date: Dec 2011
Model: 9800
PIN: N/A
Carrier: Blackberry Professional
Posts: 1
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Error: to create more than 100 classes in blackberry

Error: Cannot run program "jar": CreateProcess error=2, The system cannot find the file specified
Packaging project mnbblog1 failed (took 22.703 seconds)

while i executing, i got above error. plz anyone help me.
Offline  
Closed Thread


Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads for: how to reduce the number of classes
Thread Thread Starter Forum Replies Last Post
Visual Voicemail! Voice-To-Text Automatic Transcription Mark Rejhon Aftermarket Software 20 07-11-2007 12:16 PM
7100i text messenging semfirefighter General Legacy Device Discussion 12 06-29-2007 06:59 AM
SIM Card "Phone Number" Field Question mahoward BES Admin Corner 14 05-25-2007 11:27 AM
Cannot delete call forwarding number. someguy99 General Legacy Device Discussion 1 05-18-2007 10:31 AM
My number not showing up (Voda - UK)? Empgamer General Legacy Device Discussion 3 09-15-2006 05:26 AM





Copyright 2004-2014 BlackBerryForums.com.
The names RIM and BlackBerry are registered Trademarks of BlackBerry Inc.