Reputation: 674
I created an application that display dynamically a list view from Data Base I used HTML5 JQuery Mobile and PHP and running it with Trigger.io on emulator Android so it works good on browsers and display the list contains an image and text..
so here's so codes the html5
<div data-role="page" id="restaurant_favoris" data-theme="c" >
<div data-role="header">
</div>
<div data-role="content" class="ui-content-list">
<ul data-role="listview">
<?php render('resto') ?>
</ul>
</div>
</div>
the php call a service that iterate a Table and display
<li>
<a href="#">
<img src="assets/img/list/album-k.jpg" />
<h3>Name <?php echo $favoritrestaurant->name?></h3>
<p>nombre de points est <?php echo $favoritrestaurant-> nombre_points?></p>
</a>
</li>
like I said it works on browsers and no things to display on emulator android 2.2
Upvotes: 0
Views: 166
Reputation: 45
Are you doing a Forge-Run-Android?
That will not work trying to run PHP on Android.
You will need to create a service on your web server where your database resides and call that service with javascript, ideally returning the data in something like JSON. Call it with forge.request.ajax and process the results similarly to how your are with PHP, just do it with javascript.
See Docs here: https://trigger.io/modules/request/current/docs/index.html#forgerequestajaxoptions
Upvotes: 1