Source code which you can integrate into own application for checking
black list.

/**
* Determines status of device's IMEI.
*
* @return -1 - imei status retrieval failed. 0 - Green status 1 to 3 -
Yellow
* status 3 to 5 - Brown status above 5 - Red status
*/
public int getIMEIStatus()
{
  // 1. Get device ID
  TelephonyManager manager = (TelephonyManager)getSystemService
(Context.TELEPHONY_SERVICE);
  String sDeviceID = manager.getDeviceId();
  // 2. Fetch for IMEI data.
  // Will look like
  // http://www.artfulbits.com/android/antipiracycheck.ashx?IMEI=123456789123456
  String url = "http://www.artfulbits.com/android/antipiracycheck.ashx?
IMEI="
              + sDeviceID;
  // Server will return 200 if request post was successful.
  final int http_ok = 200;
  // Create new http client.
  HttpClient client = new DefaultHttpClient();
  // Create new http post.
  HttpPost post = new HttpPost(url);
  // Cache http response.
  HttpResponse response = null;
  // Will return -1 unless server provides its own value.
  int imeiStatus = -1;
  try
  {
    // Executind post.
    response = client.execute(post);
    // Making sure we've received correct status code.
    if(response.getStatusLine().getStatusCode() == http_ok)
    {
      // Retrieving content stream.
      InputStream stream = response.getEntity().getContent();
      // Decorating stream with Input stream reader
      InputStreamReader isr = new InputStreamReader(stream);
      // Decorating input stream reader with buffered stream reader.
      BufferedReader reader = new BufferedReader(isr);
      // Reading imei status from stream.
      imeiStatus = Integer.parseInt(reader.readLine());
      // Closing buffered reader will recursively close decorated
input stream
      // reader and input stream.
      reader.close();
    }
  }
  catch(Exception e)
  {
        e.printStackTrace();
  }
  return imeiStatus;
}

On Nov 16, 7:57 pm, AlexK <kucherenko.a...@gmail.com> wrote:
> I just did publishing of the web service!
>
> All details can be found here:
>
> http://www.artfulbits.com/Android/antipiracy.aspx
>
> In 5 minutes I'll update database by our latest catched pirate phones.
>
> On Nov 16, 2:19 pm, "admin.androidsl...@googlemail.com"
>
>
>
> <admin.androidsl...@googlemail.com> wrote:
> > +1
>
> > This keeps coming up but I am bumping because it shouldn't be ignored
> > by Google.
>
> > Problem is people can buy and refund within 24 hours. So we need a web
> > service apps can call where we can send a device ID plus a google
> > checkout number which confirms a valid non-cancelled order. If this
> > web service could be centralised to check other app markets too, we
> > would all be laughing.
>
> > Its not cost effective for a single dev to work out a solution. A team
> > of people should be driving this forwards where they can keep an eye
> > on what the pirates are doing and continue to improve the system as
> > the pirates continue to break it.
>
> > So the question then becomes a monetary one. No one has the motivation
> > to build a system without a monetary incentive. So how about all app
> > devs who are interested in the scheme support the anti-piracy
> > developers by paying a monthly subscription. Most app devs would be
> > happy to do so if they can claw back 100's of pirated copies of their
> > apps.

-- 
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

Reply via email to