Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/good-life/PushTalk
Browse files Browse the repository at this point in the history
  • Loading branch information
caosd committed Dec 24, 2012
2 parents 9176a87 + 1bd60a9 commit 113faa5
Show file tree
Hide file tree
Showing 22 changed files with 28 additions and 50 deletions.
7 changes: 5 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
# 推聊概述 PushTalk Overview
推聊是一个基于极光推送的Android手机聊天系统。支持群聊与点对点聊天。当前包括Android客户端与Java服务器端。3分钟就可以整套系统跑起来。

![](https://github.com/downloads/good-life/PushTalk/pushtalk_architecture_2.png)

### 项目官方网站
<http://github.com/good-life/pushtalk>


### 功能与特点

##### 功能列表
Expand Down Expand Up @@ -50,11 +51,13 @@

推聊服务器默认使用 `10010` 端口。可以在上述命令后指定使用另外的端口。比如以下命令指定使用 `10011` 来启动推聊聊天服务器:

java -jar pushtalk-server-with-dependencies.jar 10011
java -Dfile.encoding=UTF-8 -jar pushtalk-server-with-dependencies.jar 10011


### Android 客户端

![](https://github.com/downloads/good-life/PushTalk/pushtalk_client.png)

客户端运行,请在 github 文件下载页 <https://github.com/good-life/PushTalk/downloads/> 下载 Android apk 安装到 Android 手机即可。

你也可以自己编译 `/client-android` 项目之后安装到手机。
Expand Down
23 changes: 0 additions & 23 deletions RunnningServer.md

This file was deleted.

2 changes: 1 addition & 1 deletion client-android/.project
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>PushTalk</name>
<comment></comment>
<comment>PushTalk android client</comment>
<projects>
</projects>
<buildSpec>
Expand Down
6 changes: 3 additions & 3 deletions client-android/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="org.pushtalk.android"
android:versionCode="21"
android:versionName="0.2.1" >
android:versionCode="22"
android:versionName="0.2.2" >

<uses-sdk
android:minSdkVersion="7"
Expand Down Expand Up @@ -119,7 +119,7 @@

<!-- Required . Enable it you can get statistics data with channel -->
<meta-data android:name="JPUSH_CHANNEL" android:value="developer-default" />
<meta-data android:name="JPUSH_APPKEY" android:value="7d431e42dfa6a6d693ac2d04" /> <!-- </>值来自开发者平台取得的AppKey -->
<meta-data android:name="JPUSH_APPKEY" android:value="7d431e42dfa6a6d693ac2d04" />

<activity
android:name=".activity.ServerConfActivity"
Expand Down
2 changes: 1 addition & 1 deletion client-android/src/org/pushtalk/android/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ public class Config {

public static boolean IS_TEST_MODE = true;

public static String VERSION = "0.2.1";
public static String VERSION = "0.2.2";

public static String WEB_JS_MODULE = "pushtalk";

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public static String getUdid(Context context) {

String macAddress = AndroidUtil.getWifiMacAddress(context);
if (!StringUtils.isEmpty(macAddress)) {
String udid = StringUtils.emptyStringIfNull(macAddress
String udid = StringUtils.toMD5(macAddress
+ Build.MODEL + Build.MANUFACTURER
+ Build.ID + Build.DEVICE);
return udid;
Expand Down
1 change: 0 additions & 1 deletion server-java/.classpath
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" path="src"/>
<classpathentry kind="src" path="resources"/>
<classpathentry kind="src" path="test"/>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER"/>
<classpathentry kind="lib" path="libs/commons-cli-1.2.jar"/>
Expand Down
4 changes: 2 additions & 2 deletions server-java/.project
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>hbase-service</name>
<comment></comment>
<name>pushtalk-server-java</name>
<comment>PushTalk java server</comment>
<projects>
</projects>
<buildSpec>
Expand Down
Binary file removed server-java/resources/images/box_repeat.png
Binary file not shown.
Binary file removed server-java/resources/images/cancel-off.png
Binary file not shown.
Binary file removed server-java/resources/images/cancel-on.png
Binary file not shown.
Binary file removed server-java/resources/images/close.png
Binary file not shown.
Binary file removed server-java/resources/images/favour.png
Binary file not shown.
Binary file removed server-java/resources/images/star-off.png
Binary file not shown.
Binary file removed server-java/resources/images/star-on.png
Binary file not shown.
9 changes: 0 additions & 9 deletions server-java/resources/log4j.properties

This file was deleted.

5 changes: 5 additions & 0 deletions server-java/src/org/pushtalk/server/Config.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,13 @@ public class Config {
// Should be assign value when db init
public static String SERVER_ID;

public static final String JPUSH_USERNAME = "pushtalk";
public static final String JPUSH_PASSWORD = "654321";
public static final String JPUSH_APPKEY = "7d431e42dfa6a6d693ac2d04";

public static final String VERSION = "0.2.1";


public static final int CACHE_DURATION_DAYS = 7;
public static final int MESSAGE_CACHE_MAX_NUMBER = 100;
public static final int RECENT_CHATS_CACHE_MAX_NUMBER = 10;
Expand Down
8 changes: 3 additions & 5 deletions server-java/src/org/pushtalk/server/api/TalkServlet.java
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

import org.apache.commons.lang.StringUtils;
import org.apache.log4j.Logger;
import org.pushtalk.server.Config;
import org.pushtalk.server.model.Channel;
import org.pushtalk.server.model.Message;
import org.pushtalk.server.utils.ServiceUtils;
Expand All @@ -22,12 +23,9 @@ public class TalkServlet extends FreemarkerBaseServlet {
private static final long serialVersionUID = 348660245631638687L;
private static Logger LOG = Logger.getLogger(TalkServlet.class);

private static final String JPUSH_USERNAME = "pushtalk";
private static final String JPUSH_PASSWORD = "654321";
private static final String JPUSH_APPKEY = "7d431e42dfa6a6d693ac2d04";

private static int sendId = 0;
private static final JPushClient jpushClient = new JPushClient(JPUSH_USERNAME, JPUSH_PASSWORD, JPUSH_APPKEY);
private static final JPushClient jpushClient = new JPushClient(
Config.JPUSH_USERNAME, Config.JPUSH_PASSWORD, Config.JPUSH_APPKEY);

@Override
public void process(HttpServletRequest request,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,9 @@ public void process(HttpServletRequest request,

String udid = request.getParameter("udid");
if (null == udid) {
responseError(response, "udid is required!");
responseError(response, "udid is required! " +
"\n\nPush Talk server only support Android/iOS WebView client, " +
"don't support accessing from web browser directly.");
return;
}

Expand Down
2 changes: 1 addition & 1 deletion server-java/src/org/pushtalk/server/web/template/main.html
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@
<div>
<div>欢迎您:${user.name}!</div>
<div class="comm-tag">
<!-- <a href="/user/changeName?udid=${udid}">改名</a> -->
<a href="/user/changeName?udid=${udid}">改名</a>
<a href="/channel/new?udid=${udid}">新频道</a>
<a href="/channel?udid=${udid}">全部频道</a>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@
<head>
<meta name="viewport" content="width=device-width, initial-scale=1.0, user-scalable=no">
<meta charset="utf8">


<title>注册推聊</title>
<style>
* {margin:0;padding:0;}
Expand Down Expand Up @@ -156,3 +158,4 @@
</script>
</body>
</html>

0 comments on commit 113faa5

Please sign in to comment.