on 08-28-2014 10:30 AM
Hi All,
While doing testing of our application which is accessing the odata service and getting the data from there, we are not able to experience the app in android emulator.
In the browser (chrome) the app is doing good and all the pages are loading. The app is able to connect the odata and storing the same in an array.
When we burn the same app to emulator, the line where we are storing the data to an array after accessing the odata is throwing error:
"08-28 14:57:36.444: E/Web Console(639): Uncaught TypeError: Cannot read property 'results' of undefined at file:///android_asset/sample_makit.html:2072"
that particular portion of code:
var oModel2= new sap.ui.model.odata.ODataModel("our url");
sap.ui.getCore().setModel(oModel2);
var TableData = new Array();
TableData=oModel2.attachRequestCompleted(function(){oModel2.getProperty("/MeterReadingResults")});
var auxArray = new Array();
oModel2.read("/Devices('10010708')/MeterReadingResults",
null, null, false, function(oData, oResponse){
auxArray = oData;
});
TableData=auxArray.results;
Kindly help me in this regard,
Regards,
Arun
Hi All,
For example please help me in converting the below code into android app. The code is just displaying the company name from odata service (northwind).
<!DOCTYPE html>
<html><head>
<meta http-equiv='X-UA-Compatible' content='IE=edge' />
<meta http-equiv='Content-Type' content='text/html;charset=UTF-8'/>
<title>Table with OData Binding</title>
<script id='sap-ui-bootstrap' type='text/javascript'
src="resources/sap-ui-core.js"
data-sap-ui-libs="sap.m,sap.ui.commons,sap.ui.table"
data-sap-ui-theme="sap_bluecrystal"></script>
<script>
var oModel = new sap.ui.model.odata.ODataModel("http://services.odata.org/V3/Northwind/Northwind.svc/");
sap.ui.getCore().setModel(oModel);
var oText = new sap.ui.commons.TextView("l1", {text: "{CompanyName}"});
oText.bindElement("/Customers('ALFKI')");
oText.placeAt("content");
var app = new sap.m.App("myApp", {initialPage:"page1"});
var page1 = new sap.m.Page("page1", {
title: "TCS Power Network",
content : [oText]
});
app.addPage(page1);
app.placeAt("content");
</script>
</head>
<body class='sapUiBody'>
<div id='content'></div>
</body>
</html>
Regards,
Arun
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
I assume that you are developing a web application (not a cordova/hybrid app) using UI5. If you are running the app in the android default browser you may face some issues. UI5 best runs in chrome browser. So what I suggest is to install chrome in your android device/emulator and test.
To install chrome on emulator : if you don't have apk for chrome, install apk extractor app in a real android device >install chrome mobile app>use apk extractor app to get the apk file of chrome>send it to the laptop>install apk in emulator using the command line How do you install an APK file in the Android emulator? - Stack Overflow
Regards,
Midhun VP
Hi Midhun,
No My problem is different,
I want to convert the web application to an android hybrid app.
As i told the application i developed is working fine in web application, as you suggested I am also using chrome to develop the same.
My next step is to convert the same into an hybrid app?
In order to understand that i posted the simple code for Northwind to convert to an app?
Could you please help in this regard?
Regards,
Arun
User | Count |
---|---|
87 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.