Is there a library that provides API compatible to java/android networking in codenameone? - codenameone

I am building apps to connect to realtime and streaming services like PubNub, Ably, deep stream.io and XMPP. I am having to port java/android SDKs and the big issue is always around threads and networking. IS there plan to support the JAVA/Android API for network and threads or is there a library providing that? I do not have the skills or time to do that.

PubNub has a port to Codename One that's a bit outdated by now. There is support for the URL API but nothing lower level than that as it won't be doable (correctly) on iOS.
I would suggest working with websockets which are very portable and easy to work with: https://www.codenameone.com/blog/introducing-codename-one-websocket-support.html

Related

How can I upgrade the version of TLS on an application running in app engine to > 1.2

I am running an Angular app inside app engine. Recently this application was PEN tested and one of the issues that came up was around TLS1.0 and TLS 1.1 in use.
The recommendation from these results are to disable all TLS protocols before TLS1.2. Only use cipher suites considered cryptographically strong.
The application presently doesnt have a custom domain and is purely hosted on .appspot.com
How do I achieve this? Would I need to use a custom domain for this? I've tried read around but feel a little out of my comfort zone with this.
Thanks
To achieve that you should contact directly GCP's Support Team.
Bear in mind that this is not supported within the free trial support package.
If you don't have a Support Plan, upgrading to the Development plan with only 1 user would be enough to open a support case and request TLS changes for the needed domains.

Hacking Chrome speech-to-text API to use my own service

