Android Question Convert Designer to Code

Discussion in 'Android Questions' started by andrewj, Feb 17, 2015.

  1. andrewj

    andrewj Active Member Licensed User

    Is there an easy way to convert a layout built into the designer to the equivalent code? I have one activity which was built using the designer, and I want to convert it to being built by code like the rest of my projects. Is there a quick way to do this or do I have to do it manually?
  2. DonManfred

    DonManfred Expert Licensed User

    I believe no.
    But there is an tool rom erel which converts bal-files to xml-files. Maybe you can read this xml then and build your layout by code based on that xml.
    Dont know what you all find in this xml....
  3. Cableguy

    Cableguy Expert Licensed User

    It is not as simple as a direct conversion as there are properties in the designer that need extra code to access like corner radius or borders color... even some positioning keywords are not available on code such as bottom or right...
    open the .bal file on a text editor... about 75% -85% is somewhat straight forward conversion... but you have some extra work to do... always
  4. andrewj

    andrewj Active Member Licensed User

    I don't mind doing some manual work. It's just a long time since I created the layout and I want to make sure I've got the basic definitions right.

    I have tried opening the .bal file in both notepad and Workpad without success. Do you know which text editor works?
  5. warwound

    warwound Expert Licensed User

  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