Skip to content

Commit

Permalink
first run
Browse files Browse the repository at this point in the history
  • Loading branch information
Kevin committed Jan 23, 2019
0 parents commit 2bca157
Show file tree
Hide file tree
Showing 704 changed files with 9,302 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# intellij
*.iml

.gradle
/local.properties
/.idea/workspace.xml
/.idea/libraries
.DS_Store
/build
/captures
.externalNativeBuild
app/build

.settings/
app/jniLibs/
Binary file added .idea/caches/build_file_checksums.ser
Binary file not shown.
Binary file added .idea/caches/gradle_models.ser
Binary file not shown.
29 changes: 29 additions & 0 deletions .idea/codeStyles/Project.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 15 additions & 0 deletions .idea/gradle.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions .idea/misc.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

9 changes: 9 additions & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 12 additions & 0 deletions .idea/runConfigurations.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

32 changes: 32 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
Basic Video Chat
===================================

This application provides a completed version of the OpenTok [Basic Video Chat tutorial](https://tokbox.com/developer/tutorials/android/) for Android (differing only in some additional validation checks). Upon deploying this sample application, you should be able to have two way audio and video communication using OpenTok.

Note that you will need a valid TokBox account for this and all other TokBox samples and tutorials.

### Quick Deploy
====================================

##### 1. Git clone this repository
Clone this repository using:

```git clone [email protected]:opentok/opentok-android-sdk-samples.git```

in your terminal. Then, using [Android Studio](https://developer.android.com/studio/index.html), open the project in the Basic-Video-Chat folder.

##### 2. Configure the app
In `OpenTokConfig.java`, configure the `API_KEY`, `SESSION_ID`, and `TOKEN` variables. You can obtain these values from your [TokBox account](https://tokbox.com/account/#/). Make sure that your `TOKEN` isn't expired.

Note that we are hard coding these values in for demonstration purposes only. Your production app should not do this.

##### 2A. (Optional) Deploy a back end web service
If you want to see how you should run this app without hard coding config variables, you can deploy a pre-built server that we've provided. Do this by going to the [learning-opentok-php](https://github.com/opentok/learning-opentok-php) repository, and clicking on the purple deploy to Heroku button.

You can look through the details of that tutorial at a later point. For now, you just need to know that the sample web service provides a RESTful interface to give you the same Session information as you hard coded (`API_KEY`, `SESSION_ID`, and `TOKEN`).

##### 2B. (Optional) Configure the app to use your web service
In `OpenTokConfig.java`, configure the `CHAT_SERVER_URL` string to your web service domain.

##### 3. Run the app
That's it!
4 changes: 4 additions & 0 deletions app/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/build
config.gradle
*.jar
*.so
63 changes: 63 additions & 0 deletions app/build.gradle
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
apply plugin: 'com.android.application'

android {
compileSdkVersion 28
buildToolsVersion '28.0.3'

defaultConfig {
applicationId "com.forwiz.nursetree"
minSdkVersion 16
targetSdkVersion 28
versionCode 1
versionName "1.0"
}

compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
buildTypes {
release {
minifyEnabled false
}
debug {


}
}
}




dependencies {
implementation 'com.opentok.android:opentok-android-sdk:2.15.+'
implementation 'pub.devrel:easypermissions:0.4.0'

implementation 'com.google.code.gson:gson:2.8.5'
implementation 'com.android.support:appcompat-v7:27.1.1'

implementation 'com.android.support:recyclerview-v7:27.1.1'

// AndroidAnnotation
implementation "org.androidannotations:androidannotations-api:4.3.1"
annotationProcessor "org.androidannotations:androidannotations:4.3.1"


implementation 'com.android.support:appcompat-v7:28.0.0'

// OkHttp (Http communication library)
implementation 'com.squareup.okhttp3:okhttp:3.10.0'

implementation 'com.google.firebase:firebase-core:16.0.6'
implementation 'com.google.firebase:firebase-iid:17.0.4'
implementation 'com.google.firebase:firebase-messaging:17.3.4'
implementation 'com.firebase:firebase-jobdispatcher:0.8.5'

implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.android.volley:volley:1.0.0'
// JSR-310 (Java Time 8) backport
implementation 'com.jakewharton.threetenabp:threetenabp:1.0.5'
}

apply plugin: 'com.google.gms.google-services'
42 changes: 42 additions & 0 deletions app/google-services.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
{
"project_info": {
"project_number": "408770127762",
"firebase_url": "https://nursetree-a8aa3.firebaseio.com",
"project_id": "nursetree-a8aa3",
"storage_bucket": "nursetree-a8aa3.appspot.com"
},
"client": [
{
"client_info": {
"mobilesdk_app_id": "1:408770127762:android:dc4762f857f06459",
"android_client_info": {
"package_name": "com.forwiz.nursetree"
}
},
"oauth_client": [
{
"client_id": "408770127762-97oktke57fe4h7fqlb5bnbur7ao5tajg.apps.googleusercontent.com",
"client_type": 3
}
],
"api_key": [
{
"current_key": "AIzaSyAQBVobRocnH-DPHOi9rbqwlDvcdGngRhs"
}
],
"services": {
"analytics_service": {
"status": 1
},
"appinvite_service": {
"status": 1,
"other_platform_oauth_client": []
},
"ads_service": {
"status": 2
}
}
}
],
"configuration_version": "1"
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
package com.tokbox.android.tutorials.basicvideochat;

import android.app.Application;
import android.test.ApplicationTestCase;

/**
* <a href="http://d.android.com/tools/testing/testing_android.html">Testing Fundamentals</a>
*/
public class ApplicationTest extends ApplicationTestCase<Application> {
public ApplicationTest() {
super(Application.class);
}
}
84 changes: 84 additions & 0 deletions app/src/main/AndroidManifest.xml
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.forwiz.nursetree" >

<uses-permission android:name="android.permission.CAMERA" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.RECORD_AUDIO" />
<uses-permission android:name="android.permission.WAKE_LOCK" />
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" />

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

<!-- 통화기록에 남기기위한 permission -->
<uses-permission android:name="android.permission.WRITE_CALL_LOG" />

<uses-permission android:name="com.android.alarm.permission.SET_ALARM" />

<!-- 구버전 Firebase 메세지를 통한 다이얼로그 제어를 위한 퍼미션 ex) 예약 성립, 취소 -->
<uses-permission android:name="android.permission.GET_TASKS" />

<uses-permission android:name="android.permission.READ_PHONE_STATE" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.ACCESS_WIFI_STATE" />
<uses-permission android:name="android.permission.CHANGE_WIFI_STATE" />
<uses-permission android:name="android.permission.CHANGE_NETWORK_STATE" />

<uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="android.permission.DISABLE_KEYGUARD" />
<uses-permission android:name="android.permission.SYSTEM_ALERT_WINDOW" />
<uses-permission android:name="android.permission.REQUEST_IGNORE_BATTERY_OPTIMIZATIONS" />



<application
android:name=".ApplicationClass"
android:allowBackup="false"
android:icon="@drawable/app_icon_a"
android:label="@string/app_name"
android:resizeableActivity="false"
android:supportsRtl="true"
android:theme="@style/mainTheme">


<activity android:name=".MainActivity">
<intent-filter>
<action android:name="android.intent.action.MAIN" />

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

<!-- [START firebase_service] -->
<service android:name=".MyFirebaseMessagingService">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>
<!-- [END firebase_service] -->
<service
android:name=".MyJobService"
android:exported="false">
<intent-filter>
<action android:name="com.firebase.jobdispatcher.ACTION_EXECUTE" />
</intent-filter>
</service>

<activity
android:name=".view.TalkChatActivity_"
android:keepScreenOn="true"
android:screenOrientation="portrait"
android:showOnLockScreen="true" />

<activity
android:name=".view.TalkChatDialogActivity_"
android:noHistory="true"
android:screenOrientation="portrait"
android:showOnLockScreen="true" />

</application>

</manifest>
38 changes: 38 additions & 0 deletions app/src/main/java/com/forwiz/nursetree/ApplicationClass.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
package com.forwiz.nursetree;

import android.app.Application;
import android.content.Context;
import android.media.AudioManager;

public class ApplicationClass extends Application {

private static Context appContext;

@Override
public void onCreate() {
super.onCreate();
appContext = this;




}

@Override
public void onTerminate() {
super.onTerminate();
AudioManager am = (AudioManager) this.getSystemService(Context.AUDIO_SERVICE);
am.setMode(AudioManager.MODE_NORMAL);
am.setSpeakerphoneOn(false);
}

public static Context getAppContext() {
return appContext;
}

@Override
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
// MultiDex.install(this);
}
}
Loading

0 comments on commit 2bca157

Please sign in to comment.