Reputation: 40673
I've been using PhoneGap for a while mainly focused at iOS and using mostly 100% web code.
I'm about to investigate PhoneGap for another project where there is a desire to leverage the device's native form input components.
An example is the date picker. The spinners in iOS, the 'clicker' in Android, etc.
To what extent does/can PhoneGap access native UI components like that? If I'm targetting iOS4, can I call the native device date picker from my HTML/JS?
(I should add that I know this is not the preferred model...the entire point of PhoneGap is to be able to manage less code across more devices and standardizing on a shared UI is the better bet...but I'm investigating the options requested...)
Upvotes: 6
Views: 9560
Reputation: 3996
Yes you can invoke a native datepicker using phonegap plugins. There are currently two implementations for Android and for iOS:
Android: https://github.com/phonegap/phonegap-plugins/tree/master/Android/DatePicker iOS: https://github.com/phonegap/phonegap-plugins/tree/master/iPhone/DatePicker
Upvotes: 8
Reputation: 179994
You can access some native controls via the NativeControls plugin, which used to be part of PhoneGap core but they decided to go in a different direction.
Upvotes: 2
Reputation: 6485
No, you cannot invoke native date picker using phonegap. Phonegap is a wrapper around your browser container on mobile device. The Phonegap API has documentation related to what level of device api access is possible (Camera, Location etc)
As pointed in another answer , you can look at mobilescroll (opensource HTML/JS date-picker) http://code.google.com/p/mobiscroll/
Invoke native date picker from web-app on iOS/Android
Upvotes: 2