Android Tutorial Android push notification (C2DM) framework and tutorial

myriaddev

Active Member
Licensed User
Longtime User
Thanks salmander - you got me started

Hi salmander, I used your code in my Manifest Edit and I could not
get registered. I changed the code a little and now it works for me.
I am not smart enough to know the difference between yours and mine.
Thanks, Jerry
 

Attachments

  • myManifest.txt
    1.1 KB · Views: 325

salmander

Active Member
Licensed User
Longtime User
Hi salmander, I used your code in my Manifest Edit and I could not
get registered. I changed the code a little and now it works for me.
I am not smart enough to know the difference between yours and mine.
Thanks, Jerry
Sorry mate, may bad. I forgot to put 'permission' before C2D_MESSAGE on first line. I have fixed my previous post.
B4X:
AddManifestText(<permission android:name="$PACKAGE$.permission.C2D_MESSAGE" android:protectionLevel="signature" />)

test it again, it should be working now.
Good luck with your app.
 

cbal03

Member
Licensed User
Longtime User
I added the change in the manifest editor as well and it works for me too. Thank you.
 

bluedude

Well-Known Member
Licensed User
Longtime User
Change package name on C2DM server

Hi,

A small question, are you able to change the package name on the Google C2DM server?

My account is approved but for some reason signing in does not work and I cannot change my package name.

I think C2DM is a little a pain actually.
 

cbal03

Member
Licensed User
Longtime User
You cannot change the package name you can only submit a new one. The name submitted will be in the confirmation email from Google C2DM.
 

bluedude

Well-Known Member
Licensed User
Longtime User
Package name

The package name isn't in the confirmation email for sure.

No Erel, I mean how to change the package name for the sender account on the C2DM server (signup), there isn't a management interface to change packages later on.

Cheers,
 

cbal03

Member
Licensed User
Longtime User
Sorry. Guess I was confused for a moment. At any rate you still need to fill out the form again.
 

bluedude

Well-Known Member
Licensed User
Longtime User
Works

I have it working with a PHP script/API that send the messages from a central database. Not using the java command line stuff but it works.

Cheers,
 

cborkert

New Member
Licensed User
Longtime User
Problem with C2DM

I have everything setup according to the code posted. Package name setup w/Google.

- Device registers successfully and I have the device id from Google in my web database.
- When I try to send messages (both using the command line jar provided AND from my web server using Curl), I get Success messages back from Google.

UPDATE - Note - I had to use different email addresses for the sender vs the device - for it to work..
 
Last edited:

Ommadawn

Member
Licensed User
Longtime User
Hello

all work, but i'don't receved the message..

the android appli work fine, i have the toast registred ok
my server works, in my database, the name and id has add

when i use the desktop tool, i have the succes

D:\Téléchargements\Desktop\Desktop>java -cp b4a_c2dm.jar anywheresoftware.b4a.c2
dm.C2DM send titi "coucou"
Success: id=0:1330099140658610%f61fd6a987ce0704

but i don't received the message in my phone. 30 minutes ago and nothing.
I am in Android 4.0

i tried also in my tablette Folio 100 in 4.0, i don't received

Thanks
 

Ommadawn

Member
Licensed User
Longtime User
it's work now, just i waiting a notification and not a toast

sorry

thank you for the incredible soft!
 

donnyy

Member
Licensed User
Longtime User
Remove line 38:
B4X:
   Dim r As Reflector
It was left by mistake.
Hi Erel,

I just downloaded the 3 zip files and tried compiling the pushexample, and i got the same error message on line 52 of the pushservice. I have removed the 'Dim r as Reflector' from the pushexample, but still won't compile. Pls help.
 

donnyy

Member
Licensed User
Longtime User
I need some help here please. When i click on the register button, it doesn't do anything. Looking at the log file, i got this error "Unable to start service Intent { act= cmp=com.dispatch.test/.pushservice (has extras) }: not found". What did i do wrong?
 
Top