Is it possible to hack the Chrome (more precisely the Webkit's), through an extension, in order to use my own media server instead of Google's one?
It's needed to make realtime voice interactive app and I'm looking to an alternatives instead of doing this in flash or a Java Applet.
I found (for my projects) that using VideoIO.swf and RTMPLite is far easier and more portable solution.

Apache with Comet Support

I'd like to build a multiplayer web game application in which it supports chat. I presume the application will have to handle hundreds of simultaneous connections.
I'm planning to host my application in a shared web hosting, which has these limitations (most likely similar to PHP + Comet (long-polling) scaling / hosts):
It does not seem I can change the web server. Most likely it's using Apache.
Supports MySQL 5, PHP 5.3.x, Perl, Python, Ruby on Rails, CGI
(To be more precise, I'll be using HawkHost's shared web hosting.)
And here are my result of research, followed by my questions:
Some resources (like Python Comet Server) say that PHP is not good for handling concurrent connections, while Python is better choice. Is this true?
I've tried the long polling technique in PHP (although I don't know whether it's correctly implemented or not, like Comet issue with abandoned open connections) using "Loop endlessly until the data changes." method. This almost works. The remaining problem is that the server process never dies when the browser is closed (the server does not know that the connection has been terminated, and the data never changes). Is there any way the PHP can detect whether the browser has been terminated so that it stops the loop?
I've been looking everywhere to look for answers but still I can't conclude anything. This topic has also been asked on StackOverflow so many times, I'm sorry if I may sound repeating >.<.
Currently I am able to code using PHP, MySQL, and JQuery for JS. I'm still new to the term Comet and Server Push. If necessary, I'm also willing to learn new scripting language like Python.
I appreciate any insights of what scripting language, framework, and techniques to use to start my project.
When you have a shared hosting environment and there are a number of restrictions enforced then it's a good idea to outsource the realtime functionality. I would say this since I work for one such company, Pusher. But I hope others will back me up on this.
When using a hosted solution you can push a notification by making a HTTP request to a RESTful API. The service will then deliver the message to the connected Web Client (browser). The browser does need to include a script tag or use a library that also connects to the hosted service.
The main benefits are:
No installation or maintenance
No need to handle persistent connections - no resource usage
Really simple usage: Script tag in app and call REST API
The hosted solution handles scaling
Also, here's a list of hosted realtime solutions.
So you can use Python. Then you can use Tornado. (psst... facebook uses it)
And I had same problem with open connections. Just don't spend time for search solution in PHP - later you will be sorry. I was. Just use what is made for Comet. If you more prefere JAVA, then there is: CometD.
And for game get a normal hosting. They cheap this days.

What sort of programming environment is the Pyxis/Verivo Mobile system?

I just heard that a company I do work for may be bringing in the Pyxis Mobile application development system. When I google it most of what I find is from the company's web site and that is not very informative from a geek perspective. Can any one shed some light on what sort of programming environment it is and what programing language is involved (please let there be a text based language). Any additional information would be great.
Note: the company/product changed their name to Verivo in January.
Full Disclosure - I work as an engineer at Pyxis Mobile. However, I have been in the mobile space for 7+ years and have evaluated several approaches to mobile so hopefully this is helpful.
Pyxis Mobile provides a set of tools and components to build cross platform mobile applications. Let me outline them first.
1. Application Studio - All application development, backend integration, user provisioning and application maintenance/debugging is done w/in this tool. Application Studio (for now) is a Windows based desktop app.
2. Application Clients - Pyxis Mobile provides native client runtimes for iPhone, iPad, BlackBerry, and Android devices. These runtimes get branded for the customer through a build service and are primed to point to a specific Application Server URL.
3. Application Server - Pyxis Mobile App Server runs on the .NET stack (on IIS). All client communication is proxied via this server. This server is able to connect to varied of backend systems (via the Plugin Framework listed below) and respond to the client in a mobile optimized manner. This server needs a SQL Server (2005 or newer) for configuration access, session management, logging and more.
4. Plugin Framework - The Plugin Framework is a backend component that provides system specific pre-built access to several of the enterprise and cloud based systems (Oracle, Siebel, SAP, Salesforce.com, social feeds, REST/SOAP web services, etc.) and also offers an API layer in .NET and Python (using IronPython) to allow even further customization. A plugin is essentially comprised of one or more DLLs or a Python file. These assets are then dynamically loaded to normalize communication between Pyxis Mobile and the customers' backend systems.
5. Push Services - This provides a cross-platform push layer that can poll a backend system for change and alert a mobile device via BlackBerry Push, Apple Push Notification Services (APNS) or Android's Cloud to Deice Messaging (C2DM).
6. OverWatch Analytics - This is an optional (but included) component to track users/devices and provide integrated analytics on what the users are using and what kind of devices and locales makes up your users.
The application itself is "coded" via configuration that is build in App Studio. Pyxis Mobile abstracts away from the code so that you can work at a higher level without having to worry about the wide array of device variances (GPS, touch screens, camera, accelerometer, push, screen resolution, etc.). You can drag fields onto a from, connect screens via menus or buttons, set up caching rules and more in this graphical utility. This configuration (essentially think of an XML like document) is interpreted by the native client layer to produce a rich application. There is also a scripting layer in Lua that allows to really customize behavior via code.
The real value of Pyxis Mobile comes up when you have change to make. The clients check for new configuration at app startup or if the server forces the client to get new configuration. This gives you great agility. Lets say once your application is deployed you want start using the swipe gesture to go next/prev through a set of records. This change on other platforms would mean writing some platform specific code to trap and interpret the swipe to perform a navigation (you couldn't trap a swipe on a non-touch screen). However, in Pyxis Mobile this is a simple configuration change that can be quickly deployed to the App Server and the clients automatically download and use the new configuration. No compilation, no redeployment or re-download for the end users.
I could keep going, but hope this provides some level of guidance.
Beware of Pyxis Mobile. While many of the things they say do work, there are some serious platform issues (as a geek) which I've experienced.
1) No version control system process. The Application studio can basically only be developed on by one person at a time or you risk having your changes overwritten by a fellow developer. The "principle of last save" is very much in play.
2) No unit test coverage. This isn't the biggest issue for a lot of people, but it's a concern for anyone who wants to work in the Enterprise world.
3) The middleware server gets you some value, but it's also a PITA to work with. There is no concept of "client side storage" unless you consider the middleware server the client side. If your phone goes out of coverage, your app won't work. Again, this might not be an issue for you.
4) The application has no true scripting language to work with. The middleware server allows you to intercept requests and responses and modify what you're doing there, but it's not the most elegant solution considering that a native application can have something as simple as "if this then X else Y." This can be accomplished with Pyxis, but the whole process is convoluted and more complicated than one would think it needs to be.
5) Lack of documentation. There's some training guides and the GUI is easy enough to get around for simple apps; however, when you need to do something with guts, you're left relying on Pyxis professional services. There's really no developer community to pose questions to.
I have more complaints, but they are more opinion oriented than Q/A oriented.
I just got note about the most recent comments. I don't want to turn this into a thread of back and forth, but did want to throw a couple of quick notes.
Regarding the points on version control and documentation/developer community - no big contest there. We are definitely working on these shortcommings. We have some basic pieces in place, but we have big plans to focus on this.
Regarding unit testing - we provide a very open interface to our middleware and backend components and they can be very easily unit tested with a bit of instrumentation. We run a ton of unit and integration tests internally. However, mobile unit testing is extremely difficult to get right. We'll investigate this further.
Regarding #4 around middleware and offline capabilities - things are a lot different now. With version 7.1, 7.2 and 7.3 our products have increasing become more capabale offline and now features a secure local database if necessary. I can provide more details as necessary, but you can certainly login and operate the app even if you are out of coverage for weeks at a time!
Regarding #5, we've had a scripting engine for over 2 years. Its Lua based and its actually quite powerful and fast. It was BlackBerry only till the most recent release. Given Apple's change of stance on allowing scripting we now allow scripting on BlackBerry, iPad, iPhone and Android as well now!
#RockMeetHardplace - feel free to reach out to me directly and I'll be happy to give you more detailed live demos of our latest platform. I am at - arunSPAMNOTatpyxismobiledotcom (drop the "SPAMNOT" and replace the at and dot). I happen to be the Director of Software and interested in knowing more about the issues you had.

