Android Tutorial Any threads just for newbies?

Just getting started with BA4 and am very confused. I don't understand many terms and terminology. Have next to no experience with Java though am reasonably proficient with Basic.

A friend sent me a YouTube link to getting started and that's been helpful. I was able to get the emulator up and running. When I tried "Hello World" again tonight, I now get a Java FileNotfound error (1.bal) in the emulator.

Tried searching the forum but get overwhelmed with results. Are there any threads that just handle getting started newby questions? I tried a bunch of "beginner" & "tutorial" threads but they all seem to quickly evolve into more advanced techniques I am lost before I can even get started.

I'm excited about getting started programming for Android. TIA for any help.

Swede
AOU - Swede's Dock in Lovely Lavallette, NJ - home of Gösta H. Lovgren. Anal Orifi Unwanted
 

NJDude

Expert
Licensed User
Longtime User
Hi Swede,

The problem you mentioned here:
Yet when I run it, none of the buttons work. {sigh}

That's because you HAVEN'T created "members", after you add views to your layout, in order to "use" them you have to create members (see attached picture), I have done that for you and added notes to your sample, look at the attached project, by the way, the creation of members is explained on the beginners guide.

I hope that clears up your mind :D
 

Attachments

  • CreateMembers.JPG
    CreateMembers.JPG
    47.7 KB · Views: 250
  • Swede_SampleFixed.zip
    7.9 KB · Views: 212
  • MembersSample.JPG
    MembersSample.JPG
    36.6 KB · Views: 248

klaus

Expert
Licensed User
Longtime User
The problems are:
- you haven't set the EventName of the numeric buttons and BS button to btnEvent.
- you haven't set the Tag property of btn0 to 0.
- the OK button is called btnAction and not btnOK.
- be carefull in spelling it's btnAction and not btn_Action, and Btn is not btn.
- in the Designer the text of btnAction is OK but should be O K ! Spelling again !

Attached a modified version of your program, I haven't checked everything.

Best regards.
 

Attachments

  • Swede_Second_03.zip
    7.6 KB · Views: 235

Swede

Member
Licensed User
Longtime User
The problems are:
- you haven't set the EventName of the numeric buttons and BS button to btnEvent
Done
- you haven't set the Tag property of btn0 to 0.
Done
- the OK button is called btnAction and not btnOK.
Done
- be carefull in spelling it's btnAction and not btn_Action, and Btn is not btn.
Done. I can see where Im going to continue to have trouble with Underscores. I use then A LOT with variables, Sub, Function, etc. Gonna have to be careful with B4.
- in the Designer the text of btnAction is OK but should be O K ! Spelling again !
Changed. I presume it's "O K" and not "O K !"

Attached a modified version of your program, I haven't checked everything.
Your version runs fine. Mine doesn't. I checked each against the other, word for word, many times and they are identical. So what I thought was it MUST be in the Designer settings. Here's the two compared:

btnAction_Klaus.jpg
btnAction_me.jpg


Here's the error code when I click the O K button:
error_02.jpg

I am not clear on what an "Object" is (I probably know by another name). I *thought" it was declared here
B4X:
Dim btnAction, btn0 As Button

I've attached my latest efforts. I REALLY appreciate the efforts you are making, Klause. It's just that no lights are going off for me yet. {really deep sigh} And I promise you, I'm making the effort. There's something I'm just not seeing despite the "lights" you guys are giving me.
 

Attachments

  • Swede_Second_03.zip
    7.7 KB · Views: 212

Swede

Member
Licensed User
Longtime User
Hi Swede,

The problem you mentioned here:
Thanks Dude. I just now saw your post. I spent the last few hours responding to Klaus' suggestions. (see post just above this.) And didn't see yours.

I'll get into your stuff probably tomorrow night. Late for me right now, have to be early up in the am {frown}. Hopefully you can clear some smoke away for me. {sigh} Pretty foggy for this old sea dog right now.

Thanks.
 

Swede

Member
Licensed User
Longtime User
You haven't looked carefully enough:
In the designer you define btnAction but in the code you use btn_Action !
And you use btnAction_Click.
I changed all to btnAction !

Best regards.

You are absolutely correct, Klaus. It works as advertised now. Note I just corrected my version (removing 3? under_scores). I can see where the u_s is going to be a problem for me, at least until I get used to things. Amazing the difference in what you *see* and what's actually *there*. {geez}

Thanks your patience, Klaus.

Dude, I didn't get to your stuff yet (caught on the Parkway in that rain (and boy didn't it rain? - 4.5" in my rain gauge in the yard in just about about an hour. Never saw it rain so hard for so long), but will soon, next day or so.


Thx all.
 

klaus

Expert
Licensed User
Longtime User
The problem weren't the uderscores but the fact that you used two different spellings for the same object.
If you had used btn_Action everywhere in the code and in the Designer it would have worked too.
I prefer not to use uderscores in names but three characters at the beginning for the object type and in the name 'play' with uppercase characteres and leave the underscores for the separation between the object name and the event name, but everybody has it's habits.

Best regards.
 
Top