The spying phone! How to develop an App that turns a mobile phone into a perfect digital bug
Android gives developers a lot of freedom. Let's now create a perfect bug for mobile phones.
CONTENT PROVIDER is a part of an Android application that is responsible for making data available to other applications installed on the system. Every type of content exposed through a content provider is identified by a URI, i.e. a unique address. The typical form is as follows:
content://base-reference/etc/etc
Android has several contents. An example:
content://com.android.contacts/contacts
Once you know the uri of a content type, interacting with the provider that supplies it is more or less like making queries to a database. As a first step, you need to retrieve an instance of the android.content.ContentResolver() object. Example:
ContentResolver contentResolver = getContentResolver();
These objects allow you to query through their method:
public Cursor query( Uri uri, String[] projection, String selection, String[] selectionArgs, String sortOrder)
The parameters to provide are:
- uri: address that identifies the content type;
- projection: list with the names of the columns whose values must be included in the response.
- selection: is the WHERE clause
- selectionArgs is the list of arguments for the WHERE clause
- sortorder: is the SQL ordering clause, as you can clearly see.