I'm familiar with SQLite from having worked with it using the System.Data.SQLite provider for .NET and also Adobe AIR using ActionScript. I've been asked to investigate what is involved in creating offline data-driven apps for mobile devices (iPhone+iPad and Android for now, maybe Blackberry). The database would have to be available locally on the device because users would often be in rural areas with very unreliable and spotty cellphone reception.
Will the same javascript codebase run unchanged on iDevices and Android devices? Or will separate versions be required for each mobile OS? I see the W3 has discontinued the standards process for local web SQL database(s) because there's only one SQL contender at present and it takes at least two to tango. Is the webkit javscript SQL API in a state of flux?
Hello Tim,
When developing database centric applications for Android and IPhone, you are not locked in to using Sqlite. There is another alternative, which in many cases might be even better; namely CouchDB.
In both cases there are solutions available which makes it easy to develop database centric applications for Android and IPhone using the same code.
CouchDB
CouchDB, although written in Erlang, is basically a JSON based database using javaScript as its default interface. CouchDB can be extremely fast. However, CouchDB is not a relational database.
License: Apache license, 2.0.
Official site: http://couchdb.apache.org/
CouchDB for Android: https://github.com/couchbase/Android-Couchbase
CouchDB for IPhone: http://www.macworld.com/article/159606/2011/05/couchbase.html
Sqlite
PhoneGap is the choice if you prefer working with Sqlite. Using PhoneGap you can use the same javaScript code for both IPhone and Android for communication with Sqlite, and simply replace the middleware to match the OS you are compiling.
For Android the middleware is phonegap-version.jar, whereas for IPhone the file is named phonegap-version.dmg.
In addition to Android and IPhone, PhoneGap makes it possible to port the same applications to Blackberry, WebOS, Symbian and Bada.
License: BSD/MIT.
Official site: http://www.phonegap.com
SQLite is the only option when developing HTML5 Web Apps (if I understood you correctly).
You can check information about IndexedDB, which is already implemented in WebKit (Chrome 12) as window.webkitIndexedDB and also Firefox has implemented it.
Related
I'm wondering it's possible to identify android device by web app running on mobile web browser? And this solution have to still working after change or upgrade web browser on this phone.
My second doubt is web app can working offline on phone showing PDF presentations saved in local storage (disk). When I have internet connection I can manually sync presentations (some are removed and some are downloaded).
If PWA app can work like I described above or in this case we need to use (hybrid) mobile app ?
PWAs allow to cache assets and make them available to the users even when they are offline. There are some functionalities that only Native Apps have (eg. access to a device contacts), but they are very close under many other aspects.
I wrote an article about Service Workers and caching strategies where I explain how to cache static assets as well as HTTP GET calls. It is part of a series about PWAs, so you might find it useful to get more insights about this technology.
Have a look at the website what web can do today to have a list of WEB APIs currently available:
I do not know the detail of your requirements, but maybe you do not even need to implement an hybrid app and simply create a PWA.
I'm currently developing an app (via Intel XDK) that reads a .csv file that was created by another app (via Android Studio). The Android Studio app is mainly for capturing sensor data, whereas the Intel XDK app should display the data fancily. Since saving everything as .csv and reading it all later on is incredibly naive performance and storage-wise, I was thinking about creating a database that manages the data. Now, setting up a database for each app seems easy enough, and there are also solutions for two Android Studio apps. But how can I create and manage a database that can be used by an Android Studio as well as by an Intel XDK app?
OK, I think you want to have your Native Android Database to be accessible from another Application so your solution will be ContentProviders.
You should build a ContentProvider layer above your SQLite database in the native android application then you can easily contact the ContentProvider from any other application included PhoneGap or any cross platform one.
To learn more about ContentProviders in android check that.
To learn how to expose or use ContentProvider from CrossPlatform phonegapp applications check that.
You can use the Content Provider mechanism of Android, as described in http://developer.android.com/guide/topics/providers/content-providers.html.
You decide on one of the two apps to actually manage the database and play the role of content provider to the other. The other accesses the data via the interface provided by the content provider.
This works if both apps are on the same device. For cross-device synchronization of data look at Couchbase Lite, a database that offers this feature out-of-the-box.
In the last year I got to know that many developers started developing desktop applications that run on the web browser.
I am also trying to get into it and I'm trying to understand how I should start with such kind of development.
I first thought I should create a regular client-server application, i.e. with Apache Tomcat or with PHP, and for each launch of an application, to launch a new server on localhost and to open a browser that will load the application.
I've lately got to know that there are packages that do the server-client work for you, such as node-webkit.
I don't know where to start and I'm very confused...
When developers say that they develop desktop applications in Javascript or such that run on web browser - do they probably mean that the use node-webkit? Or does they do the complex structure I described above (JSP/PHP server on localhost) ?
Many development models with web technologies exist, but they have different purposes and it all depends on what you want to do.
You seem to be mixing 3 models
Classic websites
A server (with PHP, Java or whatever) generates HTML.
A user uses a browser to access it.
When the user clicks somewhere, the server is called again and generates another HTML file.
Single Page Applications
This model is often used when writing websites that need a lot of interactivity. For example Gmail, or Google docs are SPAs (more or less).
SPAs are websites (you can access them at an URL) where all templating is done client side, and the webserver only exposes a HTTP API.
Most of the times, people use frameworks to make those like:
AngularJS
React
Backbone
Desktop apps with web technologies
That's just coding an application that you can install on a computer or phone with web technologies (javascript, css, html).
There is no server.
Tools that enable programmers to do this are
Node webkit (for desktops)
Cordova (for phones)
Many others
Most of the time, programmers also use SPA tools in conjonction with those to help them during development
The selection of technologies for building an application depends on the use of your application and the platform you want it to run on.
Web applications in contrast to Desktop applications are hosted and served by servers (like Tomcat) which are then requested and present to you by your browser.
Desktop applications are running on your local machine and they are independent from your browser. However node webkit, allows you to design applications using HTML and making them dynamic using node. The end result is a standalone application that runs as a browser emulation that is able to render and run software based on HTML and javascript. (In this case nodejs serves the application locally and the standalone web-app is the client).
Long story short node-webkit emulates the client-server model that is used for classic web apps, to build desktop applications.
It is an unorthodox way for doing things IMHO, but it might be a good start for getting into application development.
Try this-
https://electronjs.org/
Build cross platform desktop apps with JavaScript, HTML, and CSS. With Electron, creating a desktop application for your company or idea is easy. Initially developed for GitHub's Atom editor, Electron has since been used to create applications by companies like Microsoft, Facebook, Slack, and Docker.
I have a Tomcat based server which serves as a Websocket end point (used javax.websocket) for my web based JS app. I am serving out json based data (queried from my database) via the web sockets. I am not using websockets to serve out HTML/JS pages.
Now we are building a native mobile app of our JS web app. There doesnt seem to be good native support for Websockets on Android and ios.
I would like to keep the server code base common to both JS client and the mobile client.
What would be your suggestion for such a situation? Write a different server for mobile clients?
I found this http://www.elabs.se/blog/66-using-websockets-in-native-ios-and-android-apps. They suggest SocketRocket for ios and https://github.com/TooTallNate/Java-WebSocket for Android.
I have never heard of these people / companies. Not sure of their antecedents and if their apps are bug free.
Any suggestions would be welcome.
I'm not sure if this is the answer you are looking for, but I tried this once, and decided to use a webpage that uses the websocket. Each app will display a webview accessing the page. All recent iOS SDK versions support this, but only the newer (4.4+) Androids will.
If you do not want to use webviews, I recommend Tavendo Autobahn for Android. I had a problem that my server's websocket would disconnect all the time. I had to implement a reconnection routine every couple of seconds on the app.
Hope it helps :)
I'm using this library on android for websockets https://github.com/codebutler/android-websockets
Works good with Spring WebSockets.
Sorry for messy answer, I'm in hurry, write in comments if u have questions
We offer a client-server product that runs on Windows Server (2008 R2) and SQL Server (2008 R2).
Our server is implemented via .NET 4.0 and C#.
We're looking to develop a new application that in the background will read and write from the server & DB.
The application should run on desktop, laptops, iOS devices, Android devices and Black Berry devices.
The application is targeted for a technical use (operators, technicians, installers) so rich UI is not a must at all.
What would be the best frameworks & platforms to use o achieve such an application (server side, js library, ui, etc.)
Thanks,
Janiv Ratson.
If you can do it with a web app that would be my first choice. The reason is that the web app will run on all devices.
If web app is not possible for some reason you should go with native, .NET would probably be a good choice, it covers windows, Linux and Mac (via mono) and also you can use mono touch and mono for android to port it to iphone and android.
Since you already work with .NET on Windows, you could cover desktops, laptops with .NET or Mono. Porting to iOS and Android with MonoTouch should not be too difficult especially if you don't have elaborate UI. I have no idea about BlackBerry though.