├── app ├── .gitignore ├── src │ └── main │ │ ├── res │ │ ├── mipmap-hdpi │ │ │ └── ic_launcher.png │ │ ├── mipmap-mdpi │ │ │ └── ic_launcher.png │ │ ├── mipmap-xhdpi │ │ │ └── ic_launcher.png │ │ ├── mipmap-xxhdpi │ │ │ └── ic_launcher.png │ │ ├── mipmap-xxxhdpi │ │ │ └── ic_launcher.png │ │ ├── values │ │ │ ├── dimens.xml │ │ │ ├── colors.xml │ │ │ ├── styles.xml │ │ │ └── strings.xml │ │ ├── layout │ │ │ ├── l_item.xml │ │ │ └── activity_main.xml │ │ ├── values-w820dp │ │ │ └── dimens.xml │ │ ├── menu │ │ │ └── menu.xml │ │ └── drawable │ │ │ └── json.xml │ │ ├── kotlin │ │ └── cz │ │ │ └── sazel │ │ │ └── android │ │ │ └── serverlesswebrtcandroid │ │ │ ├── console │ │ │ ├── IConsole.kt │ │ │ └── RecyclerViewConsole.kt │ │ │ ├── adapters │ │ │ └── ConsoleAdapter.kt │ │ │ ├── MainActivity.kt │ │ │ └── webrtc │ │ │ └── ServerlessRTCClient.kt │ │ └── AndroidManifest.xml ├── proguard-rules.pro └── build.gradle ├── settings.gradle ├── .github ├── demo.png ├── create_offer.png └── paste_answer.png ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradle.properties ├── LICENSE ├── .circleci └── config.yml ├── .gitignore ├── README.md ├── gradlew.bat └── gradlew /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app' 2 | -------------------------------------------------------------------------------- /.github/demo.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wojta/no-server-webrtc-android/HEAD/.github/demo.png -------------------------------------------------------------------------------- /.github/create_offer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wojta/no-server-webrtc-android/HEAD/.github/create_offer.png -------------------------------------------------------------------------------- /.github/paste_answer.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wojta/no-server-webrtc-android/HEAD/.github/paste_answer.png -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wojta/no-server-webrtc-android/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wojta/no-server-webrtc-android/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wojta/no-server-webrtc-android/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wojta/no-server-webrtc-android/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wojta/no-server-webrtc-android/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/wojta/no-server-webrtc-android/HEAD/app/src/main/res/mipmap-xxxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16dp 4 | 16dp 5 | 6 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | distributionBase=GRADLE_USER_HOME 2 | distributionPath=wrapper/dists 3 | distributionUrl=https\://services.gradle.org/distributions/gradle-6.7.1-all.zip 4 | zipStoreBase=GRADLE_USER_HOME 5 | zipStorePath=wrapper/dists 6 | -------------------------------------------------------------------------------- /app/src/main/res/values/colors.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | #3F51B5 4 | #303F9F 5 | #FF4081 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/layout/l_item.xml: -------------------------------------------------------------------------------- 1 | 2 | 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/values-w820dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 64dp 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/menu/menu.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 10 | -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 10 | 11 | 12 | -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | Serverless WebRTC Android 3 | Send 4 | Create offer 5 | Content of the message has been put into clipboard. 6 | Please paste your offer 7 | Please paste your answer 8 | Enter some message 9 | Submit 10 | 11 | -------------------------------------------------------------------------------- /app/proguard-rules.pro: -------------------------------------------------------------------------------- 1 | # Add project specific ProGuard rules here. 2 | # By default, the flags in this file are appended to flags specified 3 | # in /home/wojta/adt-bundle/sdk/tools/proguard/proguard-android.txt 4 | # You can edit the include path and order by changing the proguardFiles 5 | # directive in build.gradle. 6 | # 7 | # For more details, see 8 | # http://developer.android.com/guide/developing/tools/proguard.html 9 | 10 | # Add any project specific keep options here: 11 | 12 | # If your project uses WebView with JS, uncomment the following 13 | # and specify the fully qualified class name to the JavaScript interface 14 | # class: 15 | #-keepclassmembers class fqcn.of.javascript.interface.for.webview { 16 | # public *; 17 | #} 18 | -------------------------------------------------------------------------------- /app/src/main/res/drawable/json.xml: -------------------------------------------------------------------------------- 1 | 6 | 9 | -------------------------------------------------------------------------------- /gradle.properties: -------------------------------------------------------------------------------- 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 | # Default value: -Xmx10248m -XX:MaxPermSize=256m 13 | # org.gradle.jvmargs=-Xmx2048m -XX:MaxPermSize=512m -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 14 | 15 | # When configured, Gradle will run in incubating parallel mode. 16 | # This option should only be used with decoupled projects. More details, visit 17 | # http://www.gradle.org/docs/current/userguide/multi_project_builds.html#sec:decoupled_projects 18 | # org.gradle.parallel=true 19 | 20 | android.useAndroidX=true -------------------------------------------------------------------------------- /app/src/main/kotlin/cz/sazel/android/serverlesswebrtcandroid/console/IConsole.kt: -------------------------------------------------------------------------------- 1 | package cz.sazel.android.serverlesswebrtcandroid.console 2 | 3 | import cz.sazel.android.serverlesswebrtcandroid.BuildConfig 4 | 5 | /** 6 | * Created on 7.5.16. 7 | */ 8 | interface IConsole { 9 | 10 | fun printf(text: String, vararg args: Any) 11 | 12 | fun printf(resId: Int, vararg args: Any) 13 | 14 | fun d(text: String, vararg args: Any) { 15 | if (BuildConfig.DEBUG) printf("$text") 16 | } 17 | 18 | fun i(text: String, vararg args: Any) { 19 | if (BuildConfig.DEBUG) greenf(text, args) 20 | } 21 | 22 | fun e(text: String, vararg args: Any) { 23 | if (BuildConfig.DEBUG) redf(text, args) 24 | } 25 | 26 | fun greenf(text: String, vararg args: Any) { 27 | printf("$text") 28 | } 29 | 30 | fun bluef(text: String, vararg args: Any) { 31 | printf("$text") 32 | } 33 | 34 | fun redf(text: String, vararg args: Any) { 35 | printf("$text") 36 | } 37 | } -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | This is free and unencumbered software released into the public domain. 2 | 3 | Anyone is free to copy, modify, publish, use, compile, sell, or 4 | distribute this software, either in source code form or as a compiled 5 | binary, for any purpose, commercial or non-commercial, and by any 6 | means. 7 | 8 | In jurisdictions that recognize copyright laws, the author or authors 9 | of this software dedicate any and all copyright interest in the 10 | software to the public domain. We make this dedication for the benefit 11 | of the public at large and to the detriment of our heirs and 12 | successors. We intend this dedication to be an overt act of 13 | relinquishment in perpetuity of all present and future rights to this 14 | software under copyright law. 15 | 16 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 17 | EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF 18 | MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. 19 | IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR 20 | OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, 21 | ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR 22 | OTHER DEALINGS IN THE SOFTWARE. 23 | 24 | For more information, please refer to 25 | -------------------------------------------------------------------------------- /app/src/main/kotlin/cz/sazel/android/serverlesswebrtcandroid/console/RecyclerViewConsole.kt: -------------------------------------------------------------------------------- 1 | package cz.sazel.android.serverlesswebrtcandroid.console 2 | 3 | import android.os.Bundle 4 | import android.os.Handler 5 | import android.os.Looper 6 | import androidx.recyclerview.widget.RecyclerView 7 | import cz.sazel.android.serverlesswebrtcandroid.adapters.ConsoleAdapter 8 | import java.util.* 9 | 10 | /** 11 | * Created on 7.5.16. 12 | */ 13 | class RecyclerViewConsole(val view: RecyclerView) : IConsole { 14 | 15 | lateinit var lines: ArrayList 16 | private val SAVE_LINES = "SAVE_LINES" 17 | 18 | private lateinit var handler: Handler 19 | 20 | override fun printf(text: String, vararg args: Any) { 21 | handler.post { 22 | lines.add(String.format(Locale.getDefault(), text, args)) 23 | view.adapter?.notifyItemInserted(lines.size - 1) 24 | view.scrollToPosition(lines.size - 1); 25 | } 26 | } 27 | 28 | override fun printf(resId: Int, vararg args: Any) { 29 | printf(view.context.getString(resId, args)) 30 | } 31 | 32 | 33 | fun onSaveInstanceState(bundle: Bundle) { 34 | bundle.putStringArrayList(SAVE_LINES, lines) 35 | } 36 | 37 | 38 | fun initialize(bundle: Bundle?) { 39 | lines = bundle?.getStringArrayList(SAVE_LINES) ?: ArrayList() 40 | view.adapter = ConsoleAdapter(lines) 41 | handler = Handler(Looper.getMainLooper()) 42 | } 43 | 44 | 45 | } -------------------------------------------------------------------------------- /.circleci/config.yml: -------------------------------------------------------------------------------- 1 | version: 2 2 | jobs: 3 | build: 4 | working_directory: ~/code 5 | docker: 6 | - image: circleci/android:api-29-node 7 | environment: 8 | JVM_OPTS: -Xmx3200m 9 | steps: 10 | - checkout 11 | - restore_cache: 12 | key: jars-{{ checksum "build.gradle" }}-{{ checksum "app/build.gradle" }} 13 | # - run: 14 | # name: Chmod permissions #if permission for Gradlew Dependencies fail, use this. 15 | # command: sudo chmod +x ./gradlew 16 | - run: 17 | name: install Gradle 18 | command: ./gradlew wrapper --gradle-version=6.5 --distribution-type=bin 19 | - run: 20 | name: Download Dependencies 21 | command: ./gradlew androidDependencies 22 | - save_cache: 23 | paths: 24 | - ~/.gradle 25 | key: jars-{{ checksum "build.gradle" }}-{{ checksum "app/build.gradle" }} 26 | - run: 27 | name: Build debug APK and test APK 28 | command: | 29 | ./gradlew :app:assembleDebug 30 | ./gradlew :app:assembleDebugAndroidTest 31 | - store_artifacts: 32 | path: app/build/outputs 33 | destination: outputs 34 | - run: 35 | name: Run Tests 36 | command: ./gradlew lint test 37 | - store_artifacts: 38 | path: app/build/reports 39 | destination: reports 40 | - store_test_results: 41 | path: app/build/test-results 42 | 43 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | plugins { 2 | id 'com.android.application' 3 | id 'kotlin-android' 4 | id 'kotlin-parcelize' 5 | } 6 | 7 | android { 8 | compileSdkVersion 29 9 | 10 | defaultConfig { 11 | applicationId "cz.sazel.android.serverlesswebrtcandroid" 12 | minSdkVersion 16 13 | targetSdkVersion 29 14 | versionCode 1200 15 | versionName "1.2" 16 | 17 | testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner" 18 | } 19 | 20 | buildTypes { 21 | release { 22 | minifyEnabled false 23 | proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro' 24 | } 25 | } 26 | 27 | buildFeatures { 28 | viewBinding true 29 | } 30 | 31 | compileOptions { 32 | sourceCompatibility JavaVersion.VERSION_1_8 33 | targetCompatibility JavaVersion.VERSION_1_8 34 | } 35 | kotlinOptions { 36 | jvmTarget = '1.8' 37 | } 38 | sourceSets { 39 | main.java.srcDirs += 'src/main/kotlin' 40 | } 41 | } 42 | 43 | dependencies { 44 | implementation fileTree(dir: 'libs', include: ['*.jar']) 45 | implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version" 46 | implementation 'androidx.core:core-ktx:1.3.2' 47 | implementation 'androidx.appcompat:appcompat:1.2.0' 48 | implementation 'com.google.android.material:material:1.2.1' 49 | implementation 'androidx.constraintlayout:constraintlayout:2.0.4' 50 | implementation 'cz.sazel.android:libjingle:23022' 51 | testImplementation 'junit:junit:4.13.1' 52 | androidTestImplementation 'androidx.test.ext:junit:1.1.2' 53 | androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0' 54 | } 55 | -------------------------------------------------------------------------------- /app/src/main/kotlin/cz/sazel/android/serverlesswebrtcandroid/adapters/ConsoleAdapter.kt: -------------------------------------------------------------------------------- 1 | package cz.sazel.android.serverlesswebrtcandroid.adapters 2 | 3 | import android.content.ClipData 4 | import android.content.ClipboardManager 5 | import android.content.Context.CLIPBOARD_SERVICE 6 | import android.text.Html 7 | import android.view.LayoutInflater 8 | import android.view.View 9 | import android.view.ViewGroup 10 | import android.widget.TextView 11 | import android.widget.Toast 12 | import android.widget.Toast.LENGTH_SHORT 13 | import androidx.recyclerview.widget.RecyclerView 14 | import cz.sazel.android.serverlesswebrtcandroid.R 15 | 16 | /** 17 | * This is just to do the printing into the RecyclerView. 18 | */ 19 | class ConsoleAdapter(val items: List) : RecyclerView.Adapter() { 20 | 21 | override fun onCreateViewHolder(parent: ViewGroup, viewType: Int): ConsoleVH { 22 | val view = LayoutInflater.from(parent.context).inflate(R.layout.l_item, parent, false) 23 | return ConsoleVH(view) 24 | } 25 | 26 | 27 | override fun getItemCount(): Int = items.count() 28 | 29 | override fun onBindViewHolder(holder: ConsoleVH, position: Int) { 30 | holder.tvText.text = Html.fromHtml(items[position]) 31 | } 32 | 33 | class ConsoleVH(view: View) : RecyclerView.ViewHolder(view) { 34 | var tvText: TextView = view.findViewById(R.id.tvText) 35 | 36 | init { 37 | tvText.setOnLongClickListener { 38 | //clipboard on long touch 39 | val text = tvText.text.toString() 40 | val clipboard = tvText.context.getSystemService(CLIPBOARD_SERVICE) as ClipboardManager 41 | clipboard.setPrimaryClip(ClipData.newPlainText("text", text)) 42 | Toast.makeText(tvText.context, R.string.clipboard_copy, LENGTH_SHORT).show() 43 | true 44 | } 45 | } 46 | } 47 | } 48 | 49 | 50 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | *.iml 2 | .gradle 3 | /local.properties 4 | /.idea/workspace.xml 5 | /.idea/libraries 6 | .DS_Store 7 | /build 8 | /captures 9 | app/libs 10 | app/src/main/jni 11 | ### JetBrains template 12 | # Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio and Webstorm 13 | # Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839 14 | 15 | # User-specific stuff: 16 | .idea/workspace.xml 17 | .idea/tasks.xml 18 | .idea/dictionaries 19 | .idea/vcs.xml 20 | .idea/jsLibraryMappings.xml 21 | 22 | # Sensitive or high-churn files: 23 | .idea/dataSources.ids 24 | .idea/dataSources.xml 25 | .idea/dataSources.local.xml 26 | .idea/sqlDataSources.xml 27 | .idea/dynamic.xml 28 | .idea/uiDesigner.xml 29 | 30 | # Gradle: 31 | .idea/gradle.xml 32 | .idea/libraries 33 | 34 | # Mongo Explorer plugin: 35 | .idea/mongoSettings.xml 36 | 37 | ## File-based project format: 38 | *.iws 39 | 40 | ## Plugin-specific files: 41 | 42 | # IntelliJ 43 | /out/ 44 | 45 | # mpeltonen/sbt-idea plugin 46 | .idea_modules/ 47 | 48 | # JIRA plugin 49 | atlassian-ide-plugin.xml 50 | 51 | # Crashlytics plugin (for Android Studio and IntelliJ) 52 | com_crashlytics_export_strings.xml 53 | crashlytics.properties 54 | crashlytics-build.properties 55 | fabric.properties 56 | ### Java template 57 | *.class 58 | 59 | # Mobile Tools for Java (J2ME) 60 | .mtj.tmp/ 61 | 62 | # virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml 63 | hs_err_pid* 64 | ### Android template 65 | # Built application files 66 | *.apk 67 | *.ap_ 68 | 69 | # Files for the Dalvik VM 70 | *.dex 71 | 72 | # Java class files 73 | 74 | # Generated files 75 | bin/ 76 | gen/ 77 | out/ 78 | 79 | # Gradle files 80 | .gradle/ 81 | build/ 82 | 83 | # Local configuration file (sdk path, etc) 84 | local.properties 85 | 86 | # Proguard folder generated by Eclipse 87 | proguard/ 88 | 89 | # Log Files 90 | *.log 91 | 92 | # Android Studio Navigation editor temp files 93 | .navigation/ 94 | 95 | # Android Studio captures folder 96 | captures/ 97 | 98 | # Intellij 99 | .idea 100 | 101 | # Keystore files 102 | *.jks 103 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 2 | 12 | 13 | 20 | 21 | 34 | 35 | 44 | 45 |