Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-586] Titanium Mobile suggestion: map non-android compatible calls

GitHub Issuen/a
TypeBug
PriorityMedium
StatusClosed
ResolutionFixed
Resolution Date2011-04-17T01:53:35.000+0000
Affected Version/sn/a
Fix Version/sn/a
ComponentsAndroid
Labelsandroid, suggestion
ReporterBurggraf
AssigneeDon Thorp
Created2011-04-15T02:32:32.000+0000
Updated2011-04-17T01:53:35.000+0000

Description

Cross-platform development between iPhone, iPad, and Android would go a LOT smoother if you created stubs for methods that crash Android and either map them to an alternative interface, or at least just trap them and give the developer a message explaining that the call won't work on Android.

For example, the following call works great on iPhone, but crashes on Android:

win.setRightNavButton(btnTools);

If you could trap that call (when in Android), and turn a call to setRightNavButton into a method that does a simple alert:

alert('Warning: setRightNavButton is not implemented on the Android platform');

In an ideal world, an alternative object would be created (a view, perhaps) that mimics the iPhone navbar, and setRightNavButton would create a button on that alternative object. This would give true cross-platform compatibility.

Comments

  1. Don Thorp 2011-04-15

    We've chosen to have the APIs fail silently. Any APIs that don't should be reported as a defect. Except for a couple of select controls, we most likely will not create platform independent versions of things like navbar since that is an iPhone feature and not something other platform's users are expecting.

JSON Source