Menu

Custom Package Name

Yu Mi
2022-09-25
2022-12-12
  • Yu Mi

    Yu Mi - 2022-09-25

    Where did the Custom Package Name function go during installation ? How can I change the package name now?

     
  • Ramiro  Prieto Alvarez

    Well, it's been several versions since the installer has been offered that way, for example, if someone wanted to use the package offered by mit, they would only have to put it in this field.

     
    👍
    2
  • Andrew Williams

    Andrew Williams - 2022-11-27

    Is it possible to customize the com.ai2offline.username in our activities an such to be the same a the PackageName flag?
    Thus if you set your package name to jm.com.linuxras, main would become jm.com.linuxras.Screen1
    I know that would require that you collect the package name at the same time you collect the Project name. The way Koduler does it. I would be willing to make it happen with some pointers to where to look.

     

    Last edit: Andrew Williams 2022-11-27
    • Ramiro  Prieto Alvarez

      Kodular uses io.kodular.email.appname in its activities.
      Niotron uses com.niotron.email.appname in its activities.
      AI2Offline uses com.ai2offline.email.appname in its activities.

      Why do it differently?

       
      • Andrew Williams

        Andrew Williams - 2022-12-04

        I understand that many people wont care but some would certainly want their own org based package id for throughout their own app.
        When you call an activity from google ie: com.google.mail.SEND or whatever that represents them not the IDE they coded the app with.
        Just makes sense to me and I would want that.
        The code is below and I will maintain it as patches or github, the choice is yours.

         
  • Andrew Williams

    Andrew Williams - 2022-11-29

    Can I get a yay or nay or implementing this, I'm most the way there already just need some pointers to your changes.

     
  • Andrew Williams

    Andrew Williams - 2022-11-30

    After much code diving in the system this is what I have come up with so far.
    This seems to all happen in/from the NewYoungAndroidProjectWizard.java dialog box.
    Added checkbox under "Project Name:" with label "Use Default Package" checked by default if left checked it will proceed as usual.
    Added TextBox under "Use Default Package" with label "App Package" if Use Default is unchecked you are required to set a valid Android package id there, it is of course validated and should catch most of the invalid ones.

    With this patch you should be able to just leave the old AppPackage empty and it would just the one set when the project is created.
    Example: jm.com.linuxras
    Would make Screen1 resolve tp jm.com.linuxras.Screen1 etc etc....

    TODO: add the new messages to the rest of the translations (would need contribution here)
    My internet is acting up and I am unable to download the appinventor sub modules to do a full build and test but I know what part builds fine.
    Ramiro please try this patch and let me know how it goes, you may need to increase the height of the dialog however it looks like it could hold two fields :)

     
  • Andrew Williams

    Andrew Williams - 2022-12-01

    Morning all,
    After some more digging last night I found that while this patch will work just fine for creating projects the moment you export, copy or import a project it will revert to the internal one.
    This tells me that a default package id needs to be set at the user settings level that way the stupid server-side code can grab it just like the userId and userEmail.
    I don't know about you guys but I absolutely hate seeing a program as dynamic as this with hard coded values, frankly the system should prompt you for a package id vs overwriting whatever I had in my file with its own just to be lazy.
    Ramiro if you are willing to add the changes I will get this all coded up with the least effect on normal operation.

     
  • Ramiro  Prieto Alvarez

    That works when importing a project, but I still get the error on Save project as.
    copy a project to save project as, build the apk and check that it works, whether i change the package or not.
    greetings

     
    • Andrew Williams

      Andrew Williams - 2022-12-11

      Ramiro That works here.
      I have a project open I do File-Save Project As, I give it a name hit OK, new project opens Then I click Build->Android App (apk). Build just fine: sdb install filename.apk to my phone loads just fine too.

      One thing I did run into when I Import a project file you need to save before trying to build, but unless that's an existing but I can't see what I did to cause that behavior.

       

      Last edit: Andrew Williams 2022-12-11
  • Ramiro  Prieto Alvarez

    the changes were applied to the latest version of ai2offline.

     
    👍
    1

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.