Does a WebView app have access to Android features? - android

I am sorry if this is not the correct place to ask these questions but I cannot find the answer anywhere. I have built/building an app that basically displays a leaflet map and tracks users in real time with node and socket.io It has various functions but everything is contained either on or over the map. What I need to know is.
Will this run properly in a WebView app?
Can it run when the app is on but in the background (This has to run to keep the connection open and update location with the watch.position function)?
Can it access the HTML5 location features?
Can I access things like if I want to send a SMS from it via a button on the webapp?
Can I access the camera?
Whats the quickest software to use to develop this and could a similar app be made for iOS?
Sorry if a lot of questions but from what I have read WebView should be good enough as most of the work is back-end and map/browser based anyway. Or should I go down the native route?

I have done a couple of cross platform apps for iOS and Android with Cordova. To answer your questions: In a nutshell, I think you can do most of what you are trying to do with a framework like Cordova.
No.
Not with the webview, but maybe with Cordova (there is a plugin for background services).
Not with the webview, but yes with Cordova.
Not with the webview, but yes with Cordova.
Not with the webview, but yes with Cordova.
I am now a native developer for both iOS and Android. I would probably not do an app cross platform again unless it was really simple. I was always able to make things work in Cordova, but with a lot of hacking involved. Since you are familiar with javascript/html Corodova or Phonegap would probably be fastest in terms of development time for you.

Related

Building a hybrid app, where to start?

I know it's kind of an 'open' question to ask but I simply don't know where to start. Let me first tell you a bit of my experience/background so you know the level I'm at:
Build cd-roms with Lingo back in the days
Started web/front end development in the HTML3.2 era and kinda left off when XHTML was hot
Worked with Javascript 1.2 up till around 1.6 and later started working with Jquery
Actionscript up to 2.0, building websites and games
Did quite a bit of PHP/mySQL development. Build custom CMS' and later Drupal module development
All this was during internships or as a freelancer, everthing self thought by the help of books and such
So now I'm stuck with this idea to build myself an app. I've decided it should be an hybrid app as my target audience is very small but 60% is iOS and I don't want to leave out Android. Also I've been getting familiar with HTML5/CSS3 and started working on components for my app.
The basic concept for the app is that it's a layer on top of Google functionality: profile, calendar, circles and hangouts. Users will (eventually I hope) be able to create events for other users to rsvp to, they will be able to add eachother as buddies and chat about the events. A small step functionality wise but a huge step for me :)
I'm thinking of using the Crosswalk project for the Android version to counter the biggest issues around hybrid app development.
I've been reading up for the last months in preparation and the more I read the less I seem to know. Here's the stuff I think I should know more about;
Node.js
Gulp.js
Dev environment to work in (I once worked in Homesite, later Dreamweaver - don't laugh)
Packaging tools, etc etc.
Crosswalk project
Now I am not looking for some drag and drop software package to build an app in 3 days. I don't want to take the easy route per se, I don't mind a bit of a learning curve. I work on a Win8 machine, I know this isn't optimal but I can't change this.
Now where should I start? I was thinking NPM myself but you guys might think otherwise. Any good books on the stuff you think I need to learn to get me going?
Thanx for the advice!
I can share my experience with Cordova.
I work like full-stack developer and i'm quite expert to build responsive website, so the natural step to approach mobile dev was try Cordova.
First You can start to build HTML document totally responsive and try as webpage on your target devices.
A cool stuff, targeting mobile devices, is that You can use new CSS3 directive, without worry for compatibility with old browser.
First I installed Cordova following this tutorial.
https://ccoenraets.github.io/cordova-tutorial/create-cordova-project.html
Opening the folder /www on your project you can edit your app like a website, and you can also debug with the browser like a normal site.
To enhance the feature you will find a lot of plugins ready on github to extends the native functionality at the Cordova/phonegap project.
I suggest you also to build using onsen http://onsen.io/ a framework that let you use mobile UI easily.
Last tip that i can give you, if you target Android is try your apps on virtual machine, i use Genymotion https://www.genymotion.com/ that is much more fast then SD<
Good luck with your first app!
As you can imagine, there are a lot of framework where you can start.
Looking on your skills, maybe is better to use JS/HTML/css stack, but in this case, you will create an hybrid app in a webview.
In my opinion, webview applications quality it's only acceptable, but because of his productivity, in some cases could be the best decision.
Another good alternative is react-native. This framework allows to create a native application using javascript. React has his own markup language, is very similar to html. JS code is executed on native device using an embedder javascript engine, instead of webview, so, performances and experience can be compared to native applications.
And, at the end, my alternative, a framework I've made to write native UI and share business logic for each platforms. You can take a look on aj-framework https://github.com/bfortunato/aj-framework

Developing in Android Studio versus Framework (e.g PhoneGap)

I wanted to get a more experienced opinion on something I recently found out. A couple of months ago I set a goal to build myself a mobile app, and the first thing I did was go to developer.android.com and begin reading documentation on how to go about doing this.
I've invested a lot of time in understanding Android Studio and how to make simple apps (and I'm just now getting the hang of it all), but I just recently read about frameworks like PhoneGap(which let web devs who know HTML,CSS, and Javascript make apps too).
Before learning Android, I taught myself web dev through the Odin Project, which taught me a fair amount of HTML, CSS, and Javascript (little iffy on this language, but I'm sure it's something I could pick up easily since I already have a bit of experience).
I'm wondering what you guys feel are the limitations of using these frameworks and whether I should switch over to them, as opposed to continuing with Android since things are beginning to click for me.
Thanks!
I have developed apps for both Android and Phonegap. Phonegap takes advantage of your web development experience and lets you build mobile apps with ease. But it's not a replacement for Android API itself. A good phonegap application requires knowledge about web development and Android API.
However if your aim is to develop an android application, and you are comfortable with web development and Android, I would advice to take Android API.
Phonegap as wonderful as it is for web developers, and startups who can't afford to have dedicated resources for Android, iOS separately, has its limitations.
Performance : Phonegap app's performance is not at par with a native
android application.
Functionality : As one would expect you can't have all the functionality support a native android application has.
Look : You could easily tell apart a phonegap application from a native one. Given phonegap renders all the content in a webview, the look of native ui elements is lost
I think you will always need access to the native API to make good apps.
At least the navigation should be native, so that your app has the look and feel that the user expects, and so that stuff like the back button get correctly handled for you.
Even if there is some plugin that does that for you in a perfect way, I believe it's beneficial to know how Android works.
In the end, frameworks like PhoneGap add a layer inside your app rather than removing one, and it's always better to understand what goes on inside your app.
So the time that you've spent learning native Android won't be lost.
However, it makes sense to use HTML/JS if you want to share code between different platforms.
I think this article from Basecamp shows a very compelling example: https://signalvnoise.com/posts/3743-hybrid-sweet-spot-native-navigation-web-content.

