Is packaged apps preferable over C++ for creating a cross-platform serial read/write application to communicate with my mbed electronics project? - c++

I would like to create a cross-platform serial read/write application to communicate with my mbed electronics project. I cannot decide whether to code this application in Chrome packed app or c++(using the openFrameworks framework). I have more experience coding in html and javascript than I do in c++, but I wouldn't mind learning c++. What drew me to the packed app idea was the ability to write code in html and javascript. Eventually my project will be open-sourced. What are some of the pros and cons of using packaged apps versus c++?

C++ can be used to do chip level programming and to manipulate the chips that require lot of coding in order to implement the functionality of your desire.
Packaged apps deliver an experience as capable as a native app, but as safe as a web page. Just like web apps, packaged apps are written in HTML5, JavaScript, and CSS. But packaged apps look and behave like native apps, and they have native-like capabilities that are much more powerful than those available to web apps.
Packaged apps would be a modern concept and it would be a better option because it gives more importance to your project when the reviewers of your project find that you are using a new concept.

I'm working-on in one app that I need for setting-up embedded devices, the app must be cross plattform because it will be used in Windows, OSX and Linux.
I'm developing it in java using RXTX library that is tested and work fine in the three plattforms.

Related

How to build a cross-platform mobile application using common C++ Business Logic and Data Access Layers

We are trying to create an Application for all mobile platforms (Android, iPhone, Windows phone). We will build the User Interface using the native development languanges for each platform (Java, Objective C, C#). For the intermediate layers (DataAccess Layer and Business Logic Layer) we plan to use C++ for all platforms.
We are going to use libraries like Curl, sqlite3, libzib. So I think a good solution would be to create two seperate C++ projects (DataAccess and Business Logic) and make references to those libraries we need. First we are going to start with Android, so I will include those two projects as prebuilt static libraries using Android NDK and in the jni folder I will add some methods that they will communicate between UI and Business Logic. Later we will do the same for the other two platforms. Since I am very new to C++ I would like to make the following questions:
Do you think that this theoretically will work?
What problems are we going to face (e.g debugging, using Curl in different operating systems)?
Are there any open source mobile projects using the same approach?
Do you think that this theoretically will work?
Yes, I've written and app for Android and iOS that uses a data access layer written in C++ on both platforms. I wrote the Android edition and a colleague wrote the iOS edition. It is not open source, so I can't show you the code.
What problems are we going to face (e.g debugging, using Curl in different operating systems)?
Debugging the shared C++ code can be a pain in the ass on Android. I've never gotten the debugger for work on Windows. I normally resort to careful reading of my code and printing messages to LogCat if it is not something I can reproduce and debug on iOS. Normally this only affects the JNI layer that links the C++ business logic and the native UI code.
You'll probably have to build 3rd party libraries separately for platform. Curl has instructions for building it for each platform so that shouldn't be much trouble.
Apart from learning JNI, the biggest problem I had was that the app had to look the same (or very similar) on each platform. I'd recommend looking into Qt Mobile Edition as
πάντα ῥεῖ suggested, however it doesn't currently support Windows phone. Still, you would be able to write one UI for two of your three platforms at least - and your shared business code would still be reusable. We are in the process of starting a second app and Qt is definitely looking like the best option for us. I don't think we'd want to repeat the experience of trying to provide the same functionality on two platforms using very different APIs.
Are there any open source mobile projects using the same approach?
I'm not aware of any off-hand, but I'm sure you can Google it.

Link C++ library to html front end

I do computational research with a C++/CUDA library that does intensive number crunching. Recently I was thinking to set up a little showcase of my library on my webpage where people could work interactively with the library and see the results (plots, animations, etc.) in real time.
I have very limited html and website creating expertise. Are there libraries out there to link the html front-end to the C++/CUDA back-end? I'm developing in Linux environment but obviously I'd like my webpage to be accessed by anyone independent of their OS and/or browser.
So after a little bit of research I found the Wt library which is written in C++ and used for webpage development. Based on the information on their homepage, it seems to be exactly what I'm looking for:
Typical use scenarios:
High performance, complex web applications which are fully personalized (and thus cannot benefit from caching), fully Ajax enabled and at the same time entirely accessible and Search Engine Optimized.
Web-based GUIs for embedded systems benefit from the low footprint of a C++ web application server.
Web-based GUIs that require integration with (existing) C++ libraries, for example for scientific or engineering applications, or existing C++ desktop applications
I did something like this. To do this, I used a simple library I wrote called jrb_node at https://github.com/kennethho/jrb_node
There are other libraries like cppnetlib http://cpp-netlib.org/
Basically you make a small http server that based on the request will perform some computation and return the results as an http response. You can then combine that with javascript and Ajax if you want to make it more interactive.
An alternative to consider is to use WebCL. CUDA is pretty similar to OpenCL and it should be pretty easy to convert your code to the latter. If you have other C++ code, that might be a bit of problem though.
Do you want to run CUDA on server (e.g. the users will input the parameters, push a button and your server will do number crunching) or on client (e.g. it will be user GPU that does computations)?
For server-side you should be able to use pretty much any server technology - PHP, JSP, etc. They all provide a way to integrate to "native code".
For client-side you will not be able to do with just HTML - you need to use some "fat client" technology - e.g. ActiveX, Java applet. I do not know if Silverlight or Flash have access to native code. IMHO, you might as well just write a Qt application and put a download link on your site.

Most lightweight way to host a html/css/js UI?

I'm writing a pure Win32 application in MSVC 2012 using C++. After lots of struggling with trying to theme native win32 (I don't want to use .NET) I wouldn't mind seeing if I can do it much easier by having the application frontend rendered from HTML/CSS (which is easy to theme).
What lightweight libraries are there available for C++ that would let me have a web styled frontend on my desktop application, while seamlessly giving the user the impression that they aren't looking at a webpage?
Maybe something like http://www.terrainformatica.com/htmlayout/ could help you out.

