I'm building a web application that requires the user to upload a photo.
The application is built using HTML5, CSS, JavaScript (w/jQuery), and PHP for the backend.
I would like to add, besides the file uploading option, another option for users who use the application on their mobile phone - to upload a picture using the phone's camera.
From browsing a bit, I understood there are 2 approaches to this matter:
The Native Way - Building an independent application using Andorid's, iOS's and WM's SDK's and then having the user install them.
The Cross-Platform Way - Using one of the available services, such as PhoneGap or Appcelerator Titanium to "compile" my web application into a variety of mobile phone applications, namely Android and iOS.
Thing is, I'm not interested in creating a separate application, and then having users install it on their phones.
I'm interested in letting a user, who chooses to use the web application on his mobile phone, the ability to take a photo using his mobile device.
How do I go about doing this?
You may take a look at the camera API which lets you either take an image from the device camera or use a stored image. Here's a description on it: https://developer.mozilla.org/en-US/docs/Web/Guide/API/Camera. It also features a demo there.
No, you can't. Camera cordova plugin only support for device, not for website.
Yes, here is simple solution
<input type="file" accept="image/*;capture=camera">
Related
Without diving deep into programming for iOS and Android, is it possible to wrap a responsive PHP-based webpage in a wrapper that we lock to our url, and present it as our own app?
Also is it possible to make this app remember the users login session and other options (cookies)?
Yes, both Android and iOS support "webviews" (each platform has their own name for it).
In your app, you would simply launch into a webview with the URL that you hard code within the app yourself. Both platform webviews should also support storing cookies too.
Although, since you're wanting something this lightweight, you may want to consider a cross-platform development framework such as React-Native, Cordova/PhoneGap, etc. So that you only have to write the code once and deploy to both iOS and Android.
I have one .php web site and I want to put it in iPad application "web application".
I mean create UIWebView and load files in WebView, so my First question is, is it possible to create this webApp and can I run it on Xcode simulator?
What do I need for implementing this application (Apache, MySQL) inside ipad outside?
Basically I want to have all my .php class inside of app and run it via iPad app, it means that if I hadn't any internet I can run the application.
Since I want to run it in both iPad and XCode simulator.
Would you please give me some hints for implement this application?
A few points you need to think about:
App Store Approval - if you intend to market this app (i.e it's not for jailbroken devices via Cydia, or an in-house corporate app) then you will most likely run in to issues with the approval process.*
You're intending to bundle in a scripting language with your application. Now this may not be an issue depending on whether or not this is exposed to the end-user; but you do run the risk of Apple finding out and pulling the plug.
The alternative to bundling in a scripting language (PHP in your case) is going to be loading the code off of an external server. This is a no-no straight away, as Apple requires your application to have functionality offline - or atleast they did. Where this leaves all the Social Networking and other network-dependant apps... Well, I guess there are exceptions!
Device Performance - you're essentially intending to run a small web server on a mobile device; a tablet in this case. This could be very resource intensive, so is probably not wise. I personally wouldn't want my battery being drained because someone has decided that they want to bundle in a web server with their application.
Your implementation idea itself is sound, in the respect of using a UIWebView. You should probably check out the Apache Cordova/PhoneGap framework, and that should satisfy your needs and provide an off-the-shelf way of packaging up your web app. If you do need custom functionality then it's worth looking at anyway; plugins are relatively easy to develop, there's a wide range available already and the plans for cordova now are to allow developers to implement it into native applications. (Say, if only one view requires PhoneGap functionality etc)
Personally, I fail to see what requires PHP that can not be done via HTML5 and PhoneGap. There are storage options available, SQL options, you're using web technologies so can easily query external web services. It's also a lot safer with regards to app approval - as it's tried and tested; there are many applications build using such solutions already in the store.
I think you need a serious re-think. Otherwise, perhaps you could post some more details?
Please note that PHP is a server-side language. So do you want to run a server on your iPad? If so, you can develop PHP applications on a proper desktop/laptop and then view them on iPad Safari browser over Wifi.
Otherwise you can install LightHTTPd server with PHP libraries, MySQL, CURL and all from Cydia app store on a jailbroken iOS device to get a full environment. For Android there is this app PAW server available which can run an Apache server in such devices.
If you just want to check your website is working fine on small devices, or you want to check responsiveness of your website. Go to:Ipad Peek and run your website on given devices/simulators using url.
A simple google search pulled up this free framework: http://www.ipfaces.org/
I've never used to before, but it might do what you need.
I have to develop an app for android devices [I have no prior experience in development of android apps].
This app should be capable of recording a video / audio and communicate over rtmp with red5 streaming server. I already have video recorder and audio recorder in flash capable of recording in flv format and currently are used in a php website. Can I use these .swf and php files in android app? or I need to write a new one in java / action script 3? Is android capable of playing flv files, I meant to say will it be able to play if I pass flv file URL (to the flv player) in app. I am guessing it would be better if I directly access the device camera / microphone and record the flv.
Also, which language is recommended for my scenario, java or action script 3.0?
Any guidance / directions would be appreciated.
You may be able to use your existing .swf and .php code for this project, but you specifically have to publish your flash content to Adobe AIR in order to run it on an Android device.
You can do pretty much anything on a phone that you can do in a regular AIR app, though there are additional considerations (bandwidth, performance, etc.).
Which language you choose depends on your future plans for the app. If you already have most of the code written in AS3, it may be easier to just adapt it for mobile scenarios. Also, if you intend to eventually deploy to iPhone as well it will be easier to work with AS3 as you can just publish the same AIR app to both devices without rewriting it.
If you're concerned about performance and API access, and you have no interest in porting to iPhone, I suggest using Java.
I want to build a phone app using phonegap that can access data on a mysql server that is backing a cakephp app. Can this be done, if yes then how can use phonegap to access data from a mysql server?
Yes you can!
You need too make the controllers of you cakephp to output views that can be interpreted by the javascript in your phonegap app. For a more detailed answer we need more information. i.e. what javascript framework do you want to use in the phonegap app?
Just to be aware, an app that is basically a web page will probably be rejected by Apple. Quoting from the Phonegap Faq:
Q. Can I just create an iPhone PhoneGap-based app that just loads my website?
A. You can, but as for Apple approving it, that's another matter, and they most likely won't. As a rule of thumb, if there is no Internet connection, you must at least load the UI (your views) without the corresponding data, and put an error notice to that effect. Therefore your app must have these views included in it. For a guideline, set your iPhone to Airplane Mode in the Settings, then load either the Maps, Weather, Youtube, ITunes or Facebook apps, and see what they do (have a "shell"). Apple is probably concerned about them approving your app based on your app description and functionality as promised by you, and then you turning around and changing it completely after approval to something undesirable.
Also see similar question: iPhone Phonegap based app load External website made of componentone
I have a website and am planning to develop a mobile version of it for the iphone, blackberry and android.
My website is a social network built on PHP Zend framework. Now all these mobile apps are going to be having the same functionality like the website.
I am little ignorant about this - but from a high level I understand that all these mobile apps should not have to write any backend logic. For every functionality - they will simply make a web service API call to interact with the backend.
So does that mean, for every functionality I need to create a web service method. Can the existing code be re used - I'm a little lost -
Can someone shed some light on this matter or point me in the right direction (like some articles)
Thanks
I think the best thing for this kind of application would be write a mobile website. This should not include more than some new views in your Zend framework application.
There are some tutorials out there how to start. Just use your favorite search engine.
Apple and Android have browsers which are very advanced. They actually show the site in total. The point is would your website look better in that interface? ( I bet it would be cumbersome). You would have to make a mobile site (as suggested by #Felix) and implement the required features in a simple interface.
If you want an installable application then you are looking at three applications(one for each platform). My suggestion would be to make the mobile site and look for an app maker kind of product which would install your regular mobile site as an application on these platforms.
HTH
This is a very open subject that's obviously going to divide opinion (as already demonstrated it seems! :))
My personal view on it it this, using Safari on my iPhone is a terrible clunky cumbersome experience and "mobile optimised" websites are not ideal and don't really take advantage of the features of the device you are developing for (i.e. multi-touch etc)
This is why I think mobile applications are more appropriate ways of encapsulating the content of the web and delivering in a format suitable for its platform. Take for example, the Facebook application for iPhone and Android. That's a perfect example of taking the core features of the website and contextualising it in a manner that's easy to use and designed from the ground up for the device it's made for.
In answer to your question then yes, I would approach the development with web services in mind and use these to feedback the relevant data you need to interface with your site
While I agree with djhworld that the native mobile applications are sometimes easier to use than mobile-optimized web apps, there is a pretty big gulf in implementation time and user base fragmentation. I think the best first step is to develop a mobile web application, and if you are getting use there, consider developing native apps using web services. You may also want to look at PhoneGap as a way to cross-compile a single mobile app:
http://phonegap.com/
Also, see my other post about mobile web application development.
If you want to maximize your investment in your mobile site, I would develop it in HTML5. Currently, only WebKit browsers support it (iPhone/iPod/iPad/Android/Blackberry[soon]), but within a year most devices in developed countries will support it.
If you need to detect mobile devices on the server side, I would recommend Tera-WURFL. It is a high-speed PHP & MySQL mobile device detection software package that is free and open source.