Does J2ME support HTML5? - html

I want to make an application for J2ME phones.
In that application I want to use HTML5,
how I can do this?
I worked on LWUIT. Does LWUIT support HTML5?
Or give me any other browser info.

LWUIT/Codename One support HTML5 but not on J2ME.

There's no built-in HTML5 (or any HTML version, for that matter) parser or renderer in J2ME. There's some sort of HTML viewer support in the LWUIT library, but I suspect it is reasonably limited in general, and also in particular regarding specifically HTML5 support. In any case, research LWUIT and see if it is enough for your needs or not (hard to say without knowing your real/actual requirements).
It is also not very practical to write your own HTML parser and renderer (especially if you also need to be able to handle CSS and JavaScript). In essence, you'd have to write your own complete web browser in J2ME.
You can, of course, use platformRequest() to launch the default browser, but not that many mobile phones have HTML5 support yet.
If you also manage the server-side (where the HTML5 pages come from), and all you really need is the data, then write the server code to return/send the data to your J2ME MIDlet as either XML or JSON, which are much easier to handle.

Related

The client side of web development

In the field of RIAs, I've read tons of comments stated that the discussion about Silverlight vs JavaFX vs Flash vs HTML5 is outdated and the winner is HTML5.
Since I am a programmer (not a designer) but never used any of the technologies above and I have no time to learn all of them to compare, I want to ask the following:
1) With HTML5 we continue to only have interpreted JavaScript, or we can use more powerful languages that generates compiled code (some kind of MSIL or bytecode inside <object> ... </object> tags)?
2) Does HTML5 hide portions of our code from unwanted viewers (like Java applets and ActiveX did in the past) or the option "View - Source Code" continues to show all of our work?
3) HTML5 need some kind of runtime or all the work is done by the browser?
There is a bit of a fundamental problem with your question in that HTML5 is not really a thing. It's hard to compare it to Java or Flash, which are programming languages. It is possible to create interactive applications using HTML and JavaScript without using any of the features of HTML5. This seems to happen a lot, but for simplicity these are often referred to as HTML5 applications -- especially by non-technical people.
1) I would say that JavaScript can be as powerful as the other compiled languages you talk about even on a webpage -- especially with the power of <canvas>. You have found that HTML5 has won for a reason. In my opinion, it can do what the others can do and is simpler to implement.
There is nothing that forbids you from including Flash objects of Applets alongside JavaScript, though, and they can even interact.
2) There is nothing that prevents all of your HTML/JavaScript from being downloaded in the browser and viewed in plain text, although it can be obfuscated with tools such as Uglify.
It's also possible to download and decompile swfs and jars from a web interface, so compiling does not necessarily offer you a lot of protection anyway. Your code would be protected by Copyright (at least in the US) and you could use a license the MIT license too.
3) All the work is done by the browser. The client will only need a browser to run your code, but some browsers do not support some features you may want to use. This especially applies to older browsers.
There are a ton of frameworks and libraries out there for creating rich HTML/JavaScript applications, but these are just are mostly just JavaScript files.
HTML5 is a brand and trend. In silverlight/flash/html battle HTML must be the winner. Because browsers can't progress fragmentary. Is it true then some part of features developing in browser plugins, some part in browsers. For strong and fast progress always, at the start, needs the vector. In redefining web in our life such vector is HTML5. HTML5 is not a language, it is the set of capabilities, such video, music, webgl, geolocation, semantic essences and more and more only from browser. And we can't speek here about HTML5 like a language.
All your questions are about javascript.
Want bytecode inside <object> ... </object>? Use Chrome Native Client.
Want to hide your code? Use any obfuscator.
Modern javascript engines has just-in-time compilation. And there is the "subset" of javascript like asm.js which is just 2x slower then C++.

HTML5 Support for Multi Language

