0% found this document useful (0 votes)
2 views19 pages

User Registration App Development Guide

The document outlines the development of two mobile applications: a User Registration app and a Food Delivery app. The User Registration app includes fields for name, email, date of birth, city, and course, with functionalities to pass user data to another activity. The Food Delivery app features a tab layout showcasing different categories of food items with their prices.

Uploaded by

lenslustt
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views19 pages

User Registration App Development Guide

The document outlines the development of two mobile applications: a User Registration app and a Food Delivery app. The User Registration app includes fields for name, email, date of birth, city, and course, with functionalities to pass user data to another activity. The Food Delivery app features a tab layout showcasing different categories of food items with their prices.

Uploaded by

lenslustt
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

405-02 : Mobile Application Development-2

1. Create an Application of User Registration page including following Fields Name,


Email,DOB (Use DatePicker Dialog), City (Use Spinner to select City), Course Name
(Use AutoCompleteTextView to suggest Course name like BCA, BBA, MCA, etc.),
Provide SignUp Button Which Pass data to another activity and show user details.

 Activity_main.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="[Link]
xmlns:app="[Link]
xmlns:tools="[Link]
android:layout_width="match_parent"
android:layout_height="match_parent"
android:dividerPadding="10dp"
android:gravity="center_horizontal"

Page No. 1
405-02 : Mobile Application Development-2
android:orientation="vertical"
android:padding="50dp"
tools:context=".MainActivity">

<TextView
style="@style/[Link]"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:fontFamily="sans-serif"
android:textStyle="bold"
android:padding="30dp"
android:text="REGISTRATION"
android:textColor="@android:color/holo_blue_dark"
android:textSize="30dp" />

<EditText
android:id="@+id/txtname"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Full Name"
android:inputType="text"
android:padding="20dp"
android:textSize="20dp"
/>

<EditText
android:id="@+id/txtemail"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Email"
android:inputType="textEmailAddress"
android:padding="20dp"
android:textSize="20dp" />

<EditText
android:id="@+id/txtdate"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Date of Birth"
android:inputType="date"
android:padding="20dp"
android:textSize="20dp"
/>

<AutoCompleteTextView
android:id="@+id/autoComplete"

Page No. 2
405-02 : Mobile Application Development-2
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="Course Name "
android:padding="20dp"
android:textSize="20dp"
/>

<Spinner
android:id="@+id/spin_city"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:background="#14070707"
android:padding="10dp"
android:layout_marginTop="10dp"
android:autofillHints="Select City"
android:textSize="20dp" />

<Button
android:id="@+id/button"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:padding="20dp"
android:text="SIGNUP"
android:layout_marginTop="10dp"
android:textSize="20dp" />
</LinearLayout>

 [Link]
