I everybody. My application get data with xml. This datas are in tableview.This application run in iphone and ipad but not on android. I don't understand my errors. You can help me please?
My code is:
function AndroidInterview() { var Menu2 = require('ui/common/AndroidMenu2'); var menu2 = new Menu2(); menu2.right = '100%'; var etat = true; var self = Ti.UI.createView({ backgroundColor:'#333333', height:'100%', width:'100%' }); var bar = Ti.UI.createView({ backgroundColor:'#FF445D', height:changeDim(30,'h'), width:'100%', top:0 }); var contact = Ti.UI.createLabel({ text:'LES INTERVIEWS', color:'#FFF', width:'100%', textAlign:'center', height:changeDim(30,'h'), font:{fontFamily:'Anisette-Light',fontSize:changeDim(12,'w')} }); var send_menu = Ti.UI.createLabel({ backgroundImage:'/images/bt_menu.jpg', width:changeDim(58,'w'), height:changeDim(43,'h'), left:0, }); var data; var i = 0; var j = 0; var feedTableView; var feedTitle = ''; function displayItems(evenement){ for (var c=0;c < evenement.length;c++){ var artiste = null; var texte = null; var photo = null; id = evenement.item(c).getAttribute("id"); artiste = evenement.item(c).getAttribute("artiste"); texte = evenement.item(c).getAttribute("texte"); photo = evenement.item(c).getAttribute("photo"); texte=texte.replace(/\\n/g,'\n'); var row = Ti.UI.createTableViewRow({height:72,backgroundColor:'#eeeeee',selectedBackgroundColor:'#FCEE21'}); var imgPhotoView = Ti.UI.createView({ top:'auto', left:changeDim(10,'w'), width:changeDim(100,'w'), height:changeDim(60,'h') }); var imgPhoto = Ti.UI.createImageView({ top:'auto', width:'auto', height:changeDim(60,'h'), image:'http://www.sonotheque-hn.com/'+photo }); var titre_news = Ti.UI.createLabel({ width:'75%', left:'20%', text:artiste, color:'#666666' }); var img = Ti.UI.createImageView({ top:'auto', right:'10%', width:changeDim(11,'w'), height:changeDim(21,'h'), image:'/images/arrow.png', }); if(photo != ''){ //imgPhotoView.add(imgPhoto); row.add(img); } row.add(imgPhotoView); row.add(titre_news); row.thisArtiste = artiste; row.thisTexte = texte; row.thisPhoto = photo; if(c <= 5)data[c] = row; // I use 'i' here instead of 'c', as I'm only adding rows which have mp3 enclosures } // create the table feedTableView = Titanium.UI.createTableView({ data:data, top:changeDim(50,'h'), width:'100%', height:'97%' }); bar.addEventListener('click', function(e) { menu2.animate({ right:'50%', }); }); // Add the tableView to the current selfdow bar.add(send_menu); bar.add(contact); self.add(bar); self.add(feedTableView); self.add(menu2); feedTableView.addEventListener('click', function(e){ var win = Ti.UI.createWindow({ height:"100%", width:"100%", top:0, backgroundColor:'#333', modal:true, navBarHidden:true }); /*var scrollView=Titanium.UI.createScrollView({ contentHeight:'auto', contentWidth:'auto', backgroundColor:'#fff', width:'100%', height:"auto", top:0, layout:'vertical' });*/ var viewTop = Ti.UI.createView({ backgroundColor:'#FF445D', height:changeDim(50,'h'), width:'100%', top:0 }); var bt_x = Ti.UI.createLabel({ backgroundImage:'images/quit.png', width:changeDim(23,'w'), height:changeDim(23,'h'), left:changeDim(15,'w'), }); viewTop.addEventListener('click', function(e){ win.close(); }); viewTop.add(bt_x); if(e.rowData.thisPhoto != ''){ var webTexte = Ti.UI.createWebView({ html:'<img src="http://www.sonotheque-hn.com/'+e.rowData.thisPhoto+'" width="'+750+'" /><br/><br/><div style="width:60%; padding-left:20%">'+e.rowData.thisTexte+'</div><br/><br/>', width:self.width, height:'95%', font:{fontSize:changeDim(16,'h')}, color: '#666', textAlign:'left', top:changeDim(50,'h'), showScrollbars : false, scalesPageToFit : false, enableZoomControls : false }); /*var img = Ti.UI.createImageView({ top:0, left:0, width:'100%', height:'auto', image:'http://www.sonotheque-hn.com/'+e.rowData.thisPhoto, }); scrollView.add(img);*/ }else{ var webTexte = Ti.UI.createWebView({ html:'<div style="width:60%; padding-left:20%">'+e.rowData.thisTexte+'</div>', width:self.width, height:'100%', font:{fontSize:changeDim(16,'h')}, color: '#666', textAlign:'left', top:changeDim(50,'h'), showScrollbars : false, scalesPageToFit : false, enableZoomControls : false }); } //scrollView.add(webTexte); win.add(viewTop); win.add(webTexte); win.open(); }); // } function loadRSSFeed(){ data=[]; var xhr = Titanium.Network.createHTTPClient(); xhr.onload = function() { var doc = this.responseXML.documentElement; var evenement = doc.getElementsByTagName("evenement"); displayItems(evenement); }; xhr.open('GET','http://www.sonotheque-hn.com/application_interview.php'); // xhr.send(); } loadRSSFeed(); return self; } module.exports = AndroidInterview;