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.

 mkdir asmack && cd asmack
vagrant box add lucid32 http://files.vagrantup.com/lucid32.box
vagrant init lucid32
vagrant ssh
sudo apt-get update
sudo apt-get install git-core openjdk-6-jdk curl vim subversion ant advancecomp
curl -O http://dl.google.com/android/android-sdk_r21.1-linux.tgz
tar -xzvf android-sdk_r21.1-linux.tgz
cd android-sdk-linux/
tools/android update sdk --no-ui
cd ..
git clone https://github.com/Flowdalic/asmack.git
cd asmack/
echo "sdk-location=/home/vagrant/android-sdk-linux" > local.properties
Edit build.xml. Remove the check-android-exists dependency from the compile-android target.
./build.bash
cp build/asmack-android-17.jar /vagrant
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. JAVA并行框架学习之ForkJoin

    当硬件处理能力不能按照摩尔定律垂直发展的时候,选择了水平发展,多核处理器已经广泛应用.未来随着技术的进一步发展,可能出现成百上千个处理核心,但现有的程序运行在多核心处理器上并不能得到较大性能的提升,主 ...

  2. FormsAuthentication 登录兼容 IE11 保存cookie

    现象:使用FormsAuthentication进行登录验证,在IE11客户端无法保存cookie 解决方法:在web.config中的forms中增加cookieless="UseCook ...

  3. Gentoo源码安装图解

    Gentoo源码安装 一.前期准备 (1)下载以下三个文件 二.配置安装环境 (1)用光盘引导到LiveCD环境 (2)配置当前LiveCD环境的网络 安装Gentoo时,服务器引导的LiveCD环境 ...

  4. mysql中增加某一时间段内的时间数据(包含:时间、年、月、日、第几周、季度)

    创建表dim_date: create table `dim_date` ( `year` int (20), `month` int (20), `day` int (20), `week` int ...

  5. windows ssh RPi 2B

    /************************************************************************* * windows ssh RPi 2B * 声明 ...

  6. Java [Leetcode 242]Valid Anagram

    题目描述: Given two strings s and t, write a function to determine if t is an anagram of s. For example, ...

  7. ORACLE DATAGURARD 折腾记二

    前文再续,书接上一回,这次折腾Data Guard的一个重要目的是利用switchover实现机器的升级,怎么switchover呢?按照我的理解,Data Guard的角色切换是这样一个过程: (1 ...

  8. 【jQuery】jQuery操作<input>的聚焦与全选其内容

    实现效果: 源代码: $(function() { $("#exist_code_remind").attr("style","display:non ...

  9. @Html.Partial,@Html.Action,@Html.RenderPartial,@Html.RenderAction区别 .(转)

    mvc renderaction   renderpartial  杂谈      Html.RenderPartial与Html.RenderAction这两个方法都是用来在界面上嵌入用户控件的. ...

  10. Innodb buffer pool/redo log_buffer 相关

    InnoDB存储引擎是基于磁盘存储的,并将其中的记录按照页的方式进行管理.在数据库系统中,由于CPU速度和磁盘速度之前的鸿沟,通常使用缓冲池技术来提高数据库的整体性能. 1. Innodb_buffe ...