Interview Question & Answer – 7
Question Write a recursive program to count the number of “a”s in a string. Solution
Question Write a recursive program to count the number of “a”s in a string. Solution
This simple example demonstrates saving an integer value in the local shared preferences. We will use a flutter plugin called shared_preferences for this. You can read more about the plugin from here. Add Dependency First thing is to add the package to the dependencies. Go to pubspec.yaml and add the package. Example
Question Given a square matrix, calculate the absolute difference between the sums of its diagonals. For example, the square matrix is shown below: 1 2 3 4 5 6 9 8 9 Ans : | (1+5+9) – (3+5+9) | = 2. Solution
Question Alice and Bob each created one problem for our company. A reviewer rates the two challenges, awarding points on a scale from to for three categories: problem clarity, originality, and difficulty. We define the rating for Alice’s challenge to be the triplet , and the rating for Bob’s challenge to be the triplet .… Read More »
Question Lilah has a string, , of lowercase English letters that she repeated infinitely many times. Given an integer, , find and print the number of letter a’s in the first letters of Lilah’s infinite string. For example, if the string and , the substring we consider is , the first characters of her infinite… Read More »
Question Emma is playing a new mobile game that starts with consecutively numbered clouds. Some of the clouds are thunderheads and others are cumulus. She can jump on any cumulus cloud having a number that is equal to the number of the current cloud plus or . She must avoid the thunderheads. Determine the minimum… Read More »
Gary is an avid hiker. He tracks his hikes meticulously, paying close attention to small details like topography. During his last hike he took exactly steps. For every step he took, he noted if it was an uphill, , or a downhill, step. Gary’s hikes start and end at sea level and each step up… Read More »
Question John works at a clothing store. He has a large pile of socks that he must pair by color for sale. Given an array of integers representing the color of each sock, determine how many pairs of socks with matching colors there are. For example, there are socks with colors . There is one… Read More »
Watch Video Tutorial Add Dependency SQFlite is a Flutter library for doing local Database Operations. You can download it from here. To Integrate SQFlite library in your project In your flutter project add the dependency: You can download the sample project from here. employee.dart Database Utils Here is a sample DB Utility file. DBHelper.dart… Read More »
Lets see how we can test Flutter Apps. It would be easy if we continue from the previous example…
In this course we will learn how to Start with Flutter, Google’s own cross platform solution. So I am assuming that you have the flutter SDK and other stuff installed. if not please go to https://flutter.io and download it and setup. Android Studio If you are using Android Studio as your primary editor,… Read More »
Mobile user experience is not only related to design something to use on the mobile devices. It is a process that requires brainstorming, research and development to find out how you can better consider the UX and apply it in your UI. Keep in mind that the number of mobile internet users is increasing day… Read More »
Solved Yes, a longtime problem with Android has been solved. Yes, version fragmentation problem. Version fragmentation is often Android from different manufacturers had been stuck on different versions which makes it difficult for developers to support all variety of devices. Hopefully the problem is going to be solved. From Google’s perspective, an OS rollout is… Read More »
Hi friends, This is essentially a continuation of this post http://www.coderzheaven.com/2018/08/10/how-to-create-a-custom-native-imageview-in-android-for-reactnative/ Now we will listen to a click event from the image we just created. For that we have to add the ClickListener to the image in Android. Add below methods to the java class On the React Native Side The whole java class will… Read More »
We will create different styles to style different components, correct? And most of them will have duplicate elements, correct? What are the disadvantages of this problem? You will clutter your file with duplicate lines of code. It will increase the file size and increase the application size. Not very efficient way of coding. Limited reusability.… Read More »
Many times we need custom components from native. Here is a simple example on how to create a custom imageview in Android for react native. First we will start with the Android Version Android Create a class that extends SimpleViewManager. Write a setSrc method which accepts the source url from React Native. Implement ‘createViewInstance’ method… Read More »
So how do we normally monitor all the operations in a react native applications. All the networks, redux state etc. So you will need a plugin/package for this. Its called Reactotron. Here is the github page for Reactotron. What is Reactotron? A macOS, Windows, and Linux app for inspecting your React JS and React Native… Read More »
Image Loading and caching had been a little bit pain in react native. In-fact react native didn’t had native support for caching. But after the recent release, there is now support for caching in iOS only. Still not for Android. You can read more about this from here https://facebook.github.io/react-native/docs/images.html#cache-control-ios-only Now these are the variety of… Read More »
Animations are achieved in React Native using the Animation API. Below are the methods Animated.timing() — Maps time range to easing value. Animated.decay() — starts with an initial velocity and gradually slows to a stop. Animated.spring() — Simple single-spring physics model (Based on Rebound and Origami). Tracks velocity state to create fluid motions as the toValue updates, and can be chained… Read More »
Studies show that we spend more time with our mobile devices every day, either working or enjoying our leisure time. And we use apps in these devices . But what are the ones that we use the most? Sensor Tower is a company dedicated to the marketing of mobile applications, which periodically publishes a report… Read More »
The blockchain is one of the fastest-growing markets in the entire IT industry. According to the report, the global blockchain technology market is predicted to reach $2.3 billion by 2021, creating a big demand for more engineers and software developers. It obviously represents a colossal career potential for talented blockchain specialists. An average software developer… Read More »
Download our free news app and get instant news from popular news channels instantly. Get the app from here… https://play.google.com/store/apps/details?id=app.mobile.daily_news Please download and leave your valuable feedback as well. Why you will download this app? Fast and efficient. Incorporates news from all famous news channels. Consumes minimal battery. No intruding ads… Read More »
RoundRectCornerImageView Usage in XML
In this article, Lets find out how the image loading libraries like Picasso, Glide and Fresco works. We know that images are the one which takes most of the space in our application either in App size or the memory at runtime. Also using large number of images often kicks off Garbage Collection (GC) Events.… Read More »
Here is a simple example where the user clicks a button to show a Snackbar. We know that there is no inbuilt snackbar for iOS. But Flutter makes it easy to do without any custom native code. You can see a Demo video here. Here we use two main elements Scaffold Snackbar The Scaffold Widget… Read More »