Using service workers on android


I have an ionic 2 app which uses service workesr. When i execute it in the browser everything works fine, however when i run the app on an android device i get an error due to the use of file protocol. Does anyone know any solution to this problem? Or at least another somewhat easy way to achieve cache and background-sync without the use of service workers?