• After 15+ years, we've made a big change: Android Forums is now Early Bird Club. Learn more here.

Apps Licensing My Application

Leolicos

Member
The sample application doesn't work for me... It crashes both in my emulator and on my G1 before it's even able to load the layout. I'm also not sure what it really does... I read the "Licensing your application" part on the site doc, but I'm still confused what really goes on and why it's important.
 
So I figured out why it was crashing... I didn't notice that I had to put my public key where it obviously said "PUT YOUR PUBLIC KEY HERE". Other than that it works now.

My next question is what part do I actually need to put in my application from the sample? Do I need the whole MainActivity Activity and have that run first? Or should I just add a certain port of the activity?

My guess is making that Activity just a normal class (NOT extending activity, so there's no onCreate, but instead a constructor), and put everything that's in onCreate() but in the constructor

Code:
public class MyLicense
{
   public MyLicense()
   {
        mHandler = new Handler();

        // Try to use more data here. ANDROID_ID is a single point of attack.
        String deviceId = Secure.getString(getContentResolver(), Secure.ANDROID_ID);

        // Library calls this when it's done.
        mLicenseCheckerCallback = new MyLicenseCheckerCallback();
        // Construct the LicenseChecker with a policy.
        mChecker = new LicenseChecker(
            this, new ServerManagedPolicy(this,
                new AESObfuscator(SALT, getPackageName(), deviceId)),
            BASE64_PUBLIC_KEY);
        doCheck();
    }
    // ... all other functons in the sample's code

Does that do everything I need to do for license checking?

Do I need all that?
 
I implemented this licensing in my app, and it seems super slow to me. Specifically, the AESObfuscator generates a secret key, and it is slow on my Hero (on the order of several seconds).

Is anyone else experiencing this? Thanks!
 
Back
Top Bottom