[TIMOB-586] Titanium Mobile suggestion: map non-android compatible calls
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Medium |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2011-04-17T01:53:35.000+0000 |
Affected Version/s | n/a |
Fix Version/s | n/a |
Components | Android |
Labels | android, suggestion |
Reporter | Burggraf |
Assignee | Don Thorp |
Created | 2011-04-15T02:32:32.000+0000 |
Updated | 2011-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.
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.