Current support status of WebRTC in Codename One and AntMedia usage - codenameone

Is there any information, updates, or documentation regarding Codename One's WebRTC support? There was a mention of it months ago in this comment on Stack Overflow (AntMedia Native Interface issues), but then I haven't heard anything more about it.
For the time being, I'm supporting live streaming on AntMedia via native interfaces that do live streaming with RMTP, as on my own I couldn't find a way to support WebRTC in Codename One. Unfortunately I realized just today that the RMTP support on Android doesn't work anymore (I don't know why, in the past months it worked)... anyway I've always considered RMTP as a temporary workaround, maybe this trouble is a good opportunity to switch to WebRTC.
I've seen that Steve has quietly created this cn1lib, which has not been announced (maybe because the work is not yet finished?) nor is it present among the extensions that can be installed via Codename One's Control Center:
https://github.com/shannah/CN1WebRTC
I found the documentation here:
https://shannah.github.io/CN1WebRTC/javadoc/
but comparing this javadoc with the documentation provided by AntMedia I just don't understand what I have to do, as AntMedia provides its own SDKs for Android and iOS, provides documentation to use them, but I don't understand how I can use in their place the cn1lib made by Steve. Obviously porting their SDKs is not easy, otherwise I would have already done it as the first option. In any case, the AntMedia server should be independent from the SDKs used, as it should use standard protocols, if I understand correctly.
Specifically, I have a server running AntMedia Enterprise Edition 2.1.0, whose documentation on WebRTC support is here:
https://github.com/ant-media/Ant-Media-Server/wiki
Thank you

I haven't used AntMedia Server, so my following comment is based on 10 minutes looking through their documentation.
It looks like they provide their own API that is distinct from the standard WebRTC APIs. The Codename One WebRTC lib is built on the standard WebRTC APIs. I think that the best route, if you want to use AntMediaServer's APIs is to create native interface wrappers for it.
It is also possible and likely that you can just use the Ant Media Server and then use the standard WebRTC API to connect to it. If this is the case, then you would be able to use the cn1lib with it. However, their documentation only seems to show how to use their custom API for the client.

Related

Native integration of codenamone

Is there a way to integrate codenameone component in a native activity/fragment?.
The idea is having a codenameone library, that we use its native compilation as a library in an existing native project?
Many thanks for the reply
Maybe but probably not.
Codename One was very much designed to take over. The reason is that cross platform embedding is really difficult as the OSs have a very different concept of application embedding and lifecycle.
You can embed a native widget into Codename One "easily" but that's probably not enough.
Since in Android everything is an activity you might be able to hack something by packaging two apps into one APK and moving back and forth with the Codename One app. I wouldn't recommend it since we make a lot of assumptions and this might not work. You won't be able to do the same on other platforms either.
One strategy some developers took is to have two distinct apps that communicate between them via the cloud or via app URI calls (or both). This is a workable cross platform approach but it's also a bit painful and it isn't seamless to the user.

How to include using Smartwatches in an app written with Codename One?

My company recently came up with an idea to include using smartwatches with the app I wrote using codename one.
Is this possible? If yes, which libraries do I need?
We are evaluating the possibility of smartwatch support, this depends on customer demand.
We currently have a major enterprise prospect that has expressed interest in this but hasn't signed up. If your company is serious about this please contact us directly.
Assuming we don't go that route or you need something immediately this depends on your supported platform, you would need to use native interfaces for most functionality. In Android notifications (which we support) should work for Android wear. In iOS we are transitioning to the new xcode 7.x which should support smartwatches too but I'm not sure what would need doing.

How to enhance a class in Codename One API

