Question:- Explain Swifts pattern matching techniques
Answer:- • Tuple patterns: Values of corresponding tuple forms are matched using tuple patterns. • Type-casting patterns: You can cast or mix styles using type-casting patterns. • Wildcard patterns: Every kind and kind of value is matched by wildcard patterns, which disregard them. • Optional patterns: To align optional values, optional patterns are used. • Enumeration case patterns: The cases of existing enumeration forms are matched by enumeration case patterns. • Expression patterns: You may use expression patterns to compare a given value to a given expression.
Question:- What is a Guard statement?
Answer:- If one or more requirements aren’t met, a guard statement is used to pass program control out of a domain. The advantages of guard statement are as follows: • It is another way to safely unwrap optionals • It provides an early exit • It avoids pyramids of doom
Question:- How is memory management handled on iOS?
Answer:- Memory management is crucial in any application, especially important in iOS applications due to memory and other limitations. ARC, MRC, reference forms, and value types are all included. Every iOS developer should be aware of this! Memory leaks and system crashes are all too common in iOS apps due to poor memory management.
Question:- Explain the characteristics of Android.
Answer:- Criteria • Type of operating system • OS fragmentation • Customization Characteristics • Open source • Multiple OS versions and interoperability concerns • Heightened customization possible
Question:- Why cannot you run the standard Java bytecode on Android?
Answer:- No, not necessarily. We can program Android apps using the Native Development Kit (NDK) in C/C++. The NDK is a toolset that allows us to implement parts of our app using native code languages such as C and C++. Typically, good use cases for NDK are CPU-intensive applications such as game engines, signal processing, and physics simulation.
Question:- What is a NinePatch (9-patch) image?
Answer:- It is a resizable bitmap resource that can be used for backgrounds or other images on a device. NinePatch class permits drawing a bitmap in nine sections. The 9-patch images have an extension as .9.png. It allows extensions in 9 ways, i.e., 4 corners that are unscaled, 4 edges that are scaled in 1 axis, and the middle one that can be scaled into both axes.
Question:- What is the difference between an implicit intent and an explicit intent?
Answer:- There are two types of intents: implicit intent and explicit intent. Let us see the differences between them. • Implicit intent: It is when we call system default intent like send e-mail, send SMS, or dial number. • Explicit intent: It is when we call our own application activity. We can also pass the information from one activity to another using explicit intent.
Question:- Where can you define the icon for your activity?
Answer:- The icon for an activity is defined in the manifest file. Syntax: < activity android:icon="@drawable/app_icon" android:name=".MyTestActivity">< /activity> This means that we have to open AndroidManifest.xml. Right under the root manifest node of the XML, we can see the ‘application’ node. We have added this attribute to application. (The icon in @drawable/icon refers to the file name of the icon.) android:icon="@drawable/icon"
Question:- What is ADB?
Answer:- ADB stands for Android Debug Bridge. It is a command-line tool that is used to communicate with the emulator instance. ADB can control our device over USB from a computer, copy files back and forth, install and uninstall apps, run shell commands, and more.
Question:- How many ADB components?
Answer:- It is a client–server program that includes three components: A client, which runs on our development machine. We can invoke a client from a shell by issuing an ADB command. Other Android tools such as DDMS also create ADB clients. A server, which runs as a background process on our development machine. The server manages communication between the client and the ADB daemon running on an emulator or device. A daemon, which runs as a background process on each emulator or device instance.
Question:- What are the different storage methods in Android?
Answer:- Android offers several different options for data persistence. Shared Preferences – Store private primitive data in key-value pairs. This sometimes gets limited as it offers only key-value pairs. You cannot save your own java types. Internal Storage – Store private data on the device memory.
Question:- Android offers several different options for data persistence. Shared Preferences – Store private primitive data in key-value pairs. This sometimes gets limited as it offers only key-value pairs. You cannot save your own java types. Internal Storage – Store private data on the device memory.
Answer:- In Android, an action is a description of something that an intent sender desires. Syntax: < action android:name="string" /> Contained in: < intent-filter> Description: It adds an action to an intent filter. An < intent-filter> element must contain one or more < action> elements. If it doesnt contain any, no Intent objects will get through the filter.
Question:- What is an ANR notification in Android?
Answer:- ANR is a short form for ‘Application Not Responding’. Android systems show this dialog if an application is performing too many tasks on the main thread and has been unresponsive for a long time.
Question:- Define the three key loops when monitoring an activity.
Answer:- • Entire lifetime: An activity that happens between onCreate and onDestroy • Visible lifetime: An activity that happens between onStart and onStop • Foreground lifetime: An activity that happens between onResume and onPause
