I am building a Sencha touch 2 app.
I have a store that gets json data from a local php file.
This works fine when I run it on Google chrome (localhost). The List get populate with the correct data. However when i deploy the app to a android simulator the list doesn't get populated and LagCat shows the following message
0[WARN][Ext.data.reader.Reader#process] Unable to parse the JSON returned by the server: Error: You're trying to decode an invalid JSON String: <?php //Contents of the php file ?>
My store:
Ext.define('app.store.Info', {
extend: 'Ext.data.Store',
requires: [
],
config: {
model: 'app.model.info',
autoLoad: true,
proxy: {
type: 'ajax',
url: 'getinfo.php',
reader: {
type: 'json'
}
}
}
});
my php file uses json_encode to convert a array to json.
I know the php file is correct because it works when i test in Chrome. I am wondering if i have to do something special to run php in an Android app.