Porting my C++ app to run in a browser

Is there an easy way to port a C++ OpenGL app to a browser? It's already ported to PC, Mac and iOS. If there is some relatively easy way, would that be portable between computer browsers? I would have to use different binaries for different platforms, of course. I remember hearing something about some sandboxed environment for Chrome some time ago, but that would exclude the other browsers. How did they (id?) do with Quake in the browser?
If you're already targeting ES 2.0 for iOS your shaders should work as-is with WebGL. JavaScript ahoy!
id Software uses a giant plugin for Quake Live.
Try Google's Native Client or NaCl, if you want a lazy port.
But if you want to do a real port - refer to those two examples:
blog series about porting existing C++ game to html5 (sponsored by Opera)
short article about porting existing Objective-C game to html5 (sponsored by Microsoft).
sad example of porting popular copyrighted game from C to JavaScript (sponsored by Mozilla, with extra help of Zenimax)
If you was asking about QuakeLive - that is a custom plugin, made by Id Software. Similar functionality can be achieved with Flash or Unity plugins.
You can use Mandreel if you want the least amount of work. Another option is Emscripten but that only converts your C++, it doesn't provide all the APIs like Mandreel does.
Is there an easy way to port a C++ OpenGL app to a browser? It's already ported to PC, Mac and iOS. If there is some relatively easy way, would that be portable between computer browsers?
You could try to recompile it into JavaScript, that's what browsers execute. If you don't expect the user to install some browser plugin, you can't give them native code. Of course when in a JavaScript environment many of the things you're accustomed from native executables don't work. For examples you no longer can access a file system. You must use either DOM storage, cookies, download/upload resources from a server.

script for actionscript/flash and c++

I havent used flash or action script much. I am planning a small project that i'd like to be online via flash but i'd like to reuse the code in my c/c++ projects
Is there a script language i can use? i am thinking lua or python. After googling i found flua which is incomplete and jython. Can i use java in flash? would it be a good idea to use python in java which is ran with flash?
Have you taken a look at Alchemy?
With Alchemy, Web application developers can now reuse hundreds of millions of lines of existing open source C and C++ client or server-side code on the Flash Platform. Alchemy brings the power of high performance C and C++ libraries to Web applications with minimal degradation on AVM2. The C/C++ code is compiled to ActionScript 3.0 as a SWF or SWC that runs on Adobe Flash Player 10 or Adobe AIR 1.5.
Have you looked at Haxe? http://www.haxe.org
The Haxe compiler can produce swf files, JavaScripts and other, with a language that resembles ActionScript or JavaScript more or less, depending on what language details you care about.
Here's this nice teaser from the haxe site: "Currently in testing, with the right build of Haxe from Hugh Sanderson, you can now output your Haxe applications to pure C++ source code, complete with makefiles."
But no, I don't know about using Java inside a Flash. You mean the Flash app executing Java while it's running? or using Java to create a Flash app?
There's no way to embed Java within a Flash movie. If you're creating a SWF that will display in a browser then you're restricted to Actionscript. You could create a Java applet, load it in the same page, and use javascript to communicate between the two, though I wouldn't recommend that.
If you're using a projector to create an EXE then you may be able to load and use C++ dlls, though I've never attempted this.