Docs
Android
Unit 6

1. What is SMS?

SMS stands for Short Message Service. It is a text messaging service that allows mobile phone users to exchange short text messages (up to 160 characters) with each other.

SMS is a popular communication method that is widely used for personal and business purposes.

SMS messages are sent and received through mobile networks, and they can be sent between different mobile devices, as well as between mobile devices and other types of devices such as computers and servers.

SMS messages are typically charged based on the number of messages sent or a flat rate for a certain number of messages per month.


2. What is security?

Security refers to the protection of assets from harm or unauthorized access.

In the context of computer systems and software development, security refers to measures taken to protect computer systems, networks, and data from unauthorized access, use, disclosure, disruption, modification, or destruction.

This can include the use of encryption to protect data in transit and at rest, implementing access controls to restrict access to sensitive information, and using firewalls and intrusion detection systems to protect against attacks from external sources.

Security is a critical aspect of software development, and it requires a holistic approach that involves not only technical measures, but also policies and procedures that govern how data is accessed and used.


3. What is meant by application development.

Application development refers to the process of creating computer software programs or mobile apps for specific purposes, such as solving a problem or meeting a business need. The process of application development typically involves designing, coding, testing, and deploying the application.

Application development can involve a variety of programming languages, frameworks, and tools, depending on the requirements of the application and the platform on which it will be deployed. For example, web applications may be developed using languages like HTML, CSS, and JavaScript, while mobile apps may be developed using languages like Java, Swift, or Kotlin.

The development process typically involves collaboration between developers, designers, and stakeholders to ensure that the application meets the needs of the end-users and performs its intended functions effectively. Continuous improvement and maintenance may also be required to keep the application up-to-date and functioning properly.


4. Explain the term SMS telephony in detail.

SMS telephony is a technology that enables users to send and receive text messages using a phone number, just like a traditional phone call. SMS stands for Short Message Service, which is a protocol used to send text messages between mobile devices and other communication devices.

SMS telephony works by using a phone number to send and receive text messages instead of a dedicated messaging app or platform. This means that users can send and receive text messages using their regular phone number, just like making and receiving phone calls.

SMS telephony is widely used by businesses to send alerts, notifications, and other important information to their customers. It can also be used for two-factor authentication and password reset processes, as well as for customer support and other communication purposes.

One of the main advantages of SMS telephony is its ubiquity - almost everyone has a phone number, and SMS is supported on almost all mobile devices. Additionally, SMS messages are delivered in near real-time, making it a fast and efficient means of communication.

However, SMS telephony also has some limitations. For example, SMS messages are typically limited to 160 characters, and the protocol does not support rich media like images or videos. Additionally, SMS messages are not always reliable, and messages can be delayed or not delivered in some cases.

Despite these limitations, SMS telephony remains a widely used and important communication technology, particularly in situations where other forms of communication are not available or practical.


5. Describe the term location based services in detail.

Location-based services (LBS) refer to a category of services that utilize the location of a mobile device or other wireless device to provide users with contextually relevant information or services. These services can include everything from directions and maps to local weather and recommendations for nearby restaurants or attractions.

LBS typically rely on a combination of technologies, including GPS (Global Positioning System), Wi-Fi, and cellular network data, to determine the user's location. Once the location is determined, the service can then provide relevant information or services to the user based on their current location.

Some common examples of LBS include:

  • Maps and navigation: Services like Google Maps and Apple Maps provide users with turn-by-turn directions and maps based on their current location.
  • Geotagging: Many social media platforms allow users to add location information to their posts, allowing friends and followers to see where they are or where they have been.
  • Location-based advertising: Advertisers can use LBS to deliver targeted ads to users based on their current location.
  • Location-based search: Search engines like Google can provide location-based search results, such as local businesses or attractions, based on the user's current location.

LBS have a wide range of potential applications, from improving navigation and travel to enhancing marketing and advertising efforts. However, there are also concerns about privacy and security, as the use of location data can potentially allow for the tracking and monitoring of users without their knowledge or consent.

Overall, LBS are a powerful tool that can provide valuable services and information to users based on their current location, but they must be used responsibly and with respect for users' privacy and security.


