Access mobile device camera from a grails application using jquery mobile - iphone

I have a grails application using jquery mobile. I am hoping to find some way to access the camera on the devices. I thought about using flash to grab the webcam but that obviously wont work on Apple devices.
Does anyone know of a way to do it and keep it all browser based? I am hoping that there is a plugin somewhere or maybe html5 has some magic in there that supports it.

I have researched this quite a bit (although about six months ago) and there is no API in the Mobile Safari browser for accessing a device's camera.
You have to have a native application for this type of functionality. For instance PhoneGap lets you use a device's camera: http://docs.phonegap.com/en/1.4.1/phonegap_media_capture_capture.md.html#Capture

Related

Can I use third party PhoneGap plugin on a web page using iOS Safari browser?

I am developing an application targeted only for iOS device(for now) using PhoneGap library and HTML5. This application is going to be only a web page accessed through iOS Safari browser. I am going to use certain features like accessing accelerometer, geolocation, contacts etc of iOS device using PhoneGap library.
Will I get access to all these features without installing anything on the device.
I want to understand how does PhoneGap get access to native features
of the device by just using JavaScript only?
I see there are several useful plugins written for PhoneGap library.
Can I simply use those plugins(js files) into my page without
installing anything on the device? E.g PhoneGap ChildBrowser plugin?
Will I get access to all these features without installing anything on the device.
You will have to build as a native ios app and install it to the device.
I want to understand how does PhoneGap get access to native features of the device by just using JavaScript only?
Phonegap provides a Javascript interface to access hardware features which are actually Objective-C functions. If you look at Phonegap source you'll see a lot of Objective-C code. So it's not only Javascript.
I see there are several useful plugins written for PhoneGap library. Can I simply use those plugins(js files) into my page without installing anything on the device? E.g PhoneGap ChildBrowser plugin?
No. They have to be inside an iOS app to be able to work.
It seems like what your after is a way to access the features of an APP only through the browser.
You can access some things using HTML5 e.g.:
Geo location http://html5demos.com/geo
Accelerometer http://menscher.com/teaching/woaa/examples/html5_accelerometer.html
Video Embedding http://www.w3schools.com/html5/html5_video.asp

How to gain direct access to the hardware capabilities of mobile devices from mobile browsers

We are developing web browser application for mobile phones and I am trying to figure out a way that I can gain access to the camera and take a photo and then upload it to the internet. But so far what I was suggested is to use phonegap and create native application. Phonegap is fine but it is not what I am looking for because my client wants to design forms and these html forms somehow will be able to trigger the camera and take photo and upload it to a server. Do you think developing a native API for every platform and having access to its functions from the web browsers is possible? What your suggestion would be?
(Note: My customer only want application that can run on mobile web browsers no native application runs on I-Phone, windows mobile, Blackberry and Android)
Thanks a lot...
Web apps (not wrapped in native code as Kumar details) cannot access all device hardware and sensors. Location support is available on iOS and Android, but camera access is only available on Android (via JavaScript). Similarly, device motion APIs are not accessible on Android, but are on iOS.
As you can see, support is sketchy and if you are truly looking to use such features, you are better off (and in many cases, realistically looking at) writing native apps for each platform you intend to support.
HTML5 is not yet at the point where it can replace native apps. It can do some of the things that native apps can, but even then performance is suboptimal. Currently, native apps may be more difficult and time-consuming, but they are necessary.
Calling android native APIs from javascript functions of embedded WebView
Use JS to call Java code which will in-turn call the Camera API or whatever else you are looking for.
It's not going to be possible to do it on iPhone, the only known way of accessing the camera is through the Cocoa layer.

Can I successfully do iPhone/iPad website development/testing on Windows?

Can I successfully do iPhone/iPad web development (not native apps) on Windows, and without having an iPhone/iPad device?
I.e. work like PSD-to-iPhone-optimized XHTML/CSS layout.
I’m interested to learn about and make iPhone/iPad optimized websites. Any tips? How different will it be from desktop? What’s different other than the smaller screen?
From experience I will say the only true way to test for the iPad is to test on an iPad. I have been developing a site in html5 specifically for an iPad and we initially used the iPhone to test. The drag function we had implemented with jQuery had worked almost perfectly on the iPhone but after the client had tested on the iPad they came back to us and said the function did not work period and they were correct.
I guess this could change depending on what type of development you are doing. From experience I would say either A. Make some trips to the apple store B. Make friends with iPad owner C. Buy and iPad
yes for an ipohne emulator... try MobiOne.
It's a good application to test the pages in iphone like environment.
http://www.genuitec.com/mobile/
I don’t think you can really do iPhone/iPad development successfully without an iPhone/iPad at all, whether on Windows, Mac or Commodore 64.
If you’re serious about iPhone/iPad development, how could you not try your software out yourself on the devices it’s going to run on? Your clients are going to want code that works on the iPhone/iPad. You need an iPhone/iPad to check that it works.
if your developing a web app then i think you can use this: http://ipadpeek.com/
The answer is: Yes you can absolutely do iPhone and iPad website development on a Windows PC.
However, you really should/must test the result on an actual iPhone/iPod Touch/iPad. Especially if you are integrating in any way with special device features like the dialing feature of the phone. (Yes you can have phone numbers in a webpage trigger dialing when you tap on them.)
However, you can do the bulk of the development on Windows, testing the WebApp in Safari or Chrome, which are the most fully compliant HTML5 WebKit based browsers out there.
Also highly recommend using an HTML5 touch framework like jQuery Mobile or Sencha Touch. This will go a long way to ensuring that your WebApp is optimized for the screen size and touch gestures of the mobile devices.
Remember that you can't deploy a pure WebApp to the app store, only download it from a website. You'll need a native wrapper like PhoneGap for that. And to compile a PhoneGap wrapped WebApp you'll need XCode on a Mac.
But there's a lot of power in adding your WebApp to the home screen on iOS. No native code involved and you get a full screen webapp with a home screen icon, loading image and no browser toolbars. Highly recommended.

What are the limitations of coding web apps for the iPhone?

For instance, could a web app access the mic on an iPhone and transmit voice back to a server?
Or is it possible to build Safari extensions for the iPhone that can operate transparently on a web page? For instance, is it possible to build an extension that removed ads from Google result pages for the iPhone, without the user clicking any buttons to activate the ad-removal functionality?
You pretty much hit the main limitations.
You have no access to hardware that's not supported by HTML5 (geolocation is, but things such as acceleration and audio/video recording are not).
You can't build Safari extensions for the iPhone at this time, you can only use JavaScript like usual.
Some frameworks like PhoneGap make attempts to provide more hardware features via a native app container, but it appears Apple is trying to prevent those apps from going on the App Store, to some extent.

ASP.Net MVC jQtouch iPhone device profile/authentication

I'm building an asp.net web application for an iphone using jQtouch. How can I read the device serial number from asp.net mvc?
In short, I don't think you can get the device ID through iPhone Safari.
iPhone Safari, like any other browsers, works in a black-box model and only let through a selective set of information about the system, such as geo-location and device orientation. The Safari Web Content Guide by Apple documents several features specific to Mobile Safari.
A lot of the API's like JQTouch are interacting more and more with the device itself with things like geo-location etc. When I need to get more into the device and hardware I use tools like PhoneGap that allow you to work directly with the device like a native app (almost) still using javascript to do this. PhoneGap opens up the device functions to embed in your web page to leverage in your application. The catch is it is still a web site, but is now an application and must be added to the device through the likes of the app store or market etc.
You can read more at www.phonegap.com . I have had good luck with it so far combining JQTouch and PhoneGap.