What exactly is a purely HTML5 application? - javascript

We often hear 3 kinds of apps :
1. Purely HTML5
2. Hybrid apps
3. Native apps
So what are the key differences between these items and what exactly is a purely HTML5 app?
Thanks
Smitha

Speaking of e.g. iPhone and Android,
native apps are built in ObjC/Java.
HTML5 apps are built in JS/HTML/CSS and displayed using the native browser.
hybrid apps are built from both, with a custom-built wrapper (in ObjC/Java) that interacts with HTML/JS/CSS code (often with the help of a library such as PhoneGap).
Native apps are non-portable but fast; HTML5 apps are portable but limited to what HTML5 allows you (for example, you can't access a SD card from JS). Hybrid approach gives you portability of a HTML app, while you can still write extensions in native code to handle system-dependent, or time-critical sections.

Related

difference between cocos2d-x vs cocos2d-js

I'm just moving towards mobile apps... A friend of mine told me to start with cocos2d, I'm good in javascript. while searching google for cocos2d, and within cocos2d-x.org I found
cocos2d-x
cocos2d-JSB
cocos2d-html5
cocos2d-Javascript
I know what cocos2d-x is for and what cocos2d-html5 is for, but what is cocos2d-JSB and cocos2d-Javascript?
My questions are..
Can we develop 100% pure native apps/games in cocos2d-JSB and or cocos2d-javascript.
I also know cocos2d-JSB is javascript bindings, but what does that exactly mean?
Last but not least question: what is cocos2d-Javascript for? does that work alone or do we need cocos2d-html5 to make it previewable in iOS/Android/Windows Phone?
My aim is to develop native apps for iOS/Android and Windows.
Cocos2d-JS is Cocos2d-x engine's javascript version, maintained by Cocos2d-x team. It supports full Cocos2d-x functionality with a set of simplified javascript friendly APIs. It contains two parts: Cocos2d-html5 and Cocos2d-x JavaScript Bindings (JSB), and Cocos2d-html5 is a pure JavaScript engine for web, and Cocos2d JSB is for native app which share the same API with Cocos2d-html5.
So, Cocos2d-JS provides a consistent development experience for whichever platform you want to distribute to, either web and native. You can use it to develop web, android, iOS, mac, windows app. The windows phone8 is coming soon. You can develop your game on browsers with Cocos2d-html5, and then compile to native app with Cocos2d JSB.
Cocos2d-JavaScript is totally different from Cocos2d-html5 and Cocos2d JSB. It was branched from cocos2d-iPhone and maintained by Ryan Williams.
Cocos2d-X is a complete game engine which can be used to build native apps for android,IOS and windows mobile devices as well as for web platform. Cocos2d JSB is used to create native apps as well as web apps while Cocos2d js is used to create purely web based games. If you do not want to make any native app, you can use Cocos2d lite version also. Cocos2d lite version is a single javascript file having the complete basic functionality of Cocos2d-X. you can use this version to reduce your project size.
cocos2d-x supports 3 languages:
cocos2d-x + c++,
cocos2d-x + js,
cocos2d-x + lua.
With c++, lua, you can develop android/iOS/Windows app, but you can't develop a web-based game. It will have to be done in Javascript. cocos2d-x + js will support android/iOS, also web-based app.

Best way to build native applications with JavaScript?

I've been playing for a while with phonegap,
did some tests on my Android...
It's pretty nice.
My questions are:
What is the best (your favorite) framework to develop native mobile applications with web client side (HTML / JavaScript / CSS)?
How easy is to build and maintain those applications in multiplatforms (iOS / Android / BlackBerry) parallel?
Does it has many exceptions between different platforms (iOS / Android / BlackBerry)?
What are the requirements to develop my app for iOS?
Should I need a special IDE with special SDK? Must I have a Mac?
We're currently building a native iOS application using React Native. It would be a shame if it wasn't included here.
Pros:
React treats the DOM as an implementation detail. This made the transition over to native UI very natural. It also removes the need for HTML/CSS when writing a native app. All you need is native components, written in JavaScript.
Native components! The fundamental native components have already been bridged over to JavaScript, and there is a community busy at work bringing everything else over. The thing is, if you know or are willing to learn some Objective C or Java, there is an easy process to add any native module (or third-party module) to React Native.
Quick iteration. There have been over 2600 commits to the master branch since it was open-sourced in March.
You get all of the benefits of normal React: a virtual view layer, diffing, declarative UI creation, fantastic developer experience, and a stellar community.
You can build for multiple platforms from the same repository, reusing much of the same codebase (application logic, mostly).
Cons:
It's still young. There are a few features that require jimmy-rigging, a third-party library, or custom Objective-C/Java to get working.
Some great third-party libraries that are tied to the DOM or Browser API still don't work on React Native, including React Router.
The biggest pains have had to do with XCode and Apple's developer program, but there's no way to get around that.
How easy is to build and maintain those applications in multi-platforms?
React Native for Android was open-sourced on September 14th, 2015. I haven't used it yet, but here's what I've been able to learn so far. Update 10/21/16: React Native for the Windows Universal Platform was announced earlier this year. That means you can now use React Native to build apps for Windows desktop, Windows phones, and even Xbox!
React Native is not intended to be a write once, run anywhere mentality. They adopt a learn once, write anywhere paradigm instead. iOS is a very different platform than Android, so sincere effort needs to be put into the design for either platform. The native APIs will also be different.
So, you will end up re-writing code for native components and APIs. However, much of your application logic can be re-used. In fact, React-Native is organized so that you can keep both your Android and iOS applications in the same repository, so that you can re-use the same code when possible. I think it's brilliant, but only time will tell. According to them, it works well so far.
By the way, a team at Facebook built an iOS app using React Native, then turned around and built the Android version in three months using 87% of the same code base.
What are the requirements to develop my app for iOS?
Currently, you need a Mac and XCode in order to deploy. Currently there are very few ways around this. According to this issue and from conversations on Slack, once deployed, you can actually develop from a Windows or Linux machine. Facebook is also working on open-sourcing all of their Nuclide packages, which, according to their presentation at F8, will include tools to package and build without XCode.
Overall, React Native has been a stellar experience. It is, in my opinion, head and shoulders above anything else currently out there. The feeling within the community is also very positive. I can only assume it will get better with time.
If your app is going to be very simple (for example a port of existing web app) and you need it only on one platform and it does not need integration with phone-specific features you may want to simply use a WebView on the selected platform. If your selected platform is iOS and you don't have any programming skills, you can follow these steps:
Download xCode on your Mac,
Download this simple web view app project: https://github.com/nomtek/iOSWebViewApp
Open the simple web view app within xCode
Add your HTMLs to the project
Run it :)
Advantages of this approach:
Simple setup
No extra libraries to load - the application starts much faster
This is one arena that keeps changing, and it only gets better. Googling at the moment of your interest would be the best bet. At the time of this writing, I am watching the following right now, in no particular order:
Enyo JS
Sencha
NativeScript
Meteor
PhoneGap
Appcelerator
these are the options
Phonegap : http://phonegap.com/
PhoneGap is a free and open source framework that allows you to create
mobile apps using standardized web APIs for the platforms you care
about.
.Download the Phonegap.
Coronalabs : http://coronalabs.com/
Corona SDK builds rich mobile apps for iOS, Android, Kindle and Nook.
Build high quality >mobile apps in a fraction of the time.
Appcelerator : http://www.appcelerator.com/
Appcelerator is the only mobile first platform that enables enterprise
to create, deliver >and analyze their mobile applications.
Phone Gap does look like your best option, if you are trying to use javascript to build a mobile app
Yes, you will need a mac, because you will need to install XCODE (https://developer.apple.com/xcode/) - apple´s own IDE.
If you invest a bit in learning a new script language, Coronalabs would be your new weapon of choice. With it you can build native (cross-platform) apps and you can use a webview to add your HTML/CSS/Javascript stuff if you need it.
At the moment React Native is the best option for creating mobile apps in JavaScript.
Here are my top 3 reasons:
Very active development and updates - After all it originated at FB
Negligible learning curve
Great online resources
I was able to write a small but functional app without previous React Native experience and even deploy it to the Google Play Store all within 2 days.
Also one great benefit that i see with React Native is that you can "eject" your app at any point in time and continue to work on it in Android Studio or XCode. This could be a big relief in projects that start simple but could get complex over a period of time.
Here is short tutorial I put together while building my first react native app for Android:
http://geekycentral.com/creating-a-native-android-app-using-javascript-hello-react-native/

is Dojo more helpful than using normal Javascript+jQuery?

I really wonder why do we want to go for dojo when there is JavaScript with jQuery?
I have already used HTML and jQuery for one of my django project. And also used dojo for my another django project.
Now i am going to do another django project and I am very confused which on should i have to use?
Is there any more advantages when we are using Dojo
I think this will help you in deciding:
Dojo:
Dojo is used for creating dynamic web user interfaces by providing
widgets, high level Input and Output abstraction and utilities. Dojo
enables rapid development across platforms between JavaScript, Ajax
and web applications. Dojo is a rapid development toolkit for web
oriented software on desktop and mobile and internet applications
without using the browser’s inbuilt graphics technology. Dojo is being
used by all the popular internet browsers like Internet Explorer,
Google Chrome, Safari, Firefox, Opera and on smart phones and tablets
by Apple (iPhone, iPad) Google ( Android) and BlackBerry.
jQuery:
JQuery is a JavaScript library whereas Dojo is a JavaScript toolkit.
JQuery provides the easy interaction between HTML and JavaScript
through JavaScript Library. It is used for handling events, creating
animations, reading and manipulating HTML document and creating Ajax
application with Ajax ASP.net and PHP. Query allows the customization
of plug-ins library on top of inbuilt JavaScript libraries. JQuery
provides User Interface libraries with many useful functionalities.
JQuery is easy to use and customization feature is making it popular
and adoption is all time high.
Read more about them # this article.
In my opinion it totally depends on what type of website you are making because they are somewhat different from each other.

webview for user interface in android

I was searching for how to use swf file in android and most of the answer suggested me to use webview and an simple html file.
Now i think We can easily put css and javascript files in asset folder and then we can use them in an html5 code.
Looking at the power of HTML5, This will make app development for a web designer very easy job !
I just want to know that is it good to use this approach to build a good user interface in android ? Are there any technical pros/cons behind it ? will i miss some features provided by android ?
There are a lot of frameworks that allow you to write native android applications using HTML/CSS/JavaScript only. Here some of them :
PhoneGap
Cordova
Titanium
I've never used any of them, so I can't say if it's good or bad idea to write android apps this way, but here you can find a good session about it HTML5 versus Android.
There are pros & cons of using cross platforms. As per my point of view you shouldn't go for loading of everything in WebView.
I still recommend you native app approach because of following points :
WebView is one of the UI control in Android SDK. So, it will have
limitation of memory size and working with CPU utilization. So, you
might face performance issues in some devices.
As you know in older era we were used to work with desktop apps and after that everything is shifted to web-application.
It was
possible only because our browser(s) gets more features for e.g. more
memory area, CPU access, threading, individual Processing (like
google chrome) etc...
in-short, web browsers gets more smart and get treated as separate application. Now a days web-application can have mostly similar
performance as desktop apps. So, everything is now shifted to
web-application development.
This era will come in to Mobile development in later stage. but currently we are in middle stage of Mobile development and Cross platform development. So until and unless Web-View control of any platform (iOS / Android) gets more powerful, we can not totally relay on that.
I Hope I explain it properly :)

Can an HTML5/javascript Android app access the camera/voice recorder?

I'm thinking of getting into Android app development and I hear HTML5 apps are becoming more popular now. Can HTML5 + javascript be used to access media inputs on the phone, or is this only available to Java apps?
Thanks
Frameworks like Phonegap make this possible by providing a wrapper around the api of each device it supports, which can be called from your html5 application built using it. Check their site here or their api documentation for the camera api here.
In pure HTML5/JS, you can't.
But, you can use fameworks like Phonegap that provides JS libraries allowing you to access to the device capabilities such as GPS, camera, etc.

Categories