For a recent mobile project we used XMPP. It worked really well and I’m keen to use it again. But, in the process I learnt quite a lot about it. To start with, getting a working Android client was… interesting.

Android is a fascinating and interesting development environment. It may say Java on the tin, but it ain’t Java inside. And due to this, the otherwise great XMPP library Smack doesn’t work on Android. Instead you have to use the aSmack library. Which is actually a collection of patches and a build script. Compiled output is not to be found on the Internet. Additionally, the build script doesn’t work on Mac OS X. I built it on an Ubuntu Vagrant box. Here’s how.

Install Vagrant and VirtualBox.

  1. mkdir asmack && cd asmack
  2. vagrant box add lucid32 http://files.vagrantup.com/lucid32.box
  3. vagrant init lucid32
  4. vagrant ssh
  5. sudo apt-get update
  6. sudo apt-get install git-core openjdk-6-jdk curl vim subversion ant advancecomp
  7. curl -O http://dl.google.com/android/android-sdk_r21.1-linux.tgz
  8. tar -xzvf android-sdk_r21.1-linux.tgz
  9. cd android-sdk-linux/
  10. tools/android update sdk --no-ui
  11. cd ..
  12. git clone https://github.com/Flowdalic/asmack.git
  13. cd asmack/
  14. echo "sdk-location=/home/vagrant/android-sdk-linux" > local.properties
  15. Edit build.xml. Remove the check-android-exists dependency from the compile-android target.
  16. ./build.bash
  17. cp build/asmack-android-17.jar /vagrant
  18. exit

And you will now have asmack-android-17.jar sitting in your current directory.

http://overwatering.org/blog/2013/05/compiling-asmack/

Compiling aSmack的更多相关文章

  1. [ZZ] A Proposal For Compiling Direct3D HLSL With LLVM (Written by Michael Larabel )

    http://www.phoronix.com/scan.php?page=news_item&px=OTI2NA Note:  Something very instersting to w ...

  2. RDLC An unexpected error occurred while compiling expressions. Native compiler return value: '-1073741511'

    One of my web project, which has a rdlc file using some expressions, was working fine while developi ...

  3. openfire/spark/asmack 环境调试纪要

    项目需要简单搭建openfire/spark/asmack的环境及程序demo,本文简单记录以免遗忘. 1.openfire/spark 是java编写的xmpp服务器及PC客户端,安装过程相当简单一 ...

  4. openfire+asmack搭建的安卓即时通讯(七) 15.5.27

    本地化之章! 往期传送门: 1.http://www.cnblogs.com/lfk-dsk/p/4398943.html 2.http://www.cnblogs.com/lfk-dsk/p/441 ...

  5. android studio出现Error:compileSdkVersion android-x requires compiling with JDK 7问题

    初装Android studio的童鞋可能或多或少会存在一些问题,比如出现Error:compileSdkVersion android-x requires compiling with JDK 7 ...

  6. [译] C track: compiling C programs.

    原文:C track: compiling C programs. C track: compiling C programs. 尽管有些计算机语言(如 Schema 或者 Basic)通常使用交互式 ...

  7. openfire+asmack搭建的安卓即时通讯(四) 15.4.10

    之前的教程不知道你们成功了没,,,没成功可以问我啊=-= 第四篇博文是要实现发送消息的功能. 首先在我们登陆后的活动的layout里添加这样的两个控件,一个EditText和一个Button用于发送数 ...

  8. openfire+asmack搭建的安卓即时通讯(一) 15.4.7

    最进开始做一些android的项目,除了一个新闻客户端的搭建,还需要一个实现一个即时通讯的功能,参考了很多大神成型的实例,了解到operfire+asmack是搭建简易即时通讯比较方便,所以就写了这篇 ...

  9. maven 启动 报错 Fatal error compiling: 无效的目标发行版

    http://news.tuxi.com.cn/news/119999990123162/31622105.html http://lyking2001.iteye.com/blog/837440 针 ...

随机推荐

  1. poj 2240 Arbitrage (最短路 bellman_ford)

    题目:http://poj.org/problem?id=2240 题意:给定n个货币名称,给m个货币之间的汇率,求会不会增加 和1860差不多,求有没有正环 刚开始没对,不知道为什么用 double ...

  2. Socket编程(九)

    此为网络编程的一个系列,后续会把内容补上.....

  3. ubuntuy用户切换和密码修改

    修改当前用户的密码 $passwd 修改用户密码 $sudo passwd 用户名 切换到其他帐号(需要该用户的密码) $su 用户名 切换到root帐号 $sudo -s

  4. [面试题] for() while() 条件判断 赋值问题

    http://group.jobbole.com/7963/#comm-11311 [题目]:下列for循环的循环体执行次数为 for(int i=10, j=1; i=j=0; i++, j--)( ...

  5. Java开源项目(备查)

    转自:http://www.blogjava.net/Carter0618/archive/2008/08/11/221222.html Spring Framework  [Java开源 J2EE框 ...

  6. SQL中的CASE WHEN用法

    其语法如下: 1)case vlaue when [compare-value]then reslut [when[compare-value]] then result ...] [else res ...

  7. Java序列化 如何把多个对象存储在一个文件中

    /** * 用于保存模板文件,内容包括: * 1,标志位,1 int * 2,版本   1 int * 3,数据头长度 1 int * 4,预留数据头空间  5120 byte * 5,后续数据长度  ...

  8. create Context Menu in Windows Forms application using C# z

    In this article let us see how to create Context Menu in Windows Forms application using C# Introduc ...

  9. STM32L152 Keil 开发环境 显示Internal command error Flash down

    使用Keil开发环境对STM32L Discovery进行开发,更新一次firmware后就不能连接目标板了,报错Internal command error Flash download faile ...

  10. Mongodb操作总结

    1.Mongovue里面可以直接group by ,这个时候一定要注意,group by的任何条件的是 json, 注意当值是Int,非string型的时候,值不要加上双引号 2.注意group by ...