Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

Making global objects available to a window on Android?

How do Android apps make global objects available to the various windows opened up in the app??

For instance: let's say I have an app in which a user can login and logout. I want to track the user's login state, login name, etc, in a global user object. Then let's say I have a window for posting a comment as the user. That window needs to know the user's identity.

On iPhone, I can give the window a reference to the global user object, but that ability seems to be iPhone-only. (The Kitchen Sink "Passing Data (windows)" example.)

Do I have to use an application persistent database for this? What is the common/best practice for managing run-time "session" state for use in Android?

I could presumably just keep everything in views, all in the scope of app.js, but that defeats the purpose and utility of having multiple scopes, each confined to a window.

— asked July 22nd 2010 by Josh Whiting
  • android
  • global
  • scope
  • windows
1 Comment
  • I'm also developing an App for Android and I'm coping with the same problem. The Kitchensink passing data example custom_properties.js works for passing variables but when I try to pass on a function an exception occurs stating that myFunc is not a function but an object. I literally tried the kitchensink example.

    — commented September 3rd 2010 by Abu Saebu

0 Answers

The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.