Android Notes tutorial, Exercises of Computer science

Practical Notes Lab assignmemts of Android fundamental application development

Typology: Exercises

2018/2019

Uploaded on 09/20/2019

mj8055
mj8055 🇮🇳

1 document

1 / 136

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
SITTTR – Smart Device Programming Manual
Page 1
LAB MANUAL
SMART DEVICE PROGRAMMING LAB
6138
by
SITTTR
KALAMASSERY
pf3
pf4
pf5
pf8
pf9
pfa
pfd
pfe
pff
pf12
pf13
pf14
pf15
pf16
pf17
pf18
pf19
pf1a
pf1b
pf1c
pf1d
pf1e
pf1f
pf20
pf21
pf22
pf23
pf24
pf25
pf26
pf27
pf28
pf29
pf2a
pf2b
pf2c
pf2d
pf2e
pf2f
pf30
pf31
pf32
pf33
pf34
pf35
pf36
pf37
pf38
pf39
pf3a
pf3b
pf3c
pf3d
pf3e
pf3f
pf40
pf41
pf42
pf43
pf44
pf45
pf46
pf47
pf48
pf49
pf4a
pf4b
pf4c
pf4d
pf4e
pf4f
pf50
pf51
pf52
pf53
pf54
pf55
pf56
pf57
pf58
pf59
pf5a
pf5b
pf5c
pf5d
pf5e
pf5f
pf60
pf61
pf62
pf63
pf64

Partial preview of the text

Download Android Notes tutorial and more Exercises Computer science in PDF only on Docsity!

SITTTR – Smart Device Programming Manual Page 1

LAB MANUAL

SMART DEVICE PROGRAMMING LAB

by

SITTTR

KALAMASSERY

SITTTR – Smart Device Programming Manual Page 2

STATE INSTITUTE OF TECHNICAL TEACHERS TRAINING AND RESEARCH

GENERAL INSTRUCTIONS Rough record and Fair record are needed to record the experiments conducted in the laboratory. Rough records are needed to be certified immediately on completion of the experiment. Fair records are due at the beginning of the next lab period. Fair records must be submitted as neat, legible, and complete. INSTRUCTIONS TO STUDENTS FOR WRITING THE FAIR RECORD In the fair record, the index page should be filled properly by writing the corresponding experiment number, experiment name , date on which it was done and the page number. On the right side page of the record following has to be written:

  1. Title : The title of the experiment should be written in the page in capital letters.
  2. In the left top margin, experiment number and date should be written.
  3. Aim : The purpose of the experiment should be written clearly.
  4. Apparatus/Tools/Equipments/Components used: A list of the Apparatus/Tools /Equipments /Components used for doing the experiment should be entered.
  5. Principle : Simple working of the circuit/experimental set up/algorithm should be written.
  6. Procedure: steps for doing the experiment and recording the readings should be briefly described(flow chart/programs in the case of computer/processor related experiments)
  7. Results : The results of the experiment must be summarized in writing and should be fulfilling the aim.
  8. Inference : Inference from the results is to be mentioned. On the Left side page of the record following has to be recorded:
  9. Circuit/Program : Neatly drawn circuit diagrams/experimental set up.
  10. Design : The design of the circuit/experimental set up for selecting the components should be clearly shown if necessary.
  11. Observations: i) Data should be clearly recorded using Tabular Columns. ii) Unit of the observed data should be clearly mentioned iii) Relevant calculations should be shown. If repetitive calculations are needed, only show a sample calculation and summarize the others in a table.

SITTTR – Smart Device Programming Manual Page 4

Contents

  1. Introduction
  2. Installing Android Studio 2.1 Installing Android Studio on ubuntu 2.2 Installing Android Studio on windows
  3. Creating New Project on Android Studio
  4. Open, Re-open and Close existing project on Android studio
  5. Creating Android Virtual Devices
  6. Android Applications 6.1 Create Hello World application 6.2 Linking Activities using Intent 6.3 Passing Data Using an Intent Object 6.4 Implicit intents Familiarization 6.5 Understanding different layouts in android 6.6 Create a simple listview 6.7 Create a listview with image and text 6.8 Integrate a website inside the application using Webview 6.9 Saving Data Using the SharedPreferences Object 6.10 Saving Data to Internal Storage as files 6.11 SQLite program for database operations 6.12 Student database using SQlite 6.13 Create a hello world html5 application 6.14 Digital Bio Data Application using HTML
  7. Installing an application on a mobile device
  8. Syllabus
  9. References