I'm looking to add functionality to the built in Java SDK classes beyond the CLDC 1.1 standard which is where the API seems to be compatible with. Specifically looking to implement StringBuffer#replace(...)
What is the best way to go about this?
Thanks
cldc1.1 is a very old standard. Codename One supports far more than what that standard had but retained the filename due to legacy issues.
There is a guide on how to use the Codename One source and contribute it back to the git repository: http://codenameone.com/blog/how-to-use-the-codename-one-sources.html
However, the main issue is the need to fix this for all OS's which is pretty challenging.
To just fix the stubs for the method to appear to compile you can change the project here. However, this will only work for targets where the method is already there (Android, JavaSE etc.).
You will then need to make sure there is an implementation for all other targets:
For Windows you will need to fix the ikvm target and fork, for iOS you will need to fix the code in the JavaAPI directory under the VM directory for JavaScript you will need to contribute your changes to TeaVM if required.
For older platforms you will need to implement your changes into the retroweaver support although this might not be as relevant.

Create a library with codenameone to use on iOs and android

I was wondering if it is possible to create a library with codenameone that can be used in a native iOs/Android/... App. This library should contain the business-logic and the rest of the app should be implemented native.
Is thought this isn't possible, but the technical advisor of a client insists that this is possible.
I misread the original question, you are correct its impossible to do this and impractical to do this since the size of the library will be too big. If you want to create a library for iOS with Java the best approach would probably be J2Obj-C which was designed specifically for that purpose: https://code.google.com/p/j2objc/
Originally I had referenced these which allow you to create library projects for use with Codename One which might be the source of the confusion:
http://www.codenameone.com/3/post/2013/07/jaring-and-libraries.html
http://www.codenameone.com/cn1libs.html

Toolkit options to write a crossplatform mobile app in 2012?

I'm currently investigating the alternatives for crossplatform development for Android and iPhone (Windows 8 could be a nice addition). The app is basically a "map with an asociated app", and certainly not a game.
Searching here I see many outdated advice and tools from 2010/2011, but since then Apple has changed their policies and surely new things have appeared.
My current list and light research (might have facts wrong) is:
Monotouch/Monodroid: .NET (Mono) framework. Create "native" apps on both platforms. Requires rebuilding UI code (or similar things).
Appcelerator: Javascript framework to compile native apps.
Corona: Similar to Appcelerator.
Phonegap: Similar idea, but looks like it uses a wrapper to appify HTML5 content
SenchaTouch: Another HTML5 based platform.
Wink: Yet another HTML5 toolkit.
XVLM: Android to ObjC compiler, probably creating ugly iOS apps.
Unity3D: For games only.
Moai: For games only.
So, there are three main ideas, with some frameworks implementing each, it seems to me:
Have an abstraction layer over native iOS/Android code and build for each platform using the provided layer. (Monotouch, Unity3D)
Use HTML5 (coding in Javascript) and some kind of wrapper to "appify" the web content. (PhoneGap,Sencha,Wink)
Code using a framework that will output as a compilation pass (or similar) a native app for each supported platform (Moai, XVLM,Appcelerator,Corona)
The questions:
Is there a fourth idea I haven't yet found?
Is there any blatant mistake in my research for any of the specified frameworks?
Is there any known problem for map integration with any of these ideas or specific frameworks?
Only a partial answer:
Ad 2. Appcelerator / Titanium is more than just HTML5. I read this pretty extensive comparison between PhoneGap and Titanium the other day on Hackers News. I found it very informative. The link points to the HN comments, the link to the actual article is at the top.
My main experience is with Mono for Android and MonoTouch, so I can't personally speak much to the other options. I personally find it to be the best option there is, as it allows you to share a large amount of your code across the platforms (even extending to non-mobile platforms if you stick with .NET), while still allowing for a 100% native UI, which is extremely important. If you're looking for resources on getting started, I have this video which discusses approaches and libraries for sharing a lot of code across platforms, and also this book which covers the same thing, but also expands to talk about how to do things like store data, use maps, access the network, etc.
I also want to mention MonoGame, which is absent from your list. MonoGame is an open source XNA implementation that sits on top of Mono to allow you to target iOS/Android/Max OS X.
From what I have experienced, if you want to have a native app go Mono, if you don't need native go PhoneGap. Native is best of the UI is very important, ie games or fairly graphical apps. But from business type app, CRUD, Phone gap works well.

Resources