Get Recent Callers — Android PhoneGap Plugin
A simple PhoneGap plugin that fetches recent callers from an Android phone, with setup steps.
This is a simple PhoneGap plugin that fetches the recent callers from the phone. Follow the steps below to set up the plugin in your project.
Step 1: Download the plugin file:
sarathdr/recent-callers-phonegap on GitHub
Step 2: Create a new package called com.plugins.recentCallers and add RecentCallers.java to it.
Step 3: Register the plugin by adding the following line to res/xml/config.xml:
<plugin name="RecentCallers" value="com.plugins.recentCallers.RecentCallers" />
Step 4: You can now call the plugin from your JavaScript file as follows:
window.getRecentCallers = function (limit, callback) {
cordova.exec(callback, function (err) {}, "RecentCallers", "getRecentCallers", [limit]);
};
window.getRecentCallers(10, function (data) {
data.forEach(function (contact) {
alert(contact.name);
});
});