Is PhoneGap the right choice for me?

I am new to PhoneGap, and I have several questions:
I need a way to develop an application that will have iOS, Android, and other platform compatibility. In other words, I want to write 1 app and get compatibility versions for different platforms.
By reading the "Get Started" guide linked by the PhoneGap website, I found there are different procedures for different platforms. So to have compatibility versions across platforms, do I have to go one-by-one and change all of them if I make a modification to my app?
Also, what exactly is PhoneGap Build? It seems like I can avoid all that hassle mentioned previously and toss my app into the PhoneGap Build? Do I really not have to do anything besides writing the app? What if I need to make changes?
And finally, I've read that PhoneGap works with HTML, CSS, and Javascript, but not PHP. What if my app needs to contact a server? Can PhoneGap handle that?
Thank you for bearing with all these questions!
PhoneGap achieves platform compatibility by embedding a webview within your application. Therefore you can apply your knowledge in HTML, CSS, JavaScript and it additionally provides ways to interact with native features (e.g. camera, gps, ...).
With PhoneGap you write one general web app, tweak parts for the specific platform (sometimes you do not have to this at all) and build it for that platform. The latter can be handled with PhoneGap Build service: It takes your webapp and bundles it for the mobile operating systems out there (Embeds it within a Java app on Android, an Objective-C app on iOs)
PhoneGap is able to communicate with a server hosting a PHP script just as every other web application. Trying to dynamically load resources from remote sites can be quite a hassle but this is another question.
traumalles is correct. All your HTML/Javascript/CSS is running from within a webview on the device. Your code is, therefore, all "client-side." You can communicate with a server just like with any other page. When they say PhoneGap isn't compatible with PHP, they mean only that PhoneGap can't execute PHP code like it's a server, because it's not. It's just loading your webapp in, basically, a browser.
One other important question is what exactly do you mean with "other platforms" phonegap does provide many functionality for nearly every platform but the different webbrowser of the mobile devices have their problems and limitations.
For example are there many problems if you want to provide your application on a WindowsPhone Device because the Webbrowser has a few limitations which will cause your app to not look and behave like a native app.
Just look a bit through the phonegap API you will see that some functions are just available for IOS or for Android and there are a few only Blackberry methods and so on.
So you really have to be careful when a framework tells you it will work on all devices.
So i really don't have a problem with phonegap i worked with it very great but there will be limitations you have to deal with.
If you primarily want to develop for IOS and Android you can really achieve great native like results !

Android: PhoneGap vs Webview

