BlackBerry Forums Support Community               

Closed Thread
 
LinkBack Thread Tools
Old 02-04-2009, 05:16 AM   #1 (permalink)
Thumbs Must Hurt
 
Join Date: May 2007
Location: berlin, germany
Model: 8310
PIN: N/A
Carrier: vodafone
Posts: 163
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default Project type Library is not shown

Please Login to Remove!

Hi,
i have developed an Library Project, which was shown in the Settingslist, where you can find date and time settings etc.

Now i want to save one of my classes persistenable, thats no problem, it was saved without any problems. But after restarting my BlackBerry my program is not shown in the optionslist any more.

If i take a look at the installed programs the BlackBerry says, that my programm is installed, but it's not shown.

I habe deleted it, with the Desktopmanager, directly from the BB and installed it again, restarted and reseted the bb, renamed my project, make a newer version, recompiled it, make a new Library project, but nothing is shown there.

has anybody an idea how i can fix this problem??

PHP Code:
package blablablubb;

import net.rim.blackberry.api.options.*;
import net.rim.device.api.ui.component.*;
import net.rim.device.api.ui.container.*;
import net.rim.device.api.system.*;

class 
frmOptions implements OptionsProvider{
    private static 
frmOptions instance;
    
    public static 
void libMain(Stringxxx91;xxx93; args) {OptionsManager.registerOptionsProvider(getInstance());}
    private static 
frmOptions getInstance() {
        if(
instance == null) {
            
instance = new frmOptions();
        }
        return 
instance;
    }    
    private 
frmOptions() {}
    public 
String getTitle() {return "myOptions";}
    public 
void populateMainScreen(MainScreen mainScreen) {}
    public 
void save() {}

thanks hibbert
__________________
My English is so bad, that makes me nobody so quickly after

Last edited by hibbert : 02-04-2009 at 05:33 AM. Reason: code added
Offline  
Old 02-04-2009, 05:55 AM   #2 (permalink)
Thumbs Must Hurt
 
Join Date: May 2007
Location: berlin, germany
Model: 8310
PIN: N/A
Carrier: vodafone
Posts: 163
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

while my blackberry was starting i attached the debugger, and i get this error:
Error starting <projectname>: Class '<projectname>.clsOptions' multiply defined.

i used clsOptions in myOptions and in my application, which i can start from the blackberrys homescreen. but this applications isn started.

maybe the problem is, that clsOptions implements net.rim.device.api.util.Persistable ??
or that on the void populateMainScreen a static function of clsOptions is called to load the options into an instance of clsOptions...? looks like this here:
PHP Code:
class clsOptions implements net.rim.device.api.util.Persistable{
//...
public static clsOptions loadOptions() {
clsOptions data null;
// load etc...
return data;
}
// end of clsOptions

// my Library:
class frmOptions implements OptionsProvider {
    private static 
frmOptions instance;
    
    private 
clsOptions options;
//...
 
public void populateMainScreen(MainScreen mainScreen) {
 
options clsOptions.loadOptions();// neu
 
}

maybe this could be a problem... nor not??

thanks hibbert
__________________
My English is so bad, that makes me nobody so quickly after
Offline  
Old 02-04-2009, 06:27 AM   #3 (permalink)
CrackBerry Addict
 
Join Date: Apr 2005
Location: hamburg, germany
Model: 8900
Carrier: o2
Posts: 838
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

do not use persistant classes in a library project.
you can use a superclass in the library and implement persistable in your project in an extension.
__________________
java developer, Devinto, hamburg/germany
Offline  
Old 02-04-2009, 06:57 AM   #4 (permalink)
Thumbs Must Hurt
 
Join Date: May 2007
Location: berlin, germany
Model: 8310
PIN: N/A
Carrier: vodafone
Posts: 163
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

ermm what? ^^

can you give me an example of using a superclass? i can't follow you (at this time)

or is there a was to serialize the class to a string and save this string?


hibbert
__________________
My English is so bad, that makes me nobody so quickly after

Last edited by hibbert : 02-04-2009 at 07:22 AM.
Offline  
Old 02-04-2009, 08:06 AM   #5 (permalink)
CrackBerry Addict
 
Join Date: Apr 2005
Location: hamburg, germany
Model: 8900
Carrier: o2
Posts: 838
Post Thanks: 0
Thanked 0 Times in 0 Posts
Default

let's keep it simple:
putting your own persistable classes into a library does not work (you will get the multiply defined error).
either use "native persistable" classes (Hashtable for example works very well to save options) or put the class into your main project instead of the library.

i encountered the very same problems some time ago and am now just using Hashtable instead of bean classes.
__________________
java developer, Devinto, hamburg/germany
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





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