WebSockets for Android AND iOS Apps - android

Is there a project that provides libraries for communication over WebSocket for both Android and iOS? I know jWebSocket, but it is pretty much dead, and does not provide a lib for iOS. I know Autobahn, but it too supports only Android. I also know SocketRocket, but that is only for iOS. Is there something that supports both, or two solutions that are 100% compatible with WebSocket?
Thanks!

iOS uses ObjectiveC and Android Java, so there can't be a library that provides building the same unmodified user source code for both platforms for the platform's native language. You could have that (in principle) using C. And of course JavaScript.
Apart from that regarding the wire protocol AutobahnAndroid and SocketRocket should be absolutely compatible, since both use the AutobahnTestsuite to test protocol compliance.
Above is for pure WebSocket. If you want to use higher level features of i.e. Autobahn like the Publish & Subscribe and RPC messaging patterns provided by WAMP, we plan to have a iOS version of Autobahn that adds those .. on top of SocketRocket. No need to reinvent a mature, robust WebSocket implementation on iOS.
Disclaimer: I am creator of Autobahn/WAMP.

Related

Which Multi-platform app development framework is better for background service/synchronization on both Android and iOS?

I am looking for a Multi-platform mobile app development framework.
Key features i require are:
Support for Background Services for synchronization
Database support
Which frameworks are better suite for these?
My research comparing React Native and Xamarin so far says that react native used more often in industry and has more developer support available but officially they only have 'headless-js-android' for Android for running services. Xamarin on the other hand has the support for running services on both platforms.
I need some guidance from someone who has worked with both technologies.
Thanks.
The following is a list of multi-platform mobile apps development frameworks:
Adobe PhoneGap: https://phonegap.com/
Appcelerator Titanium: http://www.appcelerator.com
Sencha Touch: http://www.sencha.com/products/touch
Ionic: https://ionicframework.com/
Sinpalm: http://www.simpalm.com/services/sencha-touch-development-developer
Check them out and let me know which one got your attention.
This is an oversimplification on the way they work:
They allow you to create a user interface with HTML5 and JavaScript.
Then, via JavaScript injection, they provide you with a standard API framework.
This JS API framework is a common interface to both Android and iOS. Therefore, you only focus on coding against the JavaScript API framework. Behind the scenes, they have libraries that will execute this API in the respective device.
Most of them allow you to use the database and other features provided by the respective OS (Android/iOS). You only need to check which supports the feature you need better.

Is websocket is dedicated for browsers only

I am trying to program a native Objective-C and Native Android application using 3rd Party libraries. I have already chosen the libraries and I am already progressing in it.
One person in my team argues that the websocket currently implemented in concentration to web browsers, If we use this 3rd party libraries to implement the same from a native application it may not be stable.
He says maintaining a websocket connectivity from a native mobile application could be trivial, But webkit browsers already does that naturally, therefore we should think about creating a hybrod app.
Can anyone throw a comment on this?
Websockets can be used by any client (read: "app"), as long as the client implements the Websocket protocol - no browser (or hybrid) required.
For example, SocketRocket is an Objective C library that helps you implement Websockets in iOS native apps.
There's a nice article here about implementing Websockets in native iOS and Android apps.
I think that implementing Websockets without Webkit is a better way to go. Creating a Hybrid app can impact performance. If you're using only one feature (websockets), Webkit might be too heavy.
The only question is - are the libraries you are implementing mature enough?
Good Luck!

Use OData schema exposed by .NET in iOS and Android

