Interface to communicate to web pages from android application - java

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/

Related

Android application development: java vs. jquery mobile

I'd like to build an android application for a school project but I'm a bit confused, I saw that i can build an application using Java or using Jquery mobile.
Do they have the same capabilities?
If i build an application using Jquery , can i pack it and have it installed like a java application (as apk) or is it only used for building websites?
If so, what tool do i use to pack it?
jQuery Mobile needs an intermediary framework that communicates between JavaScript and Java. PhoneGap is a popular one of these frameworks.
PhoneGap is also actively maintained and they roll out new versions almost every month.
The main reason to use PhoneGap/jQuery Mobile is that it makes development easy if you already know HTML/JS/CSS. Another great reason to use PhoneGap is that you can use your existing website as the base for native applications, yeah, plural, not just Android but also iOS, Blackberry, etc. It also gives you a pre-built UI with some widgets so you don't have to roll your own.
The jQuery Mobile documentation talks about some of the caveats to creating a native application with PhoneGap and jQuery Mobile.
I don't know what you have already tried or what your skill set is (based on your stackoverflow history you may know more about java than I do), but you would be best off just using the Android SDK. I was able to design and complete a custom business project and learn java while doing it. I can't comment much on jQuery since I've never used it. jQuery seems like it might be a nice for the reasons Jasper listed but might add layers of complexity you don't need to deal with if you don't need to run your app on other platforms.
Jquery Mobile Framework provides the way how you web application looks on different hand held devices simply but this can not use the native device capabilities like picking up an contact from the contact book/application. while native application has the capabilities to handle all the system generated events or broadcasts.

How do I make a simple web app with log-in?

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.

Multiple Frontends - Java Backend

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.)

Can i create Web App to be used on smart-phones without internet ? How?

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

Integrating java and apex (salesforce)

I'm a salesforce newbie and I need to integrate java business logic with apex pages.
Is it possibile to do it without using vwmforce? Note that I have to include my own and third party libraries as well.
Is there any tutorial/resource about that?
Thanks in advance
You could perform callouts from Salesforce to your separate Java code (as long as it's exposed as webservice or at least can accept HTTP message).
Read about Integration on the Force.com platform, there are many possibilities and examples.
In the API documentation most of the time there are Java code snippets listed, for example for creation of new records (scroll down to the middle of the page, "#" anchors seem to be brokes so I cannot give a direct link).
Generally you can both "push" (send from Salesforce notifications when something happens, synchronously or not) and "pull" data (periodically ask from your Java application for changes or send INSERTS etc. whenever something happens on your side).
But if you want to run your Java on Salesforce server and not on your own machine - tough, vmforce might be the only option. I haven't tried this one yet.
In the end under the Apex, Visualforce etc. there are Oracle databases and Java (with JSP), but I doubt they'll grant access to it ;)

Categories