android-c2dm

Android GCM doesn't work with wifi networks when 3G network is available

非 Y 不嫁゛ 提交于 2019-12-07 07:15:12
问题 I am developing app on Android GCM push notification. Everything works fine .But I am not able to get the notification message when my device is on wifi rather than on data plan of service provider. In my case data plan is 3G but and notification comes as usual to devices but when device is connected through wifi I am not able to get any notifications. 回答1: Well this should not be the case, I have an android app that receives GCM push notifications regardless it is connected via 3G or Wi-Fi.

How to keep Listening for Push Notifications on Android in the background

北城余情 提交于 2019-12-07 06:04:15
问题 I am working on Push Notifications in Android. Now the issue is that I want to keep running my Push Notifications on the back ground as soon as the app start because I have no idea when the server will push the data to the devices. The main requirement is that our corporate app is having more than 10 activities and based on the notification received, I have to bring the related activity on the foreground so that user can preform action on that or do some silent action in the background

“TooManyMessages” Error coming from c2dm.intent.RECEIVE Intent

江枫思渺然 提交于 2019-12-06 14:50:20
问题 Does anyone have any documentation on this "TooManyMessages" error . After I call the GoogleCloudMessaging send method I am getting an intent from com.google.android.c2dm.intent.RECEIVE with the following key/value pairs in the extras bundle. Send error: Bundle[{error=TooManyMessages, message_type=send_error, google.message_id=1, android.support.content.wakelockid=1} 回答1: This means that too many messages were stored in the GCM server for a single device without being delivered (which might

Unregister C2DM registration Id

眉间皱痕 提交于 2019-12-06 14:28:02
问题 I want to un-register C2DM registration id. When I run the code below: public void unregisterForC2DM() { Intent unregIntent = new Intent("com.google.android.c2dm.intent.UNREGISTER"); unregIntent.putExtra("app", PendingIntent.getBroadcast(this, 0, new Intent(), 0)); startService(unregIntent); } app should not get the message from third party server. But app is still getting messages from server. I have put all required permission in the manifest file. Referred site : http://code.google.com

How to send images and website link through GCM..?

时光毁灭记忆、已成空白 提交于 2019-12-06 13:59:44
问题 I am sending messages through GCM but i can't find a method to send images and website link through GCM messages...to devices so that if we tap on notification then web link should be opened or image must be downloaded or shown..? 回答1: You can send the weblinks in GCM Message In Client ( GCMIntentService ) - @Override protected void onMessage(Context context, Intent intent) { String uriStr = intent.getStringExtra(FIELD_MESSAGE); //FIELD_MESSAGE is the same key used while sending links from

How to handle GCM changing the registration Id?

♀尐吖头ヾ 提交于 2019-12-06 13:39:47
I was wondering how will app/device be notified if GCM server decides to refresh the registrationId which the app previously retrieved from the GCM server. Currently, I save the 1st retrieved registrationId and save it in the database and send this registrationId to App server. So, from next time App won't be talking to GCM server. In this case App will never know if the registrationId is changed by GCM server. Google document suggest something to handle the case, but it does not mention what steps should be taken. Quote from Google - Although the com.google.android.c2dm.intent.REGISTRATION

android c2dm programming example

老子叫甜甜 提交于 2019-12-06 08:34:24
I am new to android application development. I am developing an android application using c2dm. Can anyone tell me of how to receive the registration id for the application from c2dm. Please tell me with a detailed example and explanation Vishwanath.M public class C2dmEx extends Activity { static TextView mytext = null; Context context = null; Intent intent = null; @Override public void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.main); mytext = (TextView) findViewById(R.id.mytext); mytext.setText("app started"); Intent registrationIntent =

C2DM Server with PHP 401 Error

大憨熊 提交于 2019-12-06 07:24:25
I'm building my own C2DM application right now. I first started with a small Android application to test the push feature. And it works if I just call the curl command with the correct settings in my shell. Now for the server part I wanted to use PHP but as it seems I'm doing something wrong as I always get a 401 error message when I try to send a message to the client. First of all the code consists of two parts. The first curl request asks for the server token. This works I get a real response from google with a working token! The second curl request ends up with a 401 error message. Any

Android C2DM sleeping phone

廉价感情. 提交于 2019-12-05 21:38:24
According to this Android C2DM keeps a socket alive with a heartbeat mechanism, making it able to receive push messages. This made me hope I could deliver messages to sleeping phones with an active wifi connection. I've made an implementation setting the "delay_while_idle" to '0'. The message is delivered if my phones' screen is powered off, but not if the phone goes to sleep (tested with intervals 20mins, 1-6 hours). I have acquired a partial cpu lock + a full wifi lock just in case. Have I simply made something fundamentally wrong or did I misunderstand the C2DM push functionality? Can I

Can not add google account in Google App Emulator

﹥>﹥吖頭↗ 提交于 2019-12-05 21:21:02
I am trying to implement my first Android C2DM aplication. I have difficulty in adding a google account. My machine is behind a proxy, but I have added an APN with the proxy,port,username,password details. I can go to the google account page using a browser, I have tried the http and https sites and I am able to access. But when I try to add a google account by going to settings-> Accounts and Sync-> Add Account->google->Already have a google account->signin->give details...It gives me this message.. Error message is "Cant establish a reliable data connection to the server" When i used wire