Using a PHP implementation of the java android market API I'm attempting to display the top 10 most popular applications.
Using the code below:
<?php
include("local.php");
include("../proto/protocolbuffers.inc.php");
include("../proto/market.proto.php");
include("../Market/MarketSession.php");
$session = new MarketSession();
$session->login(GOOGLE_EMAIL, GOOGLE_PASSWD);
$session->setAndroidId(ANDROID_DEVICEID);
$ar = new AppsRequest();
$ar->setOrderType(AppsRequest_OrderType::POPULAR);
$ar->setStartIndex(0);
$ar->setEntriesCount(10);
//free or paid
//$ar->setViewType(AppsRequest_ViewType::ALL);
//arcade etc
//$ar->setCategoryId("ARCADE");
$reqGroup = new Request_RequestGroup();
$reqGroup->setAppsRequest($ar);
$response = $session->execute($reqGroup);
$groups = $response->getResponsegroupArray();
foreach ($groups as $rg) {
$appsResponse = $rg->getAppsResponse();
$apps = $appsResponse->getAppArray();
foreach ($apps as $app) {
echo $app->getTitle()."<br/>";
}
}
But the results I'm getting aren't exactly what I expected:
Brightest Flashlight Freeâ„¢
LauncherPro
Seesmic (Facebook, Twitter)
Android Assistant(18 features)
Pho.to Lab
US Yellow Pages
Sudoku Free
Color Flashlight
ElectroDroid
Scanner Radio
I expected the list of top 10 apps to contain Gmail, Facebook, Youtube etc
Anyone know why this could be happening? Any alternative APIs we could use? Any other way we can acheive this?