Explanation of the Codename One "On Device Web Server" - codenameone

Two years ago, I read your article: https://www.codenameone.com/blog/on-device-web-server.html
I still remember being intrigued, but then I never went deeper. Today I was thinking about it again and I'd like to understand better.
What programming languages does this local server support? It seems strange to me that it is an equivalent of Apache, IIS, Tomcat or similar... Actually, what can I do with this server? I didn't get that from your blog article.
Thanks for the clarification.

The webserver is currently very simplistic and only serves files. The main use case we needed to attack was that of HTML5 features that won't work when running from a file but would work from a URL.
So it doesn't support a specific language like Java Servlets etc. as it's implemented natively.

Related

Fun web based programming environment for tablet?

Sometimes I am away from computer and have some spare time. I would love to do some programming just for fun or experiments. I can imagine something like a web site that can edit and execute JavaScript (or any other language is OK). But it must be ready for keayboardless tablet.
Unfortunately typing to google anything that contains JavaScript and IDE or Website, will give millions of links not suitable for this request. Hence I write here. This is not to start any flame or unproductive discussion. This is really the only option I can think of.
JSFiddle allows you to write HTML/JavaScript/CSS in one editor and immediately run it.
Take a look at TouchDevelop. It's developed by Microsoft Research and allows you to create apps on your iPad, Android device, etc...