package [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
public class MainActivity extends AppCompatActivity {
Spinner city;

Page No. 3
405-02 : Mobile Application Development-2
EditText dob,name,email;
Calendar calender;
AutoCompleteTextView course;
Button btn;
@Override
protected void onCreate(Bundle savedInstanceState) {
[Link](savedInstanceState);
setContentView([Link].activity_main);

calender= [Link]();
btn=(Button) findViewById([Link]);
name=(EditText)findViewById([Link]);
course=(AutoCompleteTextView) findViewById([Link]);

email=(EditText)findViewById([Link]);
dob=(EditText)findViewById([Link]);
city=(Spinner)findViewById([Link].spin_city);
String cities[]={"--Select Any--","Surat","Ahemdabad","Bardoli"};
String[] stream={"[Link]","BCA","BBA","MCA"};
ArrayAdapter stream_adapter=new ArrayAdapter(getApplicationContext(),
[Link].simple_list_item_1,stream);
[Link](1);
[Link](stream_adapter);

ArrayAdapter adapter=new ArrayAdapter(getApplicationContext(),


[Link].simple_list_item_1,cities);
[Link](adapter);
[Link](new [Link]() {
@Override
public void onClick(View view) {
int day=[Link]([Link]);
int month=[Link]([Link]);
int year=[Link]([Link]);
DatePickerDialog dp=new DatePickerDialog([Link],
[Link].Theme_Holo_Dialog,
new [Link]() {
@Override
public void onDateSet(DatePicker, int year, int month, int day) {
month=month+1;
[Link](day+"/"+month+"/"+year);
}
},year,month,day);
// [Link]
[Link]();
}
});

Page No. 4
405-02 : Mobile Application Development-2
[Link](new [Link]() {
@Override
public void onClick(View v) {
Intent in = new Intent(getApplicationContext(), [Link]);
[Link]("name",[Link]().toString());
[Link]("email",[Link]().toString());
[Link]("dob",[Link]().toString());
[Link]("course",[Link]().toString());
[Link]("city",[Link]().toString());
startActivity(in);
}
});
}
}

 activity_user.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="[Link]
xmlns:app="[Link]
xmlns:tools="[Link]
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".User"
android:orientation="vertical"
android:gravity="center_vertical">

<TextView
android:id="@+id/dataview"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:textSize="20dp"
android:textAlignment="center"/>
</LinearLayout>

 [Link]
package [Link];
import [Link];
import [Link];
import [Link];
public class User extends AppCompatActivity {
TextView tv;
@Override
protected void onCreate(Bundle savedInstanceState) {
[Link](savedInstanceState);

Page No. 5
405-02 : Mobile Application Development-2
setContentView([Link].activity_user);

Bundle extras = getIntent().getExtras();


String name = [Link]("name");
String email = [Link]("email");
String dob = [Link]("dob");
String city = [Link]("city");
String course = [Link]("course");
tv=(TextView) findViewById([Link]);
[Link]("Name : "+name+"\n\n"+"Email : "+"email"+"\n\n"+"Dob :
"+dob+"\n\n"+"City : "+city+"\n\n"+"Course : "+course);

}
}

Page No. 6
405-02 : Mobile Application Development-2
2. Create a Food Delivery Application, with Tab Layout and showing Custom List of
Food Items with its respective price.

 activity_mail.xml
<?xml version="1.0" encoding="utf-8"?>
<LinearLayout xmlns:android="[Link]
xmlns:app="[Link]
xmlns:tools="[Link]
android:layout_width="match_parent"
android:layout_height="match_parent"
android:padding="10dp"
tools:context=".MainActivity"
android:orientation="vertical">

Page No. 7
405-02 : Mobile Application Development-2
<[Link]
android:id="@+id/tablayout"
android:layout_width="match_parent"
android:layout_height="wrap_content">

<[Link]
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="VEG" />

<[Link]
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="NON-VEG" />

<[Link]
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="FASTFOODS" />
</[Link]>

<[Link].ViewPager2
android:id="@+id/viewpager2"
android:layout_width="match_parent"
android:layout_height="match_parent" />
</LinearLayout>

 [Link]
package [Link];
import [Link];
import [Link].ViewPager2;
import [Link];
import [Link];

public class MainActivity extends AppCompatActivity {


ViewPager2 vp;
TabLayout tl;
MyPageAdapter;
@Override
protected void onCreate(Bundle savedInstanceState) {
[Link](savedInstanceState);
setContentView([Link].activity_main);
vp=(ViewPager2)findViewById([Link].viewpager2);
tl=(TabLayout)findViewById([Link]);

Page No. 8
405-02 : Mobile Application Development-2
myPageAdapter=new MyPageAdapter(this);
[Link](myPageAdapter);
[Link](new [Link]() {
@Override
public void onTabSelected([Link] tab) {
[Link]([Link]());
}
@Override
public void onTabUnselected([Link] tab) {
}
@Override
public void onTabReselected([Link] tab) {
}
});
[Link](new [Link]() {
@Override
public void onPageSelected(int position) {
[Link](position);
[Link](position).select();
}
});
}
}

 [Link]
package [Link];
import [Link];
import [Link];
import [Link];
import [Link];

public class MyPageAdapter extends FragmentStateAdapter


{
public MyPageAdapter(@NonNull FragmentActivity fragmentActivity) {
super(fragmentActivity);
}

@Override
public Fragment createFragment(int position) {
if(position==0){
return new Veg();
}else if(position==1){
return new Nonveg();
} else if (position==2) {
return new Fastfood();

Page No. 9
405-02 : Mobile Application Development-2
}else{
return null;
}
}

@Override
public int getItemCount() {
return 3;
}
}

 Fragment_veg.xml

<?xml version="1.0" encoding="utf-8"?>


<FrameLayout xmlns:android="[Link]
xmlns:tools="[Link]
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".Veg">

<!-- TODO: Update blank fragment layout -->


<ListView
android:id="@+id/lv"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:scrollbars="vertical"
android:layout_marginTop="12dp"
android:divider="@android:color/transparent"
android:dividerHeight="10.0sp"
android:padding="10dp" />
</FrameLayout>

 [Link]
package [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];

public class Veg extends Fragment {


ListView;
String [] name={"Tava Pulav","Sada Dosa","Green Bhaji","Pav Bhaji","Burger","Veg
Manchurian","Paneer Tikka"};

Page No. 10
405-02 : Mobile Application Development-2
int imgs[]=
{[Link],[Link],[Link],[Link],[Link]
gur,[Link],[Link]};
int price[]={100,80,120,100,100,150,200};
@Override
public View onCreateView(LayoutInflater inflater, ViewGroup container,
Bundle savedInstanceState) {
View view= [Link]([Link].fragment_veg, container, false);
listview=(ListView)[Link]([Link]);
MyListAdapter myListAdapter=new MyListAdapter((Activity)
[Link](),imgs,name,price);
//ArrayAdapter<String>adp=new ArrayAdapter<>(getActivity(),
[Link].simple_list_item_1,n);
[Link](myListAdapter);
return view;
}
}

 activity_listitem.xml
<?xml version="1.0" encoding="utf-8"?>
<[Link]
xmlns:android="[Link]
xmlns:app="[Link]
android:layout_marginStart="15dp"
android:layout_marginEnd="15dp"
app:cardCornerRadius="25dp"
app:cardElevation="10dp"
android:layout_marginHorizontal="12dp"
android:layout_marginVertical="12dp"
android:layout_width="match_parent"
android:layout_height="wrap_content">

<RelativeLayout
android:layout_width="match_parent"
android:layout_height="wrap_content">
<[Link]
android:layout_width="60dp"
android:layout_height="60dp"
android:id="@+id/imgv"
android:src="@drawable/akshya"
android:scaleType="centerCrop"
android:layout_marginStart="12dp"
android:layout_marginBottom="12dp"
android:layout_marginTop="12dp"
app:shapeAppearanceOverlay="@style/roundedImage"/>

Page No. 11
405-02 : Mobile Application Development-2
<TextView
android:id="@+id/txtname"
android:layout_width="wrap_content"
android:layout_height="30dp"
android:layout_marginStart="20dp"
android:layout_marginTop="25dp"
android:layout_toEndOf="@+id/imgv"
android:text="Name"
android:textColor="#4EB1FF"
android:textSize="20sp"
android:textStyle="bold" />

<TextView
android:id="@+id/txtprice"
android:layout_width="wrap_content"
android:layout_height="30dp"
android:layout_alignParentRight="true"
android:layout_marginTop="25dp"
android:layout_toEndOf="@+id/txtname"
android:paddingRight="30dp"
android:text="Time"
android:textAlignment="textEnd"
android:textColor="#62B7FA"
android:textSize="18dp"
android:textStyle="bold" />
</RelativeLayout>
</[Link]>

 [Link]
package [Link];
import [Link];
import [Link];
public class Listitem extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
[Link](savedInstanceState);
setContentView([Link].activity_listitem);
}
}

