1. Black Friday Sale - 50% off

    B4A Standard for $29 instead of $59!
    Buy Now
    Dismiss Notice

Android Question ETP videos: running Erel's displayed code

Discussion in 'Android Questions' started by Jeffrey D. Spiegler, Apr 17, 2019.

  1. Jeffrey D. Spiegler

    Jeffrey D. Spiegler Member Licensed User

    Hello,

    I am teaching myself how to program in B4A, so I thought that I would work through Erel's videos. Watched/listened pretty carefully through the first 3 (Code Flow, Subs and Variables, Strings). On the fourth one, there were some things that I didn't understand well (about Lists, mostly, and variable scope), so I thought I'd type in the code, try changing some things, hopefully figure out it worked. So I typed in the code that Erel had on his screen, and tried to build it.

    I am running with an emulator, not an actual device. I have had great trouble getting it run on my phone, but I think that is due to issues with my phone. So, I'm using an emulator for now.

    First problem was the compiler complained about no 'Sub Globals' section. So I added an empty 'Sub Globals/End Sub' section, and that problem went away. But why did I need it, and Erel did not?

    Then I got this:

    java.io.FileNotFoundException: /data/user/0/b4a.MyFirstProgram/files/virtual_assets/main2.bal (No such file or directory)

    'MyFirstProgram' is left over from when I did the calculator exercise in the, I think, Getting Started booklet. Why is it looking for that? I started a new file for this new exercise, saved it to a new directory, where a proj-name.b4a file showed up, as expected. Why is it looking for something that I thought would have nothing to do with one?

    Other (perhaps) random questions:

    1) how does the compiler know to start execution with the AppStart Sub? Or does it start somewhere else that calls AppStart?

    2) I have a 'Starter' tab by default that Erel doesn't have on his screen. Do I need it? If so, what is it for? If I don't need it, does clicking on the 'X' on the tab remove it from the project? Or do I need to use the menu selection: 'Project / Remove Module'?

    3) what makes something a "non-UI/server app", as the comment at the top of the file indicates that it is? Just because I didn't run the Designer and make a UI?

    My apologies if these are annoying newbie questions, but I don't know how else to make progress, and I didn't find anything in the forums when I searched for stuff like this, or in the Booklets (please let me know if I overlooked something). And I'm sure that there will be more as I work though things, my apologies in advance.

    Thanks much for the help,
    Jeff
     
  2. Jeffrey D. Spiegler

    Jeffrey D. Spiegler Member Licensed User

    Hmmm... Is my main trouble that I am trying to run Erel's examples under B4A, where as I should be using B4J?

    thanks.
     
  3. Jeffrey D. Spiegler

    Jeffrey D. Spiegler Member Licensed User

    Hello again.

    Yup, installed B4J, tried the examples under that, they work fine/great. Wow, the forums do work, if nothing else to make you talk to yourself...

    Sorry for the newbie confusion.

    Jeff
     
    DonManfred likes this.
  4. aeric

    aeric Active Member Licensed User

    Hi Jeff, welcome to the community. B4A and B4J are separate products. You may learn one first. Any question please don't hesitate to post in this forum.

    By the way, you should post in the correct forum i.e Question forum.
     
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