Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
151 changed files
with
3,284 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="com.flotype.bridge" android:versionCode="1" | ||
android:versionName="1.0"> | ||
|
||
|
||
<application android:icon="@drawable/icon" android:label="@string/app_name"> | ||
<activity android:name=".MainActivity" android:label="@string/app_name"> | ||
<intent-filter> | ||
<action android:name="android.intent.action.MAIN" /> | ||
<category android:name="android.intent.category.LAUNCHER" /> | ||
</intent-filter> | ||
</activity> | ||
</application> | ||
<uses-permission android:name="android.permission.INTERNET"></uses-permission> | ||
</manifest> |
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# cache for current jar dependecy. DO NOT EDIT. | ||
# format is <lastModified> <length> <SHA-1> <path> | ||
# Encoding is UTF-8 |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
/** Automatically generated file. DO NOT MODIFY */ | ||
package com.flotype.bridge; | ||
|
||
public final class BuildConfig { | ||
public final static boolean DEBUG = true; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
/* AUTO-GENERATED FILE. DO NOT MODIFY. | ||
* | ||
* This class was automatically generated by the | ||
* aapt tool from the resource data it found. It | ||
* should not be modified by hand. | ||
*/ | ||
|
||
package com.flotype.bridge; | ||
|
||
public final class R { | ||
public static final class attr { | ||
} | ||
public static final class drawable { | ||
public static final int icon=0x7f020000; | ||
} | ||
public static final class id { | ||
public static final int button1=0x7f050002; | ||
public static final int editText1=0x7f050001; | ||
public static final int text=0x7f050000; | ||
} | ||
public static final class layout { | ||
public static final int main=0x7f030000; | ||
} | ||
public static final class string { | ||
public static final int app_name=0x7f040001; | ||
public static final int hello=0x7f040000; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<lint> | ||
</lint> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd"> | ||
<modelVersion>4.0.0</modelVersion> | ||
<artifactId>BridgeAndroidTest</artifactId> | ||
<name>asdf</name> | ||
<properties> | ||
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> | ||
</properties> | ||
<dependencies> | ||
<dependency> | ||
<groupId>com.flotype.bridge</groupId> | ||
<artifactId>bridge-java-core</artifactId> | ||
<version>0.0.1</version> | ||
</dependency> | ||
<dependency> | ||
<groupId>ch.qos.logback</groupId> | ||
<artifactId>logback-classic</artifactId> | ||
<version>1.0.3</version> | ||
</dependency> | ||
</dependencies> | ||
|
||
<url>http://flotype.com</url> | ||
<organization> | ||
<name>Flotype Inc.</name> | ||
<url>http://flotype.com</url> | ||
</organization> | ||
<scm> | ||
<url>http://git.flotype.com/bridge-java</url> | ||
</scm> | ||
<version>0.0.1-snapshot</version> | ||
<groupId>com.sridattalabs</groupId> | ||
</project> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
-optimizationpasses 5 | ||
-dontusemixedcaseclassnames | ||
-dontskipnonpubliclibraryclasses | ||
-dontpreverify | ||
-verbose | ||
-optimizations !code/simplification/arithmetic,!field/*,!class/merging/* | ||
|
||
-keep public class * extends android.app.Activity | ||
-keep public class * extends android.app.Application | ||
-keep public class * extends android.app.Service | ||
-keep public class * extends android.content.BroadcastReceiver | ||
-keep public class * extends android.content.ContentProvider | ||
-keep public class * extends android.app.backup.BackupAgentHelper | ||
-keep public class * extends android.preference.Preference | ||
-keep public class com.android.vending.licensing.ILicensingService | ||
|
||
-keepclasseswithmembernames class * { | ||
native <methods>; | ||
} | ||
|
||
-keepclasseswithmembernames class * { | ||
public <init>(android.content.Context, android.util.AttributeSet); | ||
} | ||
|
||
-keepclasseswithmembernames class * { | ||
public <init>(android.content.Context, android.util.AttributeSet, int); | ||
} | ||
|
||
-keepclassmembers enum * { | ||
public static **[] values(); | ||
public static ** valueOf(java.lang.String); | ||
} | ||
|
||
-keep class * implements android.os.Parcelable { | ||
public static final android.os.Parcelable$Creator *; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
# This file is automatically generated by Android Tools. | ||
# Do not modify this file -- YOUR CHANGES WILL BE ERASED! | ||
# | ||
# This file must be checked in Version Control Systems. | ||
# | ||
# To customize properties used by the Ant build system edit | ||
# "ant.properties", and override values to adapt the script to your | ||
# project structure. | ||
# | ||
# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home): | ||
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt | ||
|
||
# Project target. | ||
target=android-10 |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" | ||
android:layout_width="fill_parent" | ||
android:layout_height="fill_parent" | ||
android:orientation="vertical" > | ||
|
||
<TextView | ||
android:id="@+id/text" | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" | ||
android:layout_weight="1" | ||
android:editable="false" | ||
android:text="Welcome to Bridge Chat" | ||
android:textAppearance="?android:attr/textAppearanceLarge" /> | ||
|
||
<LinearLayout | ||
android:layout_width="match_parent" | ||
android:layout_height="wrap_content" > | ||
|
||
<EditText | ||
android:id="@+id/editText1" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_weight="1" | ||
android:ems="10" > | ||
|
||
<requestFocus /> | ||
</EditText> | ||
|
||
<Button | ||
android:id="@+id/button1" | ||
android:layout_width="wrap_content" | ||
android:layout_height="wrap_content" | ||
android:layout_weight="1" | ||
android:text="Send" /> | ||
</LinearLayout> | ||
|
||
</LinearLayout> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<resources> | ||
<string name="hello">Hello World, MainActivity!</string> | ||
<string name="app_name">BridgeAndroidTest</string> | ||
</resources> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,80 @@ | ||
package com.flotype.bridge; | ||
|
||
import java.io.IOException; | ||
|
||
|
||
import org.apache.log4j.Level; | ||
|
||
|
||
import android.app.Activity; | ||
import android.os.Bundle; | ||
import android.os.Environment; | ||
import android.widget.TextView; | ||
import de.mindpipe.android.logging.log4j.LogConfigurator; | ||
|
||
public class MainActivity extends Activity { | ||
|
||
interface RemoteChat extends BridgeRemoteObject { | ||
public void message(String sender, String message); | ||
} | ||
|
||
|
||
|
||
interface RemoteAuth extends BridgeRemoteObject { | ||
public void join(String room, String pass, ChatObj obj, BridgeObject cb); | ||
} | ||
|
||
static { | ||
final LogConfigurator logConfigurator = new LogConfigurator(); | ||
|
||
logConfigurator.setUseFileAppender(false); | ||
logConfigurator.setRootLevel(Level.DEBUG); | ||
// Set log level of a specific logger | ||
logConfigurator.setLevel("org.apache", Level.ERROR); | ||
logConfigurator.configure(); | ||
} | ||
|
||
interface RemoteGreeter extends BridgeRemoteObject { | ||
public void greet(String name, BridgeObject callback); | ||
} | ||
|
||
Bridge bridge; | ||
|
||
/** Called when the activity is first created. */ | ||
@Override | ||
public void onCreate(Bundle savedInstanceState) { | ||
super.onCreate(savedInstanceState); | ||
setContentView(R.layout.main); | ||
|
||
bridge = new Bridge("abcdefgh"); | ||
try { | ||
RemoteAuth auth = bridge.getService("auth", RemoteAuth.class); | ||
auth.join("bridge-lovers", "secret123", new ChatObj(), new BridgeObject() { | ||
public void callback(RemoteChat channel, String channelName) { | ||
|
||
} | ||
}); | ||
bridge.connect(); | ||
} catch (IOException e) { | ||
// TODO Auto-generated catch block | ||
e.printStackTrace(); | ||
} | ||
} | ||
|
||
public void updateText(final String text) { | ||
runOnUiThread(new Runnable() { | ||
public void run() { | ||
TextView textView = (TextView) findViewById(R.id.text); | ||
textView.append("\n" + text); | ||
} | ||
}); | ||
|
||
} | ||
|
||
class ChatObj implements BridgeObject { | ||
public void message(String sender, String message) { | ||
MainActivity.this.updateText(sender + ": " + message); | ||
} | ||
} | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
from BridgePython import Bridge | ||
|
||
|
||
class AuthHandler(object): | ||
def join(self, room, password, obj, callback): | ||
if password == "secret123": | ||
print ('Welcome!') | ||
# new: join channel using the client's objects | ||
bridge.join_channel(room, obj, callback) | ||
else: | ||
print ('Sorry!') | ||
|
||
bridge = Bridge(api_key='abcdefgh') | ||
bridge.publish_service('auth', AuthHandler()) | ||
|
||
bridge.connect() |
Oops, something went wrong.