Page No. 12
405-02 : Mobile Application Development-2
 [Link]
package [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];
import [Link];

public class MyListAdapter extends ArrayAdapter {


Activity activity;
int img[];
String name[];
int price[];
public MyListAdapter( Activity context, int img[],String name[],int price[]) {
super(context, [Link].activity_listitem,name);
[Link]=context;
[Link]=img;
[Link]=name;
[Link]=price;
}
@Override
public View getView(int position, View convertView, ViewGroup parent) {
LayoutInflater lin=[Link]();
View view=[Link]([Link].activity_listitem,null,false);
ImageView imgs=(ImageView) [Link]([Link]);
TextView names=(TextView) [Link]([Link]);
TextView prices=(TextView) [Link]([Link]);
[Link](img[position]);
[Link](name[position]);
[Link]("Rs."+[Link](price[position])+"/-");
return view;
}
}

Page No. 13
405-02 : Mobile Application Development-2
3. Create flutter app which contain registration & login form.

import 'package:flutter/[Link]';

void main() {
runApp(const MyApp());
}
class MyApp extends StatelessWidget {
const MyApp({[Link]});
@override
Widget build(BuildContext context) {
return MaterialApp(

Page No. 14
405-02 : Mobile Application Development-2
debugShowCheckedModeBanner: false,
title: 'Flutter Demo',
theme: ThemeData(
colorScheme: [Link](seedColor: [Link]),
useMaterial3: true,
),
home: const MyHomePage(title: 'FlutterApp'),
);
}
}

