There are various websites (say LinkedIn) which have a corresponding mobile app.My question is - "How they feed data to their mobile apps?". Obviously they are not doing HTML scraping of their webpages, otherwise it would be really inefficient.
I am asking this because I have a website, and I am also going to develop an android app for that.So, do I have to design my website (like database) in a specific way to support mobile apps. (I mean, what are the preconditions do I take care of , while designing my website, in relation to the mobile apps)
What you need is a web service. It sounds little complicated but actually its not! in normal websites when you visit a website you get HTML data. but in web service when you request for a data you get the data in xml or json. Then on client side you parse this data and show it as you like.
The most used method for sending data between web services and clients is called RESTful web service and it usually uses json. So after a request you get a .json file. I highly recommend you to use RESTful web service especially since you are a beginner.
As i said RESTful web services are famous so most frameworks support that! So if you are creating you website with this frameworks you don't have to code anything! they build the web service for you. If not there are plenty of code for any given language.
Another thing is since xml (and json) file are platform independent you only need one web service to handle all of the client (android, ios, windows, etc.). And there are sufficient tools and libraries in each platform to work with xml (json) files. Sending data to server is also the same, you send the data in xml format, service receive it and do what ever need to be done (for example stores the data in database)
Lastly the world of web services are a lot bigger. What i said was a highly simplified version to give you a whole idea! If you interested to learn more there are plenty of books you can read. Many people (including myself) think web services are the future of internet. Where different services each developed by different company work together to provide user with something great.
Related
It's required from me to make an android app that must
1\Displays the cheapest prizes for some goods eg car by parsing them from some commercial web sites ascending .
2\Alerts users with the updates in those web sites
I saw some android apps doing like this tasks (they enable users to be the first to know by sending them push notifications of breaking news events and so on)
for example Pulse app.
How they do this ? that is my problem
Perhaps you will advice me using rss feed but not all web sites have rss feed
for just an example this website
please can anyone help
If it were me, I'd probably use python's BeautifulSoup to scour the websites for the data you need, and then I'd store that on my webserver in some easily Java-digestible form like JSON. (BeautifulSoup is a quite powerful screen scraper and there are a lot of examples on web as to how to use it.) Auto update it every 24 hours, or more frequently, depending on your requirements. Your Android app can then regularly query this data, and then generate the required notifications, etc. Alternatively, you can use the Android compatible library here that's supposedly similar to BeautifulSoup.
I am new to Android and taking the risk of doing a final year project of building an Android app. I would like to know whether I can create Client-server architecture application in Android. I'd like the front end to be the mobile app. Also, where do you store data (I don't know where to store data exactly) at back end.
Use Restful web Services with json(Ex: WCF in the backend with Sql Server)
For Mobile App, These are useful tutorials http://developer.android.com/training/index.html,
http://www.vogella.com/tutorials/android.html.
Very many, if not most, existing Android apps retrieve data over the Internet and display it (e.g. the StackExchange, Yelp, or Facebook apps). They are clients requesting data from servers and therefore fit into the definition of being “client/server”. I'm hard-pressed to think of an app on my phone that isn't a client to some kind of web service.
If, as your question suggests, you are using HTTP for client/server communication, there is no reason why the client platform (Android) should have any impact whatsoever on the server-side implementation. In the wild, Android clients are served by servers implemented with every conceivable combination of OS, language, and database. Therefore “where do you store data?” is an unanswerable question, as the answer depends entirely on implementation choices that you make on the server side.
I am trying to develop a system that involves a:
server with a database that will handle the system's logic and manipulate data
an android app that will interact with that server (pull and push data into the server)
a website that will do the same as the android app, but from a website with slightly different data.
What I thought of is to use SQLite with Apache Tomcat installed on the server and deploy a Grails war file on it. That will take care of the 'website' side of the system. But what about the android app? Can it communicate with Tomcat as well?
Tomcat will suit your needs. I would look at hosting options though. Are you hosting your own server, or do you have a hosting provider? Do you have experience hosting a tomcat server etc. Do you have experience with java web applications, or other web frameworks? All of the above, and probably more should lead you to your decision on what type of framework/language to use on the server. This in turn will lead you to your options for hosting, and web-container to use.
Once that is determined all major web frameworks will allow you to publish web-services Rest, Soap, etc. that can be consumed by an android application.
Also, if you are planning on providing a web interface and service at the server level, my guess is you are going to be storing a fair amount of data, I would look into a more robust and scalable database such as mysql or postgres. This post contains some insights into this.
If you have an API that is web accessible, an Android can access it.
Android shouldn't have any problems communicating with Tomcat.
Look at http://grails.org/doc/latest/guide/13.%20Web%20Services.html for more information.
A RESTful web service is most likely what you'll need. Android can consume SOAP web services but it requires more work for less overall functionality.
I am developing an application that needs to retrieve some data from a web server. But I have no idea how can this be possible?
You need to create what is called a web service. This web service acts as a web page that can be read easily by machines. This page will let your program make HTTP posts and gets (Just like a web browser) in order to request and receive information. You can look at this page for the Google Maps API to see an example of how it works.
For the protocol that you use to communicate, you have many options. Among the most popular are JSON and XML.
To create the web service itself you have a multitude of options. It seems to be Java Servlet s and PHP are popular, but there are many others (ASP, Perl, Python ...).
I want to create a very simple rest-like web service to be used by an android application. The web service just needs to offer a way to add user entries to a simple database and retrieve other users' entries.
What would you recommend as a platform to accomplish this?
I was thinking google app engine might be a good way to get this going without worrying about hosting but asp.net mvc or django are other possibilities.
I know this isn't a direct answer but I would shy away from any sort of offical XML-based web services. I've found that JSON is far less verbose and generally leads to faster response times as opposed to full blown SOAP messages. I would urge you to evaluate JSON as your "transport" mechanism.