Skip to content

Commit 731e730

Browse files
author
Devendra
committed
adding example app which subscribes to hello world at boot, phone or avd needs to be restarted on install
1 parent 908c3bb commit 731e730

33 files changed

Lines changed: 253 additions & 58 deletions

‎android/3.4/Pubnub-Android-3.4.jar‎

1 Byte
Binary file not shown.

‎android/3.4/build.xml‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
<target depends="copy_jars_to_examples" name="build"/>
3131
<target depends="create-jar" name="copy_jars_to_examples">
3232
<copy file="Pubnub-Android-3.4.jar" todir="./examples/PubnubExample/libs/"/>
33+
<copy file="Pubnub-Android-3.4.jar" todir="./examples/SubscribeAtBoot/libs/"/>
3334
</target>
3435

3536
<target depends="build-project" name="create-jar">
1 Byte
Binary file not shown.
Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,32 @@
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2+
package="com.pubnub.examples.subscribeatboot"
3+
android:permission="android.permission.RECEIVE_BOOT_COMPLETED"
4+
android:versionCode="1"
5+
android:versionName="1.0" >
6+
>
7+
<uses-sdk
8+
android:minSdkVersion="8"
9+
android:targetSdkVersion="17" />
10+
11+
12+
<application
13+
android:allowBackup="true"
14+
android:icon="@drawable/ic_launcher"
15+
android:label="@string/app_name"
16+
android:theme="@style/AppTheme" >
17+
<receiver android:name="com.pubnub.examples.subscribeatboot.BootReceiver" >
18+
<intent-filter>
19+
<action android:name="android.intent.action.BOOT_COMPLETED" />
20+
</intent-filter>
21+
</receiver>
22+
23+
<service
24+
android:name="com.pubnub.examples.subscribeatboot.PubnubService"
25+
android:enabled="true" />
26+
</application>
27+
28+
<uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED" >
29+
</uses-permission>
30+
<uses-permission android:name="android.permission.INTERNET"/>
31+
32+
</manifest>
50.2 KB
Loading
30.9 KB
Binary file not shown.
Binary file not shown.
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# To enable ProGuard in your project, edit project.properties
2+
# to define the proguard.config property as described in that file.
3+
#
4+
# Add project specific ProGuard rules here.
5+
# By default, the flags in this file are appended to flags specified
6+
# in ${sdk.dir}/tools/proguard/proguard-android.txt
7+
# You can edit the include path and order by changing the ProGuard
8+
# include property in project.properties.
9+
#
10+
# For more details, see
11+
# http://developer.android.com/guide/developing/tools/proguard.html
12+
13+
# Add any project specific keep options here:
14+
15+
# If your project uses WebView with JS, uncomment the following
16+
# and specify the fully qualified class name to the JavaScript interface
17+
# class:
18+
#-keepclassmembers class fqcn.of.javascript.interface.for.webview {
19+
# public *;
20+
#}
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# This file is automatically generated by Android Tools.
2+
# Do not modify this file -- YOUR CHANGES WILL BE ERASED!
3+
#
4+
# This file must be checked in Version Control Systems.
5+
#
6+
# To customize properties used by the Ant build system edit
7+
# "ant.properties", and override values to adapt the script to your
8+
# project structure.
9+
#
10+
# To enable ProGuard to shrink and obfuscate your code, uncomment this (available properties: sdk.dir, user.home):
11+
#proguard.config=${sdk.dir}/tools/proguard/proguard-android.txt:proguard-project.txt
12+
13+
# Project target.
14+
target=android-17
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
package com.pubnub.examples.subscribeatboot;
2+
3+
import android.content.BroadcastReceiver;
4+
import android.content.Context;
5+
import android.content.Intent;
6+
import android.util.Log;
7+
8+
public class BootReceiver extends BroadcastReceiver {
9+
10+
@Override
11+
public void onReceive(Context context, Intent arg1) {
12+
Intent intent = new Intent(context, PubnubService.class);
13+
context.startService(intent);
14+
Log.i("PubnubService", "started");
15+
}
16+
17+
}

0 commit comments

Comments
 (0)