Server side programming: simple tutorial for getting started with server/client [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance.
Closed 10 years ago.
I apologize in advance for the open-ended question. I tried searching, but wasn't sure what specifically to search for, in all honesty...
Briefly put, I'm a novice iPhone programmer and I've made applications that have communicated with a Java server. For example, my iphone application would use HTTP Get or POST requests and would receive back data. However, I'm not the person writing the server side code and frankly, have no idea how it's done!
I'd like to learn at least the mechanics of how things are done on both sides, so now I'm trying to learn. I picked up a book on Google App Engine since it seems like an economical way just in case I do decide to release a server/client app.
However, I assume that I could have chosen RoR or PHP as well. I'm assuming the principles must be the same.
If anyone could point me towards tutorials that shows the "other side" of what happens in a server/client app, that would be most appreciated! By other side, I mean, on the client side, I already know how to request and receive data. I just dont know what happens on the server side...
Thank you and sorry for the general question..
These are most important components of web application:
an http server: serves static files, works as a pipe to your applplication for dynamic content. For example: apache, nginx.
An actual web application: handles requests for dynamic content. Usually you use a a web-framework. For example: django for python, symfony for php, RoR for Ruby, node.js for javascript.
A database server. For example: MySQL, PostgreSQL
Some other things which might be considered:
a mail server to send email messages
image processing libraries
fulltext search engines
These components are less common:
memory caching server, for example: memcache
non relational databases, for example: redis, couchdb, riak, mongodb
task queue server: for example RabbitMQ
The reason why appengine might seem easier for novice is that you don't need to configure web server or database. You only need to write your application code. Fully-managed hosting with task queue, memcache, datastore, content-delivery-network are already available in appengine.
The problem with appengine is that it forces many limitations on you.
If you don't need memcache, task queue and distributed system then it is very easy to develop applications with popular frameworks, they provide tutorials how to set up your own http server and database.
If you need these advanced parts then it will be more difficult to configure everything.
Common practices in web application development include:
using ORM to work with relational database
using MVC or similar pattern to structure code
Html code is kept away from code in templates. Thus templating language is used.
As a web-backend developer aside from coding application code you also need to understand well the database which you use.
If you only build a backend for your mobile application, you won't need HTML, CSS, Javascript and templating. Though MVC pattern and ORM still applies. You also will need to know more about HTTP protocol and various methods of implementing an HTTP API. If you like XML, the WSDL does a good job. There are great libraries for WSDL which makes writing HTTP API easy.
The base API in Java is the Servlet API. Read this tutorial.
On top of this API, there exist a myriad of frameworks (Stripes, Spring MVC, Struts2, JSF, Wicket, etc.), which all have their own philosophy. There are two groups of frameworks, though: action-based ones (Stripes, Spring MVC, Struts2, ...) and component-based ones (JSP, Wicket, ...).
The action-based ones usually use JSPs for their view technology (to generate the markup), but also support others. What you'll learn if you learn JSP will be useful in a variety of frameworks, so I would learn it as well. Read this tutorial.
I applaud your choice of starting with App Engine:
Some concepts of GAE are hard, but so is SQL. If you don't know either you might just start with GAE which is a modern noSql system.
GAE is not a good fit for all problems. But I believe it is a good fit for your setup: a lot of independent clients with limited need for heavy queries.
About the cost: GAE is cheap if you know how to programm it. I have both EC2 and GAE in different setups, and while they are hard to compare, I believe GAE is cheaper.
IMHO most of the cost of hosting comes from support/management cost. We have a team 10+ developers, but no system/database admin.
I think, starting from app engine may not be good idea for starter for server side developing.
Asp.net ( or php) will be more "efficient": not only source for learning and tutorials but also better for make mistakes and learn better
Once you done with asp.net, and have good pratice about your server side project,
it is easy and very fast move to app engine
good luck

A small query regarding appcelerator titanium?

i'm planning on working with titanium.
i want to know if "Same origin policy" can be eliminated by using titanium.
are there any drawbacks in titanium?
please recommend some cross-platforms..
please do leave some suggestions..
Thank you,
SOP is especially used for HTTP. So it doesn't concern titanium since it only use javascript as "local" language that is "translated" into xcode. at the end you got an simple xcode-project and an .app file.
i use it for a quite complex app and it works fine. i needed adding some features as module written in objC since the framework isn't as ongoing concering the iphone API as the native objC, but that worked out fine.
Since you are asking for the drawbacks of Titanium.. here it is..
I would not say that it's cross platform. Even my android app will look different in my Mac compared to the one developed in Windows.
Not all functions will work on Android and iPhone. Some will partially work on the other.
Ti is a biased and Android Developer are always left behind.
Also, if you are developing an Android app like me, you will be facing a lot of problems and Kitchen Sink will not always work. Android development in Ti is very bad and expect to find a lot of bugs.
Contacts API is not even complete as of now (Version 1.60) . I can't even get the contacts email and phone number!
No Bluetooth support
I spent a lot of hours "debugging" and waiting for the emulator rather than serious coding.
API refence and the QA will help a bit but there are more questions than answers.
Ti doesn't even have a proper debugging features as well as IDE. Make sure to dedicate a lot of hours in knowing how it works. I have a hard time finding a good resources to start.
Memory Problem and Leaks are very common.
Gradients will not work in Android (use image instead)
and last thing, Documentation really sucks!
(but still I love Ti despite all of the above)

What database options do I have for the Blackberry?

I notice most of the discussions about Blackberry database options are old, and generally not too informative.
As of today, March 31st, 2010, what is the best, most universally supported, free database option available for Blackberry developers?
I heard SQLite is available for JDE v5, but last I checked, that was still in beta, and I didn't want to commit to developing on a system that is not supported by most of the phones in service.
Thing is, I don't see any dates on these claims. For all I know, the announcements I am reading are from 2008.
So, I am still on v 4.7. I need to use a relational DB for the app I am developing, but there aren't many resources for DB handling available - or at least resources that are useful to me. I find a lot of "tutorials" that assume you know everything there is to know about Blackberry development, or Java. But no complete classes or anything. Many of these examples don't even work. Eclipse gives warnings and errors from code copied and pasted from other people's examples.
I can answer any questions that may assist in this case. Hopefully, this thread will help many BB developers in the future.
Before v5 I don't think there is a native relational database that you can work with on the Blackberry, the closest thing is the Persistant Store API, however I think that there are 3rd party libraries that you can use, like SQL Anywhere.
Depending on the Java dialect supported on your Blackberry version, db4o could also work well for your usecase. It's an object database, quite similar to Perst.
Ok, in case anyone has had similar experiences with this, here is what I have done:
The JAR class path thing was resolved through no help at all from these sites.
What I did to get an outside JAR included in my package was to right click the package name in the navigation menu (Eclipse) - then select Build Path - then add libraries.
From this I was able to modify an existing library to include the JAR for the perst package.
Now I am able to import org.garret.perst.*
We'll see if there are any complications.
Forgive the number of posts, maybe it will help someone else down the way.

Is NetBiscuits any good?

Has anybody got any real world stories build mobile web sites with NetBiscuits?
Someone told me it was the next big thing in mobile development (http://www.netbiscuits.com/home) and it looks pretty good from their site. Just wondered if anybody (besides them) has actually used it.
From a few months time working with it, I can say that they're indeed one of the best (if not the best) out there. The support is also insanely quick and good.
Only thing making me stop using it is the price. Especially if you're a small company and want to use their POI feature.
However I have yet to find a good replacement. May end up rolling my own version...
Edit: Related question.
They have created an entire xml (bml) based markup language that emulates html that has a very steep learning curve. I would seriously reconsider using it.
I have seen it working nicely. It also supports ASP.NET controls SDK that can be used to write ASP.NET app from Visual Studio. Once this app is deployed on your premise, you can use live bridge agent to connect this app to a Live Bridge server that Net Biscuits hosts. Your app is called a backend app in this case. This is a very useful feature when you do want to have Forms capability in your app and also want it to be accessible on NetBiscuits platform.
Check http://kb.netbiscuits.com/tactile/edc/livebridge_help.html. BiscuitML is also easier to grasp.
Look out for performance issues though. Customers in Australia have had response time issues - probably due to the Cloud Platform being located in USA/UK.

Resources