Accessing native API/system from Sencha Touch - android

Sencha Touch is quite perfect for my project. But in order to call a driver for an hardware barcode scanner on iOS and Android, it would be necessary to have access to the underlying system.
Is that somehow possible with Sencha Touch itself when "transforming" it into a native app (the Sencha SDK allows this)?
I know that it is possible with PhoneGap. But I'm afraid using all these technologies together (PhoneGap + Sencha touch) could make the UI less responsive, but that is a decisive factor in this project.
Edit: in this thread, a user says the following:
"you cannot access the native iOS file system, unless you use Sencha
SDK Tools and native packaging"
So is it possible with Sencha touch?

You have to keep two things separated, are you developing a web app or a native app that has a web app embedded? I.e. are users going to get to the app by navigating to a certain URL or are they going to download it from App Store/Google Play?
For native I would suggest using PhoneGap as the "shell" and use the bar code scan plugin that is available on GitHub
For pure web app development, the only thing I can think of is the Bar code Scanner service from ZXing which requires users to already have the bar code scanner installed (or redirects them to the appropriate store if I remember correctly). In this scenario you are however depending on ZXing to maintain their open service and any changes on their part could have a direct impact on your app.
Hope this helps you!
Edit after comment from OP:
Ah so you need general access to the native environment. As for as I know there isn't a documented way of accessing other native components other than those specified in the Sencha Docs it seems to be on the way according to mitchell at sencha.
The question is really though if Phonegap makes a less responsive app than the Sencha Mobile Packager. Both creates a shell application that invokes a web view and I haven't seen any performance tests between the two.

Related

native app using url in cordova/phonegap HTML5 performance

So we're developing using NodeJS, angular, html5 and all that jazz. But we want to have a more native app experience. So we're going to use ionic. However, instead of building the app as a local app and pulling in the data we want, they've decided to just build a web app and point the native app to the wep apps url.
So it's a glorified browser that looks like a native app.
Do we lose the ability to harness the devices hardware? Such as hardware acceleration and access to the devices tools like the camera. If you could provide a link to an article detailing the cons of this approach, that would be fantastic.
#Chauncey, If you are using phonegap, you are a liberty to use any of the hardware devices you have permission to use, as long as you have the plugins loaded.
However, both Google Play and Apple iTunes frown on having Apps that are just glorified browser. There is another misconception. Phonegap Apps can have as much look and feel as native Apps. With Ionic and others, those things are done for you, and hidden from you. So with Ionic, your native look and feel is only as good as Ionic gives you.
Oh, and your request for for links to articles lgtfy --Jesse
Pointing on an external URL is not a good idea.
A mobile app should have all images/css/scripts on device in order to shrink network access.
That you want to do will be really slow and does not offer a good user experience. In this way, your application can be rejected by Apple when you will submit it to AppStore.
Cordova/Phonegap needs to run some scripts at start and then raises events. You can't use device specific hardware before that. And if you redirect the main frame to an URL, you will overwrite these scripts ...

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.... :-)

Which native APIs from Apple and Android devices can Appcelerator access which Phonegap cannot?

I am aware of Appcelerator and Phonegap's differences with regards to their approach in creating cross device/platform applications for Android and iOS. I believe one of Appcelerators advantage is that it has access over the device's API, correct me if I am wrong but isn't Phonegap also capable of accessing the device's API? My question is if both of them has access to the device's API, then what advantage does Appcelerator have over Phonegap in terms of API coverage? Which native APIs from Apple and Android devices can Appcelerator access which Phonegap cannot?
With the typical PhoneGap application, you're trying to mimic the native GUI elements in JavaScript, most likely with something like the Sencha Touch framework. However, with Titanium (Appcelerator is the company, Titanium is the product), you're using Native GUI elements.
To answer your question, when you're developing a simple application in PhoneGap, you're not using the native Table View, Tab View, Image View, etc. Instead, you're using JavaScript that tries to mimic those controls. So, in even the simplest of cases, you're not using native APIs with PhoneGap.
Considering you're able to write your own native code for either Android or iOS using PhoneGap, I don't think there are actual limitations in terms of API coverage beyond what comes with it out of the box. I just finished writing a plugin for PhoneGap that allows me to access the orientation gyros (ie yaw, pitch, roll) on Android because it didn't have one. Since PhoneGap fires up your class on initialization, you're able to inject whatever code you need before/after executing the super.loadUri statement.
PhoneGap is simply a wrapper that makes it easier to separate your presentation layer from the native device code by automatically loading up an html file in a chromeless browser and then listening for specific requests made from the browser back to the native code (ie, the plugins PhoneGap ships with). You're free to add additional native code around the PhoneGap wrapper.

Categories

Resources