Puppycode Com Blog Index Php b4a Dummy for Programmers Modul

October 16, 2017 | Author: marcelo19750000 | Category: Portable Document Format, Html, Databases, Web Browser, Application Programming Interface
Share Embed Donate


Short Description

apostila...

Description



Puppycode Blog Dummy for programmers

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

Module 5 B4A Sample Login Program Using Database SQLite Browser B4A (Basic4Android) SAMPLE PROGRAM

STEP 1. Open your b4a

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

Step 2. Save your program as “Sample”

Step 3. Open SQLite Browser and create data base

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

Step 4. Create database with file name “dbsample.db”

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

Step 5. Create table name “accounts” with 3 Fields [id], [username] and [password] then press OK

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

Insert data in New Record

open in browser PRO version

username : adminDB2

password: adminDB2

username : adminDB

password: adminDB

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

Step 6. Now create your Design by clicking “Designer ”-> Open Designer in the Menu bar open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

Step 7. Now add 1 Button , 2 Labels and 2 EditText components

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

Step 8. Change the component name in the properties Button= btnlogin EditText1= txtusername EditText2= txtpassword

And for the Label change the TEXT in the properties open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

Label1 = Username Label2= Password Btnlogin= Login

Step 9. Every component should be initialize.

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

Step 10. Go back designer and right click the Button named “btnlogin” and generate “Click” open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

Add this codes to the btnlogin_click Dim cursor1 As Cursor If txtusername.Text = “” And txtpassword.Text=”” Then Msgbox(“Please fill up all the fields”,”invalid”) Else cursor1=SQL1.ExecQuery(“Select * from accounts where username='”& txtusername.Text &”‘ and password ='”& txtpassword.Text &”‘”) If cursor1.RowCount0 Then Msgbox(“Login Successful”,””) Else Msgbox(“Please check your username or your password”,”wrong input”) End If End If

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

Step 11. Save your Design as “loginlayout”

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

Step 12. Now we are going to create a simple program using DATABASE My database name is “datasample.db” these are the codes you are going to use to connect your database to your program

If File.Exists(File.DirInternal,”datasample.db”) = False Then File.Copy(File.DirAssets,”datasample.db”,File.DirInternal,”datasample.db”) End If If SQL1.IsInitialized = False Then SQL1.Initialize(File.DirInternal, “datasample.db”, False) End If

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

and check the SQL in the library Manager and the Dim SQL1 As SQL Dim cursor1 As Cursor

Configure the File manager ,add your database to your file manager

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

Step 13. If you want to test the program, download the b4a application in your android phone

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

Make sure that your computer/laptop and your android phone connection belongs to the same network

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

My IP address in my computer is 192.168.1.116 and also in my android phone

Step 14. Configure the connectivity in the b4a in your computer Connect in to your IP

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

Check the connection in to your android phone If your status is connected, both devices are connected. If is not please check your IP in your computer or your network connection or Click START-Wireless

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

Step 15. Run your program

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

Step 16. Check your mobile phone and install the b4A example

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

Click the login button without any input in the username and password the output should be

Now input admin in the username and admin123 in password the output should be

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

Now input “adminDB” in the username and “adminDB” in the password or input “adminDB2” in the username and “adminDB2” in the password the output should be

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

NEXT TUTORIAL: CRUD NEXT

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

Proudly powered by WordPress | Theme: Oblique by Themeisle.

open in browser PRO version

Are you a developer? Try out the HTML to PDF API

pdfcrowd.com

View more...

Comments

Copyright ©2017 KUPDF Inc.
SUPPORT KUPDF