我想在我已经存在的Android应用程序中嵌入聊天功能。它已经包括登录凭据。 因此,我尝试将QuickBlox SDK添加到我现有的Android项目中,该项目是从GitHub Link github
下载的另外,Q-Munate Android源代码是否也需要在我现有的应用中添加?
是否也需要添加或没有该Q-Municate源代码,我只能通过在我现有应用中导入QuickBlox SDK来开发聊天功能?
这是我项目的顶级build.gradle文件
//Top-Level构建文件,您可以在其中添加所有子项目/模块共有的配置选项。
buildscript {
repositories {
jcenter()
}
def qbSdkVersion = '3.2.0'
dependencies {
classpath 'com.android.tools.build:gradle:2.2.3'
classpath 'com.neenbedankt.gradle.plugins:android-apt:1.8'
classpath 'org.greenrobot:greendao-gradle-plugin:3.1.0'
compile "com.quickblox:quickblox-android-sdk-chat:$qbSdkVersion"
//include only necessary module dependency, all transitive modules will be included automatically
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
maven {
url = "file://C:/Users/HP/Downloads/quickblox-android-sdk-releases-master"
// url "https://github.com/QuickBlox/quickblox-android-sdk-releases/raw/master/"
}
mavenCentral()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
这是模块级别build.gradle
apply plugin: 'com.android.application'
apply plugin: 'org.greenrobot.greendao'
apply plugin: 'com.neenbedankt.android-apt'
android {
compileSdkVersion 24
buildToolsVersion "23.0.3"
defaultConfig {
applicationId "com.sensei.app"
minSdkVersion 15
targetSdkVersion 24
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
greendao {
schemaVersion 1
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:24.2.0'
compile 'com.android.support:cardview-v7:24.0.+'
compile 'com.android.support:design:24.2.0'
compile 'com.squareup.retrofit2:retrofit:2.1.0'
compile 'com.squareup.retrofit2:converter-gson:2.0.2'
compile 'org.greenrobot:greendao:3.1.1'
compile 'org.greenrobot:eventbus:3.0.0'
compile 'com.jakewharton:butterknife:8.4.0'
сompile "com.quickblox:quickblox-android-sdk-chat:$qbSdkVersion" //include only necessary module dependency, all transitive modules will be included automatically
сompile "com.quickblox:quickblox-android-sdk-content:$qbSdkVersion"
сompile "com.quickblox:quickblox-android-sdk-messages:$qbSdkVersion"
сompile "com.quickblox:quickblox-android-sdk-customobjects:$qbSdkVersion"
debugCompile 'com.facebook.stetho:stetho:1.4.1'
debugCompile 'com.facebook.stetho:stetho-okhttp3:1.4.1'
apt 'com.jakewharton:butterknife-compiler:8.4.0'
}
访问此链接以获取与QuickBlox
集成的简单聊天功能https://github.com/quickblox/quickblox-android-sdk/tree/master/master/sample-chat
您需要在项目中添加代码以进行聊天功能,例如一对一聊天或组聊天,以及上述示例中的全部。