Android电子市场的API无法返回结果 [英] Android market API fails to return results

查看:118
本文介绍了Android电子市场的API无法返回结果的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有低于code被调用我的应用程序。
请将appname传递到执行方法的任何应用程序名称的用户
希望搜索。
最初,这个现在工作得很好,不过,我想主要应用
搜索没有返回任何结果。
例如,如果的appName =地图值的数组但是其返回,
如果的appName =第一资本找不到结果。
就像我上面说这样做的工作,然后有一天它只是停止
在返回的主要应用我做的搜索结果。
任何帮助将大大AP preciated。

 私人回调< AppsResponse>回调=新的回调< AppsResponse>(){
            公共无效onResult(ResponseContext背景下,AppsResponse响应){
                    清单<结果>名单=新的ArrayList<结果>();
                    清单<应用>应用程式= response.getAppList();
                    对于程序(App应用:应用){
                            结果R =新成果();
                            r.setArtistName(app.getCreator());
                            r.setArtistId(app.getCreatorId());
                            r.setKind(app.getAppType()的toString());
                            r.setTrackId(DROID_+ app.getId());
                            r.setPrice(app.getPrice());
                            r.setVersion(app.getVersion());
                            r.setAverageUserRating(app.getRating());
                            r.setUserRatingCount(将String.valueOf(app.getRatingsCount()));                            r.setTrackViewUrl(https://ssl.gstatic.com/android/market/
                                            + app.getPackageName());
                            list.add(R);
                    }
                    res.setResults(名单);
            }
    };
    公共ŧ执行(字符串的appName)抛出异常{
            查询字符串=的appName;
            session.login(电子邮件,密码);
            RES =新的SearchResult();
            AppsRequest appsRequest = AppsRequest.newBuilder()。setQuery(查询).setStartIndex(0).setEntriesCount(10).setWithExtendedInfo(真)
                            。建立();
            session.append(appsRequest,回调);
            调用Session.flush();
            返回(T)资源;
    }

这是发送到Android市场的背景

  authSubToken:道理放在这里
unknown1:0
版本:1002012
androidId:0123456789123456
deviceAndSdkVersion:克雷斯波:8
用户语言:恩
userCountry:我们
operatorAlpha:T-Mobile的
simOperatorAlpha:T-Mobile的
operatorNumeric:310260
simOperatorNumeric:310260


解决方案

您已经为您提供真正的Andr​​oid ID,使其工作。
这不是假的androidId:0123456789123456

您可以从GTALK服务监视器获得它
http://www.honeytechblog.com/monitor-google-talk-service-安卓/

(Android的ID数部分)

I have the below code that gets called in my application. the appName passed into the execute method is any app name the user wishes to search for. initially this worked fine, however now the main app that I want to search for are not returning any results. for example if appName="maps" an array of values is returned, however if appName="capitalOne" no results are found. Like I said above this did work and then one day it just stopped returning results for the main apps I do searches on. any help would be greatly appreciated.

    private Callback<AppsResponse> callback = new Callback<AppsResponse>() { 
            public void onResult(ResponseContext context, AppsResponse response) { 
                    List<Results> list = new ArrayList<Results>(); 
                    List<App> apps = response.getAppList(); 
                    for (App app : apps) { 
                            Results r = new Results(); 
                            r.setArtistName(app.getCreator()); 
                            r.setArtistId(app.getCreatorId()); 
                            r.setKind(app.getAppType().toString()); 
                            r.setTrackId("DROID_" + app.getId()); 
                            r.setPrice(app.getPrice()); 
                            r.setVersion(app.getVersion()); 
                            r.setAverageUserRating(app.getRating());
                            r.setUserRatingCount(String.valueOf(app.getRatingsCount())); 

                            r.setTrackViewUrl("https://ssl.gstatic.com/android/market/" 
                                            + app.getPackageName()); 
                            list.add(r); 
                    } 
                    res.setResults(list); 
            } 
    }; 
    public T execute(String appName) throws Exception { 
            String query = appName; 
            session.login("email", "password"); 
            res = new SearchResults(); 
            AppsRequest appsRequest = AppsRequest.newBuilder().setQuery(query) .setStartIndex(0).setEntriesCount(10).setWithExtendedInfo(true) 
                            .build(); 
            session.append(appsRequest, callback); 
            session.flush(); 
            return (T) res; 
    } 

This is the context that is sent to the android market

authSubToken: "token goes here"
unknown1: 0
version: 1002012
androidId: "0123456789123456"
deviceAndSdkVersion: "crespo:8"
userLanguage: "en"
userCountry: "us"
operatorAlpha: "T-Mobile"
simOperatorAlpha: "T-Mobile"
operatorNumeric: "310260"
simOperatorNumeric: "310260" 

解决方案

You have to provide you real android id to make it work. not this fake one androidId: "0123456789123456"

You can obtain it from gtalk service monitor http://www.honeytechblog.com/monitor-google-talk-service-android/

(number part of android id)

这篇关于Android电子市场的API无法返回结果的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