Skip to content
This repository has been archived by the owner on Oct 16, 2023. It is now read-only.

Commit

Permalink
first commit
Browse files Browse the repository at this point in the history
  • Loading branch information
yuliskov committed Dec 23, 2016
0 parents commit dc94685
Show file tree
Hide file tree
Showing 195 changed files with 19,594 additions and 0 deletions.
10 changes: 10 additions & 0 deletions .gitignore
@@ -0,0 +1,10 @@
*.7z
*.iml
.gradle
/local.properties
/.idea/workspace.xml
/.idea/libraries
.DS_Store
/build
/captures
.externalNativeBuild
9 changes: 9 additions & 0 deletions .idea/codeStyleSettings.xml

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

8 changes: 8 additions & 0 deletions .idea/dictionaries/Yuriy.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/encodings.xml

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

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

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

10 changes: 10 additions & 0 deletions .idea/inspectionProfiles/Project_Default.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.

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

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

22 changes: 22 additions & 0 deletions README.md
@@ -0,0 +1,22 @@
#Smart YouTube TV

Imagine that you have ordinary chinese android box with simple remote controller.
What YouTube client you should use? Regular client doesnt understand remote controller.
Off course you may use official YouTube TV client for Nexus Player. But there is many drawback.
One of them is deps (e.g. gapps) that box usually don't have.
Another drawback is that official client needs minimum Android 5.0.
And there comes Smart YouTube TV. It require zero deps, minimum Android 4.4.

##Highlights
- consist of two parts: app and standalone browser engine
- browser engine can be used independently (currently in development)
- browser engine based on android open source browser project marshmallow branch (link1)

##Pros of browser engine
- you don't have to deal with creating custom methods for managing WebView lifecircle (pause, resume etc)
- with regular WebView you have to deal with some issues. For example WebView continue to play video at background.
- browser can have tabs, settings and other regular browser features
- all internal state is saved into persistent memory instead of RAM

(link1)
Based on: git clone -b marshmallow-release https://android.googlesource.com/platform/packages/apps/Browser
1 change: 1 addition & 0 deletions browser/.gitignore
@@ -0,0 +1 @@
/build
37 changes: 37 additions & 0 deletions browser/build.gradle
@@ -0,0 +1,37 @@
apply plugin: 'com.android.library'

android {
compileSdkVersion 25
buildToolsVersion "25.0.0"

defaultConfig {
minSdkVersion 15
targetSdkVersion 25
versionCode 1
versionName "1.0"

testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"

}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}

dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.0.0'
testCompile 'junit:junit:4.12'

// compile 'com.jakewharton:butterknife:8.4.0'
// annotationProcessor 'com.jakewharton:butterknife-compiler:8.4.0'
compile 'com.noveogroup.android:android-logger:1.3.5'

compile 'com.squareup.okhttp3:okhttp:3.5.0'
}
17 changes: 17 additions & 0 deletions browser/proguard-rules.pro
@@ -0,0 +1,17 @@
# Add project specific ProGuard rules here.
# By default, the flags in this file are appended to flags specified
# in C:\portable\dev\android-sdk/tools/proguard/proguard-android.txt
# You can edit the include path and order by changing the proguardFiles
# directive in build.gradle.
#
# For more details, see
# http://developer.android.com/guide/developing/tools/proguard.html

# Add any project specific keep options here:

# If your project uses WebView with JS, uncomment the following
# and specify the fully qualified class name to the JavaScript interface
# class:
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
# public *;
#}
@@ -0,0 +1,26 @@
package com.liskovsoft.browser;

import android.content.Context;
import android.support.test.InstrumentationRegistry;
import android.support.test.runner.AndroidJUnit4;

import org.junit.Test;
import org.junit.runner.RunWith;

import static org.junit.Assert.*;

/**
* Instrumentation test, which will execute on an Android device.
*
* @see <a href="http://d.android.com/tools/testing">Testing documentation</a>
*/
@RunWith(AndroidJUnit4.class)
public class ExampleInstrumentedTest {
@Test
public void useAppContext() throws Exception {
// Context of the app under test.
Context appContext = InstrumentationRegistry.getTargetContext();

assertEquals("com.liskovsoft.browser.test", appContext.getPackageName());
}
}
13 changes: 13 additions & 0 deletions browser/src/main/AndroidManifest.xml
@@ -0,0 +1,13 @@
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.liskovsoft.browser">

<uses-permission android:name="android.permission.INTERNET"/>
<uses-permission android:name="android.permission.WAKE_LOCK"/>
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
<uses-permission android:name="com.android.browser.permission.READ_HISTORY_BOOKMARKS"/>

<application android:name=".Browser" android:theme="@style/AppTheme">

</application>

</manifest>
@@ -0,0 +1,74 @@
package com.liskovsoft.browser;

import android.content.Intent;
import android.content.res.Configuration;
import android.os.Bundle;
import android.view.ActionMode;
import android.view.ContextMenu;
import android.view.ContextMenu.ContextMenuInfo;
import android.view.KeyEvent;
import android.view.Menu;
import android.view.MenuItem;
import android.view.MotionEvent;
import android.view.View;


public interface ActivityController {

void start(Intent intent);

void onSaveInstanceState(Bundle outState);

void handleNewIntent(Intent intent);

void onResume();

boolean onMenuOpened(int featureId, Menu menu);

void onOptionsMenuClosed(Menu menu);

void onContextMenuClosed(Menu menu);

void onPause();

void onDestroy();

void onConfgurationChanged(Configuration newConfig);

void onLowMemory();

boolean onCreateOptionsMenu(Menu menu);

boolean onPrepareOptionsMenu(Menu menu);

boolean onOptionsItemSelected(MenuItem item);

void onCreateContextMenu(ContextMenu menu, View v, ContextMenuInfo menuInfo);

boolean onContextItemSelected(MenuItem item);

boolean onKeyDown(int keyCode, KeyEvent event);

boolean onKeyLongPress(int keyCode, KeyEvent event);

boolean onKeyUp(int keyCode, KeyEvent event);

void onActionModeStarted(ActionMode mode);

void onActionModeFinished(ActionMode mode);

void onActivityResult(int requestCode, int resultCode, Intent intent);

boolean onSearchRequested();

boolean dispatchKeyEvent(KeyEvent event);

boolean dispatchKeyShortcutEvent(KeyEvent event);

boolean dispatchTouchEvent(MotionEvent ev);

boolean dispatchTrackballEvent(MotionEvent ev);

boolean dispatchGenericMotionEvent(MotionEvent ev);

}

0 comments on commit dc94685

Please sign in to comment.