B4A Library Trial License Manager dla Android - End of Trial Period.

Hello,

I would like to introduce you to my library "Trial License Manager for Android."
TLMdroid software calculates the serial code for a specific user
and checks the number of days until the end of the trial period the application.

To calculate the serial codes transmitted is five parameters:
Par1 = "Name user license"
Par2 = "Application name"
Par3 = "E-mail your license"
PAR4 = "Unique identifier, eg .: IMEI"
Par5 = "Expiration of license (Date Format: dd-mm-yyyy)"

An example of the use of the library is in the attached below code.

B4X:
Sub Process_Globals
    'These global variables will be declared once when the application starts.
    'These variables can be accessed from all modules.
   
    Dim cfis As TLMdroid

End Sub

Sub Globals
    'These global variables will be redeclared each time the activity is created.
    'These variables can only be accessed from this module.

End Sub

Sub Activity_Create(FirstTime As Boolean)
    'Do not forget to load the layout file created with the visual designer. For example:
    Private expPar1,expPar2,expPar3,expPar4,expKeys,expDate As String

    Private pid As PhoneId

    expPar1 = "Name user license"
    expPar2 = "Application name"
    expPar3 = "E-mail your license"
    expPar4 = pid.GetDeviceId    'The code IMEI
    expDate = "01-12-2015"       'Date Expiration of license (format daty: dd-MM-yyyy)

    cfis.Initialize
    expKeys = cfis.CodiceF(expPar4 & expPar3 & expDate & expPar2 & expPar1)
    cfis.Parameters(expPar1,expPar2,expPar3,expPar4,expKeys,expDate)

    Try
        Msgbox("License: " & cfis.RegisteredVersion & " days left.", "License expiration date")
    Catch
        ToastMessageShow("End of Trial Period" & CRLF & "Closing Application ...", True)
        ExitApplication
    End Try
End Sub

Sub Activity_Resume
End Sub

Sub Activity_Pause (UserClosed As Boolean)
End Sub
 

Attachments

  • TLMdroid v1.02.zip
    3.7 KB · Views: 198

susu

Well-Known Member
Licensed User
Longtime User
Thank you.
What if the device does not have IMEI?
 

T201016

Active Member
Licensed User
Longtime User
Hi,
See this link as well: Android Device Unique ID - Alternative to PhoneId

Generally, each of these five parameters you can use in any way.
You can instead of IMEI enter any string of characters or use your own generator unique passwords ...

This will generate a GUID, make sure to enable the Reflector library.

B4X:
Dim r As Reflector
r.Target = r.RunStaticMethod("java.util.UUID", "randomUUID", Null, Null)
Return r.RunMethod("toString")
 
Top