Here is our case:
We exposed some POCO types using OData by ASP.NET Web api, mainly the schema of models. What we want to achieve is share these schema with iOS and Android clients. I am not familiar with both iOS and Android developments, isthere any methods let us develop just like normal .NET application style, add something like ServiceReference to the project, so that we can use those models? Or some other ways to allow make use of those stuffs.
We just focused on latest version of iOS (iOS 7 / iOS 8), and Android 4.4+. Any shared experience is welcome.
The following libraries are both for OData V4 only.
For iOS, there is the ODataCpp library owned by the same team who implements the ASP.NET Web API OData at Microsoft that you can try out. It's recently open sourced and will have its first binary release soon. It supports iOS as a target building platform and iOS apps can be built using it.
For Android, there is the Apache Olingo Java Client. It's still under development but according to the recent communications on developer mailing list, its first V4 client release will be very soon. You can have access to the source code on it's Git repository. It's been tested for building Android applications.
Also, while not a server side native application, a strong stop gap is the library Odata4js, which allows you to Prototype PlainObject Models, and use data-driven js libraries to manipulate/work with the data. Javascript would work on both platforms until official APIs release, and OData4Js works very well with other major releases such as Angular, jQuery, etc.

Developing a Java Cross platform library (mobile and web)

There are so many cross platform libraries that I am kinda lost to get an answer to a very basic java question.
I have a java library that works well on Android. It does not use any android specific functionality and also builds on the standard java sdk. This library uses sockets (plain simple Socket, ServerSocket kinda architecture) to communicate between the library and a server hosted (may be on a ec2 or some virtual public server).
Now my question is, can other developers import my java library (built using java sdk) to a application that uses html/css for User Interface, package all of this into a mobile application for iPhone (use native iPhone packaging, and a WebView to launch) ? Also can I ship this library so other software developers can build a web application to work on desktops and cross browser's ?
Some questions on stackoverflow are close to what I am looking for, but not quite there.
Developing Mobile Apps for Multiple Platforms (without a cross-platform framework!)
Will a webserver be able to use my library that connects to the server using sockets ?
And will every client that connects to this webserver create a new instance of my library ?
If you library doesn't use any dependencies on either Android or any other library, another developer can use it pretty much anywhere they want. Although keep in mind that platforms like EC2 may have a preferred way of using communication. (I'm no expert on EC2, so you'll have to see what they use.)
So I guess it's better to abstract out that socket functionality for good.
I don't think you can use a Java library in iPhone. iOS terms of use clearly states that you cannot use a compiler or interpreter on the device other than the one given in the SDK and the webkit javaScript engine in Safari. So there's no way your Java code is going to run on iPhone (without jail-breaking.)
I don't understand the question about webView. Do you mean navigating to a site that is powered by your library ? If yes, then yes as long as you keep it in the boundaries of Safari. (no Flash, no Java Applet .etc.)
Will a webserver be able to use my library that connects to the server
using sockets ?
For the most part, yes. But as I said, the platform may not allow raw connections, so it's good to abstract it out.
And will every client that connects to this webserver create a new
instance of my library ?
This depends on the design of your library and its public APIs.
Hope this helps.

Android reusing GWT RPC backend without AppEngine

I have been developing GWT application for a while and I'm trying to port my app to Android. I'm very new to Android but it seems that the ADT share many similarities with GWT so the learning curve might not be very steep.
There's what I read from GPE 2.4
Android and GWT clients that are capable of talking to the same App
Engine backend using the same RPC code and business logic.
It would be great to share the same backend which I spent a hell lot of effort in design and implementation. However, I'm not using AppEngine and impossible to switch to it either. I'm wondering if the Android app can still share the same RPC structure with GWT without using AppEngine. Thanks.
If you're still in need of a solution, check out GWT-SyncProxy (Disclaimer, I recently joined the project). I just put out a 0.4 release that has an Android Library that allows you to make GWT RPC calls from Android (or Java standalone apps using the regular library).
https://code.google.com/p/gwt-syncproxy/.
The library can utilize Android accounts if you do switch to GAE, but it's definitely not required.
You can try to use http-dispatch. It is the adapted gwt-dispatch framework which can be used on Android platform. Http-dispatch uses default binary serialization so it works from the box for many types of objects. Currently it is in alpha but you can try http://code.google.com/p/http-dispatch/

Categories

Resources