Android API for retrieving list of apps in Market

by Scott » Tue, 16 Dec 2008 06:07:22 GMT

Sponsored Links
 I'm looking for a way to get a list of all the apps available in the
Android Market.  I'm guessing the market interfaces with some sort of
database that stores the information, so I'm hoping there's some sort
of API I could reference to retrieve this information.  This is so I
can work on a web market for Android for users to view outside their


Other Threads

1. Debugging in Eclipse - current line wrong for methods with multiple return points

You can view the code and "positions" tables with:

% dexdump -d myapp.apk

Search for your method (DebugProblem1.m).  Skip past the instructions
to find the "positions" table, which has pairs of Dalvik instruction
offsets and line numbers.  When I do this in a test class that matches
yours I get:

000108:                                        |[000108] Foo.m:(I)I
000118: 1210                                   |0000: const/4 v0, #int
1 // #1
00011a: 3302 0300                              |0001: if-ne v2, v0,
0004 // +0003
00011e: 1200                                   |0003: const/4 v0, #int
0 // #0
000120: 0f00                                   |0004: return v0
      catches       : (none)
      positions     :
        0x0001 line=18
        0x0003 line=19
        0x0004 line=22
      locals        :
        0x0000 - 0x0005 reg=1 this LFoo;

The code is very simple:

 0000 load 1 into v0
 0001 if the method argument (v2) does not equal v0, branch to 0004
 0003 load 0 into v0
 0004 return v0

As you can see, there's only one "return" statement, shared by both
code paths.  This is why the de{*filter*} leaps around.  The situation
could be avoided by adding additional instructions, but that's
generally undesirable.

It's a bit like debugging native code built with "-g -O2".  (That
thought inspired me to try it with "dx --no-optimize", but that still
used a common return statement and suffered from the same problem.)

The Java bytecode for this class does have two returns, and would
display correctly in a de{*filter*}:

private int m(int);
   Stack=2, Locals=2, Args_size=2
   0:   iload_1
   1:   iconst_1
   2:   if_icmpne       7
   5:   iconst_0
   6:   ireturn
   7:   iconst_1
   8:   ireturn
   line 18: 0
   line 19: 5
   line 22: 7

Bottom line: this is an artifact of the conversion from Java bytecode
to Dalvik bytecode.


2. TabActivity + TabContentFactory + inflated layouts... problem

Hi guys,

First, I'm really sorry for the wtf subject but I couldn't find a way
to describe the problem in 1 sentence, so here it is...

I have an activity which extends TabActivity and implements TabContentFactory.
For simplicity's sake I'll limit the problem to 1 tab.

In onCreate() I do this:

TabHost host = getTabHost();
LayoutInflater inflater = LayoutInflater.from(this);
mSomeLayout = (LinearLayout)inflater.inflate(R.layout.some_layout, null);

In createTabContent:

if (tag.equals("the_tab_tag")) return mSomeLayout;

So far, so great. I get the tab, the layout is displayed.

I also have a button in the layout, so I do:

mButton = (Button)mSomeLayout.findViewById(;

And then I subscribe to it's click event:

mButton.setOnClickListener(new View.OnClickListener()
                        public void onClick(View v)

Now, here's the problem. I click the button and nothing happens.
I can for example execute the following code from elsewhere:


and the button will get disabled, but when I tap it (in its *enabled*
state) - nothing happens.

Can someone help me? Am I doing something wrong?

If I'm not, could it be that I have another tab, where the another
inflated copy of the same layout is displayed?
However, in this layout's button's OnClickListener nothing happens as well.

I'm really stuck, so thanks for any suggestions!



3. Layout file not recognized as such in eclipse

4. Max size of URL on the browser and POST

5. Omx video encoding in Cupcake

6. create an image "on the fly" and assign it to a button

7. How can active installs go *down* on a paid app?