胡斌

add test for xuedianyun webrtc

正在显示 37 个修改的文件 包含 933 行增加0 行删除
  1 +.gradle
  2 +/local.properties
  3 +/.idea/workspace.xml
  4 +/.idea/libraries
  5 +.idea/
  6 +.DS_Store
  7 +/build
  8 +app/build
  9 +*.iml
  1 +apply plugin: 'com.android.application'
  2 +
  3 +android {
  4 + compileSdkVersion 26
  5 + defaultConfig {
  6 + applicationId "com.xuedianyun.cloudclass"
  7 + minSdkVersion 21
  8 + targetSdkVersion 26
  9 + versionCode 1
  10 + versionName "1.0"
  11 + // testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
  12 + vectorDrawables.useSupportLibrary= true
  13 + }
  14 + buildTypes {
  15 + release {
  16 + minifyEnabled false
  17 + proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
  18 + }
  19 + }
  20 + compileOptions {
  21 + targetCompatibility 1.8
  22 + sourceCompatibility 1.8
  23 + }
  24 +}
  25 +
  26 +dependencies {
  27 + implementation fileTree(dir: 'libs', include: ['*.jar'])
  28 + implementation 'com.android.support:appcompat-v7:26.1.0'
  29 + implementation 'com.android.support:design:26.1.0'
  30 + implementation 'com.android.support.constraint:constraint-layout:1.0.2'
  31 + implementation 'com.android.support:support-vector-drawable:26.1.0'
  32 + implementation 'org.webrtc:google-webrtc:1.0.+'
  33 + // testImplementation 'junit:junit:4.12'
  34 + // androidTestImplementation 'com.android.support.test:runner:1.0.1'
  35 + // androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
  36 +}
  37 +
  1 +# Add project specific ProGuard rules here.
  2 +# You can control the set of applied configuration files using the
  3 +# proguardFiles setting in build.gradle.
  4 +#
  5 +# For more details, see
  6 +# http://developer.android.com/guide/developing/tools/proguard.html
  7 +
  8 +# If your project uses WebView with JS, uncomment the following
  9 +# and specify the fully qualified class name to the JavaScript interface
  10 +# class:
  11 +#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
  12 +# public *;
  13 +#}
  14 +
  15 +# Uncomment this to preserve the line number information for
  16 +# debugging stack traces.
  17 +#-keepattributes SourceFile,LineNumberTable
  18 +
  19 +# If you keep the line number information, uncomment this to
  20 +# hide the original source file name.
  21 +#-renamesourcefileattribute SourceFile
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<manifest xmlns:android="http://schemas.android.com/apk/res/android"
  3 + package="com.xuedianyun.cloudclass">
  4 +
  5 + <application
  6 + android:allowBackup="true"
  7 + android:icon="@mipmap/ic_launcher"
  8 + android:label="@string/app_name"
  9 + android:roundIcon="@mipmap/ic_launcher_round"
  10 + android:supportsRtl="true"
  11 + android:theme="@style/AppTheme">
  12 + <activity
  13 + android:name="com.xuedianyun.cloudclass.MainActivity"
  14 + android:label="@string/app_name">
  15 + <intent-filter>
  16 + <action android:name="android.intent.action.MAIN" />
  17 + <category android:name="android.intent.category.LAUNCHER" />
  18 + </intent-filter>
  19 + </activity>
  20 + </application>
  21 + <uses-permission android:name ="android.permission.RECORD_AUDIO"/>
  22 + <uses-permission android:name ="android.permission.MODIFY_AUDIO_SETTINGS"/>
  23 + <uses-permission android:name="android.permission.CAMERA" />
  24 + <uses-feature android:name="android.hardware.camera" />
  25 + <uses-feature android:name="android.hardware.camera.autofocus" />
  26 + <uses-feature android:name="android.hardware.camera2.full" />
  27 + <uses-feature android:name="android.hardware.camera2.autofocus" />
  28 + <uses-permission android:name="android.permission.INTERNET" />
  29 + <uses-permission android:name="android.webkit.PermissionRequest" />
  30 +</manifest>
  1 +package com.xuedianyun.cloudclass;
  2 +
  3 +import android.Manifest;
  4 +import android.annotation.TargetApi;
  5 +import android.content.Intent;
  6 +import android.content.pm.PackageManager;
  7 +import android.net.Uri;
  8 +import android.os.Build;
  9 +import android.os.Bundle;
  10 +import android.support.annotation.NonNull;
  11 +import android.support.design.widget.BottomNavigationView;
  12 +import android.support.v4.app.ActivityCompat;
  13 +import android.support.v4.content.ContextCompat;
  14 +import android.support.v7.app.AppCompatActivity;
  15 +import android.util.Log;
  16 +import android.view.MenuItem;
  17 +import android.view.View;
  18 +import android.webkit.ConsoleMessage;
  19 +import android.webkit.PermissionRequest;
  20 +import android.webkit.WebChromeClient;
  21 +import android.webkit.WebSettings;
  22 +import android.webkit.WebView;
  23 +import android.webkit.WebViewClient;
  24 +
  25 +import com.xuedianyun.cloudclass.R;
  26 +
  27 +public class MainActivity extends AppCompatActivity {
  28 + private static final int CAMERA_REQUEST = 1888;
  29 +
  30 + private WebView mWebView;
  31 + //private String mCustomURL = "https://pclive.xuedianyun.com/pcBase/agora/";
  32 + private String mCustomURL = "https://webrtc.github.io/samples/src/content/devices/input-output/";
  33 + private String mWebrtcURL = "https://janus.conf.meetecho.com/videoroomtest.html";
  34 +
  35 + private BottomNavigationView.OnNavigationItemSelectedListener mOnNavigationItemSelectedListener
  36 + = new BottomNavigationView.OnNavigationItemSelectedListener() {
  37 +
  38 + @Override
  39 + public boolean onNavigationItemSelected(@NonNull MenuItem item) {
  40 + switch (item.getItemId()) {
  41 + case R.id.navigation_custom:
  42 + mWebView.loadUrl(mCustomURL);
  43 + return true;
  44 + case R.id.navigation_webrtc:
  45 + mWebView.loadUrl(mWebrtcURL);
  46 + return true;
  47 + case R.id.navigation_refresh:
  48 + mWebView.reload();
  49 + return true;
  50 + case R.id.navigation_open:
  51 + openBrowserWithURL(mWebView.getUrl());
  52 + return true;
  53 + }
  54 + return false;
  55 + }
  56 + };
  57 +
  58 + @Override
  59 + protected void onCreate(Bundle savedInstanceState) {
  60 + super.onCreate(savedInstanceState);
  61 +
  62 + setContentView(R.layout.activity_main);
  63 +
  64 + checkForAndAskForPermissions();
  65 +
  66 + BottomNavigationView navigation = (BottomNavigationView) findViewById(R.id.navigation);
  67 + navigation.setOnNavigationItemSelectedListener(mOnNavigationItemSelectedListener);
  68 + }
  69 +
  70 + @Override
  71 + public void onRequestPermissionsResult(int requestCode, @NonNull String[] permissions, @NonNull int[] grantResults) {
  72 + super.onRequestPermissionsResult(requestCode, permissions, grantResults);
  73 + switch (requestCode) {
  74 + case CAMERA_REQUEST: {
  75 + // If request is cancelled, the result arrays are empty.
  76 + if (grantResults.length > 0 && grantResults[0] == PackageManager.PERMISSION_GRANTED) {
  77 +
  78 + createWebView();
  79 +
  80 + } else {
  81 + // permission denied, boo! Disable the
  82 + // functionality that depends on this permission.
  83 + }
  84 +
  85 + return;
  86 + }
  87 +
  88 + // other 'case' lines to check for other
  89 + // permissions this app might request
  90 + }
  91 + }
  92 +
  93 + private void createWebView() {
  94 +
  95 + mWebView = (WebView) findViewById(R.id.webview);
  96 + setUpWebViewDefaults(mWebView);
  97 + mWebView.loadUrl(mCustomURL);
  98 + mWebView.setWebChromeClient(new WebChromeClient() {
  99 +
  100 + public boolean onConsoleMessage(ConsoleMessage m) {
  101 + Log.d("getUserMedia, WebView", m.message() + " -- From line "
  102 + + m.lineNumber() + " of "
  103 + + m.sourceId());
  104 +
  105 + return true;
  106 + }
  107 +
  108 + @Override
  109 + public void onPermissionRequest(final PermissionRequest request) {
  110 +
  111 + // getActivity().
  112 + MainActivity.this.runOnUiThread(new Runnable() {
  113 + @TargetApi(Build.VERSION_CODES.LOLLIPOP)
  114 + @Override
  115 + public void run() {
  116 + // Below isn't necessary, however you might want to:
  117 + // 1) Check what the site is and perhaps have a blacklist
  118 + // 2) Have a pop up for the user to explicitly give permission
  119 + //if(request.getOrigin().toString().equals("https://pclive.xuedianyun.com/") ||
  120 + // request.getOrigin().toString().equals("https://janus.conf.meetecho.com/")) {
  121 + request.grant(request.getResources());
  122 + // } else {
  123 + // request.deny();
  124 + // }
  125 + }
  126 + });
  127 + }
  128 + });
  129 + }
  130 +
  131 + private void checkForAndAskForPermissions() {
  132 + if (ContextCompat.checkSelfPermission(MainActivity.this,
  133 + Manifest.permission.RECORD_AUDIO)
  134 + != PackageManager.PERMISSION_GRANTED) {
  135 +
  136 + // No explanation needed; request the permission
  137 + if (ActivityCompat.shouldShowRequestPermissionRationale(MainActivity.this,
  138 + Manifest.permission.RECORD_AUDIO)) {
  139 +
  140 + //
  141 +
  142 + } else ActivityCompat.requestPermissions(MainActivity.this,
  143 + new String[]{Manifest.permission.RECORD_AUDIO}, CAMERA_REQUEST+1);
  144 + }
  145 + if (ContextCompat.checkSelfPermission(MainActivity.this,
  146 + Manifest.permission.CAMERA)
  147 + != PackageManager.PERMISSION_GRANTED) {
  148 +
  149 + // No explanation needed; request the permission
  150 + if (ActivityCompat.shouldShowRequestPermissionRationale(MainActivity.this,
  151 + Manifest.permission.CAMERA)) {
  152 +
  153 + //
  154 +
  155 + } else ActivityCompat.requestPermissions(MainActivity.this,
  156 + new String[]{Manifest.permission.CAMERA}, CAMERA_REQUEST);
  157 + } else {
  158 + // Permission has already been granted
  159 + createWebView();
  160 + }
  161 + }
  162 +
  163 + private void setUpWebViewDefaults(WebView webView) {
  164 +
  165 + WebSettings settings = webView.getSettings();
  166 + settings.setJavaScriptEnabled(true);
  167 +
  168 + if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
  169 + webView.setLayerType(View.LAYER_TYPE_HARDWARE, null);
  170 + }
  171 +
  172 + settings.setCacheMode(WebSettings.LOAD_NO_CACHE);
  173 + settings.setAllowContentAccess(true);
  174 + settings.setAllowFileAccessFromFileURLs(true);
  175 + settings.setAllowUniversalAccessFromFileURLs(true);
  176 + settings.setJavaScriptCanOpenWindowsAutomatically(true);
  177 + settings.setMediaPlaybackRequiresUserGesture(false);
  178 +
  179 + // Enable remote debugging via chrome://inspect
  180 + if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.KITKAT) {
  181 + WebView.setWebContentsDebuggingEnabled(true);
  182 + }
  183 +
  184 + webView.clearCache(true);
  185 + webView.clearHistory();
  186 + webView.setWebViewClient(new WebViewClient());
  187 + }
  188 +
  189 + private void openBrowserWithURL(String url) {
  190 +
  191 + Uri uri = Uri.parse("googlechrome://navigate?url=" + url);
  192 + Intent i = new Intent(Intent.ACTION_VIEW, uri);
  193 + if (i.resolveActivity(MainActivity.this.getPackageManager()) == null) {
  194 + i.setData(Uri.parse(url));
  195 + }
  196 +
  197 + MainActivity.this.startActivity(i);
  198 + }
  199 +}
  1 +<vector xmlns:android="http://schemas.android.com/apk/res/android"
  2 + xmlns:aapt="http://schemas.android.com/aapt"
  3 + android:width="108dp"
  4 + android:height="108dp"
  5 + android:viewportHeight="108"
  6 + android:viewportWidth="108">
  7 + <path
  8 + android:fillType="evenOdd"
  9 + android:pathData="M32,64C32,64 38.39,52.99 44.13,50.95C51.37,48.37 70.14,49.57 70.14,49.57L108.26,87.69L108,109.01L75.97,107.97L32,64Z"
  10 + android:strokeColor="#00000000"
  11 + android:strokeWidth="1">
  12 + <aapt:attr name="android:fillColor">
  13 + <gradient
  14 + android:endX="78.5885"
  15 + android:endY="90.9159"
  16 + android:startX="48.7653"
  17 + android:startY="61.0927"
  18 + android:type="linear">
  19 + <item
  20 + android:color="#44000000"
  21 + android:offset="0.0" />
  22 + <item
  23 + android:color="#00000000"
  24 + android:offset="1.0" />
  25 + </gradient>
  26 + </aapt:attr>
  27 + </path>
  28 + <path
  29 + android:fillColor="#FFFFFF"
  30 + android:fillType="nonZero"
  31 + android:pathData="M66.94,46.02L66.94,46.02C72.44,50.07 76,56.61 76,64L32,64C32,56.61 35.56,50.11 40.98,46.06L36.18,41.19C35.45,40.45 35.45,39.3 36.18,38.56C36.91,37.81 38.05,37.81 38.78,38.56L44.25,44.05C47.18,42.57 50.48,41.71 54,41.71C57.48,41.71 60.78,42.57 63.68,44.05L69.11,38.56C69.84,37.81 70.98,37.81 71.71,38.56C72.44,39.3 72.44,40.45 71.71,41.19L66.94,46.02ZM62.94,56.92C64.08,56.92 65,56.01 65,54.88C65,53.76 64.08,52.85 62.94,52.85C61.8,52.85 60.88,53.76 60.88,54.88C60.88,56.01 61.8,56.92 62.94,56.92ZM45.06,56.92C46.2,56.92 47.13,56.01 47.13,54.88C47.13,53.76 46.2,52.85 45.06,52.85C43.92,52.85 43,53.76 43,54.88C43,56.01 43.92,56.92 45.06,56.92Z"
  32 + android:strokeColor="#00000000"
  33 + android:strokeWidth="1" />
  34 +</vector>
  1 +<vector xmlns:android="http://schemas.android.com/apk/res/android"
  2 + android:width="24dp"
  3 + android:height="24dp"
  4 + android:viewportWidth="24.0"
  5 + android:viewportHeight="24.0">
  6 + <path
  7 + android:fillColor="#FF000000"
  8 + android:pathData="M12,4l-1.41,1.41L16.17,11H4v2h12.17l-5.58,5.59L12,20l8,-8z"/>
  9 +</vector>
  1 +<vector xmlns:android="http://schemas.android.com/apk/res/android"
  2 + android:width="24dp"
  3 + android:height="24dp"
  4 + android:viewportHeight="24.0"
  5 + android:viewportWidth="24.0">
  6 + <path
  7 + android:fillColor="#FF000000"
  8 + android:pathData="M3,13h8L11,3L3,3v10zM3,21h8v-6L3,15v6zM13,21h8L21,11h-8v10zM13,3v6h8L21,3h-8z" />
  9 +</vector>
  1 +<vector xmlns:android="http://schemas.android.com/apk/res/android"
  2 + android:width="24dp"
  3 + android:height="24dp"
  4 + android:viewportHeight="24.0"
  5 + android:viewportWidth="24.0">
  6 + <path
  7 + android:fillColor="#FF000000"
  8 + android:pathData="M10,20v-6h4v6h5v-8h3L12,3 2,12h3v8z" />
  9 +</vector>
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<vector xmlns:android="http://schemas.android.com/apk/res/android"
  3 + android:width="108dp"
  4 + android:height="108dp"
  5 + android:viewportHeight="108"
  6 + android:viewportWidth="108">
  7 + <path
  8 + android:fillColor="#26A69A"
  9 + android:pathData="M0,0h108v108h-108z" />
  10 + <path
  11 + android:fillColor="#00000000"
  12 + android:pathData="M9,0L9,108"
  13 + android:strokeColor="#33FFFFFF"
  14 + android:strokeWidth="0.8" />
  15 + <path
  16 + android:fillColor="#00000000"
  17 + android:pathData="M19,0L19,108"
  18 + android:strokeColor="#33FFFFFF"
  19 + android:strokeWidth="0.8" />
  20 + <path
  21 + android:fillColor="#00000000"
  22 + android:pathData="M29,0L29,108"
  23 + android:strokeColor="#33FFFFFF"
  24 + android:strokeWidth="0.8" />
  25 + <path
  26 + android:fillColor="#00000000"
  27 + android:pathData="M39,0L39,108"
  28 + android:strokeColor="#33FFFFFF"
  29 + android:strokeWidth="0.8" />
  30 + <path
  31 + android:fillColor="#00000000"
  32 + android:pathData="M49,0L49,108"
  33 + android:strokeColor="#33FFFFFF"
  34 + android:strokeWidth="0.8" />
  35 + <path
  36 + android:fillColor="#00000000"
  37 + android:pathData="M59,0L59,108"
  38 + android:strokeColor="#33FFFFFF"
  39 + android:strokeWidth="0.8" />
  40 + <path
  41 + android:fillColor="#00000000"
  42 + android:pathData="M69,0L69,108"
  43 + android:strokeColor="#33FFFFFF"
  44 + android:strokeWidth="0.8" />
  45 + <path
  46 + android:fillColor="#00000000"
  47 + android:pathData="M79,0L79,108"
  48 + android:strokeColor="#33FFFFFF"
  49 + android:strokeWidth="0.8" />
  50 + <path
  51 + android:fillColor="#00000000"
  52 + android:pathData="M89,0L89,108"
  53 + android:strokeColor="#33FFFFFF"
  54 + android:strokeWidth="0.8" />
  55 + <path
  56 + android:fillColor="#00000000"
  57 + android:pathData="M99,0L99,108"
  58 + android:strokeColor="#33FFFFFF"
  59 + android:strokeWidth="0.8" />
  60 + <path
  61 + android:fillColor="#00000000"
  62 + android:pathData="M0,9L108,9"
  63 + android:strokeColor="#33FFFFFF"
  64 + android:strokeWidth="0.8" />
  65 + <path
  66 + android:fillColor="#00000000"
  67 + android:pathData="M0,19L108,19"
  68 + android:strokeColor="#33FFFFFF"
  69 + android:strokeWidth="0.8" />
  70 + <path
  71 + android:fillColor="#00000000"
  72 + android:pathData="M0,29L108,29"
  73 + android:strokeColor="#33FFFFFF"
  74 + android:strokeWidth="0.8" />
  75 + <path
  76 + android:fillColor="#00000000"
  77 + android:pathData="M0,39L108,39"
  78 + android:strokeColor="#33FFFFFF"
  79 + android:strokeWidth="0.8" />
  80 + <path
  81 + android:fillColor="#00000000"
  82 + android:pathData="M0,49L108,49"
  83 + android:strokeColor="#33FFFFFF"
  84 + android:strokeWidth="0.8" />
  85 + <path
  86 + android:fillColor="#00000000"
  87 + android:pathData="M0,59L108,59"
  88 + android:strokeColor="#33FFFFFF"
  89 + android:strokeWidth="0.8" />
  90 + <path
  91 + android:fillColor="#00000000"
  92 + android:pathData="M0,69L108,69"
  93 + android:strokeColor="#33FFFFFF"
  94 + android:strokeWidth="0.8" />
  95 + <path
  96 + android:fillColor="#00000000"
  97 + android:pathData="M0,79L108,79"
  98 + android:strokeColor="#33FFFFFF"
  99 + android:strokeWidth="0.8" />
  100 + <path
  101 + android:fillColor="#00000000"
  102 + android:pathData="M0,89L108,89"
  103 + android:strokeColor="#33FFFFFF"
  104 + android:strokeWidth="0.8" />
  105 + <path
  106 + android:fillColor="#00000000"
  107 + android:pathData="M0,99L108,99"
  108 + android:strokeColor="#33FFFFFF"
  109 + android:strokeWidth="0.8" />
  110 + <path
  111 + android:fillColor="#00000000"
  112 + android:pathData="M19,29L89,29"
  113 + android:strokeColor="#33FFFFFF"
  114 + android:strokeWidth="0.8" />
  115 + <path
  116 + android:fillColor="#00000000"
  117 + android:pathData="M19,39L89,39"
  118 + android:strokeColor="#33FFFFFF"
  119 + android:strokeWidth="0.8" />
  120 + <path
  121 + android:fillColor="#00000000"
  122 + android:pathData="M19,49L89,49"
  123 + android:strokeColor="#33FFFFFF"
  124 + android:strokeWidth="0.8" />
  125 + <path
  126 + android:fillColor="#00000000"
  127 + android:pathData="M19,59L89,59"
  128 + android:strokeColor="#33FFFFFF"
  129 + android:strokeWidth="0.8" />
  130 + <path
  131 + android:fillColor="#00000000"
  132 + android:pathData="M19,69L89,69"
  133 + android:strokeColor="#33FFFFFF"
  134 + android:strokeWidth="0.8" />
  135 + <path
  136 + android:fillColor="#00000000"
  137 + android:pathData="M19,79L89,79"
  138 + android:strokeColor="#33FFFFFF"
  139 + android:strokeWidth="0.8" />
  140 + <path
  141 + android:fillColor="#00000000"
  142 + android:pathData="M29,19L29,89"
  143 + android:strokeColor="#33FFFFFF"
  144 + android:strokeWidth="0.8" />
  145 + <path
  146 + android:fillColor="#00000000"
  147 + android:pathData="M39,19L39,89"
  148 + android:strokeColor="#33FFFFFF"
  149 + android:strokeWidth="0.8" />
  150 + <path
  151 + android:fillColor="#00000000"
  152 + android:pathData="M49,19L49,89"
  153 + android:strokeColor="#33FFFFFF"
  154 + android:strokeWidth="0.8" />
  155 + <path
  156 + android:fillColor="#00000000"
  157 + android:pathData="M59,19L59,89"
  158 + android:strokeColor="#33FFFFFF"
  159 + android:strokeWidth="0.8" />
  160 + <path
  161 + android:fillColor="#00000000"
  162 + android:pathData="M69,19L69,89"
  163 + android:strokeColor="#33FFFFFF"
  164 + android:strokeWidth="0.8" />
  165 + <path
  166 + android:fillColor="#00000000"
  167 + android:pathData="M79,19L79,89"
  168 + android:strokeColor="#33FFFFFF"
  169 + android:strokeWidth="0.8" />
  170 +</vector>
  1 +<vector xmlns:android="http://schemas.android.com/apk/res/android"
  2 + android:width="24dp"
  3 + android:height="24dp"
  4 + android:viewportHeight="24.0"
  5 + android:viewportWidth="24.0">
  6 + <path
  7 + android:fillColor="#FF000000"
  8 + android:pathData="M12,22c1.1,0 2,-0.9 2,-2h-4c0,1.1 0.89,2 2,2zM18,16v-5c0,-3.07 -1.64,-5.64 -4.5,-6.32L13.5,4c0,-0.83 -0.67,-1.5 -1.5,-1.5s-1.5,0.67 -1.5,1.5v0.68C7.63,5.36 6,7.92 6,11v5l-2,2v1h16v-1l-2,-2z" />
  9 +</vector>
  1 +<vector xmlns:android="http://schemas.android.com/apk/res/android"
  2 + android:width="24dp"
  3 + android:height="24dp"
  4 + android:viewportWidth="24.0"
  5 + android:viewportHeight="24.0">
  6 + <path
  7 + android:fillColor="#FF000000"
  8 + android:pathData="M17.65,6.35C16.2,4.9 14.21,4 12,4c-4.42,0 -7.99,3.58 -7.99,8s3.57,8 7.99,8c3.73,0 6.84,-2.55 7.73,-6h-2.08c-0.82,2.33 -3.04,4 -5.65,4 -3.31,0 -6,-2.69 -6,-6s2.69,-6 6,-6c1.66,0 3.14,0.69 4.22,1.78L13,11h7V4l-2.35,2.35z"/>
  9 +</vector>
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<android.support.constraint.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
  3 + xmlns:app="http://schemas.android.com/apk/res-auto"
  4 + xmlns:tools="http://schemas.android.com/tools"
  5 + android:id="@+id/container"
  6 + android:layout_width="match_parent"
  7 + android:layout_height="match_parent"
  8 + tools:context="com.xuedianyun.cloudclass.MainActivity">
  9 +
  10 + <android.support.design.widget.BottomNavigationView
  11 + android:id="@+id/navigation"
  12 + android:layout_width="0dp"
  13 + android:layout_height="wrap_content"
  14 + android:layout_marginEnd="0dp"
  15 + android:layout_marginStart="0dp"
  16 + android:background="?android:attr/windowBackground"
  17 + app:layout_constraintBottom_toBottomOf="parent"
  18 + app:layout_constraintLeft_toLeftOf="parent"
  19 + app:layout_constraintRight_toRightOf="parent"
  20 + app:menu="@menu/navigation" />
  21 +
  22 + <WebView
  23 + android:id="@+id/webview"
  24 + android:layout_width="fill_parent"
  25 + android:layout_height="fill_parent" />
  26 +
  27 +</android.support.constraint.ConstraintLayout>
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<menu xmlns:android="http://schemas.android.com/apk/res/android">
  3 +
  4 + <item
  5 + android:icon="@drawable/ic_home_black_24dp"
  6 + android:id="@+id/navigation_custom"
  7 + android:title="@string/title_custom" />
  8 + <item
  9 + android:icon="@drawable/ic_home_black_24dp"
  10 + android:id="@+id/navigation_webrtc"
  11 + android:title="@string/title_webrtc" />
  12 + <item
  13 + android:icon="@drawable/ic_refresh_black_24dp"
  14 + android:id="@+id/navigation_refresh"
  15 + android:title="@string/title_refresh" />
  16 + <item
  17 + android:icon="@drawable/ic_arrow_forward_black_24dp"
  18 + android:id="@+id/navigation_open"
  19 + android:title="@string/title_open" />
  20 +
  21 +</menu>
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
  3 + <background android:drawable="@drawable/ic_launcher_background" />
  4 + <foreground android:drawable="@drawable/ic_launcher_foreground" />
  5 +</adaptive-icon>
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<adaptive-icon xmlns:android="http://schemas.android.com/apk/res/android">
  3 + <background android:drawable="@drawable/ic_launcher_background" />
  4 + <foreground android:drawable="@drawable/ic_launcher_foreground" />
  5 +</adaptive-icon>
  1 +<?xml version="1.0" encoding="utf-8"?>
  2 +<resources>
  3 + <color name="colorPrimary">#3F51B5</color>
  4 + <color name="colorPrimaryDark">#303F9F</color>
  5 + <color name="colorAccent">#FF4081</color>
  6 +</resources>
  1 +<resources>
  2 + <!-- Default screen margins, per the Android Design guidelines. -->
  3 + <dimen name="activity_horizontal_margin">16dp</dimen>
  4 + <dimen name="activity_vertical_margin">16dp</dimen>
  5 +</resources>
  1 +<resources>
  2 + <string name="app_name">xuedianyun cloud class test</string>
  3 + <string name="title_custom">Custom</string>
  4 + <string name="title_webrtc">WebRTC</string>
  5 + <string name="title_refresh">Refresh</string>
  6 + <string name="title_open">Open</string>
  7 +</resources>
  1 +<resources>
  2 +
  3 + <!-- Base application theme. -->
  4 + <style name="AppTheme" parent="Theme.AppCompat.Light.DarkActionBar">
  5 + <!-- Customize your theme here. -->
  6 + <item name="colorPrimary">@color/colorPrimary</item>
  7 + <item name="colorPrimaryDark">@color/colorPrimaryDark</item>
  8 + <item name="colorAccent">@color/colorAccent</item>
  9 + </style>
  10 +
  11 +</resources>
  1 +// Top-level build file where you can add configuration options common to all sub-projects/modules.
  2 +
  3 +buildscript {
  4 +
  5 + repositories {
  6 + google()
  7 + jcenter()
  8 + }
  9 + dependencies {
  10 + classpath 'com.android.tools.build:gradle:3.0.1'
  11 +
  12 +
  13 + // NOTE: Do not place your application dependencies here; they belong
  14 + // in the individual module build.gradle files
  15 + }
  16 +}
  17 +
  18 +allprojects {
  19 + repositories {
  20 + google()
  21 + jcenter()
  22 + }
  23 +}
  24 +
  25 +task clean(type: Delete) {
  26 + delete rootProject.buildDir
  27 +}
  1 +# Project-wide Gradle settings.
  2 +
  3 +# IDE (e.g. Android Studio) users:
  4 +# Gradle settings configured through the IDE *will override*
  5 +# any settings specified in this file.
  6 +
  7 +# For more details on how to configure your build environment visit
  8 +# http://www.gradle.org/docs/current/userguide/build_environment.html
  9 +
  10 +# Specifies the JVM arguments used for the daemon process.
  11 +# The setting is particularly useful for tweaking memory settings.
  12 +org.gradle.jvmargs=-Xmx1536m
  13 +android.injected.testOnly=false
  14 +# When configured, Gradle will run in incubating parallel mode.
  15 +# This option should only be used with decoupled projects. More details, visit
  16 +# http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects
  17 +# org.gradle.parallel=true