SITTTR – Smart Device Programming Manual Page 5

Introduction

Android is an open source and Linux-based Operating System for mobile devices such as smartphones and tablet computers. Android was developed by the Open Handset Alliance, led by Google, and other companies. Android offers a unified approach to application development for mobile devices which means developers need only develop for Android, and their applications should be able to run on different devices powered by Android. The first beta version of the Android Software Development Kit (SDK) was released by Google in 2007 where as the first commercial version, Android 1.0, was released in September 2008. The source code for Android is available under free and open source software licenses.

Android is an operating system based on Linux with a Java programming interface. Android provides a rich application framework that allows to build innovative apps and games for mobile devices in a Java language environment. The Android Software Development Kit (Android SDK) provides all necessary tools to develop Android applications. The Android SDK contains tools to create, compile and package Android application. The Android SDK also provides an Android device emulator, so that Android applications can be tested without a real Android phone. We can create Android virtual devices (AVD) via the Android SDK, which run in this emulator. The Android SDK contains the Android debug bridge (adb) tool which allows to connect to a virtual or real Android device. Google offers the Google Play service in which programmers can offer their Android application to Android users. Google phones include the Google Play application which allows installing applications. Google Play also offers an update service ie. if a programmer uploads a new version of his application to Google Play, this service will notify existing users that an update is available and allow to install it.

SITTTR – Smart Device Programming Manual Page 7

Step1: Setup the repo for installing Android Studio

$ sudo apt-add-repository ppa:paolorotolo/android-studio

Step2: $ sudo apt-get update

Step3: $ sudo apt-get install android-studio

Above install command will install android-studio in the directory /opt. Now, run the following command to start the setup wizard:

Step4: $ /opt/android-studio/bin/studio.sh

This will invoke the setup screen. Following are the screen shots that follow to set up Android studio:

SITTTR – Smart Device Programming Manual Page 11

Chapter-

Installing Android Studio on Windows Android Studio is one of the best and most popular IDE for development of Android application which is released by IntelliJ IDEA. Android studio has rich functionalists and easy to work. Android studio has great and awesome user interface, it is also smart with coding and will save your time.

Android programming is Java based programming so it requires JDK & JRE environment. You must have toinstall JDK & JREfor working with android. After installing JDK and JRE you need to configure Environment variables on your computer. Environment variables let to provide some specific path for android. There will be JDK/bin or JDK only. After installing JDK & JRE and configuring environment variables, the next step will be installation of SDK (Software Development Kit). This is another important component for android programming. If you are thinking to develop android apps, then you must install SDK on your computer.

Installing Andrio Studio on Windows

To download Android Studio for you computer, you need to visit official site of android. There you will see android studio download button.

SITTTR – Smart Device Programming Manual Page 13

Step3: Now choose what you want to install, all are most important component in android programming.

Go for "Next"

SITTTR – Smart Device Programming Manual Page 14

Step4: Go for "I Agree", It's for integrating SDK, it will confirm SDK installation.

Step5: Go for "I Agree", It's for Haxm installation.

SITTTR – Smart Device Programming Manual Page 16

Step7: Here you need to define the size of android emulator processor. You can define up to

2GB and more than that, depends on your RAM capacity. The size will be determined

through Haxm. This will help your android studio to run faster.

SITTTR – Smart Device Programming Manual Page 17

Step8: Now choose setting for shortcut of android studio on your computer.

  • SITTTR – Smart Device Programming Manual Page
  • SITTTR – Smart Device Programming Manual Page
  • SITTTR – Smart Device Programming Manual Page

SITTTR – Smart Device Programming Manual Page 20

Chapter-

Creating New Project on Android Studio Android Studio is one of the best IDE (Integrated Development Environment) for Android Developers with rich functionality and control mechanism. It was announced on 2013 and today it is one of the most popular IDE in the world for android development purpose.

In this chapter we will learn how to create new project on android studio.

Step1: First of all you need to start your Android Studio. Then it will show you the default start window on your screen, where you can see various options.