views:

85

answers:

2

From within my Android application, I need to make the phone 'checkin' with Google for Market updates. This can be done manually by the user by opening the dialer and typing '*#*#CHECKIN#*#*'. My app needs the ability to do the same thing.

I'm positive this done using an Intent. Some digging shows that the Alarm Manager has this pending intent waiting:

  RTC_WAKEUP #5: Alarm{44b1ee18 type 0 com.google.android.server.checkin}
    type=0 when=1277981220358 repeatInterval=40212000 count=0
    operation=PendingIntent{44b256c0: PendingIntentRecord{44c26a80 com.google.android.server.checkin broadcastIntent}}

Now the question is, how do I get my app to broadcast this same type of Intent? I tried this.sendBroadcast(myIntent) in the activity with no luck, so I'm rather stumped at the moment.

Any thoughts?

A: 

You shouldn't rely on this functionality. This is an undocumented API, and it's undocumented for a reason.

This can (and likely will) change in future releases of the Android Market app. Since your application is relying on this functionality, this means your application will break.

Trevor Johns
I completely understand and usually agree with this. However, this particular application is a single-use app designed to fix an issue some rooted users are experiencing with custom ROMs. It's not intended for use by the masses or anything like that, which is why I (and those who would use the app) don't mind the possibility of it 'breaking' in the future. Its just a quick fix I'm hoping to package into a simple APK for these rooted users.
Colin O'Dell
Punching that code into the dialer is considered more work than asking users to find, download, install and run another app?
adamp
@adamp: It's one of many things the app needs to perform. Would be nice if it could do all of them with a single click instead of sending the user to the dialer and then making them come back into the app.
Colin O'Dell
+1  A: 

collinodell,

startActivity(new Intent(Intent.ACTION_DIAL, Uri.parse("tel:*%23*%232432546%23*%23*")));

I got it today by hex encoding the #, and calling the dialer. Root66 gave me the tip

jcase

jcase