GithubHelp home page GithubHelp logo

chanchan123444 / imsdk-android Goto Github PK

View Code? Open in Web Editor NEW

This project forked from qunarcorp/imsdk-android

0.0 2.0 0.0 6.87 MB

Startalk企业级im工具

Home Page: https://im.qunar.com/new

License: MIT License

Java 98.52% HTML 1.07% CSS 0.22% JavaScript 0.18%

imsdk-android's Introduction

公有云(Startalk APP)

基于Startalk服务器及客户端,用户可建立属于自己的域,

注册账号、新建域、添加域用户、下载客户端、配置域导航,

仅需5步,您就可以拥有强大的im能力,

客户端下载下载

  • Android

Startalk on Android

客户端导航配置配置导航

私有云(Startalk SDK)

Startalk私有云是一种去中心化的部署方式,

用户或企业将Startalk后端代码完全部署在自己的服务器上,

选择SDK嵌入自己的APP中,

每个公司都是一个单独的节点,每个节点独立运营,数据只保存在节点中,

下面是Android sdk的嵌入方式以及配置。

配置Gradle

buildscript {
    repositories {
        jcenter()
        google()
    }
}
 
allprojects {
    repositories {
        maven {
            url "http://qt.qunar.com/package/mvn/repository/maven-qim/"
        }
        
        maven {
            url "http://developer.huawei.com/repo/"
        }
    mavenCentral()
        jcenter {
           url "http://jcenter.bintray.com/"
        }
        jcenter()
        google()
    }
}
dependencies {
  compile 'com.qunar.im:sdk-im:3.0.3' //或者直接引用imlib Library工程,compile project(':imlib')
}

配置manifestPlaceholders(如果自己的app不分渠道,可直接在buildTypes里配置manifestPlaceholders,反之需在每个Flavor下配置manifestPlaceholders)

flavorDimensions "qim"
    //分渠道
    productFlavors {
        //QTalk
        qtalk {
            dimension "qim"

            manifestPlaceholders = [
                    PACKAGE_NAME : "sdk.im.qunar.com.qtalksdkdemo",//替换成自己项目的applicationId
                    serverDoMain  : true,
                    SCHEME : "qtalkaphone",
                    currentPlat  : "QTalk",
                    MAIN_SCHEMA : "start_qtalk_activity"
            ]
        }
        // QChat
        qchat {
            dimension "qim"

            manifestPlaceholders = [
                    PACKAGE_NAME : "sdk.im.qunar.com.qtalksdkdemo",//替换成自己项目的applicationId
                    serverDoMain  : false,
                    SCHEME : "qchataphone",
                    currentPlat  : "QChat",
                    MAIN_SCHEMA : "start_qchat_activity",
            ]
        }

    }

主工程Manifest配置

参照app下的AndroidManifest配置

如何使用(主要接口)

首先需要对sdk进行初始化操作,之后配置导航Url,然后进行登录。

 1.初始化SDK
 
 QIMSdk.getInstance().init(Application application)
 2.配置导航地址
 
 QIMSdk.getInstance().setNavigationUrl(String url)
 3.用户名密码登录
 
 QIMSdk.getInstance().login(String uid,String password,LoginStatesListener loginStatesListener)
 4.自动登录(本地缓存用户之前登录的用户名、token后可自动登录)
 
 QIMSdk.getInstance().autoLogin(LoginStatesListener loginStatesListener)
 5.登出
 
 QIMSdk.getInstance().signOut()
 6.打开debug模式

 QIMSdk.getInstance().openDebug()

其他参考api.md

Scheme Support

参考文档scheme文档

ProGuard

Depending on your ProGuard (DexGuard) config and usage, you may need to include the following lines in your proguard.cfg

-dontwarn com.mqunar.**
-keep class com.mqunar.**{*;}
-dontwarn com.qunar.**
-keep class com.qunar.**{*;}

Compatibility

  • Minimum Android SDK: QTalk SDK requires a minimum API level of 16.
  • Compile Android SDK: QTalk SDK requires you to compile against API 26 or later.

常见错误

在gradle.properties文件中添加 android.enableAapt2=false

error:style attribute '@android:attr/windowEnterAnimation' not found.
Message{kind=ERROR, text=error: style attribute '@android:attr/windowEnterAnimation' not found.

在主工程的values styles.xml中添加如下style

<style name="SplashTheme" parent="AppTheme">
   <item name="android:windowIsTranslucent">true</item>
</style>
error:No resource found that matches the given name (at 'theme' with value '@style/SplashTheme').

意见反馈

imsdk-android's People

Contributors

fantasywxx avatar froyomu avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.