import java.util.Locale;\r
\r
import net.sf.openrocket.android.util.AndroidLogWrapper;\r
-import net.sf.openrocket.document.OpenRocketDocument;\r
+import net.sf.openrocket.database.ComponentPresetDatabase;\r
import net.sf.openrocket.l10n.DebugTranslator;\r
import net.sf.openrocket.l10n.ResourceBundleTranslator;\r
import net.sf.openrocket.l10n.Translator;\r
+import android.content.pm.ApplicationInfo;\r
import android.preference.PreferenceManager;\r
\r
public class Application extends android.app.Application {\r
\r
- private OpenRocketDocument rocketDocument;\r
- \r
// Big B boolean so I can synchronize on it.\r
private static Boolean initialized = false;\r
- \r
+\r
public void initialize() {\r
synchronized (initialized) {\r
if ( initialized == true ) {\r
System.setProperty("org.xml.sax.driver","org.xmlpull.v1.sax2.Driver");\r
\r
net.sf.openrocket.startup.Application.setLogger( new AndroidLogWrapper.LogHelper() );\r
- \r
+\r
net.sf.openrocket.startup.Application.setPreferences( new PreferencesAdapter() );\r
- \r
+\r
+ net.sf.openrocket.startup.Application.setComponentPresetDao( new ComponentPresetDatabase(){\r
+ @Override\r
+ protected void load() {\r
+ // We don't need components\r
+ } \r
+ } );\r
+\r
MotorDatabaseAdapter db = new MotorDatabaseAdapter(this);\r
\r
net.sf.openrocket.startup.Application.setMotorSetDatabase(db);\r
- \r
+\r
Translator t;\r
t = new ResourceBundleTranslator("l10n.messages");\r
if (Locale.getDefault().getLanguage().equals("xx")) {\r
t = new DebugTranslator(t);\r
}\r
- \r
+\r
net.sf.openrocket.startup.Application.setBaseTranslator(t);\r
\r
initialized = true;\r
public void onCreate() {\r
super.onCreate();\r
initialize();\r
+ boolean isDebuggable = (0 != (getApplicationInfo().flags & ApplicationInfo.FLAG_DEBUGGABLE));\r
+ AndroidLogWrapper.setLogEnabled(isDebuggable);\r
PreferencesActivity.initializePreferences(this, PreferenceManager.getDefaultSharedPreferences(this));\r
}\r
\r
- /**\r
- * @return the rocketDocument\r
- */\r
- public OpenRocketDocument getRocketDocument() {\r
- return rocketDocument;\r
- }\r
-\r
- /**\r
- * @param rocketDocument the rocketDocument to set\r
- */\r
- public void setRocketDocument(OpenRocketDocument rocketDocument) {\r
- this.rocketDocument = rocketDocument;\r
- }\r
- \r
- \r
- \r
}\r