Android Question How to upgrade an older app

wdegler

Active Member
Licensed User
Longtime User
I have received that some of my apps must be updraded to a higher version VERY soon!
I have been away from development for a while, hence, my questions:

I have downloaded Android version 12.
I can recompile my apps using this latest B4A but what else is needed?
How do I determine the API level of my published apps and how can I update it?
Please help me to catch up again to save my apps from extinction.
 

Alessandro71

Well-Known Member
Licensed User
Longtime User
start here:

 
Upvote 0

Brian Dean

Well-Known Member
Licensed User
Longtime User
I can recompile my apps using this latest B4A but what else is needed?
Before you recompile you need to open the manifest editor and set the target sdk version to 33.
B4X:
<uses-sdk android:minSdkVersion="5" android:targetSdkVersion="33"/>

If your code still compiles without any problems then you are finished, but you might find that it does not compile, or it might compile but not run correctly. In these case you will have to update your code to work at the new sdk level.
 
Upvote 0

wdegler

Active Member
Licensed User
Longtime User
Thank you for your response, Alessandro71.

I have studied the document you referred to without finding precisely what I must do to simply upgrade my apps to the latest Android version (13?) and the latest API level (31?).
Note: The configuration settings cannot find my (old) Javac and jar files although I have set their correct paths.

I think that bringing my apps up-to-date should require little effort, but I am confused right now.

My published apps have been available for a while now and are known to work well.

I need to know the short, direct steps to update them. Please advise.
 
Upvote 0

Alessandro71

Well-Known Member
Licensed User
Longtime User
First step is installing the latest version of B4A with all its additional files (SDK and Java) as explained in the B4A download page.
be sure to follow each step, since SDK and Java are probably changed since last time you used them.
even if setting 33 in the manifest will lead to a successful compile, that doesn’t mean the app will work.
each SDK version brings new changes (notifications and storage access to name a few), so new code will probably needed.
there is no magic wand: you knows what your apps do, so just take your time to read the SDK requirements listed in the message above, search the forum, and good luck.
 
Upvote 0

MicroDrie

Well-Known Member
Licensed User
Longtime User
I have been away from development for a while, hence, my questions:
Time is a relative concept, but from API version 21 security has been tightened so that you have to add and/or permissions in the manifest file or you no longer have access to a certain directory location. This can therefore have quite a big impact on your "old" program. In addition to the advice given above, you could also look at:

I recommend that you read this post [B4X] Features that Erel recommends to avoid to quickly polish up your old source.

I have downloaded Android version 12.
Be aware that the current version is not Android 12, but already Android 13.

How do I determine the API level of my published apps
If you still have the old source, you can find the API levels in the manifest file. This question is not relevant, because if you have installed the latest version of the IDE in accordance with the above, you can find a new dummy program (because how old is not for a long time) and add the old and the new required permissions to it to fix the permissions faults. However, keep in mind that if you take the permission too wide, you run the risk that Google will ask all kinds of security and privacy questions that you will then have to answer in that case.

If you follow the advice given here in this and previous posts, you will go a long way. For specific questions you can use the search function in the forum and where you don't come up with, you can ask a new specific question. Please indicate specifically where and how you encounter a challenge, because based on the information you provide with this question, we can only give you some generalities.

Finally, good luck with your migration process.
 
Upvote 0

wdegler

Active Member
Licensed User
Longtime User
Thanks to all of you for your responses! I have attempted to follow your suggestions.

In Manifest I changed a line to
<uses-sdk android:minSdkVersion="33" />
Is this correct?

For simplicity, I created a folder “NewB4A” on my Desktop and added
1. The folder of a published app,
2. the newly installed B4A, jdk20.0.2, platform-tools and tools folders,
3. Android.jar (found only in a previous app).

I set Configure paths to
javac.exe: C:\Users\Walter\Desktop\New B4A\jdk-20.0.2\bin\javac.exe (not a problem)

android.jar: C:\Users\Walter\Desktop\New B4A\android.jar (Problem: not found)

Compile and run stops at attempt to use android.jar.

I'm ahead of where I was, I think. The .jar problem is holding me back. Suggestions of how I may proceed?

I still want to update my published apps; that's all!
 
Upvote 0

MicroDrie

Well-Known Member
Licensed User
Longtime User
You just have to follow every step on the installation web page and don't skip a step because then you either miss things (like the android.jar or you use the wrong android.jar which makes you say API level 33 in the manifext file, but in reality an outdated version without using API level 33. Delete all installation directories, start over and follow everything step by step.
 
Upvote 0

mcqueccu

Well-Known Member
Licensed User
Longtime User
The manifest code is from old project as you said. To reset to the new format, just delete everything from the manifest file and save. Then reopen the manifest. The codes should be generated to the new format. NOTE: (Backup any manifest code from other third-party libraries you added)
 
Upvote 0
Top