First lets start B4A and B4J I’ll now open the original B4A project Copy the global declarations from B4A Paste them into B4J Copy and paste the title too Change the title variable Copy all of the code in B4A beneath Activity_Resume and paste it into B4J I’m assembling the B4A code to run in the emulator later Now lets tidy up the code in B4J Find which libraries we are using in B4A Now select the same libraries in B4J Select the first layout file in B4A Oops!
I didn’t save the new B4J project
Lets save it now Open the B4J layout designer Open the first layout file in B4A, press CTRL+A to select all the views, CTRL+C to copy all the views Go back to the first layout file in B4J, press CTRL+V to paste the views, now save the layout and create a new blank B4J layout Open the second layout file in B4A, press CTRL+A to select all the views, CTRL+C to copy all the views Go back to the second layout file in B4J and press CTRL+V to paste the views, now save the layout. That’s all we need from B4A Load the main layout file into B4J And like magic, the orange warnings have all disappeared, just four errors to look into now Make that three Make that two Make that none 👍 Lets test the B4A Android app, it should be working Now lets test the B4J desktop app Hmm an issue, what have I missed??? I’ve found it, my fault, the sub event is incorrect 🙄
Lets auto generate the correct B4J sub event 😎 Lets give it another go Yes, done it… We’ve converted a B4A Android app into a B4J desktop app in about 10 minutes Images from www.pixabay.com via their RESTful API