Permalink
Browse files

Added new project GCMExample

  • Loading branch information...
1 parent a66f19a commit 5f44107a52fda96763f8e29c6d48fe56c0b1b7ff @rakeshcusat committed Jul 10, 2012
Showing with 310 additions and 5 deletions.
  1. +8 −0 AndroidProjects/GCMExample/.classpath
  2. +33 −0 AndroidProjects/GCMExample/.project
  3. +45 −0 AndroidProjects/GCMExample/AndroidManifest.xml
  4. +45 −0 AndroidProjects/GCMExample/bin/AndroidManifest.xml
  5. +6 −0 AndroidProjects/GCMExample/gen/com/rakesh/gcmexample/BuildConfig.java
  6. +16 −0 AndroidProjects/GCMExample/gen/com/rakesh/gcmexample/Manifest.java
  7. +40 −0 AndroidProjects/GCMExample/gen/com/rakesh/gcmexample/R.java
  8. BIN AndroidProjects/GCMExample/ic_launcher-web.png
  9. BIN AndroidProjects/GCMExample/libs/android-support-v4.jar
  10. +20 −0 AndroidProjects/GCMExample/proguard-project.txt
  11. +14 −0 AndroidProjects/GCMExample/project.properties
  12. BIN AndroidProjects/GCMExample/res/drawable-hdpi/ic_action_search.png
  13. BIN AndroidProjects/GCMExample/res/drawable-hdpi/ic_launcher.png
  14. BIN AndroidProjects/GCMExample/res/drawable-ldpi/ic_launcher.png
  15. BIN AndroidProjects/GCMExample/res/drawable-mdpi/ic_action_search.png
  16. BIN AndroidProjects/GCMExample/res/drawable-mdpi/ic_launcher.png
  17. BIN AndroidProjects/GCMExample/res/drawable-xhdpi/ic_action_search.png
  18. BIN AndroidProjects/GCMExample/res/drawable-xhdpi/ic_launcher.png
  19. +15 −0 AndroidProjects/GCMExample/res/layout/activity_gcmmain.xml
  20. +6 −0 AndroidProjects/GCMExample/res/menu/activity_gcmmain.xml
  21. +7 −0 AndroidProjects/GCMExample/res/values-large/dimens.xml
  22. +5 −0 AndroidProjects/GCMExample/res/values-v11/styles.xml
  23. +5 −0 AndroidProjects/GCMExample/res/values-v14/styles.xml
  24. +7 −0 AndroidProjects/GCMExample/res/values/dimens.xml
  25. +8 −0 AndroidProjects/GCMExample/res/values/strings.xml
  26. +5 −0 AndroidProjects/GCMExample/res/values/styles.xml
  27. +24 −0 AndroidProjects/GCMExample/src/com/rakesh/gcmexample/GCMMainActivity.java
  28. BIN AndroidProjects/WidgetAlarmManagerExample/bin/WidgetAlarmManagerExample.apk
  29. +0 −2 ...etAlarmManagerExample/src/com/rakesh/widgetalarmmanagerexample/AlarmManagerBroadcastReceiver.java
  30. +1 −3 ...ojects/WidgetAlarmManagerExample/src/com/rakesh/widgetalarmmanagerexample/TimeWidgetProvider.java
