Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

PhoneGap: To what extent can I interact with native UI components?

Tags:

cordova

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...)

like image 541
DA. Avatar asked Jul 11 '11 13:07

DA.


2 Answers

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

like image 163
dvtoever Avatar answered Nov 15 '22 11:11

dvtoever


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

like image 23
Satish Avatar answered Nov 15 '22 10:11

Satish