Skip to content

Commit

Permalink
starrtc demo for android v1.2.2
Browse files Browse the repository at this point in the history
  • Loading branch information
895377235 committed Dec 29, 2018
1 parent 7bf83cf commit 8688899
Show file tree
Hide file tree
Showing 203 changed files with 7,353 additions and 901 deletions.
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -106,4 +106,8 @@ QQ群:807242783

更新记录
===
https://github.com/starrtc/android-demo/wiki/Changelog
https://github.com/starrtc/android-demo/wiki/Changelog

对比
===
webRTC vs starRTC: https://github.com/starrtc/android-demo/raw/master/webRTC_vs_starRTC.mp4
Binary file modified StarRTC_demo.apk
Binary file not shown.
27 changes: 18 additions & 9 deletions app/app.iml
Original file line number Diff line number Diff line change
Expand Up @@ -23,19 +23,19 @@
</facet>
</component>
<component name="NewModuleRootManager" LANGUAGE_LEVEL="JDK_1_7">
<output url="file://$MODULE_DIR$/build/intermediates/classes/debug" />
<output-test url="file://$MODULE_DIR$/build/intermediates/classes/test/debug" />
<output url="file://$MODULE_DIR$/build/intermediates/javac/debug/compileDebugJavaWithJavac/classes" />
<output-test url="file://$MODULE_DIR$/build/intermediates/javac/debugUnitTest/compileDebugUnitTestJavaWithJavac/classes" />
<exclude-output />
<content url="file://$MODULE_DIR$">
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/apt/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/not_namespaced_r_class_sources/debug/processDebugResources/r" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/debug" isTestSource="false" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/rs/debug" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/res/resValues/debug" type="java-resource" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/apt/androidTest/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/r/androidTest/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/not_namespaced_r_class_sources/debugAndroidTest/processDebugAndroidTestResources/r" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/aidl/androidTest/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/buildConfig/androidTest/debug" isTestSource="true" generated="true" />
<sourceFolder url="file://$MODULE_DIR$/build/generated/source/rs/androidTest/debug" isTestSource="true" generated="true" />
Expand Down Expand Up @@ -84,18 +84,27 @@
<sourceFolder url="file://$MODULE_DIR$/src/test/java" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/rs" isTestSource="true" />
<sourceFolder url="file://$MODULE_DIR$/src/test/shaders" isTestSource="true" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/assets" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/annotation_processor_list" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/apk_list" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/blame" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/check-libraries" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/check-manifest" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/classes" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/checkDebugClasspath" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/checkReleaseClasspath" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/compatible_screen_manifest" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/incremental" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/javaPrecompile" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/instant_run_merged_manifests" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/javac" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/jniLibs" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/manifests" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/merged_assets" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/merged_manifests" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/prebuild" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/processed_res" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/res" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/rs" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/shader_assets" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/shaders" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/splits-support" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/split_list" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/symbols" />
<excludeFolder url="file://$MODULE_DIR$/build/intermediates/transforms" />
<excludeFolder url="file://$MODULE_DIR$/build/outputs" />
Expand Down
11 changes: 9 additions & 2 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ apply plugin: 'com.android.application'

android {
compileSdkVersion 25
buildToolsVersion '27.0.3'
buildToolsVersion '28.0.3'
defaultConfig {
applicationId "com.starrtc.demo"
minSdkVersion 18
minSdkVersion 17
targetSdkVersion 25
versionCode 1
versionName "1.0"
Expand All @@ -26,6 +26,13 @@ android {
jniLibs.srcDirs = ['libs']
}
}

lintOptions {
checkReleaseBuilds false
// Or, if you prefer, you can continue to check for errors in release builds,
// but continue the build even when errors are found:
abortOnError false
}
}


Expand Down
Binary file modified app/libs/armeabi-v7a/libstarRTC.so
Binary file not shown.
Binary file modified app/libs/star_rtc_sdk.jar
Binary file not shown.
85 changes: 65 additions & 20 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@

<uses-feature android:name="android.hardware.camera" />
<uses-feature android:name="android.hardware.camera.autofocus" />

<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.FLASHLIGHT" />
<uses-permission android:name="android.permission.INTERNET" />
Expand All @@ -13,6 +14,8 @@
<uses-permission android:name="android.permission.BLUETOOTH" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />

<application
android:allowBackup="true"
Expand All @@ -25,14 +28,14 @@
android:screenOrientation="portrait">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>

<!-- starAvSdk -->
<!-- 【必须】消息收发service -->
<!-- <service
<!--
<service
android:name="com.starrtc.starrtcsdk.core.service.StarService"
android:exported="true">
<intent-filter>
Expand All @@ -45,19 +48,51 @@
<intent-filter>
<action android:name="cn.starav.staravsdk.service.StarAssistService" />
</intent-filter>
</service>-->