How can I run a WebSocket server on top of GAE?

How can I run a WebSocket server on top of Google App Engine? Is it possible? Will it be possible?
Is it possible?
No.
You can't right now because GAE doesn't allow generic inbound socket connections. Each request is also limited to 30 seconds but this could easily be worked around with automatic reconnection and session tracking.
Will it be possible?
Probably.
Google has been one of the biggest (main) promoters of the WebSockets standard. I would be surprised if they don't push support for it into GAE at some point in the future. Note that the WebSockets draft standard is still in flux so Google might be hesitant to add support before the standard is more solid.
Here is the bug for WebSockets support on GAE: http://code.google.com/p/googleappengine/issues/detail?id=2535
Note that a google employee indicates it's not on the roadmap but that they know it would be useful. That's about as positive an answer as you get from google about features that have not been announced. I recommend adding your voice to that bug in favor of WebSocket support. It can't hurt.
Also, depending on your application, you may consider the Channel API which will likely have GAE support soon:
http://googleappengine.blogspot.com/2010/05/app-engine-at-google-io-2010.html
http://bitshaq.com/2010/09/01/sneak-peak-gae-channel-api/
EDIT (2015): the Channels API is available now (it has been for a while).
All of these answers are out of date.
The Channel API has been deprecated. Google strongly recommends you use Firebase.
It is also worth noting, that Google has now released the flexible environment.
With the flexible environment, you could easily allow socket connections, or use Python 3.
It's officially supported now.
See https://cloud.google.com/appengine/docs/python/channel/
EDIT: the Channel API is supported, not WebSockets. The Channel API is built on WebSockets, but it doesn't give you direct access to the WebSocket. I suppose it's good enough for typical Web apps.
As of January 9, 2019 it is officially in Beta now - but only for App Engine flexible. For example, see the Python documentation. According to the issue tracker, it will work with any language, though.
You can't.
GAE limits HTTP requests to 30 seconds, WebSockets expect to have connection open for a long time.
Will it be possible? Only Google knows this.
A couple people have gotten websockets working with GAE with the help of another server... checkout http://code.google.com/p/typhoonae/wiki/WebSockets
There's also this: https://cloud.google.com/appengine/docs/go/sockets/
It's experimental and very low level though.
Google App Engine has recently launched support for Websockets on App Engine Flexible Environment. You can take a look at their blog post.
https://cloud.google.com/blog/products/application-development/introducing-websockets-support-for-app-engine-flexible-environment
June 2019
Websocket support for GAE is now supported under SLA for Flex.
Hi everyone, I'm happy to announce that Websockets support
for Flex is now Generally Available! We've made no changes since Beta
but Websockets traffic is now subject to our SLA.
We've also published documentation for this feature for all App Engine Flex languages.
See https://issuetracker.google.com/issues/35886348#comment285
Hope helps, but seems to be supported now. 2021
[https://cloud.google.com/appengine/docs/flexible/java/using-websockets-and-session-affinity][1]

Resources