6. Explain the following terms with example:

  1. Displaying the map

  2. Displaying zoom control

  3. Displaying the map refers to the process of showing a digital representation of a geographical area on a device's screen. It usually involves using a mapping software or application, such as Google Maps, to generate a visual display of an area, which can be viewed on a computer or mobile device. For example, if you search for a city or address on Google Maps, the application will display a map of that location.

  4. Displaying zoom control refers to showing the user interface element that allows the user to zoom in or out of the displayed map. This is usually represented as a set of plus and minus buttons or a slider, which the user can use to adjust the zoom level of the map display. For example, on Google Maps, the zoom control is typically displayed in the bottom right corner of the map, and users can click on the plus or minus buttons to zoom in or out of the map display.


7. How to monitoring location in Android?

Android devices have built-in features for monitoring location, such as GPS, Wi-Fi, and cellular networks. Additionally, developers can use the Android Location API to build applications that can access and monitor the device's location in a variety of ways.

Here are some steps to monitor location in Android:

  1. Enable location services: Go to Settings on your Android device and enable location services. This will allow the device to determine your location using GPS, Wi-Fi, and cellular networks.
  2. Use Google Maps: Google Maps is an easy way to monitor your location on an Android device. Simply open the app and it will display your current location on the map.
  3. Use Android Location API: Developers can use the Android Location API to build applications that can access and monitor the device's location in a variety of ways. This API provides access to location data in a variety of formats, including latitude and longitude, altitude, and accuracy.
  4. Use third-party apps: There are many third-party apps available on the Google Play Store that can monitor location in a variety of ways. Some popular options include GPS Tracker, Life360, and Glympse.

When monitoring location on an Android device, it's important to keep in mind privacy and security concerns. Be sure to only share your location data with trusted apps and services, and consider using a VPN or other security measures to protect your data.


8. Describe Android security model with permissions.

The Android security model is based on a permissions system, which controls what actions and data an application can access on an Android device. Permissions are requests made by applications to the user or system to grant access to sensitive data or features, such as camera, microphone, contacts, or location.

Android applications are required to declare the permissions they need in their manifest file. When a user installs an app, they are presented with a list of permissions the app requires and must grant permission before the app can access the requested data or features.

  • There are two types of permissions in Android: normal permissions and dangerous permissions.

Normal permissions are considered less sensitive and do not pose a significant risk to user privacy or security. Examples of normal permissions include access to the device's vibration motor, network state, or internet access. Normal permissions are automatically granted to the app without the user's explicit approval.

Dangerous permissions, on the other hand, can potentially harm user privacy or security and require the user's explicit approval before the app can access them. Examples of dangerous permissions include access to the device's camera, microphone, contacts, or location. When an app requests dangerous permissions, the user is prompted to grant or deny access to each permission individually.

Android also provides a runtime permissions system, which requires apps to request dangerous permissions at runtime, i.e., when the app is running and trying to access the requested feature or data. This ensures that the user is aware of which permissions the app is using and can grant or revoke them as needed.

In summary, the Android security model with permissions ensures that users have control over what data and features an app can access and protects user privacy and security by requiring explicit approval for dangerous permissions.


9. How to create and displaying application on Google Play Store?

To create and display an application on Google Play Store, you need to follow these steps:

  1. Register for a Google Play Developer account: Go to the Google Play Console website and sign up for a developer account. You will need to provide some personal and payment information and pay a one-time registration fee of $25.
  2. Create a new application: Once you have registered for a developer account, log in to the Google Play Console and click on the "Create Application" button to start a new application.
  3. Fill out the application details: Enter the application details, including the app name, description, category, and screenshots. You can also upload an APK file, which is the compiled version of your app.
  4. Set pricing and distribution: Choose the pricing and distribution options for your app. You can set the app to be free or charge a price, and choose whether to distribute the app globally or only in certain countries.
  5. Submit the application: Review and submit the application for review by Google. The review process typically takes a few days, during which Google will check that your app meets their guidelines for quality and security.
  6. Publish the application: Once your application has been approved, you can publish it on the Google Play Store. Your app will then be available for users to download and install on their Android devices.

It's important to note that creating and publishing an application on Google Play Store is just the beginning. You will also need to promote your app, monitor user feedback, and update the app regularly to keep it running smoothly and maintain user interest.


10. Describe the term signing of application with example.

In the context of Android application development, signing refers to the process of digitally signing an application with a unique key to ensure its authenticity and integrity.

Every Android app must be signed before it can be installed on a device or uploaded to an app store. The signing process involves creating a digital certificate and signing the app with it, which allows users to verify that the app has not been tampered with and was created by a trusted source.

