[android-developers] Re: Is there a way to determine if a user has purchased a specific application in the market?

2009-07-22 Thread Al Sutton

Taking this a bit further you could use the AndAppStore licensing
system if you didn't want to run your own database.

More info is at http://andappstore.com/AndroidApplications/licensing.jsp

Al.

--

* Written an Android App? - List it at http://andappstore.com/ *

==
Funky Android Limited is registered in England  Wales with the
company number  6741909. The registered head office is Kemp House,
152-160 City Road, London,  EC1V 2NX, UK.

The views expressed in this email are those of the author and not
necessarily those of Funky Android Limited, it's associates, or it's
subsidiaries.


On Jul 21, 11:56 pm, Mike mmille...@gmail.com wrote:
 You could get a unique ID from the user's phone, refer to this blog
 post:http://strazzere.com/blog/?p=116

 Then, instruct the user to enter the unique ID when they submit their
 donation, and keep this information in a database.

 Voila! You can now determine who has donated by making a web service
 call to your server from your game.

 On Jul 21, 3:34 pm, Mike michaeldouglaskra...@gmail.com wrote:

  Use case goes like this:

  1) Dev puts game for sale on Android market hoping to make lots of $$
  $.
  2) Dev makes $50 in a month, cries a little, realizes his game is
  languishing in the ratings so makes it free.
  3) Game does really well and gets  50,000 downloads.
  4) Dev still wants to make some $$$ off his game, so adds a donate
  feature to app which points users to another app dev has created in
  the marketplace where they can donate by buying the app.
  5) Dev wants to reward those who have donated by providing new
  features only to them.

  So...  how do I go about determining if any given user has purchased
  either my original app, or my donate app so that I can unlock
  functionality?  I'd like to determine this even if the user no longer
  has the app installed on their phone.

  Then android market app seems to know this which is how it knows not
  to charge the user again for the same app they've already paid for.

  - Mike
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Is there a way to determine if a user has purchased a specific application in the market?

2009-07-22 Thread MrChaz

Assuming they still had it installed it you could just query the
PackageManager for it.
Otherwise I dunno, maybe it's possible to write stuff into the
SharedPreferences somehow

On Jul 21, 11:34 pm, Mike michaeldouglaskra...@gmail.com wrote:
 Use case goes like this:

 1) Dev puts game for sale on Android market hoping to make lots of $$
 $.
 2) Dev makes $50 in a month, cries a little, realizes his game is
 languishing in the ratings so makes it free.
 3) Game does really well and gets  50,000 downloads.
 4) Dev still wants to make some $$$ off his game, so adds a donate
 feature to app which points users to another app dev has created in
 the marketplace where they can donate by buying the app.
 5) Dev wants to reward those who have donated by providing new
 features only to them.

 So...  how do I go about determining if any given user has purchased
 either my original app, or my donate app so that I can unlock
 functionality?  I'd like to determine this even if the user no longer
 has the app installed on their phone.

 Then android market app seems to know this which is how it knows not
 to charge the user again for the same app they've already paid for.

 - Mike
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Is there a way to determine if a user has purchased a specific application in the market?

2009-07-22 Thread Mike

Hey there Mr Chaz!  :)

Hmmm... I think I'm leaning towards just requiring people that buy my
donate app to keep it on their phones and I'll look for it using the
PackageManager as you suggested.

I really don't want to deal with maintaining a web server and a
backend database if I don't have to.  I'm making next to nothing off
of this anyway, so the thought of spending yet more money on
infrastructure seems a little premature at this point.

- Mike

On Jul 22, 5:30 am, MrChaz mrchazmob...@googlemail.com wrote:
 Assuming they still had it installed it you could just query the
 PackageManager for it.
 Otherwise I dunno, maybe it's possible to write stuff into the
 SharedPreferences somehow

 On Jul 21, 11:34 pm, Mike michaeldouglaskra...@gmail.com wrote:

  Use case goes like this:

  1) Dev puts game for sale on Android market hoping to make lots of $$
  $.
  2) Dev makes $50 in a month, cries a little, realizes his game is
  languishing in the ratings so makes it free.
  3) Game does really well and gets  50,000 downloads.
  4) Dev still wants to make some $$$ off his game, so adds a donate
  feature to app which points users to another app dev has created in
  the marketplace where they can donate by buying the app.
  5) Dev wants to reward those who have donated by providing new
  features only to them.

  So...  how do I go about determining if any given user has purchased
  either my original app, or my donate app so that I can unlock
  functionality?  I'd like to determine this even if the user no longer
  has the app installed on their phone.

  Then android market app seems to know this which is how it knows not
  to charge the user again for the same app they've already paid for.

  - Mike
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Is there a way to determine if a user has purchased a specific application in the market?

