iOS Question Convert B4A in B4I

Discussion in 'iOS Questions' started by Giusy, Aug 11, 2018.

  1. Giusy

    Giusy Active Member Licensed User

    Hi,
    I have to convert my program B4A in B4I.
    how should I change the commands

    StartActivity("mainpro")
    Activity.finish

    Thanks
     
  2. Star-Dust

    Star-Dust Expert Licensed User

    @Giusy from the little I know of B4i I can tell you that IOS does not work like Android.
    The App is not divided into different activities.
    You must use only one activity and possibly split into separate pages. Each Page can contain multiple panels.

    Even if you might think about associating an Activity with the page, it's actually not the same thing at least for writing the code.
    The code will reside entirely on the Main or code modules.
    In android the code of each activity is in the module of the same activity, while in IOS all the code related to the various pages must be in the Main or in the code modules.

    To load a new page use this command:
    Code:
    NavControl.ShowPage(PageNew)
    you can load the Layou on the page with this command:
    Code:
    PageNew.Initialize("page2")
    PageNew.RootPanel.LoadLayout (
    'LayoutNew')
     
    Last edited: Aug 11, 2018
    Giusy likes this.
  3. Giusy

    Giusy Active Member Licensed User

    @Star-Dust,
    I feel like crying :(
    If in B4A I have an activity with many buttons (like a menu) and an other activity with the development of choices,
    indicatively how I translate it?
     
  4. sorex

    sorex Expert Licensed User

    stop using activities and use panels that you show or hide.

    less misery that way and works fine on both.
     
    JordiCP and Giusy like this.
  5. Star-Dust

    Star-Dust Expert Licensed User

    I started writing for ios for a week and I'm rewriting everything.
    Although some parts as functions and methods can be copied in full, what concerns the UI must be rewritten.
    Luckily I have used the Activities in my Apps a little, but I have used different Panels for the different parts of the App. So I will continue in this direction

    Now I'm designing the new Apps in such a way that it requires little translation between the various platforms and possibly using the XUI library.

    Do well to cry :p
     
    Giusy likes this.
  6. klaus

    klaus Expert Licensed User

    Unfortunately, you need to change your mind.
    Even Google with Android changed it's mind since the different versions.
    Now, even in B4A, using different Panels instead of Activities becomes more used.
    I am sure that XUI will be an answer in the future.
    But it will need, in my opinion, some time to become mature, because the operating systems are diiferent, there are same views but there are also different views, and at least but not last the feeling of the users, about user interfaces, are not the same in the different oprerating systems.
     
    Last edited: Aug 11, 2018
    Giusy likes this.
  7. Giusy

    Giusy Active Member Licensed User

    @Star-Dust thanks for the encouragement ahahahahah
    thank you all
    I found something interesting from Erel (which I enclose)
     

    Attached Files:

  8. Star-Dust

    Star-Dust Expert Licensed User

    I wanted to be realistic :p
     
    Giusy likes this.
  9. Filippo

    Filippo Expert Licensed User

    @Giusy
    I always try to realize the following conversion:
    B4a -> B4i
    Starter-Service -> Code-module
    Activity -> Page
    Code-module -> Code-module
    frmMain.bal -> frmMain.bil

    In this way, I no longer have to re-develop the app.
    Converting an activity to a B4i panel would work as well, but, in my opinion, is not a professional programming.
     
    klaus, Giusy and Star-Dust like this.
  10. Giusy

    Giusy Active Member Licensed User

    Grazie Filippo :)
     
  11. sorex

    sorex Expert Licensed User

    why not?

    it looks the same to the end-user (on Android even better since you don't have these stupid activity delays and animations)
    and it's a lot easier to deal with as you stay in the same main activity and use classes.

    all my games use this method and porting an android app to IOS is a matter of maybe an hour of fiddling and testing.
    (mainly font and gravitiy differences and that's about it)

    it ofcourse depends on the type of app.
     
  12. Erel

    Erel Administrator Staff Member Licensed User

  13. Didier9

    Didier9 Active Member Licensed User

  14. Carlos marin

    Carlos marin Active Member Licensed User

    Hello a few days ago I acquired the license for b4i, I'm going through all my program of b4a and I'm doing great, I really appreciate this tool I do not have to work on a mac and almost all the b4a code is received by the b4i. what worries me is having so many pages and not being able to finish them that will not fill the memory?
     
  15. Erel

    Erel Administrator Staff Member Licensed User

    You should always start a new thread for your questions.

    I would have started with the most simple implementation possible. If you do see a memory error then you should investigate it and find its cause. It is possible to remove pages by removing them from the NavControl.
     
  16. Erel

    Erel Administrator Staff Member Licensed User

    I don't see how the above post is related. It is much simpler to go from B4A to B4i than to rewrite it with Xcode. If you are using XUI then you can actually share the same modules between the projects.
     
    Star-Dust likes this.
  17. Computersmith64

    Computersmith64 Well-Known Member Licensed User

    I wasn't suggesting that the app be rewritten in Xcode. I figured that if B4i generates code that is compiled in Xcode, it might be useful to get a better understanding of how iOS apps compare to Android apps.

    Having said that, rewriting B4A apps in Swift is actually pretty easy.
     
Loading...
  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice