BS1053-基于安卓+websocket实现大学校园社交通讯APP

发布于:2022-11-03 ⋅ 阅读:(336) ⋅ 点赞:(0)

基于安卓的校园社交通讯APP,系统基于安卓架构开发实现手机端校园社交圈子功能。程序主要包含用户注册,用户登录,线上聊天,发布朋友圈,用户通讯录,文件发送,个人信息等功能模块,系统集成
实现了用户朋友圈内容的广播推送,实现用户聊天窗口发送图片及文件。

原文地址

一、程序设计

本次基于地图实现的车位智慧推荐系统APP,主要内容涉及:

主要功能模块:用户注册,用户登录,线上聊天,发布朋友圈,用户通讯录,文件发送,个人信息等
主要包含技术:java,安卓,websocket,html,javascript
主要包含算法:数据分析计算等

二、效果实现

系统效果

在这里插入图片描述

其他效果省略

核心代码

class Builder extends Message{
const soundUri = ‘sound_uri’;
const notifyForeground = ‘notify_foreground’;
const notifyEffect = ‘notify_effect’;
const intentUri = ‘intent_uri’;
const webUri = ‘web_uri’;
const flowControl = ‘flow_control’;
const callback = ‘callback’;
public function __construct(){
$this->notify_id = 0;
$this->notify_type = -1;
$this->payload = ‘’;
t h i s − > r e s t r i c t e d p a c k a g e n a m e = C o n s t a n t s : : this->restricted_package_name = Constants:: this>restrictedpackagename=Constants::packageName;
parent::__construct();
}

public function payload($payload){
	$this->payload = $payload;
}

public function title($title){
	$this->title = $title;
}

public function description($description){
	$this->description = $description;
}

public function passThrough($passThrough){
	$this->pass_through = $passThrough;
}

public function notifyType($type){
	$this->notify_type = $type;
}

public function restrictedPackageNames($packageNameList){
            $jointPackageNames = '';
	foreach($packageNameList as $packageName){
		if(isset($packageName)){
			$jointPackageNames .= $packageName.Constants::$comma;
		}
	}
	$this->restricted_package_name = $jointPackageNames;
}

public function timeToLive($ttl){
	$this->time_to_live = $ttl;
}

public function timeToSend($timeToSend){
	$this->time_to_send = $timeToSend;
}

public function notifyId($notifyId){
	$this->notify_id = $notifyId;
}

public function extra($key,$value){
	$this->extra[$key] = $value;
}

public function build(){
	$keys = array(
			'payload','title','description','pass_through','notify_type',
			'restricted_package_name','time_to_live','time_to_send','notify_id'		
	);
	foreach($keys as $key){
		if(isset($this->$key)){
			$this->fields[$key] = $this->$key;
			$this->json_infos[$key] = $this->$key;
		}
	}
	
	//单独处理extra
	$JsonExtra = array();
	if(count($this->extra) > 0){
		foreach($this->extra as $extraKey=>$extraValue){
			$this->fields[Message::EXTRA_PREFIX.$extraKey] = $extraValue;
			$JsonExtra[$extraKey] = $extraValue;
		}
	}
	$this->json_infos['extra'] = $JsonExtra;
	
}

}