Quantcast
Channel: Ionic Forum - Latest posts
Viewing all articles
Browse latest Browse all 228595

Where to put assets so the app can find them when built on Android?

$
0
0

Hi all,

I've been building my first ionic + cordova app, originally with VS 2015 and have since thrown that out for text editor + CLI.

I'm having a problem where all images I had in my [project name]\www\img and [project name]\www\audio folders, that I am targeting via my controllers, are not loading when the app is built and run on android. However, they work fine when testing in Ripple (via VS). An example:

$ionicLoading.show({
        template: '<html><body><h1>SOMETEXT</h1><div><img src="../img/countdown.gif" /></div></body></html>',
        animation: 'fade-in',
        showBackdrop: false,
        maxWidth: 80,
        showDelay: 0,
    });

I've tried swapping the img src for a link to some image hosted online, and that works fine for mobile.

So ultimately, where should my img src be pointing? (And likewise for the below):

var src = "questions/"+$scope.qd.Q_Audio
media = $cordovaMedia.newMedia(src, null, null, null)
media.play();

Viewing all articles
Browse latest Browse all 228595

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>