小编no *_*one的帖子

将Smack与Android Studio项目集成,用于聊天应用程序

我正在尝试使用ejabberd服务器和smack库实现聊天信使,但很难整合所有的jar和smack的依赖.我正在使用android Studio.

我的build.gradle(模块):

apply plugin: 'com.android.application'

    android {
        compileSdkVersion 22
        buildToolsVersion "22.0.1"

        defaultConfig {
            applicationId "com.example.nit.xmppclient"
            minSdkVersion 18
            targetSdkVersion 22
            versionCode 1
            versionName "1.0"
        }
        buildTypes {
            release {
                minifyEnabled false
                proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
            }
        }
    }

    dependencies {
        compile fileTree(dir: 'libs', include: ['*.jar'])
        compile 'com.android.support:appcompat-v7:22.2.0'

        compile "org.igniterealtime.smack:smack-android:4.1.0"
        compile "org.igniterealtime.smack:smack-tcp:4.1.0"
        compile "org.igniterealtime.smack:smack-android-extensions:4.1.0"

        compile 'org.ogce:xpp3:1.1.6'

    }
Run Code Online (Sandbox Code Playgroud)

首先我得到XMLpullparser错误然后我添加了xpp3.但是在我添加了xpp3后,我得到了

Error:Gradle: Execution failed for task ':app:preDexDebug'.
> com.android.ide.common.process.ProcessException: org.gradle.process.internal.ExecException: Process 'command '/usr/lib/jvm/java-7-openjdk-amd64/bin/java'' finished with non-zero exit value 1
Run Code Online (Sandbox Code Playgroud)

的build.gradle(项目):

// Top-level build file where …
Run Code Online (Sandbox Code Playgroud)

android xmpp ejabberd smack asmack

19
推荐指数
1
解决办法
5910
查看次数

ChatStateListener无法正常工作

实施嫌API现在试图让喜欢的用户是否是聊天状态Composing,Paused等等.我迄今所做

public class IncomingChatListener implements  ChatMessageListener, ChatStateListener {

        @Override
        public void stateChanged(Chat chat, ChatState state) {
            Log.d("-----","into chat state");
            if (ChatState.composing.equals(state)) {
                Log.d("Chat State",chat.getParticipant() + " is typing..");
            } else if (ChatState.gone.equals(state)) {
                Log.d("Chat State",chat.getParticipant() + " has left the conversation.");
            } else {
                Log.d("Chat State",chat.getParticipant() + ": " + state.name());
            }
        }
public void processMessage(Chat chat, Message message) {
.......
......

}
Run Code Online (Sandbox Code Playgroud)

当用户输入时,我发送的状态如下:

ChatStateManager.getInstance(connection).setCurrentState(ChatState.composing, myChat);
Run Code Online (Sandbox Code Playgroud)

问题是stateChanged函数永远不会被调用而是函数中收到了像编写等的chatStatus包processMessage.

我怎么能在stateChanged功能上收到它?

android chat smack asmack

5
推荐指数
0
解决办法
337
查看次数

Mysql-Connector-Java 与 Spring-Jdbc 之间的区别

据我所知,我们使用 Mysql-connector jar 将 java 应用程序连接到数据库。我正在关注 spring 教程,上面提到的东西都是通过 Maven 添加的。两者有什么区别?

spring jdbc mysql-connector spring-jdbc

4
推荐指数
1
解决办法
2467
查看次数

cassandra中多列的范围

我的桌子:

CREATE TABLE user_position (
  geopart text, // first 3 characters of geohash
  geohash text,
  datetime timestamp,
  userId bigint,
  PRIMARY KEY ((geopart), geohash, datetime, user_id)
);
Run Code Online (Sandbox Code Playgroud)

我的虚拟查询:

select * from user_position where geopart = 'abc' and geohash > 'a' and geohash < 'z' and datetime >= '2015-08-08 15:08:58+0530';
Run Code Online (Sandbox Code Playgroud)

错误:

Bad Request: PRIMARY KEY column "datetime" cannot be restricted (preceding column "geohash" is restricted by a non-EQ relation)
Run Code Online (Sandbox Code Playgroud)

题:

我做错了什么?如果在Cassandra中无法使用多列的范围,那么我该如何实现呢?

cql cassandra

2
推荐指数
1
解决办法
1915
查看次数

标签 统计

android ×2

asmack ×2

smack ×2

cassandra ×1

chat ×1

cql ×1

ejabberd ×1

jdbc ×1

mysql-connector ×1

spring ×1

spring-jdbc ×1

xmpp ×1