BlackBerry Forums Support Community
              

Closed Thread
 
Thread Tools
Old 02-04-2009, 05:16 AM   #1
hibbert
Thumbs Must Hurt
 
Join Date: May 2007
Location: berlin, germany
Model: 8310
PIN: N/A
Carrier: vodafone
Posts: 163
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
hibbert
Thumbs Must Hurt
 
Join Date: May 2007
Location: berlin, germany
Model: 8310
PIN: N/A
Carrier: vodafone
Posts: 163
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
simon.hain
CrackBerry Addict
 
Join Date: Apr 2005
Location: hamburg, germany
Model: 8900
Carrier: o2
Posts: 838
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
hibbert
Thumbs Must Hurt
 
Join Date: May 2007
Location: berlin, germany
Model: 8310
PIN: N/A
Carrier: vodafone
Posts: 163
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
simon.hain
CrackBerry Addict
 
Join Date: Apr 2005
Location: hamburg, germany
Model: 8900
Carrier: o2
Posts: 838
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



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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


Atrix International Vacomegau Omega Plus Portable Vacuum Cleaner GUC picture

Atrix International Vacomegau Omega Plus Portable Vacuum Cleaner GUC

$119.00



Vacuum Bagging Connector for Carbon Fiber - Fiberglass - Pre-Preg - Composite picture

Vacuum Bagging Connector for Carbon Fiber - Fiberglass - Pre-Preg - Composite

$39.99



Watts 800M4QT 1 in. Pressure Vacuum Breaker picture

Watts 800M4QT 1 in. Pressure Vacuum Breaker

$70.45



Appion MGAVCT 1/4 Inches MegaFlow Vacuum-Rated Valve Core Removal Tool picture

Appion MGAVCT 1/4 Inches MegaFlow Vacuum-Rated Valve Core Removal Tool

$65.08



FEBCO 765DBV 3/4in Bronze FNPT Pressure Vacuum Breaker NEW picture

FEBCO 765DBV 3/4in Bronze FNPT Pressure Vacuum Breaker NEW

$89.99



VacPouch - Chamber Vacuum Pouches, 3mil, 500 PACK picture

VacPouch - Chamber Vacuum Pouches, 3mil, 500 PACK

$66.52







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