how can meteor be coupled to an android app? - android

The meteor homepage (www.meteor.com) says in bullet point 8 ("interoperability"):
You can connect anything to Meteor, from native mobile apps to legacy
databases to Arduinos. Just implement the simple DDP protocol.
Question: Android is Java, how can it connect to meteor (js)? Any links to useful resources / tutorials would be appreciated!

DDP stands for Distributed Data Protocol and is specific for Meteor.
There is no built-in Android/Java support yet, but here is an official Meteor DDP client written in Python that you could use as a reference: https://github.com/meteor/meteor/tree/devel/examples/unfinished/python-ddp-client
More information:
https://stackoverflow.com/questions/10128430/documentation-or-code-details-on-meteors-ddp-pub-sub-protocol
How do I get a live stream of deltas from Meteor collection, for use outside of a webapp?

FYI, I wrote up a higher level Android DDP layer that takes care of client state including collection handling.
It's on github and includes Maven artifacts in Maven Central (my version of the java-ddp-client also is in Maven Central):
https://github.com/kenyee/android-ddp-client

Not sure why no one mentioned this, but there is a Java DDP client library:
https://github.com/kutrumbo/java-ddp-client
FYI, I've forked this and fleshed it out quite a bit. I started writing an Android app with it and found it missing a lot of stuff to get it to work properly:
https://github.com/kenyee/java-ddp-client
I also wrote up an Android layer over this to make things easier and will check it into Github as soon as I figure out how to get it to work w/ Gradle in Eclipse (can't get it to recognize the android-libraries plugin so none of the references to the Android library work)-:
I did write an Android app using all this stuff...look in the Play store for "Meteor.js Party" which matches Meteor's Parties sample.

Clients can communicate with Meteor through its DDP protocol (specs). Look at the list of independent DDP implementations for common platforms.

Related

Porting a Cordova plugin from Android to iOS

I am in the process of creating the iOS version of a hybrid Cordova app which uses one single in-house plugin. The plugin provides the app with a range of services.
an encrypted SQLite database via SQLCipher
geolocation tracking
watching for Wifi networks (not actually using them, I only care about their MAC ids)
asynchronous https POST to periodically transfer app status data to my servers. I originally used OKHTTP for this purpose but now rely solely on the native APIs provided by Android.
Websockets (I am using this implementation in Android largely because it is very well documented)
Android's CountDownTimer to reguarly update the app screen when it is in the foreground
The accelerometer sensor to keep track of linear acceleration changes and the number of steps since last reboot.
Storing some information in files
Mostly using Android SharedPreferences to keep track of the app state
I would rate myself as a fairly decent programmer and have coded in C/C#/Delphi/C++ at various times in the past though most of my current experience has been with Java/ES6 and PHP. I have taken a look at Cordova's instructions for creating iOS plugins. What surprises me slightly is that a good 3+ years after Swift was introduced the Cordova folk still say
An iOS plugin is implemented as an Objective-C class that extends the CDVPlugin class. For JavaScript's exec method's service parameter to map to an Objective-C class, each plugin class must be registered as a tag in the named application directory's config.xml file.
I have used Evothing's excellent guide to install the entire Cordova ecosystem on my Mac Mini and have tested out the "Echo" sample app in the Cordova documentation. Much to my surprise I was able to test the app on my local iOS device at just my second attempt. However, this is purely the result of copying and pasting the sample Cordova Echo app code. Much of the Objective C syntax makes little sense to me and I note that it appears to use pointers (lots of *s) from which I am inferring that there is no automated garbage collection.
My questions
Are there well documented iOS APIs for handling geolocation, wifi scanning, file i/o etc as I have listed above?
Am I obliged to do all of this in Objective C or is it now possible to create Cordova iOS plugins in Swift (which appears to have a flatter learning curve)
Is it possible to use Websockets in this environment? If so, is there a comprehensive native iOS implementation?
Are there any shortcut ways to convert my Android/Java plugin code for use on iOS?
Finally, in view of the capabilities that I need to port, are there any glaringly obvious gotchas that I need to be aware of before I start
I am assuming that the iOS webview is based on Safari and accepts most CSS3/HTML5/ES6 constructs so the process of porting the UI - which works without a hitch in the Android Webview which shares it codebase with Chrome.
I'd be much obliged to anyone who might be able to give me some pointers here.

Is it possible to build a native android-to-android video chat app using webrtc?

I see a lot of tutorials in the Internet teaching about android to browser or browser to browser webrtc application. Is it possible to build a native android-to-android video chat app using webrtc?
Well, for establishing a connection between the devices before the call via peer-to-peer WebRTC solution you need STUN/TURN/ICE servers.
They establish the route for communication between the devices.
Once the route is established the devices communicate directly without participation of a server for passing the media streams.
To make it easier for you, you can look at or try some existing solutions, like ConnectyCube.
They have peer-to-peer WebRTC solution for Android already implemented.
So, maybe there is not need to reinvent the wheel.
There is an official Android sample project AppRTCMobile provided here - https://webrtc.org/native-code/android/. However, the build process is tedious and the total download size exceeds 20 GB. The recommended way is to use the following dependency in your project.
implementation 'org.webrtc:google-webrtc:1.0.+'
However, for video chat functionality you will need to refer AppRTCMobile source code. There is a clone of this project on GitHub updated for Oreo and ready to import in Android Studio. Check out this link.
WebRTC uses ICE protocol for creating connection between two peers. It uses DTLS-SRTP for creating secure data exchange between peers.
Now both ICE protocol and DTLS-SRTP are protocols that can be implemented on any devices no matter what platform. You implement or use existing implementation of
ICE and DTLS-SRTP protocol on your android apps and communicate with each other.
When you read tutorials about implementation of WebRTC for communication between android app and browser, there the android app has the implementation of both ICE and DTLS-SRTP. So this android app can communicate with other android app having similar implementation.
in addition to #tahlil great answer, you can also use a number of open source SDKs out there that already took the burden on bundling the WebRTC libraries and offering simple APIs for you to integrate Real Time Communications in your native app. One example of such SDK is the RestComm Android SDK
See https://github.com/Mobicents/restcomm-android-sdk and http://www.telestax.com/restcomm-client-android-sdk-beta-2-is-out/

Opentok module for Titanium SDK that supports both Android and IOS?

I am developing a mobile application using Titanium SDK. This is my first mobile app. Most of the app is done successfully. The only module that remains is Video conference support. The company I am working in has chosen to use Opentok SDK. I finished the web application and it works fine. Now I've hit a wall in mobile app and can't move further. The problem is Opentok provides a module to use for Titanium, But it only supports build to IOS not Android. The reason we chose Titanium is for cross platform support.
Is there any module available to use or any other way to implement Opentok with Titanium that builds into both Android and IOS.
I have already tried using a WebView to open the conference module of web application. But bad luck, Opentok only works with chrome browser in mobile. But WebView utilizes native stock browser which does not support WEBRTC. So, opentok doesn't work with webview too.
Please help me. This is my first app and I am stuck at this point.
To Create a Module for OpenTok Android:
These are the steps I would follow.
Create a new Android module: titanium.py create --type=module --id=com.tokbox.ti.opentok --platform=android --name=opentok-titanium
Follow the installation instructions from OpenTok for Android. (Hint: I added a separate section down below to help you get through their instructions.)
Make sure the module runs: ant run.emulator or ant install.
Try running their sample, fully in JAVA, completely separate from Titanium. Make sure it works, and you know what it should look like. Then, figure out what exactly you need from their API. Or, if you're feeling ambitious, decide you want everything. Work to strip down the example to just the surface area that you need. Simplify it down to the least number of files you feel makes sense.
Write an example/app.js that demonstrates how you want the module to be used. For example, maybe you'd start off by requiring the module, then setting some API + Session keys, then calling some API, etc.
Based on the documentation, port what you need in to your module. Reference the Appcelerator Android module dev guide and open source Android modules for inspiration.
Write documentation for the module to specify what the various properties, methods, etc are, so that other developers can figure out how to use the module.
When you're done, submit a PR to OpenTok and revel in your creation and contribution.
Some Hints for Step 2:
.jar files go in lib/.
.so files go in platform/android/libs/armeabi/
Permissions go in timodule.xml, and you can see an example in the open source PayPal module for Android
OpenTok does not work with WebView. OpenTok support for Titanium Android does not currently exist because it is currently in beta and we don't currently have engineering bandwidth to build a Titanium Android integration. However, if you are familiar with Titanium, you are more than welcome to add the integration yourself and send a pull request. You can get the Android beta here and you can get titanium source code here
If you are in a hurry and open to trying other frameworks, our PhoneGap Plugin currently supports both android and ios.

Code generation for iOS and android

I'm searching for a framework to create apps for both Android and iOS from one codebase. I'm aware of Appcelarator and PhoneGap etc. However I need a different kind of product. I'm not sure if it exists. I can't find it here or on google.
We are a team of Android and iOS developers and aren't afraid to build natively. What I want is a tool to help me jumpstart development. Preferably a tool where I can create the basic UI and Models and generate native code to use as basis for further development.
Does such a tool exist?
Have you seen Mono??
iOS
Note: Make sure you following the instructions on the MonoTouch website re installation
Development tools (Free): XCode + Interface Builder (http://developer.apple.com/devcenter/ios)
MonoTouch ($399USD): http://monotouch.net/
Register for developer program/app store ($99USD): Register
Android
Note: Make sure you following the instructions on the MonoDroid website re installation
Development tools (Free): Java JDK, Android SDK
MonoDroid (public beta): monodroid-download
Register for developer program/market ($25USD): Register
Don’t forget for the iOS component you’re going to need to go buy a Mac to use.
Have a look at LiveCode 5 from RunRev.
http://www.runrev.com/
Have you checked out DAPP? I like it quite a bit.
http://dapp.kerofrog.com.au/
Yes you can Generate the code for both Android/ios and many more languages using the Tool Swagger
Please Check the tool,this tool gives the basic UI and Models and generate native code to just like your Requirement.
But You have to right the Swaggger Specification file(it will be on Json or Yaml) for that. And after Writing Swagger Specification file You can downlaod the code for Android/ios and other language as well. So kindly follow the document of swagger. You will get clear idea about that.
Here i list down usefull links of swagger :
https://swagger.io/
https://github.com/swagger-api/swagger-codegen
https://editor.swagger.io/
https://swagger.io/docs/
There's a tool called Genexus for Smart Devices, which is a code generator that supports iOS, Android, Blackberry and Windows 8.
However, you need to learn the tool, and I've found it useful only for simple CRUD apps. It does enable extremely fast development of said apps, it's a good fit for simple LOB apps. I've tried it and deployed to Android (haven't tested on iOS or other platforms).
http://www.genexus.com/SD/mobile-application-development?en
If you're experienced with iOS and Android, you'll probably get frustrated though (and I'm sure the code it generates isn't pretty).
I've used the generator for desktop and web .NET and Java, and works reasonably well (with those caveats), so I'm sure the Smart Devices generator will continue evolving.
Take a look at Flutter, from their docs:
Flutter transforms the app development process. Build, test, and deploy beautiful mobile, web, desktop, and embedded apps from a single codebase.

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