2009-07-22 Thread Mike

So, assuming Android 1.5 is running on the phone I am planning on
doing the following:

Of course, the other fun thing about trying to test this is that I
can't buy my own friggin' app through the market.  I'm hoping others
can look at this code and help verify that checking for uninstalled
packages using the GET_UNINSTALLED_PACKAGES flag will do what I think
it will.

private Boolean isUserHasPaid = null;

private static final String DONATE_PACKAGE_NAME = my.donate.package;

/**
 * Determines if a user has donated.
 *
 * This is determined by checking with the PackageManager and seeing
if the
 * donate app is currently installed, or if it is not installed, we'll
check to see
 * if they had it installed and uninstalled it.
 *
 * @param ctx The context
 *
 * @return true if user has donated, else false
 */

public boolean isUserHasPaid(Context ctx)
{
if (isUserHasPaid == null)
{
PackageInfo pi = null;

try
{
pi = 
ctx.getPackageManager().getPackageInfo(DONATE_PACKAGE_NAME,
PackageManager.GET_ACTIVITIES);
}
catch (NameNotFoundException e)
{
// Eat this exception - pi will be null if the package 
was not
found
}

if (pi == null)
{
try
{
pi = 
ctx.getPackageManager().getPackageInfo(DONATE_PACKAGE_NAME,
PackageManager.GET_UNINSTALLED_PACKAGES);
}
catch (NameNotFoundException e)
{
// Eat this exception - pi will be null if the 
package was not
found
}
}

isUserHasPaid = Boolean.valueOf(pi != null);
}

return isUserHasPaid;
}

On Jul 22, 10:10 am, Mike michaeldouglaskra...@gmail.com wrote:
 Hey there Mr Chaz!  :)

 Hmmm... I think I'm leaning towards just requiring people that buy my
 donate app to keep it on their phones and I'll look for it using the
 PackageManager as you suggested.

 I really don't want to deal with maintaining a web server and a
 backend database if I don't have to.  I'm making next to nothing off
 of this anyway, so the thought of spending yet more money on
 infrastructure seems a little premature at this point.

 - Mike

 On Jul 22, 5:30 am, MrChaz mrchazmob...@googlemail.com wrote:

  Assuming they still had it installed it you could just query the
  PackageManager for it.
  Otherwise I dunno, maybe it's possible to write stuff into the
  SharedPreferences somehow

  On Jul 21, 11:34 pm, Mike michaeldouglaskra...@gmail.com wrote:

   Use case goes like this:

   1) Dev puts game for sale on Android market hoping to make lots of $$
   $.
   2) Dev makes $50 in a month, cries a little, realizes his game is
   languishing in the ratings so makes it free.
   3) Game does really well and gets  50,000 downloads.
   4) Dev still wants to make some $$$ off his game, so adds a donate
   feature to app which points users to another app dev has created in
   the marketplace where they can donate by buying the app.
   5) Dev wants to reward those who have donated by providing new
   features only to them.

   So...  how do I go about determining if any given user has purchased
   either my original app, or my donate app so that I can unlock
   functionality?  I'd like to determine this even if the user no longer
   has the app installed on their phone.

   Then android market app seems to know this which is how it knows not
   to charge the user again for the same app they've already paid for.

   - Mike
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---



[android-developers] Re: Is there a way to determine if a user has purchased a specific application in the market?

2009-07-21 Thread Mike

You could get a unique ID from the user's phone, refer to this blog
post: http://strazzere.com/blog/?p=116

Then, instruct the user to enter the unique ID when they submit their
donation, and keep this information in a database.

Voila! You can now determine who has donated by making a web service
call to your server from your game.

On Jul 21, 3:34 pm, Mike michaeldouglaskra...@gmail.com wrote:
 Use case goes like this:

 1) Dev puts game for sale on Android market hoping to make lots of $$
 $.
 2) Dev makes $50 in a month, cries a little, realizes his game is
 languishing in the ratings so makes it free.
 3) Game does really well and gets  50,000 downloads.
 4) Dev still wants to make some $$$ off his game, so adds a donate
 feature to app which points users to another app dev has created in
 the marketplace where they can donate by buying the app.
 5) Dev wants to reward those who have donated by providing new
 features only to them.

 So...  how do I go about determining if any given user has purchased
 either my original app, or my donate app so that I can unlock
 functionality?  I'd like to determine this even if the user no longer
 has the app installed on their phone.

 Then android market app seems to know this which is how it knows not
 to charge the user again for the same app they've already paid for.

 - Mike
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers-unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
-~--~~~~--~~--~--~---