Android Question Build a form with B4A

Status
Not open for further replies.

Arta

Member
Hello
I want to create a program where people enter their information in the form. Please help me to make this program. I want people to be able to fill out the form several times, and each time they fill out the form, the information they have entered will be sent to me in the form of a database, email or anything else. If possible, provide me with training and resources. Thankful
 

Peter Simpson

Expert
Licensed User
Longtime User
Upvote 0

Brian Dean

Well-Known Member
Licensed User
Longtime User
You do not say whether you are new to B4A, or new to Android, or new to programming altogether. In any of these cases you need to make an investment in learning. People will help you, but don't expect them to write a project for you.

Start with some small practice projects just to learn what tools are available and how to use them. This is not something that you can do in five minutes, or even in the couple of hours since you joined the forum. Read the documentation - everyone will tell you this - so that you learn the terminology and know where to find the information that you need. Then come back to the forum with some more specific questions when you hit a problem.
 
Upvote 0

mcqueccu

Well-Known Member
Licensed User
Longtime User
Hello
I want to create a program where people enter their information in the form. Please help me to make this program. I want people to be able to fill out the form several times, and each time they fill out the form, the information they have entered will be sent to me in the form of a database, email or anything else. If possible, provide me with training and resources. Thankful

You can contact/send me a mail at info@leafecodes.com
I can take an hour or two to take you through all that you need to get started with B4X including building your user registration system to a database for a small fee.
 
Upvote 0

aeric

Expert
Licensed User
Longtime User
This example may give you a good start. It requires some knowledge to setup the web application and MySQL database.
 
Upvote 0

Arta

Member
I have been working with B4A for almost a year, but I have just become a member of the association.
I am familiar with the database environment to the extent that I enter content and so on. But I do not know how to create a form so that the results of the form are sent to me.
 
Upvote 0

Peter Simpson

Expert
Licensed User
Longtime User
@Arta you should start with getting a basic form obviously created in layout to save to a database, whilst learning you should start with saving to an SQLite on device database.

After that you can start to utilise the same code but using MySQL.

There are plenty of ways that you can achieve what you are trying to do. You need to start with the very basics though.
 
Upvote 0

Arta

Member
@Arta you should start with getting a basic form obviously created in layout to save to a database, whilst learning you should start with saving to an SQLite on device database.

After that you can start to utilise the same code but using MySQL.

There are plenty of ways that you can achieve what you are trying to do. You need to start with the very basics though.
I am familiar with the database to the extent that I can put the title and content in the database.
 
Upvote 0

Brian Dean

Well-Known Member
Licensed User
Longtime User
Here is an absolutely basic app that will collect data and send you an email, which is what you asked for in your first post. It is just a starting point.

Sending emails from Android is not very slick, but this might do if your app is only meant to be used by a limited number of people. If it is intended for a business then you need to think about sending the messages to somewhere on the web. You can still get away without needing a server application on the web if the message volume is low, but that is another story.
 

Attachments

  • Project.zip
    14.4 KB · Views: 177
Upvote 0

Arta

Member
Here is an absolutely basic app that will collect data and send you an email, which is what you asked for in your first post. It is just a starting point.

Sending emails from Android is not very slick, but this might do if your app is only meant to be used by a limited number of people. If it is intended for a business then you need to think about sending the messages to somewhere on the web. You can still get away without needing a server application on the web if the message volume is low, but that is another story.
If the information they enter in the form is stored in the database, I have no problem, that is, the email must not be sent.
 
Upvote 0

Arta

Member
Here is an absolutely basic app that will collect data and send you an email, which is what you asked for in your first post. It is just a starting point.

Sending emails from Android is not very slick, but this might do if your app is only meant to be used by a limited number of people. If it is intended for a business then you need to think about sending the messages to somewhere on the web. You can still get away without needing a server application on the web if the message volume is low, but that is another story.
1621177086768.png

The second line gives an error.
 
Upvote 0

Brian Dean

Well-Known Member
Licensed User
Longtime User
The second line gives an error.

I don't know why that is, but you can remove that line - the project should still run. Try it.

In any case you can see the subroutine that sends an email -
B4X:
Private Sub sendEmail
    Dim mail As Email
    mail.To.Add("somebody@somewhere.com")
    mail.Subject = "New Subscription"
    mail.Body = "Name = " & txtName.Text & ";  Number = " & txtNumber.Text
' You can replace the line above with  -   mail.Body = "Name = A Name;  Number = 0123-456789"
    Dim intMsg As Intent = mail.GetIntent
    StartActivity(intMsg)
End Sub

You can copy this into a project of your own. Note that you need to select the "Phone" library in the "Libraries" tab. That will show you how the process for sending an email works.

Try either of these things and let me know if you still get any problems. And let me know if it works, too.
 
Upvote 0

Arta

Member
I don't know why that is, but you can remove that line - the project should still run. Try it.

In any case you can see the subroutine that sends an email -
B4X:
Private Sub sendEmail
    Dim mail As Email
    mail.To.Add("somebody@somewhere.com")
    mail.Subject = "New Subscription"
    mail.Body = "Name = " & txtName.Text & ";  Number = " & txtNumber.Text
' You can replace the line above with  -   mail.Body = "Name = A Name;  Number = 0123-456789"
    Dim intMsg As Intent = mail.GetIntent
    StartActivity(intMsg)
End Sub

You can copy this into a project of your own. Note that you need to select the "Phone" library in the "Libraries" tab. That will show you how the process for sending an email works.

Try either of these things and let me know if you still get any problems. And let me know if it works, too.
1621319070530.png

Line 24 gives an error.
 
Upvote 0
Status
Not open for further replies.
Top