Skip to Content

SAPUI5 Application works fine in Browser but not in Mobile

Hi Experts,

I am new to sapui5. I have developed one sample mobile application using SAPUI5.

In that application I used fake OS and disable the web security in Chrome.Then it's working fine.

I deployed same Application in mobile using Phonegap. But when I run that application I am getting

HTTP Request Failed0,, - at file:///android_asset/www/sapui5/resources/sap-ui-core.js:41


and doesn't give any output.

Please find the Below code

/** Code for Model Creation **/

var sServiceUrl = "http://xxx.xx.xx.x/ZTEST_CUURENCY_SRV";

var oModel = new sap.ui.model.odata.ODataModel(sServiceUrl, true, "username", "password");

sap.ui.getCore().setModel(oModel);

/** Code for list binding in view .js file**/

var currencyListHeader = new sap.m.List('currency_list',{

inset : false,

headerText : "Currency List",

footerText : "End",

width: "50%"

});

var itemTemplate = new sap.m.StandardListItem({

title : "{Currency}",

description: "{AltCurr}",

iconInset: false

});

currencyListHeader.bindAggregation("items",{

path: "/Currency",

template: itemTemplate

});

return currencyListHeader;

Please help me to solve this issue

Thanks&Regards

Sridevi


Add a comment
10|10000 characters needed characters exceeded

Assigned Tags

Related questions

3 Answers

  • Best Answer
    author's profile photo Former Member
    Former Member
    Posted on Sep 12, 2013 at 05:21 AM

    Hi SriDevi,

    Do you use sapui5-mobile-static.zip library or some thing else.

    This is jQuery version issue you need 1.7v of jQuery.

    Thanks

    Manoj

    Add a comment
    10|10000 characters needed characters exceeded

    • Hi Manoj,

      It's very helpful to me .As you said I copied the resource folder in sapui5-mobile-static in my phonegap application.

      Still I am getting same error as I mentioned earlier.

      I added the following script in index.html file of my application.

      <script src="sapui5/resources/sap-ui-core.js"

      id="sap-ui-bootstrap"

      data-sap-ui-libs="sap.m"

      data-sap-ui-theme="sap_mvi" >

      </script>

      Below is my project Structure

      when I run that application I am getting the following error

      Please help me to solve this

      Thanks&Regards

      Sridevi

      proj_Structure.jpg (43.0 kB)
      error.jpg (128.0 kB)
  • author's profile photo Former Member
    Former Member
    Posted on Sep 16, 2013 at 05:13 AM

    Hi Sridevi,

    I have made one sample application for mobile (Android version) via using PhoneGap.

    1. Create One Android Application.

    2. Copy cordova.js and library file in correspondence places.

    3. copy sapui5 library to www-> lib place.

    4. copy your project controllers and view files included folder structure.

    5. map sap core js file path in html file.

    this HTML must have link Cordova.js,jquery1.8.js and Your sap html file code.

    After that RUN your application It's work 100%.

    I will share GITHub url where you can download sample code and RUN .

    Regards

    Manoj

    Add a comment
    10|10000 characters needed characters exceeded

  • author's profile photo Former Member
    Former Member
    Posted on Sep 12, 2013 at 05:56 AM

    Hi,

    I think you forgot to include the SAPUI5 library in your PhoneGap Project. When you test your application in Eclipse, you run your application on a server created by Eclipse that includes all the needed libraries.

    When you build apps with PhoneGap you need to include those libraries in your project.

    The 1.12.1 version of SAPUI5 you downloaded contains a .zip-file named "sapui5-mobile-static.zip". Unzip it, take the "resources"-folder and copy it at the same level as your "index.html" in your PhoneGap project.

    It should run without problems.

    Happy testing,

    Christoph

    Add a comment
    10|10000 characters needed characters exceeded

    • Hi ,

      I already included that resource folder in my application. Still I am getting the same error message in logcat .

      I included that files in index.html like below

      <script src="sapui5/resources/sap-ui-core.js"

      id="sap-ui-bootstrap"

      data-sap-ui-libs="sap.m"

      data-sap-ui-theme="sap_mvi" >

      </script>

      <script type="text/javascript" src="phonegap/cordova-2.7.0.js"></script>

      My project structure is like below.

      When I am using Public URL which is given by SAPUI5 Demo kit ,

      http://services.odata.org/Northwind/Northwind.svc/

      then I am getting output without having any errors

      We don't have any proxy server. Is it any proxy problem with my application?

      I have done all the ways to solve this proxy issue by following the below thread.But I can't get the solution.

      http://scn.sap.com/thread/3380807


      Please help me to get out of here.

      Thanks&Regards

      Sridevi

      Proj_Structure.jpg (38.6 kB)

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.