├── app ├── .gitignore ├── libs │ └── grpc-all-0.7.1.jar ├── src │ ├── main │ │ ├── res │ │ │ ├── mipmap-hdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-mdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xhdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── mipmap-xxhdpi │ │ │ │ └── ic_launcher.png │ │ │ ├── values │ │ │ │ ├── styles.xml │ │ │ │ ├── dimens.xml │ │ │ │ └── strings.xml │ │ │ ├── menu │ │ │ │ └── menu_main.xml │ │ │ ├── values-w820dp │ │ │ │ └── dimens.xml │ │ │ └── layout │ │ │ │ ├── activity_main.xml │ │ │ │ └── fragment_main.xml │ │ ├── AndroidManifest.xml │ │ └── java │ │ │ └── com │ │ │ └── lovoo │ │ │ └── ubuntudroid │ │ │ └── hellogrpc │ │ │ ├── MainActivity.java │ │ │ └── MainActivityFragment.java │ └── androidTest │ │ └── java │ │ └── com │ │ └── lovoo │ │ └── ubuntudroid │ │ └── hellogrpc │ │ └── ApplicationTest.java ├── proguard-rules.pro └── build.gradle ├── lib_hello_grpc ├── .gitignore ├── libs │ └── grpc-all-0.7.1.jar ├── build.gradle └── src │ └── main │ ├── proto │ └── hello.proto │ └── java │ └── com │ └── lovoo │ └── ubuntudroid │ └── hellogrpc │ └── Server.java ├── settings.gradle ├── .gitignore ├── grpc-android-anim.gif ├── gradle └── wrapper │ ├── gradle-wrapper.jar │ └── gradle-wrapper.properties ├── gradle.properties ├── gradlew.bat ├── README.md └── gradlew /app/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | -------------------------------------------------------------------------------- /lib_hello_grpc/.gitignore: -------------------------------------------------------------------------------- 1 | /build 2 | *.iml -------------------------------------------------------------------------------- /settings.gradle: -------------------------------------------------------------------------------- 1 | include ':app', ':lib_hello_grpc' 2 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | .gradle 2 | /local.properties 3 | /.idea 4 | .DS_Store 5 | /build 6 | /captures 7 | *.iml -------------------------------------------------------------------------------- /grpc-android-anim.gif: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lovoo/grpc-android-demo/HEAD/grpc-android-anim.gif -------------------------------------------------------------------------------- /app/libs/grpc-all-0.7.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lovoo/grpc-android-demo/HEAD/app/libs/grpc-all-0.7.1.jar -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lovoo/grpc-android-demo/HEAD/gradle/wrapper/gradle-wrapper.jar -------------------------------------------------------------------------------- /lib_hello_grpc/libs/grpc-all-0.7.1.jar: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lovoo/grpc-android-demo/HEAD/lib_hello_grpc/libs/grpc-all-0.7.1.jar -------------------------------------------------------------------------------- /app/src/main/res/mipmap-hdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lovoo/grpc-android-demo/HEAD/app/src/main/res/mipmap-hdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-mdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lovoo/grpc-android-demo/HEAD/app/src/main/res/mipmap-mdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lovoo/grpc-android-demo/HEAD/app/src/main/res/mipmap-xhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/mipmap-xxhdpi/ic_launcher.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/lovoo/grpc-android-demo/HEAD/app/src/main/res/mipmap-xxhdpi/ic_launcher.png -------------------------------------------------------------------------------- /app/src/main/res/values/styles.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/values/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 16dp 4 | 16dp 5 | 6 | -------------------------------------------------------------------------------- /gradle/wrapper/gradle-wrapper.properties: -------------------------------------------------------------------------------- 1 | #Mon Jun 29 14:45:03 CEST 2015 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-2.4-all.zip 7 | -------------------------------------------------------------------------------- /app/src/main/res/menu/menu_main.xml: -------------------------------------------------------------------------------- 1 | 4 | 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/values-w820dp/dimens.xml: -------------------------------------------------------------------------------- 1 | 2 | 5 | 64dp 6 | 7 | -------------------------------------------------------------------------------- /app/src/main/res/values/strings.xml: -------------------------------------------------------------------------------- 1 | 2 | Hello GRPC 3 | Hello GRPC world! 4 | Settings 5 | Hello server! 6 | GRPC server host 7 | port 8 | 9 | -------------------------------------------------------------------------------- /app/src/main/res/layout/activity_main.xml: -------------------------------------------------------------------------------- 1 | 8 | -------------------------------------------------------------------------------- /app/src/androidTest/java/com/lovoo/ubuntudroid/hellogrpc/ApplicationTest.java: -------------------------------------------------------------------------------- 1 | package com.lovoo.ubuntudroid.hellogrpc; 2 | 3 | import android.app.Application; 4 | import android.test.ApplicationTestCase; 5 | 6 | /** 7 | * Testing Fundamentals 8 | */ 9 | public class ApplicationTest extends ApplicationTestCase { 10 | public ApplicationTest () { 11 | super(Application.class); 12 | } 13 | } -------------------------------------------------------------------------------- /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 /Users/Sven.Bendel/Library/Android/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 | -------------------------------------------------------------------------------- /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 -------------------------------------------------------------------------------- /app/src/main/AndroidManifest.xml: -------------------------------------------------------------------------------- 1 | 2 | 4 | 5 | 6 | 7 | 8 | 13 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /app/build.gradle: -------------------------------------------------------------------------------- 1 | apply plugin: 'com.android.application' 2 | 3 | android { 4 | compileSdkVersion 22 5 | buildToolsVersion "23.0.0 rc2" 6 | 7 | defaultConfig { 8 | applicationId "com.lovoo.ubuntudroid.hellogrpc" 9 | minSdkVersion 21 10 | targetSdkVersion 22 11 | versionCode 1 12 | versionName "1.0" 13 | } 14 | buildTypes { 15 | release { 16 | minifyEnabled false 17 | proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 18 | } 19 | } 20 | 21 | lintOptions { 22 | disable 'InvalidPackage' 23 | } 24 | } 25 | 26 | dependencies { 27 | compile fileTree(dir: 'libs', include: ['*.jar']) 28 | //compile fileTree(dir: '../lib_hello_grpc/libs', include: ['grpc-all-0.7.1.jar']) 29 | compile project(':lib_hello_grpc') 30 | compile 'com.jakewharton:butterknife:7.0.0' 31 | compile 'com.squareup.okhttp:okhttp:2.4.0' 32 | compile 'com.squareup.picasso:picasso:2.5.2' 33 | } 34 | -------------------------------------------------------------------------------- /lib_hello_grpc/build.gradle: -------------------------------------------------------------------------------- 1 | buildscript { 2 | repositories { 3 | mavenCentral() 4 | } 5 | dependencies { 6 | classpath 'com.google.protobuf:protobuf-gradle-plugin:0.4.1' 7 | } 8 | } 9 | 10 | apply plugin: 'java' 11 | apply plugin: 'com.google.protobuf' 12 | 13 | //region protobuf code generation 14 | sourceSets { 15 | main { 16 | proto { 17 | plugins { 18 | grpc { } 19 | } 20 | } 21 | } 22 | } 23 | 24 | protocDep = "com.google.protobuf:protoc:3.0.0-alpha-3" 25 | protobufNativeCodeGenPluginDeps = ["grpc:io.grpc:protoc-gen-grpc-java:0.7.1"] 26 | 27 | apply plugin: 'idea' 28 | 29 | // Allow intellij projects to refer to generated-sources 30 | idea { 31 | module { 32 | // The whole build dir is excluded by default, but we need build/generated-sources, 33 | // which contains the generated proto classes. 34 | excludeDirs = [file('.gradle')] 35 | if (buildDir.exists()) { 36 | excludeDirs += files(buildDir.listFiles()) 37 | excludeDirs -= file("$buildDir/generated-sources") 38 | } 39 | } 40 | } 41 | //endregion 42 | 43 | dependencies { 44 | compile fileTree(dir: 'libs', include: ['*.jar']) 45 | 46 | compile 'com.google.guava:guava:18.0' 47 | compile 'com.google.protobuf:protobuf-java:3.0.0-alpha-2' 48 | compile 'com.google.code.findbugs:jsr305:3.0.0' 49 | // we cannot use the following dependency as com.google.auth:google-auth-library-oauth2-http:0.1.0 seems to be unavailable right now 50 | //compile 'io.grpc:grpc-all:0.7.1' 51 | 52 | // these libraries are necessary for the server 53 | compile 'io.netty:netty-all:4.1.0.Beta5' 54 | compile 'com.twitter:hpack:0.11.0' 55 | } -------------------------------------------------------------------------------- /lib_hello_grpc/src/main/proto/hello.proto: -------------------------------------------------------------------------------- 1 | // Copyright 2015, Google Inc. 2 | // All rights reserved. 3 | // 4 | // Redistribution and use in source and binary forms, with or without 5 | // modification, are permitted provided that the following conditions are 6 | // met: 7 | // 8 | // * Redistributions of source code must retain the above copyright 9 | // notice, this list of conditions and the following disclaimer. 10 | // * Redistributions in binary form must reproduce the above 11 | // copyright notice, this list of conditions and the following disclaimer 12 | // in the documentation and/or other materials provided with the 13 | // distribution. 14 | // * Neither the name of Google Inc. nor the names of its 15 | // contributors may be used to endorse or promote products derived from 16 | // this software without specific prior written permission. 17 | // 18 | // THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 19 | // "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 20 | // LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 21 | // A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 22 | // OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 23 | // SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 24 | // LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 25 | // DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 26 | // THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 27 | // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 28 | // OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 29 | 30 | syntax = "proto3"; 31 | 32 | package helloworld; 33 | 34 | option java_multiple_files = true; 35 | option java_package = "io.grpc.examples.helloworld"; 36 | option java_outer_classname = "HelloWorldProto"; 37 | 38 | // The greeting service definition. 39 | service Greeter { 40 | // Sends a greeting 41 | rpc SayHello (HelloRequest) returns (HelloResponse) {} 42 | } 43 | 44 | // The request message containing the user's name. 45 | message HelloRequest { 46 | string name = 1; 47 | } 48 | 49 | // The response message containing the greetings 50 | message HelloResponse { 51 | string message = 1; 52 | } -------------------------------------------------------------------------------- /app/src/main/res/layout/fragment_main.xml: -------------------------------------------------------------------------------- 1 | 10 | 11 | 16 | 17 | 24 | 25 | 32 | 33 | 34 |