class MyHomePage extends StatefulWidget {


const MyHomePage({[Link], required [Link]});
final String title;
@override
State<MyHomePage> createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
bool isChecked=false;
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
backgroundColor: [Link],
title: Text([Link]),
),
body: Center(
child: SingleChildScrollView(
child: Padding(
padding: const [Link](20,0, 20,20),
child: Column(
children:[
Text("LOGIN HERE",
style: TextStyle(fontSize: 30,color: [Link],
fontWeight: [Link],),),
SizedBox(height: 40,),
TextField(
decoration: InputDecoration(
hintText: "Enter Username",
labelText: "UserName",
border: OutlineInputBorder(borderRadius: [Link](5)),
),
),
SizedBox(height: 30,),
TextField(
obscureText: true,

Page No. 15
405-02 : Mobile Application Development-2
decoration: InputDecoration(
hintText: "Enter Password",
labelText: "Password",
border: OutlineInputBorder(borderRadius: [Link](5)),
),
),
SizedBox(height: 20,),
Row(
children: [
Checkbox(value: isChecked, onChanged: (newvalue){
setState(() {
isChecked=newvalue!;
});
},
),
Text("Agree Term & Conditions.",
style: TextStyle(fontSize: 20,color: [Link],
fontWeight: [Link])),
],
),
SizedBox(height: 20,),
TextButton(
style: [Link](
backgroundColor: [Link],
padding: [Link](50, 10, 50, 10),
shape: RoundedRectangleBorder(borderRadius: [Link](5))
),
onPressed:() {
if(isChecked) {
[Link](context).push(
MaterialPageRoute(
builder: (context) => MyRegistration()));
}
},
child: Text("LOGIN",
style: TextStyle(color: [Link],fontSize: 25,letterSpacing: 5),),
),
SizedBox(height: 20,),
Row(
mainAxisAlignment:[Link],
children: [
Text("Don't have Account ?",
style:TextStyle(color: [Link],fontSize: 20,)),
TextButton(onPressed: (){
[Link](context,
MaterialPageRoute(builder: (context) => MyRegistration(),));

Page No. 16
405-02 : Mobile Application Development-2
}, child: Text("SignUp",style:
TextStyle(color: [Link],fontSize: 20,letterSpacing: 1,)))
],
),
]
),
),
),
),
);
}
}

class MyRegistration extends StatefulWidget {


const MyRegistration({[Link]});
@override
State<MyRegistration> createState() => _MyRegistrationState();
}
class _MyRegistrationState extends State<MyRegistration> {
String? gender;
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(title: Text("Registration"), backgroundColor: [Link],),
body: Container(
child: SingleChildScrollView(
child: Padding(
padding: const [Link](20,20,20,20),
child: Column(
mainAxisAlignment: [Link],
children:[
Text("REGISTER HERE",
style:TextStyle(fontSize: 25,color: [Link],fontWeight: [Link]),),
SizedBox(height: 20,),
TextField(
decoration: InputDecoration(
hintText: "Enter FullName",
labelText: "Full Name",
border: OutlineInputBorder(borderRadius: [Link](5)),
),
),
SizedBox(height: 10,),
TextField(
decoration: InputDecoration(
hintText: "Enter Email",
labelText: "Email",

Page No. 17
405-02 : Mobile Application Development-2
border: OutlineInputBorder(borderRadius: [Link](5)),
),
),
SizedBox(height: 10,),
TextField(
decoration: InputDecoration(
hintText: "Enter MobileNo.",
labelText: "MobileNo",
border: OutlineInputBorder(borderRadius: [Link](5)),
),
),
SizedBox(height: 10,),
TextField(
obscureText: true,
decoration: InputDecoration(
hintText: "Enter Password",
labelText: "Password",
border: OutlineInputBorder(borderRadius: [Link](5)),
),
),
SizedBox(height: 20,),
Row(children: [
Text("Gender",
style:TextStyle(fontSize: 25,color: [Link],
fontWeight: [Link],fontFamily: 'Arial'),),
Radio(value:"Male", groupValue: gender, onChanged:(newvalue){
setState(() {
gender=newvalue;
});
}),
Text("Male", style:TextStyle(fontSize: 25,
color: [Link],fontWeight: [Link],),),
Radio(value:"FeMale", groupValue: gender, onChanged:(newvalue){
setState(() {
gender=newvalue;
});
}),
Text("FeMale", style:TextStyle(fontSize: 25,
color: [Link],fontWeight: [Link],),),
//Radio(value:"FeMale", groupValue: gender, onChanged:(){}),

],),
TextButton(
style: [Link](
backgroundColor: [Link],
padding: [Link](50, 10, 50, 10),

Page No. 18
405-02 : Mobile Application Development-2
shape: RoundedRectangleBorder(borderRadius: [Link](5))
),
onPressed:() {
},
child: Text("SIGNUP",
style: TextStyle(color: [Link],fontSize: 25,letterSpacing: 5),),
),
]
),
),
),
),
);
}
}

Page No. 19

You might also like