make a website compatible with android
How can I make a website(which is exist before) compatible with android? So that we can use every functionality of that website on our android device.开发者_Python百科
Have a look at this link: http://developer.android.com/guide/webapps/targeting.html. The same rules would apply for making a website. One of the most important things is adding this line:
<meta name="viewport" content="width=device-width" />
This tells the browser to set the zoom level according to the device width. Otherwise the site will be zoomed out a lot and the user will have to zoom in to see the text properly.
- Almost all of your website's functionality will work in the Android browser unless you have some really screwed up Javascript code.
- Have a different stylesheet for the mobile browser.
- Keep lower resolution graphics as bandwidth is a huge issue on phones. An EDGE network is too slow and even 3G speeds vary a lot.
- Do not keep the pages too long. Display sections as Accordion menus which will expand/contract when the user clicks on the headers.
- Do not keep drop down menus which are activated on mouse hover. There is no hover state on the phone.
This article from SmashingMagazine has a couple of other tips.
have a look at WebView here. I did this with an Internal site of mine. Basically I scaled it down in size and graphics. Depending on the amount of content it could be easy or more difficult.
rewrite/modify it to be compatible with mobile browsers. Its not something that you can just add a stylesheet for.
Android's webbrowser, at least for recent versions of Android, is quite powerful, and quite close, in terms of features, to a desktop one.
So, if your website doesn't do any too-fancy / special stuff (like super-recent HTML5), it should work quite well on an Android device.
Note, though, that if you want your website to work on a mobile device, you'll have to at least think about :
- The fact that 3G (or worse) network is slow (bandwith is not great ; and ping is not good either) ; don't make your pages too heavy.
- The screen is small : don't put too much data on it
- Using touch-screens with big (compared to the screen's size) is hard and not precise : use big links, don't have links too close to each other.
精彩评论