-
Notifications
You must be signed in to change notification settings - Fork 56
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
29 changed files
with
359 additions
and
78 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file renamed
BIN
+831 KB
...oidRTCDemo/app/libs/qndroid-rtc-3.0.2.jar → ...oidRTCDemo/app/libs/qndroid-rtc-3.1.0.jar
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
153 changes: 118 additions & 35 deletions
153
QNDroidRTCDemo/app/src/main/java/com/qiniu/droid/rtc/demo/activity/RoomActivity.java
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
62 changes: 62 additions & 0 deletions
62
QNDroidRTCDemo/app/src/main/java/com/qiniu/droid/rtc/demo/service/ForegroundService.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,62 @@ | ||
package com.qiniu.droid.rtc.demo.service; | ||
|
||
import android.app.Notification; | ||
import android.app.NotificationChannel; | ||
import android.app.NotificationManager; | ||
import android.app.Service; | ||
import android.content.Context; | ||
import android.content.Intent; | ||
import android.os.Binder; | ||
import android.os.Build; | ||
import android.os.IBinder; | ||
import android.support.v4.app.NotificationCompat; | ||
import android.util.Log; | ||
|
||
public class ForegroundService extends Service { | ||
|
||
private static final String TAG = "ForegroundService"; | ||
private final IBinder mBinder = new LocalBinder(); | ||
|
||
public class LocalBinder extends Binder { | ||
ForegroundService getService() { | ||
return ForegroundService.this; | ||
} | ||
} | ||
|
||
@Override | ||
public void onCreate() { | ||
super.onCreate(); | ||
if (Build.VERSION.SDK_INT >= 26) { | ||
String CHANNEL_ID = "screen share"; | ||
NotificationChannel channel = new NotificationChannel(CHANNEL_ID, | ||
"screen share", | ||
NotificationManager.IMPORTANCE_DEFAULT); | ||
|
||
((NotificationManager) getSystemService(Context.NOTIFICATION_SERVICE)).createNotificationChannel(channel); | ||
Notification notification = new NotificationCompat.Builder(this, CHANNEL_ID) | ||
.setContentTitle("") | ||
.setContentText("").build(); | ||
startForeground(1, notification); | ||
Log.i(TAG, "start foreground"); | ||
} | ||
} | ||
|
||
@Override | ||
public void onDestroy() { | ||
super.onDestroy(); | ||
if (Build.VERSION.SDK_INT >= 26) { | ||
stopForeground(true); | ||
} | ||
} | ||
|
||
@Override | ||
public IBinder onBind(Intent intent) { | ||
return mBinder; | ||
} | ||
|
||
@Override | ||
public int onStartCommand(final Intent intent, int flags, int startId) { | ||
return super.onStartCommand(intent, flags, startId); | ||
} | ||
} | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.