how to make android app fetch content from dedicated internet page? - android

I am planning to create a small review app in android that fetches movie reviews from a webserver/page. So how should i design the online component? The online part need not be visible through browsers, but available to the app. So, basically how should i put the data on the server? Json or simple web page or database tables?

In my opinion the best approach to achieve this is to create some (REST or not) web service and as an output format use json.
architecture like this: mobile_app <---> web service <---> database
You could also have some other program which for example will be creating some json file on ftp server.
If you have webpage already in created in php, python, ruby etc you can create some API for your mobie app. For example you have some page with movie reviews with your-domain/reviews.html URL
you can create similar endpoint for your mobile app with you-domain/reviews.json which will gives you some json dedicated for your mobile.

Related

Real-time communication between app and webpage

I'm trying to figure out how to have a real time data displayed on a webpage through the use of an android app.
For example, users are using android app and are scored (answering questions). My webpage will display the scores in order in real-time.
Iv come to the conclusion to use Redis, but what exactly do i need for this to function? Do i need a web socket where my web page will communicate with. This socket could be python where it accesses the database and then responds with the scores in order?
Im struggling to find out how exactly this would work as this is new to me. What exactly should i be looking for (terminology etc)?
Thanks
One approach might be:
set up a database on a server on the internet
program your app to save data to that remote database
set up a webservice
program the webservice to read data from the database and serve it as an html page
For extra credit
implement a REST style API which retrieves and serves data from the database
create an ajax webpage which uses the API to fetch and display data (so you don't have to refresh the page constantly)

How to connect android to python web services and MySQL database

I'm new to Android and to web services in general.
This is what i gotta do: My company has a back end website(for the client to monitor the sales) that's used to manage/monitor sales on some stores and it connects to a MySQL db to store data about sales and users(usernames and passwords).
What I want to do is to get data from that database and to add (sync operations) new rows, all of this from my android app.
I googled this many times and it came up with some similar projects but using another languages.
I would like to see some code samples if possible and some how-to theory, what theory should I follow when developing this, how and what ways of communicating between android and python web services and from the web services to the MySQL database.
Thank you in advance.
You will need a working API, that allows you to communicate to the web service from the android application. I would read into how to write an API and how to build a RESTful service using JSON as a way of communicating between server and android app. There are alternatives to JSON, but JSON is better suited for Android than perhaps AJAX and soap is being used less and less. (Can ajax call be done in Android? It can but has limitations)
(I could only post two full hyper links as i don't have enough reputation yet to do so, you may have to remove the spaces)
API:
http://sharismlab.com/blog/2012/07/21/how-to-write-an-api-for-your-web-app/
REST:
www .restapitutorial. com/lessons/whatisrest.html/
JSON:
htt p:// www.r evillweb.co m/article s/why-use-j son/
You may want to check out restjee. It allows you to define and implement RESTful data access APIs without having to write any server side code. Works with just about any database.

asp.net Web Api and mobile aplications

I just want to make a TV guide for Android and later some other Mobile Platform. I want to use an RSS updates to update my application. In this specific scenario I want to use http://tvprofil.net/ 's RSS resource. I thought that I could just call site's RSS XML from my Android app, parse it, show, and thats the end of the story.
But, my cousine told me that the best way to do things is through Asp.net Web Api Service. Something to deal with REST. So, If I have to change resource, to like some iptv provider's RSS I would just change the Service and not have to deal anything with my mobile application. Other advantage, he said, is if I want to build Windows Phone application or iOS aplication that works the same way, I would have that same service to do job for me and just create UI and basic things for those apps.
The problem is that I have no idea how Asp.net web Api is used.
Can anyone give me some usefull link, or even better, write an example of this thig. I just want the RSS from http://tvprofil.net/ to go through Asp.Net Web Api Service and that I can call service and get it as XML or ... even Json... or to get anything at all to my app.
The whole thing is pretty confusing to me
If a RSS feed has enough data for your application to function then you do not need ASP.NET Web Api. The only role ASP.NET Web Api could play in this scenario is if it acted as an intermediate. E.g. your client application contacts your server application (ASP.NET Web Api) which in turn pulls the data from the actual external data source (tvprofil.net RSS).
For completeness sake, a list of pro's and con's:
Advantages of using an intermediate server
Reliability. You can cache the data of the external data source and serve that data even while the external data source is offline. Also, by caching the data you can lighten the load on the external data source to a bare minimum.
Transformability. Your intermediate server can translate the data of an external data source to another format that is more suitable for your client application. This is useful when you have many external data sources that each serve data in another format. Your intermediate server acts as a layer of abstraction for your client application.
Disadvantages of using an intermediate server
More effort. It will take more effort to develop and host an intermediate server.
Reliability. You must ensure your intermediate server is online and connected to the internet 24/7

webservices to access joomla website

I want to write an app which can be installed on iphone or Android and communicate the website with Joomla installed on it. I understand that Joomla is a CMS to handle front end and database.
My question is, for the iphone app to communicate the website database, do I have to write plugins for Joomla, or do I have to create a seperate engine which communicated database directly?
Thanks.
You can use Joomla API or you can implement whatever you want with PHP code that you'll build yourself, which is actually creating your own "API". for example, you can write a php that will be hosted on the same server as Joomla which will call the DB and list the names and emails of all the users (from jos_users) - this is pretty easy to implement on the server's side, and you can implement a call to this PHP on the client side (phone) which will send a request and parse the response and display it.

what web service and format to use

i'd like to aks, if someone were to create a web site, let's say for example: a site for storing information on an online database, what would be the recommended web service (SOAP or REST) and format to use (XML or JSON) if there will be server - client transactions/interactions and a client application will also be used in an android platform?
also, i'm curious. does anyone know if google uses REST web service and JSON format for the GMAIL in android?
thanks
ads
I'm not sure about what they use in the GMAIL application.
But I'd prefer REST and JSON because of two simple reasons
REST is easier to access, since forming the request is not gonna take much time.
JSON lib is bundled with android and is smaller in size when compared with its XML counterpart.

Categories

Resources