</service>
-->
<!-- starAvSdk -->
<service
android:name=".demo.service.FloatWindowsService"
android:exported="false">
</service>-->
android:exported="false"></service>

<activity
android:name=".demo.StarAvDemoActivity"
android:screenOrientation="portrait" />

<!-- 设置 -->
<activity
android:name=".demo.setting.AboutActivity"
android:screenOrientation="portrait" />
<activity
android:name=".demo.setting.SettingActivity"
android:screenOrientation="portrait" />

<!-- VOIP -->
<activity
android:name=".demo.voip.VoipListActivity"
android:screenOrientation="portrait" />
<activity
android:name=".demo.voip.VoipActivity"
android:screenOrientation="portrait" />
<activity
android:name=".demo.voip.VoipAudioActivity"
android:screenOrientation="portrait" />
<activity
android:name=".demo.voip.VoipCreateActivity"
android:screenOrientation="portrait" />
<activity
android:name=".demo.voip.VoipRingingActivity"
android:screenOrientation="portrait" />
<!-- P2P直连 -->
<activity android:name=".demo.p2p.VoipP2PDemoActivity"
android:screenOrientation="landscape"/>
<activity android:name=".demo.p2p.VoipP2PCreateActivity"
android:screenOrientation="landscape"/>
<activity android:name=".demo.p2p.VoipP2PRingingActivity"
android:screenOrientation="landscape"/>
<activity android:name=".demo.p2p.VoipP2PActivity"
android:screenOrientation="landscape"/>
<!-- 视频互动直播 -->
<activity
android:name=".demo.videolive.VideoLiveListActivity"
android:screenOrientation="portrait" />
Expand All @@ -67,6 +102,8 @@
<activity
android:name=".demo.videolive.VideoLiveActivity"
android:screenOrientation="portrait" />

<!-- 视频会议 -->
<activity
android:name=".demo.videomeeting.VideoMeetingActivity"
android:screenOrientation="landscape" />
Expand All @@ -76,15 +113,13 @@
<activity
android:name=".demo.videomeeting.VideoMeetingCreateActivity"
android:screenOrientation="portrait" />
<activity
android:name=".demo.test.EchoTestActivity"
android:screenOrientation="portrait" />

<!-- 测试 -->
<activity
android:name=".demo.test.LoopTestActivity"
android:screenOrientation="landscape" />
<activity
android:name=".demo.setting.SettingActivity"
android:screenOrientation="portrait" />

<!-- IM -->
<activity
android:name=".demo.im.chatroom.ChatroomActivity"
android:screenOrientation="portrait" />
Expand All @@ -110,27 +145,37 @@
android:name=".demo.im.group.MessageGroupListActivity"
android:screenOrientation="portrait" />
<activity
android:name=".demo.voip.VoipRingingActivity"
android:name=".demo.im.c2c.C2CListActivity"
android:screenOrientation="portrait" />
<activity
android:name=".demo.StarAvDemoActivity"
android:name=".demo.im.c2c.C2CCreateActivity"
android:screenOrientation="portrait" />
<activity
android:name=".demo.test.LayoutTestActivity"
android:name=".demo.im.group.MessageGroupSettingActivity"
android:screenOrientation="portrait" />

<!-- 音频互动直播 -->
<activity
android:name=".demo.im.c2c.C2CListActivity"
android:name=".demo.audiolive.AudioLiveListActivity"
android:screenOrientation="portrait" />
<activity
android:name=".demo.im.c2c.C2CCreateActivity"
android:name=".demo.audiolive.AudioLiveCreateActivity"
android:screenOrientation="portrait" />
<activity
android:name=".demo.im.group.MessageGroupSettingActivity"
android:name=".demo.audiolive.AudioLiveActivity"
android:screenOrientation="portrait" />

<!-- 小班课 -->
<activity
android:name=".demo.voip.VoipCreateActivity"
android:name=".demo.miniclass.MiniClassCreateActivity"
android:screenOrientation="portrait" />
<activity
android:name=".demo.miniclass.MiniClassListActivity"
android:screenOrientation="portrait" />
<activity android:name=".demo.setting.AboutActivity"></activity>
<activity
android:name=".demo.miniclass.MiniClassActivity"
android:screenOrientation="landscape" />
<activity android:name=".demo.setting.SetupServerHostActivity"></activity>
</application>

</manifest>
Binary file removed app/src/main/assets/sample.pcm
Binary file not shown.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.starrtc.demo.demo.database;
package com.starrtc.demo.database;

import android.database.Cursor;

