My tests APPS are always reported as LICENSED, when the console is set to NOT_LICENSED. I have uploaded the test app, but not published it.
This isn't the entire app, but I stripped out enough to show what I am doing to see if some one can locate what I am missing. I always get licensed passed (my toast message) when testing the app on real devices. Any help will be greatly appreciated
This isn't the entire app, but I stripped out enough to show what I am doing to see if some one can locate what I am missing. I always get licensed passed (my toast message) when testing the app on real devices. Any help will be greatly appreciated
B4X:
'Activity module
Sub Process_Globals
'These global variables will be declared once when the application starts.
'These variables can be accessed from all modules.
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.
Dim WebView1 As WebView
Dim ph As Phone
Dim bd As BitmapDrawable
'*************************************
'license setup
Dim publicKey As String
'shortened public key for posting - real key goes below
publicKey = "MIIBIjANBgkqhkiG9w0BAQ"
Dim test1 As String
Dim ptype As String
ptype = ph.Model
'end license setup
'*************************************
End Sub
Sub Activity_Create(FirstTime As Boolean)
'*************************************
' Begin licensing code
If FirstTime Then
Dim lc As LicenseChecker
Dim p As PhoneId
lc.Initialize("lc", p.GetDeviceId, publicKey, "kljdflkf".GetBytes("UTF8"))
lc.SetVariableAndValue("test1", "randomstring")
If ptype = "sdk" Then
ToastMessageShow("SDK Detected", True)
'emulator -> jump to Allow
lc_Allow
Else
'check license
lc.CheckAccess
End If
End If
' End licensing code
'*************************************
Dim url As String
Activity.LoadLayout("Main")
'*************************************
'Start load and view - load index screen
WebView1.Initialize("WebView1")
Activity.AddView(WebView1,0dip, 0dip, 100%x, 100%y)
url="file:///android_asset/index.html"
WebView1.LoadUrl(url)
'End load code
'*************************************
End Sub
Sub Activity_Resume
End Sub
Sub WebView1_OverrideUrl (Url As String) As Boolean
'*************************************
'Intercepted market request
If Url.IndexOf("market://")>-1 Then
WebView1.StopLoading
Dim market As Intent
market.Initialize(market.ACTION_VIEW,Url)
StartActivity (market)
End If
'*************************************
End Sub
Sub lc_Allow
'licensed passed
ToastMessageShow("License Passed.", True)
Log("Allow")
End Sub
Sub lc_DontAllow
'failed license check
Log("DontAllow")
ToastMessageShow("Invalid License.", True)
Activity.Finish
End Sub
Sub lc_Error (ErrorCode As String)
'error checking license
Log("error: " & ErrorCode)
ToastMessageShow("License Error.", True)
Activity.Finish
End Sub
Last edited: