0% found this document useful (0 votes)
8 views7 pages

MAD Syntax

The document provides a comprehensive guide on Android development, covering the installation of Android Studio, creating virtual devices, and building a 'Hello World' application. It details various UI components such as TextView, EditText, Buttons, and layouts, along with examples of implementing functionalities like a login form, countdown timer, and SQLite database interactions. Additionally, it includes instructions for using intents, services, and permissions, as well as creating applications like a converter and SMS application.

Uploaded by

kishorgaikar826
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)
8 views7 pages

MAD Syntax

The document provides a comprehensive guide on Android development, covering the installation of Android Studio, creating virtual devices, and building a 'Hello World' application. It details various UI components such as TextView, EditText, Buttons, and layouts, along with examples of implementing functionalities like a login form, countdown timer, and SQLite database interactions. Additionally, it includes instructions for using intents, services, and permissions, as well as creating applications like a converter and SMS application.

Uploaded by

kishorgaikar826
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

BY-Prof.K.R.

CHAURE (CO DEPT )

1. Install Android IDE & Create AVD


Android Studio → Tools → Device Manager → Create
Virtual Device → Select Device → Select System Image →
Finish
(No code syntax)

2. Hello World Program


activity_main.xml
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Hello World"/>

3. Android Directory Structure


app/
├── manifests/[Link]
├── java/[Link]/[Link]
├── res/
│ ├── layout/
│ ├── drawable/
│ ├── values/

4. TextView & EditText


<TextView
android:text="Username"/>

<EditText
android:id="@+id/etUser"
android:hint="Enter name"/>

5. Button, ImageButton, ToggleButton


<Button android:text="Submit"/>

<ImageButton
android:src="@drawable/ic_launcher"/>

<ToggleButton
android:textOn="ON"
android:textOff="OFF"/>

6. CheckBox & RadioButton


<CheckBox android:text="Java"/>

<RadioGroup>
<RadioButton android:text="Male"/>
<RadioButton android:text="Female"/>
</RadioGroup>

7. Progress Bar
<ProgressBar
android:layout_width="wrap_content"
android:layout_height="wrap_content"/>
8. Login Form
<EditText android:hint="Username"/>
<EditText android:hint="Password"/>
<Button android:text="Login"/>

9. LinearLayout & ConstraintLayout + Custom Toast


<LinearLayout android:orientation="vertical">
Toast toast =
[Link](this,"Registered",Toast.LENGTH_SHORT);
[Link]();

10. FrameLayout, TableLayout, RelativeLayout


<FrameLayout> </FrameLayout>

<TableLayout>
<TableRow>
<TextView/>
<TextView/>
</TableRow>
</TableLayout>

<RelativeLayout>
<Button
android:layout_centerInParent="true"/>
</RelativeLayout>

11. GridView, ImageView, ScrollView, ListView


<GridView android:numColumns="2"/>

<ImageView android:src="@drawable/img"/>

<ScrollView>
<LinearLayout></LinearLayout>
</ScrollView>

<ListView android:id="@+id/list"/>

12. Simple Calculator (GridLayout)


<GridLayout android:columnCount="4">
<Button android:text="1"/>
</GridLayout>

13. Splash Screen


<style name="[Link]">
<item
name="android:windowBackground">@drawable/splash</ite
m>
</style>

14. Converter App


double c = [Link]([Link]().toString());
double f = (c * 9/5) + 32;

15. Countdown Timer


new CountDownTimer(10000,1000){
public void onTick(long ms){}
public void onFinish(){}
}.start();

16. Date Picker


DatePickerDialog dp = new DatePickerDialog(this);
[Link]();

17. Time Picker


TimePickerDialog tp = new TimePickerDialog(this);
[Link]();

18. Two Activities (Login App)


Intent i = new Intent(this,[Link]);
startActivity(i);

19. Explicit & Implicit Intent


// Explicit
new Intent(this,[Link]);

// Implicit
Intent i = new Intent(Intent.ACTION_VIEW,
[Link]("[Link]
startActivity(i);

20. Services (WiFi / Bluetooth)


WifiManager wifi =
(WifiManager)getSystemService(WIFI_SERVICE);
[Link](true);

21. Broadcast Receiver


public class MyReceiver extends BroadcastReceiver {
public void onReceive(Context c, Intent i){}
}

22. SQLite Database (Register App)


SQLiteDatabase db =
openOrCreateDatabase("UserDB",MODE_PRIVATE,null);
[Link]("CREATE TABLE user(name TEXT)");

23. Authentication App


Cursor c = [Link]("SELECT * FROM user",null);

24. MyContacts App


ContentResolver cr = getContentResolver();
Cursor c =
[Link]([Link].CONTENT_URI,null,nul
l,null,null);

25. Camera
Intent i = new
Intent(MediaStore.ACTION_IMAGE_CAPTURE);
startActivityForResult(i,100);

26. SMS Application


SmsManager sms = [Link]();
[Link]("1234567890",null,"Hello",null,null);

27. Email
Intent i = new Intent(Intent.ACTION_SEND);
[Link]("message/rfc822");
startActivity(i);

28. Location Services + Permission


[Link](this,
new
String[]{[Link].ACCESS_FINE_LOCATION}
,1);

29. Navigation Drawer (Fragment)


DrawerLayout drawer = findViewById([Link].drawer_layout);

30. Flashlight App + Permission


CameraManager cm =
(CameraManager)getSystemService(CAMERA_SERVICE);
[Link](cameraId,true);

You might also like