Expand Down Expand Up @@ -96,13 +96,14 @@ public void setHistory(HistoryBean historyBean,Boolean hasRead){
historyBean.setNewMsgCount(0);
}
if (cursor != null) cursor.close();
coreDBM.execSQL("delete from " + HISTORY_TABLE + " where type=? and conversationId=?",
new Object[]{historyBean.getType(),historyBean.getConversationId()});
coreDBM.execSQL("insert into " + HISTORY_TABLE + "(type,conversationId,newMsg,lastMsg,lastTime,groupName,groupCreaterId) values(?,?,?,?,?,?,?)",
new Object[]{historyBean.getType(), historyBean.getConversationId(),
coreDBM.execSQL("UPDATE "+HISTORY_TABLE+" SET newMsg = ?," +
" lastMsg = ?," +
" lastTime = ?" +
" where type=? and conversationId=?",
new Object[]{
historyBean.getNewMsgCount(), historyBean.getLastMsg(),
historyBean.getLastTime(),historyBean.getGroupName(),
historyBean.getGroupCreaterId()});
historyBean.getLastTime(),
historyBean.getType(), historyBean.getConversationId()});
}else{
if(hasRead){
historyBean.setNewMsgCount(0);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.starrtc.demo.demo.database;
package com.starrtc.demo.database;

public class HistoryBean {
private int id = 0;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
package com.starrtc.demo.demo.database;
package com.starrtc.demo.database;

public class MessageBean {
private int id;
Expand Down
26 changes: 26 additions & 0 deletions app/src/main/java/com/starrtc/demo/demo/BaseActivity.java
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,11 @@
import android.view.View;

import com.starrtc.demo.R;
import com.starrtc.demo.demo.p2p.VoipP2PRingingActivity;
import com.starrtc.demo.demo.voip.VoipRingingActivity;
import com.starrtc.demo.utils.AEvent;
import com.starrtc.demo.utils.IEventListener;
import com.starrtc.starrtcsdk.api.XHClient;
import com.starrtc.starrtcsdk.core.im.message.XHIMMessage;

import org.json.JSONException;
Expand All @@ -28,13 +30,15 @@ protected void onPause() {

private void addListener(){
AEvent.addListener(AEvent.AEVENT_VOIP_REV_CALLING,this);
AEvent.addListener(AEvent.AEVENT_VOIP_P2P_REV_CALLING,this);
AEvent.addListener(AEvent.AEVENT_C2C_REV_MSG,this);
AEvent.addListener(AEvent.AEVENT_GROUP_REV_MSG,this);
AEvent.addListener(AEvent.AEVENT_USER_ONLINE,this);
AEvent.addListener(AEvent.AEVENT_USER_OFFLINE,this);
}
private void removeListener(){
AEvent.removeListener(AEvent.AEVENT_VOIP_REV_CALLING,this);
AEvent.removeListener(AEvent.AEVENT_VOIP_P2P_REV_CALLING,this);
AEvent.removeListener(AEvent.AEVENT_C2C_REV_MSG,this);
AEvent.removeListener(AEvent.AEVENT_GROUP_REV_MSG,this);
AEvent.removeListener(AEvent.AEVENT_USER_ONLINE,this);
Expand Down Expand Up @@ -67,6 +71,14 @@ public void run() {
startActivity(intent);
}
break;
case AEvent.AEVENT_VOIP_P2P_REV_CALLING:
if(MLOC.canPickupVoip){
MLOC.hasNewVoipMsg = true;
Intent intent = new Intent(BaseActivity.this,VoipP2PRingingActivity.class);
intent.putExtra("targetId",eventObj.toString());
startActivity(intent);
}
break;
case AEvent.AEVENT_C2C_REV_MSG:
MLOC.hasNewC2CMsg = true;
runOnUiThread(new Runnable() {
Expand Down Expand Up @@ -121,6 +133,13 @@ public void run() {
@Override
public void run() {
MLOC.showMsg(BaseActivity.this,"服务已断开");
if(findViewById(R.id.loading)!=null) {
if (XHClient.getInstance().getIsOnline()) {
findViewById(R.id.loading).setVisibility(View.INVISIBLE);
} else {
findViewById(R.id.loading).setVisibility(View.VISIBLE);
}
}
}
});
break;
Expand All @@ -129,6 +148,13 @@ public void run() {
@Override
public void run() {
// MLOC.showMsg(BaseActivity.this,"服务已连接");
if(findViewById(R.id.loading)!=null) {
if (XHClient.getInstance().getIsOnline()) {
findViewById(R.id.loading).setVisibility(View.INVISIBLE);
} else {
findViewById(R.id.loading).setVisibility(View.VISIBLE);
}
}
}
});
break;
Expand Down
Loading

0 comments on commit 8688899

Please sign in to comment.