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
0 parents
commit 1e47a53
Showing
34 changed files
with
7,046 additions
and
0 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,9 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<classpath> | ||
<classpathentry kind="src" path="src"/> | ||
<classpathentry kind="src" path="gen"/> | ||
<classpathentry kind="con" path="com.android.ide.eclipse.adt.ANDROID_FRAMEWORK"/> | ||
<classpathentry kind="con" path="com.android.ide.eclipse.adt.LIBRARIES"/> | ||
<classpathentry kind="lib" path="libs/cordova-1.9.0.jar"/> | ||
<classpathentry kind="output" path="bin/classes"/> | ||
</classpath> |
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,2 @@ | ||
*.DS_Store | ||
bin |
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,33 @@ | ||
<?xml version="1.0" encoding="UTF-8"?> | ||
<projectDescription> | ||
<name>PusherExample</name> | ||
<comment></comment> | ||
<projects> | ||
</projects> | ||
<buildSpec> | ||
<buildCommand> | ||
<name>com.android.ide.eclipse.adt.ResourceManagerBuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
<buildCommand> | ||
<name>com.android.ide.eclipse.adt.PreCompilerBuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
<buildCommand> | ||
<name>org.eclipse.jdt.core.javabuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
<buildCommand> | ||
<name>com.android.ide.eclipse.adt.ApkBuilder</name> | ||
<arguments> | ||
</arguments> | ||
</buildCommand> | ||
</buildSpec> | ||
<natures> | ||
<nature>com.android.ide.eclipse.adt.AndroidNature</nature> | ||
<nature>org.eclipse.jdt.core.javanature</nature> | ||
</natures> | ||
</projectDescription> |
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,49 @@ | ||
<manifest xmlns:android="http://schemas.android.com/apk/res/android" | ||
package="com.pusher.pusherexample" | ||
android:versionCode="1" | ||
android:versionName="1.0" > | ||
|
||
<uses-sdk | ||
android:minSdkVersion="8" | ||
android:targetSdkVersion="15" /> | ||
|
||
<supports-screens | ||
android:largeScreens="true" | ||
android:normalScreens="true" | ||
android:smallScreens="true" | ||
android:resizeable="true" | ||
android:anyDensity="true" /> | ||
|
||
<uses-permission android:name="android.permission.VIBRATE" /> | ||
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> | ||
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> | ||
<uses-permission android:name="android.permission.ACCESS_LOCATION_EXTRA_COMMANDS" /> | ||
<uses-permission android:name="android.permission.READ_PHONE_STATE" /> | ||
<uses-permission android:name="android.permission.INTERNET" /> | ||
<uses-permission android:name="android.permission.RECEIVE_SMS" /> | ||
<uses-permission android:name="android.permission.RECORD_AUDIO" /> | ||
<uses-permission android:name="android.permission.MODIFY_AUDIO_SETTINGS" /> | ||
<uses-permission android:name="android.permission.READ_CONTACTS" /> | ||
<uses-permission android:name="android.permission.WRITE_CONTACTS" /> | ||
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" /> | ||
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" /> | ||
<uses-permission android:name="android.permission.GET_ACCOUNTS" /> | ||
<uses-permission android:name="android.permission.BROADCAST_STICKY" /> | ||
|
||
<application | ||
android:icon="@drawable/ic_launcher" | ||
android:label="@string/app_name" | ||
android:theme="@style/AppTheme" > | ||
<activity | ||
android:name=".PusherExample" | ||
android:label="@string/title_activity_main" | ||
android:configChanges="orientation|keyboardHidden|screenSize" > | ||
<intent-filter> | ||
<action android:name="android.intent.action.MAIN" /> | ||
|
||
<category android:name="android.intent.category.LAUNCHER" /> | ||
</intent-filter> | ||
</activity> | ||
</application> | ||
|
||
</manifest> |
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,22 @@ | ||
<!DOCTYPE HTML> | ||
<html> | ||
<head> | ||
<title>Pusher Example</title> | ||
</head> | ||
<body> | ||
<h1>Hello Pusher</h1> | ||
<h2>Device Info:</h2> | ||
<div id="deviceProperties"></div> | ||
|
||
<h2>Pusher</h2> | ||
<label>Connection status: </label><span id="connectionStatus">no loaded</span><br /> | ||
<label>Subscription status: </label><span id="subscriptionStatus">not loaded</span><br /> | ||
<button id="subscribeBtn">Subscribe</button> | ||
|
||
<script src="js/libs/cordova-1.9.0.js"></script> | ||
<script src="js/libs/websocket.js"></script> | ||
<script src="http://js.pusher.com/1.12/pusher.js"></script> | ||
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script> | ||
<script src="js/app.js"></script> | ||
</body> | ||
</html> |
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,54 @@ | ||
( function( $ ) { | ||
|
||
var CONFIG = { | ||
PUSHER: { | ||
APP_KEY: '49e26cb8e9dde3dfc009' | ||
} | ||
}; | ||
|
||
document.addEventListener("deviceready", onDeviceReady, false); | ||
|
||
function onDeviceReady() { | ||
|
||
// Get device info | ||
var deviceInfo = 'Device Name: ' + device.name + '<br />' + | ||
'Device Cordova: ' + device.cordova + '<br />' + | ||
'Device Platform: ' + device.platform + '<br />' + | ||
'Device UUID: ' + device.uuid + '<br />' + | ||
'Device Version: ' + device.version + '<br />'; | ||
|
||
$('#deviceProperties').html(deviceInfo) | ||
|
||
// Connect | ||
var pusher = new Pusher(CONFIG.PUSHER.APP_KEY); | ||
pusher.connection.bind('state_change', connectionStateChange); | ||
|
||
function connectionStateChange(state) { | ||
$('#connectionStatus').html(state.current); | ||
} | ||
|
||
// Subscribe | ||
var channel = pusher.subscribe('my-channel'); | ||
channel.bind('pusher:subscription_succeeded', subscriptionSucceeded); | ||
|
||
function subscriptionSucceeded() { | ||
$('#subscriptionStatus').html('succeeded'); | ||
} | ||
|
||
var clicks = 0; | ||
$('#subscribeBtn').click( subscribeBtnClicked ); | ||
function subscribeBtnClicked() { | ||
var channelName = 'channel-' + clicks; | ||
++clicks; | ||
pusher.subscribe(channelName); | ||
} | ||
|
||
} | ||
|
||
} )( jQuery ); | ||
|
||
Pusher.log = function( msg ) { | ||
if( window.console && window.console.log ) { | ||
window.console.log( msg ); | ||
} | ||
}; |
Oops, something went wrong.