Does anyone have any idea that HTML5 has multilingual support.
I mean to say if I design my website in English and html5 will convert that using some lang or translate or any other supportive tag will convert that web page into a respective language.
Any guidance or bit of code can help me a lot.
Thanks a tons!!!
HTML5 doesn't translate anything. It’s simply a markup language that displays the contents you have put inside it without applying any logic to it.
However, such translations are usually done by modern browsers like Chrome, FireFox etc. Advance browsers do detect that the website you are viewing is in some other language and offer you the choice to convert it to your preferred language.
Only thing that HTML5 has in connection with this whole translation thing is that it has a new attribute called translate. By using this attribute with a value of "no" you can now flag elements that you don't want to be translated by browsers:
<span translate="no">衝撞撞沒輸贏」應是「衝衝撞撞沒輸贏</span>
<!--Now no browser will dare to translate this.-->
The question is - do you want to auto-translate the content, or do you want to translate the user interface of your website.
By itself HTML5 doesn't really provide complete support for either, only some hints, and even they are not really implemented everywhere.
You can add a Google Translate button to your website, as described at http://www.labnol.org/internet/google-translation-widgets/10135/ , for example. Google Chrome has it built-in and it works for all websites. Other browser may get such functionality in the future, but that is a feature of the browser application and not of HTML.
For translating your site's interface you can use one of the many internationalization libraries. Many CMS's and web frameworks come with such an i18n library. You can also do it client-side, using a library such as jquery.i18n ( https://github.com/wikimedia/jquery.i18n/ ).
(Disclaimer: I am one of the developers of juery.i18n.)
Finally, just a tip about good practice: Do use the lang attribute on all the relevant HTML elements. Even if it's just "en". This is useful for spell checking, picking the correct fonts, translation, etc. Whenever you know the language, specify it. It may seem redundant, but it is needed.
There is no integrated translation in HTML5. HTML provides support for the lang attribute which indicates what language a given tag's content is written in, but this is merely an indicative attribute which does not modify the content in any way.
The more philosophical reasoning behind why there is no automatic translation is that HTML is a structural language... it defines the framework upon which your web page is built. Not only does it not modify content, but if it did you as the developer would lose control over the quality and accuracy of the translation. This could be a very bad thing...
As you must already know, however, Chrome will translate pages in foreign languages for you into your preferred language. The difference here is that Chrome is controlled by the user, who has the power to decide in what language to view the content as well as whether they wish to view the original content which is explicitly defined by you, the developer.
Translation is up to the browser. To translate, you need a translation engine which will actually do the translation for you. As you know, you can't simply convert words one by one and end up with a proper translation in the other language. Chrome leverages the power of Google Translate to translate its pages and this is how it offers this functionality. Your best bet for multilanguage support is to offer your pages in as many languages as you accurately can, and then hope that users who don't use Chrome will plug your URL into Google translate or a similar service to get an approximation of your content in their native tongue.

Methodological concerns about HTML5, SEO, and backwards compatibility

I defied all conventional knowledge, and wrote my HTML5 site first. Now I am writing the HTML4 site and adding a script which detects old browsers. The question I have is mainly regarding web safe fonts. I am aware that it is best practice to use HTML instead of images of pretty text, for the benefit of SEO. However, since the HTML5 website exists with the HTML in the headers, I wonder if it is safe to use images to represent those headers in the HTML4 version of the site. Simply put, will my web client's indexing suffer? I feel that the HTML5 version will ensure good ranking, but I wanted to put it to the community and get an opinion.
Second question, should I create the more accessible version in HTML4 or XHTML?
Finally, is there a simpler way to make a new site backwards compatible, and still be able to make use of newer technology?
After a fair amount of research, I found that it is not so unusual to create a site in HTML5, and implement items for the purpose of graceful degradation.
At this site: spacebug.com/gracefully-detect-old-browsers-and-fallback-from-html5/, the authors recommend not using PHP user agent variables to detect browser capability. It says that there are too many user agents and that headers change, etc. Check out the link for their in-depth explanation. It offers that the right way to do it is to use javascript to check for certain capabilities. Since my purpose is to either render it in HTML5 or render it in XHTML, this makes my life pretty simple.
Once I found that javascript was the way to go, a simple Google search led me to this site: diveintohtml5.info/detect.html. This offers a number of methods for detecting browser functionality as it relates to HTML5.
For those who are not as savvy with the code, or for those who are looking for a quick solution, the second website also offers a link to modernizr.com, which is an "open-source MIT licensed javascript library that detects support for many HTML5 and CSS3 features."
So, thank you all for your input. I have learned a great deal from this experience, and I am hoping it will make everything much more user friendly and efficient.
Happy developing!
Kat

HTML5 site implementation

My question is borne out of my confusion on (still incomplete, with existing features still evolving?) HTML5 support in different browsers, all the resources available on how to implement existing features and simple practicality.
1) How do you go about implementing HTML5 only features in your web-site? Do you do some kind of browser/version check at first access and notify user that he should install some other browser (though cumbersome and uncomfortable to the user)?
2) Is there a way to check availability of HTML5 features in user's browser dynamically (version X of Chrome does not support it, next might and it should work then) and easily without some significant computing overhead and significant coding?
3) Assuming the answer to 2) is yes, what to do about changes in spec that might occur in the future? (The check would say fine, the browser does implement e.g. WebGL, but my implementation would run into errors as there would be some changes between the spec I had used during development and spec that was enhanced in the W3C process and would make my implementation incompatible)
to start using html5, make sure that the first line in your html is <!doctype html> this tells the browser that you are speaking in the language of html5
this google-hosted html5 shiv helps to ensure that the new html5 tags work in older browsers and as someone already pointed out, you can and dare I say it, should use modernizr to test the browser's CSS rendering capabilities
This is just something you need to keep abreast of yourself unfortunately ;) The way I look at it, if the spec changes in a big way, lets say they decided to remove the <article>, there will be a lot of chatter online and you are likely to read about it
I recommend that you take a look at html5-boilerplate. It's a A rock-solid default for HTML5 awesome.` It's a starter kit with template html, CSS and Javascript files for building an html5 website.
This is useful: http://www.modernizr.com/
As for 3: I think that's just a risk of using a technology before it's out of spec.
Take a look at modernizr, it's a js library that will do various feature detection tests and gives you a way to query whether or not to use a particular feature. You can also load specific js files with modernizr.load based on whether a feature is supported in the browser.
http://www.modernizr.com/
Tutorial: http://www.alistapart.com/articles/taking-advantage-of-html5-and-css3-with-modernizr/