不能预览此文件类型
  1 +#Sun Feb 25 19:58:48 GMT 2018
  2 +distributionBase=GRADLE_USER_HOME
  3 +distributionPath=wrapper/dists
  4 +zipStoreBase=GRADLE_USER_HOME
  5 +zipStorePath=wrapper/dists
  6 +distributionUrl=https\://services.gradle.org/distributions/gradle-4.1-all.zip
  1 +#!/usr/bin/env bash
  2 +
  3 +##############################################################################
  4 +##
  5 +## Gradle start up script for UN*X
  6 +##
  7 +##############################################################################
  8 +
  9 +# Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
  10 +DEFAULT_JVM_OPTS=""
  11 +
  12 +APP_NAME="Gradle"
  13 +APP_BASE_NAME=`basename "$0"`
  14 +
  15 +# Use the maximum available, or set MAX_FD != -1 to use that value.
  16 +MAX_FD="maximum"
  17 +
  18 +warn ( ) {
  19 + echo "$*"
  20 +}
  21 +
  22 +die ( ) {
  23 + echo
  24 + echo "$*"
  25 + echo
  26 + exit 1
  27 +}
  28 +
  29 +# OS specific support (must be 'true' or 'false').
  30 +cygwin=false
  31 +msys=false
  32 +darwin=false
  33 +case "`uname`" in
  34 + CYGWIN* )
  35 + cygwin=true
  36 + ;;
  37 + Darwin* )
  38 + darwin=true
  39 + ;;
  40 + MINGW* )
  41 + msys=true
  42 + ;;
  43 +esac
  44 +
  45 +# Attempt to set APP_HOME
  46 +# Resolve links: $0 may be a link
  47 +PRG="$0"
  48 +# Need this for relative symlinks.
  49 +while [ -h "$PRG" ] ; do
  50 + ls=`ls -ld "$PRG"`
  51 + link=`expr "$ls" : '.*-> \(.*\)$'`
  52 + if expr "$link" : '/.*' > /dev/null; then
  53 + PRG="$link"
  54 + else
  55 + PRG=`dirname "$PRG"`"/$link"
  56 + fi
  57 +done
  58 +SAVED="`pwd`"
  59 +cd "`dirname \"$PRG\"`/" >/dev/null
  60 +APP_HOME="`pwd -P`"
  61 +cd "$SAVED" >/dev/null
  62 +
  63 +CLASSPATH=$APP_HOME/gradle/wrapper/gradle-wrapper.jar
  64 +
  65 +# Determine the Java command to use to start the JVM.
  66 +if [ -n "$JAVA_HOME" ] ; then
  67 + if [ -x "$JAVA_HOME/jre/sh/java" ] ; then
  68 + # IBM's JDK on AIX uses strange locations for the executables
  69 + JAVACMD="$JAVA_HOME/jre/sh/java"
  70 + else
  71 + JAVACMD="$JAVA_HOME/bin/java"
  72 + fi
  73 + if [ ! -x "$JAVACMD" ] ; then
  74 + die "ERROR: JAVA_HOME is set to an invalid directory: $JAVA_HOME
  75 +
  76 +Please set the JAVA_HOME variable in your environment to match the
  77 +location of your Java installation."
  78 + fi
  79 +else
  80 + JAVACMD="java"
  81 + which java >/dev/null 2>&1 || die "ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
  82 +
  83 +Please set the JAVA_HOME variable in your environment to match the
  84 +location of your Java installation."
  85 +fi
  86 +
  87 +# Increase the maximum file descriptors if we can.
  88 +if [ "$cygwin" = "false" -a "$darwin" = "false" ] ; then
  89 + MAX_FD_LIMIT=`ulimit -H -n`
  90 + if [ $? -eq 0 ] ; then
  91 + if [ "$MAX_FD" = "maximum" -o "$MAX_FD" = "max" ] ; then
  92 + MAX_FD="$MAX_FD_LIMIT"
  93 + fi
  94 + ulimit -n $MAX_FD
  95 + if [ $? -ne 0 ] ; then
  96 + warn "Could not set maximum file descriptor limit: $MAX_FD"
  97 + fi
  98 + else
  99 + warn "Could not query maximum file descriptor limit: $MAX_FD_LIMIT"
  100 + fi
  101 +fi
  102 +
  103 +# For Darwin, add options to specify how the application appears in the dock
  104 +if $darwin; then
  105 + GRADLE_OPTS="$GRADLE_OPTS \"-Xdock:name=$APP_NAME\" \"-Xdock:icon=$APP_HOME/media/gradle.icns\""
  106 +fi
  107 +
  108 +# For Cygwin, switch paths to Windows format before running java
  109 +if $cygwin ; then
  110 + APP_HOME=`cygpath --path --mixed "$APP_HOME"`
  111 + CLASSPATH=`cygpath --path --mixed "$CLASSPATH"`
  112 + JAVACMD=`cygpath --unix "$JAVACMD"`
  113 +
  114 + # We build the pattern for arguments to be converted via cygpath
  115 + ROOTDIRSRAW=`find -L / -maxdepth 1 -mindepth 1 -type d 2>/dev/null`
  116 + SEP=""
  117 + for dir in $ROOTDIRSRAW ; do
  118 + ROOTDIRS="$ROOTDIRS$SEP$dir"
  119 + SEP="|"
  120 + done
  121 + OURCYGPATTERN="(^($ROOTDIRS))"
  122 + # Add a user-defined pattern to the cygpath arguments
  123 + if [ "$GRADLE_CYGPATTERN" != "" ] ; then
  124 + OURCYGPATTERN="$OURCYGPATTERN|($GRADLE_CYGPATTERN)"
  125 + fi
  126 + # Now convert the arguments - kludge to limit ourselves to /bin/sh
  127 + i=0
  128 + for arg in "$@" ; do
  129 + CHECK=`echo "$arg"|egrep -c "$OURCYGPATTERN" -`
  130 + CHECK2=`echo "$arg"|egrep -c "^-"` ### Determine if an option
  131 +
  132 + if [ $CHECK -ne 0 ] && [ $CHECK2 -eq 0 ] ; then ### Added a condition
  133 + eval `echo args$i`=`cygpath --path --ignore --mixed "$arg"`
  134 + else
  135 + eval `echo args$i`="\"$arg\""
  136 + fi
  137 + i=$((i+1))
  138 + done
  139 + case $i in
  140 + (0) set -- ;;
  141 + (1) set -- "$args0" ;;
  142 + (2) set -- "$args0" "$args1" ;;
  143 + (3) set -- "$args0" "$args1" "$args2" ;;
  144 + (4) set -- "$args0" "$args1" "$args2" "$args3" ;;
  145 + (5) set -- "$args0" "$args1" "$args2" "$args3" "$args4" ;;
  146 + (6) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" ;;
  147 + (7) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" ;;
  148 + (8) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" ;;
  149 + (9) set -- "$args0" "$args1" "$args2" "$args3" "$args4" "$args5" "$args6" "$args7" "$args8" ;;
  150 + esac
  151 +fi
  152 +
  153 +# Split up the JVM_OPTS And GRADLE_OPTS values into an array, following the shell quoting and substitution rules
  154 +function splitJvmOpts() {
  155 + JVM_OPTS=("$@")
  156 +}
  157 +eval splitJvmOpts $DEFAULT_JVM_OPTS $JAVA_OPTS $GRADLE_OPTS
  158 +JVM_OPTS[${#JVM_OPTS[*]}]="-Dorg.gradle.appname=$APP_BASE_NAME"
  159 +
  160 +exec "$JAVACMD" "${JVM_OPTS[@]}" -classpath "$CLASSPATH" org.gradle.wrapper.GradleWrapperMain "$@"
  1 +@if "%DEBUG%" == "" @echo off
  2 +@rem ##########################################################################
  3 +@rem
  4 +@rem Gradle startup script for Windows
  5 +@rem
  6 +@rem ##########################################################################
  7 +
  8 +@rem Set local scope for the variables with windows NT shell
  9 +if "%OS%"=="Windows_NT" setlocal
  10 +
  11 +@rem Add default JVM options here. You can also use JAVA_OPTS and GRADLE_OPTS to pass JVM options to this script.
  12 +set DEFAULT_JVM_OPTS=
  13 +
  14 +set DIRNAME=%~dp0
  15 +if "%DIRNAME%" == "" set DIRNAME=.
  16 +set APP_BASE_NAME=%~n0
  17 +set APP_HOME=%DIRNAME%
  18 +
  19 +@rem Find java.exe
  20 +if defined JAVA_HOME goto findJavaFromJavaHome
  21 +
  22 +set JAVA_EXE=java.exe
  23 +%JAVA_EXE% -version >NUL 2>&1
  24 +if "%ERRORLEVEL%" == "0" goto init
  25 +
  26 +echo.
  27 +echo ERROR: JAVA_HOME is not set and no 'java' command could be found in your PATH.
  28 +echo.
  29 +echo Please set the JAVA_HOME variable in your environment to match the
  30 +echo location of your Java installation.
  31 +
  32 +goto fail
  33 +
  34 +:findJavaFromJavaHome
  35 +set JAVA_HOME=%JAVA_HOME:"=%
  36 +set JAVA_EXE=%JAVA_HOME%/bin/java.exe
  37 +
  38 +if exist "%JAVA_EXE%" goto init
  39 +
  40 +echo.
  41 +echo ERROR: JAVA_HOME is set to an invalid directory: %JAVA_HOME%
  42 +echo.
  43 +echo Please set the JAVA_HOME variable in your environment to match the
  44 +echo location of your Java installation.
  45 +
  46 +goto fail
  47 +
  48 +:init
  49 +@rem Get command-line arguments, handling Windowz variants
  50 +
  51 +if not "%OS%" == "Windows_NT" goto win9xME_args
  52 +if "%@eval[2+2]" == "4" goto 4NT_args
  53 +
  54 +:win9xME_args
  55 +@rem Slurp the command line arguments.
  56 +set CMD_LINE_ARGS=
  57 +set _SKIP=2
  58 +
  59 +:win9xME_args_slurp
  60 +if "x%~1" == "x" goto execute
  61 +
  62 +set CMD_LINE_ARGS=%*
  63 +goto execute
  64 +
  65 +:4NT_args
  66 +@rem Get arguments from the 4NT Shell from JP Software
  67 +set CMD_LINE_ARGS=%$
  68 +
  69 +:execute
  70 +@rem Setup the command line
  71 +
  72 +set CLASSPATH=%APP_HOME%\gradle\wrapper\gradle-wrapper.jar
  73 +
  74 +@rem Execute Gradle
  75 +"%JAVA_EXE%" %DEFAULT_JVM_OPTS% %JAVA_OPTS% %GRADLE_OPTS% "-Dorg.gradle.appname=%APP_BASE_NAME%" -classpath "%CLASSPATH%" org.gradle.wrapper.GradleWrapperMain %CMD_LINE_ARGS%
  76 +
  77 +:end
  78 +@rem End local scope for the variables with windows NT shell
  79 +if "%ERRORLEVEL%"=="0" goto mainEnd
  80 +
  81 +:fail
  82 +rem Set variable GRADLE_EXIT_CONSOLE if you need the _script_ return code instead of
  83 +rem the _cmd.exe /c_ return code!
  84 +if not "" == "%GRADLE_EXIT_CONSOLE%" exit 1
  85 +exit /b 1
  86 +
  87 +:mainEnd
  88 +if "%OS%"=="Windows_NT" endlocal
  89 +
  90 +:omega
  1 +include ':app'