Titanium Community Questions & Answer Archive

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

Android and Dashboard View

Hello,

I've been getting a NullPointerException error when trying to initiate a dashboard view via the Android 2.2 API. This code works just fine on the iPhone emulator. Here is the code I have:

var labels = ['news','calendar','map','emergency'];

    for (var c=0;c<labels.length;c++)
    {
        var item = Titanium.UI.createDashboardItem({
            image:'images/dashboard/'+labels[c]+'_off.png',
            selectedImage:'images/dashboard/'+labels[c]+'_on.png',
            label:labels[c]
        });
        info.push(item);
    }

var dashboard = Titanium.UI.createDashboardView({
    data:info,
    zindex: 2

});

Is there something that I'm not doing correctly that would be causing these errors? What works in android? Any help is appreciated.

Stefan

— asked August 2nd 2010 by Stefan Holodnick
  • android
  • dashboard
  • error
  • nullpointerexception
  • view
1 Comment
  • BUMP!
    Is there an ETA of Dashboard view on Android?

    — commented August 25th 2010 by Ben Hornedo

4 Answers

  • Any ETA of dashboard for android?

    — answered August 2nd 2010 by Sj Singh
    permalink
    0 Comments
  • Based on the UI of this API Doc:
    http://developer.appcelerator.com/apidoc/mobile/latest/Titanium.UI.DashboardView-object

    Dashboards are only available for iPhone.

    — answered August 2nd 2010 by John Welch
    permalink
    0 Comments
  • DashboardView is only available for iPhone. So there won't be a Dashboard view for Android.

    But that doesn't means you cannot create a DashboardView for Android. You can create your own Dashboard style view with javascript and some little development.

    — answered September 22nd 2010 by Musa Ulker
    permalink
    0 Comments
  • As others have said, Ti.UI.DashboardView only works using the iOS platform.

    If you want to create a dashboard view for Android you'll have to roll your own. For a good start, check out Paul Dowsett's cross-platform grid layout sample code posted here. You can modify it pretty easily to have buttons by replacing the views and labels with imageViews.

    — answered June 14th 2011 by Brandon Jackson
    permalink
    0 Comments
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.