title: cordova - call javascript from android background service cordova plugin
body: <p>Currently, I am developing an Ionic2 app that should have an ability to connect automatically to paired bluetooth devices in range while beeing closed/killed in order to collect specific data. </p>
  
  <p>Using this plugin <a href="https://github.com/Red-Folder/bgs-core" rel="nofollow noreferrer">https://github.com/Red-Folder/bgs-core</a>, I am creating a background service for android.</p>
  
  <p>Since most of the main app logic written in JS, I would like to know whether it is possible to call functionality written in JavaScript from cordova plugin (in case of Android from Java) while the application is closed. If yes, how can I do it?</p>
  
  <p>As an alternative, are there other cordova plugins that support background execution while an app is killed?</p>
  
  <p>I have found similar questions, however, none of them contains a sufficient solution:</p>
  
  <p><a href="https://stackoverflow.com/questions/21974248/run-javascript-in-background-service-on-android-phonegap">run javascript in background service on android phonegap</a></p>
  
  <p><a href="https://stackoverflow.com/questions/24584914/how-to-run-cordova-plugin-in-android-background-service">How to run cordova plugin in Android background service?</a></p>