I have been doing android programming for a while now but only as a hobby. I know the basics of java, and can say I have a solid understanding of PHP and MySQL (I once followed a tutorial that showed how to create a very basic content management system). I've been wanting to expand my knowledge beyond the simple android apps I've made and recently had an idea for an android app. In this app, the user would create a Username and password the first time it is ran. From then, the user can fill out a form. From what i know so far, the valuesof this form can be stored in a MySQL database. So basically every user needs to have their own set of variables stored (which are not a lot). As I been looking around, i think there are many ways to create a web app, and there are different frameworks for doing so. I read I can create a web app with log-in, using ASP.NET. Can this be done using java? I just need some general guidance. I want to make the web app standalone, and then focus on creating an app for android that uses it.
I think good platform for your kind of case is to use Google App Engine (GAE). It provides platform to do your web-service with Java (or python if you prefer). It is also free for low amounts of traffic (like your service) and they have really good tools to manage the site (check the database entries, usage statistics, etc.).
Google has written a good set of tutorials to build webservice with Java in GAE:
http://googcloudlabs.appspot.com/
AppEngine documentation main page:
http://code.google.com/intl/fi-FI/appengine/
Signup here:
https://appengine.google.com/
I think you may want to look at JavaServer Pages.
Related
After five and a half years full-time work on a product ranking engine project, which revolves around a 64,839 line applet, the browser companies have seen fit to dump applets.
At this point I am in no position to convert the applet to another language (unless I get a huge injection of funds to hire a team of programmers). My partner is not going to support me for another two years.
I know the questions are rather vague and I should be keeping up with the latest tech, however I've had chronic earaches for 14 years that affect memory and concentration, so programming is difficult enough without trying to keep up with the latest developments in software as well. The reason I am asking for advice is that I don't want to make another monumental screw up.
Question 1: My understanding is that Java Web Start launches the application, but it then cannot communicate back to the JSF web page any more (JSF2.0). Is there any way of getting around this?
Question 2: Can anyone suggest any other options other than re-coding the whole thing?
Question 3: Is it likely that applets will be altered to use the latest plugin format or are they gone for good? Does anyone have any inside information on this?
Overview of the applet's requirements:
The applet allows a user to customise some or all of the product ranking criteria, which has been preset by a panel of knowledgeable experts, to their own particular needs. The criteria is stored and edited via graphs (custom painted jPanels).
The ranking criteria can be altered entirely using the mouse (to change the graph shapes), though some values can be entered using the keyboard if the user wishes. Once customised, the applet is then used to submit the changes to the ranking engine server.
It is also used to allow third party experts to alter the ranking criteria to create their own product usage category ranking criteria. The third party expert can then place links on their own web site that will allow users to rank products using the third party expert's own ranking criteria. This allows anyone to create their own ranking criteria for use by others.
The applet uses a plugin bean that is also used in a standalone Java editor application, which is used to create a product usage ranking criteria file from scratch (the editor is 77,710 lines of code, though 61,257 lines of that is the plugin which is also used in the applet). This means most likely having to convert the editor as well, as the two are inextricably linked. The plugin basically is the applet and also the editor.
The plugin can capture, edit and store ranking criteria for virtually anything the human brain can rank. Thanks to the graphs, it can use any attribute that the brain uses, and for which we have no formal system of measurement; hence why the applet is so damn big.
Your question is probably too broad for Stack Overflow, but I'll give a brief response.
Java Web Start
Java Web Start is probably the best route for you. This technology is basically a convenient way for a user to obtain, install, and run a Java desktop app. The web browser is only used to initially download a small XML file describing your app and where to get the app. The Java Network Launching Protocol (JNLP) defines these pieces of information stored in that XML file. Your app will be downloaded from a server, and saved to the local machine. A Java Runtime Environment (JRE) can be downloaded and installed if need be as part of the process.
By default the app runs within a security sandbox similar to Java Applets. But you can sign your app and define security protocols to break out of some of those restrictions including making network connections.
The bulk of your programming would remain intact. The app is still pure Java, running in a JVM. You would need to do a bit of reprogramming to be a desktop app rather than packaged as an Applet. And you would have to learn about easing those sandbox restrictions. And your app will have a menu bar of its own as a full-fledged app, so you may want to take advantage of that. But the guts of your app would remain the same.
Over the years, Sun & Oracle have put efforts into improving Java Web Start. Unfortunately it came too late after Java-on-the-desktop had lost too much mind-share. And Swing never got the overhaul it so desperately needed. So Java Web Start never went big-time. But Java Web Start does work as advertised, so give it a try.
While there were some security issues years ago, I believe they have been resolved long ago. The many infamous security problems with Java were largely involving the web browser plugins bridging between browsers and the Java JRE; those problems do not affect Java Web Start (though you should do your own research to confirm).
For the general public, Java Web Start may be too much to ask of new, anonymous, and less-motivated users. For a commercial product with a user-base of eager customers, it may the perfect solution for you. I suggest you do some more study, read the Wikipedia page, study the Oracle technology page, look at the Tutorial, read this overview by John Zukowski that includes an example of network (making socket connection to time.nist.gov), and so on.
Vaadin
The Vaadin framework is an open-source free-of-cost professional user-interface development framework that uses pure Java to run your app on a server in a Java Servlet web container while automatically generating a user-interface using standard web technologies (HTTP, HTML, CSS, JavaScript, GWT, WebSocket, etc.) for presentation within a regular web browser (Firefox, Chrome, Safari, IE, Edge, etc.). As a graybeard, I think of Vaadin as an X Window System for the new millennium: The user interacts with screen widgets on their local computer but the business logic of the app is executing on the server, and the server is updating the remote UI as a result of that business logic executing.
Vaadin is not yet-another-web-templating system. Instead, your app is written in pure Java. No need for you to learn the alphabet-soup of web technologies listed above. Vaadin takes care of that for you, auto-magically. You say in Java “I want a label, then a field, and a button” and Vaadin makes those appear in the web browser.
Using Vaadin would allow you to retain your Java code for the business logic part. But you would need to re-write the user-interface parts to use Vaadin widgets instead of Swing widgets. This would not be so terribly difficult as Vaadin was inspired by the general style of Swing, defining layouts governed by layout managers in which you place your various widgets (fields, labels, buttons, etc.).
Vaadin can make very professional business-oriented apps that feel almost like desktop business apps. Tip: I prefer the Reindeer theme for business apps over the newer Valo theme.
But you mentioned some kind of free-form drawing canvas in your Swing applet. That may be a sticking point. I do not know of such a widget for use within a Vaadin app. I am not saying there is no such thing, I just do not know of any. There are slider widgets that may useful, but I don't clearly understand your needs in that regard.
I am trying to implement a "Doctor Finder" application for android which will have a symptom checker facility like webMD. Since webMD don't have any API's I must create my own expert system (which takes a lot of time) or need to find something similar to webMD which offers public API. I found NIL API from National Library of Medicine US and I doubt it would be useful in my scenario.
Now the actual question, Is it possible to use webMD's online symptoms checker using an interface from android. I don't want to show the HTML page within my app but to send and receive information through it? If not is there any APIs available to serve this purpose?
You can do that by using "selenium".
Its a tool used for automated testing of web applications. you can navigate and enter information in the web page and get results using this.
http://www.seleniumhq.org/
I just started working on a project which will about making a big website.
With big i mean:
Webshop
Forum
Normal Website (Information pages etc..)
At first i just wanted to pick a decent open-source webshop and just built my site around it.
But then i started thinking about how to expand etc.
I started to think how i would like this website to be acces from a mobile phone. Not just with a browser but with an App. (I have decent experience in making apps for Android & Iphone). So the real question is:
Would it be smart to make the "Core" of my whole website in Java and use services to acces it and thus allowing different frontends to use the same "Core". Like:
- PHP for browser frontend
- Java (android) for the android App
- Objective C for the IPhone App.
And let them all just communication to the "Core" through REST (Json).
What will be the advantages / disadvantages with this approach and will there be a significant delay in rendering eg. a webpage (http request to php, then php making calls to java server (different physical server) then accessing the database and then returning it all, so php can format it to HTML).
Hope hearing some answers or suggestions!
I would skip the Java layer and make the "core" PHP. There is a wealth of tools and frameworks (like Zend FW) for building thoses components in PHP. Design your application around a REST interface and allow your mobile apps to use REST.
Better yet, use Rails. It's so easy to design and set up a REST interface.
I think your solution is “smart”. The only changes I suggest are:
Use the same platform to build both the "core" and the "browser frontend." This way you will have more productivity.
Keep the "core" and "browser" frontend on the same server, if possible in the same process. Unless you have a reason do it differently. This will reduce problems with performance, latency and so on.
If you're already familiar with Java I would suggest you look at something like GWT (or GWT + third-party libraries like Ext GWT or Smart GWT) for your front-end. I don't see the point in picking another language for the front-end unless you really want to learn something else (e.g. PHP as you suggest in your question).
I think the rest of your approach is sound (i.e. Java on the backend, providing RESTful services, etc.)
I want to make cross - platform app which could be used for different smart-phones, and been advised to make 'Web App'.
Can 'web app' work without internet?
How to do it, which programing language to use?
thanks
Oh sure. Bundle all your HTML, JS anc CSS with your app, and have a thin Java/Android app over these assets. If you are not making any calls to fetch or show external HTML/pages, you don't need internet.
Most likely no.
While it is possible to run "web apps" without access to the internet (you can simply execute Javascript locally from some browsers), it would be
(Subjectively) not particularly useful.
Not supported by many devices, whom (like the iPhone) do not allow the storage and execution of arbitrary, non-native code on the device.
However, some frameworks do exist that hold the idea of "web apps" can be a distribution model. For example, PhoneGap allows you to code in HTML5/Javascript, and distribute your app to multiple platforms.
Yes, it can work offline once downloaded from web. Use just any regular programming language for web application development. If you are good at programming, I recommend ruby-on-rails or ASP.NET MVC with Jquery mobile.
You might want to look into frameworks like:
PhoneGap: http://www.phonegap.com/
jQuery Mobile: http://jquerymobile.com/
GWT Mobile: http://code.google.com/p/gwt-mobile-webkit/
Your question is very broad so it's hard to give a useful answer. Essentially when making a web app you'll normally be working with javascript, css, and html... though there are frameworks which will let you write your app in Java/Python/Ruby and then have those languages create your app for you. Keep in mind this is mostly all front facing stuff though. The actual web app will still need to have a backend written in a programming language that you understand (hopefully).
Good luck :).
Check out the jQuery Mobile API - I started using it recently and it has proved to be a viable option. Check this out.
https://developer.mozilla.org/en/Using_Application_Cache with an application cache your Web App can be used offline. It will cache the resources you specify to disk.
So you can write a Javascript + HTML webpage/app and use it both on and off line.
You can cache/store:
HTML
CSS
Javascript
Images
GET Requests
Is there a way i can use an access database from my Blackberry Curve?
All i want is to be able to open the DB, open table and run queries.
How?
Thanks,
I'm not sure that's going to be possible due to the size of the engine needed to interface with Microsoft Access. Perhaps something like SQLite would be better? If you already have data in Access, then transforming it into something like SQLite first?
As a general rule you have to either adopt some web based technology, or at least get your hands on some developer tools that work on the particular product in question.
Obviously access does and run on Linux or a Mac Computer. Obviously word or excel does not run on your smartphone either.
However most smartphones do support web based technologies or have some type of web browser.
Access 2010 allows you to build web based applications. I'm currently testing and playing with some of my access applications on an apple iPad right now, and they work great.
For couple small little forms, it's probably likely cheaper and better to adopt some web based development tools like asp.net, but this is all going to come down to what type of infrastructure and web servers and other resources you have at your disposal within your organization to bring into play here.
You can take a look of the following video of mine, and you'll notice at approximately the halfway point, I switch to running the access application 100% inside of a standard based web browser.
http://www.youtube.com/watch?v=AU4mH0jPntI
So Access 2010 + sharepoint allows you to build 100% browser neutral based applications. This means no ActiveX or even Silverlight is required. Thus the resulting access application will run inside most modern browser, and this includes most smartphones.