Android :: Register App With C2DM
Sep 21, 2010
I am using the Emulator of version 8. and when i am trying to register the Android Application then it will gives the null registration ID. Please help me to resolve this issue. How can i register the Android Application with C2DM.My code is to register the App.
Intent registrationIntent = new Intent("com.google.android.c2dm.intent.REGISTER");
registrationIntent.putExtra("app", PendingIntent.getBroadcast(startCode.this, 0, new Intent(), 0)); // boilerplate
registrationIntent.putExtra("sender", "12786@gmail.com");
startService(registrationIntent);
handleRegistration(getApplicationContext(), registrationIntent);...............
View 1 Replies
Sep 5, 2010
I'm trying to test the C2DM framework. I got the confirmation email a couple of days ago and then tryied to create a client that could register. For that purpose, I created a simple client following the steps described in this tutorial:
http://code.google.com/intl/es-419/android/c2dm/index.html.
The Android manifest file contains among other things this code:
<permission android:name="com.bilthon.ufrj.permission.C2D_MESSAGE"
android:protectionLevel="signature" />
<uses-permission android:name="com.bilthon.ufrj.permission.C2D_MESSAGE" />
<uses-permission android:name="com.google.android.c2dm.permission.RECEIVE" />
<uses-permission android:name="android.permission.INTERNET"/>
<receiver android:name=".C2DMReceiver"
android:permission="com.google.android.c2dm.permission.SEND">
<intent-filter> <action android:name="com.google.android.c2dm.intent.REGISTRATION" />
<category android:name="com.bilthon.ufrj" /> </intent-filter>
<intent-filter> <action android:name="com.google.android.c2dm.intent.RECEIVE" />
<category android:name="com.bilthon.ufrj" /> </intent-filter> </receiver>
And then, the main activity launched when the program starts has the following code:
Intent registrationIntent = new Intent("com.google.android.c2dm.intent.REGISTER");
registrationIntent.putExtra("app", PendingIntent.getBroadcast(this, 0, new Intent(), 0));
// boilerplate registrationIntent.putExtra("sender","mytestemail@gmail.com");
Log.d("WelcomeScreen","mytestemail@gmail.com");
startService(registrationIntent);
I also registered a google account on the AVD running my client, as they said it was required. But the problem is that I cannot get the broadcast receiver to "wake up". I don't know what could be wrong. By analysing the logs, I can see that the registration intent is created and apparently used correctly, but the receiver code just never is executed, what could be wrong?
View 3 Replies
View Related
Aug 20, 2010
I looked all over the web and in this group for a solution but I don't seem to have any luck. I'm probably not the only developer that needs to try C2DM on the emulator so a solution to this could be quite useful. First of all let me say that I'm running the latest Google APIs 8 rev 2 as AVD which should have all the necessary magic to allow me to run C2DM (it even has all the market components to run the LVL). I tried both Chrome to Phone and Jumpnote and it was impossible to make the C2DM service work. - Chrome to Phone fails when trying to connect from the Android app running on the emulator with a "Error: Unable to connect". On the Chrome to Phone site they recommend that Talk should be tried first and that the Market should be available (none of these come in the emulator image and I'm not sure if I should even try to install them on the emulator). - Jumpnote does not synchronize automatically and gives me an error: "Error calling remote note sync RPC" (when I do a manual sync I can see the docs being synchronized but looks like C2DM, which enables the auto sync, is broken). I also heard a comment that maybe port forwarding via adb could be necessary (but I'm really not sure this makes any sense).
View 5 Replies
View Related
Jul 7, 2010
We are looking for possibility of extend C2DM to other platform such as WM. And want to check the technology or protocol behind android 2.2 Cloud to Device Messaging.
View 2 Replies
View Related
Aug 16, 2010
I'd like my Android app to receive notification when new messages arrive in my gmail account. I realize that the Android gmail client does not broadcast notification when it receives messages. Instead I want to utilize the gmail server's Cloud to Device Messaging capabilities to do this. I read the article at http://code.google.com/android/c2dm/ - the only "missing piece" for me is to understand how my app sends a
registration ID to the gmail server. Can someone please point me in the right direction?
View 1 Replies
View Related
Aug 19, 2010
Is C2DM one way communication? Is it always from "cloud2Android"? Is it possible to work from Windows2Cloud?
i.e. Is there a way to send messages from Cloud to PC?
View 5 Replies
View Related
Jul 30, 2010
its not that big deal but i found a Syntax error in the code for C2DM Registering from this site registrationIntent.putExtra("app", PendingIntent.getBroadcast(this, 0, new Intent(), 0); where they missing the end ")" and here's my magical fix :) registrationIntent.putExtra("app", PendingIntent.getBroadcast(this, 0, new Intent(), 0));
View 2 Replies
View Related
Jul 6, 2010
I am playing around with C2DM service. What I am concerned about is that I cannot test my device-side application from Android 2.2 emulator. The application was built more or less according to http://code.google.com/android/c2dm/index.html doc, but when register intent is sent from application, Logcat shows this: Unable to start service Intent { act=com.google.android.c2dm.intent.REGISTER (has extras) }: not found I also tried to run chrometophone and jumpnote applications and the result is the same when registring device. Any ideas? Is it possible to test C2DM service from Android emulator?
View 9 Replies
View Related
Oct 18, 2010
I'm adding Android C2DM to a Android library project. I started with the com.google.android.c2dm package that is included with JumpNote and Chrome To Phone. In order to use this package, you have to subclass the C2DMBaseReceiver service which takes the Sender Id as an argument to it's constructor. In JumpNote, this argument is initialized using a hard-coded static variable in a config class. However, in an Android library project, which may be used by multiple concurrently running apps I don't think I can use a hard-coded static variable (that is, I believe it could lead to problems when/if multiple apps are trying to access/modify the static variable). I tried to think of a way to initialize the Sender Id without using a static variable and am stumped so far.The obvious solution would be to use the Manifest or a Resource string or a combination of the 2. For example, in strings.xml I might have a "ac2dmSender" string, which is accessed in a meta-data child of the C2DMReceiver service declaration in the manifest. However, it seems that you cannot get a reference to the PackageManager or ResourceManager from a static context, so there is no way for me to then retrieve the meta data in such a way as to pass it in to the constructor of C2DMBaseReceiver.
View 1 Replies
View Related
Sep 24, 2010
Has any one implemented C2dm successfully,
then please send the code, how to get registration_id form c2dm server for our application.
View 2 Replies
View Related
Aug 2, 2010
When i open jumpNote project in eclipse,i encounter some mistakes like the following description. many variables related with c2dm like
Config.C2DM_ACCOUNT_EXTRA,
Config.C2DM_MESSAGE_SYNC,
Config.C2DM_SENDER etc
*cannot be resolved.*
i uses the latest sdk(2.2).
any one konws the reasons, i think that if i miss some jar files?
View 3 Replies
View Related
Nov 5, 2010
I've been messing around with C2DM and have a nice little app working perfectly in the Emulator. I send a message from my app server to Google's C2DM servers, the message will arrive on the emulator and my app would respond appropriately.
My problem now is running the app on my smartphone (a Nexus One). The app runs fine and registers for C2DM with Google and then forwards it's rego ID to my application server. This is all working as expected. Problem is, when I send a message from my app server to the phone, my app never receives the message. After some investigation I found out
that the message reaches the phone, but the C2DM subsystem seems to be forwarding the message to the Google Talk app and not MY app.
Has anyone seen this behavior before? Can anyone give hints on what to look for to solve this? I was assuming that if the registration messages where forwarded to my app, then everything else should be as well.
View 1 Replies
View Related
Nov 24, 2010
Contact email *
Email address we should contact when you've been whitelisted:
aaa@gmail.com
Role account email *
Google Account ID that will be used for sending messages to C2DM:
bbb@gmail.com
I register from my app and sender id (bbb@gmail.com) to c2dm service and i get registration_id. After that my third party server must get ClientLogin authentication using email and password. From which email? The whitelisted email (aaa@gmail.com) or sender id (bbb@gmail.com)?? I try both email and from this process i got authorization_id. But when i use the registration_id and authorization_id to send message to C2DM Server, i got response codes 401 Unauthorize. I use authorization_id from whitelisted email (aaa@gmail.com) and sender id (bbb@gmail.com) but none worked.
View 2 Replies
View Related
Jul 21, 2010
I am currently working on implementing C2DM stuff and have got this far.
1. Register the device and get back a device registration ID 2. The server gets a Client Authorization Token for "ac2dm" service 3. The server then sends a message to the device via C2DM using the registration id and the client authorization code and gets the following "NotRegistered" message back.
Meaning: NotRegistered — The registration_id is no longer valid, for example user has uninstalled the application or turned off notifications. Sender should stop sending messages to this device.
The thing is as soon as i get the registration id i am sending it to my server which is then sending a message via C2DM all within the space of 1 minute. so how can it not be valid?
I have registered for use the C2DM service and i would expect that if i was not registered with Google then i would not get a registration device id right? Although i don't remember getting an email from google saying i was registered apart from that when i registered to be white listed it did say something about being added to a list. Anyway your views and opinions are welcome.
View 5 Replies
View Related
Aug 17, 2009
How can I register for SMS database changes? I tried:
mCursor = mActivity.getContentResolver().query(Sms.CONTENT_URI, new String[] { Sms.ADDRESS }, null, null, null);
mCursor.registerDataSetObserver(mydataSetObserver);
where mydataSetObserver is implemented like this:
private class MyDataSetObserver extends DataSetObserver {
public void onChanged() { System.out.println ("1");
} public void onInvalidated() { System.out.println ("2");
} }
But when I tried sending a SMS message in the emulator, MyDataSetObserver never get called.
View 2 Replies
View Related
Apr 6, 2010
I tried to register too late for Google IO and its already sold out. I really wanted to go this year and don't care about getting a free phone. Anyone know if there is a way to still register? What about taking the place of those who cancel their registrations? Next year I will register the day it opens.
View 3 Replies
View Related
Aug 18, 2009
Can you explain to me how to registred a project for the ADC2. Can i publish now or i need to waiting update the ADC official site?
View 2 Replies
View Related
Aug 31, 2009
Does anyone knows how to register in the ADC2 as a team? Where can I asign the team members for an aplication?
View 4 Replies
View Related
Dec 5, 2009
I have a question regarding services. In Android I am able to use all the methods defined in the service by calling bindService(). In bindService() we have to pass the ServiceConnection object and could able to get the reference of Service Interface through which we can invoke service methods. But Android framework services (System services) are started in a different manner by just calling the getSystemService(). How can I register my service with Android framework.
View 4 Replies
View Related
Jun 30, 2009
How to register listening for any Contact (add/remove contact, change in email/phone) changes on android?
View 1 Replies
View Related
Jul 28, 2010
From the previous question I asked, I am still having the same question. I do not know how to use database (SQLite) to 'sync' with my application to log in or register
package log1.log2;
import android.app.Activity;
import android.content.Intent;
import android.os.Bundle;
import android.view.View;
import android.view.View.OnClickListener;
import android.widget.Button;
import android.widget.EditText;
import android.widget.TextView;................
View 1 Replies
View Related
Nov 24, 2010
how can I register my application so that when I receive a sms my app appears in dialog Complete action using. I have put in an intent code
<intent-filter>
<action android:name="android.intent.action.VIEW"/>
<action android:name="android.intent.action.SENDTO"/>
<category android:name="android.intent.category.DEFAULT"/>
<category android:name="android.intent.category.BROWSABLE"/>
<data android:scheme="sms"/>
</intent-filter>
but it's not working... should I use receiver? Note that the activity in which I've inserted this code is not main activity.
View 2 Replies
View Related
Sep 13, 2009
How can I register a custom codewise created drawable for use in the xml files for the @drawable/. notation? Is there a way to get the drawable into the List which is also display in the R.drawable.? The other part isn't if I for example create a GradientDrawable which is inherited, how can I use it in xml files like the <gradient> tag? Where must I register that?
View 2 Replies
View Related
Oct 10, 2009
A simple question: How do I register for multiple sensors? I just switched from registerListener(SensorListener listener, int sensors, int rate), which is deprecated, to registerListener(SensorEventListener listener, Sensor sensor, int rate). Previously, I could use " | " to indicate multiple sensors, but now " | " is undefined, so how?
View 4 Replies
View Related
Oct 26, 2010
On Tue, Oct 26, 2010 at 1:50 AM, Tim <tim.ka...@gmail.com> wrote:
> "AlarmManager.setRepeating()" can be set with "interval". But the max > available interval is daily - "INTERVAL_DAY". So, how to set weekly/ > monthly/yearly interval?
View 5 Replies
View Related
Aug 14, 2009
Can you please tell me how to register SMS received action? I tried the following, but when I set up a breakpoint in onReceive() never get called. Please help if you have any idea.
import android.provider.Telephony.Sms.Intents;
registerReceiver(new MyReceiver, new IntentFilter(Intents.SMS_RECEIVED_ACTION));
private class MyReceiver extends BroadcastReceiver {
@Override public void onReceive(Context context, Intent intent) {
}
[Quote]
View 2 Replies
View Related
Jun 18, 2009
On android, is it possible to listen for all outgoing call events? i.e. my code get invoked when users make an out-going phone call? One possible way is to periodically pull call-log database for that information. But I would like to know if i can register for a notification when outgoing call happens?
View 3 Replies
View Related
Aug 25, 2009
What is the approx time taken to register as a developer and to be able to publish apps on the Android Market? Do we need to wait for any approval from Google to be able to publish the apps once registered as a developer and a Google checkout merchant?
View 8 Replies
View Related
Mar 5, 2010
I was trying to find out were my apps memory was being leaked and was able to discover that when calling registerCallback(...) it would lead to a memory leak after a screen orientation change. What could be some possible things that are causing the leak? I've tried many things. And I do have a unregisterCallback(..) call.
View 20 Replies
View Related
Nov 9, 2010
I use my file explorer a lot. It eliminates much of the "You have to put the files here" sort of requirement of many applications. And in many case - movie files for example - when you touch the file, it opens it in the appropriate application. There are exceptions like *.epub files. When I touch one, I get the famous "...does not support." message. So the question is, can I "register" Laputa (for example) to be the app to open *.epub files - Similar to the File Types dialog in Windows?I suppose this might require root access?
View 3 Replies
View Related