php mobile website, need advice - php

i am planning to build a very simple mobile website which involves form submission and database storing, few years ago i have heard something called wap and wml to make these kind of webs, so i search on google for the IDE or the SDK, but it seems that all the pages regarding those is no longer available, i wonder....
anyway, what do people use nowadays to build mobile websites (because obviously, i am way left behind about this) ? if you don't mind, please provide me reading materials on how to build mobile websites today, thank you very much

what do people use nowadays to build mobile websites
HTML.

It depends,
Do you want to target high-end smartphones or older phones that only support basic HTML/CSS?
Typically most mobile websites work on a range of handsets and use HTML5 or XHTML-MP, if you need to support very old handsets you can use WML (otherwise don't bother).

WAP and WML are, as far as I'm concerned, effectively dead. Nobody uses them. It used to be the way mobile sites were built, but things have gotten much better.
These days your best bet is just to use HTML, CSS and JavaScript. You don't want to build a full desktop-style site though, you still want to build for low bandwidth consumption. Part of the issue is which platforms your are targeting. If you only care about iPhones, then it's really simple. You can build an test in Mobile Safari and be done with it. If you register for the Apple Developer Program, and download the XCode bundle, it includes a Mobile Safari emulator.
It's pretty easy to also support Android phones, as they use a very similar browser (Chrome/WebKit). It gets trickier when you want to include Blackberry or Windows Phone. Blackberry prior to OS version 6 has a terrible browser, which can only handle basic HTML, and limited or no CSS and JS. At this time I'm not aware of what the capabilities are on Windows Phone 7.
There are some JavaScript frameworks around that will help you add features to mobile sites via progressive enhancement, and they help you work with touchscreen events. Google for Sencha Touch and jQuery Mobile.

People tend to build mobile websites the same way they build standard websites: HTML, CSS, JS. See this article for a more in-depth look: http://www.smashingmagazine.com/2010/11/03/how-to-build-a-mobile-website/

If targeting high-end devices (iPhone, Android, iPad), you'd need to just get to know the browser application for those handhelds. Apple has lots of documentation on presenting web content for the iOS devices, and how to communicate different preferences to the browser (like should the page be able to be pinch-zoomed, or what image should be used for a shortcut icon if the user wants to save it to their springpad (larger image than a favicon)), like this guide for preparing content for the iPad.

Related

Can I target specific browsers/devices with the Manifest or Appcache file or just exclude the appcache from Desktop browsers?

Essentially I would like to be able to use an appcache file on my site but only for mobile devices, to enable those devices to view the website/webapp I am developing offline, however desktops/laptops often have access to the internet and I would rather these view the site as is, with no manifest/caching etc..
I am aware user agent sniffing is at best unreliable although can provide some good results, if this could be avoided it would be best.
The site/webapp I am developing is built in HTML/CSS/JS/PHP and uses responsive layouts to serve the same pages of the site to each device with customised views/layouts depending on the devices width (using css media queries).
Thanks for any help in advance, all my searches for this specifically have proved unfruitful :(
Update
After Robertc's comments below I would like to clarify that it is Desktop Browsers (ie the very same browsers that are used on laptops) that I would like to exclude any caching from via appcache/manifest file... This is a requirement from client and also from me as programmatically it seems easier to target desktops and laptops together as they are using same software/OS...
More specifically my webapp needs to support caching via appcache/manifest on iOS, Android & Blackberry (although it would be nice to have all tablets/smartphones) so maybe the question is how to find one of these devices and include the appcache reference, however this looks like it is leading down the path of user agent sniffing which I was hoping to avoid...
Because the browser does check the Appcache.manifast before everything else happens, you have to do an additional serverside detection. You cannot load the appcache.manifest by javascript.
Make a Serverside detection on the Useragent and deliver the HTML with manifest if you get a request from iphone, ipad, android etc. and without manifest in the other cases.
User Agent checking is the best approach. You deliver your site for people who doesn't fake there User Agent.
User agent test with php for mobile devices (just add your devices you need):
Mobile regexp user agent
http://chrisschuld.com/projects/browser-php-detecting-a-users-browser-from-php/

how to convert php existing web application to mobile application

i have developed a webpage with joomla 1.5, now i need to convert my web application to mobile application. the user can download my application through mobile apple or etc then they can access. Tell any tips and kindly guide me...
You could take a look at phonegap ( http://phonegap.com/ )
It is a java framework that you can control with javascript to ring, vibrate, determine position, etc.
There are tutorials for how to make an application for every phone operating system, and they are pretty understandable for beginners. However, since you use joomla, your code has to run on a php server. (The tutorial covers only how to embed local html files in your app).
There are some tutorials out there that cover the use of phonegap with 'existing' websites. Google for it.
In the future, you might want to have a look at jquery mobile, there is an interface builder on their site http://jquerymobile.com/ and it is designed to look good on every device. You can use their themeroller and some additional css to achieve quite a nice app.
Suresh, because it will be important that your users interact with your server where your Joomla installation is hosted, it will be most feasible for you to create separate CSS stylings for your website that will be mobile specific.
Because Joomla has a user community, it is likely that plugins or templates have been written that can help speed this process up. Here's an extension that accomplishes some of what you're looking for, in-so-far as it will allow users on mobile phones to interact with your website via a browser in a comfortable way.
http://extensions.joomla.org/extensions/mobile/mobile-display/11722
Have you tried Mobile Joomla? It's a great extension that would be an easy first step to getting your site mobile-friendly.
"Mobile Joomla!® is the best way to mobilize your Joomla! site, displaying beautifully on iPhone, iPad, Android, Windows Phone and all other phones."
http://www.mobilejoomla.com/
for converting the existing web application to mobile application,you have to create web services of the web application and return the data in XML or json format.at the end of mobile development like on android plateform you have to parse those data on simulator,and this way you can test the application and use in mobile.
Humm joomla is not a good bet for mobile web apps. Even with adapted css and layouts, If you have a lot of extensions, some might break in mobile view.
I would build a a web app from scratch (using jquery mobile, that as a good cross platform support) and get the data from the original website. It might take a while longer, but the experience for your users will surely be better.
EDIT:
From what I gathered from your comments, it seems you want a landing page where people can download a "game" to their mobile phones, is that right? Please explain exactly what you want to accomplish so we might help you.

How to create a mobile version of a video hosting site

I've been googling for about 2 month on how to create a mobile website and found many results which work great if you have a blog or anything like that. But I have some sort of a video hosting site and i need to allow users to watch, upload and rate videos. i have jw player player and the script is php javascript
when I say mobile i mean everything from smartphone to android, everything
Any help or a link for a tutorial would be highly appreciated
EDIT
#Bizorke I'm not asking you to write me a book, i want an answer like this
That guy answered a huge question with one small paragraph and some tutorials that's it and I loved his answer
and i would read any book if you suggest one, because i cannot find a good one
Edited in response to comments
I can try giving you a starting point for your project. If you want to know how this can be done, stop searching for an answer online and start looking for a very detailed book on mobile web development. There are a lot of things to learn, especially if you are trying to build a cross-platform mobile website. There are lots of books out there, you'll need to find some that talk about cross-platform mobile web development. A lot of experimentation will be required.
For the actual video sharing part I would just develop the site to work exactly the same as such a website would work for a PC. Mobile devices are becoming increasingly similar to PCs in terms of power and browsing experience, so you might just be able to do this part with minimal hassle if you're lucky. After you've completed the site and it works on a PC, just go back and test it with a whole bunch of different types of mobile devices to see which phones support it and which don't, and go from there by customizing the website to work with different specific types of devices.
Good luck!
Additional Information
I have done some mobile app dev before but never a mobile website, so can't offer any good suggestions for books (google books has a bunch listed but you'll have to look at the descriptions to find a good one that suits your needs and interests).
Also, have you considered making a mobile app to accomplish what you are trying to do? You could build an app for each type of smartphone, then you won't have to worry about platform browser compatibility issues.

Mobile Website essentials..?

I have decided i'll have to make a mobile version of my website. so ive tried reading about and come here to confirm and get your approval.
1) I have decided im going to use jquery mobile framework to create it. what are its limitations? according to me...none. educate me.
2) I don't have a smartphone or similar? how will i test the website during development? i have read about phone emulators... what is the best phone emulator you wud recommend that emulates a vast array of phones?
3)Once ive developed the website... i'll need a smart way of phone detection... so as it redirects to mobile website... i know there are libraries for this... again i need a recommendation here
Please help me answer these questions or direct me towards the right path... i know a lot of mobile website noobs need these questions answered.
btw, my website is veepiz.com. incase that can help
Some points I know are these
Try not to use flash in your mobile website. Apple has no intention on supporting flash on their phones.
jQuery Mobile is still inn alpha, but have heard good things so far. Check out jQuery Mobile's graded browser support for the support they provide to different browsers.
1.) I would stay away from using javascript for a mobile website unless you know that the device(s) you will be targeting support javascript. Most modern smart phones support javascript but you might run into issues with older devices.
2.) I can't speak on emulators but there are a few firefox plugins that allow you to modify the headers to allow you to simulate what your site would look like on a particular mobile device.
3.) You can use an open source tool like Wurfl for device detection. It comes in several flavors including php.
As with any kind of development, it's about analyzing what your target devices/audience will be and gearing your site development towards those devices while gracefully degrading features for those devices that are't supported.

