admin管理员组

文章数量:1401143

I am currently building a web based application and would like to use the native Android date picker for a field. I have looked into using PhoneGap but it seems to be more than I need for my project. Is there anyway to invoke the date picker field with basic JavaScript?

Also, I am not looking to use jQuery Mobile as the CSS for it pletely disables my current look.

I am currently building a web based application and would like to use the native Android date picker for a field. I have looked into using PhoneGap but it seems to be more than I need for my project. Is there anyway to invoke the date picker field with basic JavaScript?

Also, I am not looking to use jQuery Mobile as the CSS for it pletely disables my current look.

Share Improve this question edited Oct 3, 2012 at 17:57 Furqan Safdar 16.7k13 gold badges61 silver badges98 bronze badges asked Oct 3, 2012 at 17:25 atxpunkrockatxpunkrock 5148 silver badges20 bronze badges
Add a ment  | 

3 Answers 3

Reset to default 3

On Android you cannot inwoke the native datepicker from a web app (input type="date" would be the correct way, which is supported on iOS > 5).

I remend using Mobiscroll, which is a javascript datepicker (and not just datepicker) plugin, which has themes to make it look like the native date picker.

I'm pretty sure the answer to your question is "no". PhoneGap works by having native libraries for each platform that are accessible through a Javascript API -- without the native libraries, I don't think you will be able to invoke the date picker field.

That said, PhoneGap is an open source project, so you can always analyze their source, and see what would be necessary to implement it. The PhoneGap code for Android is here:

https://github./apache/incubator-cordova-android

I googled the PhoneGap datapicker plugin, and came across this

https://github./phonegap/phonegap-plugins/tree/master/Android/DatePicker

I think this is what you are looking for, but I did not test it personally.

本文标签: Native Android DatePicker with JavaScriptStack Overflow