我目前正在试用Firebase分析套装,但是,我遇到了一个小问题,我的应用程序分发在谷歌播放和亚马逊商店(不支持谷歌播放服务),所以对于我想要的亚马逊风味删除对Firebase的依赖(我已经知道该怎么做),但是,我还需要删除Firebase插件,这样它在构建时不会抛出异常.
这就是我现在所拥有的:
productFlavors {
google {
applicationId 'google app id'
}
amazon {
applicationId 'amazon app id'
}
}
dependencies {
googleCompile 'com.google.firebase:firebase-analytics:9.0.0'
amazonCompile 'com.amazonaws:aws-android-sdk-mobileanalytics:2.2.12'
amazonCompile('com.crashlytics.sdk.android:crashlytics:2.5.1@aar') {
transitive = true;
}
}
apply plugin: 'com.google.gms.google-services'
Run Code Online (Sandbox Code Playgroud)
但是,我需要删除插件只有亚马逊风味.
这甚至可能吗?或者至少有一些我能尝试的东西吗?
更新:
根据史蒂夫的要求,我去亚马逊Kindle平板电脑上尝试使用Firebase的版本,即使你没有安装Google Play服务也能正常工作.
android firebase android-gradle-plugin gradle-plugin firebase-analytics
我有一个应用程序,登录后它会在欢迎屏幕上引发你.我放了一个Toast来看看onResume何时触发,但它也会在onCreate之后触发
protected void onResume(){
super.onResume();
Database openHelper = new Database(this);//create new Database to take advantage of the SQLiteOpenHelper class
myDB2 = openHelper.getReadableDatabase(); // or getWritableDatabase();
myDB2=SQLiteDatabase.openDatabase("data/data/com.example.login2/databases/aeglea", null, SQLiteDatabase.OPEN_READONLY);//set myDB to aeglea
cur = fetchOption("SELECT * FROM user_login");//use above to execute SQL query
msg.setText("Username: "+cur.getString(cur.getColumnIndex("username"))
+"\nFull name: "+cur.getString(cur.getColumnIndex("name"))+" "+cur.getString(cur.getColumnIndex("last"))
+"\ne-mail: "+cur.getString(cur.getColumnIndex("email"))
+"\nAeglea id:"+cur.getString(cur.getColumnIndex("uid")));
Toast.makeText(getApplicationContext(), "RESUMED", Toast.LENGTH_SHORT).show();
}
Run Code Online (Sandbox Code Playgroud)
它来自:
//create new intent
Intent log = new Intent(getApplicationContext(), Welcome.class);
// Close all views before launching logged
log.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP);
startActivity(log);
// Close Login Screen
finish(); …Run Code Online (Sandbox Code Playgroud)