开发者

Android: Programmatically triggering phone checkin

开发者 https://www.devze.com 2023-01-05 12:40 出处:网络
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 \'*#*#CH

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?


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


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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号