Skip to main content

Home/ Android Dev/ Group items tagged notification

Rss Feed Group items tagged

Vincent Tsao

The CommonsBlog - Activity or Notification via Ordered Broadcast - 0 views

  • I’ve run into the following generalized question a lot recently: I have an event that occurs in the background. I want to update my activity, if the activity is on the screen. Otherwise, I want to raise a Notification.
  • Hence, the recipe for the activity-or-Notification pattern is: Define an action string you will use when the event occurs that you want to go to the activity or notification (e.g., com.commonsware.java.packages.are.fun.EVENT). Dynamically register a BroadcastReceiever in your activity, with an IntentFilter set up for the aforementioned action string and with a positive priority (the default priority for a filter is 0). This receiver should then have the activity do whatever it needs to do to update the UI based on this event. The receiver should also call abortBroadcast() to prevent others from getting it. Be sure to register the receiver in onStart() or onResume() and unregister the receiver in the corresponding onStop or onPause() method. Register in your manifest a BroadcastReceiver, with an <intent-filter> set up for the aforementioned action string. This receiver should raise the Notification. In your service (e.g., an IntentService), when the event occurs, call sendOrderedBroadcast(). And that’s it. If the activity is on-screen, its receiver will be registered, so it will get the event, process it, and cancel the broadcast. If the activity is not on-screen, its receiver will not be registered, so the event will go to the default handler, in the form of your manifest-registered BroadcastReceiver, which will raise the Notification.
Vincent Tsao

How to update the GUI in Push/C2DM sample from advandroid book? - cw-android | Google G... - 0 views

  • > Now I just want to update the GUI from this method. > Can I somehow call a method in PushEndpointDemo.java? No, for two reasons: 1. Because C2DMReceiver is a manifest-registered BroadcastReceiver and therefore has no access to any activities 2. There might not be an activity, since you have no control over the timing of when the C2DM message is received (e.g., the user pressed BACK, the user pressed HOME) > Do I need a Broadcast Intent to do this? Possibly. -- If you want to update an activity or else ignore the message, have C2DMReceiver send out a private broadcast, picked up by a receiver registered via registerReceiver() in the activity -- If you want to update an activity or else raise a notification, have C2DMReceiver send out an ordered broadcast, as described here: http://commonsware.com/blog/2010/08/11/activity-notification-ordered-... -- If you want to update a database, call startActivity() on an IntentService, and have it do the database I/O, plus possibly broadcast an Intent to update an activity/raise a notification.
Vincent Tsao

androidpn - Xpress Push Notification for Android - Google Project Hosting - 1 views

  • An open source project to provide push notification support for Android -- a xmpp based notification server and a client tool kit. This project is currently being hosted at http://sourceforge.net/projects/androidpn/.
Vincent Tsao

Xtify: Platform Overview - 0 views

  • Xtify is an ASP / Notifications Platform that delivers notifications and messages directly to your mobile users' devices and prompts users to take desired actions - whenever and wherever most appropriate, based on geo-location and geo-history.
Vincent Tsao

java - remove notification bar shadow in android app - Stack Overflow - 0 views

  • <!-- Variation on the Light theme that turns off the title --><style name="Theme.IOSched" parent="android:style/Theme.Light">    <item name="android:windowNoTitle">true</item>    <item name="android:windowContentOverlay">@null</item></style>
  • The android:windowContentOverlay is your shadow, and setting it to @null in your theme will eliminate it. You can see this in action in the Google I|O 2010 conference app, which uses many of the same UI conventions as does the new Twitter app. However, right now, the Twitter app has not yet been open-sourced, which is why I point you to the I|O app. The code fragment above is from that app's styles.xml resource.
Vincent Tsao

myandroidwidgets - Project Hosting on Google Code - 0 views

  • A bunch of sample apps for Android. Simple workarounds and examples for doing things on Android. Custom Progress Bar - A customized Progress Bar for android with your own animation Drag and Drop widgets on Android Ongoing notifications on Android HTML with images in a Text View Custom Expandable List Views on Android Custom List View - Phonebook Example Custom Title Bar Android WebView, Javascrip and CSS Unzip files on Android
Simon Pan

Service | Android Developers - 0 views

  • avoid
    • Simon Pan
       
      如果在Service裡做了要做的事,它們還是在UI thread裡做事情,而不是在什麼別的thread做事情。但是Service很特別,它又不是一個執行緒,因為通常Service要做的事情都蠻耗時的,萬一Service算是執行緒,那麼就會強碰到系統的ANR機制。
  • A facility for the application to tell the system about something it wants to be doing in the background
  • A facility for an application to expose some of its functionality to other applications.
  • ...3 more annotations...
  • two reasons
  • depending on the value they return from onStartCommand(): START_STICKY is used for services that are explicitly started and stopped as needed,
  • then take the service out of the started state and don't recreate until a future explicit call to Context.startService(Intent).
Simon Pan

In-app Billing Overview | Android Developers - 1 views

  • nonce
    • Simon Pan
  • launches the pending intent
  • checkout flow finishes
  • ...22 more annotations...
  • sends your application a notification message
  • you must send a confirmation
  • will continue sending IN_APP_NOTIFY messages
  • should not
  • until you have delivered the item to the user.
  • will still receive an IN_APP_NOTIFY broadcast intent
  • must be able to handle IN_APP_NOTIFY messages
  • references a specific request ID
  • is installed
  • reinstalled.
  • even though you never initiated the purchase.
  • must handle
  • it usually stops sending IN_APP_NOTIFY intents
  • even though your application has sent a CONFIRM_NOTIFICATIONS message. This can occur if a device loses network connectivity while you are sending the CONFIRM_NOTIFICATIONS message.
  • You can do this by checking the orderID
  • even though your application has not sent a REQUEST_PURCHASE message.
  • may receive
  • informing the application that there is a purchase state change.
  • This applies only to items that have their purchase type set to "managed per user account."
  • signs the JSON string that is contained in the PURCHASE_STATE_CHANGED
  • it includes the signed JSON string (unencrypted) and the signature.
  • you can use the public key portion of your RSA key pair to verify the signature.
1 - 15 of 15
Showing 20 items per page