Android 4.2 是谷歌新一代移动操作系统,它沿用了 4.1 果冻豆 ”(Jelly Bean) 这一名称,与 Android 4.1 相似性很高,但仍在细节之后做了一些改进与升级,比较重要的包括: Photo Sphere 全景拍照;键盘手势输入; Miracast 无线显示共享;手势放大缩小屏幕,以及为盲人用户设计的语音输出和手势模式导航功能等。尤其令人关注的是,谷歌在 Android 4.2 中新加入了新的恶意软件扫描功能。
过去一年,谷歌一直为在使用 Android 系统的只能手机和平板电脑上推出更具特色的应用和数字内容而努力。今年五月,谷歌重整推出了 Google Play 应用商店,目前其已有超过 70 万个应用,与苹果旗鼓相当,苹果应用商店的应用质量相对更高。今年第三季度,在中国地区 Android 系统智能手机的市场份额为 87.7% ,而在美国地区的市场份额为 60.5%
随着近些年社交通讯应用的崛起,传统的微信延时应用业务已经不能满足人们的日常使用需求,人们渴求的是一种更好的即时通讯。但是纵观国内外此类应用少之又少,优秀的更如凤毛麟角,但并不意味着没有。接下来小编要介绍的就是一款十分优秀的即时通讯应用,可以在 Android4.2 上完美运行的!
AnyChat SDK ,支持 Windows Linux Mobile Android iOS Mac 等操作系统平台,提供客户端 SDK 、服务器端 SDK ,可与第三方平台紧密集成。
AnyChat for Android 采用 JNI 接口技术,提供纯 JAVA 接口,支持 Android 2.1 Android 2.2 Android 2.3 以及 Android 4.x 等平台。
AnyChat for Android 可与其它平台的 AnyChat 互联互通,连接同一个服务器程序,有关服务器的 SDK 可参考 AnyChat Platform Core SDK 开发包。
AnyChat for Android SDK 包里面提供了 Demo 程序源代码(基于 Eclipse 工程)供参考,下面是部分代码段:
(来自 AnyChatAudioHelper.java
package com.bairuitech.anychat;

import android.media.AudioFormat;
import android.media.AudioManager;
import android.media.AudioRecord;
import android.media.AudioTrack;
import android.media.MediaRecorder;
import android.util.Log;


// AnyChat 音频包装类,实现音频采集、播放等
public class AnyChatAudioHelper {
             private final static String TAG = "ANYCHAT";
             private AudioTrack mAudioTrack = null;
             private AudioRecord mAudioRecord = null;
            
             private PlayAudioThread mPlayAudioThread = null;                     // 播放线程
             private boolean mPlayThreadExitFlag = false;                                     // 播放线程退出标志
             private int mMinPlayBufSize = 0;
             private boolean mAudioPlayReleased = false;
            
             private RecordAudioThread mRecordAudioThread = null;     // 采集线程
             private boolean mRecordThreadExitFlag = false;                             // 采集线程退出标志
             private int mMinRecordBufSize = 0;
             private boolean mAudioRecordReleased = false;

             // 初始化音频播放器
             public int InitAudioPlayer( int profile) {
                             if(mAudioTrack != null)
                                         return 0;
                            Log.d(TAG, "InitAudioPlayer, profile: " + profile);
                             int channel, samplerate, samplebit;
                             // 根据上层设定的profile来配置参数
                             if(profile==1) {
                                         samplerate = 16000;
                                         channel = AudioFormat.CHANNEL_CONFIGURATION_MONO;
                                         samplebit = AudioFormat.ENCODING_PCM_16BIT;
                            }
                             else if(profile==2) {
                                         samplerate = 44100;
                                         channel = AudioFormat.CHANNEL_CONFIGURATION_STEREO;
                                         samplebit = AudioFormat.ENCODING_PCM_16BIT;
                            }
                             else {
                                         return -1;
                            }
                             try {
                                         mAudioPlayReleased = false;
                                         // 获得构建对象的最小缓冲区大小
                                         mMinPlayBufSize = AudioTrack.getMinBufferSize(samplerate, channel, samplebit);
                                         mAudioTrack = new AudioTrack(AudioManager.STREAM_MUSIC, samplerate, channel, samplebit, mMinPlayBufSize, AudioTrack.MODE_STREAM);
                                        
                                         if (mPlayAudioThread == null)
                                         {
                                                        mPlayThreadExitFlag = false;
                                                        mPlayAudioThread = new PlayAudioThread();
                                                        mPlayAudioThread.start();
                                         }
                                         Log.d(TAG, "mMinPlayBufSize = " + mMinPlayBufSize);
                            }
                             catch(Exception e)
                            {
                                         return -1;
                            }
                             return 0;
             }

完整代码包下载:
Android http://down.51cto.com/data/711001
Windows http://down.51cto.com/data/715497
Linux http://download.csdn.net/detail/weixiaowenrou/5169796
IOS http://down.51cto.com/data/715486
WEB http://down.51cto.com/data/710983