Does anyone know how to create a content provider where the data source is a web service (like the one mentioned above) and not db?
Consider the following answer can be considered a fairly old-fashioned "manual" method.
You can create a content provider that requests a web service and converts the result to a cursor.
To request a web service, you can use HttpClient and HttpGet . You can find a MyKong tutorial on how to do this. There are also newer alternatives for this .
When analyzing search results retrieved from a web service, you can create your own cursor using the MatrixCursor class by adding rows with addRow () for each individual result.
If you must do this, make sure you always invoke your content provider through a background thread (i.e. using CursorLoader , AsyncTask or some other form of streaming), otherwise your network operation will end in the main user interface thread.
source share