MAD question bank Flashcards
How do you publish android applications in the market? Explain
Android application publishing is a process that makes your Android applications available to users. Infect, publishing is the last phase of the Android application development process.
Once you developed and fully tested your Android Application, you can start selling or distributing free using Google Play (A famous Android marketplace). You can also release your applications by sending them directly to users or by letting users download them from your own website.
You can check a detailed publishing process at Android official website, but this tutorial will take you through simple steps to launch your application on Google Play. Here is a simplified check list which will help you in launching your Android application −
- Regression Testing
Before you publish your application, you need to make sure that its meeting the basic quality expectations for all Android apps, on all of the devices that you are targeting. So perform all the required testing on different devices including phone and tablets.
2 Application Rating
When you will publish your application at Google Play, you will have to specify a content rating for your app, which informs Google Play users of its maturity level. Currently available ratings are (a) Everyone (b) Low maturity (c) Medium maturity (d) High maturity.
3 Targeted Regions
Google Play lets you control what countries and territories where your application will be sold. Accordingly you must take care of setting up time zone, localization or any other specific requirement as per the targeted region.
4 Application Size
Currently, the maximum size for an APK published on Google Play is 50 MB. If your app exceeds that size, or if you want to offer a secondary download, you can use APK Expansion Files, which Google Play will host for free on its server infrastructure and automatically handle the download to devices.
5 SDK and Screen Compatibility
It is important to make sure that your app is designed to run properly on the Android platform versions and device screen sizes that you want to target.
6 Application Pricing
Deciding whether you app will be free or paid is important because, on Google Play, free app’s must remain free. If you want to sell your application then you will have to specify its price in different currencies.
7 Promotional Content
It is a good marketing practice to supply a variety of high-quality graphic assets to showcase your app or brand. After you publish, these appear on your product details page, in store listings and search results, and elsewhere.
8 Build and Upload release-ready APK
The release-ready APK is what you you will upload to the Developer Console and distribute to users. You can check complete detail on how to create a release-ready version of your app: Preparing for Release.
9 Finalize Application Detail
Google Play gives you a variety of ways to promote your app and engage with users on your product details page, from colourful graphics, screen shots, and videos to localized descriptions, release details, and links to your other apps. So you can decorate your application page and provide as much as clear crisp detail you can provide.
Before exporting the apps, you must some of tools
Dx tools(Dalvik executable tools ): It going to convert .class file to .dex file. it has useful for memory optimization and reduce the boot-up speed time
AAPT(Android assistance packaging tool):it has useful to convert .Dex file to.Apk
APK(Android packaging kit): The final stage of deployment process is called as .apk.
- Discuss the important characteristics of Mobile Applications.
- Simplicity for the End-User
Convenient user interface and logical navigation are the foundation for a great UX. This simple characteristic makes an app rank the best among alternative digital products. - Both iOS and Android Must Be Covered
- High Performance
Remember the moment when your app is launched. Since that time, your software product should not make its users wait for something to be loaded. You should make sure that your app works fast, and if it does not — you should pay particular attention to it. Keep up with the continuous mobile app optimization to make all the screens and in-app processes loaded in a speedy manner. It is key for mobile app high performance. - Security
This feature is important for mobile apps across various industries, however, the financial and healthcare areas should be particularly emphasized here. Mobile app security means the user data are well-protected at a legal level. It is one of the critical requirements of a successive mobile app. - Regular Updates
The truly excellent software product needs a continuous process of improvements and updates. It promises the lasting popularity of a mobile app. Maintain your server and make sure that your content is always up-to-date. Regularly update an app and enrich it with new features.
- Explain about saving data to internal and external storage in Android Environment.
- Storage on the Inside
When you install an app on your phone, the Android operating system will give you some form of secret internal storage where the app can store its private data. No other application has access to this information. When you uninstall an application, all of the data associated with it is also removed.
To save a file to the internal storage, you must first obtain it from the internal directory. You can do this by calling the getFilesDir() or getCacheDir() methods. The getFilesDir() method returns the absolute path to the directory where files are created on the filesystem. getCacheDir() returns the absolute path to the filesystem’s application-specific cache directory.
When Should Internal Storage Be Used?
The internal storage can be used when you need some confidential data for your application. Another thing to keep in mind is that if your app is storing data that may be utilized by other apps, you should avoid using internal storage since when you remove the app, all of your data will be gone, and other apps will never have access to that data. For instance, if your app is downloading a pdf or storing an image or video that might be used by other apps, you shouldn’t use internal storage.
- External Hard Drives
Most Android devices have relatively low internal storage. As a result, we keep our data on an external storage device. These storage units are accessible to everyone, which means they can be accessed by all of your device’s applications. You can also access the storage by connecting your mobile device to a computer. You must obtain the READ EXTERNAL STORAGE permission from the user in order to gain access to the external storage. As a result, any application with this permission has access to your app’s data.
When is it appropriate to use external storage?
You can use external storage if the data that your application stores can be used by other applications. Additionally, if the file stored by your application is huge, such as a video, you can save it to external storage. You can use external storage to keep the data even after uninstalling the application.
- Write short notes on Kotlin and Object box.
Kotlin is a new open source programming language like Java, JavaScript, etc. It is a high level strongly statically typed language that combines functional and technical part in a same place. Currently, Kotlin targets Java and JavaScript. It runs on JVM.
Kotlin is influenced by other programming languages such as Java, Scala, Groovy, Gosu, etc. The syntax of Kotlin may not be exactly similar to JAVA, however, internally Kotlin is reliant on the existing Java Class library to produce wonderful results for the programmers. Kotlin provides interoperability, code safety, and clarity to the developers around the world.
ObjectBox is an Android database designed for Edge Computing and Offline First experiences.
- How Performance of an Android app can be judged? Discuss memory management in Android application development.
In this post, we’ll look at how to monitor app performance metrics to discover areas where the app uses resources inefficiently, such as CPU, network, memory, and device battery. The Android Profiler tools provide real-time statistics to understand how the app uses device resources. Several profiling tools are available in Android Studio to aid in the detection and visualization of possible issues:
CPU profiler: This tool helps in the identification of runtime performance issues.
Memory profiler: This tool aids in the tracking of memory allocations.
Network profiler: This tool measures network traffic utilization.
Energy profiler: This tool monitors energy consumption.
The Android Runtime (ART) and Dalvik virtual machine use paging and memory-mapping (mmapping) to manage memory. This means that any memory an app modifies—whether by allocating new objects or touching mmapped pages—remains resident in RAM and cannot be paged out. The only way to release memory from an app is to release object references that the app holds, making the memory available to the garbage collector. That is with one exception: any files mmapped in without modification, such as code, can be paged out of RAM if the system wants to use that memory elsewhere.
- Explain about Design standards of the User Interface (UI).
Visibility of system status.
Users should always be informed of system operations with easy to understand and highly visible status displayed on the screen within a reasonable amount of time.
Match between system and the real world.
Designers should endeavor to mirror the language and concepts users would find in the real world based on who their target users are. Presenting information in logical order and piggybacking on user’s expectations derived from their real-world experiences will reduce cognitive strain and make systems easier to use.
User control and freedom.
Offer users a digital space where backward steps are possible, including undoing and redoing previous actions.
Consistency and standards.
Interface designers should ensure that both the graphic elements and terminology are maintained across similar platforms. For example, an icon that represents one category or concept should not represent a different concept when used on a different screen.
Error prevention.
Whenever possible, design systems so that potential errors are kept to a minimum. Users do not like being called upon to detect and remedy problems, which may on occasion be beyond their level of expertise. Eliminating or flagging actions that may result in errors are two possible means of achieving error prevention.
Recognition rather than recall.
Minimize cognitive load by maintaining task-relevant information within the display while users explore the interface. Human attention is limited and we are only capable of maintaining around five items in our short-term memory at one time. Due to the limitations of short-term memory, designers should ensure users can simply employ recognition instead of recalling information across parts of the dialogue. Recognizing something is always easier than recall because recognition involves perceiving cues that help us reach into our vast memory and allowing relevant information to surface. For example, we often find the format of multiple choice questions easier than short answer questions on a test because it only requires us to recognize the answer rather than recall it from our memory.
Flexibility and efficiency of use. With increased use comes the demand for less interactions that allow faster navigation. This can be achieved by using abbreviations, function keys, hidden commands and macro facilities. Users should be able to customize or tailor the interface to suit their needs so that frequent actions can be achieved through more convenient means.
Aesthetic and minimalist design.
Keep clutter to a minimum. All unnecessary information competes for the user’s limited attentional resources, which could inhibit user’s memory retrieval of relevant information. Therefore, the display must be reduced to only the necessary components for the current tasks, whilst providing clearly visible and unambiguous means of navigating to other content.
Help users recognize, diagnose and recover from errors. Designers should assume users are unable to understand technical terminology, therefore, error messages should almost always be expressed in plain language to ensure nothing gets lost in translation.
Help and documentation.
Ideally, we want users to navigate the system without having to resort to documentation. However, depending on the type of solution, documentation may be necessary. When users require help, ensure it is easily located, specific to the task at hand and worded in a way that will guide them through the necessary steps towards a solution to the issue they are facing.
List out the best practices of Android Security. How to prevent hacking Android phones?
- Use implicit intents and non-exported content providers:
a. Show an app chooser
If an implicit intent can launch at least two possible apps on a user’s device, explicitly show an app chooser. This interaction strategy allows users to transfer sensitive information to an app that they trust.
b. Apply signature-based permissions
When sharing data between two apps that you control or own, use signature-based permissions. These permissions don’t require user confirmation and instead check that the apps accessing the data are signed using the same signing key. Therefore, these permissions offer a more streamlined, secure user experience.
c. Disallow access to your app’s content providers
Unless you intend to send data from your app to a different app that you don’t own, you should explicitly disallow other developers’ apps from accessing the ContentProvider objects that your app contains. This setting is particularly important if your app can be installed on devices running Android 4.1.1 (API level 16) or lower, as the android:exported attribute of the element is true by default on those versions of Android.
d. Ask for credentials before showing sensitive information
When requesting credentials from users so that they can access sensitive information or premium content in your app, ask for either a PIN/password/pattern or a biometric credential, such as using face recognition or fingerprint recognition.
- Categorize mobile applications development tools and introduce some real products and implementations for publishing
We have covered best Android & iOS mobile app development tools in the following categories.
Recommended Tool iPhone App development tools Mobile Analytic Tools Cross-Platform App Development Tools App Development frameworks AR (Augmented Reality) Tools AI(Artificial Intelligence) Tools Mobile Payment Tools Push notification Tools Game Engines
Cross-Platform App Development Tools
1) Xamarin:
Xamarin is the preferred mobile app development tool for native applications. It reuses business logic layers and data access across platforms. It is widely used to build apps for iOS, Windows, and Android app development.
- Appcelerator:
Appcelerator allows developers to create apps with fewer lines of code. This app development tool supports iOS, Android, Windows, and browser-based HTML5 applications.
App Development frameworks:
- KendoUI:
Kendo UI is an end-to-end mobile app development solution for modern client-side development. It follows modern web standards by providing highly modular app development solutions. - Mobile Angular UI:
Mobile Angular UI is a mobile app development framework. It relies on rich libraries like overthrow.js and fastclick.js to provide the better mobile experience.
- Demonstrate the usage of Implicit Intent with Code Snippet?
What is intent in Android?
Intent is an messaging object which passes between components like services, content providers, activities etc. Normally startActivity() method is used for invoking any activity.
Some of the general functions of intent are:
Start service Launch activity Display web page Display contact list Message broadcasting
Implicit Intent: Using implicit Intent, component can’t be specifying. An action to be performed is declared by implicit intent. Then android operating system will filter out component which will response to the action.
String url = editText1.getText().toString(); Intent intent=new Intent(Intent.ACTION_VIEW, Uri.parse(url)); startActivity(intent);
- How can we measure the UI performance of the mobile applications? Give a list of components of the UI tool kit.
UI response times: No app performance monitoring metrics are complete without an assessment of UI hangs. You need to constantly monitor the responsiveness of your app’s user interface for issues. Users can experience UI hangs for various reasons and if there’s a longer than usual delay (250ms on average) or a failure to respond to a user’s input, you need to be aware of it in order to fix it as soon as possible before the negative reports and comments come flooding in.
Moving forth we will see some important Android UI controls for our applications:
TextView EditText Button ImageButton ToggleButton RadioButton RadioGroup CheckBox AutoCompleteTextView ProgressBar Spinner TimePicker DatePicker SeekBar AlertDialog Switch RatingBar
Briefly discuss about deploying APK Files.
Before installing an app using an APK file other than Google Play Store, we have to ensure that our Android phone settings are enabled to install third-party apps. It can be checked under the “Security” tab or the Setting menu. Generally, this option says install from unknown sources or allows third-party installations. However, the newer Android versions of phones are a little more different.
Short note on object box
ObjectBox is a superfast object-oriented database with strong relation support. ObjectBox is embedded into your Android, Linux, macOS, or Windows app.
ObjectBox supports multiple platforms and languages. Besides JVM based languages like Java and Kotlin, ObjectBox also offers:
ObjectBox Swift: build fast mobile apps for iOS (and macOS)
ObjectBox Dart/Flutter: cross-platform for mobile and desktop apps (beta)
ObjectBox Go: great for data-driven tools and small server applications
ObjectBox C and C++: native speed with zero copy access to FlatBuffer objects
How MVVM architecture works
Developers always prefer a clean and structured code for the projects. By organizing the codes according to a design pattern helps in the maintenance of the software. By having knowledge of all crucial logic parts of the android application, it is easier to add and remove app features. Further, design patterns also assure that all the codes get covered in Unit Testing without the interference of other classes. Model — View — ViewModel (MVVM) is the industry-recognized software architecture pattern that overcomes all drawbacks of MVP and MVC design patterns. MVVM suggests separating the data presentation logic(Views or UI) from the core business logic part of the application.
The separate code layers of MVVM are:
Model: This layer is responsible for the abstraction of the data sources. Model and ViewModel work together to get and save the data.
View: The purpose of this layer is to inform the ViewModel about the user’s action. This layer observes the ViewModel and does not contain any kind of application logic.
ViewModel: It exposes those data streams which are relevant to the View. Moreover, it servers as a link between the Model and the View.
- Create a sample application to examine using the filesystem to store data, both internal to our application and external using the platform’s Secure Digital (SD) card support in Android Environment.
The aim of this article is to show users how to use internal storage. In this article will be creating an application that can write data to a file and store it in internal storage and read data from the file and display it on the main activity using TextView. Saving and loading data on the internal storage is private for an application that can not be accessed by other applications. When the app is uninstalled the data stored in the internal by that app is removed. To read and write in the android internal storage we have two methods
OpenFileOutput(): used for creating and saving a file. This method returns a FileOutputStream instance.
Syntax: OpenFileOutput(String filename,int mode)
Parameters:
mode:
Context.MODE_PRIVATE: If the file exists then it is overridden else a new file is created.
Context.MODE_APPEND: if the file exists then the data is appended at the end of the file.
Returns:
FileOutputStream object
OpenFileInput(): Used to read data from a file, this returns an FileInputStream instance.
Syntax: OpenFileInput( String filename)
Returns:
FileInputStream object
Step by Step Implementation
Step 1: Create a New Project
To create a new project in Android Studio please refer to How to Create/Start a New Project in Android Studio. Note that select Java as the programming language.
Step 2: Working with the activity_main.xml file
The activity_main.xml file has the following widgets
One EditText for accepting user input
Two Buttons one for reading data and the other for writing
One TextView to display the content of the file
Step 3: Working with the MainActivity.java file
Inside the MainActivity.java file we are going to do the following things:
- Initialize variables
- The file will be creating is DemoFile.txt. this can be found in Device File Explorer > data > data > application_package > files
What is android activity lifecycle. Explain briefly
Android Activity Lifecycle is controlled by 7 methods of android.app.Activity class. The android Activity is the subclass of ContextThemeWrapper class.
An activity is the single screen in android. It is like window or frame of Java.
By the help of activity, you can place all your UI components or widgets in a single screen.
The 7 lifecycle method of Activity describes how activity will behave at different states.
Android Activity Lifecycle methods
Let’s see the 7 lifecycle methods of android activity.
Methods:
onCreate:
called when activity is first created.
onStart:
called when activity is becoming visible to the user.
onResume:
called when activity will start interacting with the user.
onPause
called when activity is not visible to the user.
onStop
called when activity is no longer visible to the user.
onRestart
called after your activity is stopped, prior to start.
onDestroy
called before the activity is destroyed.
Draw activity lifecycle diagram
Write a program for activity lifecycle
It provides the details about the invocation of life cycle methods of activity. In this example, we are displaying the content on the logcat.
File: MainActivity.java
package example.javatpoint.com.activitylifecycle;
import android.app.Activity;
import android.os.Bundle;
import android.util.Log;
public class MainActivity extends Activity {
@Override protected void onCreate(Bundle savedInstanceState) { super.onCreate(savedInstanceState); setContentView(R.layout.activity_main); Log.d("lifecycle","onCreate invoked"); } @Override protected void onStart() { super.onStart(); Log.d("lifecycle","onStart invoked"); } @Override protected void onResume() { super.onResume(); Log.d("lifecycle","onResume invoked"); } @Override protected void onPause() { super.onPause(); Log.d("lifecycle","onPause invoked"); } @Override protected void onStop() { super.onStop(); Log.d("lifecycle","onStop invoked"); } @Override protected void onRestart() { super.onRestart(); Log.d("lifecycle","onRestart invoked"); } @Override protected void onDestroy() { super.onDestroy(); Log.d("lifecycle","onDestroy invoked"); } }
What is multimodal interface ?
Multimodal interfaces process two or more combined user input modes, such as speech, pen, touch, manual gestures, and gaze, in a coordinated manner with multimedia system output.
They are a new class of emerging systems that aim to recognize naturally occurring forms of human language and behavior, with the incorporation of one or more recognition-based technologies (e.g., speech, pen, vision). Multimodal interfaces represent a paradigm shift away from conventional graphical user interfaces (Fig. 1). They are being developed largely because they offer a relatively expressive, transparent, efficient, robust, and highly mobile form of human–computer interaction. They represent users’ preferred interaction style, and they support users’ ability to flexibly combine modalities or to switch from one input mode to another that may be better suited to a particular task or setting.
What are mobile agents
In Mobile Computing, Mobile Agents are the composition of computer software and data that can autonomously move from one computer to another computer and continue its execution on the destination computer.
In other words, you can say that An Mobile Agent is an autonomous program that is capable of moving from host to host in a network and interact with resources and other agents. In this process, the chance of data loss is scarce because the state of the running program is saved and then transported to the new host. It allows the program to continue execution from where it left off before migration. The most significant advantage of mobile agents is the possibility of moving complex processing functions to the location where you have enormous amounts of data and that have to be processed.
Types of mobile agents ?
Mobile Agents are also called as transportable agents. They are classified into two types:
Mobile Agents with pre-defined path: They have a static migration path.
Mobile Agents with undefined path i.e., Roamer: They have dynamic migration paths. The mobile agents choose their path according to the present network condition.
What are the four features of mobile agents ?
Features of Mobile Agents
The mobile agents are autonomous with intelligence, social ability, learning, and the most important feature is their mobility. They are independent in nature, self-driven and do not require a corresponding node for communication. They can work efficiently even after the user gets disconnected from the network.
Intelligence
Mobile Agents are capable of learning and searching for knowledge about their domain. That’s why they are called intelligent agents because they possess a degree of domain knowledge. They can also transport their state from one environment to another without disturbing the previous holding data and be capable of performing appropriately in the new environment.
Autonomous
The Mobile Agents are Autonomous. It means the agents are not only motivated by the outside actions initiated by the users or system but also they have internal events that decided their performance and behavior. The mobile agents can also take an autonomous decision while selecting a node.
Mobility
Mobile Agents contain some degree of mobility. The agent is not limited to its home node only. They can migrate from one node to another and can carry out tasks along with them. This feature distributes the processing and balancing of the load. Another benefit of this capability is that when the user goes offline, the agents will still keep functioning.
Communicative
Mobile Agents can communicate effectively with other agents, users and systems. The mobile agents use a communication language for inter-agent communication.
Draw the life cycle for mobile agents
The life cycle of mobile agents ensures the following conditions:
They can adapt to the environment. For example, either home or foreign environment.
They are capable of switching among the positions of one node to another.
They are autonomous and focused on the final output.
advantages and disadvantages of mobile agents ?
Advantages of Mobile Agents
The following are some advantages of mobile agents over conventional agents:
Mobile Agents are autonomous and self-driven in nature.
They are maintenance-friendly or easily maintainable.
They are Fault-tolerant. It means they are able to operate without an active connection between client and server.
They reduce the compilation time.
They provide less delay in the network.
They provide fewer loads on the network.
They facilitate parallel processing. It means they can be asynchronously executed on multiple heterogeneous network hosts.
They provide dynamic adaptation in which their actions are dependent on the state of the host environment.
Disadvantages of Mobile Agents
The following are some disadvantages of mobile agents:
The most significant disadvantage of mobile agents is their security. They are less secured
Applications of mobile agents ?
Mobile agents are used in the following applications:
Mobile Agents are applied in a wide range of domains such as E-commerce, traffic control, network management, robotics, data-intensive applications etc.
They are also used in grid computing, parallel computing, distributed computing and mobile computing etc.