Here's an example of how to sign an Android app using the keytool command:

  1. Generate a Keystore: You can create a new Keystore file using the keytool command. This file will contain the private key and certificate for signing your app. For example, to create a new Keystore file called mykeystore.keystore, you can use the following command:

    keytool -genkey -v -keystore mykeystore.keystore -alias myalias -keyalg RSA -keysize 2048 -validity 10000
  2. Sign your app: Once you have created your Keystore file, you can sign your app using the jarsigner command. For example, to sign an app called myapp.apk with the mykeystore.keystore file, you can use the following command:

    jarsigner -verbose -sigalg SHA1withRSA -digestalg SHA1 -keystore mykeystore.keystore myapp.apk myalias
  3. Verify the signature: You can verify that your app has been signed correctly using the jarsigner command. For example, to verify the signature of an app called myapp.apk, you can use the following command:

    jarsigner -verify -verbose -certs myapp.apk

It's important to note that the signing process is a crucial step in Android app development, as it ensures the authenticity and integrity of your app. Without a valid signature, your app may not be accepted by app stores or may not run correctly on user devices.


11. How to custom permission in Android security model?

In Android, custom permissions can be created to provide additional security controls for an application. Custom permissions can be defined in the AndroidManifest.xml file of the application, and can be granted or denied to other applications by the user at install time.

Here are the steps to create a custom permission in the Android security model:

  1. Define the permission in the AndroidManifest.xml file: To create a custom permission, add a <permission> element to the AndroidManifest.xml file, with a unique name for the permission and a description of its purpose. For example:

    <permission
        android:name="com.example.myapp.PERMISSION_NAME"
        android:label="@string/permission_label"
        android:description="@string/permission_description"
        android:protectionLevel="dangerous"
     />

    The protectionLevel attribute specifies the level of protection for the permission, and can be set to normal, dangerous, signature, or signatureOrSystem.

  2. Use the permission in your app: Once the custom permission has been defined, you can use it in your app by adding a <uses-permission> element to the AndroidManifest.xml file. For example:

    <uses-permission android:name="com.example.myapp.PERMISSION_NAME"/>
  3. Request the permission at runtime: If the custom permission has a protectionLevel of dangerous, the user will be prompted to grant or deny the permission at runtime when the app attempts to use it. To request the permission, you can use the requestPermissions() method in your app's code.

    String[] permissions = { "com.example.myapp.PERMISSION_NAME" };
    requestPermissions(permissions, PERMISSION_REQUEST_CODE);

    You can then handle the user's response in the onRequestPermissionsResult() method.

Custom permissions can provide additional security controls for an application, allowing the user to grant or deny specific permissions to other apps at install time. This can help to prevent malicious apps from accessing sensitive data or performing unauthorized actions on the device.


12. With the help of example explain how to get locations in Android.

Here's an example of how to get the current location of a device in Android using the LocationManager and LocationListener classes:

  1. Request location permission: To access the device's location, you need to request the ACCESS_FINE_LOCATION permission from the user. You can do this by adding the following line to the AndroidManifest.xml file:

    <uses-permission android:name="android.permission.ACCESS_FINE_LOCATION"/>
  2. Create LocationManager instance: Create an instance of the LocationManager class to interact with the location service. You can do this in your activity's onCreate() method:

    LocationManager locationManager = (LocationManager) getSystemService(Context.LOCATION_SERVICE);
  3. Create LocationListener instance: Create an instance of the LocationListener class to receive location updates. You can do this by implementing the LocationListener interface and overriding its methods:

    LocationListener locationListener = new LocationListener() {
        public void onLocationChanged(Location location) {
            // Called when a new location is found
            double latitude = location.getLatitude();
            double longitude = location.getLongitude();
            Log.d("Location", "Latitude: " + latitude + ", Longitude: " + longitude);
        }
     
        public void onStatusChanged(String provider, int status, Bundle extras) {}
     
        public void onProviderEnabled(String provider) {}
     
        public void onProviderDisabled(String provider) {}
    };
  4. Register for location updates: Register the locationListener to receive location updates from the locationManager. You can do this in your activity's onResume() method:

    locationManager.requestLocationUpdates(LocationManager.GPS_PROVIDER, 0, 0, locationListener);

    This code requests location updates from the GPS_PROVIDER with a minimum time interval of 0 milliseconds and a minimum distance of 0 meters between updates.

  5. Unregister for location updates: To stop receiving location updates, you should unregister the locationListener from the locationManager in your activity's onPause() method:

    locationManager.removeUpdates(locationListener);

This example demonstrates how to get the current location of a device in Android using the LocationManager and LocationListener classes. The onLocationChanged() method will be called each time the device's location is updated, and the latitude and longitude of the new location will be logged to the console.