Well once upon a time, it was very easy to develop, test and push into
the PlayStore. I guess Google became jealous of Apple and its layers of
requirements. I spent the last 3 days trying to move one app (TDust)
into the play store. I freely admit that part of it is truly my fault for not keeping
the apps up to date. So trying to move from API 24( Android 7) to the current required API 30 (Android 11) and 64 bit versions has been fun. I can test on
Adroid 7, 8, 11 and 12 with the devices I have. I actually went to Best
Buy and bought an unlocked phone, Samsung Galaxy A13. It was $165 if you activate it and
$165 if you dont. Naturally I did not activate. It is more a less a
mini tablet at this point.
I had already done the Permission thing before, but Google keeps
changing the permissions required. When permissions were implemented,
to use BLE you need to have location permissions. I suppose it is
because there is small possibility that the location of the phone can be
determined. But this changed as the APIs advanced. First it was coarse
location then fine and now coming in API 31 (Android 12) no location as long as
you swear on someone's grave you wont use BLE to find the phone's
location😎. Actually they are completely revamping the permissions around
BLE with specific BLE permissions, which makes more sense.
I am only complying with API 30 and the new App bundle requirement for
now. This is good for new apps until Aug 2022 and Updates until Nov
2022, at which point it is API 31/32. With the price of gas, won't be
making many trips this summer, so I will have some time on my hands to work on API 31 and 32.
When I went all the way to API 30 and using the very latest Delphi version, 11.1, it all failed big time. The program
crashed, the debugger failed, it was a mess. I am using the Delphi compiler. As I have said before, been using this for 30+ years, old dog not going to change now. So I went back several
revisions on the compiler, to version 10.3.3 , used API 24 as the target SDK and the last set of code that worked
from my SVN repository. That worked on all the devices, though the newer Androids complained
a lot when installing on the newer devices.
So I slowly marched up the API list. One thing I did was create a separate code module to handle the permissions. That way once I figured it out, it would hopefully work for all my Android Apps. When I got to API 29 (#10) I had to switch the compiler version to 10.4.2. This is where permissions started changing and I had to research what was happening. After two days I finally got it all working on API 29. I am now one step away.
At this point I had to change version of the compiler to 11.0. This caused quite a few library types
to change, but I was smart enough to implement conditional compilation
so that I could go back and forth between 11 and 10.4.2. This proved
useful as API 30 did not come easily. When I first tried the 11.1 version of Delphi, it would crash on start. The debugger finally showed that the issue is in one of the units startup code, but I never tracked it down. I did see in Embarcadero's Developer JIRA a bug report RSP-35804 and RSP-35919. ( I realize not everyone has access to this, so I will try and describe it.) The first one concerned using location permissions (FINE and COARSE). The later concerned BLE Discovery which also uses location permissions (FINE or COARSE depending on Android version. Because the second on was essentially the same as the first one, most info is in the first one. Embarcadero said it was fixed in 11.1, but people were still reporting the issue. Basically there was some error in the JNI implementation of location gathering.
But for me, none of this showed up this time in version 11 or version 11.1. I dont know what happened from the very first time I tried 11.1 and at the end of my slow march through the API levels. I had other issues with compiler configurations, choosing the correct permissions (COARSE vs FINE) but it never crashed like it did the first time. All I can say is that the app finally worked on all the devices with API 30 as the
target.
Then uploading to the Play Store became another fun thing. You cant
upload APKs any more they have to be in the new App Bundle format. And
now signing/encrypting the App is not good enough, the upload has to
have a key also. They can be the same, but they recommend against it.
Well I converted my existing key to the format they wanted but could not
figure out how to generate a separate upload key. So for now they are
the same. Supposedly I can change the upload key, I just cant change
the App key. I uploaded the app and then the Play Store went nuts about
a permission, LOCATION_BACKGROUND. I had read an item in Stack Overflow that it was now required,
but Google wanted to know why I was using it and to provide a 30 sec video
showing how it was used. Then a week or so they would get back to me.
So I deleted the upload, went back removed the permission and tested
again. It all seemed to work. Upload this new version, no complaints
and it was published. So either the StackOverflow and the approved
response misinterpreted the Android spec or Android in not following the spec.
But it cant end here. I then tested the install on the devices. The
older devices were still installing the older version, dont know why.
Something I have to look into. But the 64 bit version just crashed on
start. So back to the devices. The compiler keeps separate configs for
debug and release. I had failed to test the 64 bit release version.
Found a setting in the 64 bit release config that was wrong. Once that
was fixed, the 64 bit devices started working.
I still need to find out why the new 32bit version is not installing.
You would thing this is not a big deal, but............ The Samsung A13
I bought at Best Buy is an ARM8 64 bit, but they installed the 32 bit
version of Android. So even if Google is screaming 64bit to everyone,
some of the big guys are still installing 32 bit OS, even on 64 bit ARMs.
No comments:
Post a Comment