Embedding a web based game into an Android Application

I've created a simple web based game (text driven) in PHP and have recently become very interested in moving this onto Android - originally i thought the game could be rewritten in Java but after some investigation i found you can embed pages straight into an Android application.
Am i missing something or will i be able to simply embed my web application into Android and expect it to work flawlessly? Is there any issues i should be aware of? My app uses a login system utilising sessions / cookies - will this pose a problem for Android users?
I'd be interested in hearing anyones thoughts that have done something similar and any issues they've encountered. The only issue i forsee is how the page renders on different phones (although this i imagine this can be somewhat nullified by good markup and well thought out javascript) and any issues in regards to sessions / cookies?
If anyone has any good resources for doing this sort of work i'd be grateful.
As a final thought it'd be good to hear peoples thoughts on whether i should rewrite it or keep it embedded, what are the benefits of rewriting it?
Thanks
The WebView class provides access to a full fledged webkit browser. As a matter of fact, the default Android Browser itself is implemented using that very same WebView implementation. Javascript, Sessions and Cookies should be no problem whatsoever, you probably just have to activate them (see WebSettings).
Even flash should more or less work on newer devices, but I don't have any experience with that.
See http://developer.android.com/reference/android/webkit/WebView.html for further details.
Generally, using Apps as so called "launchers", i.e. apps that basically only contain a browser window are somewhat frowned upon, since the android market isn't meant to replicate the world wide web. I do somewhat understand the need for that though, since visibility is much higher and Google does not yet provide a way to treat web apps as first class citizens, like they do for Chrome OS.
On the other hand, if your app already works fine using php, I don't see any need to rewrite it in native code.
Take a look at http://phpforandroid.net/

Categories