I have been researching PhoneGap and I'm now at an impasse and need some advice. I know that PhoneGap essentially 'converts' html5,css,JS sites to 'apps' for distribution, which leads me to my question:
Why wouldn't one simply utilize a webview within an activity to do the same thing and keep the app native?
The advantage of PhoneGap is that it provides APIs that enable your HTML/javascript to interact with the phone (e.g. camera, accelerometer, media etc.)
These APIs are standard across multiple devices (iOS, Android, WinPhone, Blackberry etc.). So you can write one set of HTML/javascript and deploy to multiple platforms.
If you just created a WebView you would not have the PhoneGap APIs and you would need to build containers on each platform you were interested in.
Good question I have searched me too, because we went in Phonegap solution and I think it is a wrong way for us.
The long story:
That is very true if you write once a UI with web developer skills than not needed to know native language and it compile, and ready for testing.
Web developers are more so higher the demand => developer price even cheaper.
When the client want a Milestone 1 for his great idea it will ask a few company, freelancers about development price and time. If is a very basic application version with Phonegap you will have the less development cost( off if your web dev skills are the same laver as platform dev skills) with webView at second place and last one the native.
The client is satisfied with app result buit with Phonegap and want to get more investors so it will make a presentation, where they are asking more features.
At Milestone 2 you will add a few features. Some are easy command line install and you get it, some aren't. Maybe you will be unlucky as you want a combination of 2 existing plugin with a few extras. The conclusion will be: you have to develop a plugin. At this point is already a very big sign of interrogation which is cheaper: the Phonegap + Phonegap plugin or a WebView. If you need 5 existing plugin and your has a little modification, than still Phonegap. But if you need only 1 plugin, only yours, than the web view is the proper way. There are also cases which makes the Phonegap stucture useless. Also there is a problem with version control system under Phonegap if you develop web files, and native code too: some are regenerating at each build time some not. Still is expensiver the native platform. Now the required features are developed. The client will make a demo for investors, where will be visible execution speed with this new features. Or here they will require optimisation, runtime speed-up or after publish to market they will see some are running with low end phones and not the ultimate, which ws used at demos and they will decide to go to Milestone 3 : speed up.
At optimisation, speed up (Milestone 3) you will decide as you need native GUI. After all GUI developed with web now you will need to throw out at fence and implement the side, maybe some parts need even NDK to speed up. No way to be good here with Phonegap. But you have hired web developers, or contracted that company. Now go back to that company , developers which can make native code. They will not start from 0, so they need to analyse the code, refactor and your development price will go up at least with 50% as you would start it from 0 with native.
Good Question, you still could use webview for that but you won't be able to access native functions like ringtone, camera, and all that, however, the app done that way will be regarded as a native app.

Moving from android to sencha-touch

I am creating an app on android but after hearing about sencha that it supports multiple platforms, so before choosing that i have some confusions about this framework. Please answer few questions
Will sencha apps will work only in web browsers? i.e. launching an app will open web browser first?
Android has built in database i.e. SQLite? does sancha supports it or has its own built in DBMS?
Can i use hardware features like camera(for barcode scanning)?
Does it support google maps
Is it possible to create homescreen widgets that runs on iphone,blackberry and android?
any help in this regard will be highly appreciated
Not too much information is available on the internet about Sencha Touch. Their latest version is Sencha Touch 2. I did explore that alternative a few months back (back then, they were still on version 1).
That being said, let me answer as many of your queries as I can.
Sencha Touch driven applications don't run in your web browser. They
run natively on each platform you design for. However, they make use
of the webkit engine integrated in you App. Therefore, launching you
App will not open a browser page but will run your application
(HTML5 by the way) within your App.
A preliminary search on their website has SQL Database mentioned. http://docs.sencha.com/touch/2-0/#!/api/Ext.feature.has-property-SqlDatabase. Not sure about how they integrate it. Perhaps a look into their SDK/ API and a few samples should clear that up. Alternatively, an I am just guessing here at this point, it might connect your website database, if one exists.
Harware features don't seem to be avialble at the moment. A quick look at their kitchnsink example should give you an idea of the components available for integration. http://dev.sencha.com/deploy/touch/examples/production/kitchensink/index.html
It does support Google Maps.
They do list an extension called WIDGET but the documnetation seems rather silent about functionality. Again, as mentioned earlier, a dive in to the SDK / API and a few examples might clear that up.
This here is their online Guide: http://docs.sencha.com/touch/2-0/#!/guide
And this is a page to their Examples: http://docs.sencha.com/touch/2-0/#!/example
I would still go ahead with Native App development as it gives you more flexibility over something like Sencha Touch.
Alternatively, if you would still like the one effort, multiple platform thingy, there are a few alternatives available.
http://www.phonegap.com/
http://www.appcelerator.com/
http://www.rhomobile.com/
Good luck with your app development. And I hope the info provided helps.... :-)

Categories

Resources