Appcelerator Blog

The Leading Resource for All Things Mobile

Forging Titanium Episode 13: Android Notifications

0 Flares 0 Flares ×

Editor’s note: This and future episodes of Forging Titanium are available here.

In this week’s episode of Forging Titanium we step into the world of Android Status Bar Notifications. With these native notifications, you can more readily keep your users engaged with the current state of your app and its content. When you consider the fact that most mobile app’s sessions can be measured in seconds, that constant engagement becomes a critical component to the ongoing success of your apps. And the best part about it? It’s built right into Titanium’s core Javascript API.

Episode Highlights

  • Learn how to launch native Android Status Bar Notifications via Ti.Android.Notification
  • See the basics of creating a native Android Service
  • A basic example of how to receive background location events from Ti.Geolocation
  • Pretty much all the native Android utilization you can handle!

Episode Resources:

0 Flares Twitter 0 Facebook 0 Google+ 0 LinkedIn 0 Email -- 0 Flares ×

7 Comments

  1. Eli

    The notification is creating another task when returning from the home screen.
    Getting the following line when running in the emulator. is there a work around?
    startActivity called from non-Activity context; forcing Intent.FLAG_ACTIVITY_NEW_TASK for: Intent

  2. @Eli: try adding Ti.Android. FLAG_ACTIVITY_CLEAR_TOP to your list of flags for the intent in your service

  3. Eli

    @Tony: Thanks for the quick response!
    Tried several variations of the flags (I’ve created a Q&A: http://developer.appcelerator.com/question/128717/android-notification-starts-new-task) with the same results.
    I’ve tried the following flags (FLAG_ACTIVITY_CLEAR_TOP | FLAG_ACTIVITY_SINGLE_TOP | FLAG_ACTIVITY_RESET_TASK_IF_NEEDED) together and separate and they all result with a forcing Intent.FLAG_ACTIVITY_NEW_TASK

  4. @Eli: I’ll respond in the Q&A question that you posted.

  5. Eli

    @Tony, this is broken on 1.8.0.1
    Getting errors on both Rhino and V8
    http://developer.appcelerator.com/question/129961/1801—creatependingintent-missing-from-tiandroid

  6. peder

    hi, when using the back button to exit the app the notifications with an interval gets cancelled or for some reason don’t show. on the other hand, when using the home button to exit the app, they work as they should. Any idea how to fix this?

  7. peder

    fixed it, faked a homebtn push on back button event. now my problem is that the first notification pops up at once, when it should com after 10 seconds. after that the rest of them works correctly. any ideas on this?

Comments are closed.

Sign up for updates!

Become a mobile leader. Take the first step to scale mobile innovation throughout your enterprise.
Get in touch
computer and tablet showing Appcelerator software
Start free, grow from there.
0 Flares Twitter 0 Facebook 0 Google+ 0 LinkedIn 0 Email -- 0 Flares ×