ASP.Net and HTML5

I need to develop a web application, i have two choices
mvc3 straight forward implementation
using HTML5
i want to know whether HTML5 can be used as part of .net web application architecture or not?
Reasons:
there is no official support of HTML5 server controls like
Now IE 9 was launched but how good it supports HTML5
I found in internet that there is installation for HTML5 helper, but how reliabale it is?
I need guidance on the HTML5 and .net and if any tutorials in this combination.
Thanks in advance
Standards are based on implementation, not invention. If Microsoft wants to wait till HTML5 spec is finished, they will be waiting a long time. Meanwhile, modern browsers have implemented large portions of the spec and are moving forward.
With that in mind, how can one expect ASP.NET to contain elements of HTML5 and related technologies if Microsoft doesn't believe in its usage right now? In our small business, this is the reason we would never use it.
Microsoft always argument that HTML5 isn't fully finished. Then ASP.NET cannot be totally rewriten to follow it. Makes some sense, but...
You can do it by yourself: http://stephenwalther.com/blog/archive/2011/01/11/building-an-html5-app-with-asp-net.aspx.
But I realy believe that ASP.NET MVC is more flexible to it task.
Your question is pretty open-ended. What do you want out of HTML5? If you're just looking for controls, you run into a roadblock that ASP.Net web forms won't render the new HTML 5 input types with placeholders and custom keyboards like URL Input, Email input canvas, etc. I made an open-source project to make these plug and play with Web Forms.
If you're looking for other parts of the spec, pay special attention to whether or not the markup "fails gracefully". If you can optimize the experience with HTML5, but still keep a baseline quality for older browsers, I say go for it!