Registering Device for C2DM

Bill Norris

Active Member
Licensed User
Longtime User
Currently, in order to register a device for C2DM in the Push example, we type in a unique name to identify the device. I would like to be able to have the device "self-register", because ultimately the end user will have multiple devices running the app, and I don't want him/her to be burdened with the mundane task of registering each device manually. I cannot identify a means for the app to use to determine a unique device id to register itself. Anyone (Erel?) have any ideas?
 

grant1842

Active Member
Licensed User
Longtime User
Great Ideal

I to got the example working and think the same.
This is a great ideal.
 
Upvote 0

myriaddev

Active Member
Licensed User
Longtime User
self-register

I built a data base of each phone # as key and then a unique name string id
for each phone from same db on each phone. Then i send a c2cm register command to my external db/php when my app is started. Also i send
a unregister command when app is closed.
Hope this helps, Jerry
 
Upvote 0

Bill Norris

Active Member
Licensed User
Longtime User
RE:

I am working on a tablet app -- no phone. I've researched to see if there is a way to access some unique identifier within the device, but have been unable to find something that will be 100% reliable and consistent.
 
Upvote 0

myriaddev

Active Member
Licensed User
Longtime User
Tablets have phone #s too

Hi Bill. Tablets have phone numbers, or unique identifier
as a phone #. What is wrong with all the identifiers
in the tablets you have looked at ?
Jerry
 
Upvote 0

Bill Norris

Active Member
Licensed User
Longtime User
Was just browsing the net on the device id topic and there were several posts mentioning that the machines internal id number could not be relied on to alway be the same. Sounded strange to me but that is where I left off. I see that if you go into settings/system/about tablet/status, there is a serial number. I would have to assume that number would forever be that serial number for that machine, unless it were to be rooted, which will not be the case. Not sure how to capture that number with b4A, though.
 
Upvote 0

grant1842

Active Member
Licensed User
Longtime User
I modified my code to use .
Sub Process_Globals
dim PhoneId as Phone

Sub btnRegister_Click

If Regex.IsMatch("[\d\w]+", PhoneId.GetSettings("android_id")) = False Then
ToastMessageShow("Name not valid", True)
Return
End If
Register(PhoneId.GetSettings("android_id"))
End Sub

This lets the user press a button a self register.
You could modify it to do it on the create event or what ever to do it automatically.
 
Upvote 0
Top