I was wondering if we can have chrome apps on tablet and mobile? They are used on desktop version of chrome but I dont know if it works for tablets or mobile.
Yes and no.
No in the sense that an app cannot be straight up loaded in Chrome for mobile. It needs to be published as a separate app in the app store.
Yes in the sense that there is a conversion process developers can use. There's a Google-provided toolchain based on Apache Cordova which allows you to make a native app for mobile out of a Chrome app.
See here for the workflow. Note that it is considered a preview release.
Edit: there's an alpha release of a tool which allows to load up an app without conversion. See Chrome Apps Developer Tool
Related
I hacked together a website (HTML+CSS+Javascript only) that I use offline to control some Bluetooth Low energy devices. I was thinking of hosting it with Apache on my local network so that I could use it on laptops and maybe phones around the house. I only use Chrome on all my devices.
What would happen if I went to the website on my Android Phone? I assume the CSS and HTML would load fine but what happens to the Javascript? Will it run at all? Are all the BLE methods different?
PS: Basically I want to know if my idea is too far-fetched to even attempt. If it's way easier to just develop a separate app in Kotlin in Android Studio I'll take that route and not even bother with Apache.
Yes. Web Bluetooth API was shipped on for desktop and Android since Chrome 56.
Check here: https://www.chromestatus.com/feature/5264933985976320
What features (HTML, JS, CSS, Web APIs), outside of plugins, are available in a cordova web view ? I am making a web app, and then I use cordova to create an apk file. The web app works fine with chrome and firefox for android. But when I try the generated apk on the same android device and the emulator the JavaScript is obviously not executed because buttons have no effect.
The initial HTML and CSS display fine, and I think I use some JavaScript or HTML5 features that are not available yet on cordova web view, but I don't know what I can use and what I cannot. I had a look at the emulator's error log but I get nothing meaning-full.
For example is it possible to use es2015 without transpiling, esModules etc, but I don't know where to look it up. What is the difference between a webview browser and chrome/firefox for android.
Targeting Android 4 and later.
https://cordova.apache.org/
It's probably easiest to look at the architecture diagram: https://cordova.apache.org/docs/en/latest/guide/overview/index.html.
Cordova apps consist of a small wrapper around a WebView (this is a "window" of the default browser installed by your mobile OS, although you can swap it out for another: https://cordova.apache.org/docs/en/latest/guide/hybrid/webviews/), with access to the mobile device's features via plugins. So... to answer your questions:
You can use any technology that's supported by the mobile browser you're working in. https://caniuse.com is super helpful in this regard.
You will also find that Android 4.x's stock web browser is not that great -- some of the shiny new popover UI stuff (walkthrough help and light boxes) will render, but the z-order is all messed up when you try to click to the next item. I've run into other issues as well, but I can't remember them off the top of my head.
The Crosswalk project allows you to embed a Chrome browser web view in older Android versions (back to 4.x I think). Support for this project has been discontinued in the latest Cordova releases, as it's no longer necessary.
I've been building Android apps for a few years now, and I've arrived to this working setup:
Intellij Idea IDE write/debug
Genymotion "Emulator"
Physical Device (only when needed)
Git
Ant (probably should move to Gradle) Release/Debug builds
And now I'm looking to form an equally productive environment for Javascript (Phonegap, etc), for Android/iOS/Win8Phone.
I want to avoid the "nice-text-editor-only" solution (I believe a full IDE is superior in productivity terms).
Any suggestions?
Try Brackets editor http://brackets.io/. It's a nice editor to code the web. Phonegap plugins also available for this editor. Just take a look at this editor. Make sure to download the version of Brackets with Phonegap Plugin compatibility.
For the Cordova/Phonegap app I developed, I used cloud9. In my workflow, I would first get things working in my browser, then occasionally do builds with Adobe's Phonegap Build service to work out the kinks on my mobile devices.
The nice thing about c9 is you'll have a public URL for the website you're developing so you can preview it in your device's browser, which is typically closer to the environment you'll get with Phonegap.
The weinre debugging tool, although slow if you're running it through http://debug.phonegap.com/, can really help track down problems when debugging on mobile devices.
We got a Cordova App running and wrote ourselves a build script using Grunt which makes building the App a breeze. We don't require any of the APIs Chrome offers and are, apart from some performance issues with elderly Android devices which forced us to block some minor features on those devices, pretty much satisfied with the current status of our app.
So far we couldn't find any reason why it would make sense to transform our Cordova App into a Mobile Chrome App. Or is there something we're missing? Are there any differences in terms of JS speed, CSS support, etc.?
The primary motivation for Chrome Apps on Mobile leveraging Apache Cordova was to bring Desktop Chrome Apps to Android and iOS.
However, there are some reasons why you should/shouldn't consider using the cca toolkit, particularly if you already enjoy using cordova:
Chrome Apps APIs
If you wish to leverage some of the useful Chrome Apps APIs which we have ported to mobile, you may already be able to use them inside your vanilla cordova app, even without using our cca toolkit! (We went out of our way to try and make this work whenever possible, giving back to the community that helps us in turn).
However, for some of the APIs, you really do need to use our cca toolkit, since we may rely on the chrome app lifecycle or other specifics. (It seems our docs don't yet make this distinction clear, so I've filed an issue to address that).
Verdict: consider cca if one of the Chrome Apps API's which do not work on vanilla cordova appeal to you.
Desktop Platform
Chrome Packaged Apps run on any desktop platform chrome runs on -- which is every single mainstream Operating System in popular use today. The capabilities and native integration of these apps are rapidly improving, and are truly removing barriers to using web technologies for whole ranges of application types.
So, while the motivation for Chrome Apps on Mobile was to enable porting some of those desktop apps to mobile, you should consider if the reverse isn't actually useful for you!
This would mean adjusting your existing app to use the chrome app lifecycle and manifest, adhere to restrictions like CSP and disabled web features, and cannot rely on cordova extensions -- but in practice this is often not prohibitive for a cordova app which is already a package offline-enabled web application (thats the hard part)!
Verdict: consider cca if you would also like to also target the desktop platform, or would like to submit your app to the chrome web store.
Cordova Plugins
If your existing mobile app already leverages some cordova plugins, you can still use the cca tool, since we create a fully compatible cordova project. This comes with the caveat that those plugins will only be available on mobile -- but you can use feature detection for desktop-mobile app compatibility.
Verdict: the cca tool does not prohibit the use of cordova plugins.
Mobile Platforms that are not Android or iOS
We do not currently support some of the platforms which vanilla cordova does, such as BlackBerry, Windows Phone, or upcoming platforms like FirefoxOS, Tizen, and Ubuntu (though many of those do not yet have feature parity with Android / iOS anyway).
Verdict: don't use cca if one of these mobile platforms is important to you.
Final Words
If you are already happy with what you have, well, they say that if it aint broke, perhaps don't fix it!
I am interested in web standards (js/HTML/CSS). I would like to create applications from them, for phones and tablets. And sell these applications on mobile stores and web stores (for appstores and google play).
Is it possible ? What would be the best way to do it ?
Yes, there is a PhoneGap platform that can be used for building mobile apps for iOS, Android, Symbian, Windows Phone.Apps developed with it are accepted in all the stores. It is quite popular, robust and has nice features.
As mentioned in one of the other answers, yes PhoneGap will do the trick if you decide to write your app in HTML/CSS/JavaScript. Now, if you want to have a pleasant user experience on both smartphone and tablet operating systems, I would also recommend looking into Twitter Bootstrap.
This CSS framework has built-in responsive web-design styles that will allow you to scale things down in a user-friendly manner from tablet to smartphone, as well as show/hide different parts of your HTML depending on whether your users are viewing the page on a tablet or smart phone.
Specifically, you can do things like the following:
<div class="visible-tablet">
This will only be visible on tablets.
</div>
<div class="visible-phone">
This will only be visible on smart-phones.
</div>
For a full listing of the responsive design support in Twitter Bootstrap, check out their section on responsive design.
You may also want to check out the Google Chrome Web Developer plugin to assist you in creating a responsive web experience. This plugin lets you (among other things) view how your page will look on multiple device resolutions and is an invaluable tool for debugging resolution-specific issues.
You can look at Zurb Foundation, which is a very active open source project for building responsive web apps for mobile devices. Some overall description of the features here.
You can create Windows 8 Apps using Javascript and HTML 5 (apart from using Native languages). Windows 8 runs on Surface tablets and PC's.
Create your first Windows Store app using JavaScript (Windows)
There is a free ebook as well: free-ebook-programming-windows-8-apps-with-html-css-and-javascript
There are lots of options around - PhoneGap seems to be the most popular and, since it's now part of Adobe, it will probably continue to be popular.
However, there is a more important issue to be considered here: iOS users expect an iOS app experience, Android users an Android one... You get the idea. Make sure it's the best choice for your customers.
See this story about HTML5 at Facebook.
Also, and I know I might open a can of worms here, the performance will always be inferior to that of a native application.
You can also try MoSync:
"Build native mobile apps for all the major platforms using our leading open-source, cross-platform development environment. Now with support for In-App Purchases, NativeUI and Windows Phone 7." ]
There's Titanium from Appcelerator where according to their site you can build native apps using Javascript.
Just a late update: Facebook has open-sourced react-native since use asked your question and unlike PhoneGap (now called cordova) React-Native does not build hybrid app but builds true Native mobile application with the same power you would get when using Java for android or ObjectiveC for IOS. You can find out more here
No point in doing Microsoft/Windows Mobile anymore since it's now dead, but the easiest way to create Android apps based on HTML is to use DroidScript which can be found on Google Play (it did not exists at the time of this question).
You can also build native (non-html) apps with pure JavaScript using the same tool and it's far easier to use for novices than PhoneGap/Cordova.