Android Question Putting our apk in Play Store

kepler

Active Member
Licensed User
Longtime User
Good morning,

I'm having some doubts regarding how to put my app in Play Store.

I've realized that we must create our own key within the B4A project - done.

Oh, and there's the annoying problem that the icon must have exactly 512x512 px - or it will give an error in the upload.

The play store gives us a key for our application when we upload it, and we can use it with the License lib to validate it.

But how?

Where/how can we test if the licence process is working?

Are we forced to publish the app and then see if the authentication process is working?

I think that there are experienced developers here that can help me out - if you be so kind.

Regards,

Kepler
 

Peter Simpson

Expert
Licensed User
Longtime User
Hello @kepler,
Here are instruction on how to implement Google License library. BTW you don't need to use licensing in your app (it's optional), but it's a good idea to do so. Please note that this will limit installs to only from the Play Store. Also you will have to add Beta testers email addresses to your developers account so that they do not need to install the app from the play store to use.

Once Google license is integrated, to test if licensing it working correctly or not, you just need to install the app on a device without logging into your Google account, or give the app to a friend. If the licensing is working correctly, the app will just close straight away.

https://www.b4x.com/android/forum/t...ion-with-the-licensing-library.11429/#content
 
Upvote 0

kepler

Active Member
Licensed User
Longtime User
Hi @Peter :)

Well this is not going well....

I've implemented the code in the post you spoke - I've already had seen it.
There, I have one dout. The code goes like this:

B4X:
Sub Process_Globals
   Dim publicKey As String
   publicKey = "MIIBIjANBgkqhAADSFEFEFkiG9w0BfW/cGhTbtIs6QIDAQAB..."
   Dim test_1 As String
End Sub
Sub Globals

End Sub
Sub Activity_Create(FirstTime As Boolean)
   Dim lc As LicenseChecker
   Dim p As PhoneId
   lc.Initialize("lc", p.GetDeviceId, publicKey, "kljdflkf".GetBytes("UTF8"))
   lc.SetVariableAndValue("test1", "some secret value")
   lc.CheckAccess
End Sub

My first doubt is that the variable test_1 is declared in the Globals, but referred as test1 (no underscore) after. Is this correct?

Second...my biggest problem. As far as I read, I had to submit a alpha version of the app. And I'm trying to check if the license is checking or not.

But I get in the phone the "NO_MARKET_MANAGE" error and in the emulator "LICENCE Invalid"...

The support told me to change the Response to "LICENSE".

Can't seem to put this working...

Kind regards,

Kepler
 
Upvote 0

Peter Simpson

Expert
Licensed User
Longtime User
NO_MARKET_MANAGEMANAGE means that you need to upload a copy of the app (withther new licensing included) to the Play Store before trying to run the app on your device.

I presume that you have a copy already uploaded to the store but without the license library.

Sorry for delay in responding, but I've been out on a cycling run...
 
Upvote 0

kepler

Active Member
Licensed User
Longtime User
Hi,

I hope you had a nice run :)

No, I've uploaded it with the License library provided in this forum.

Does the apk update takes too long - might that be the reason?

It's my first app in Play Store - so I'm really new at this.

Regards,

Kepler
 
Upvote 0

kepler

Active Member
Licensed User
Longtime User
Good evening Peter

You're right - I had to wait. But the alpha version is active.

And...guess what? I got the licence script working fine in my first try! I can run my app fine but my syster can't - no license for her...

I really apreciate your kind and thoughful attention.

My best regards

Kepler
 
Upvote 0

Peter Simpson

Expert
Licensed User
Longtime User
Your welcome :)
If you add your sisters GMail email address to your developers console (click on the left hand cog). At the bottom of the settings screen you will see the following, just add your sisters (or any beta testers) GMail email address and the app will start working for them without having to download your app from the Play Store.

LICENCE TESTING
In addition to the owner of this console the following users will get the Licence test response from the application. There is a limit of 400 test accounts.

Gmail accounts with testing access
 
Upvote 0

kepler

Active Member
Licensed User
Longtime User
Hi again,

A problem arised...

When we run the app for the first time Offline we get an invalid licence - that can make some sense.
If we run it with the wifi on, the licence is checked and we're in.

But if we run it again Offline in a tablet we get again an invalid key.
In a cell phone, however, it will run AS LONG we don't clear the cache. If we clear the cache we get again an invalid licence...

Does anyone has this issue? I'm running an alpha version for the time being.

Kind regards,

Kepler
 
Upvote 0

DonManfred

Expert
Licensed User
Longtime User
Google privacy States that test licence cache is saved only for a minute...
You can store this info by yourself. And if the app is restartet you can check your stored value. If you stored a valid license then you could skip the check from the licensing library.
 
Upvote 0

kepler

Active Member
Licensed User
Longtime User
You can store this info by yourself. And if the app is restartet you can check your stored value. If you stored a valid license then you could skip the check from the licensing library.

Hi Don,

Which value do I save to be safe - and where? Doen'st lc.CheckAccess only gives a short response (like LICENSED)?

Kind regards,

Kepler
 
Last edited:
Upvote 0
Top