0

In a nutshell, I've built an app using HTML/CSS/JS and Phonegap. It's still in testing phase. I have all my app's images saved in Google Cloud Storage (GCS). I have image tags (divs) within my app that needs to pull those images from GCS to the specific div. However, this method of just adding the direct URL only seems to work on iOS devices. What I need to know is, what is the correct method of pulling those images from GCS to my app so that it works on all platforms (iOS, Android, BlackBerry etc)? Do I need to add a line of code in the head of my index.html or does it have something to do with the config.xml? I've been looking for answers on the net, but nothing could give me clear-cut results that works across all platforms.

I'm still fairly new to the whole "app building game", please be gentle.

Here is some code:

    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width; height=device-height; initial-scale=1"/>
    <title>App Name</title>
    <link href="simple-flat.min.css" rel="stylesheet" type="text/css"/>
    <link href="jquery.mobile-1.3.1 /jquery.mobile.structure-1.3.1.min.css" rel="stylesheet" type="text/css"/>
    <link href="General.css" rel="stylesheet" type="text/css"/>
    <link href="owl-carousel/owl.carousel.css" rel="stylesheet" type="text/css"/>
    <script type="text/javascript" src="jquery.mobile-1.3.1 /demos/js/jquery.js"></script>
    <script type="text/javascript" src="jquery.mobile-1.3.1 /demos/js/jquery.mobile-1.3.1.min.js"></script>
    <script type="text/javascript" src="maps.js"></script>
    <script type="text/javascript" src="http://maps.google.com/maps/api/js?sensor=true"></script>
    <script type="text/javascript" src="cordova.js"></script>

    <script>var __adobewebfontsappname__="dreamweaver"</script>
    <script src="http://use.edgefonts.net/raleway:n1:default.js" type="text/javascript></script>

      <script type="text/javascript" charset="utf-8">

      function onLoad() {
      document.addEventListener("deviceready", onDeviceReady, false);
      }
      function onDeviceReady() {
      document.addEventListener("offline", onOffline, false);
      }
      function onOffline() {        
      navigator.notification.alert('Please check your internet connection', function() 
      {   },'Connection Failure','OK');
      window.location = "index.html#offline";  
      }

      </script>

      </head>
      <body onload="onLoad()">

      <div id="cultures" data-role="page" data-theme="a" >
    <div data-role="header" id="header" data-theme="a" data-position="fixed">
    <h1>Headline</h1>
    <div id="image" data-theme="c">
    <img src="http://commondatastorage.googleapis.com/about_namibia%2FHimba.jpg" width="100%"/></div>
    <div class="headline_bar"><h3>Cultures</h3></div>
     </div>

    <div data-role="content">
    <p>Some copy goes here.</p>
    </div>

    <div data-role="footer" id="footer" class="ui-bar" data-position="fixed">
    </div>
    </div>

    </body>
    </html>
  • "only seems to work on IOS devices" - despite of your question, what is not working in android? Code, Error logs? – 最白目 Nov 13 '13 at 09:49
  • The images serving from Google Cloud Service only display on iphone and ipad. When I open the app in android devices, the images don't display at all. Simply getting a big blank box with questionmark where image(s) are suppose to be. – user2987013 Nov 13 '13 at 18:09
  • Hi friend, thanks for your reply, can you show us some code? – 最白目 Nov 13 '13 at 20:14

0 Answers0