Android Tutorial Convert a big Activity project to B4XPages

For years is scare me to convert a big project from Activities to B4XPages, mainly because the app is only for Android (and I don't have plans to IOS or desktop), but in several issues the answer from Erel is "switch to B4XPages".

The other problem is because I have many apps in the Play Store and I always release updates. It would take a long time to made a full convert and other apps would be outdated.

So, based in the answers to this my question, I started to convert it, creating a mix of b4xpages and activities in the same project, until the full convert.

This is not my top big project, but it has dozens of libs, layouts and activities.

We have this great post about convertion, which Cliff McKibbin says that it tooks more the 6-20 hours to full convert.
I tooks me less than a hour to create this first mixed project.

The project is in the Play Store for the last weeks, without any critical issue in Firebase Crashlytics.

Keep in mind this is not a full convertion and, in some cases, will not get all the benefits of a B4XPages project, but it's a beginning and in the future will get it.

This are the steps that I used:
1 - create a new B4XPages project
2 - change the package name
3 - copy all code from manisfest
4 - import all modules .BAS from the Activity project
5 - copy all files (include layouts) from the Files folder
6 - copy google-services.json file, because I use Firebase
7 - check all libs that is used in the Activities project
8 - copy subfolder /icon, that I use to adaptive icon
9 - copy all lines and references from Project Attributes region from Main module in Activity project to B4XMainPage in B4XPages project
10 - copy Process_Globals e Globals variables (Main) to Class_Globals (B4XMainPage)
11 - change references (in B4XPages):
- Activity -> Root
- Activity.Finish -> B4XPages.ClosePage(Me)
- mainpage layout to your main page layout: Root.LoadLayout("mystartpage")
12 - change Admob ads to show and update in B4XPages format
13 - new modules will be included in the B4XPages format
14 - Priority activities to change to B4XPages:
due this issue, I need to change the activity module to B4XPage format to interact with the new b4xpage module.

Any insigths, suggestions or tips to this post are welcome.
 

Ivica Golubovic

Active Member
Licensed User
I can't understand why people decide to waste hours and hours to convert an old project that is completely functional as an activity project into B4X pages. In such cases, in my opinion, there is no benefit. I use B4X pages for new projects, and leave old activity projects as activity projects. Again, this is just my opinion and I'm not trying to change anyone's opinion.
 

LucaMs

Expert
Licensed User
Longtime User
I agree. For new projects, B4XPages is much better. For those that are already functioning, very large, it is not worth it, unless you want to make the same Android app, which you already have, also for iOS, and this is not the case.
(and I don't have plans to IOS or desktop),
 

Cableguy

Expert
Licensed User
Longtime User
Imagine that in a few "ticks" time (months, years, whatever) he gets asked to add some feature or to change some behaviour... and that at that point in time, he has been working with B4XPages for some time... returning to an "activity based" behaving app may be challenging, while if the app is, even slowly converted to B4XPages will ensure a uptodate base to work with...
just my 2 cents
 

Ivica Golubovic

Active Member
Licensed User
It might be a little tricky, but imagine that after years of driving a car, your car breaks down and you have to ride a bike. How long do you think it would take you to learn how to ride a bike again? I think 2 to 5 minutes at most.... I have projects with 20 or more activities, several services and a lot of inline java code. It would take weeks to convert and test the new project that would be B4X pages. I think it's an unnecessary waste of time. It's fine for smaller projects. Again, this is my personal opinion.
 

Spavlyuk

Active Member
Licensed User
I can't understand why people decide to waste hours and hours to convert an old project that is completely functional as an activity project into B4X pages.
Whenever someone posts an issue about their activity project the #1 answer is usually to stop using activities... OP even says so in their post.

It would take weeks to convert and test the new project that would be B4X pages.
How much time would you have to waste if you have to fix issues on your own because you're not using b4xpages?
 
Cookies are required to use this site. You must accept them to continue using the site. Learn more…