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
4 Answers
-
Any ETA of dashboard for android?
-
Based on the UI of this API Doc:
http://developer.appcelerator.com/apidoc/mobile/latest/Titanium.UI.DashboardView-objectDashboards are only available for iPhone.
-
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.
-
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.