First idea: provide an unlock code based on IMEI encryption on your website.
When people buy the app on your website, they will have to enter a code at the app launch. The app will compare the uncrypted number to the phone IMEI.
So if people A with IMEI B share the app to people with IMEI C, the app won't work.
EDIT: read this great post to get a unique number for an Android device: Is there a unique Android device ID?
You can also try
Settings.Secure#ANDROID_ID
returns the Android ID as an unique 64-bit hex string.
import android.provider.Settings.Secure;
private String android_id = Secure.getString(getContext().getContentResolver(),
Secure.ANDROID_ID);
but It's known to be null sometimes, it's documented as "can change upon factory reset". Use at your own risk, and it can be easily changed on a rooted phone.
The weakest part will now be the Market, that's really easy to share and copy it.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…