View
8 AndroidProjects/GCMExample/.classpath
@@ -0,0 +1,8 @@
+<?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="output" path="bin/classes"/>
+</classpath>
View
33 AndroidProjects/GCMExample/.project
@@ -0,0 +1,33 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<projectDescription>
+ <name>GCMExample</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>
View
45 AndroidProjects/GCMExample/AndroidManifest.xml
@@ -0,0 +1,45 @@
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="com.rakesh.gcmexample"
+ android:versionCode="1"
+ android:versionName="1.0" >
+
+ <uses-sdk
+ android:minSdkVersion="8"
+ android:targetSdkVersion="xx" />
+ <!-- Permissions -->
+ <permission
+ android:name="com.rakesh.gcmexample.permission.C2D_MESSAGE"
+ android:protectionLevel="signature" />
+
+ <uses-permission android:name="com.rakesh.gcmexample.permission.C2D_MESSAGE" />
+ <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
+
+ <application
+ android:icon="@drawable/ic_launcher"
+ android:label="@string/app_name"
+ android:theme="@style/AppTheme" >
+ <activity
+ android:name=".GCMMainActivity"
+ android:label="@string/title_activity_gcmmain" >
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN" />
+
+ <category android:name="android.intent.category.LAUNCHER" />
+ </intent-filter>
+ </activity>
+
+ <!-- Broadcast Receiver -->
+ <receiver
+ android:name="com.google.android.gcm.GCMBroadcastReceiver"
+ android:permission="com.google.android.c2dm.permission.SEND" >
+ <intent-filter>
+ <action android:name="com.google.android.c2dm.intent.RECEIVE" />
+ <action android:name="com.google.android.c2dm.intent.REGISTRATION" />
+
+ <category android:name="com.rakesh.gcmexample" />
+ </intent-filter>
+ </receiver>
+ <service android:name=".GCMIntentService" />
+ </application>
+
+</manifest>
View
45 AndroidProjects/GCMExample/bin/AndroidManifest.xml
@@ -0,0 +1,45 @@
+<manifest xmlns:android="http://schemas.android.com/apk/res/android"
+ package="com.rakesh.gcmexample"
+ android:versionCode="1"
+ android:versionName="1.0" >
+
+ <uses-sdk
+ android:minSdkVersion="8"
+ android:targetSdkVersion="xx" />
+ <!-- Permissions -->
+ <permission
+ android:name="com.rakesh.gcmexample.permission.C2D_MESSAGE"
+ android:protectionLevel="signature" />
+
+ <uses-permission android:name="com.rakesh.gcmexample.permission.C2D_MESSAGE" />
+ <uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
+
+ <application
+ android:icon="@drawable/ic_launcher"
+ android:label="@string/app_name"
+ android:theme="@style/AppTheme" >
+ <activity
+ android:name=".GCMMainActivity"
+ android:label="@string/title_activity_gcmmain" >
+ <intent-filter>
+ <action android:name="android.intent.action.MAIN" />
+
+ <category android:name="android.intent.category.LAUNCHER" />
+ </intent-filter>
+ </activity>
+
+ <!-- Broadcast Receiver -->
+ <receiver
+ android:name="com.google.android.gcm.GCMBroadcastReceiver"
+ android:permission="com.google.android.c2dm.permission.SEND" >
+ <intent-filter>
+ <action android:name="com.google.android.c2dm.intent.RECEIVE" />
+ <action android:name="com.google.android.c2dm.intent.REGISTRATION" />
+
+ <category android:name="com.rakesh.gcmexample" />
+ </intent-filter>
+ </receiver>
+ <service android:name=".GCMIntentService" />
+ </application>
+
+</manifest>
View
6 AndroidProjects/GCMExample/gen/com/rakesh/gcmexample/BuildConfig.java
@@ -0,0 +1,6 @@
+/** Automatically generated file. DO NOT MODIFY */
+package com.rakesh.gcmexample;
+
+public final class BuildConfig {
+ public final static boolean DEBUG = true;
+}
View
16 AndroidProjects/GCMExample/gen/com/rakesh/gcmexample/Manifest.java
@@ -0,0 +1,16 @@
+/* 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.rakesh.gcmexample;
+
+public final class Manifest {
+ public static final class permission {
+ /** Permissions
+ */
+ public static final String C2D_MESSAGE="com.rakesh.gcmexample.permission.C2D_MESSAGE";
+ }
+}
View
40 AndroidProjects/GCMExample/gen/com/rakesh/gcmexample/R.java
@@ -0,0 +1,40 @@
+/* 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.rakesh.gcmexample;
+
+public final class R {
+ public static final class attr {
+ }
+ public static final class dimen {
+ public static final int padding_large=0x7f040002;
+ public static final int padding_medium=0x7f040001;
+ public static final int padding_small=0x7f040000;
+ }
+ public static final class drawable {
+ public static final int ic_action_search=0x7f020000;
+ public static final int ic_launcher=0x7f020001;
+ }
+ public static final class id {
+ public static final int menu_settings=0x7f080000;
+ }
+ public static final class layout {
+ public static final int activity_gcmmain=0x7f030000;
+ }
+ public static final class menu {
+ public static final int activity_gcmmain=0x7f070000;
+ }
+ public static final class string {
+ public static final int app_name=0x7f050000;
+ public static final int hello_world=0x7f050001;
+ public static final int menu_settings=0x7f050002;
+ public static final int title_activity_gcmmain=0x7f050003;
+ }
+ public static final class style {
+ public static final int AppTheme=0x7f060000;
+ }
+}
View
BIN AndroidProjects/GCMExample/ic_launcher-web.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN AndroidProjects/GCMExample/libs/android-support-v4.jar
Binary file not shown.
View
20 AndroidProjects/GCMExample/proguard-project.txt
@@ -0,0 +1,20 @@
+# To enable ProGuard in your project, edit project.properties
+# to define the proguard.config property as described in that file.
+#
+# Add project specific ProGuard rules here.
+# By default, the flags in this file are appended to flags specified
+# in ${sdk.dir}/tools/proguard/proguard-android.txt
+# You can edit the include path and order by changing the ProGuard
+# include property in project.properties.
+#
+# 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 *;
+#}
View
14 AndroidProjects/GCMExample/project.properties
@@ -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-16
View
BIN AndroidProjects/GCMExample/res/drawable-hdpi/ic_action_search.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN AndroidProjects/GCMExample/res/drawable-hdpi/ic_launcher.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN AndroidProjects/GCMExample/res/drawable-ldpi/ic_launcher.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN AndroidProjects/GCMExample/res/drawable-mdpi/ic_action_search.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN AndroidProjects/GCMExample/res/drawable-mdpi/ic_launcher.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN AndroidProjects/GCMExample/res/drawable-xhdpi/ic_action_search.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
BIN AndroidProjects/GCMExample/res/drawable-xhdpi/ic_launcher.png
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
View
15 AndroidProjects/GCMExample/res/layout/activity_gcmmain.xml
@@ -0,0 +1,15 @@
+<RelativeLayout xmlns:android="http://schemas.android.com/apk/res/android"
+ xmlns:tools="http://schemas.android.com/tools"
+ android:layout_width="match_parent"
+ android:layout_height="match_parent" >
+
+ <TextView
+ android:layout_width="wrap_content"
+ android:layout_height="wrap_content"
+ android:layout_centerHorizontal="true"
+ android:layout_centerVertical="true"
+ android:padding="@dimen/padding_medium"
+ android:text="@string/hello_world"
+ tools:context=".GCMMainActivity" />
+
+</RelativeLayout>
View
6 AndroidProjects/GCMExample/res/menu/activity_gcmmain.xml
@@ -0,0 +1,6 @@
+<menu xmlns:android="http://schemas.android.com/apk/res/android">
+ <item android:id="@+id/menu_settings"
+ android:title="@string/menu_settings"
+ android:orderInCategory="100"
+ android:showAsAction="never" />
+</menu>
View
7 AndroidProjects/GCMExample/res/values-large/dimens.xml
@@ -0,0 +1,7 @@
+<resources>
+
+ <dimen name="padding_small">8dp</dimen>
+ <dimen name="padding_medium">16dp</dimen>
+ <dimen name="padding_large">16dp</dimen>
+
+</resources>
View
5 AndroidProjects/GCMExample/res/values-v11/styles.xml
@@ -0,0 +1,5 @@
+<resources>
+
+ <style name="AppTheme" parent="android:Theme.Holo.Light" />
+
+</resources>
View
5 AndroidProjects/GCMExample/res/values-v14/styles.xml
@@ -0,0 +1,5 @@
+<resources>
+
+ <style name="AppTheme" parent="android:Theme.Holo.Light.DarkActionBar" />
+
+</resources>
View
7 AndroidProjects/GCMExample/res/values/dimens.xml
@@ -0,0 +1,7 @@
+<resources>
+
+ <dimen name="padding_small">8dp</dimen>
+ <dimen name="padding_medium">8dp</dimen>
+ <dimen name="padding_large">16dp</dimen>
+
+</resources>
View
8 AndroidProjects/GCMExample/res/values/strings.xml
@@ -0,0 +1,8 @@
+<resources>
+
+ <string name="app_name">GCMExample</string>
+ <string name="hello_world">Hello world!</string>
+ <string name="menu_settings">Settings</string>
+ <string name="title_activity_gcmmain">GCMMainActivity</string>
+
+</resources>
View
5 AndroidProjects/GCMExample/res/values/styles.xml
@@ -0,0 +1,5 @@
+<resources>
+
+ <style name="AppTheme" parent="android:Theme.Light" />
+
+</resources>
View
24 AndroidProjects/GCMExample/src/com/rakesh/gcmexample/GCMMainActivity.java
@@ -0,0 +1,24 @@
+package com.rakesh.gcmexample;
+
+import android.os.Bundle;
+import android.app.Activity;
+import android.view.Menu;
+import android.view.MenuItem;
+import android.support.v4.app.NavUtils;
+
+public class GCMMainActivity extends Activity {
+
+ @Override
+ public void onCreate(Bundle savedInstanceState) {
+ super.onCreate(savedInstanceState);
+ setContentView(R.layout.activity_gcmmain);
+ }
+
+ @Override
+ public boolean onCreateOptionsMenu(Menu menu) {
+ getMenuInflater().inflate(R.menu.activity_gcmmain, menu);
+ return true;
+ }
+
+
+}
View
BIN AndroidProjects/WidgetAlarmManagerExample/bin/WidgetAlarmManagerExample.apk
Binary file not shown.
View
2 ...anagerExample/src/com/rakesh/widgetalarmmanagerexample/AlarmManagerBroadcastReceiver.java
@@ -13,7 +13,6 @@
public class AlarmManagerBroadcastReceiver extends BroadcastReceiver {
- final public static String ONE_TIME = "onetime";
@Override
public void onReceive(Context context, Intent intent) {
PowerManager pm = (PowerManager) context.getSystemService(Context.POWER_SERVICE);
@@ -37,7 +36,6 @@ public void onReceive(Context context, Intent intent) {
public void setOnetimeTimer(Context context){
AlarmManager am=(AlarmManager)context.getSystemService(Context.ALARM_SERVICE);
Intent intent = new Intent(context, AlarmManagerBroadcastReceiver.class);
- intent.putExtra(ONE_TIME, Boolean.TRUE);
PendingIntent pi = PendingIntent.getBroadcast(context, 0, intent, 0);
am.set(AlarmManager.RTC_WAKEUP, System.currentTimeMillis(), pi);
}
View
4 ...idgetAlarmManagerExample/src/com/rakesh/widgetalarmmanagerexample/TimeWidgetProvider.java
@@ -52,7 +52,6 @@ public void onUpdate(Context context, AppWidgetManager appWidgetManager,
R.layout.time_widget_layout);
// Set the text with the current time.
remoteViews.setTextViewText(R.id.tvTime, Utility.getCurrentTime("hh:mm:ss a"));
-
appWidgetManager.updateAppWidget(widgetId, remoteViews);
}
}
@@ -61,9 +60,8 @@ public void onUpdate(Context context, AppWidgetManager appWidgetManager,
public void onAppWidgetOptionsChanged(Context context,
AppWidgetManager appWidgetManager, int appWidgetId,
Bundle newOptions) {
+ //Do some operation here, once you see that the widget has change its size or position.
Toast.makeText(context, "onAppWidgetOptionsChanged() called", Toast.LENGTH_SHORT).show();
- super.onAppWidgetOptionsChanged(context, appWidgetManager, appWidgetId,
- newOptions);
}
}

0 comments on commit 5f44107

Please sign in to comment.