We have just reached some sort of a brick wall in our project and would
appreciate some comments or suggestions or pointers, anything at all.
Problem Statement
Making a web-technologies (html5/canvas) based mobile/tablet app that can
do some natural language processing.
Our Constraints
For UI, we are more reliant on prototyping it with html5 technologies
like the Canvas api, SVG. It aligns a lot with our skills and has the
requisite capabilities
NLP libraries are more mature and well developed in Python (like NLTK)
Some alternatives that we tried
Javascript based libraries for NLP. They might not be as matured, but
could have proved a faster alternative if there were JS libraries for NLP.
We found these:
Natural https://github.com/NaturalNode/natural
Other JS based libraries:
http://www.chrisumbel.com/article/node_js_natural_language_nlp
But they proved to be Node based and we couldn't figure out a way
to add them to a browser kind of page, so that we could embed it into a
"PhoneGap" type platform. We could be wrong.
To use Python NLP logic in our mobile app, we tried some cross
platform libraries:
PhoneGap http://phonegap.com/
This StackOverflow
responsePhoneGap with Django Backend
suggests
that "you cannot run python code on iOS or Android using PhoneGap"
Qt 5 http://qt-project.org/,
Qt5-mobilehttp://qt.digia.com/qtmobile/
There 2 promising Python Based Qt libraries:
PyQthttp://www.riverbankcomputing.com/software/pyqt/introand
PySide http://qt-project.org/wiki/PySide
This QML/Python/Qt
demohttp://qt-project.org/wiki/Using-QtWebKit-and-QML-with-PySideis
almost exactly what we want:
There is a Python backend with JS calling python objects and
vice versa using methods like: sendData(), receiveJSON() ...
But it doesn't seem to compile on our machines, and later we
found PySide development has stagnated and supports only
till Qt4.8,
whereas Qt5+ provides support for mobile/tablet development.
This blogpost details how some app developers used Python for
backend and QML for
UIhttp://blog.qt.digia.com/blog/2012/03/23/mixd-tv-leveraging-qt-quick-for-a-rich-desktop-ui-from-a-python-back-end/.
But its just descriptive, and doesn't give real information.
Kivi http://kivy.org/docs/guide/packaging-ios.html#:
Despite some niggles, it does seem to work but it doesn't seem
to have a way to develop a 'UIWebView' class based iOS app,
which we need
to use our html5 based UI.
Pythonista http://omz-software.com/pythonista/:
Same problem as Kivi above. We don't want to develop the mobile
app using Python, we just need a python backend for our html5
based webapp
iOS: We checked the native iOS development libraries also, but
couldn't find an easy way to embed a python backend logic
Android: ? Does anyone know if we could embed python into an
web-based app.
AJAX calls to Flask server:
This is the last option, that we are fairly confident about. Host
python logic on a Flask server and make AJAX calls from the webapp. But
given its for an application for kids, we might end up making
numerous AJAX
calls for same part-of-speech tagging
Any help/suggestions are most welcome.
Related
we have a setup with a Django backend serving our native iOS and Android clients.
We have a couple of functions that we have implemented on each platform (for offline support etc) that we would like to have in a common framework.
My question is, is there any nice way to build a shared codebase that can run on these three platforms?
The three environments use very different languages. You have Java on Android, Swift or ObjectiveC on iOS and Python on your backend.
You may be able to embed Python in your mobile apps, and have them run a Python script (that will be the same code as the one you have on your backend), but it's going to take a while to get this just right.
I would keep the code implemented three times, unless it's really really complicated.
Can Nativescript build apps for web as well?
As Ionicframework and similar uses Cordova to build Android and iOS the same code there can be served by an HTTP server to the mobile or desktop browsers.
Will that be possible with the apps built with Nativescript, using same code base for web version of the app?
Nowadays Angular integration is on the way, and using Angular for the mvc kind of things (like data bindings, events etc.) and using Native for the device apis, platform apis and native gui would help in an unequaled way.
Angular parts can be used in the browser as well when built for it. What to do with the xml written for the gui templates in Nativescript, they could be converted to proper html for web built of the app, as Nativescript itself already uses a unified gui api for different platforms, that could be possible. And lastly, native calls made in NativeScript would be ignored in the web build.
It would be great to build for Android, iOS, and Web with the same exact code base.
tl;dr: No
Longer: The big difference between the Cordova/Phonegap based technologies (such as Ionic and Supersonic) and the Dynamic Runtime based technologies (such as NativeScript, React Native and Titanium) is that the first uses a HTML approach where the application is run by WebKit/Blink in a WebView. Looking on the Dynamic Runtime technologies there's no HTML Engine running your app, but rather native views and widgets. The framework (in this case NativeScript) is "just" a bridge between Javascript and the native language of the device.
However, depending of how you architecture your code, you can create Javascript which will be usable in both a NativeScript environment as well as in a browser environment.
Edit: The above means that you could reuse some of your code. There'll still be NativeScript specific code.
Edit2: There's an ongoing project to enable usage of Angular 2 in NativeScript. Please see current status in the issue: https://github.com/NativeScript/NativeScript/issues/103 Also note that the Telerik NativeScript core developer Valentin Stoychev is saying
The idea [is] to enable as much code reuse as possible between your web and mobile apps.
So: Yes on code reuse - no on exact same codebase.
Adding to the (correct) response of Emil - I do not think it is possible to have any significant portion of the app shared (even for the logic part) since {N} apps mostly utilize the Nativscript observable implementation which would probably 'leak' into your models / view models.
Having said that, I suggest you to monitor the work happening on integrating Angular2, which would probably mean a larger code sharing potential (with Angular2 web apps)
We are building a mobile app for our website which is a kind of social network. So the functionality of mobile app will be close to the Facebook app.
We are targeting Android, BlackBerry and iOS.
We tried using phonegap and other HTML, javascript solutions, but the performance for these apps was very sluggish. It was no where close to what we expect.
We are now thinking of a middle path. The front end of each platform will be native. The backend which communicates between the server and the front end we will write in C++ . After some research I have found that, C++ code code can be consumed in different platforms in following ways
iOS: objective c has support to consume c++.
Android: using Android NDK toolkit
BlackBerry: BlackBerry provides a native sdk, not sure if it is what I need.
I have 3 questions:
Is it the right direction? Or there is some basic flaw?
Is there a serious time saving, by doing this? Or is it much faster to do the backend in the native?
Is there a noticeable difference in performance?
The APIs between Android and Objective-C are wildly different across the board. You will probably not be able to share communication APIs to any significant degree.
One out-there option is to standardise on Mono. Xamarin supports iOS and Android out of the box, and there's this thing called MonoBerry for Playbook and Blackberry 10. With Mono, I recommend that you standardise on SignalR for back-end communication. It's known to work on MonoTouch and Mono for Android, but you'll have to do some research for MonoBerry.
I don't know if you can get all the requisite pieces working together on all three platforms. There will almost certainly be a fair amount of bashing your head against brick walls initially. But if you do, you'll have a much more pleasant ride than with C++.
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 !
I have a regular web based application written using JSP, HTML, Javascript. Can I use some of the mobile development platforms to deploy it as a native app on either Apples's iOS iPhone or on Android platform?
The idea is to "develop once and run everywhere" - meaning, be able to deploy the same application on multiple platforms such as Web based application, iOS based app and Android based app.
While this would be great, I am unsure if this can be done. I understand that this may be accomplished if the front end part is written in HTML5, CSS3 and Javascript. However, it would be very cumbersome to write the application front-end only using these technologies without either Java or ASP .Net.
To a point: no.
Precisely, you might be able to get a servlet container running on an Android device, but you almost certainly won't be able to pull it off on an iOS device.
Actually writing a front-end application without using server side technologies isn't that difficult with JavaScript and HTML5. Rewriting an existing application is certainly a complex project though.
The currently popular "develop once, run anywhere" platforms for mobile devices are Apache Callout (previously PhoneGap) and Appcelerator Titanium.
Callout is based on making a thin Webkit shell as a native application, and then injecting interfaces towards the phone's features into the JavaScript context of that Webkit instance. It's easier to get into than Titanium, and it is completely free.
Titanium is also JavaScript based, but partially compiles your JavaScript code into native code which is then compiled by your native development stack for each platform. The upside is somewhat more responsive program. Some features require buying a license.
Having tested both during the last two weeks, I believe that depending on such solutions at this time amounts to technological suicide. Both of these systems are slow, buggy and even require licensing. Users will recognize apps made with them and generally reward you with poor ratings and reviews on markets.